Age | Commit message (Collapse) | Author |
|
Problem: expand() removes a slash after an environment variable that
ends with a colon on Windows.
Solution: Check the correct char for a colon (zeertzjq)
closes: #14161
Note: Vim still removes the path-separator at the end, if another path separator
follows directly after it, e.g. on:
```
echo $FOO='/usr/'
echo expand('$FOO/bar') == '/usr/bar'
```
see:
,----[ misc1.c:1630 ]
| // if var[] ends in a path separator and tail[] starts
| // with it, skip a character
| if (after_pathsep(dst, dst + c)
| #if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA)
| && (dst == save_dst || dst[-1] != ':')
| #endif
| && vim_ispathsep(*tail))
| ++tail;
`----
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Overflow logic requires long long
Solution: Define vimlong_T data type to make life easier
for porters
closes: #13598
Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Cannot detect overstrike mode in Cmdline mode
Solution: Make mode() return "cr" for overstrike
closes: #13569
Signed-off-by: Sam-programs <None>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: INT overflow logic can be simplified
Solution: introduce trim_to_int() function
closes: #13556
Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: overflow detection not accurate when adding digits
Solution: Use a helper function
Use a helper function to better detect overflows before adding integer
digits to a long or an integer variable respectively. Signal the
overflow to the caller function.
closes: #13539
Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Michael Henry <vim@drmikehenry.com>
Signed-off-by: Ernie Rael <errael@raelity.com>
|
|
Problem: [security]: overflow in get_number
Solution: Return 0 when the count gets too large
[security]: overflow in get_number
When using the z= command, we may overflow the count with values larger
than MAX_INT. So verify that we do not overflow and in case when an
overflow is detected, simply return 0
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: mode() doesn't indicate command line for terminal
Solution: make it return 'ct' for command-line from Terminal mode
closes: #6265
closes: #13017
closes: #13018
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: h-east <h.east.727@gmail.com>
|
|
Problem: screenpos() wrong result with w_skipcol and cpoptions+=n
Solution: Use adjust_plines_for_skipcol() instead of subtracting
w_skipcol.
closes: #12625
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
|
Problem: Recent glibc marks sigset() as a deprecated.
Solution: Use sigaction() in mch_signal() if possible. (Ozaki Kiichi,
closes #12373)
|
|
Problem: Functions without arguments are not always declared properly.
Solution: Use "(void)" instead of "()". (Yegappan Lakshmanan, closes #12031)
|
|
Problem: Some settings use the current codepage instead of 'encoding'.
Solution: Adjust how options are initialized. (Ken Takata, closes #11992)
|
|
Problem: Using isalpha() adds dependency on current locale.
Solution: Do not use isalpha() for recognizing a URL or the end of an Ex
command. (closes #11835)
|
|
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes #11813)
|
|
Problem: ModeChanged autocmd not executed when Visual mode is ended with
CTRL-C.
Solution: Do not trigger the autocmd when got_int is set. (closes #11394)
|
|
Problem: Virtual text "above" does not work with 'nowrap'.
Solution: Do wrap the line after. (closes #11084)
|
|
Problem: Clearing screen causes flicker.
Solution: Do not clear but redraw in more cases. Add () to "wait_return".
|
|
Problem: Using static buffer for multiple completion functions.
Solution: Use one buffer in expand_T.
|
|
Problem: Mechanism to prevent recursive screen updating is incomplete.
Solution: Add "redraw_not_allowed" and set it in build_stl_str_hl().
(issue #10952)
|
|
Problem: Redraw flags are not named specifically.
Solution: Prefix "UPD_" to the flags, for UPDate_screen().
|
|
Problem: Cursor position wrong with wrapping virtual text in empty line.
Solution: Adjust handling of an empty line. (closes #10875)
|
|
Problem: A "below" aligned text property does not work with 'nowrap'.
Solution: Start a new screen line to display the virtual text.
(closes #10851)
|
|
Problem: Cannot show virtual text.
Solution: Initial changes for virtual text support, using text properties.
|
|
Problem: MS-Windows: tests fail if there is a stray "runtime" directory.
Solution: Only use a "runtime" directory if it contains "defaults.vim".
|
|
Problem: Tiny issues.
Solution: Tiny improvements.
|
|
Problem: Various warnings from clang on MS-Windows.
Solution: Avoid the warnings. (Yegappan Lakshmanan, closes #10553)
|
|
Problem: Various white space and cosmetic mistakes.
Solution: Change spaces to tabs, improve comments.
|
|
Problem: The mode #defines are not clearly named.
Solution: Prepend MODE_. Renumber them to put the mapped modes first.
|
|
Problem: Duplicate code.
Solution: Move code below if/else. (closes #10314)
|
|
Problem: Build failure without the +eval feature.
Solution: Use other error message. Avoid warnings.
|
|
Problem: Old Coverity warning for not checking ftell() return value.
Solution: Check return value of fseek() and ftell().
|
|
Problem: Build error without the +eval feature.
Solution: Adjust #ifdefs.
|
|
Problem: Still using cached values after unsetting some known environment
variables.
Solution: Take care of the side effects. (closes #10194)
|
|
Problem: Small pieces of dead code.
Solution: Remove the dead code. (Goc Dundar, closes #10190) Rename the
qftf_cb struct member to avoid confusion.
|
|
Problem: Using wrong flag for using bell in the terminal.
Solution: Change to use BO_TERM.
|
|
Problem: The ModeChanged autocmd event is inefficient.
Solution: Avoid allocating memory. (closes #10134) Rename
trigger_modechanged() to may_trigger_modechanged().
|
|
Problem: Some type casts are redundant.
Solution: Remove the type casts. (closes #9643)
|
|
Problem: Various code not used when features are disabled.
Solution: Add #ifdefs. (Dominique Pellé, closes #9491)
|
|
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
|
|
Problem: Error messages are spread out.
Solution: Move more errors to errors.h.
|
|
Problem: Various spelling mistakes in comments.
Solution: Fix the mistakes. (Dominique Pellé, closes #9416)
|
|
Problem: Error messages are everywhere.
Solution: Move more error messages to errors.h and adjust the names.
|
|
Problem: Screen is cleared when a FocusLost autocommand triggers.
Solution: Do not redraw when at the hit-enter or more prompt. (closes #9274)
|
|
Problem: Internal error when ModeChanged is triggered when v:event is
already in use.
Solution: Save and restore v:event if needed.
|
|
Problem: ModeChanged is not triggered on every mode change.
Solution: Also trigger on minor mode changes. (Maguns Gross, closes #8999)
|
|
Problem: Checking first character of url twice.
Solution: Only check once. (closes #9026)
|
|
Problem: Completion submode not indicated for virtual replace.
Solution: Add submode to "Rv". (closes #8945)
|
|
Problem: The ModeChanged event only uses one character for the new_mode and
old_mode values.
Solution: Pass one as first argument to mode(). (issue #8856)
|
|
Problem: Cannot distinguish Normal and Terminal-Normal mode.
Solution: Make mode() return "nt" for Terminal-Normal mode. (issue #8856)
|
|
Problem: No generic way to trigger an autocommand on mode change.
Solution: Add the ModeChanged autocommand event. (Magnus Gross, closes #8856)
|
|
Problem: mode() does not indicate using CTRL-O in Select mode.
Solution: Use "vs" and similar. (closes #8640)
|