To: vim_dev@googlegroups.com Subject: Patch 8.1.2121 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.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) Files: src/window.c, src/testdir/test_window_cmd.vim *** ../vim-8.1.2120/src/window.c 2019-09-21 20:46:14.732275724 +0200 --- src/window.c 2019-10-07 22:24:33.656300676 +0200 *************** *** 4654,4659 **** --- 4654,4662 ---- 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 */ *** ../vim-8.1.2120/src/testdir/test_window_cmd.vim 2019-09-10 21:22:54.876629189 +0200 --- src/testdir/test_window_cmd.vim 2019-10-07 22:22:43.084851339 +0200 *************** *** 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,562 **** --- 559,591 ---- 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\", '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("\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 *** ../vim-8.1.2120/src/version.c 2019-10-06 22:00:08.301244080 +0200 --- src/version.c 2019-10-07 22:27:08.279531916 +0200 *************** *** 755,756 **** --- 755,758 ---- { /* Add new patch number below this line */ + /**/ + 2121, /**/ -- An indication you must be a manager: You feel sorry for Dilbert's boss. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///