[RFC] Add getcmdscreenpos() and getcmdcompltype()#10344
[RFC] Add getcmdscreenpos() and getcmdcompltype()#10344Shougo wants to merge 10 commits intovim:masterfrom
Conversation
I'll give you a small hint, check Vim's declaration of |
|
Thank you. I have fixed it. But it does not fix my errors.
|
|
I have fixed the errors. |
|
Is this still WIP? |
|
From the name of the diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 6abf76706..2ad34ffcf 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -213,8 +213,8 @@ getcharmod() Number modifiers for the last typed character
getcharpos({expr}) List position of cursor, mark, etc.
getcharsearch() Dict last character search
getcharstr([expr]) String get one character from the user
-getcmdcompletion() String return the current command-line
- completion
+getcmdcompletion() String return the type of the current
+ command-line completion
getcmdline() String return the current command-line
getcmdpos() Number return cursor position in command-line
getcmdscreenpos() Number return cursor screen position in
@@ -3213,9 +3213,9 @@ getcharstr([expr]) *getcharstr()*
result is converted to a string.
getcmdcompletion() *getcmdcompletion()*
- Return the current command-line completion type. Only works
- when the command line is being edited, thus requires use of
- |c_CTRL-\_e| or |c_CTRL-R_=|.
+ Return the type of the current command-line completion.
+ Only works when the command line is being edited, thus requires
+ use of |c_CTRL-\_e| or |c_CTRL-R_=|.
See |command-completion| for the return string.
Also see |getcmdtype()|, |setcmdpos()| and |getcmdline()|.
Returns an empty string when completion is not defined.
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index c9b79e797..abcbd3453 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -976,7 +976,8 @@ Buffers, windows and the argument list:
swapname() get the swap file path of a buffer
Command line: *command-line-functions*
- getcmdcompletion() get the current command line completion
+ getcmdcompletion() get the type of the current command line
+ completion
getcmdline() get the current command line
getcmdpos() get position of the cursor in the command line
getcmdscreenpos() get screen position of the cursor in theFWIW, if it's not too late, I would also consider including "type" in the name of the function itself: I did a quick test, and both |
Sorry. It is not WIP. |
|
I have renamed the function name. |
|
When I see getcmdcmptype() I guess "cmp" stands for compare, but it means completion. |
|
OK. I have renamed. |
|
|
vim-patch:8.2.4903: cannot get the current cmdline completion type and position
Problem: Cannot get the current cmdline completion type and position.
Solution: Add getcmdcompltype() and getcmdscreenpos(). (Shougo Matsushita,
closes vim/vim#10344)
vim/vim@79d599b
vim-patch:8.2.4910: imperfect coding
Problem: Imperfect coding.
Solution: Make code nicer.
vim/vim@9ff7d71
vim-patch:8.2.4903: cannot get the current cmdline completion type and position
Problem: Cannot get the current cmdline completion type and position.
Solution: Add getcmdcompltype() and getcmdscreenpos(). (Shougo Matsushita,
closes vim/vim#10344)
vim/vim@79d599b
vim-patch:8.2.4910: imperfect coding
Problem: Imperfect coding.
Solution: Make code nicer.
vim/vim@9ff7d71
vim-patch:8.2.4903: cannot get the current cmdline completion type and position
Problem: Cannot get the current cmdline completion type and position.
Solution: Add getcmdcompltype() and getcmdscreenpos(). (Shougo Matsushita,
closes vim/vim#10344)
vim/vim@79d599b
vim-patch:8.2.4910: imperfect coding
Problem: Imperfect coding.
Solution: Make code nicer.
vim/vim@9ff7d71
vim-patch:8.2.4903: cannot get the current cmdline completion type and position
Problem: Cannot get the current cmdline completion type and position.
Solution: Add getcmdcompltype() and getcmdscreenpos(). (Shougo Matsushita,
closes vim/vim#10344)
vim/vim@79d599b
vim-patch:8.2.4910: imperfect coding
Problem: Imperfect coding.
Solution: Make code nicer.
vim/vim@9ff7d71
Hi. This is the port of neovim/neovim#18284.
It is useful for popup competion in command line mode.
getcmdscreenpos()works for me. Butgetcmdcompletion()does not work well on Vim.It works on neovim.I think the implementation is same with Vim and neovim.But the completion context seems wrong....Can you check my implementation?