Age | Commit message (Collapse) | Author |
|
Problem: Filetype may be undetected when a SwapExists autocommand sets
filetype in another buffer.
Solution: Make filetype detection state buffer-specific. Also fix a
similar problem for 'modified' (zeertzjq).
closes: #14344
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: more places exist where curwin == prevwin, and it may even be
expected in some cases.
Solution: revert v9.1.0001, but document that it's possible instead.
(Sean Dewar)
I've had a change of heart for the following reasons:
- A quick 'n dirty [GitHub code
search](https://github.com/search?q=%2F%28winnr%5C%28%5C%29%5Cs*%3D%3D%5Cs*winnr%5C%28%5B%27%22%5D%23%5B%27%22%5D%5C%29%7Cwinnr%5C%28%5B%27%22%5D%23%5B%27%22%5D%5C%29%5Cs*%3D%3D%5Cs*winnr%5C%28%5C%29%29%2F&type=code)
reveals some cases where it's expected in the wild.
Particularly, it made me aware `winnr() == winnr('#')` is possible when curwin
is changed temporarily during the evaluation of a &statusline expression item
(`%{...}`), and is used to show something different on the statusline
belonging to the previous window; that behaviour wasn't changed in v9.1.0001,
but it means curwin == prevwin makes sense in some cases.
- The definition and call sites of back_to_prevwin imply some expectation that
prevwin == wp (== curwin) is possible, as it's used to skip entering the
prevwin in that case.
- Prior to v9.1.0001, `:wincmd p` would not beep in the case that was patched in
v9.1.0001, but now does. That resulted in #14047 being opened, as it affected
the CtrlP plugin.
I find it odd that `:wincmd p` had cases where it wouldn't beep despite doing
nothing, but it may be preferable to keep things that way (or instead also
beep if curwin == prevwin, if that's preferred).
- After more digging, I found cases in win_free_mem, enter_tabpage,
aucmd_restbuf and qf_open_new_cwindow where curwin == prevwin is possible
(many of them from autocommands). Others probably exist too, especially in
places where curwin is changed temporarily.
fixes: #14047
closes: #14186
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Things that temporarily change/restore curwin/buf (e.g:
win_execute, some autocmds) may break assumptions that
curwin/buf is the cmdwin when "cmdwin_type != 0", causing
issues.
Solution: Expose the cmdwin's real win/buf and check that instead. Also
try to ensure these variables are NULL if "cmdwin_type == 0",
allowing them to be used directly in most cases without
checking cmdwin_type. (Sean Dewar)
Alternatively, we could ban win_execute in the cmdwin and audit all places that
temporarily change/restore curwin/buf, but I didn't notice any problems arising
from allowing this (standard cmdwin restrictions still apply, so things that may
actually break the cmdwin are still forbidden).
closes: #12819
Signed-off-by: Sean Dewar <seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: reg_executing() returns wrong result in :normal with range
when 'showcmd' is set (after 8.2.4705).
Solution: Reset "pending_end_reg_executing" when executing a register.
closes: #13707
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Moving tabpages on :drop may cause an endless loop
Solution: Disallow moving tabpages on :drop when cleaning up the arglist
first
Moving tabpages during drop command may cause an endless loop
When executing a :tab drop command, Vim will close all windows not in
the argument list. This triggers various autocommands. If a user has
created an 'au Tabenter * :tabmove -' autocommand, this can cause Vim to
end up in an endless loop, when trying to iterate over all tabs (which
would trigger the tabmove autocommand, which will change the tpnext
pointer, etc).
So instead of blocking all autocommands before we actually try to edit
the given file, lets simply disallow to move tabpages around. Otherwise,
we may change the expected number of events triggered during a :drop
command, which users may rely on (there is actually a test, that expects
various TabLeave/TabEnter autocommands) and would therefore be a
backwards incompatible change.
Don't make this an error, as this could trigger several times during the
drop command, but silently ignore the :tabmove command in this case (and
it should in fact finally trigger successfully when loading the given
file in a new tab). So let's just be quiet here instead.
fixes: #13676
closes: #13686
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: vim9: clean up from v9.0.1955
Solution: Fix a few remaining issues, improve error message
- Use `cl_exec`, the executing class, to check permissions in `get_lval()`.
- Handle lockvar of script variable from class.
- Add 'in class "Xxx"' to e_cannot_access_private_variable_str.
closes: #13222
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
|
|
Problem: Vim9: lockvar issues with objects/classes
Solution: fix `get_lhs()` object/class access and avoid `SEGV`,
make error messages more accurate.
- `get_lval()` detects/returns object/class access
- `compile_lock_unlock()` generate code for bare static and obj_arg access
- `do_lock_var()` check lval for `ll_object`/`ll_class` and fail if so.
Details:
- Add `ll_object`/`ll_class`/`ll_oi` to `lval_T`.
- Add `lockunlock_T` to `isn_T` for `is_arg` to specify handling of `lval_root` in `get_lval()`.
- In `get_lval()`, fill in `ll_object`/`ll_class`/`ll_oi` as needed; when no `[idx] or .key`, check lval_root on the way out.
- In `do_lock_var()` check for `ll_object`/`ll_class`; also bullet proof ll_dict case
and give `Dictionay required` if problem. (not needed to avoid lockvar crash anymore)
- In `compile_lock_unlock()` compile for the class variable and func arg cases.
closes: #13174
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
|
|
Problem: Vim9: need instanceof() function
Solution: Implement instanceof() builtin
Implemented in the same form as Python's isinstance because it allows
for checking multiple class types at the same time.
closes: #12867
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
|
|
Problem: Wrong cursor position when clicking after concealed text
with 'virtualedit'.
Solution: Store virtual columns in ScreenCols[] instead of text
columns, and always use coladvance() when clicking.
This also fixes incorrect curswant when clicking on a TAB, so now
Test_normal_click_on_ctrl_char() asserts the same results as the ones
before patch 9.0.0048.
closes: #12808
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
|
Problem: Cannot use positional arguments for printf()
Solution: Support positional arguments in string formatting
closes: #12140
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
|
|
Problem: Test failures for unreachable code.
Solution: Add a test override to ignore unreachable code.
|
|
Problem: FOR_ALL_ macros are defined in an unexpected file.
Solution: Move FOR_ALL_ macros to macros.h. Add FOR_ALL_HASHTAB_ITEMS.
(Yegappan Lakshmanan, closes #12109)
|
|
Problem: Using tt_member for the class leads to mistakes.
Solution: Add a separate tt_class field.
|
|
Problem: Cannot call a :def function with a number for a float argument.
Solution: Accept a number as well, convert it to a float.
|
|
Problem: Restoring KeyTyped when building statusline not tested.
Solution: Add a test. Clean up and fix other tests. (closes #11815)
|
|
Problem: A child class cannot override functions from a base class.
Solution: Allow overriding and implement "super".
|
|
Problem: Unused global variable.
Solution: Remove the variable. (closes #11752)
|
|
Problem: A shell command switching screens may still have a problem with
the kitty keyboard protocol.
Solution: Disable the kitty keyboard protocol both in the current and the
alternate screen, if there are indications it might be needed.
(issue #11705) Also fix naming.
|
|
Problem: Cannot display 'showcmd' somewhere else.
Solution: Add the 'showcmdloc' option. (Luuk van Baal, closes #11684)
|
|
Problem: Using a <Cmd> mapping CmdlineChanged may be triggered twice.
Solution: Count the number of times CmdlineChanged is triggered and avoid
doing it twice. (closes #116820
|
|
Problem: Build errors without the +channel feature. (John Marriott)
Solution: Adjust #ifdefs.
|
|
Problem: It is not easy to see what client-server commands are doing.
Solution: Add channel log messages if ch_log() is available. Move the
channel logging and make it available with the +eval feature.
|
|
Problem: Leaking memory from autocmd windows.
Solution: Free window when auc_win is not NULL.
|
|
Problem: Using one window for executing autocommands is insufficient.
Solution: Use up to five windows for executing autocommands.
|
|
Problem: Cannot detect whether modifyOtherKeys is enabled.
Solution: Use XTQMODKEYS introduced by xterm version 377 to request the
modifyOtherKeys level. Update the keycode check results.
|
|
Problem: Cannot debug the Kitty keyboard protocol with TermDebug.
Solution: Add Kitty keyboard protocol support to the libvterm fork.
Recognize the escape sequences that the protocol generates. Add
the 'keyprotocol' option to allow the user to specify for which
terminal what protocol is to be used, instead of hard-coding this.
Add recognizing the kitty keyboard protocol status.
|
|
Problem: prop_add_list() gives multiple errors for invalid argument.
Solution: Only give one error message.
|
|
Problem: Too many #ifdefs.
Solution: Graduate the +cmdwin feature. Now the tiny and small builds are
equal, drop the small build. (Martin Tournoij, closes #11268)
|
|
Problem: The 'splitscroll' option is not a good name.
Solution: Rename 'splitscroll' to 'splitkeep' and make it a string option,
also supporting "topline". (Luuk van Baal, closes #11258)
|
|
Problem: Error for modifying a const is not detected at compile time.
Solution: Add TTFLAG_CONST and check for it in add() and extend().
|
|
Problem: Various problems with 'nosplitscroll'.
Solution: Fix 'nosplitscroll' problems. (Luuk van Baal, closes #11166)
|
|
Problem: Cursor moves if cmdwin is closed when 'splitscroll' is off.
Solution: Skip win_fix_cursor if called when cmdwin is open or closing.
(Luuk van Baal, closes #11134)
|
|
Problem: With virtual text "above" indenting doesn't work well.
Solution: Ignore text properties while adjusting indent. (issue #11084)
|
|
Problem: The 'cmdheight' zero support causes too much trouble.
Solution: Revert support for 'cmdheight' being zero.
|
|
Problem: Cannot use the message popup window directly.
Solution: Add ":echowindow".
|
|
Problem: The tiny version has the popup menu but not 'wildmenu'.
Solution: Graduate the wildmenu feature.
|
|
Problem: Build error without the +eval feature.
Solution: Remove #ifdef.
|
|
Problem: Mechanism to prevent recursive screen updating is incomplete.
Solution: Add "redraw_not_allowed" and set it in build_stl_str_hl().
(issue #10952)
|
|
Problem: Cannot make difference between the end of :normal and a character
in its argument.
Solution: Add the "typebuf_was_empty" flag. (closes #10950)
|
|
Problem: Invalid memory access with for loop over NULL string.
Solution: Make sure mb_ptr2len() consistently returns zero for NUL.
|
|
Problem: No test for what patch 9.0.0155 fixes.
Solution: Add a test. Fix typos. (closes #10822)
|
|
Problem: When 'cmdheight' is zero pressing ':' may scroll a window.
Solution: Add the made_cmdheight_nonzero flag and set 'scrolloff' to zero.
|
|
Problem: Cursor in wrong column with mouse click after concealed text.
Solution: Store the text column when drawing text.
|
|
Problem: 'fillchars' cannot have window-local values.
Solution: Make 'fillchars' global-local. (closes #5206)
|
|
Problem: Reproducing memory access errors can be difficult.
Solution: When testing, copy each line to allocated memory, so that valgrind
can detect accessing memory before and/or after it. Fix uncovered
problems.
|
|
Problem: Syntax highlighting disabled when using synID() in searchpair()
skip expression and it times out. (Jaehwang Jung)
Solution: Add the redrawtime_limit_set flag. (closes #10562)
|
|
Problem: Value of cmod_verbose is a bit complicated to use.
Solution: Use zero for not set, value + 1 when set. (closes #10564)
|
|
Problem: CurSearch highlight is often wrong.
Solution: Remember the last highlighted position and redraw when needed.
|
|
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.
|