diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2025-07-17 10:45:37 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-17 02:45:37 +0000 |
| commit | e6ce067f02ed07501093e79dc56466fada8652a1 (patch) | |
| tree | 6ce098237609fbe059ffea1ef4c7783ca833112b /runtime/syntax/python.vim | |
| parent | 8bf99ddbac68fc1809c3cfb702cf23d9a1f29e72 (diff) | |
| download | rneovim-e6ce067f02ed07501093e79dc56466fada8652a1.tar.gz rneovim-e6ce067f02ed07501093e79dc56466fada8652a1.tar.bz2 rneovim-e6ce067f02ed07501093e79dc56466fada8652a1.zip | |
vim-patch:9.1.1556: string handling in cmdexpand.c can be improved (#34966)
Problem: string handling in cmdexpand.c can be improved
Solution: Improve string manipulation in cmdexpand.c (John Marriott).
This PR does the following:
In cmdline_fuzzy_completion_supported():
- replace the series of if tests with a switch
In expand_shellcmd_onedir():
- move the code to concatenate path and pattern to expand_shellcmd().
This allows us to slightly simplify the argument list to pass the fully
pathed pattern and the length of the path in the pattern (0 if no path)
- factor out calls to STRMOVE()
In expand_shellcmd():
- factor out calls to STRMOVE() in the first for loop.
- reorganise the second for loop by:
a) only calling vim_strchr() if s is not at the end of the string
b) making sure that when the path and pattern are concatenated they fit
inside buf
c) concatenating path and pattern and pass to expand_shellcmd_onedir()
In globpath():
- slightly improve logic that determines if the complete path will fit
inside the buffer
In f_getcompletion():
- replace the series of if tests with a switch
- factor out calls to STRLEN()
In copy_substring_from_pos():
- factor out the call to STRLEN()
closes: vim/vim#17742
https://github.com/vim/vim/commit/393d398247440f7045acf703cd179ad0da148318
Co-authored-by: John Marriott <basilisk@internode.on.net>
Diffstat (limited to 'runtime/syntax/python.vim')
0 files changed, 0 insertions, 0 deletions