Age | Commit message (Collapse) | Author |
|
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: '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>
|
|
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>
|
|
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>
|
|
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)
|
|
Problem: Functions without arguments are not always declared properly.
Solution: Use "(void)" instead of "()". (Yegappan Lakshmanan, closes #12031)
|
|
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes #11805)
|
|
Problem: With the +vartabs feature indent folding may use wrong 'tabstop'.
Solution: Use the "buf" argument instead of "curbuf".
|
|
Problem: Cannot use 'indentexpr' for Lisp indenting.
Solution: Add the 'lispoptions' option.
|
|
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.
|
|
Problem: Build error and compiler warnings.
Solution: Add missing change. Add type casts.
|
|
Problem: With virtual text "above" indenting doesn't work well.
Solution: Ignore text properties while adjusting indent. (issue #11084)
|
|
Problem: 'breakindent' does not indent non-lists with
"breakindentopt=list:-1".
Solution: Adjust indent computation. (Maxim Kim, closes #11038)
|
|
Problem: Not passing APC_INDENT flag.
Solution: Pass the flag where it's needed.
|
|
Problem: Redraw flags are not named specifically.
Solution: Prefix "UPD_" to the flags, for UPDate_screen().
|
|
Problem: Cannot show virtual text.
Solution: Initial changes for virtual text support, using text properties.
|
|
Problem: Comparing line pointer for 'breakindent' is not reliable.
Solution: Make a copy of the line.
|
|
Problem: Reading beyond the end of the line with lisp indenting.
Solution: Avoid going over the NUL at the end of the line.
|
|
Problem: Lisp indenting my run over the end of the line.
Solution: Check for NUL earlier.
|
|
Problem: Retab test disabled because it hangs on MS-Windows.
Solution: Also set got_int at the other place a overlong text is detected.
|
|
Problem: Build fails with small features.
Solution: Add #ifdef. Skip test on MS-Windows.
|
|
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.
|
|
Problem: When indenting gets out of hand it is hard to stop.
Solution: When line gets too long set got_int.
|
|
Problem: "textlock" is always zero.
Solution: Remove "textlock" and rename "textwinlock" to "textlock".
(closes #10489)
|
|
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.
|
|
Problem: With 'smartindent' inserting '}' after completion goes wrong.
Solution: Check the cursor is in indent. (closes #10420)
|
|
Problem: Smart indenting done when not enabled.
Solution: Check option values before setting can_si. (closes #10420)
|
|
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: Cannot make 'breakindent' use a specific column.
Solution: Add the "column" entry in 'breakindentopt'. (Christian Brabandt,
closes #10362, closes #10325)
|
|
Problem: Compiler warning for not initialized variable.
Solution: Initialize the variable. (John Marriott)
|
|
Problem: Indent operator creates an undo entry for every line.
Solution: Create one undo entry for all lines. (closes #10227)
|
|
Problem: Crash with weird 'vartabstop' value.
Solution: Check for running into the end of the line.
|
|
Problem: MS-Windows: still running out of memory for a very long line.
Solution: Check for negative length.
|
|
Problem: :retab may allocate too much memory.
Solution: Bail out when allocating more than MAXCOL bytes.
|
|
Problem: crash when repeatedly using :retab.
Solution: Bail out when the line is getting too long.
|
|
Problem: Divide by zero with huge tabstop value.
Solution: Reject tabstop value that overflows to zero.
|
|
Problem: Preprocessor indents are inconsistent.
Solution: Fix preprocessor indents. (Ken Takata, closes #9691)
|
|
Problem: ":retab 0" may cause illegal memory access.
Solution: Limit the value of 'tabstop' to 10000.
|
|
Problem: Cannot use an import in 'indentexpr'.
Solution: Set the script context when evaluating 'indentexpr'
|
|
Problem: Cached breakindent values not initialized properly.
Solution: Initialize and cache formatlistpat. (Christian Brabandt,
closes #9526, closes #9512)
|
|
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)
|
|
Problem: Error messages are spread out.
Solution: Move more errors to errors.h.
|
|
Problem: Error messages are spread out.
Solution: Move more errors to errors.h.
|
|
Problem: No error for passing an invalid line number to append().
Solution: In Vim9 script check for a non-negative number. (closes #9417)
|
|
Problem: Memory leak for :retab with invalid argument.
Solution: Free the memory. Make error messages consistent.
|
|
Problem: Invalid memory access when using :retab with large value.
Solution: Check the number is positive.
|
|
Problem: Using uninitialized memory.
Solution: Initialize the rm_ic field. (Dominique Pellé, closes #8800)
|
|
Problem: When 'indentexpr' causes an error the did_throw flag may remain
set.
Solution: Reset did_throw and show the error. (closes #8677)
|
|
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)
|