Skip to content

Commit

Permalink
Use systemlist instead of r!
Browse files Browse the repository at this point in the history
Doesn't use a temporary file, which avoids a potential issue with the
`egrep` backend. Also doesn't show stderr to the console.
  • Loading branch information
AndrewRadev committed Jun 5, 2020
1 parent f7f76df commit 352b783
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 0 additions & 2 deletions autoload/writable_search.vim
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ function! writable_search#Rerun(...)

%delete _
call b:command.Read()
0delete _

call writable_search#Parse()
endfunction
Expand Down Expand Up @@ -221,7 +220,6 @@ function! s:Grep(query)

%delete _
call b:command.Read()
0delete _
endfunction

function! s:LastSelectedText()
Expand Down
3 changes: 2 additions & 1 deletion autoload/writable_search/command.vim
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ function! writable_search#command#Read() dict
let saved_shellredir = &shellredir
let &shellredir = substitute(&shellredir, '\V2>&1', '', 'g')

exe 'r!'.full_command
let output = systemlist(full_command)
call append(0, output)

let &shellredir = saved_shellredir
endfunction
Expand Down

0 comments on commit 352b783

Please sign in to comment.