Commit Graph

42 Commits

Author SHA1 Message Date
Jay Sandhu
80a3018a09 test: add some tests for :*map <expr>
Add tests for:
 - Cursor position restored after :map expr
 - Cursor position restored after :imap expr
 - Error in :cmap expr handled correctly

Cherry-picked from #12837
2022-02-17 08:45:15 +08:00
Justin M. Keyes
c34130d13a API: deprecate nvim_command_output 2019-12-02 20:52:06 -08:00
Jan Edmund Lazo
01e3690ca8 vim-patch:8.1.1049: when user tries to exit with CTRL-C message is confusing
Problem:    When user tries to exit with CTRL-C message is confusing.
Solution:   Only mention ":qa!" when there is a changed buffer. (closes vim/vim#4163)
a84a3dd663

vim-patch:8.1.1052: test for CTRL-C message sometimes fails

Problem:    test for CTRL-C message sometimes fails
Solution:   Make sure there are no changed buffers.
553e5a5c56

vim-patch:8.1.1053: warning for missing return statement

Problem:    Warning for missing return statement. (Dominique Pelle)
Solution:   Add return statement.
d6c3f1fa2b
2019-07-28 22:19:11 -04:00
Gabriel Cruz
8c6f5b7f92 Spurious quote mark in command line when typing <C-R> (#9934)
Remove <C-R> special char after reading following chars
2019-04-24 10:41:07 +02:00
Gabriel Cruz
3b7a4f233b vim-patch:8.0.0714: cmdline redraw during timer #9835
vim-patch:8.0.0714: when a timer causes a command line redraw " goes missing
Problem:    When a timer causes a command line redraw the " that is displayed
            for CTRL-R goes missing.
Solution:   Remember an extra character to display.
a92522fbf3

vim-patch:8.0.0720: unfinished mapping not displayed when running timer
Problem:    Unfinished mapping not displayed when running timer.
Solution:   Also use the extra_char while waiting for a mapping and digraph.
            (closes vim/vim#1844)
6a77d2667e

close #9835
2019-04-12 03:20:05 +02:00
Björn Linse
e598811e76 ui: disable clearing almost everywhere
Avoid clearing the screen in most situations. NOT_VALID should be
equivalent to CLEAR unless some external force messed up the terminal,
for these situations <c-l> and :mode will still clear the screen.

Also eliminate some obsolete code in screen.c, that dealt with that in
vim drawing window 1 can mess up window 2, but this never happens in
nvim.

But what about slow terminals? There is two common meanings in which
a terminal is said to be "slow":

Most commonly (and in the sense of vim:s nottyfast) it means low
bandwidth for sending bytes from nvim to the terminal. If the screen is
very similar before and after the update_screen(CLEAR) this change
should reduce bandwidth. If the screen is quite different, but there is
no new regions of contiguous whitespace, clearing doesn't reduce
bandwidth significantly. If the new screen contains a lot of whitespace,
it will depend of if vsplits are used or not: as long as there is no
vsplits, ce is used to cheaply clear the rest of the line, so
full-screen clear is not needed to reduce bandwith. However a left
vsplit currently needs to be padded with whitespace all the way to the
separator. It is possible ec (clear N chars) can be used to reduce
bandwidth here if this is a problem. (All of this assumes that one
doesn't set Normal guibg=... on a non-BCE terminal, if you do you are
doomed regardless of this change).

Slow can also mean that drawing pixels on the screen is slow. E-ink
screens is a recent example. Avoiding clearing and redrawing the
unchanged part of the screen will always improve performance in these
cases.
2018-10-22 11:59:02 +02:00
Justin M. Keyes
aff64b3a52 Merge #9124 'vim-patch:8.0.1672' 2018-10-17 09:51:09 +02:00
Björn Linse
c8810a51a3 tests: improve robustness of immediate successes in screen tests 2018-10-15 20:13:11 +02:00
Jan Edmund Lazo
9c2d5f1a33 functionaltest: map error does not cancel prompt 2018-10-14 09:08:56 -04:00
Jan Edmund Lazo
8192267dea vim-patch:8.0.0609: some people still don't know how to quit (#8571)
Problem:    For some people the hint about quitting is not sufficient.
Solution:   Put <Enter> separately.  Also use ":qa!" to get out even when
            there are changes.
28a8193e31
2018-06-17 12:51:03 +02:00
Björn Linse
98e7112390 msg: do not scroll entire screen (#8088) 2018-03-31 11:12:27 +02:00
ZyX
79b4b6fc86 *: Make sure that !did_throw implies !current_exception
Fixes #7876
2018-03-25 14:50:48 +03:00
Justin M. Keyes
c095f83116 api: change nvim_command_output behavior
Implement nvim_command_output with `execute({cmd},"silent")`.

Behavior changes:
- does not provoke any hit-enter prompt
- no longer prepends a newline char
- does not capture some noise (like the "[New File]" message, see the
  change to tabnewentered_spec.lua)

Technically ("bug-for-bug") this a breaking change.  But the previous
behavior of nvim_command_output meant that it probably wasn't used for
anything outside of tests.

Also remove the undocumented `v:command_output` variable which was
a hack introduced only for the purposes of nvim_command_output.

closes #7726
2018-01-10 23:45:44 +01:00
ZyX
5ab0f988ca *: Replace all occurrences of NVim with Nvim 2017-11-30 11:53:25 +03:00
ZyX
cddf84c398 functests: Add some more tests 2017-11-26 16:45:29 +03:00
ZyX
c287893225 viml/parser/expressions,unittests: Do better testing, fix found issues 2017-11-19 19:22:54 +03:00
ZyX
556451a7f2 unittests,syntax: Check for sanity of highlight_init_cmdline
Also fixes some errors found.
2017-11-13 01:11:13 +03:00
ZyX
3ecb95298f tests: Fix testlint errors 2017-11-06 01:17:37 +03:00
ZyX
b935a12dab ex_getln: Make use of new parser to color expressions
Retires g:Nvim_color_expr callback.
2017-10-29 16:32:13 +03:00
ZyX
19a28352a9 ex_getln: Make error messages look better 2017-08-14 01:56:48 +03:00
ZyX
0571b8cb0e functests: Alter comment 2017-08-14 01:22:10 +03:00
ZyX
a5449f79ac functests: Check that input is correctly silenced 2017-08-14 01:17:16 +03:00
ZyX
c5857e3f38 ex_getln: Cache highlight callback calling results 2017-07-26 22:56:48 +03:00
ZyX
0a46ae3c0a functests: Add sleep to <C-c> test 2017-07-18 01:29:41 +03:00
ZyX
25f669049c functests: Test input() nesting support 2017-07-18 01:17:59 +03:00
ZyX
759f71d50e functests: Check for previously unchecked errors 2017-07-18 00:34:39 +03:00
ZyX
8a581b918b ex_getln: Check prev_prompt_errors before running redrawcmdline
Otherwise there will be infinite recursion and shortly a crash. Running 
redrawcmdline recursively occurs under color_cmdline_error label.
2017-07-18 00:20:21 +03:00
ZyX
cfb1d937a6 api helpers: Also save and restore did_emsg 2017-07-18 00:08:57 +03:00
ZyX
f4744e1821 ex_getln: Do not goto color_cmdline_end without first cleaning up
The issue with debug mode was actually not cleaning up after `try_enter`: 
location `&tstate` was pointing to got invalidated and received some “garbage” 
(actually, values that got stored on the stack afterwards). But pointer to that 
garbage was still stored in `msg_list`, so next attempt to check it resulted in 
a crash.
2017-07-17 01:55:10 +03:00
ZyX
7ab152aaa5 ex_getln: Save and restore try state
Problem: when processing cycle such as

    :for pat in [' \ze*', ' \zs*']
    :  try
    :    let l = matchlist('x x', pat)
    :    $put ='E888 NOT detected for ' . pat
    :  catch
    :    $put ='E888 detected for ' . pat
    :  endtry
    :endfor

`:let l = …` throwing an error causes this error to be caught after 
color_cmdline attempts to get callback for highlighting next line (the one with 
`$put = 'E888 NOT…`). Saving/restoring state prevents this from happening.
2017-07-01 15:34:25 +03:00
ZyX
ea75966e42 ex_getln: Do not make <C-c> interrupt input() after interrupting hl cb 2017-06-28 22:54:13 +03:00
ZyX
3da49cd68e ex_getln: Fix “echoerr msg not shown” problem
This also attempted to fix problem with cancelling input() on error by avoiding 
standard error printing facilities (assumed thrown error message is the 
problem), but with no luck so far.
2017-06-28 22:09:10 +03:00
ZyX
9ccb3abbb5 functests: Uncomment {REDRAW} part of “works” test 2017-06-28 14:39:52 +03:00
ZyX
5e4976559a functests: Partially uncomment <C-c> test 2017-06-28 14:34:12 +03:00
ZyX
0ed95423de ex_getln: Call highlight callback inside :try 2017-06-28 14:26:23 +03:00
ZyX
493d250446 functests: Make “stops executing callback” test work
Needed to be adjusted to use input() (previously relied on side-effects of 
executing `:cmd`) and dismiss something (hidden “Press ENTER” message?).
2017-06-28 13:58:51 +03:00
ZyX
edc2a7ee46 functests: Make tests work with input()
There are still some issues: specifically, new “pending” test hangs busted.
2017-06-27 02:15:49 +03:00
ZyX
8e5134784c functests: Comment out failing test 2017-06-27 01:55:21 +03:00
ZyX
71616fce0b functests: Abstract away some ways to enter cmdline coloring mode
Reason: should actually switch to using input() coloring because other coloring 
variants are eventually going away.
2017-06-27 01:54:08 +03:00
ZyX
407abb3a6c eval,ex_getln: Add support for coloring input() prompts 2017-06-27 01:34:54 +03:00
ZyX
d82741f8c0 ex_getln: Add some more tests, fix some found errors 2017-06-27 01:34:54 +03:00
ZyX
3d25200127 functests: Start adding some tests 2017-06-27 01:34:54 +03:00