diff options
author | zeertzjq <zeertzjq@outlook.com> | 2021-10-04 02:53:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-03 14:53:58 -0400 |
commit | 04b59ebd851ce950340403eff019a704ecbab3f7 (patch) | |
tree | 6457d7c9189e5e20622ebf3f3f7877bc0e67ebab | |
parent | 3beea1fe1bca5b0cf3f724ab0d06a01a04652297 (diff) | |
download | rneovim-04b59ebd851ce950340403eff019a704ecbab3f7.tar.gz rneovim-04b59ebd851ce950340403eff019a704ecbab3f7.tar.bz2 rneovim-04b59ebd851ce950340403eff019a704ecbab3f7.zip |
vim-patch:8.2.3465: cannot detect insert scroll mode (#15885)
Problem: Cannot detect insert scroll mode.
Solution: Add "scroll" to complete_info(). (closes vim/vim#8943)
https://github.com/vim/vim/commit/27fef59dd1dd75f50c366f7f616ffa4451560452
-rw-r--r-- | runtime/doc/eval.txt | 2 | ||||
-rw-r--r-- | src/nvim/edit.c | 4 | ||||
-rw-r--r-- | src/nvim/testdir/test_popup.vim | 4 |
3 files changed, 8 insertions, 2 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index d6f72b68f7..d0bcbac4ee 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -3419,6 +3419,8 @@ complete_info([{what}]) *complete_info()* "" Not in completion mode "keyword" Keyword completion |i_CTRL-X_CTRL-N| "ctrl_x" Just pressed CTRL-X |i_CTRL-X| + "scroll" Scrolling with |i_CTRL-X_CTRL-E| or + |i_CTRL-X_CTRL-Y| "whole_line" Whole lines |i_CTRL-X_CTRL-L| "files" File names |i_CTRL-X_CTRL-F| "tags" Tags |i_CTRL-X_CTRL-]| diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 45edbec4a6..5ac733285d 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -116,7 +116,7 @@ static char *ctrl_x_msgs[] = static char *ctrl_x_mode_names[] = { "keyword", "ctrl_x", - "unknown", // CTRL_X_SCROLL + "scroll", "whole_line", "files", "tags", @@ -3329,7 +3329,7 @@ void get_complete_info(list_T *what_list, dict_T *retdict) // Return Insert completion mode name string static char_u *ins_compl_mode(void) { - if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET || compl_started) { + if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET || ctrl_x_mode == CTRL_X_SCROLL || compl_started) { return (char_u *)ctrl_x_mode_names[ctrl_x_mode & ~CTRL_X_WANT_IDENT]; } return (char_u *)""; diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim index 710450293c..eb367cfe5c 100644 --- a/src/nvim/testdir/test_popup.vim +++ b/src/nvim/testdir/test_popup.vim @@ -950,6 +950,10 @@ func Test_popup_complete_info_01() \ ["\<C-X>", 'ctrl_x'], \ ["\<C-X>\<C-N>", 'keyword'], \ ["\<C-X>\<C-P>", 'keyword'], + \ ["\<C-X>\<C-E>", 'scroll'], + \ ["\<C-X>\<C-Y>", 'scroll'], + \ ["\<C-X>\<C-E>\<C-E>\<C-Y>", 'scroll'], + \ ["\<C-X>\<C-Y>\<C-E>\<C-Y>", 'scroll'], \ ["\<C-X>\<C-L>", 'whole_line'], \ ["\<C-X>\<C-F>", 'files'], \ ["\<C-X>\<C-]>", 'tags'], |