Commit Graph

2636 Commits

Author SHA1 Message Date
Björn Linse
8b42249cdd RPC: turn errors from async calls into notifications
Previously, nvim sent a response with invalid request id (UINT64_MAX).
In functionaltests, catch unexpected error notifications in after_each().
2018-12-03 10:42:00 +01:00
Rui Abreu Ferreira
07ad5d71ab clipboard: Support custom VimL functions #9304
Up to now g:clipboard["copy"] only supported string values invoked as
system commands.

This commit enables the use of VimL functions instead. The function
signatures are the same as in provider/clipboard.vim. A clipboard
provider is expected to store and return a list of lines (i.e. the text)
and a register type (as seen in setreg()).

cache_enabled is ignored if "copy" is provided by a VimL function.
2018-12-03 00:07:08 +01:00
Justin M. Keyes
b19403e73e
Merge #9291 'vim-patch:8.1.{550,551}' 2018-12-02 23:10:26 +01:00
Justin M. Keyes
0f00f31cbd VimL/confirm(): Show dialog even if :silent
closes #8788
related #9034
2018-12-01 16:06:01 +01:00
Björn Linse
2271b10a8e insert: make <cmd> mapping work in completion (CTRL-X) mode 2018-12-01 10:37:46 +01:00
Jan Edmund Lazo
471129792c fixup: 30 col resize to scroll debug 2018-12-01 01:56:22 -05:00
Jan Edmund Lazo
5c3488c937 fixup: 35 col resize to scroll screen 2018-12-01 00:15:11 -05:00
Jan Edmund Lazo
2479004c13 functionaltests: vim-patch:8.1.{550,551} fix 2018-11-30 23:35:36 -05:00
Jan Edmund Lazo
5de5507ea6 vim-patch:8.1.0550: expression evaluation may repeat an error message
Problem:    Expression evaluation may repeat an error message. (Jason
            Franklin)
Solution:   Increment did_emsg and check for the value when giving an error
            for the echo command.
