Problem: A double-width char in a floating window causes an extra
space to be drawn to the left of its boundary.
Solution: Only reset skipstart at the first column.
Fix#24775
Problem: screenpos() wrong result with w_skipcol and cpoptions+=n
Solution: Use adjust_plines_for_skipcol() instead of subtracting
w_skipcol.
closes: vim/vim#12625bfe377b8f2
Problem: missing winid argument for virtcol()
Solution: Add a {winid} argument to virtcol()
Other functions col(), charcol() and virtcol2col() support a {winid}
argument, so it makes sense for virtcol() to also support than.
Also add test for virtcol2col() with 'showbreak' and {winid}.
closes: vim/vim#12633825cf813fa
Problem: incorrect heights in win_size_restore()
Solution: avoid restoring incorrect heights in win_size_restore()
876f5fb570
I already merged this prior, so just replace the new test with the old one,
but add a test case for the global statusline.
Problem: Fix regression in {func} argument of reduce()
Solution: pass function name as string again
Before patch 9.0.0548, passing a string as {func} argument of reduce()
is treated as a function name, but after patch 9.0.0548 it is treated as
an expression instead, which is useless as reduce() doesn't set any v:
variables. This PR restores the behavior of {func} before that patch.
Also correct an emsg() call, as e_string_list_or_blob_required doesn't
contain format specifiers.
closes: vim/vim#12824ad0c442f1f
Problem: wrong error messages when passing wrong types to count()
Solution: fix it
This fixes two problems:
1. When passing wrong type to {ic} argument of count(), two error
messages are given, the second of which is misleading.
2. When passing wrong type to {comp} argument of count(), the error
message doesn't mention that {comp} may be a String.
closes: vim/vim#128254f389e7c0f
Problem: Crash when collection is modified when using filter().
Solution: Lock the list/dict/blob. (Ernie Rael, closesvim/vim#12183)
e6d40dcdc7
Co-authored-by: Ernie Rael <errael@raelity.com>
Problem: reduce() with a compiled lambda could be faster.
Solution: Call eval_expr_typval() instead of call_func() directly.
f1c60d4bf1
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Error message for wrong argument type is not specific.
Solution: Include more information in the error. (Yegappan Lakshmanan,
closesvim/vim#11037)
8deb2b30c7
Cherry-pick test_listdict.vim changes from patch 8.2.4809.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Accepting one and zero for the second sort() argument is strange.
Solution: Disallow using one and zero in Vim9 script.
2007dd49f5
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Functions implementing reduce and map are too long.
Solution: Use a function for each type of value. Add a few more test cases
and add to the help. (Yegappan Lakshmanan, closesvim/vim#9370)
389b72196e
Partial port as this doesn't include handling for non-materialized List.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Cannot use reduce() for a string.
Solution: Make reduce() work with a string. (Naruhiko Nishino, closesvim/vim#9366)
0ccb5842f5
Omit tv_get_first_char() as it doesn't really save much code.
Co-authored-by: rbtnn <naru123456789@gmail.com>
Problem: Some lines of code not covered by tests.
Solution: Add a few more test cases. (Dominique Pellé, closesvim/vim#9453)
8bfa0eb863
Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
Problem: Cannot use a script-local function for 'foldtext'.
Solution: Expand "s:" and "<SID>". (Yegappan Lakshmanan, closesvim/vim#9411)
27708e6c7b
Cherry-pick test_filter_map.vim change from patch 8.2.3871.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Leaking memory in map() and filter(), cannot use a string argument
in Vim9 script.
Solution: Fix the leak, adjust the argument check, also run the tests as
Vim9 script. (Yegappan Lakshmanan, closesvim/vim#9354)
2d877599ee
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Cannot filter or map characters in a string.
Solution: Make filter() and map() work on a string. (Naruhiko Nishino,
closesvim/vim#9327)
c479ce032f
Co-authored-by: rbtnn <naru123456789@gmail.com>
Problem: Error for const argument to mapnew().
Solution: Don't give an error. (closesvim/vim#7400)
57cf4973a2
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: not enough tests run with Vim9.
Solution: Run a few more tests in Vim9 script and :def function. Fix
islocked(). Fix error for locking local variable.
bd77aa9274
Omit GLV_NO_DECL: Vim9 script only.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: not enough tests run with Vim9.
Solution: Run a few more tests in Vim9 script and :def function.
3e9c0b9608
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: dict-completion does not respect region
Solution: respect selected region in dict completion
Set do_region to zero as we don't want a complete dump of the matching
words, we want the code to filter them according to the user's selected
region.
closes: vim/vim#12792closes: vim/vim#7025e98fb643ec
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Problem: virtcol2col returns last byte of a multi-byte char
Solution: Make it return the first byte for a multi-byte char
closes: vim/vim#12786closes: vim/vim#12799b209b86e66
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: getcompletion() "cmdline" fails after :autocmd
Solution: Use set_cmd_context() instead of set_one_cmd_context().
closes: vim/vim#12804e4c79d3615
Problem: Cannot use positional arguments for printf()
Solution: Support positional arguments in string formatting
closes: vim/vim#121400c6181fec4
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
Problem: getcompletion() failes for user-defined commands
Solution: set context for completion function
closes: vim/vim#12681closes: vim/vim#126808ef1fbc0c3
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: incsearch test not sufficient (after 9.0.1691)
Solution: add an additional test
73b8209266
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
Problem:
Treesitter highlighting is slow for large files with lots of injections.
Solution:
Only parse injections we are going to render during a redraw cycle.
---
- `LanguageTree:parse()` will no longer parse injections by default and
now requires an explicit range argument to be passed.
- `TSHighlighter` now parses injections incrementally during on_win
callbacks for the line range being rendered.
- Plugins which require certain injections to be parsed must run
`parser:parse({ start_row, end_row })` before using the tree.
Problem: Temporarily changing current window in a script causes
CursorMoved to be triggerd.
Solution: Don't trigger CursorMoved if neither curwin nor cursor
changed between two checks.