summaryrefslogtreecommitdiffstats
path: root/src/fold.c
AgeCommit message (Collapse)Author
2024-03-13patch 9.1.0177: Coverity reports dead codev9.1.0177zeertzjq
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>
2024-03-12patch 9.1.0172: More code can use ml_get_buf_len() instead of STRLEN()v9.1.0172zeertzjq
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>
2024-01-03patch 9.1.0002: a closing fold expr, may start a new foldv9.1.0002Shota Nozaki
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>
2023-01-27patch 9.0.1251: checking returned value of ga_grow() is inconsistentv9.0.1251Yegappan Lakshmanan
Problem: Checking returned value of ga_grow() is inconsistent. Solution: Check for FAIL instaed of "not OK". (Yegappan Lakshmanan, closes #11897)
2023-01-09patch 9.0.1166: code is indented more than necessaryv9.0.1166Yegappan Lakshmanan
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes #11792)
2023-01-08patch 9.0.1158: code is indented more than necessaryv9.0.1158Yegappan Lakshmanan
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes #11787)
2023-01-02patch 9.0.1132: code is indented more than neededv9.0.1132Yegappan Lakshmanan
Problem: Code is indented more than needed. Solution: Use an early return to reduce indentation. (Yegappan Lakshmanan, closes #11769)
2022-10-01patch 9.0.0634: evaluating "expr" options has more overhead than neededv9.0.0634Bram Moolenaar
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'.
2022-08-14patch 9.0.0206: redraw flags are not named specificallyv9.0.0206Bram Moolenaar
Problem: Redraw flags are not named specifically. Solution: Prefix "UPD_" to the flags, for UPDate_screen().
2022-05-23patch 8.2.5009: fold may not be closeable after appendingv8.2.5009Brandon Simmons
Problem: Fold may not be closeable after appending. Solution: Set the fd_small flag to MAYBE. (Brandon Simmons, closes #10471)
2022-05-20patch 8.2.4987: after deletion a small fold may be closablev8.2.4987Brandon Simmons
Problem: After deletion a small fold may be closable. Solution: Check for a reverse range. (Brandon Simmons, closes #10457)
2022-05-10patch 8.2.4935: with 'foldmethod' "indent" some lines not included in foldv8.2.4935Brandon Simmons
Problem: With 'foldmethod' "indent" some lines are not included in the fold. (Oleg Koshovetc) Solution: Fix it. (Brandon Simmons, closes #10399, closes #3214)
2022-05-07patch 8.2.4911: the mode #defines are not clearly namedv8.2.4911Bram Moolenaar
Problem: The mode #defines are not clearly named. Solution: Prepend MODE_. Renumber them to put the mapped modes first.
2022-04-23patch 8.2.4813: pasting text while indent folding may mess up foldsv8.2.4813Brandon Simmons
Problem: Pasting text while indent folding may mess up folds. Solution: Adjust the way folds are split. (Brandon Simmons, closes #10254)
2022-02-16patch 8.2.4402: missing parenthesis may cause unexpected problemsv8.2.4402kylo252
Problem: Missing parenthesis may cause unexpected problems. Solution: Add more parenthesis is macros. (closes #9788)
2022-02-15patch 8.2.4393: possible number overflow with nested foldsv8.2.4393Bram Moolenaar
Problem: Possible number overflow with nested folds. Solution: Avoid a negative line number.
2022-01-28patch 8.2.4241: some type casts are redundantv8.2.4241=?UTF-8?q?Dundar=20G=C3=B6c?=
Problem: Some type casts are redundant. Solution: Remove the type casts. (closes #9643)
2022-01-22patch 8.2.4179: 'foldtext' is evaluated in the current script contextv8.2.4179Bram Moolenaar
Problem: 'foldtext' is evaluated in the current script context. Solution: Use the script context where the option was set.
2022-01-21patch 8.2.4173: cannot use an import in 'foldexpr'v8.2.4173Bram Moolenaar
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.
2022-01-08patch 8.2.4043: using int for second argument of ga_init2()v8.2.4043Bram Moolenaar
Problem: Using int for second argument of ga_init2(). Solution: Remove unnessary type cast (int) when using sizeof().
2022-01-02patch 8.2.3986: error messages are spread outv8.2.3986Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more error messages to errors.h.
2022-01-02patch 8.2.3985: error messages are spread outv8.2.3985Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more error messages to errors.h.
2021-12-27patch 8.2.3914: various spelling mistakes in commentsv8.2.3914Dominique Pelle
Problem: Various spelling mistakes in comments. Solution: Fix the mistakes. (Dominique Pellé, closes #9416)
2021-11-24patch 8.2.3662: illegal memory access if malloc() failsv8.2.3662Bram Moolenaar
Problem: Illegal memory access if malloc() fails. Solution: Check 'foldmethod' is not empty. (closes #9207)
2021-07-27patch 8.2.3229: Vim9: runtime and compile time type checks are not the samev8.2.3229Yegappan Lakshmanan
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)
2021-06-27patch 8.2.3069: error messages are spread outv8.2.3069Bram Moolenaar
Problem: Error messages are spread out. Solution: Move some error messages to errors.h. Use clearer names.
2021-02-01patch 8.2.2447: 'foldlevel' not applied to folds restored from sessionv8.2.2447Bram Moolenaar
Problem: 'foldlevel' not applied to folds restored from session. Solution: Set 'foldlevel' after creaiting the folds. (closes #7767)
2020-12-21patch 8.2.2176: crash with a sequence of fold commandsv8.2.2176Bram Moolenaar
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)
2020-11-10patch 8.2.1972: crash when recreating nested foldv8.2.1972Bram Moolenaar
Problem: Crash when recreating nested fold. Solution: Check for empty growarray. (closes #7278)
2020-11-03patch 8.2.1947: crash when using "zj" without foldsv8.2.1947Bram Moolenaar
Problem: Crash when using "zj" without folds. (Sean Dewar) Solution: Check for at least one fold. (closes #7245)
2020-09-17patch 8.2.1702: crash when using undo after deleting folded linesv8.2.1702Bram Moolenaar
Problem: Crash when using undo after deleting folded lines. Solution: Check for NULL pointer. (closes #6968)
2020-09-01patch 8.2.1561: using NULL pointers in fold codev8.2.1561Bram Moolenaar
Problem: Using NULL pointers in fold code. Solution: Avoid using a NULL pointer. (Dominique Pellé, closes #6831, closes #6831)
2020-09-01patch 8.2.1560: using NULL pointers in some codev8.2.1560Bram Moolenaar
Problem: Using NULL pointers in some code. (James McCoy) Solution: Avoid adding to a NULL pointer. Use byte as unsigned.
2020-08-31patch 8.2.1554: crash in normal testv8.2.1554Bram Moolenaar
Problem: Crash in normal test. Solution: Skip adjusting marks if there are no folds.
2020-08-31patch 8.2.1553: crash in edit testv8.2.1553Bram Moolenaar
Problem: Crash in edit test. Solution: Avoid using invalid pointer.
2020-08-31patch 8.2.1552: warnings from asan with clang-11v8.2.1552Bram Moolenaar
Problem: Warnings from asan with clang-11. (James McCoy) Solution: Avoid using a NULL pointer. (issue #6811)
2020-06-24patch 8.2.1049: Vim9: leaking memory when using continuation linev8.2.1049Bram Moolenaar
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.
2019-12-01patch 8.1.2379: using old C style commentsv8.1.2379Bram Moolenaar
Problem: Using old C style comments. Solution: Use // comments where appropriate.
2019-09-28patch 8.1.2096: too many #ifdefsv8.1.2096Bram Moolenaar
Problem: Too many #ifdefs. Solution: Graduate FEAT_COMMENTS.
2019-09-01patch 8.1.1960: fold code is spread outv8.1.1960Bram Moolenaar
Problem: Fold code is spread out. Solution: Move fold functions to fold.c.
2019-08-24patch 8.1.1922: in diff mode global operations can be very slowv8.1.1922Bram Moolenaar
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.
2019-08-19patch 8.1.1890: ml_get error when deleting fold markerv8.1.1890Bram Moolenaar
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)
2019-05-24patch 8.1.1384: using "int" for alloc() often results in compiler warningsv8.1.1384Bram Moolenaar
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.
2019-01-24patch 8.1.0805: too many #ifdefsv8.1.0805Bram Moolenaar
Problem: Too many #ifdefs. Solution: Graduate FEAT_MBYTE, part 1.
2019-01-13patch 8.1.0743: giving error messages is not flexiblev8.1.0743Bram Moolenaar
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.
2018-11-14patch 8.1.0527: using 'shiftwidth' from wrong buffer for foldingv8.1.0527Bram Moolenaar
Problem: Using 'shiftwidth' from wrong buffer for folding. Solution: Use "buf" instead of "curbuf". (Christian Brabandt)
2017-09-16patch 8.0.1118: FEAT_WINDOWS adds a lot of #ifdefsv8.0.1118Bram Moolenaar
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.
2017-04-23patch 8.0.0583: fold test hangs on MS-Windowsv8.0.0583Bram Moolenaar
Problem: Fold test hangs on MS-Windows. Solution: Avoid overflow in compare.
2017-04-22patch 8.0.0581: moving folded text is sometimes not correctv8.0.0581Bram Moolenaar
Problem: Moving folded text is sometimes not correct. Solution: Bail out when "move_end" is zero. (Matthew Malcomson)
2017-03-23patch 8.0.0503: endless loop in updating folds with 32 bit intsv8.0.0503Bram Moolenaar
Problem: Endless loop in updating folds with 32 bit ints. Solution: Subtract from LHS instead of add to the RHS. (Matthew Malcomson)