76a6345433
2018-11-30 23:35:36 -05:00
Justin M. Keyes
32a30d90b4
highlight: Fix missing .rgb_sp_color in initializers (#9287)
terminal_get_line_attributes() had this bug for a long time, though it
likely had no effect visible to users.

ref #9028
ref 60f845ca55
2018-11-30 21:13:01 +01:00
Björn Linse
32405de7df API: rename nvim_buf_clear_highlight to nvim_buf_clear_namespace
We want a single function to clear all namespaced buffer objects. This
will later include extmarks.
2018-11-29 15:15:04 +01:00
Justin M. Keyes
0d1e5ec1b8
Merge #9221 from justinmk/doc 2018-11-28 03:49:17 +01:00
Justin M. Keyes
30857030e8 doc
- develop.txt is for design/guidelines; architecture/concepts should
  live elsewhere (currently src/nvim/README.md)
- move dev-jargon to intro.txt
- replace https://neovim.io/community (deprecated) with
  https://neovim.io/#chat
- <Cmd> avoids CmdlineEnter/Leave
  https://github.com/vim/vim/issues/2889
2018-11-28 03:48:06 +01:00
Justin M. Keyes
cf631aaed0
diff/highlight: Fix GUI highlight for low-priority CursorLine (#9281)
ref #9028
ref 0653ed63a5
2018-11-28 03:23:10 +01:00
Justin M. Keyes
7fdb45e0f8 preserve_exit: Ignore SIGHUP
closes #9274
ref #9028

If stdin closed then read_error_exit calls preserve_exit. Handling
SIGHUP during preserve_exit would cause a premature teardown, and
conflicts with e.g. ui_bridge_stop which waits for TUI to teardown.

Vim ignores SIGHUP in its prepare_to_exit and getout_preserve_modified
routines:

    /* Ignore SIGHUP, because a dropped connection causes a read error, which
     * makes Vim exit and then handling SIGHUP causes various reentrance
     * problems. */
    signal(SIGHUP, SIG_IGN);
2018-11-27 01:14:55 +01:00
Justin M. Keyes
60f845ca55 diff/highlight: Show underline for low-priority CursorLine 2018-11-27 01:14:55 +01:00
Justin M. Keyes
b1aaa0a881 API: Implement nvim_win_set_buf() #9100
closes #9100
2018-11-25 16:27:10 +01:00
Björn Linse
01dbf0951b api: implement object namespaces
Namespaces is a lightweight concept that should be used to group
objects for purposes of bulk operations and introspection. This is
initially used for highlights and virtual text in buffers, and is
planned to also be used for extended marks. There is no plan use them
for privileges or isolation, neither to introduce nanespace-level
options.
2018-11-24 11:01:37 +01:00
Justin M. Keyes
deb18a050e
defaults: background=dark #2894 (#9205)
By historical accident, Nvim defaults to background=light. So on a dark
background, `:colorscheme default` looks completely wrong.

The "smart" logic that Vim uses is confusing for anyone who uses Vim on
multiple platforms, so rather than mimic that, pick the (hopefully) most
common default.

- Since Neovim is dark-powered, we assume most users have dark backgrounds.
- Most of the GUIs tend to have a dark background by default.

ref #6289
2018-11-20 10:52:49 +01:00
James McCoy
25356f2802
Merge pull request #9240 from jamessan/mbyte_spec-failure
unit/mbyte_spec: Run utf_char2bytes test in batches of 0xFFF characters
2018-11-15 16:25:29 -05:00
James McCoy
c344f4b6ae
unit/mbyte_spec: Run utf_char2bytes test in batches of 0xFFF characters
Running the full 0xFFFF set of tests in one process fails on slower
architectures/when there's CPU contention.
2018-11-15 07:06:37 -05:00
Justin M. Keyes
f8639dc99c
test: adjust time-sensitive tests (#9220)
- window_split_tab_spec.lua: Put cursor at bottom of :terminal buffer so
  that it follows output.
- inccommand_spec.lua: Increase timeout to allow 2nd retry.
- Timer tests are less reliable on Travis CI macOS 10.12/10.13.
  ref #6829
  ref e39dade80b
  ref de13113dc1
  ref https://github.com/neovim/neovim/pull/9095#issuecomment-429603452
  > We don't guarantee that a X ms timer is triggered during Y ms sleep
  > for any X<Y, though I would expect the load to be really bad for this
  > to happen with X=10ms, Y=40ms.
2018-11-10 11:12:04 +01:00
Björn Linse
d36afafc8d
Merge pull request #9211 from bfredl/init_options
ui_options: also send when starting in --embed mode
2018-11-08 15:15:36 +01:00
Björn Linse
348adbcc7a ui_options: also send when starting or from OptionSet
needed after #9024 to receive options from init.vim
2018-11-08 14:12:54 +01:00
Tommy Allen
c4c74c3883 jobstart(): Fix hang on non-executable cwd #9204
* os/fs.c: add os_isdir_executable()
* eval.c: fix hang on job start caused by non-executable cwd option
* channel.c: assert cwd is an executable directory
* test: jobstart() produces error when using non-executable cwd
2018-11-07 10:31:25 +01:00
Justin M. Keyes
6fe740c7ab test/win: window_split_tab_spec: fix retry() 2018-11-05 07:59:14 +01:00
Justin M. Keyes
10ef903648 test/win: window_split_tab_spec: increase retry() time
The default timeout of 10s only allows 1 retry.
2018-11-05 03:25:36 +01:00
Justin M. Keyes
de13113dc1 test/timer_spec: relax lower-bound
Test is unreliable on macOS 10.13.  The lower-bound isn't central to the
purpose of the test, so just relax it.

ref https://github.com/neovim/neovim/pull/9095#issuecomment-429603452

> We don't guarantee that a X ms timer is triggered during Y ms sleep
> for any X<Y, though I would expect the load to be really bad for this
> to happen with X=10ms, Y=40ms.

related: #6829
2018-11-05 00:35:54 +01:00
Justin M. Keyes
697176fc3e test/win: retry unreliable SIGWINCH test 2018-11-04 14:24:05 +01:00
Björn Linse
48398d61e4
Merge pull request #9183 from bfredl/offset2
api: make nvim_buf_get_offset independent on platform option
2018-11-02 08:36:38 +01:00
Björn Linse
c40f992e10 api: simplify nvim_buf_get_offset function 2018-11-01 22:00:40 +01:00
Justin M. Keyes
c45a859171
Merge #7506 'deps: update libuv' 2018-11-01 20:42:20 +01:00
Justin M. Keyes
f5671c8614 win: test: SIGWINCH is noisy #7506 2018-11-01 17:17:07 +01:00
Björn Linse
281da0dd59 api: implement nvim_buf_get_offset_for_line
Like line2byte, but works for any buffer, and uses zero-based
indexing (API conventions).
2018-11-01 15:05:05 +01:00
Jan Edmund Lazo
7ab0e8c8dd functionaltest: enable job channel test 2018-10-31 22:55:07 -04:00
Jan Edmund Lazo
4abed17496 functionaltest: win: enable shada FileWriteCmd 2018-10-31 22:55:07 -04:00
Jan Edmund Lazo
8e44396794 functionaltest: enable buffered output tests 2018-10-31 22:55:07 -04:00
Jan Edmund Lazo
fe2e7cfdee functionaltest: enable FilterReadPre,FilterReadPost test 2018-10-31 22:55:07 -04:00
Jan Edmund Lazo
bc5fb82c6d functionaltest: win: enable diffput,diffget test 2018-10-31 22:55:07 -04:00
Jan Edmund Lazo
88974c8e66 functionaltests: win: enable gzip test
Close gzip file handles.
2018-10-31 22:54:18 -04:00
Björn Linse
4d7c7f96dd
Merge pull request #9149 from bfredl/virt_cul
screen: show virt_text when 'cursorline' is set
2018-10-25 21:24:06 +02:00
Björn Linse
6994cc4d1a UI: add missing redraw after enter_tabpage
redraw_all_later() isn't guaranteed to update must_redraw after
switching tab, we must do it ourselves.

fixes #9152
2018-10-25 17:46:58 +02:00
Björn Linse
662abd8451 screen: fix glitches with nvim_buf_set_virtual_text
- virtual text disappeared when 'cursorline' was set
- virtual text was shifted when emtpy line was visually selected.
2018-10-25 09:30:48 +02:00
Justin M. Keyes
6dae7776ed
Merge #9145 'CI, nodejs fixes' 2018-10-22 21:52:51 +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
Jan Edmund Lazo
db6521a560 test: fix/speedup scrollback_spec
- fix: Use "set PROMPT=$" trick to satisfy screen:expect{any='%$'}
- speedup: Use cmd.exe instead of powershell.
2018-10-22 01:30:28 +02:00
Björn Linse
bcab880bb6 api/ui: verify compatibility of UI events 2018-10-21 20:36:52 +02:00
Justin M. Keyes
3059516e8a
Merge #9086 'vim-patch:8.1.0448' 2018-10-18 00:47:30 +02:00
Justin M. Keyes
aff64b3a52 Merge #9124 'vim-patch:8.0.1672' 2018-10-17 09:51:09 +02:00
Justin M. Keyes
9642903dea
test: Improve 008_autocommands_spec reliability (#9129)
Sometimes 008_autocommands_spec fails like this:

    [ RUN      ] autocommands that delete and unload buffers: BufUnload, VimLeave: -- Output to stderr:
    CMake Error at /home/travis/build/neovim/neovim/cmake/RunTests.cmake:53 (message):
      functional tests failed with error: 1

The final :quit + wait() is a race. Use command() instead, which is
synchronous.  Use command('silent! ...') everywhere else too, because
it's clearer instead of feeding input and clearing the expected errors
with CTRL-L.
2018-10-17 09:24:45 +02:00
Justin M. Keyes
ee94eecbd4 vim-patch:8.1.0448: cursorline not removed when using 'cursorbind'
Problem:    Cursorline not removed when using 'cursorbind'. (Justin Keyes)
Solution:   Store the last cursor line per window. (closes vim/vim#3488)
4a5abbd613
2018-10-16 00:15: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
Justin M. Keyes
e39dade80b test: adjust timer tests
Timer tests are less reliable on Travis CI macOS 10.12 (most egregious).
Also somewhat on 10.13.
2018-10-13 23:34:49 +02:00
Björn Linse
79a11ecfd3
Merge pull request #9121 from bfredl/virt_invalid
API: make nvim_buf_set_virtual_text handle invalid chars
2018-10-13 20:15:28 +02:00
Reto Schnyder
bddcbbb571 signs: Add "numhl" argument #9113
close #9113
ref #9040
2018-10-13 19:39:56 +02:00
Björn Linse
3d84cf6ff4 api: make nvim_buf_set_virtual_text handle invalid chars
Clients are supposed to supply only valid text, but if it is
invalid, translate it rather than messing up the screen
2018-10-13 16:37:17 +02:00
Justin M. Keyes
b11f5aa119 doc: xdg, MAINTAIN.md, channel-id, job control
- tutor: emphasize K
2018-10-11 19:32:31 +02:00
Björn Linse
075dc42fb2 test: replace wait() with pre-assertion in assert_term_colors 2018-10-06 11:36:09 +02:00
James McCoy
eb7b2c7912
Fix crash if --embed is used more than once 2018-10-03 07:29:08 -04:00
Björn Linse
bab3b0ad45 ui: reserve the right to split a screen redraw into multiple batches. 2018-10-02 10:52:37 +02:00
Björn Linse
43823acae2 ui: rename ext_newgrid to ext_linegrid 2018-10-01 21:24:15 +02:00
Justin M. Keyes
6e146d4132
test: check_cores(): Fix tmp dir exclusion (#9061)
tmpdir_get() may be an absolute path, but we invoke glob() with
a relative `initial_path`.

That can lead to this error:

    [  ERROR   ] test/functional/helpers.lua @ 752: after_each
    test/helpers.lua:95: cannot open ./Xtest-tmpdir/nvim8jKCjR: No such file or directory
    stack traceback:
            test/helpers.lua:95: in function 'glob'
            test/helpers.lua:273: in function 'check_cores'
            test/functional/helpers.lua:757: in function <test/functional/helpers.lua:752>
2018-09-28 08:58:22 +02:00
Justin M. Keyes
990c147de3 test: Do not load entire log-file into memory
With DEBUG-level logging, after `make test`, log file could be 1+ GB.
2018-09-23 15:58:02 +02:00
Justin M. Keyes
22c83a4de9 swapfile: Always show swap dialog (E325)
If swapfile dialog prompts for input, it must be displayed to the user.

fix #8840
fix #9027
2018-09-23 15:58:01 +02:00
Justin M. Keyes
c3d24368a1 shortmess+=F: Hide :bnext, :bprev fileinfo messages 2018-09-23 15:58:01 +02:00
Björn Linse
4da5cb38d3 startup: always wait for UI with --embed, unless --headless also is supplied 2018-09-22 10:18:28 +02:00
Justin M. Keyes
ecdd2df88a
shell/logging: Fix E730 with verbose system({List}) #9009
ref https://github.com/neovim/neovim/issues/9001#issuecomment-421843790

Steps to reproduce:
    :set verbose=9
    :call system(['echo'])
    E730: using List as a String
2018-09-21 09:20:04 +02:00
Björn Linse
5487624730 startup: don't erase screen on :hi Normal during startup
NB: existing `color default` test was actually enough to trigger the bug,
when ext_newgrid=false is used. I created the `:hi Normal` test as
I thought the builtin colors wouldn't set Normal (unless 'bg' is changed)
But as the root cause actually comes from `:hi Normal`, it makes sense
to still add the separate test (if `color default` here gets optimized to
become a no-op, or something).
2018-09-20 12:25:31 +02:00
Daniel Hahler
47d74bf32f doc: test/README.md (#9020)
- testdir location
- no old style tests are left in the fixed list in the Makefile

[ci skip]
2018-09-20 09:37:53 +02:00
Justin M. Keyes
a316258d2c test: system_spec: remove redundant clear() 2018-09-19 00:49:18 +02:00
Björn Linse
bd8d43c6fe startup: wait for embedder before executing startup commands and files
Give embeders a chance to set up nvim, by processing a request before
startup. This allows an external UI to show messages and prompts from
--cmd and buffer loading (e.g. swap files)
2018-09-18 19:22:16 +02:00
Björn Linse
45f53b370b buffer: add support for virtual text annotations 2018-09-17 10:41:29 +02:00
Ronan Pigott
9ed46a77e6 vim-patch:8.1.0355 Incorrect adjusting the popup menu (#8996)
Problem:    Incorrect adjusting the popup menu for the preview window.
Solution:   Compute position and height properl. (Ronan Pigott)  Also show at
            least ten items. (closes vim/vim#3414)
2018-09-16 11:15:46 +02:00
Björn Linse
5056d40b16 getchar: allow <SID> in <Cmd> mapping 2018-09-13 11:02:24 +02:00
rpigott
59c5c4f006 test: popupmenu placement 2018-09-13 00:27:42 +02:00
Jan Edmund Lazo
95608136d5 tests: update expected output of :digraph command 2018-09-08 22:28:35 -04:00
ZyX
a9fa66b5b8 functests: Add tests 2018-09-06 02:12:36 +03:00
Justin M. Keyes
51d42917f0 test/win: job_spec: increase jobwait() timeout
powershell is slow, and this timeout is "worst case" so it doesn't make
the tests more costly, only avoids a false-positive.

close #8958
2018-09-05 22:05:05 +02:00
Justin M. Keyes
bfe82d4650
Merge #8888 from janlazo/vim-8.0.1020 2018-09-05 09:38:34 +02:00
Justin M. Keyes
608ff261ad test: API validation: assert exact string
expect_err() matches against a pattern. Terminate the pattern with "$"
to check against buffer overrun.

ref #8931
2018-09-05 08:04:15 +02:00
Justin M. Keyes
db17d2c0fa API: Avoid overrun when formatting error-message
msgpack_rpc_to_object (called by handle_request .. msgpack_rpc_to_array)
always NUL-terminates API Strings.
But handle_request .. msgpack_rpc_get_handler_for operates on a raw
msgpack_object, before preparation.
2018-09-05 08:04:15 +02:00
Jan Edmund Lazo
f8e042f732 tests: call getchar(1) in timer callback
Test changes from 8.0.1020 and 8.0.1048.
2018-09-04 10:00:17 -04:00
Justin M. Keyes
90519107f2 Merge #8921 'highlight: Fix after-EOL matches at cursor' 2018-09-04 07:05:20 +02:00
Björn Linse
7ff63fcdc0
Merge pull request #8942 from bfredl/attr_state
screen.lua: extend snapshot_util() to work with extension state
2018-09-03 12:16:49 +02:00
Ricky Zhou
2694fa759f Add tests for highlighting after the end of a line. 2018-09-03 03:13:03 -07:00
Björn Linse
74937589d0 screen.lua: extend snapshot_util() to work with extension state
Simplify handling of attributes: collect new attributes in the same pass
as screen lines are rendered, instead of using two passes.
2018-09-03 10:36:55 +02:00
Justin M. Keyes
acdede50ce
test: Dump $NVIM_LOG_FILE contents (#8926)
Do this at the test-framework level instead of CI (Travis) scripts.
Then it works for QuickBuild and AppVeyor.

ref eb6dd3e42d
2018-08-28 22:13:34 +02:00
Daniel Hahler
643ef257b3 API: nvim_unsubscribe(): Handle unknown events #8745
close #8745
2018-08-28 10:20:19 +02:00
Björn Linse
3d88287e30 tests: introduce screen:expect{...} form 2018-08-27 15:15:49 +02:00
Matthieu Coudron
2e5c299f11
warn about tests without libintl 2018-08-25 23:13:34 +09:00
Jan Edmund Lazo
2c0998e104 vim-patch:8.0.1291: C indent wrong when * immediately follows comment
Problem:    C indent wrong when * immediately follows comment. (John Bowler)
Solution:   Do not see "/*" after "*" as a comment start. (closes vim/vim#2321)
f8c53d3d26
2018-08-20 00:05:12 -04:00
Björn Linse
4a46ab8de9 cmdline: always use save_cmdline before command_line_enter
":normal :" might be invoked in various ways, so its safest to always
allow recursive invocation of cmdline mode
2018-08-17 10:48:48 +02:00
Jan Edmund Lazo
0bdd4e8393 oldtests: finish port of 8.0.1224 2018-08-15 01:27:30 -04:00
Björn Linse
fa4c260100 cursor_shape: use attribute ids instead of syntax ids
As attribute ids is the convention in the UI protocol
Also remove non-threadsafe calls in tui.c to syntax module.
2018-08-13 13:35:35 +02:00
Björn Linse
2b9fc9a13f
Merge pull request #8660 from phodge/7688-nvim-buf-lines-should-return-empty-list-for-unloaded-buffer
handle unloaded buffers in nvim_buf_*() functions
2018-08-02 13:28:36 +02:00
Marcos Almeida
a2253744c9 system(): handle profiling and 'verbose' #8730
closes #8362

Vim's code calls `call_shell` directly from `get_system_output_as_rettv`
whereas in Nvim this function has been rewritten to not call `call_shell` but to call
`os_system` via `do_os_system`, losing the support for profiling and verbose.

Changing the code to call `call_shell` from `get_system_output_as_rettv`
seems to be too complicated to be worth it on the current version of the
code. So this commit duplicates the relevant code.
2018-07-29 03:49:11 +02:00
Björn Linse
9a584773b5 screen.c: add update_window_hl to special redrawing entrypoints
The following (run as a script) used to cause a crash due to :sign using a
special redraw (not updating nvim's specific highlight data structures)
without proper redraw first, as split just flags for redraw later.

set cursorline
sign define piet text=>> texthl=Search
split
sign place 3 line=2 name=piet buffer=1
2018-07-27 17:11:01 +02:00
Peter Hodge
b53b621ef6 functests: tests related to operations on unloaded buffers #7688 2018-07-25 15:07:13 +10:00
Björn Linse
11861bc9c8 tests: add test for switching tabpage right after scroll 2018-07-24 16:37:48 +02:00
Björn Linse
d183103b45 test: assert scroll region state for clear
some clients assume this, so tests should check it
2018-07-24 16:37:04 +02:00
Björn Linse
ed5ac84ab0 tests: test for redrawing tabline when msgsep marker goes outside screen 2018-07-24 16:36:20 +02:00
Justin M. Keyes
2000b6a64a Merge #8589 'VimL: Remove legacy v:xx aliases' 2018-07-23 03:18:10 +02:00
Jan Edmund Lazo
c9f2faf3bf vim-patch:8.0.1398: :packadd does not load packages from the "start" directory (#8762)
Problem:    :packadd does not load packages from the "start" directory.
            (Alejandro Hernandez)
Solution:   Make :packadd look in the "start" directory if those packages were
            not loaded on startup.
9e1d399e63
2018-07-23 02:04:49 +02:00
Shougo Matsushita
03bd5a4b91 Make "v:errmsg", "v:shell_error" and "v:this_session" distinct 2018-07-23 08:47:51 +09:00
Björn Linse
6b8cd827a9 ui: add tests for hlstate extension 2018-07-21 13:21:59 +02:00
Björn Linse
1adb01c120 ui: use line-based rather than char-based updates in screen.c
Add ext_newgrid and ext_hlstate extensions. These use predefined
highlights and line-segment based updates, for efficiency and
simplicity.. The ext_hlstate extension in addition allows semantic
identification of builtin and syntax highlights.

Reimplement the old char-based updates in the remote UI layer, for
compatibility. For the moment, this is still the default. The bulitin
TUI uses the new line-based protocol.

cmdline uses curwin cursor position when ext_cmdline is active.
2018-07-21 13:21:58 +02:00
Björn Linse
989b585e10 highlight: refactor to use stateful representation
This allows us to keep track of the source higlight groups,
and not only the final combined highlights.
2018-07-21 13:20:37 +02:00
Justin M. Keyes
489d32f2b8
startup: fix ":if 0|syntax on|endif" bug (#8731)
Problem: ":if 0|syntax {on,off}|endif" skips the default of "syntax on"
because the executor was setting the `did_syntax_onoff` flag even though
"syntax {on,off}" is not actually executed.

closes #8728
2018-07-18 14:30:11 +02:00
Justin M. Keyes
fc45c97829 Merge #8736 'vim-patch:8.0.0697: stable keymap.h' 2018-07-13 20:54:52 +02:00
Jan Edmund Lazo
175297a23a tests: <SNR> is represented as 'R' (ASCII) 2018-07-12 20:26:54 -04:00
Marco Hinz
01570f1ff3
terminal: handle &confirm and :confirm on unloading (#8726)
Show a proper confirmation dialog when trying to unload a terminal buffer while
the confirm option is set or when :confirm is used.

Fixes https://github.com/neovim/neovim/issues/4651
2018-07-12 14:57:20 +02:00
Björn Linse
56065bbdc6
Merge pull request #8721 from bfredl/quickresize
Fix redrawing issues with narrow screen and remove extra wait in resize tests
2018-07-12 12:21:11 +02:00
Björn Linse
e51bffefa5 screen: truncate showmode messages
Before this, bottom of screen got messed up when modemsg (+ one extra
space to not force terminal scroll) didn't fit on one line.
2018-07-12 10:27:23 +02:00
Björn Linse
38f0ac07b5 tests/screen.lua: treat "resize" like any other event
Saves ~10 seconds in UI tests
2018-07-11 12:57:01 +02:00
James McCoy
9f8bd77d7b
test/includes: Use ${gen_cdefs} when pre-processing headers
Now that uv.h is directly being included, pre-processing of
test/includes/pre/uv.h fails on Linux with

    In file included from «SRCDIR»/neovim/test/includes/pre/uv.h:1:
    In file included from /usr/include/uv.h:62:
    /usr/include/uv/unix.h:72:11: fatal error: 'uv/pthread-barrier.h' file not found
    # include "uv/pthread-barrier.h"
              ^~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

This happens because we're missing -D_GNU_SOURCE (part of ${gen_cdefs}),
which makes the pthread_barrier_* functionality visible.
2018-07-11 00:26:28 -04:00
James McCoy
ba7704ab4e
test: Rename includes/pre/uv-errno.h to includes/pre/uv.h
libuv users are only supposed to directly include uv.h.  In v1.21.0, all
the uv-*.h headers were renamed to uv/*.h, which caused the unit tests
to fail with

    [123/125] Generating post/uv-errno.h
    FAILED: test/includes/post/uv-errno.h
    cd «SRCDIR»/src/neovim/build/test/includes && /usr/bin/clang -std=c99 -E -P «SRCDIR»/src/neovim/test/includes/pre/uv-errno.h -I/usr/include -I/usr/include -o «SRCDIR»/neovim/build/test/includes/post/uv-errno.h
    «SRCDIR»/src/neovim/test/includes/pre/uv-errno.h:1:10: error: 'uv-errno.h' file not found with <angled> include; use "quotes" instead
    #include <uv-errno.h>
             ^~~~~~~~~~~~
             "uv-errno.h"

The intention of the file is to extend libuv's error constants with more
values used by the unit tests.  This can just as easily be achieved
without poking into pseudo-private header files.
2018-07-11 00:26:07 -04:00
Michael Hoffmann
0ed8b12a07 transstr_buf: fix length comparison #8681
closes #8466
closes #8664
Regression by 0d7daaad98.

- Fix length comparison.
- Fix loop(s) which iterated over all fields of array `pcc` even if it
  was not filled up (try unicode 0x9f as statusline character).

Note about the tests:
- To input unicode with more than two hex digits you can use <C-v>U...:
  a + U+fe20: a︠
  a + U+fe20 + U+fe21: a︠︡
2018-07-10 21:57:26 +02:00
ZviRackover
627cc1b3d8 test: build_stl_str_hl (#8703)
Improve coverage of `build_stl_str_hl`.
Minor removal of dead code in the tested function.
2018-07-10 20:46:40 +02:00
Jan Edmund Lazo
a5ed460241 tests: endfunc allows uncommented bar 2018-07-07 13:31:55 -04:00
Justin M. Keyes
f65a751d82 test: nvim_buf_attach: reduce delay
This test is mostly a demo/reference for:
https://github.com/neovim/neovim/issues/8634#issuecomment-400940467
so let's not pay a 1s penalty.
2018-07-02 20:47:28 +02:00
Justin M. Keyes
b4fcf02316 test: nvim_buf_attach response after initial delay
ref #8634
2018-07-01 17:31:58 +02:00
Justin M. Keyes
60ef7889a2 test: buffer_updates: 10s timeout 2018-07-01 17:31:00 +02:00
Justin M. Keyes
ef9ef75a7b
Merge #8635 from janlazo/vim-8.0.0252 2018-07-01 15:29:20 +02:00
Justin M. Keyes
22d95e462e
coverity/108274: tty-test.c: Insecure data handling (#8666) 2018-07-01 14:48:30 +02:00
Jan Edmund Lazo
3e4a058b01 test: port kword_test to Lua for utf_char2bytes()
Use LuaJIT FFI to create char pointer.
Validate output with utf_ptr2char(), vim_iswordc() and vim_iswordp().
Use const for LuaJIT string-to-char conversion.
2018-07-01 08:45:19 -04:00
KillTheMule
40911e435e API: emit nvim_buf_lines_event from :terminal #8616
closes #8575
2018-07-01 14:42:56 +02:00
Yichao Zhou
12481781a0 highlight: high-priority CursorLine if fg is set. #8578
closes #7383
closes #7715

This implements the compromise described in #7383:
* low-priority CursorLine if foreground is not set
* high-priority ("same as Vim" priority) CursorLine if foreground is set

ref d1874ab282
ref 56eda2aa17
2018-06-28 01:49:40 +02:00
David Hotham
1cbc830189 API: nvim_win_set_cursor: set curswant #8613
Fixes #8591
2018-06-25 02:14:55 +02:00
Jan Edmund Lazo
14b3741ec5 test: update writefile test for invalid list items
It validates list items with tv_check_str_on_nr()
to catch invalid types (ex. E745, E805).
If there is an invalid item, it does not write to the file.
2018-06-24 16:22:16 -04:00
Justin M. Keyes
b7514493a0
defaults: shortmess+=F (#8619)
Because we default to laststatus=2 (statusline is always visible), the
:edit message is not useful.

ref #6289
2018-06-22 08:18:02 +02:00
Justin M. Keyes
6294a807d3
Merge #8579 win: cmake: Improvements for building with IDEs 2018-06-20 02:19:42 +02:00
Justin M. Keyes
9625e9da75 startup: delete empty stdin buffer if other files were opened
DWIM: avoid empty buffer 1 when stdin was empty. If other files were
specified at startup, we assume that stdin is only accidentally
not-a-TTY: user did not intend to send text from it.

ref #8560
ref #8561
2018-06-18 21:51:42 +02:00
Justin M. Keyes
d44ed79ccc startup: go to buffer 2 if stdin is empty
If stdin is not a TTY we read it into buffer 1, as text. But if the
stdin pipe is empty, Nvim was most likely invoked for some other reason.
DWIM: select buffer 2 (if it exists). Example:

    echo file1 | xargs nvim

closes #8560
closes #8561
ref https://github.com/equalsraf/neovim-qt/issues/417
2018-06-18 17:51:38 +02:00
b-r-o-c-k
7097aba6be cmake: Organize targets into folders
Enabling CMake's USE_FOLDERS option and adding the FOLDER property to
targets allows some IDEs to list the targets in an organized
hierarchy of folders.
2018-06-17 07:54:39 -05:00
Justin M. Keyes
487cf98c0b startup: fix -E/-Es without -u NONE
Before this change, -E/-Es without `-u NONE` reads stdin as Ex commands.
It should always read stdin as text (into buffer 1), like this:

    echo foo | nvim -Es +'%p'
    foo
    echo foo | nvim -Es -u NORC +'%p'
    foo
2018-06-17 14:50:53 +02:00
Justin M. Keyes
9c2099d585 Ex mode: use getexline() instead of getexmodeline()
This changes Ex mode (Q, -e) to work like Vim's "improved Ex mode"
(gQ, -E).  That brings some small behavior differences, but should not
impact most Ex scripts (unless, for example, they depend on mappings
being disabled--but that can be solved for -e by skipping user config).

Before this change:
* the screen test hangs.

After this change:
* Q acts like gQ.
* -e/-es differs from -E/-Es only in its treatment of stdin.

This moves towards potentially removing getexmodeline().
(HINT: That does NOT mean "removing Ex mode", it means removing the
Vi-compatible Ex mode, which differs from Vim's "improved Ex mode" only
in some minor details (e.g. mappings are disabled).)

ref #1089 :-)~
2018-06-17 14:50:53 +02: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
c46997aa87
Merge pull request #8546 from bfredl/eob
Add fillchar for EndOfBuffer and check for invalid UTF-8
2018-06-14 18:00:59 +02:00
Björn Linse
5442f0b622 fillchars: make checks more strict and improve tests 2018-06-14 14:00:09 +02:00
James McCoy
6c0f1903e6
functionaltest: Use octal escapes for printf
According to POSIX[0], only octal escapes are supported by the printf
command.  GNU coreutils' printf and some shells' builtin printf versions
which support hex escapes, but dash and non-GNU printf do not.

[0]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html
2018-06-13 23:03:37 -04:00
Jack Bracewell
a7bb63c55d Add ‘eob’ option to fillchars
This option allows configuring what character is shown on the empty
lines at the end of a buffer, previously hardcoded to ‘~’
2018-06-13 17:54:16 +02:00
Björn Linse
050f3975f6 options: remove 'maxcombine` option (always use 6) 2018-06-13 10:11:35 +02:00
Björn Linse
315b7f8632
test/ui: doublewidth rendering. multibyte and cmdwin chars in folded lines (#8534) 2018-06-12 17:57:47 +02:00
Justin M. Keyes
44c6deb91a NVIM v0.3.0
FEATURES:
3cc7ebf810 #7234 built-in VimL expression parser
6a7c904648 #4419 implement <Cmd> key to invoke command in any mode
b8363283fa #7679 'startup: treat stdin as text instead of commands'
58b210e114 :digraphs : highlight with hl-SpecialKey #2690
7a13611ba2 #8276 'startup: Let `-s -` read from stdin'
1e71978cf0 events: VimSuspend, VimResume #8280
1e7d5e8cdf #6272 'stdpath()'
f96d99ad11 #8247 server: introduce --listen
e8c39f72fd #8226 insert-mode: interpret unmapped META as ESC
98e7112390 msg: do not scroll entire screen (#8088)
f72630b784 #8055 let negative 'writedelay' show all redraws
5d2dd2ebe2 win: has("wsl") on Windows Subsystem for Linux #7330
a4f6cec7a3 cmdline: CmdlineEnter and CmdlineLeave autocommands (#7422)
207b7ca4bc #6844 channels: support buffered output and bytes sockets/stdio

API:
f85cbea725 #7917 API: buffer updates
418abfc9d0 #6743 API: list information about all channels/jobs.
36b2e3f743 #8375 API: nvim_get_commands
273d2cd5d5 #8329 API: Make nvim_set_option() update `:verbose set …`
8d40b3617c #8371 API: more reliable/descriptive VimL errors
ebb1acb3c0 #8353 API: nvim_call_dict_function
9f994bb699 #8004 API: nvim_list_uis
34057045be #7520 API/UI: forward option updates to UIs
911b1e49ab #7821 API: improve nvim_command_output

WINDOWS OS:
9cefd83cc7 #8084, #8516 build/win: support MSVC
ee4e1fd8ec win: Fix reading content from stdin (#8267)

TUI:
ffb8904913 #8309 TUI: add support for mouse release events in urxvt
8d5a46e77b #8081 TUI: implement "standout" attribute
60716371e9 TUI: support TERM=konsole-256color
67848c0b91 #7653 TUI: report TUI info with -V3 ('verbose' >= 3)
3d0ee17c91 TUI/rxvt: enable focus-reporting
d109f5645b #7640 TUI: 'term' option: reflect effective terminal behavior

FIXES:
ed6a113804 #8273 'job-control: avoid kill-timer race'
4e02f1ab87 #8107 'jobs: separate process-group'
451c48a092 terminal: flush vterm output buffer on pty output #8486
5d6732ff09 :checkhealth fixes #8335
53f11dcfc7 #8218 'Fix errors reported by PVS'
d05712fbe7 inccommand: pause :terminal redraws (#8307)
51af911a27 inccommand: do not execute trailing commands #8256
84359a467f terminal: resize to the max dimensions (#8249)
d49c1dda8b #8228 Make vim_fgets() return the same values as in Vim
60e96a45b4 screen: winhl=Normal:Background should not override syntax (#8093)
0c59ac1a2c #5908 'shada: Also save numbered marks'
ba87a2cde7 cscope: ignore EINTR while reading the prompt (#8079)
b1412dc412 #7971 ':terminal Enter/Leave should not increment jumplist'
3a5721e91b TUI: libtermkey: force CSI driver for mouse input #7948
6ff13d78b7 #7720 TUI: faster startup
1c6e956079 #7862 TUI: fix resize-related segfaults
a58c9094db #7676 TUI: always hide cursor when flushing, never flush buffers during unibilium output
303e1df13f #7624 TUI: disable BCE almost always
249bdb07dd #7761 mark: Make sure that jumplist item will not have zero lnum
6f41ce0260 #7704 macOS: Set $LANG based on the system locale
a043899ba2 #7633 'Retry fgets on EINTR'

CHANGES:
ad60927d09 #8304 default to 'nofsync'
f3f1970597 #8035 defaults: 'fillchars'
a6052c7307 #7984 defaults: sidescroll=1
b69fa866db #7888 defaults: enable cscopeverbose
7c4bb23ff3 defaults: do :filetype stuff unless explicitly "off"
2aa308c685 #5658 'Apply :lmap in macros'
8ce6393048 terminal: Leave 'relativenumber' alone (#8360)
e46534b423 #4486 refactor: Remove maxmem, maxmemtot options
131aad953c win: defaults: 'shellcmdflag', 'shellxquote' #7343
c57d315963 #8031 jobwait(): return -2 on interrupt also with timeout
6452831cf9 clipboard: macOS: fallback to tmux if pbcopy is broken #7940
300d3651e2 #7919 Make 'langnoremap' apply directly after a map
ada1956206 #7880 'lua/executor: Remove lightuserdata'

INTERNAL:
de0a9548f7 #7806 internal statistics for list impl
dee78a4095 #7708 rewrite internal list impl
2018-06-11 00:46:49 +02:00
Justin M. Keyes
f72f638f97 doc: job/channel, misc #7783
doc: termios defaults. ref #6992
doc: :help shell-powershell
doc: provider: Python minimum version is 2.7, 3.4
doc: remove :!start special-case. #5844
doc: mention #7917 change which accepts empty Array for Dictionary parameter
doc: <Cmd> pseudokey
doc: lmap change #5658
doc: -s, -es
2018-06-11 00:08:27 +02:00
Justin M. Keyes
dc5fdbc758 test: fix startup_spec
This behavior was changed (improved) by 5861dc5966 which actually
makes -E more faithful to Vim's behavior.
2018-06-10 16:27:13 +02:00
Justin M. Keyes
b8363283fa
Merge #7679 'startup: treat stdin as text instead of commands' 2018-06-10 15:10:59 +02:00
Justin M. Keyes
f85cbea725 Merge #7917 'API: buffer updates' 2018-06-08 10:13:04 +02:00
林千里
451c48a092 terminal: flush vterm output buffer on pty output #8486
Fixes #4151

libvterm uses an "output buffer" for terminal reporting
(e.g. \e[6n to report cursor position)
Flush it in on_channel_output() not just terminal_send_key()

See also this line from pangoterm:
https://bazaar.launchpad.net/~leonerd/pangoterm/trunk/view/607/pangoterm.c#L2159
2018-06-08 02:18:27 +02:00
Justin M. Keyes
db68d1d638
Merge #8491 from janlazo/vim-8.0.0255 2018-06-07 18:31:50 +02:00
Jan Edmund Lazo
e0d39d8e53 vim-patch:8.0.0256: missing changes to one file breaks test
Problem:    Tests fail because some changes were not included.
Solution:   Add changes to evalfunc.c
3a29abcb61
2018-06-07 12:02:57 -04:00
Justin M. Keyes
3abf17ae88
API: validation: mention invalid method name (#8489) 2018-06-07 10:56:44 +02:00
Jan Edmund Lazo
7f6c1d256f vim-patch:8.0.0254: error message of assert functions (#8488)
Problem:    When using an assert function one can either specify a message or
            get a message about what failed, not both.
Solution:   Concatenate the error with the message.
c7b831ca15
2018-06-07 09:59:45 +02:00
Justin M. Keyes
5861dc5966
Merge #8461 from bfredl/scrollstatus 2018-06-06 00:34:08 +02:00
Jan Edmund Lazo
6ffcc2b800 fixup: exclude node_modules/ for crash detection
node.js client uses lodash which has core.js.
2018-06-05 07:33:26 -04:00
Jan Edmund Lazo
f274b84e1e test: give more time for nodejs
Link neovim package to project root directory.
Increase delay to 3 seconds.
Reduce the total lines in temporary node scripts.
2018-06-04 19:42:28 -04:00
Justin M. Keyes
d8c7ff1335 cleanup, test interactive -E 2018-06-04 02:09:28 +02:00
Justin M. Keyes
1f300e08b8 win/startup: remove --literal
Fixes 2 failing tests in startup_spec.lua.

The Windows-only `--literal` option complicates support of "stdin-as-text
+ file-args" (#7679).  Could work around it, but it's not worth
the trouble:
- users have a reasonable (and englightening) alternative: nvim +"n *"
- "always literal" is more consistent/predictable
- avoids platform-specific special-case

Unrelated changes:
- Replace fileno(stdxx) with STDXX_FILENO for consistency (not motivated
  by any observed technical reason).
2018-06-04 02:09:27 +02:00
Justin M. Keyes
4211255c75 startup: allow explicit "-" file arg with --headless 2018-06-04 02:09:27 +02:00
Justin M. Keyes
63058fb5b0 startup: fix -es/-Es so they are actually silent
silent-mode (-es/-Es) has been broken for years.  The workaround up to
now was to include --headless.  But --headless is not equivalent because
it prints all messages, not the limited subset defined by silent-mode.
2018-06-04 02:09:27 +02:00
Justin M. Keyes
51e817dc1b startup: stdin as text instead of commands
Treat stdin as text by default (so the "-" file is not needed):
    echo foo | nvim

It works with file args (implemented in next commit), too:
    echo foo | nvim file1.txt file2.txt

Why? Because:
- Execution of input is (1) almost always unintentional/confusing,
  and (2) potentially destructive.
- Avoids the need for time-delayed warning.  #7659
- The _common_ case is to open text in a buffer, not send commands.

Note:
- Not for Ex-mode (-es) because it is used by scripts.  But maybe `-Es`?
- Not for --headless, because stdio may be a protocol stream and may be
  used for any purpose by stdioopen().

To treat stdin as Normal-mode commands, use `-s -` instead:
    echo ifoo | nvim -s -
Other alternatives:
  - Replay a register. E.g. the following mostly works, except @q aborts
    on any "beep" (e.g. if the cursor can't move).
    nvim -c '%d q|norm @q' -
  - Future: Let `:%source` work with unsaved buffer contents?

closes #2087
closes #7659
2018-06-04 02:07:39 +02:00
Justin M. Keyes
402a797d08
Merge #8456 'API: nvim_list_uis: include channel id' 2018-06-03 08:29:45 +02:00
Björn Linse
37e00c6e65 ex_getln: remove msg_scrolled cargo-cult magic, fixes #8251 2018-06-02 10:07:07 +02:00
Björn Linse
1efe65a155 ex_getln: don't redraw statusline on top of scrolled messages 2018-06-02 09:39:39 +02:00
Alexander Karle
39a03c0fe7 wildmenu: close before redrawing statusline (#8453)
Fixes #8385
2018-06-02 00:22:53 +02:00
Björn Linse
5be3865ce7 nvim_list_uis: include channel id 2018-06-01 10:20:13 +02:00
Jan Edmund Lazo
e21f454e11 fixup: always delete Xfile, fix exit code check
after_each + os.remove ensures Xfile is deleted after every test.
Windows exit code is inconsistent.
2018-05-25 07:43:02 -04:00
Jan Edmund Lazo
05282069db win: test: close shada file before os.remove 2018-05-24 22:11:16 -04:00
Jan Edmund Lazo
51db8ebf67 win: test: delete sautest/ 2018-05-24 22:11:15 -04:00
Jan Edmund Lazo
64177e3e98 win: test: don't test symlink if not admin user 2018-05-24 22:11:14 -04:00
Jan Edmund Lazo
209f05b487 win: test: disable non-admin failing tests
mkfifo (msysgit) does not work outside of msys2 environment.
gzip tests fail on Windows.

mklink requires admin privs for file symbolic links so mklink fails.
2018-05-24 22:11:12 -04:00
KillTheMule
333679ad0e Add empty options dict to buf_attach 2018-05-23 22:07:27 +02:00
KillTheMule
65e7f6f0b9 Rename some more, fixe borked renaming 2018-05-23 22:07:27 +02:00
KillTheMule
0bee3925ab Send changedtick as first event if buffer contents weren't requested 2018-05-23 22:07:27 +02:00
KillTheMule
ad151847f1 Unify updates_start and updates to lines_event
Also rename changedtick -> changedtick_event
2018-05-23 22:07:27 +02:00
KillTheMule
3866137eed Update test 2018-05-23 22:07:27 +02:00
KillTheMule
e7451f8a91 Some renamings and doc changes 2018-05-23 22:07:27 +02:00
KillTheMule
de5d1e863c Try fixing that test on travis 2018-05-23 22:07:27 +02:00
KillTheMule
5aa8af7cdb Increase sendkeys timeout 2018-05-23 22:07:27 +02:00
KillTheMule
6bdcbef2f5 The grand renaming 2018-05-23 22:07:27 +02:00
KillTheMule
ec215a1962 Fix tests on windows
`cat` is distributed with neovim, so when can use it everywhere, as
opposed to `sort`.

The diffget test fails for unknown reasons on appveyor, mark it pending
for now.
2018-05-23 22:07:27 +02:00
KillTheMule
0476e0aef3 Make LiveUpdate return lastline instead of numreplaced
In analogy to `nvim_buf_set_lines`.
2018-05-23 22:07:27 +02:00
KillTheMule
37b8e95fd6 Lint 2018-05-23 22:07:27 +02:00
KillTheMule
8bcc011959 Make separate functions to start/stop live updates 2018-05-23 22:07:27 +02:00
KillTheMule
bafae1c427 Add argument to not send a buffers content when updates are enabled
Add a test.
2018-05-23 22:07:27 +02:00
Peter Hodge
79184809bb Tests for buffer updates
Originally written by @phodge in
https://github.com/neovim/neovim/pull/5269.
2018-05-23 22:07:27 +02:00
Björn Linse
6da4548f0e api: list information about all channels/jobs.
Fire autocmd when channel opens or its info changes.
Add a way for API clients can describe themselves.
2018-05-23 18:18:16 +02:00
Justin M. Keyes
d995825c66 Merge #8377 'TextChangedP autocommand' 2018-05-19 11:44:52 +02:00
Justin M. Keyes
3de81ea351
test: inccommand_spec: retry unreliable test (#8311) 2018-05-18 19:41:14 +02:00
Justin M. Keyes
2ed2939597
Merge #8406 'stdpath(): handle NULL default values' 2018-05-18 19:33:28 +02:00
Justin M. Keyes
26d5a981eb do not pass NULL to os_getenv
closes #8393
2018-05-18 19:04:37 +02:00
Björn Linse
a676c658cc channel: avoid references to non-rooted vimL list with output
likely fixes #7768 #7913

If multiple internal stream callbacks were recieved before vimL
callbacks got called, only invoke one vimL callback with all data.
2018-05-17 19:09:32 +02:00
Justin M. Keyes
2aa308c685
Merge #5658 'Apply :lmap in macros' 2018-05-17 02:13:31 +02:00
Justin M. Keyes
efb6caa39b test: nodejs_spec: fix test after upstream API change
closes https://github.com/neovim/node-client/issues/72
2018-05-15 00:03:21 +02:00
Shougo Matsushita
021c5875c1 vim-patch:8.0.1494: no autocmd triggered in Insert mode with visible popup menu
Problem:    No autocmd triggered in Insert mode with visible popup menu.
Solution:   Add TextChangedP. (Prabir Shrestha, Christian Brabandt,
            closes vim/vim#2372, closes vim/vim#1691)
            Fix that the TextChanged autocommands are not always triggered
            when sourcing a script.

5a09343719
2018-05-14 19:14:25 +08:00
Justin M. Keyes
137eedb4ed API: nvim_get_commands(): return Dictionary 2018-05-12 07:29:21 +02:00
Justin M. Keyes
cb6672853a API: nvim_get_commands(): builtin is irrelevant for buffer-local
builtin commands are never buffer-local, so we can return empty for that
case.
2018-05-12 07:29:21 +02:00
Justin M. Keyes
738bffea2c API: nvim_get_commands(): more attributes
Support more :command attributes:
  -bang
  -bar
  -register
2018-05-11 13:50:00 +02:00
Justin M. Keyes
9fa7727ce0 API: nvim_get_commands(): always return keys
- Always return all keys, with at least NIL value.
- Require `opts` param to be {"builtin":false}
- Validate `opts` param
2018-05-11 13:20:43 +02:00
Nimit Bhardwaj
25b6304840 API: nvim_get_commands() 2018-05-11 13:20:19 +02:00
Justin M. Keyes
273d2cd5d5 Merge #8329 'API: Make nvim_set_option() update :verbose set …' 2018-05-11 10:08:09 +02:00
Justin M. Keyes
8d40b3617c
Merge #8371 'API: more reliable/descriptive VimL errors' 2018-05-10 19:18:58 +02:00
raichoo
3a6b80f2f4 UI: redraw statusline when entering cmdline (#8347) 2018-05-10 14:55:07 +02:00
Justin M. Keyes
79a0d82755 test: API: fix tests after improved error capture 2018-05-10 04:01:25 +02:00
Justin M. Keyes
2326a4ac3a API: nvim_eval(): return non-generic VimL errors
Use the same pattern as nvim_call_function (_call_function).
2018-05-09 23:18:39 +02:00
Justin M. Keyes
c9f3174075 API: return non-generic VimL errors
- Return VimL errors instead of generic errors for:
  - nvim_call_function
  - nvim_call_dict_function
- Fix tests which were silently broken before this change.

This violates #6150 where we agreed not to translate API errors.  But
that can be fixed later.
2018-05-09 23:18:38 +02:00
Justin M. Keyes
cabffb0182 API: nvim_call_dict_function: expect actual function, not name 2018-05-06 14:52:21 +02:00
Justin M. Keyes
fe7ab60af7 API: nvim_call_dict_function: eliminate internal param
The `internal` param is difficult to explain, and will rarely be
anything but `true`.  To avoid it, use a hack: check if the resolved
dict value starts with "function(".
2018-05-06 14:38:26 +02:00
Justin M. Keyes
19c2ce1901 refactor: nvim_call_dict_function
- Add test coverage for errors.
- Rename, rearrange.
2018-05-06 14:38:26 +02:00
Sebastian Witte
124275dd58 API: nvim_call_dict_function #3032 2018-05-06 14:38:26 +02:00
Justin M. Keyes
f46f138fb6 test: nvim_call_function: verify "too many arguments" error 2018-05-06 14:38:26 +02:00
James McCoy
5009317525
Merge pull request #8358 from mhinz/screen
[RFC] screen: avoid artifacts
2018-05-04 19:42:58 -04:00
Marco Hinz
ec1a7791b0
test: screen artifacts 2018-05-04 22:14:27 +02:00
Björn Linse
0d037ad978 messages: redraw tabline if it was overdrawn by messages
fixes #8354

Regression from #8088, where we try to avoid clearing the screen
if not absolutely necessary
2018-05-04 09:15:19 +02:00
b-r-o-c-k
7170de1971 api: Make nvim_set_option() update :verbose set ...
Make `:verbose set ...` show when an option was last modified by an
API client or Lua script/chunk. In the case of an API client, the
channel ID is displayed.
2018-05-03 21:05:20 -05:00
Jakson Alves de Aquino
58b210e114 :digraphs : highlight with hl-SpecialKey #2690
closes #2690
2018-05-01 11:33:50 +02:00
Justin M. Keyes
4744142fad lint 2018-04-28 11:01:16 +02:00
Justin M. Keyes
bd17ef75b3 test/unit/undo_spec.lua: fixup after rebase #4985 2018-04-27 13:06:41 +02:00
Justin M. Keyes
d6a1640260 test/util: move general functions into global helpers 2018-04-27 13:06:41 +02:00
Christopher Waldon
34f29ac858 test/unit: some unit tests for undo.c #4985 2018-04-27 13:06:31 +02:00
Justin M. Keyes
53f11dcfc7
Merge #8218 'Fix errors reported by PVS'
closes #4983
2018-04-27 09:25:02 +02:00
Justin M. Keyes
ad60927d09
Merge #8304 "default to 'nofsync'" 2018-04-24 02:51:07 +02:00
Justin M. Keyes
77cb14cc6d API: nvim__stats()
Use it to verify fsync() behavior.
2018-04-24 00:44:06 +02:00
Justin M. Keyes
32f3937477 test: fsync() codepaths 2018-04-23 21:29:07 +02:00
ZyX
03c2844b53 functests: Fix testlint errors 2018-04-22 20:32:25 +03:00
Justin M. Keyes
d05712fbe7
inccommand: pause :terminal redraws (#8307)
fix #5584
2018-04-22 12:26:16 +02:00
Nimit Bhardwaj
51af911a27 inccommand: do not execute trailing commands #8256
fix #7494
2018-04-21 13:06:46 +02:00
Justin M. Keyes
fe5f38d8bd
terminal: do not call redraw_buf_later() (#8306)
fixes #8290
2018-04-21 04:11:45 +02:00
Justin M. Keyes
be2a3ddd58
test: "Command-line option -s": avoid indeterminism (#8305)
closes #8303
2018-04-21 03:15:18 +02:00
Justin M. Keyes
c10a207a20
test/util: throttle retry() (#8296)
Avoid a hot loop in retry(), there's no need to retry more than 50/s.

Also use luv.sleep() to implement sleep() instead of spinning the
event-loop, so events are not silently discarded.
2018-04-20 23:56:50 +02:00
Justin M. Keyes
522443d6bf test/util: retry(): also decorate non-string error 2018-04-18 09:47:51 +02:00
Justin M. Keyes
1dc497398e test: nodejs_spec: allow more time for nodejs init 2018-04-18 09:42:56 +02:00
Justin M. Keyes
7a13611ba2
Merge #8276 'startup: Make -s - read from stdin' 2018-04-17 10:33:36 +02:00
Justin M. Keyes
48967695c4
test: tui_spec.lua: relax test (#8289)
Sometimes an extra FocusGained/FocusLost event might trigger. This
doesn't matter, we just want to test that the events were received in
cmdline-mode.
2018-04-16 23:35:58 +02:00
Andrew Pyatkov
84359a467f terminal: resize to the max dimensions (#8249)
closes #8096
2018-04-16 22:25:23 +02:00
Justin M. Keyes
b2c066409d job-control: children_kill_cb(): do not check elapsed time
1. Don't check elapsed time in children_kill_cb(), it's already implied
   by the start-time of the timer itself.
2. Restart timer from children_kill_cb() for PTY jobs, to send SIGKILL
   after SIGTERM. There is an edge case where SIGKILL might follow
   SIGTERM too quickly, if jobstop() is called near the 2-second timer
   window.  But this edge case is not worth code complication.
2018-04-15 18:23:11 +02:00
Justin M. Keyes
7598e6cf17
Merge #8120 'test: win: prefer cmd.exe' 2018-04-15 18:16:37 +02:00
ZyX
f8d574225b eval: Silence PVS/V547: E882 may be triggered
I failed to deduce why analyzer thinks E882 may not be triggered, though 
conditions for triggering it are strange: it would trigger E882 only in the 
single case “function returned non-number”. Cases “function thrown exception”, 
or “built-in sorter encountered error” will neither yield E882 nor stop 
sort()/uniq().

Note though that searching test code revealed that neither E702 nor E882 are not 
tested anywhere.
2018-04-15 18:45:12 +03:00
geekodour
1e71978cf0 events: VimSuspend, VimResume #8280
closes #3648
ref #5959
2018-04-15 15:05:02 +02:00
Justin M. Keyes
1e7d5e8cdf
Merge #6272 'stdpath()' 2018-04-15 04:09:30 +02:00
Jan Edmund Lazo
5abfa94ed2 test: win: use "start" to test backgrounded job (#8171) 2018-04-15 02:43:18 +02:00
b-r-o-c-k
387fbcd95c win: Fix reading from stdin
* Reading from stdin on Windows is fixed in the same way as it was in
  #8267.
* The file_read function was returning without filling the
  destination buffer when it was called with a non-blocking file
  descriptor.
2018-04-14 14:21:36 -05:00
b-r-o-c-k
ad999eaa77 Merge branch 'master' into s-dash-stdin 2018-04-14 14:17:51 -05:00
Justin M. Keyes
1c3a849881
API/nvim_command_output: handle :echon capture (#8265)
ref https://github.com/neovim/python-client/pull/290
2018-04-13 00:49:37 +02:00
Björn Linse
aea079a25d channels: delay free so that libuv can cleanup handles
add test for a crash this caused
2018-04-12 18:22:47 +02:00
Justin M. Keyes
87f4d2592c
test/util: expect_err() (#8257)
other cleanup, ref #8245
2018-04-11 22:07:00 +02:00
Justin M. Keyes
704ba4151e server: init v:servername if $NVIM_LISTEN_ADDRESS is invalid
Before this change, if $NVIM_LISTEN_ADDRESS was invalid, v:servername
was left empty.
2018-04-11 02:41:05 +02:00
Justin M. Keyes
507bda1c95 server: introduce --listen, deprecate $NVIM_LISTEN_ADDRESS 2018-04-11 02:41:05 +02:00
Justin M. Keyes
9f598e5765 serverstop(): return FALSE for invalid address 2018-04-11 01:58:41 +02:00