To: vim_dev@googlegroups.com Subject: Patch 8.2.3461 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3461 Problem: Cannot distinguish Normal and Terminal-Normal mode. Solution: Make mode() return "nt" for Terminal-Normal mode. (issue #8856) Files: runtime/doc/eval.txt, src/misc1.c, src/testdir/test_functions.vim *** ../vim-8.2.3460/runtime/doc/eval.txt 2021-09-30 18:59:55.934522866 +0100 --- runtime/doc/eval.txt 2021-10-02 16:23:56.623910905 +0100 *************** *** 7987,7993 **** returned, otherwise only the first letter is returned. Also see |state()|. ! n Normal, Terminal-Normal no Operator-pending nov Operator-pending (forced characterwise |o_v|) noV Operator-pending (forced linewise |o_V|) --- 8061,8067 ---- returned, otherwise only the first letter is returned. Also see |state()|. ! n Normal no Operator-pending nov Operator-pending (forced characterwise |o_v|) noV Operator-pending (forced linewise |o_V|) *************** *** 7996,8001 **** --- 8070,8076 ---- niI Normal using |i_CTRL-O| in |Insert-mode| niR Normal using |i_CTRL-O| in |Replace-mode| niV Normal using |i_CTRL-O| in |Virtual-Replace-mode| + nt Terminal-Normal (insert goes to Terminal-Job mode) v Visual by character V Visual by line CTRL-V Visual blockwise *** ../vim-8.2.3460/src/misc1.c 2021-09-12 12:39:04.323467415 +0100 --- src/misc1.c 2021-10-02 16:27:23.480600609 +0100 *************** *** 712,717 **** --- 712,721 ---- buf[1] = 'i'; buf[2] = restart_edit; } + #ifdef FEAT_TERMINAL + else if (term_in_normal_mode()) + buf[1] = 't'; + #endif } // Clear out the minor mode when the argument is not a non-zero number or *** ../vim-8.2.3460/src/testdir/test_functions.vim 2021-09-09 19:45:30.254411571 +0100 --- src/testdir/test_functions.vim 2021-10-02 16:32:53.640138342 +0100 *************** *** 874,879 **** --- 874,887 ---- call assert_equal('c-ce', g:current_modes) " How to test Ex mode? + if has('terminal') + term + call feedkeys("\N", 'xt') + call assert_equal('n', mode()) + call assert_equal('nt', mode(1)) + call feedkeys("aexit\", 'xt') + endif + bwipe! iunmap xunmap *** ../vim-8.2.3460/src/version.c 2021-10-02 11:26:01.712790111 +0100 --- src/version.c 2021-10-02 16:25:16.125709344 +0100 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 3461, /**/ -- From "know your smileys": 8<}} Glasses, big nose, beard /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///