diff options
-rw-r--r-- | src/nvim/ex_getln.c | 3 | ||||
-rw-r--r-- | test/functional/ex_cmds/debug_spec.lua | 110 |
2 files changed, 110 insertions, 3 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 377ca3ddbe..3eb66cd2dc 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -295,10 +295,7 @@ static uint8_t *command_line_enter(int firstc, long count, int indent) redir_off = true; // don't redirect the typed command if (!cmd_silent) { - s->i = msg_scrolled; - msg_scrolled = 0; // avoid wait_return message gotocmdline(true); - msg_scrolled += s->i; redrawcmdprompt(); // draw prompt or indent set_cmdspos(); } diff --git a/test/functional/ex_cmds/debug_spec.lua b/test/functional/ex_cmds/debug_spec.lua new file mode 100644 index 0000000000..5dad8098ea --- /dev/null +++ b/test/functional/ex_cmds/debug_spec.lua @@ -0,0 +1,110 @@ +local helpers = require('test.functional.helpers')(after_each) +local Screen = require('test.functional.ui.screen') +local feed = helpers.feed +local clear = helpers.clear + +describe(':debug', function() + local screen + before_each(function() + clear() + screen = Screen.new(50, 14) + screen:set_default_attr_ids({ + [1] = {bold = true, foreground = Screen.colors.Blue1}, + [2] = {bold = true, reverse = true}, + [3] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red}, + [4] = {bold = true, foreground = Screen.colors.SeaGreen4}, + }) + screen:attach() + end) + it('scrolls messages correctly', function() + feed(':echoerr bork<cr>') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {2: }| + {3:E121: Undefined variable: bork} | + {3:E15: Invalid expression: bork} | + {4:Press ENTER or type command to continue}^ | + ]]) + + feed(':debug echo "aa"| echo "bb"<cr>') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {2: }| + {3:E121: Undefined variable: bork} | + {3:E15: Invalid expression: bork} | + Entering Debug mode. Type "cont" to continue. | + cmd: echo "aa"| echo "bb" | + >^ | + ]]) + + feed('step<cr>') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {2: }| + {3:E121: Undefined variable: bork} | + {3:E15: Invalid expression: bork} | + Entering Debug mode. Type "cont" to continue. | + cmd: echo "aa"| echo "bb" | + >step | + aa | + cmd: echo "bb" | + >^ | + ]]) + + feed('step<cr>') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {2: }| + {3:E121: Undefined variable: bork} | + {3:E15: Invalid expression: bork} | + Entering Debug mode. Type "cont" to continue. | + cmd: echo "aa"| echo "bb" | + >step | + aa | + cmd: echo "bb" | + >step | + bb | + {4:Press ENTER or type command to continue}^ | + ]]) + + feed('<cr>') + screen:expect([[ + ^ | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + | + ]]) + end) +end) |