Skip to content

Commit

Permalink
Load $XDG_CONFIG_HOME/ctags/*.ctags and respect XDG base directory sp…
Browse files Browse the repository at this point in the history
…ecification (close universal-ctags#89)
  • Loading branch information
itchyny committed Dec 19, 2019
1 parent e216bb4 commit 9a0c776
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ static const char *const StageDescription [] = {
[OptionLoadingStageDosCnf] = "DOS .cnf file",
[OptionLoadingStageEtc] = "file under /etc (e.g. ctags.conf)",
[OptionLoadingStageLocalEtc] = "file under /usr/local/etc (e.g. ctags.conf)",
[OptionLoadingStageXdg] = "file(s) XDG configuration directory",
[OptionLoadingStageHomeRecursive] = "file(s) under HOME",
[OptionLoadingStageCurrentRecursive] = "file(s) under the current directory",
[OptionLoadingStagePreload] = "optlib preload files",
Expand Down Expand Up @@ -3600,6 +3601,13 @@ static struct preloadPathElt preload_path_list [] = {
.stage = OptionLoadingStageCustom,
},
#endif
{
.path = "ctags",
.isDirectory = true,
.makePath = prependEnvvar,
.extra = "XDG_CONFIG_HOME",
.stage = OptionLoadingStageXdg,
},
{
.path = ".ctags.d",
.isDirectory = true,
Expand Down
1 change: 1 addition & 0 deletions main/options_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ typedef enum eOptionLoadingStage {
OptionLoadingStageDosCnf,
OptionLoadingStageEtc,
OptionLoadingStageLocalEtc,
OptionLoadingStageXdg,
OptionLoadingStageHomeRecursive,
OptionLoadingStageCurrentRecursive,
OptionLoadingStagePreload,
Expand Down

0 comments on commit 9a0c776

Please sign in to comment.