Skip to content

Commit

Permalink
refactor: hide stderr from Neovim
Browse files Browse the repository at this point in the history
This implements idea "3" from here:

- wincent/command-t#393 (comment)

> we may also want to swallow `stderr` so it doesn't leak back in any
> visible way (ie. that would mean changing a call to `git ...` into
> `git ... 2> /dev/null` etc). The only catch is that this may make
> trouble-shooting harder (users could edit out or change the redirect,
> I guess).

So, yeah. This is a double-edged sword, but in the next commit I am
planning on dulling at least one of those edges by implementing a
fallback behavior for each of these scanners.
  • Loading branch information
Padmamanickam authored and wincent committed Aug 31, 2022
1 parent fccc5d3 commit 17ef765
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lua/wincent/commandt/private/scanners/find.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ find.scanner = function(directory)
end
local lib = require('wincent.commandt.private.lib')
-- TODO: support max depth, dot directory filter etc
local command = 'find -L ' .. directory .. ' -type f -print0'
local command = 'find -L ' .. directory .. ' -type f -print0 2> /dev/null'
local scanner = lib.scanner_new_command(command, drop)
return scanner
end
Expand Down
1 change: 1 addition & 0 deletions lua/wincent/commandt/private/scanners/git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ git.scanner = function(directory, options)
if directory ~= '' then
command = command .. ' -- ' .. directory
end
command = command .. ' 2> /dev/null'
local scanner = lib.scanner_new_command(command)
return scanner
end
Expand Down
1 change: 1 addition & 0 deletions lua/wincent/commandt/private/scanners/rg.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ rg.scanner = function(directory)
if #directory > 0 then
command = command .. ' ' .. directory
end
command = command .. ' 2> /dev/null'
local scanner = lib.scanner_new_command(command, drop)
return scanner
end
Expand Down

0 comments on commit 17ef765

Please sign in to comment.