Skip to content

Commit f0bfcc8

Browse files
committed
Prevent unnecessary directory change
A directory change is unneeded if the command is vimgrep
1 parent d0490d5 commit f0bfcc8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

plugin/EasyGrep.vim

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -620,14 +620,14 @@ endfunction
620620
" }}}
621621
" ChangeDirectoryToGrepRoot {{{
622622
function! s:ChangeDirectoryToGrepRoot()
623-
if g:EasyGrepRoot != "cwd"
623+
if g:EasyGrepRoot != "cwd" && !s:IsCommandVimgrep()
624624
exe "lcd ".s:GetGrepRoot()
625625
endif
626626
endfunction
627627
" }}}
628628
" ChangeDirectoryToPrevious {{{
629629
function! s:ChangeDirectoryToPrevious()
630-
if g:EasyGrepRoot != "cwd"
630+
if g:EasyGrepRoot != "cwd" && !s:IsCommandVimgrep()
631631
lcd -
632632
endif
633633
endfunction
@@ -2416,9 +2416,6 @@ function! s:ReplaceUndo()
24162416
execute "ll ".(cc+1)
24172417
endif
24182418

2419-
" TODO: increase the granularity of the undo to be per-atom
2420-
" TODO: check that replacement is at off
2421-
24222419
let thisLine = getline(".")
24232420
let linebeg = strpart(thisLine, 0, off)
24242421
let lineend = strpart(thisLine, off)

0 commit comments

Comments
 (0)