mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
shell: Ensure silent bang mappings won't cut output
Setting `msg_didout` after `call_shell` is enough as it will cause `hit_return_msg()` to print on next line. Close #3269
This commit is contained in:
@@ -1246,8 +1246,9 @@ do_shell (
|
||||
// 1" command to the terminal.
|
||||
ui_cursor_goto(msg_row, msg_col);
|
||||
(void)call_shell(cmd, flags, NULL);
|
||||
did_check_timestamps = FALSE;
|
||||
need_check_timestamps = TRUE;
|
||||
msg_didout = true;
|
||||
did_check_timestamps = false;
|
||||
need_check_timestamps = true;
|
||||
|
||||
// put the message cursor at the end of the screen, avoids wait_return()
|
||||
// to overwrite the text that the external command showed
|
||||
|
||||
@@ -372,5 +372,6 @@ return {
|
||||
set_session = set_session,
|
||||
write_file = write_file,
|
||||
rmdir = rmdir,
|
||||
mkdir = lfs.mkdir,
|
||||
exc_exec = exc_exec,
|
||||
}
|
||||
|
||||
49
test/functional/shell/bang_filter_spec.lua
Normal file
49
test/functional/shell/bang_filter_spec.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
-- Specs for bang/filter commands
|
||||
|
||||
local helpers = require('test.functional.helpers')
|
||||
local feed, execute, clear = helpers.feed, helpers.execute, helpers.clear
|
||||
local mkdir, write_file, rmdir = helpers.mkdir, helpers.write_file, helpers.rmdir
|
||||
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
|
||||
describe('issues', function()
|
||||
local screen
|
||||
|
||||
before_each(function()
|
||||
clear()
|
||||
rmdir('bang_filter_spec')
|
||||
mkdir('bang_filter_spec')
|
||||
write_file('bang_filter_spec/f1', 'f1')
|
||||
write_file('bang_filter_spec/f2', 'f2')
|
||||
write_file('bang_filter_spec/f3', 'f3')
|
||||
screen = Screen.new()
|
||||
screen:attach()
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
rmdir('bang_filter_spec')
|
||||
end)
|
||||
|
||||
it('#3269 Last line of shell output is not truncated', function()
|
||||
execute([[nnoremap <silent>\l :!ls bang_filter_spec<cr>]])
|
||||
feed([[\l]])
|
||||
screen:expect([[
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
:!ls bang_filter_spec |
|
||||
|
|
||||
f1 |
|
||||
f2 |
|
||||
f3 |
|
||||
Press ENTER or type command to continue^ |
|
||||
]])
|
||||
end)
|
||||
|
||||
end)
|
||||
Reference in New Issue
Block a user