diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-11-12 13:32:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-12 13:32:48 +0100 |
commit | 598f5af58b21747ea9d6dc0a7d846cb85ae52824 (patch) | |
tree | 75ce4e63e1300f33a13a607a9cc6cbb1a60b9a80 /src/nvim/ex_getln.c | |
parent | 84eed76b552405b0aef442e3eddc7f29f484b2cd (diff) | |
parent | ae9a3d3b9984ef8bf9cec1a8738f29821951c5a5 (diff) | |
download | rneovim-598f5af58b21747ea9d6dc0a7d846cb85ae52824.tar.gz rneovim-598f5af58b21747ea9d6dc0a7d846cb85ae52824.tar.bz2 rneovim-598f5af58b21747ea9d6dc0a7d846cb85ae52824.zip |
Merge #5582 from justinmk/icm
'inccommand': Support :smagic/:snomagic. Less jumping around.
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r-- | src/nvim/ex_getln.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 17693ecfc8..c4169f03f0 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -1599,6 +1599,16 @@ static int command_line_changed(CommandLineState *s) && cmd_is_live(ccline.cmdbuff)) { // process a "live" command ('inccommand') do_cmdline(ccline.cmdbuff, NULL, NULL, DOCMD_KEEPLINE|DOCMD_LIVE); + + // restore the window "view" + curwin->w_cursor = s->old_cursor; + curwin->w_curswant = s->old_curswant; + curwin->w_leftcol = s->old_leftcol; + curwin->w_topline = s->old_topline; + curwin->w_topfill = s->old_topfill; + curwin->w_botline = s->old_botline; + update_topline(); + redrawcmdline(); } @@ -5147,7 +5157,9 @@ static int ex_window(void) cmdwin_type = get_cmdline_type(); // Create empty command-line buffer. - buf_open_special(0, "[Command Line]", "nofile"); + buf_open_scratch(0, "[Command Line]"); + // Command-line buffer has bufhidden=wipe, unlike a true "scratch" buffer. + set_option_value((char_u *)"bh", 0L, (char_u *)"wipe", OPT_LOCAL); curwin->w_p_rl = cmdmsg_rl; cmdmsg_rl = false; curbuf->b_p_ma = true; |