Problem: string_T struct could be used more often
Solution: Refactor code and make use of string_T struct
for key-value pairs, reformat overlong lines
(John Marriott)
closes: #15975
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: current command completion is a bit limited
Solution: Add the shellcmdline completion type and getmdcomplpat()
function (Ruslan Russkikh).
closes: #15823
Signed-off-by: Ruslan Russkikh <dvrussk@yandex.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: too many strlen() calls in usercmd.c
Solution: refactor code to reduce the number or strlen() calls
(John Marriott)
closes: #15516
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Keymap completion is not available
Solution: Add keymap completion (Doug Kearns)
Add keymap completion to the 'keymap' option, user commands and builtin
completion functions.
closes: #13692
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: POSIX function name in exarg struct causes issues
on OpenVMS
Solution: Rename getline member in exarg struct to ea_getline,
remove isinf() workaround for VMS
There are compilers that do not treat well POSIX functions - like
getline - usage in the structs.
Older VMS compilers could digest this... but the newer OpenVMS compilers
( like VSI C x86-64 X7.4-843 (GEM 50XB9) ) cannot deal with these
structs. This could be limited to getline() that is defined via
getdelim() and might not affect all POSIX functions in general - but
avoiding POSIX function names usage in the structs is a "safe side"
practice without compromising the functionality or the code readability.
The previous OpenVMS X86 port used a workaround limiting the compiler
capabilities using __CRTL_VER_OVERRIDE=80400000
In order to make the OpenVMS port future proof, this pull request
proposes a possible solution.
closes: #13704
Signed-off-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: no support for custom cmdline completion
Solution: Add new vimscript functions
Add the following two functions:
- getcmdcompltype() returns custom and customlist functions
- getcompletion() supports both custom and customlist
closes: #12228
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Problem: getcompletion() failes for user-defined commands
Solution: set context for completion function
closes: #12681closes: #12680
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: mapset() not properly handling script ID
Solution: replace_termcodes() may accept a script ID
closes: #12699closes: #12697
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Problem: Crash when using buffer-local user command in cmdline window.
(Karl Yngve Lervåg)
Solution: Use the right buffer to find the user command. (closes#12030,
closes#12029)
Problem: Command line completion of user command may have duplicates.
(Dani Dickstein)
Solution: Skip global user command if an identical buffer-local one is
defined. (closes#10797)
Problem: Cannot get the current cmdline completion type and position.
Solution: Add getcmdcompltype() and getcmdscreenpos(). (Shougo Matsushita,
closes#10344)
Problem: Vim9: Declarations in a {} block of a user command do not use Vim9
rules if defined in a legacy script. (Yegappan Lakshmanan)
Solution: Pretend the script is Vim9 script.
Problem: No command line completion for :breakadd and :breakdel.
Solution: Add completion for :breakadd and :breakdel. (Yegappan Lakshmanan,
closes#9950)
Problem: Some command completion functions are too long.
Solution: Refactor code into separate functions. Add a few more tests.
(Yegappan Lakshmanan, closes#9785)
Problem: Keeping track of allocated lines in user functions is too
complicated.
Solution: Instead of freeing individual lines keep them all until the end.
Problem: Using freed memory when defining a user command from a user
command.
Solution: Do not use the command pointer after executing the command.
(closes#9318)
Problem: Command completion in cmdline window uses global user commands,
not local commands for the window where it was opened from.
Solution: Use local commands. (closes#9168)
Problem: "verbose set efm" reports the location of the :compiler command.
(Gary Johnson)
Solution: Add the "-keepscript" argument to :command and use it when
defining CompilerSet.
Problem: fullcommand() gives the wrong name if there is a buffer-local user
command. (Naohiro Ono)
Solution: Use a separate function to get the user command name.
(closes#8840)
Problem: Some plugins have a problem with the error check for using
:command with -complete but without -nargs.
Solution: In legacy script only give a warning message.