summaryrefslogtreecommitdiffstats
path: root/src/indent.c
AgeCommit message (Collapse)Author
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-02-12patch 9.1.0103: 'breakindentopt' "min" not correct with 'signcolumn'v9.1.0103zeertzjq
Problem: 'breakindentopt' "min" works incorrectly with 'signcolumn'. Solution: Use win_col_off() and win_col_off2(). (zeertzjq) closes: #14014 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-11patch 9.1.0097: 'breakindent' behaves inconsistently with 'list' and splitsv9.1.0097zeertzjq
Problem: 'breakindent' behaves inconsistently with 'list' and splits. Solution: Use 'listchars' from the correct window and handle caching properly. Move cheaper comparisons to the top. (zeertzjq) closes: #14008 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-29patch 9.0.1958: cannot complete option valuesv9.0.1958Yee Cheng Chin
Problem: cannot complete option values Solution: Add completion functions for several options Add cmdline tab-completion for setting string options Add tab-completion for setting string options on the cmdline using `:set=` (along with `:set+=` and `:set-=`). The existing tab completion for setting options currently only works when nothing is typed yet, and it only fills in with the existing value, e.g. when the user does `:set diffopt=<Tab>` it will be completed to `set diffopt=internal,filler,closeoff` and nothing else. This isn't too useful as a user usually wants auto-complete to suggest all the possible values, such as 'iblank', or 'algorithm:patience'. For set= and set+=, this adds a new optional callback function for each option that can be invoked when doing completion. This allows for each option to have control over how completion works. For example, in 'diffopt', it will suggest the default enumeration, but if `algorithm:` is selected, it will further suggest different algorithm types like 'meyers' and 'patience'. When using set=, the existing option value will be filled in as the first choice to preserve the existing behavior. When using set+= this won't happen as it doesn't make sense. For flag list options (e.g. 'mouse' and 'guioptions'), completion will take into account existing typed values (and in the case of set+=, the existing option value) to make sure it doesn't suggest duplicates. For set-=, there is a new `ExpandSettingSubtract` function which will handle flag list and comma-separated options smartly, by only suggesting values that currently exist in the option. Note that Vim has some existing code that adds special handling for 'filetype', 'syntax', and misc dir options like 'backupdir'. This change preserves them as they already work, instead of converting to the new callback API for each option. closes: #13182 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-03-07patch 9.0.1391: "clear" macros are not always usedv9.0.1391Yegappan Lakshmanan
Problem: "clear" macros are not always used. Solution: Use ALLOC_ONE, VIM_CLEAR, CLEAR_POINTER and CLEAR_FIELD in more places. (Yegappan Lakshmanan, closes #12104)
2023-02-21patch 9.0.1336: functions without arguments are not always declared properlyv9.0.1336Yegappan Lakshmanan
Problem: Functions without arguments are not always declared properly. Solution: Use "(void)" instead of "()". (Yegappan Lakshmanan, closes #12031)
2023-01-12patch 9.0.1183: code is indented more than necessaryv9.0.1183Yegappan Lakshmanan
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes #11805)
2022-12-19patch 9.0.1078: with the +vartabs feature indent folding may use wrong 'ts'v9.0.1078zeertzjq
Problem: With the +vartabs feature indent folding may use wrong 'tabstop'. Solution: Use the "buf" argument instead of "curbuf".
2022-10-15patch 9.0.0761: cannot use 'indentexpr' for Lisp indentingv9.0.0761Bram Moolenaar
Problem: Cannot use 'indentexpr' for Lisp indenting. Solution: Add the 'lispoptions' option.
2022-10-13patch 9.0.0737: Lisp word only recognized when a space followsv9.0.0737Bram Moolenaar
Problem: Lisp word only recognized when a space follows. Solution: Also match a word at the end of a line. Rename the test. Use a compiled function to avoid backslashes.
2022-10-01patch 9.0.0635: build error and compiler warningsv9.0.0635Bram Moolenaar
Problem: Build error and compiler warnings. Solution: Add missing change. Add type casts.
2022-09-14patch 9.0.0464: with virtual text "above" indenting doesn't work wellv9.0.0464Bram Moolenaar
Problem: With virtual text "above" indenting doesn't work well. Solution: Ignore text properties while adjusting indent. (issue #11084)
2022-09-02patch 9.0.0358: 'breakindent' does not indent non-listsv9.0.0358Maxim Kim
Problem: 'breakindent' does not indent non-lists with "breakindentopt=list:-1". Solution: Adjust indent computation. (Maxim Kim, closes #11038)
2022-08-15patch 9.0.0215: not passing APC_INDENT flagv9.0.0215Bram Moolenaar
Problem: Not passing APC_INDENT flag. Solution: Pass the flag where it's needed.
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-07-25patch 9.0.0067: cannot show virtual textv9.0.0067Bram Moolenaar
Problem: Cannot show virtual text. Solution: Initial changes for virtual text support, using text properties.
2022-07-01patch 9.0.0016: comparing line pointer for 'breakindent' is not reliablev9.0.0016Bram Moolenaar
Problem: Comparing line pointer for 'breakindent' is not reliable. Solution: Make a copy of the line.
2022-06-22patch 8.2.5151: reading beyond the end of the line with lisp indentingv8.2.5151Bram Moolenaar
Problem: Reading beyond the end of the line with lisp indenting. Solution: Avoid going over the NUL at the end of the line.
2022-06-18patch 8.2.5122: lisp indenting my run over the end of the linev8.2.5122Bram Moolenaar
Problem: Lisp indenting my run over the end of the line. Solution: Check for NUL earlier.
2022-06-16patch 8.2.5108: retab test disabled because it hangs on MS-Windowsv8.2.5108Bram Moolenaar
Problem: Retab test disabled because it hangs on MS-Windows. Solution: Also set got_int at the other place a overlong text is detected.
2022-06-15patch 8.2.5103: build fails with small featuresv8.2.5103Bram Moolenaar
Problem: Build fails with small features. Solution: Add #ifdef. Skip test on MS-Windows.
2022-06-15patch 8.2.5102: interrupt not caught in testv8.2.5102Bram Moolenaar
Problem: Interrupt not caught in test. Solution: Consider an exception thrown in the current try/catch when got_int is set. Also catch early exit when not using try/catch.
2022-06-12patch 8.2.5080: when indenting gets out of hand it is hard to stopv8.2.5080Bram Moolenaar
Problem: When indenting gets out of hand it is hard to stop. Solution: When line gets too long set got_int.
2022-05-27patch 8.2.5029: "textlock" is always zerov8.2.5029zeertzjq
Problem: "textlock" is always zero. Solution: Remove "textlock" and rename "textwinlock" to "textlock". (closes #10489)
2022-05-21patch 8.2.4993: smart/C/lisp indenting is optionalv8.2.4993Bram Moolenaar
Problem: smart/C/lisp indenting is optional, which makes the code more complex, while it only reduces the executable size a bit. Solution: Graduate FEAT_CINDENT, FEAT_SMARTINDENT and FEAT_LISP.
2022-05-14patch 8.2.4953: with 'si' inserting '}' after completion goes wrongv8.2.4953Bram Moolenaar
Problem: With 'smartindent' inserting '}' after completion goes wrong. Solution: Check the cursor is in indent. (closes #10420)
2022-05-14patch 8.2.4951: smart indenting done when not enabledv8.2.4951Bram Moolenaar
Problem: Smart indenting done when not enabled. Solution: Check option values before setting can_si. (closes #10420)
2022-05-09patch 8.2.4928: various white space and cosmetic mistakesv8.2.4928Bram Moolenaar
Problem: Various white space and cosmetic mistakes. Solution: Change spaces to tabs, improve comments.
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-05-06patch 8.2.4882: cannot make 'breakindent' use a specific columnv8.2.4882Christian Brabandt
Problem: Cannot make 'breakindent' use a specific column. Solution: Add the "column" entry in 'breakindentopt'. (Christian Brabandt, closes #10362, closes #10325)
2022-04-20patch 8.2.4794: compiler warning for not initialized variablev8.2.4794Bram Moolenaar
Problem: Compiler warning for not initialized variable. Solution: Initialize the variable. (John Marriott)
2022-04-19patch 8.2.4792: indent operator creates an undo entry for every linev8.2.4792Bram Moolenaar
Problem: Indent operator creates an undo entry for every line. Solution: Create one undo entry for all lines. (closes #10227)
2022-02-21patch 8.2.4436: crash with weird 'vartabstop' valuev8.2.4436Bram Moolenaar
Problem: Crash with weird 'vartabstop' value. Solution: Check for running into the end of the line.
2022-02-12patch 8.2.4364: MS-Windows: still running out of memory for a very long linev8.2.4364Bram Moolenaar
Problem: MS-Windows: still running out of memory for a very long line. Solution: Check for negative length.
2022-02-12patch 8.2.4362: :retab may allocate too much memoryv8.2.4362Bram Moolenaar
Problem: :retab may allocate too much memory. Solution: Bail out when allocating more than MAXCOL bytes.
2022-02-12patch 8.2.4359: crash when repeatedly using :retabv8.2.4359Bram Moolenaar
Problem: crash when repeatedly using :retab. Solution: Bail out when the line is getting too long.
2022-02-05patch 8.2.4298: divide by zero with huge tabstop valuev8.2.4298Bram Moolenaar
Problem: Divide by zero with huge tabstop value. Solution: Reject tabstop value that overflows to zero.
2022-02-03patch 8.2.4288: preprocessor indents are inconsistentv8.2.4288K.Takata
Problem: Preprocessor indents are inconsistent. Solution: Fix preprocessor indents. (Ken Takata, closes #9691)
2022-01-28patch 8.2.4245: ":retab 0" may cause illegal memory accessv8.2.4245Bram Moolenaar
Problem: ":retab 0" may cause illegal memory access. Solution: Limit the value of 'tabstop' to 10000.
2022-01-22patch 8.2.4185: cannot use an import in 'indentexpr'v8.2.4185Bram Moolenaar
Problem: Cannot use an import in 'indentexpr'. Solution: Set the script context when evaluating 'indentexpr'
2022-01-15patch 8.2.4093: cached breakindent values not initialized properlyv8.2.4093Christian Brabandt
Problem: Cached breakindent values not initialized properly. Solution: Initialize and cache formatlistpat. (Christian Brabandt, closes #9526, closes #9512)
2022-01-07patch 8.2.4029: debugging NFA regexp my crash, cached indent may be wrongv8.2.4029Bram Moolenaar
Problem: Debugging NFA regexp my crash, cached indent may be wrong. Solution: Fix some debug warnings in the NFA regexp code. Make sure log_fd is set when used. Fix breakindent and indent caching. (Christian Brabandt, closes #9482)
2022-01-01patch 8.2.3967: error messages are spread outv8.2.3967Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more errors to errors.h.
2021-12-31patch 8.2.3961: error messages are spread outv8.2.3961Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more errors to errors.h.
2021-12-27patch 8.2.3916: no error for passing an invalid line number to append()v8.2.3916Bram Moolenaar
Problem: No error for passing an invalid line number to append(). Solution: In Vim9 script check for a non-negative number. (closes #9417)
2021-09-04patch 8.2.3403: memory leak for :retab with invalid argumentv8.2.3403Bram Moolenaar
Problem: Memory leak for :retab with invalid argument. Solution: Free the memory. Make error messages consistent.
2021-09-04patch 8.2.3402: invalid memory access when using :retab with large valuev8.2.3402Bram Moolenaar
Problem: Invalid memory access when using :retab with large value. Solution: Check the number is positive.
2021-08-29patch 8.2.3386: using uninitialized memoryv8.2.3386Dominique Pelle
Problem: Using uninitialized memory. Solution: Initialize the rm_ic field. (Dominique Pellé, closes #8800)
2021-07-31patch 8.2.3259: when 'indentexpr' causes an error did_throw may hangv8.2.3259Bram Moolenaar
Problem: When 'indentexpr' causes an error the did_throw flag may remain set. Solution: Reset did_throw and show the error. (closes #8677)
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)