h-east / vim Goto Github PK
View Code? Open in Web Editor NEWThis project forked from vim/vim
Vim-CLPUM
Home Page: http://h-east.github.io/vim/
License: Vim License
This project forked from vim/vim
Vim-CLPUM
Home Page: http://h-east.github.io/vim/
License: Vim License
&conceallevel > 0
の状態で cursorline
, cursorcolumn
, relativenumber
のいずれかを設定すると、
<C-D>
で CLPUM が表示されないことがあります。
[repro steps]
vimrc
:
if exists('+clpum')
set clpum
set clpumheight=40
set clcompleteopt+=noinsert
endif
set cole=1 cul
vim -u vimrc -N
:set <C-D>
expected: CLPUM が表示される
actual: CLPUM が表示されない
内部的には処理が実行されているので、<C-N>
等で候補選択すると CLPUM が表示されます。
[investigation]
Line 1196 in 60422e6
&conceallevel > 0
のとき conceal_update_lines = TRUE
Line 1299 in 60422e6
curwin->w_valid &= ~VALID_CROW
となる
Line 970 in 60422e6
Line 795 in 60422e6
curs_columns
> curs_rows
> redraw_for_cursorline
と呼ばれ、
Line 145 in 60422e6
cursorline
, relativenumber
がセットされていると redraw_win_later(wp, SOME_VALID)
が呼ばれるため、この後の再描画で CLPUM が消去されてしまいます。
[solution proposal]
Line 142 in 60422e6
Line 824 in 60422e6
Line 1197 in 60422e6
上記箇所の判定に && !clpum_visible()
を追加することで領域の再描画を回避できました。
$ vim -Nu NONE -c "set wmnu wim=popup"
typed
:set <Tab><C-R>=
Actual behavior:
How to reproduce:
Expected behavior:
Actual behavior:
https://groups.google.com/d/msg/vim_dev/E3zq6C_b23k/sEmckDA9AwAJ
Now behavior:
- When 'clpum' option is on.
- `<TAB>` behavior:
When not started CLPUM, conform to 'wildmenu' and 'wildmode'.
When started CLPUM, Use the next match. This match replaces the previous one.
- `<C-D>` behavior:
When not started CLPUM, CLPUM is triggered.
When started CLPUM, Use the next match. This match replaces the previous one.
I'll change to the following behavior.
- When 'clpum' option is on.
- `<TAB>` and `<C-D>` behavior:
When not started CLPUM, CLPUM is triggered.
When started CLPUM, Use the next match. This match replaces the previous one.
Hi!
Thanks for making this patch, I hope it gets included in Vim.
When popup menu is overlapping terminal window it is not cleared when closed. The issue and a fix are both related to vim#2908
diff --git a/src/clpum.c b/src/clpum.c
index 22ec3a487..c8b7025e2 100644
--- a/src/clpum.c
+++ b/src/clpum.c
@@ -394,7 +394,7 @@ clpum_undisplay(void)
//FreeWild(clpum_size, clpum_array);
clpum_array = NULL;
//clpum_size = -1;
- redraw_all_later(SOME_VALID);
+ redraw_all_later(NOT_VALID);
#ifdef FEAT_WINDOWS
redraw_tabline = TRUE;
#endif
How to reproduce:
$ vim -N -u NONE -c "set clpum"
:set <C-D>
Continue to press the <C-D>.
$vim -Nu NONE -c "set wmnu wim=popup"
:set <TAB>
A popup menu is displayed and command-line stay :set
. Because option clcot
default value is "menuone,noinsert".
A popup menu is displayed and command-line completed to :set all
. Unexpected completion.
in Vim clone directory (:cd vim/src)
$ vim -Nu NONE -c "set wmnu wim=popup clcot=menu,noinsert"
:cd <TAB>↑↑↑↑
→↓↓↓↓
→
When command-line cursor position + complete item length > Columns in CLPUM, command-line and last line message become scramble.
How to reproduce:
$ ./vim -N -u NONE -c "set clpum ch=2"
:set w
:set
+ 75 spaces + w
)<C-D>
Expected behaivior:
Actual behaivior:
input() 関数を第3引数つき(補完つき)で呼び出すと、補完を開始したタイミングで落ちます。
gvim -N -u NONE または vim -N -u NONE
で起動した後、
以下のスクリプトを読み込みます(cmdlineから入力しても再現可能)
set wildmenu wildmode=popup
call input('', '', 'option')
<TAB>
を何度か叩きます。
With the following settings:
set wildmode=popup
set wildmenu
set clcompleteopt=menu
Enter:
:colorsch
<tab>
<c-y>
^Y
is inserted.The following is what fixed it for me.
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 6b19c8c8c..0673418b6 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -8969,8 +8969,7 @@ clpum_compl_prep(int c)
* the selection without inserting anything. When
* clpum_compl_enter_selects is set the Enter key does the same. */
if ((c == Ctrl_Y || (clpum_compl_enter_selects
- && (c == CAR || c == K_KENTER || c == NL)))
- && clpum_visible())
+ && (c == CAR || c == K_KENTER || c == NL))))
retval = TRUE;
/* CTRL-E means completion is Ended, go back to the typed text. */
SEGV occurs when using <C-R>=
expansion.
[environment]
Vim 7.4.1832 on Ubuntu 16.04
[repro steps]
$ cat test.vim
if has('clpum')
set wildmode=popup
set wildmenu
endif
$ vim -Nu NONE -S test.vim
input keys,
:<C-R>=<CR><TAB>
and SEGV occurs.
[cause]
stacktrace.1 (when expansion)
#0 getcmdline (firstc=61, count=0, indent=0) at ex_getln.c:387
#1 0x000000000050c053 in get_expr_register () at ops.c:784
#2 0x00000000004897e5 in getcmdline (firstc=58, count=1, indent=0) at ex_getln.c:1454
#3 0x000000000048b05b in getexline (c=58, cookie=0x0, indent=0) at ex_getln.c:2497
#4 0x0000000000470d4c in do_cmdline (cmdline=0x0, fgetline=0x48b01e <getexline>, cookie=0x0, flags=0) at ex_docmd.c:1003
#5 0x0000000000503254 in nv_colon (cap=0x7fff060f2710) at normal.c:5320
#6 0x00000000004fc5ff in normal_cmd (oap=0x7fff060f27a0, toplevel=1) at normal.c:1149
#7 0x00000000005ec25c in main_loop (cmdwin=0, noexmode=0) at main.c:1359
#8 0x00000000005ebc4c in main (argc=7, argv=0x7fff060f2a88) at main.c:1051
stacktrace.2 (received SEGV)
#0 0x000000000048d962 in ExpandInit (xp=0x0) at ex_getln.c:4103
#1 0x0000000000475435 in set_one_cmd_context (xp=0x0, buff=0xc44940 "edit ") at ex_docmd.c:3422
#2 0x000000000048eacc in set_cmd_context (xp=0x0, str=0xc44940 "edit ", len=5, col=5) at ex_getln.c:4784
#3 0x0000000000496643 in clpum_complete (c=9) at ex_getln.c:8866
#4 0x00000000004889a7 in getcmdline (firstc=58, count=1, indent=0) at ex_getln.c:1102
#5 0x000000000048b05b in getexline (c=58, cookie=0x0, indent=0) at ex_getln.c:2497
#6 0x0000000000470d4c in do_cmdline (cmdline=0x0, fgetline=0x48b01e <getexline>, cookie=0x0, flags=0) at ex_docmd.c:1003
#7 0x0000000000503254 in nv_colon (cap=0x7fff060f2710) at normal.c:5320
#8 0x00000000004fc5ff in normal_cmd (oap=0x7fff060f27a0, toplevel=1) at normal.c:1149
#9 0x00000000005ec25c in main_loop (cmdwin=0, noexmode=0) at main.c:1359
#10 0x00000000005ebc4c in main (argc=7, argv=0x7fff060f2a88) at main.c:1051
It nests getcmdline
, so clpum_compl_xp
points NULL
when entering clpum_complete
.
getcmdline # L383: set clpum_compl_xp to &xpc
__get_expr_register
____getcmdline # L383: set clpum_compl_xp to &xpc
# and L2218: set clpum_compl_xp to NULL
__clpum_complete # clpum_compl_xp is NULL
How to reproduce:
$ vim -Nu NONE -c 'set clpum clcot=menu,noinsert'
:set clcot=<TAB>
Expected behavior:
menu,noinsert
is complemented.
Actual behavior:
Nothing complemented.
Remarks:
It is complemented with the use of the <C-D>
instead of <TAB>
.
I checked by CUI Vim 7.4.1290 on fedora Linux.
I'll rename to popup
.
Are you OK?
How to reproduce:
Expected behavior:
Actual behavior:
With vim --clean
, Shift-Tab in command-line completes the last filename.
I want clpum to show popup even when pressing Shift-Tab.
Sorry, I tried this only in CUI Vim.
vimrc
set wildmode=popup
set wildmenu
set clpumheight=40
vim --clean -S clpum.vim
:e <S-Tab>
It does not show popup.
It works the same as plain vim behavior.
WSL Debian 9.5
Microsoft Windows 10 Pro 64bit 10.0.17134
How to reproduce:
$ vim -N -u NONE -c "set clpum"
:abcde<C-B>set w
<Tab><Tab>
<C-E>
Expected behavior:
|
is cursor):set w|abcde
Actual behavior:
abcde
gone?:set w|
Thing like 'pumwidth'.
The first item bar
is selected in completion menu, but not inserted to command-line
when pressing <Tab>
to complete file paths.
set wildmode=popup
set wildmenu
set clpumheight=40
$ ls -1 tmp
bar
baz
foo
vim --clean -S clpum.vim
:e tmp/<Tab>
It shows bar
, baz
, foo
in completion menu, and the first item bar
is selected.
But bar
is not inserted to command-line.
So the next <Tab>
selects and inserts the second item baz
not the first item bar
.
Add built-in function clcomplete(), clcomplete_add() and clcomplete_check() instead of complete(), complete_add() and complete_check().
--with-features=small
and --with-features=tiny
build fails.
Hoe to reproduce:
$ vim -N -u NONE -c "set clpum"
:<C-X>
Expected behavior:
E764: Option 'clcompletefunc' is not set
Actual behavior:
Because the same function is present longest
in the 'wildmenu' option.
The last line message (e.g. -- Command-line mode completion (^D^N^P) match 1 of 363
) disappear.
In case of Windows (build by MSYS2):
./gvimd.exe -Nu NONE -c "set wmnu wim=popup ch=2"
:set
:set termcap_
(_
is cursor)
:set _
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.