diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-10-07 22:27:36 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-10-07 22:27:36 +0200 |
commit | a27e1dcddc9e3914ab34b164f71c51b72903b00b (patch) | |
tree | a937e011929bcc61facb08dcf272074ddeb8f806 /src | |
parent | 1614a14901558ca091329315d14a7d5e1b53aa47 (diff) | |
download | vim-git-a27e1dcddc9e3914ab34b164f71c51b72903b00b.tar.gz |
patch 8.1.2121: mode is not updated when switching to terminalv8.1.2121
Problem: Mode is not updated when switching to terminal in Insert mode.
Solution: Redraw the mode when entering a terminal window. (Jason Franklin)
Diffstat (limited to 'src')
-rw-r--r-- | src/testdir/test_window_cmd.vim | 29 | ||||
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/window.c | 3 |
3 files changed, 34 insertions, 0 deletions
diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim index ffe8f431d..d958c3697 100644 --- a/src/testdir/test_window_cmd.vim +++ b/src/testdir/test_window_cmd.vim @@ -1,5 +1,7 @@ " Tests for window cmd (:wincmd, :split, :vsplit, :resize and etc...) +so check.vim + func Test_window_cmd_ls0_with_split() set ls=0 set splitbelow @@ -557,6 +559,33 @@ func Test_access_freed_mem() call assert_equal(&columns, winwidth(0)) endfunc +func Test_insert_cleared_on_switch_to_term() + CheckFeature terminal + + set showmode + terminal + wincmd p + + call feedkeys("i\<C-O>", 'ntx') + redraw + + " The "-- (insert) --" indicator should be visible. + let chars = map(range(1, &columns), 'nr2char(screenchar(&lines, v:val))') + let str = trim(join(chars, '')) + call assert_equal('-- (insert) --', str) + + call feedkeys("\<C-W>p", 'ntx') + redraw + + " The "-- (insert) --" indicator should have been cleared. + let chars = map(range(1, &columns), 'nr2char(screenchar(&lines, v:val))') + let str = trim(join(chars, '')) + call assert_equal('', str) + + set showmode& + %bw! +endfunc + func Test_visual_cleared_after_window_split() new | only! let smd_save = &showmode diff --git a/src/version.c b/src/version.c index f668b9704..f4d027534 100644 --- a/src/version.c +++ b/src/version.c @@ -754,6 +754,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2121, +/**/ 2120, /**/ 2119, diff --git a/src/window.c b/src/window.c index 6416e0187..6174c02fd 100644 --- a/src/window.c +++ b/src/window.c @@ -4654,6 +4654,9 @@ win_enter_ext( maketitle(); #endif curwin->w_redr_status = TRUE; + if (bt_terminal(wp->w_buffer)) + // terminal is likely in another mode + redraw_mode = TRUE; redraw_tabline = TRUE; if (restart_edit) redraw_later(VALID); /* causes status line redraw */ |