Age | Commit message (Collapse) | Author |
|
Problem: Coverity reports dead code.
Solution: Remove the dead code. Also fix a mistake in ml_get_pos_len()
and update some comments (zeertzjq).
closes: #14189
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: More code can use ml_get_buf_len() instead of STRLEN().
Solution: Change more STRLEN() calls to ml_get_buf_len(). Also do not
set ml_line_textlen in ml_replace_len() if "has_props" is set,
because "len_arg" also includes the size of text properties in
that case. (zeertzjq)
closes: #14183
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: a closing fold expression may unexpectedly start a new fold
when it should end a fold
(reported by Shota Nozaki)
Solution: if a fold hasn't started yet, do not immediately
start a new fold with level 1
(Shota Nozaki)
fixes: #12768
closes: #13748
Signed-off-by: Shota Nozaki <emonkak@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Checking returned value of ga_grow() is inconsistent.
Solution: Check for FAIL instaed of "not OK". (Yegappan Lakshmanan,
closes #11897)
|
|
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes #11792)
|
|
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes #11787)
|
|
Problem: Code is indented more than needed.
Solution: Use an early return to reduce indentation. (Yegappan Lakshmanan,
closes #11769)
|
|
Problem: Evaluating "expr" options has more overhead than needed.
Solution: Use call_simple_func() for 'foldtext', 'includeexpr', 'printexpr',
"expr" of 'spellsuggest', 'diffexpr', 'patchexpr', 'balloonexpr',
'formatexpr', 'indentexpr' and 'charconvert'.
|
|
Problem: Redraw flags are not named specifically.
Solution: Prefix "UPD_" to the flags, for UPDate_screen().
|
|
Problem: Fold may not be closeable after appending.
Solution: Set the fd_small flag to MAYBE. (Brandon Simmons, closes #10471)
|
|
Problem: After deletion a small fold may be closable.
Solution: Check for a reverse range. (Brandon Simmons, closes #10457)
|
|
Problem: With 'foldmethod' "indent" some lines are not included in the
fold. (Oleg Koshovetc)
Solution: Fix it. (Brandon Simmons, closes #10399, closes #3214)
|
|
Problem: The mode #defines are not clearly named.
Solution: Prepend MODE_. Renumber them to put the mapped modes first.
|
|
Problem: Pasting text while indent folding may mess up folds.
Solution: Adjust the way folds are split. (Brandon Simmons, closes #10254)
|
|
Problem: Missing parenthesis may cause unexpected problems.
Solution: Add more parenthesis is macros. (closes #9788)
|
|
Problem: Possible number overflow with nested folds.
Solution: Avoid a negative line number.
|
|
Problem: Some type casts are redundant.
Solution: Remove the type casts. (closes #9643)
|
|
Problem: 'foldtext' is evaluated in the current script context.
Solution: Use the script context where the option was set.
|
|
Problem: Cannot use an import in 'foldexpr'.
Solution: Set the script context to where 'foldexpr' was set. (closes #9584)
Fix that the script context was not set for all buffers.
|
|
Problem: Using int for second argument of ga_init2().
Solution: Remove unnessary type cast (int) when using sizeof().
|
|
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
|
|
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
|
|
Problem: Various spelling mistakes in comments.
Solution: Fix the mistakes. (Dominique Pellé, closes #9416)
|
|
Problem: Illegal memory access if malloc() fails.
Solution: Check 'foldmethod' is not empty. (closes #9207)
|
|
Problem: Vim9: runtime and compile time type checks are not the same.
Solution: Add more runtime type checks for builtin functions. (Yegappan
Lakshmanan, closes #8646)
|
|
Problem: Error messages are spread out.
Solution: Move some error messages to errors.h. Use clearer names.
|
|
Problem: 'foldlevel' not applied to folds restored from session.
Solution: Set 'foldlevel' after creaiting the folds. (closes #7767)
|
|
Problem: Crash with a sequence of fold commands.
Solution: Bail out when there are no folds at all. Add a test (Dominique
Pellé) (closes #7515)
|
|
Problem: Crash when recreating nested fold.
Solution: Check for empty growarray. (closes #7278)
|
|
Problem: Crash when using "zj" without folds. (Sean Dewar)
Solution: Check for at least one fold. (closes #7245)
|
|
Problem: Crash when using undo after deleting folded lines.
Solution: Check for NULL pointer. (closes #6968)
|
|
Problem: Using NULL pointers in fold code.
Solution: Avoid using a NULL pointer. (Dominique Pellé, closes #6831,
closes #6831)
|
|
Problem: Using NULL pointers in some code. (James McCoy)
Solution: Avoid adding to a NULL pointer. Use byte as unsigned.
|
|
Problem: Crash in normal test.
Solution: Skip adjusting marks if there are no folds.
|
|
Problem: Crash in edit test.
Solution: Avoid using invalid pointer.
|
|
Problem: Warnings from asan with clang-11. (James McCoy)
Solution: Avoid using a NULL pointer. (issue #6811)
|
|
Problem: Vim9: leaking memory when using continuation line.
Solution: Keep a pointer to the continuation line in evalarg_T. Centralize
checking for a next command.
|
|
Problem: Using old C style comments.
Solution: Use // comments where appropriate.
|
|
Problem: Too many #ifdefs.
Solution: Graduate FEAT_COMMENTS.
|
|
Problem: Fold code is spread out.
Solution: Move fold functions to fold.c.
|
|
Problem: In diff mode global operations can be very slow.
Solution: Do not call diff_redraw() many times, call it once when redrawing.
And also don't update folds multiple times.
|
|
Problem: Ml_get error when deleting fold marker.
Solution: Check that the line number is not below the last line. Adjust the
fold when deleting the empty line. (Christian Brabandt,
closes #4834)
|
|
Problem: Using "int" for alloc() often results in compiler warnings.
Solution: Use "size_t" and remove type casts. Remove alloc_check(), Vim
only works with 32 bit ints anyway.
|
|
Problem: Too many #ifdefs.
Solution: Graduate FEAT_MBYTE, part 1.
|
|
Problem: Giving error messages is not flexible.
Solution: Add semsg(). Change argument from "char_u *" to "char *", also
for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes
#3302) Also make emsg() accept a "char *" argument. Get rid of
an enormous number of type casts.
|
|
Problem: Using 'shiftwidth' from wrong buffer for folding.
Solution: Use "buf" instead of "curbuf". (Christian Brabandt)
|
|
Problem: FEAT_WINDOWS adds a lot of #ifdefs while it is nearly always
enabled and only adds 7% to the binary size of the tiny build.
Solution: Graduate FEAT_WINDOWS.
|
|
Problem: Fold test hangs on MS-Windows.
Solution: Avoid overflow in compare.
|
|
Problem: Moving folded text is sometimes not correct.
Solution: Bail out when "move_end" is zero. (Matthew Malcomson)
|
|
Problem: Endless loop in updating folds with 32 bit ints.
Solution: Subtract from LHS instead of add to the RHS. (Matthew Malcomson)
|