Commit Graph

1940 Commits

Author SHA1 Message Date
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
d6a1640260 test/util: move general functions into global helpers 2018-04-27 13:06:41 +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
Justin M. Keyes
b11b681289 test/util: matches() 2018-04-11 01:58:41 +02:00
Justin M. Keyes
fa6415f13f
test/API: validate channel arg (#8245) 2018-04-08 03:01:15 +02:00
Justin M. Keyes
e8c39f72fd
Merge #8226 from justinmk/insert-mode-meta 2018-04-04 04:36:13 +02:00
Justin M. Keyes
224ebc0078 insert-mode: interpret unmapped META as ESC
closes #2454
closes #8213
ref #7972
2018-04-04 03:23:15 +02:00
Björn Linse
60e96a45b4 screen: winhl=Normal:Background should not override syntax (#8093)
fixes #7375
2018-04-02 14:21:14 +02:00
Justin M. Keyes
0c59ac1a2c
Merge #5908 'shada: Also save numbered marks' 2018-04-02 12:01:00 +02:00
ZyX
5d9bb16d66 functests: Use proper path in eq() 2018-04-02 11:14:11 +03:00
James McCoy
ec459965f5
test/options: Fix stdpath() failures on Windows 2018-04-01 22:40:20 -04:00
ZyX
dd1b493f75 shada: Fix some memory leaks and completely ignore numbered mark names
Problems:
- In two places in shada_read_when_writing() memory just was not freed. Both 
  places were verified to cause test failures.
- Numbered marks got assigned incorrect (off-by-one compared to position in the 
  array) numbers in replace_numbered_mark.
- It was possible to have non-continuously populated array of numbered marks 
  which messed up code for merging them.

(Note about tests: marks with additional data are always compared different when 
merging, that caused some confusion regarding why test did not work the way 
I expected.)
2018-04-01 21:29:47 +03:00