From d4b12eaf84c4a3079b6228769ee9ad2380bd42b3 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 27 Dec 2022 07:51:35 -0500 Subject: [PATCH] Don't override 'tags' without "./tags" References: https://github.com/tpope/vim-sensible/issues/94 --- plugin/sensible.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/sensible.vim b/plugin/sensible.vim index 889edb8..d122a9b 100644 --- a/plugin/sensible.vim +++ b/plugin/sensible.vim @@ -58,7 +58,9 @@ if v:version > 703 || v:version == 703 && has("patch541") set formatoptions+=j " Delete comment character when joining commented lines endif -if has('path_extra') +" Replace the check for a tags file in the parent directory of the current +" file with a check in every ancestor directory. +if has('path_extra') && (',' . &g:tags . ',') =~# ',\./tags,' setglobal tags-=./tags tags-=./tags; tags^=./tags; endif