Age | Commit message (Collapse) | Author |
|
Problem: E95 is possible if a buffer called "[Command Line]" already
exists when opening the cmdwin. This can also happen if the
cmdwin's buffer could not be deleted when closing.
Solution: Un-name the cmdwin buffer, and give it a special name instead,
similar to what's done for quickfix buffers and for unnamed
prompt and scratch buffers. As a result, BufFilePre/Post are
no longer fired when opening the cmdwin. Add a "command" key
to the dictionary returned by getbufinfo() to differentiate
the cmdwin buffer instead. (Sean Dewar)
NOTE: This is technically a breaking change... maybe this needs a different
solution? (Or maybe this issue can be ignored...)
A GitHub search reveals some plugins expect the old behaviour. However, many of
those plugins also do not seem to account for the string being translated, so
they are subtly broken anyway (not withstanding the fact that you can call any
old buffer "[Command Line]" too...)
closes: #12819
Signed-off-by: Sean Dewar <seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Autocmds triggered from opening the cmdwin (in win_split and
do_ecmd) can cause issues such as E199, as the current checks
are insufficient.
Solution: Commands executed from the cmdwin apply to the old curwin/buf,
so they should be kept in a "suspended" state; abort if
they've changed. Also abort if cmdwin/buf was tampered with,
and check that curwin is correct. Try to clean up the cmdwin
buffer (only if hidden and non-current to simplify things; the
same approach is used when closing cmdwin normally), and add a
beep. (Sean Dewar)
It'd be nice to also check that curwin was *really* created by win_split, as
autocommands can change curwin before it returns (so it can't be assumed to be
that of the split); for now, this means that the cmdwin may not be the botwin in
that case, which is probably OK.
closes: #12819
Signed-off-by: Sean Dewar <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: incorrect heights in win_size_restore()
Solution: avoid restoring incorrect heights in win_size_restore()
Changing 'showtabline' or 'cmdheight' in the cmdwin restores incorrect
window heights after closing the cmdwin.
This may produce a gap between the cmdline and the window above.
Solution: restore window sizes only if the number of lines available for windows
changed; subtract the rows of the tabline, cmdline and last window's statusline
from 'lines' (other statuslines don't matter).
closes: #12704
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
|
|
Problem: In cmdline window S-Tab does not select previous completion.
(Maxim Kim)
Solution: Add a mappint for S-Tab. (closes #12116)
|
|
Problem: Tests check for +cmdwin feature which is always present.
Solution: Remove the checks. (closes #11287)
|
|
Problem: Using negative array index with negative width window.
Solution: Make sure the window width does not become negative.
|
|
Problem: When quitting the cmdline window with CTRL-C it remains visible.
Solution: Redraw to avoid confusion. Adjust the error message.
(closes #11152) Adjust the cursor position after CTRL-C.
|
|
Problem: Cmdwin test fails on MS-Windows.
Solution: Skip test on MS-Windows.
|
|
Problem: Using freed memory with cmdwin and BufEnter autocmd.
Solution: Make sure pointer to b_p_iminsert is still valid.
|
|
Problem: Manually deleting temp test files.
Solution: Use the 'D' flag of writefile() and mkdir().
|
|
Problem: No test for what 9.0.0234 fixes.
Solution: Add a test. (issue #10950)
|
|
Problem: Reading before the start of the line.
Solution: When displaying "$" check the column is not negative.
|
|
Problem: Confusing error when using "q:" in command line window.
Solution: Check for the situation and give a better error message.
(closes #10756)
|
|
Problem: The command line test is getting quite big.
Solution: Move command line window tests to a separate file.
|