diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-04-20 21:31:56 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-04-20 21:31:56 +0200 |
| commit | 348eb8074fe0d314ca08fa39f4584019621e3f92 (patch) | |
| tree | 263918474b6f832479be27ed5ae1e5908b0801f8 /vis-lua.c | |
| parent | aaefca67b304688efb0f4c893aab469d61f8f0bf (diff) | |
| download | vis-348eb8074fe0d314ca08fa39f4584019621e3f92.tar.gz vis-348eb8074fe0d314ca08fa39f4584019621e3f92.tar.xz | |
vis-lua: load files from directory specified with ./configure --sharedir=DIR
Close #231
Diffstat (limited to 'vis-lua.c')
| -rw-r--r-- | vis-lua.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -11,6 +11,10 @@ #include "vis-core.h" #include "text-motions.h" +#ifndef VIS_PATH +#define VIS_PATH "/usr/local/share/vis" +#endif + #if !CONFIG_LUA void vis_lua_init(Vis *vis) { } @@ -985,14 +989,12 @@ void vis_lua_init(Vis *vis) { * - $VIS_PATH/{,lexers} * - {,lexers} relative to the binary location * - $XDG_CONFIG_HOME/vis/{,lexers} (defaulting to $HOME/.config/vis/{,lexers}) - * - /usr/local/share/vis/{,lexers} - * - /usr/share/vis/{,lexers} + * - /usr/local/share/vis/{,lexers} (or whatever is specified during ./configure) * - package.path (standard lua search path) */ char path[PATH_MAX]; - vis_lua_path_add(vis, "/usr/share/vis"); - vis_lua_path_add(vis, "/usr/local/share/vis"); + vis_lua_path_add(vis, VIS_PATH); /* try to get users home directory */ const char *home = getenv("HOME"); |
