ZyX
64158f2b0b
unittests: Populate ARGTYPES in child process only
2017-11-19 22:32:02 +03:00
ZyX
03a129aacf
Merge branch 'master' into expression-parser
2017-11-19 22:05:22 +03:00
ZyX
7c20f60b88
unittests: Avoid infinite cycle somewhere because of init failure
2017-11-19 22:01:14 +03:00
ZyX
ebb33eddd9
tests: Stabilize float format and %e in format_luav and format_string
2017-11-19 22:00:59 +03:00
ZyX
f20f97c936
*: Fix linter errors
2017-11-19 21:13:27 +03:00
ZyX
a94255a7ac
tests: Use single test file for unit and functional parser tests
2017-11-19 20:20:06 +03:00
ZyX
53fa435a1f
functests: Fix ui/cmdline test
2017-11-19 19:34:15 +03:00
ZyX
c287893225
viml/parser/expressions,unittests: Do better testing, fix found issues
2017-11-19 19:22:54 +03:00
Eric Roberts
a6de144c3e
'viewoptions': add "curdir" flag #7447
...
The flag enables the current local directory set by ":lcd" to be saved
to views which is the current default behaviour. The option can be
removed to disable this behaviour.
closes #7435
vim-patch:8.0.1289
2017-11-18 12:02:15 +01:00
Justin M. Keyes
67e4529292
defaults: scrollback=10000 ( #7556 )
2017-11-14 20:55:25 +01:00
nateozem
30a21830d0
doc: test/README.md: migrate wiki info ( #7552 )
2017-11-14 01:43:52 +01:00
James McCoy
8d8212d384
Merge pull request #7545 from jamessan/test-fixes
...
Fix test failures found in Debian builds, closes #7522
2017-11-12 21:09:44 -05:00
Marco Hinz
d5b7f28b44
test/unit/path_spec: expect correct buffer size ( #7514 )
...
Fixed-size buffers and lfs.currentdir().. does not compute. The tests would fail
if the current working directory was longer than expected.
2017-11-13 02:28:07 +01:00
Justin M. Keyes
e6beb60da5
:terminal : fix crash on resize ( #7547 )
...
closes #7538
Fix wrong window references from #7440
Remove some eager resizing. Still mostly doesn't address #4997 .
2017-11-13 02:06:32 +01:00
ZyX
342239a9c5
unittests,viml/parser/expressions: Start adding asgn parsing tests
2017-11-13 01:11:13 +03:00
ZyX
39c75d31be
unittests: Fix automatic test case generation
2017-11-13 01:11:13 +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
James McCoy
b63cde97f4
tests: terminal: Assert for SIGWINCH handling before continuing
...
Fixes test failures like
test/functional/terminal/cursor_spec.lua @ 62: terminal cursor with number column is positioned correctly when focused
./test/functional/ui/screen.lua:302: Row 2 did not match.
Expected:
|{7: 1 }tty ready |
|*{7: 2 }{1: } |
|{7: 3 } |
|{7: 4 } |
|{7: 5 } |
|{7: 6 } |
|{3:-- TERMINAL --} |
Actual:
|{7: 1 }tty ready |
|*{7: 2 }rows: 6, cols: 46 |
|{7: 3 }{1: } |
|{7: 4 } |
|{7: 5 } |
|{7: 6 } |
|{3:-- TERMINAL --} |
2017-11-12 16:45:39 -05:00
James McCoy
cf75de710c
tui_spec: Convert nil to "" before formatting it
...
This fixes an apparent difference in behavior between Lua and LuaJIT.
Lua fails to format nil:
test/functional/terminal/tui_spec.lua:381: bad argument #2 to 'format' (string expected, got nil)
2017-11-12 16:45:39 -05:00
ZyX
45445e2e03
unittests: Add some more edge test cases
2017-11-12 03:52:26 +03:00
ZyX
c7495ebcc0
viml/parser/expressions: Add support for parsing assignments
2017-11-12 02:18:43 +03:00
ZyX
bbb21e5dd3
unittests: Add a way to show some custom messages only when crashed
2017-11-11 23:50:37 +03:00
Justin M. Keyes
f5d4da0144
:checkhealth : validate 'runtimepath' ( #7526 )
2017-11-10 22:37:54 +01:00
Marco Hinz
9837a9c401
compat: "v:count" distinct from "count" ( #7407 )
2017-11-09 02:20:12 +01:00
Justin M. Keyes
e98bcf0523
Merge #7465 has('ttyin'), has('ttyout')
2017-11-08 04:10:22 +01:00
Justin M. Keyes
c67dd5acd0
NVIM v0.2.1
...
FEATURES:
0e873a30f3
Lua(Jit) built-in #4411
5b32bce73c
Windows: `:terminal` #7007
7b0ceb3726
UI/API: externalize cmdline #7173
b67f58b284
UI/API: externalize wildmenu #7454
b23aa1cf09
UI: 'winhighlight' #6597
17531ed082
UI: command-line coloring (`:help input()-highlight`) #6364
244a1f97db
API: execute lua directly from the remote api #6704
45626de63f
API: `get_keymap()` #6236
db999821d4
API: `nvim_get_hl_by_name()`, `nvim_get_hl_by_id()` #7082
dc685387a3
menu_get() function #6322
9db42d4ce9
:cquit : take an error code argument #7336
9cc185dc6d
job-control: serverstart(): support ipv6 #6680
1b7a9bf4d2
job-control: sockopen() #6594
6efe84af68
clipboard: fallback to tmux clipboard #6894
6016ac270f
clipboard: customize clipboard with `g:clipboard` #6030
3a86dd54f3
ruby: override ruby host via `g:ruby_host_prog` #6841
16cce1ac17
debug: $NVIM_LOG_FILE #6827
0cba3da26e
`:checkhealth` built-in, validates $VIMRUNTIME #7399
FIXES:
105d680aea
TUI: more terminals, improve scroll/resize #6816
cb912a3eda
:terminal : handle F1-F12, other keys #7241
619838f85d
inccommand: improve performance #6949
04b3c32772
inccommand: Fix matches for zero-width #7487
60b1e8ad12
inccommand: multiline, other fixes #7315
f1f7f3b512
inccommand: Ignore leading modifiers in the command #6967
1551f71321
inccommand: fix 'gdefault' lockup #7262
6338199b76
API: bufhl: support creating new groups #7414
541dde36e3
API: allow K_EVENT during operator-pending
8c732f7274
terminal: adjust for 'number' #7440
5bec94652c
UI: preserve wildmenu during jobs/events #7110
c349083155
UI: disable 'lazyredraw' during ui_refresh. #6259
51808a244e
send FocusGained/FocusLost event instead of pseudokey #7221
133f8bc628
shada: preserve unnamed register on restart #4700
1b70a1da04
shada: avoid assertion on corrupt shada file #6958
9f534f338a
mksession: Restore tab-local working directory #6859
de1084f3c4
fix buf_write() crash #7140
7f7698649f
syntax: register 'Normal' highlight group #6973
6e7a8c3fe2
RPC: close channel if stream was closed #7081
85f3084e21
clipboard: disallow recursion; show hint only once #7203
8d1ccb606d
clipboard: performance, avoid weird edge-cases #7193
01487d4385
'titleold' #7358
01e53a5cbe
Windows: better path-handling, separator (slash) hygiene #7349
0f2873ce99
Windows: multibyte startup arguments #7060
CHANGES:
9ff0cc7085
:terminal : start in normal-mode #6808
032b088c84
lower priority of 'cursorcolumn', 'colorcolumn' #7364
2a3bcd1ff8
RPC: Don't delay notifications when request is pending #6544
023f67cad8
:terminal : Do not change 'number', 'relativenumber' #6796
1ef2d768e7
socket.c: Disable Nagle's algorithm on TCP sockets #6915
6720fe253e
help: `K` tries Vim help instead of manpage #3104
7068370560
help, man.vim: change "outline" map to `gO` #7405
2017-11-07 23:54:31 +01:00
ZyX
4aebd00a9e
*: Fix linter errors
2017-11-06 20:28:37 +03:00
ZyX
24a353364d
Merge branch 'master' into expression-parser
2017-11-06 20:23:35 +03:00
ZyX
42959d0e8f
unittests: Add tests for vim_str2nr
2017-11-06 20:15:05 +03:00
Adrian Neumann
8f03014e88
eval/decode.c: Avoid NULL arg to memchr() #7332
...
Clang complains because memchr has undefined behavior if the ptr is
NULL, even if len==0.
Helped-by: Nikolai Aleksandrovich Pavlov <kp-pav@yandex.ru>
2017-11-06 05:00:58 +01:00
Justin M. Keyes
842a54a1bb
doc
2017-11-06 01:56:04 +01:00
ZyX
ebb5977837
api/vim: Add “len” dictionary key
...
This allows determining where parsing ended which may be needed for e.g. parsing
`:echo` with that API function.
2017-11-06 01:17:39 +03:00
ZyX
7849070f99
tests: Add missing test cases
2017-11-06 01:17:39 +03:00
ZyX
7bc6de7526
api/vim,functests: Add tests for nvim_parse_expression, fix found bugs
2017-11-06 01:17:39 +03:00
ZyX
b9d5aea073
api/vim: Create part of nvim_parse_expression function
2017-11-06 01:17:38 +03:00
ZyX
d98199de9c
charset: Refactor vim_str2nr
2017-11-06 01:17:38 +03:00
ZyX
3ecb95298f
tests: Fix testlint errors
2017-11-06 01:17:37 +03:00
KillTheMule
04b3c32772
'inccommand': Fix matches for zero-width ( #7487 )
...
closes #7485
2017-11-05 17:11:44 +01:00
Justin M. Keyes
54cac3033f
test: startup_spec: cmd.exe escaping
2017-11-04 09:36:52 +01:00
Justin M. Keyes
68bef0a57d
test: has("ttyin"), has("ttyout")
2017-11-04 09:36:52 +01:00
James McCoy
a39c8b7ce3
test: server_spec: Tolerate missing protocol ( #7478 )
...
Travis disabled IPv6:
[ RUN ] serverstart(), serverstop() parses endpoints correctly: FAIL
...build/neovim/neovim/test/functional/eval/server_spec.lua:83: Expected objects to be the same.
Passed in:
(table) {
[1] = '127.0.0.1:12345' }
Expected:
(table) {
[1] = '127.0.0.1:12345'
*[2] = '::1:12345' }
Change all tests to ensure a server was actually started before
expecting it to be returned from serverlist().
2017-11-02 10:45:38 +01:00
Lech Lorens
6340689582
quickfix: fix location list updates (test).
2017-10-31 19:14:23 +01:00
Justin M. Keyes
b67f58b284
Merge #7454 'ui: ext_wildmenu'
...
closes #6168
ref #5686
2017-10-31 10:45:06 +01:00
Justin M. Keyes
60b1e8ad12
Merge #7315 "'inccommand': multiline, other fixes"
...
closes #5589
closes #5590
closes #5598
closes #5608
2017-10-31 01:11:35 +01:00
ZyX
b29a776550
Merge branch 'master' into expression-parser
2017-10-30 00:49:12 +03:00
ZyX
538af1c90a
syntax,viml/parser/expressions: Add missing highlight groups
...
Also adjusts some names.
2017-10-29 22:02:19 +03:00
ZyX
748f3ad5bb
syntax,viml/expressions/parser: Create defaults for expr highlighting
2017-10-29 21:30:06 +03:00
KillTheMule
4daf63871a
Fix cmd modifier tests for the new highlight
2017-10-29 18:21:26 +01:00
KillTheMule
369ac900f9
Adjust tests for new highlighting.
...
Also extend an old test to show of the new way.
2017-10-29 18:11:32 +01:00
KillTheMule
ab942b7ffb
Test for clearing the highlight
2017-10-29 18:11:32 +01:00
KillTheMule
be20b20cf3
Adjust tests for the new preview window
...
... that does not have that superflous last line.
Also, remove some indeterminism for the freebsd64 tests. Partially,
those were suggested by the tests themselves, while successfull. Some of
them were added after some testing because the lookaround test would
fail on freebsd64 only.
2017-10-29 18:11:32 +01:00
KillTheMule
a4e4f2bd02
Move tests into original file, lint, and add a test
2017-10-29 18:11:32 +01:00
KillTheMule
1fcd838942
Fix old inccomand tests, and add more for the new functionality.
2017-10-29 18:10:46 +01: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
Dongdong Zhou
39e83fa7cb
ui: allow external ui to draw wildmenu
...
Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
Updated docs and tests.
2017-10-29 08:18:03 +01:00
Björn Linse
2a3bcd1ff8
rpc: Don't delay notifications when request is pending ( #6544 )
...
With the old behavior, if a GUI makes a blocking request that requires user
interaction (like nvim_input()), it would not get any screen updates.
The client, not nvim, should decide how to handle notifications during a
pending request. If an rplugin wants to avoid async calls while a sync call is
busy, it likely wants to avoid processing async calls while another async call
also is handled as well.
This may break the expectation of some existing rplugins. For compatibility,
remote/define.vim reimplements the old behavior. Clients can opt-out by
specifying `sync=urgent`.
- Legacy hosts should be updated to use `sync=urgent`. They could add a flag
indicating which async methods are always safe to call and which must wait
until the main loop returns.
- New hosts can expose the full asyncness, they don't need to offer both
behaviors.
ref #6532
ref #1398 d83868fe90
2017-10-29 03:06:53 +01:00
Justin M. Keyes
3a938fff09
test/win: partially disable :terminal resize test ( #7453 )
2017-10-29 02:10:37 +01:00
Justin M. Keyes
7b0ceb3726
Merge #7173 'api/ui: externalize cmdline'
...
closes #6162
2017-10-29 02:13:12 +02:00
Justin M. Keyes
1a93f58831
test: ui/cmdline_spec.lua: enable on Windows
2017-10-29 02:12:45 +02:00
ZyX
06bdc9ed83
klee: Update vim_str2nr in mock as well
2017-10-29 01:40:55 +03:00
ZyX
c202f17c8d
unittests: Avoid alloc log checking errors when printing tests
2017-10-29 01:31:31 +03:00
ZyX
568cf73c90
viml/parser/expressions: Fix last error found by KLEE
2017-10-29 01:29:48 +03:00
Justin M. Keyes
8c732f7274
Merge #7440 "terminal: adjust for 'number'"
...
closes #5310
2017-10-28 18:02:21 +02:00
Matthew Malcomson
da13d9a30c
test: ctrl_c_spec: bias timeouts for success ( #7451 )
...
Having timeouts that are likely to fail incurs a penalty of waiting for
screen:expect() to fail, hence removing such small timeouts will speed
up the test on average.
2017-10-28 18:01:38 +02:00
Justin M. Keyes
bcf266de46
test: :terminal + numberwidth=9
2017-10-28 17:55:11 +02:00
Sam Wilson
b8a67551d8
terminal: Account for number column ( #5310 )
2017-10-27 17:59:54 -04:00
Björn Linse
445f25998c
ext_cmdline: fix inputsecret()
2017-10-26 20:29:10 +02:00
Björn Linse
91d8e26bc7
ext_cmdline: interact with cmdline window
2017-10-26 20:29:10 +02:00
Björn Linse
bed0a3a842
ext_cmdline: implement redraw!
2017-10-26 20:29:08 +02:00
Björn Linse
91f94bfef8
ext_cmdline: restructure and improve tests
2017-10-26 20:28:49 +02:00
Björn Linse
f2aaa4ae8b
ext_cmdline: rename cmdline_char to cmdline_special_char
2017-10-26 20:28:49 +02:00
Björn Linse
a68817f565
ext_cmdline: extend "function" to generic "block" mechanism
2017-10-26 20:28:49 +02:00
Björn Linse
22402fb99d
ext_cmdline: add support for highlighting
2017-10-26 20:28:47 +02:00
Dongdong Zhou
fb389a6b4b
ext_cmdline: added indent
2017-10-26 09:35:13 +02:00
Dongdong Zhou
461ae69824
ext_cmdline: Add function block support
2017-10-26 09:35:13 +02:00
Dongdong Zhou
866dadaf75
ext_cmdline: added cmdline level
...
add cchar_to_string
2017-10-26 09:35:13 +02:00
Dongdong Zhou
e164ba41c8
ext_cmdline: fix firstc, change cmdline_leave to cmdline_hide
2017-10-26 09:35:13 +02:00
Dongdong Zhou
daec81ab51
ext_cmdline: change the content format
2017-10-26 09:35:13 +02:00
Dongdong Zhou
550651c130
ext_cmdline: use standard external ui functions
2017-10-26 09:35:12 +02:00
Dongdong Zhou
b7a8a76f6e
ext_cmdline: lint
2017-10-26 09:35:12 +02:00
Dongdong Zhou
26fd70bd18
ext_cmdline: add tests
2017-10-26 09:35:12 +02:00
James McCoy
f1f7f3b512
inccommand: Ignore leading modifiers in the command
2017-10-24 19:55:29 -04:00
Justin M. Keyes
e35a66d396
Merge #7430 'Ignore virtcols after 32000'
2017-10-22 16:43:43 +02:00
Justin M. Keyes
42b80c3acf
Merge #7165 'lua: Move stricmp to vim module'
2017-10-22 16:29:36 +02:00
Justin M. Keyes
a3134bc480
test: tabstop=<big-number> #2838
2017-10-22 14:11:09 +02:00
Josh Leeb-du Toit
9db42d4ce9
:cquit : take an error code argument #7336
...
closes #2699
ex_cmds.lua: use flags consistent with similar commands such as `cnext`.
upstream discussion:
"[patch] :qcuit can take exit code"
https://groups.google.com/d/msg/vim_dev/_PjyNbUKyRc/oPgr5_ZXc6AJ
2017-10-22 13:02:31 +02:00
Björn Linse
dfe806ea8b
bufhl: support creating new groups
2017-10-19 11:59:32 +02:00
ZyX
47938e1e22
viml/parser/expressions: Fix some errors spotted by KLEE
...
Not all of them are fixed yet though.
2017-10-19 10:48:05 +03:00
Justin M. Keyes
3bcee71cc8
:checkhealth : validate $VIM
2017-10-17 01:51:21 +02:00
Justin M. Keyes
d214df4e9b
doc: replace ":CheckHealth" with ":checkhealth"
2017-10-17 01:51:21 +02:00
Justin M. Keyes
5baeb4a49c
ex-cmds: :checkhealth
...
Built-in `:checkhealth` checks for valid $VIMRUNTIME by attempting to
autoload `health#check()`.
closes #2977
closes #3159
2017-10-17 01:51:20 +02:00
Justin M. Keyes
2f4647e77b
test: avoid redundant clear() #7340
2017-10-16 21:59:13 +02:00
Justin M. Keyes
a792c1f6db
Merge #7340 'menu_get: print keycodes'
2017-10-16 09:15:31 +02:00
Justin M. Keyes
56eda2aa17
syntax: 'cursorline': revert priority change ( #7400 )
...
ref #7383
reverts d1874ab282
ref #6380
2017-10-16 08:18:03 +02:00
ZyX
c9f511d24a
viml/parser/expressions: Remove unused flag
2017-10-16 09:06:05 +03:00
ZyX
8e856ebcd0
klee: Add run.sh --help and run.sh -s
2017-10-16 09:00:39 +03:00
ZyX
252a76db80
unittests: Free everything and check for memory leaks
...
Also improves error reporting.
2017-10-16 03:06:34 +03:00
ZyX
c03dc13bb7
klee: Fix possible assertion error
...
No idea how it did not happen to hit me yet.
2017-10-16 03:05:27 +03:00
ZyX
248493f155
test/unit/formatc: Fix parsing of most recent viml_parser_highlight
2017-10-16 03:03:34 +03:00
ZyX
15043e93b6
klee: Update key_name_entry table
2017-10-16 00:41:41 +03:00
ZyX
ed253b5fe6
klee: Include colors in test
2017-10-16 00:39:48 +03:00
ZyX
fe81380bf5
viml/parser/expressions: Highlight prefix separately from number
...
Should make accidental octals more visible.
2017-10-16 00:30:55 +03:00
ZyX
5e92ee6565
charset: Do not call strlen() from vim_str2nr
2017-10-16 00:19:02 +03:00
ZyX
1a3635304b
charset: Avoid overflow in vim_str2nr
2017-10-16 00:07:32 +03:00
ZyX
76f0466536
Merge branch 'master' into expression-parser
2017-10-15 21:16:27 +03:00
ZyX
3aa2c0d63a
viml/parser/expressions,klee: Fix some problems found by KLEE run
2017-10-15 21:11:00 +03:00
ZyX
6c19cbef26
viml/parser/expressions,tests: Add AST freeing, with sanity checks
2017-10-15 20:05:35 +03:00
ZyX
206f7ae76a
unittests: Test some edge cases
2017-10-15 19:18:17 +03:00
ZyX
c286155bfa
viml/parser/expressions: Create tests for latest additions
2017-10-15 19:13:52 +03:00
ZyX
8178ba2871
klee: Fix some errors made in …parser.c
2017-10-15 19:13:52 +03:00
ZyX
fa3cfc0dd5
viml/parser/expressions: Finish parser
...
Note: formatc.lua was unable to swallow some newer additions to ExprASTNodeType
(specifically `kExprNodeOr = '|'` and probably something else), so all `= …`
were dropped: in any case they only were there in order to not bother updating
viml_pexpr_debug_print_ast_node and since it is now known all nodes which will
be present it is not much of an issue.
2017-10-15 19:13:52 +03:00
ZyX
af38cea133
viml/parser/expressions: Add support for string parsing
2017-10-15 19:13:52 +03:00
ZyX
bd3a4166b2
viml/parser/expressions: Add support for subscript and list literals
2017-10-15 19:13:51 +03:00
ZyX
e45e519495
viml/parser/expressions: Error out on multiple colons in a row
2017-10-15 19:13:51 +03:00
ZyX
21a5ce033c
viml/parser/expressions: Add support for the dot operator and numbers
2017-10-15 19:13:50 +03:00
ZyX
163792e9b9
viml/parser/expressions: Make lexer parse numbers, support non-decimal
2017-10-15 19:13:50 +03:00
ZyX
0bc4e22379
viml/parser/expressions: Forbid dot or alpha characters after a float
...
This is basically what Vim already does, in addition to forbidding floats should
there be a concat immediately before it.
2017-10-15 19:13:50 +03:00
ZyX
6168e1127c
viml/parser/expressions: Add support for comparison operators
2017-10-15 19:13:49 +03:00
ZyX
6791c57420
viml/parser/expressions: Make sure that arrows outside lambda throw
2017-10-15 19:13:49 +03:00
ZyX
6144e26eb9
viml/parser/expressions: Add support for ternary operator
2017-10-15 19:13:49 +03:00
ZyX
9e721031d5
viml/parser/expressions: Fix determining invalid commas/colons
2017-10-15 19:13:48 +03:00
ZyX
3735537a50
viml/parser/expressions: Fix call inside nested parenthesis
...
It may have incorrectly tried to call everything because of essentially “value”
nodes being treated as not such.
2017-10-15 19:13:48 +03:00
Björn Linse
4b3e51d4ee
ops: save and restore clipboard batch status when entering cmdline window
2017-10-15 16:36:00 +02:00
Justin M. Keyes
c4ab110e04
health.vim: fix highlighting
...
`:syntax keyword` is affected by 'iskeyword'. When we aligned
'iskeyword' to that of filetype=help, colon (:) is now included.
Simplest way to deal with this is to include colon (:) in the `:syntax
keyword` directive.
Also:
- change "SUGGESTIONS" mouthful to "ADVICE"
- change "SUCCESS" to "OK"
2017-10-15 12:06:13 +02:00
James McCoy
dc513f7618
getcmdline_prompt: Temporarily disable msg_silent so prompt is displayed
...
vim-patch:7.4.1636
Closes #7378
2017-10-14 14:32:27 -04:00
ZyX
f265066081
unittests: Add support for dumping “expected” state
...
Purpose is similar to that of `screen:snapshot_util()`, but in different domain.
2017-10-08 22:25:09 +03:00
ZyX
9fa8f7fc0a
viml/parser/expressions: Add a way to adjust lexer
...
It also adds support for kExprLexOr which for some reason was forgotten.
It was only made sure that KLEE test compiles in non-KLEE mode, not that
something works or that KLEE is able to run tests.
2017-10-08 22:25:08 +03:00
ZyX
0987d3b10f
viml/parser/expressions: Make curly braces name actually work
2017-10-08 22:25:07 +03:00
ZyX
3cc65ac054
viml/parser/expressions: Make commas actually work when calling
2017-10-08 22:25:07 +03:00
ZyX
d4782fb1ca
viml/parser/expressions: Make commas actually work when calling
2017-10-08 22:25:06 +03:00
ZyX
7980614650
viml/parser/expressions: Add support for figure braces (three kinds)
2017-10-08 22:25:06 +03:00
ZyX
7c97f78393
klee: Start preparing for klee tests
...
First stage: something compiling without klee, but with a buch of dirty
hacks - done.
Second stage: something running under klee, able to emit useful results,
but still using dirty hacks - done.
Third stage: make CMake care about clang argumnets - not done, may be
omitted if proves to be too hard. Not that klee can be run on CI in any
case.
2017-10-08 22:25:05 +03:00
ZyX
430e516d3a
viml/parser/expressions: Start creating expressions parser
...
Currently supported nodes:
- Register as it is one of the simplest value nodes (even numbers are
not that simple with that dot handling).
- Plus, both unary and binary.
- Parenthesis, both nesting and calling.
Note regarding unit tests: it stores data for AST in highlighting in
strings in place of tables because luassert fails to do a good job at
representing big tables. Squashing a bunch of data into a single string
simply yields more readable result.
2017-10-08 22:25:03 +03:00
Justin M. Keyes
52517321d1
test: nvim_get_hl_by_name/by_id #7082
...
- test all properties
- test failure modes
2017-10-08 21:17:20 +02:00
ZyX
919223c23a
unittests: Move some functions into helpers modules
2017-10-08 22:12:00 +03:00
ZyX
2d8b9937de
viml/parser: Handle encoding conversions
2017-10-08 22:11:59 +03:00
ZyX
0300c4d109
viml/expressions: Add lexer with some basic tests
2017-10-08 22:11:57 +03:00
Justin M. Keyes
04187a1c74
Merge #7082 'api: nvim_get_hl_by_name/by_id'
2017-10-08 19:09:14 +02:00
Justin M. Keyes
032b088c84
Merge #7364 lower priority of 'cursorline', 'cursorcolumn'
2017-10-07 19:11:05 +02:00
ckelsel
c0e45d97b0
vim-patch:8.0.0148 #7344
...
Problem: When a C preprocessor statement has two line continuations the
following line does not have the right indent. (Ken Takata)
Solution: Add the indent of the previous continuation line. (Hirohito
Higashi)
c6aa475a27
2017-10-07 17:10:37 +02:00
Justin M. Keyes
d1874ab282
syntax: 'cursorline': low priority #6380
2017-10-07 16:45:15 +02:00
KillTheMule
1f6138702c
More tests
2017-10-02 21:49:53 +02:00
Justin M. Keyes
6f7754dfa0
test: avoid extra clear() calls
...
also: various other cleanup
2017-10-02 01:46:16 +02:00
Ignas Anikevicius
e9dba214ea
test/shada: fixup for Windows backslashes #7287
2017-10-02 00:48:43 +02:00
Ignas Anikevicius
2b133101cf
win: vim_FullName(): force backslashes #7287
...
- Replace obvious cases of '/' literal with PATHSEP. (There are still
some remaining cases that need closer inspection.)
- Fixup tests: ui/screen_basic
closes #7117
ref https://github.com/neovim/neovim/issues/2471#issuecomment-271193714
2017-10-02 00:48:30 +02:00
KillTheMule
9fb8b47ad8
menu_get: adjust tests for prettyprinting
...
... and add a bit of new testing
2017-10-01 11:47:35 +02:00
Matthieu Coudron
3a00648639
Changed prototypes to accept a boolean "rgb"
2017-09-30 11:43:26 +09:00
Matthieu Coudron
e3a2cca387
Increased test coverage for RGB and cterm
2017-09-30 11:43:26 +09:00
Matthieu Coudron
ba7277cfb4
Adds nvim_get_hl_by_name/by_id
...
...in order to retrieve highlights.
Added test/functional/api/highlight_spec.lua
HL_NORMAL is not really a good name, since it's more like an empty attribute than the normal's one.
If one pays attention, syn_cterm_attr2entry is never called with attr=0 because it's always special cased before.
I suggest in subsequent PRs we remove the ATTR_OFF and just insert an EMPTY ATTR/RESET_ATTR/UNINITIALIZED for id 0.
2017-09-30 11:43:26 +09:00
ZyX
190c8516f5
unittests: Add a way to print trace on regular error
2017-09-29 01:21:13 +03:00
ZyX
520c0b91a5
test/helpers: Add format_string and format_luav
...
First intended to provide %r functionality like in Python (and also support for
%*.*s, but this was not checked), second adds nice table formatting for use in
cases similar to screen:snapshot_util().
2017-09-29 01:21:07 +03:00
KillTheMule
126b2ca077
test: lint whitespace in legacy/ ( #7308 )
2017-09-24 20:42:48 +02:00
Justin M. Keyes
9d6bac3219
test: more coverage for RPC + op-pending #3732
2017-09-16 12:21:31 +02:00
KillTheMule
6d0f87a0bd
'inccommand': fix 'gdefault' lockup #7261
...
closes #7244
ref #7249
2017-09-12 22:44:11 +02:00
KunMing Xie
ceade2fe53
vim-patch:8.0.0186 ( #7154 )
...
Problem: The error message from assert_notequal() is confusing.
Solution: Only mention the expected value.
5869cf060e
2017-09-10 12:52:43 +02:00
Justin M. Keyes
b927e50c53
test: FocusGained: retry() cmdline-mode test
2017-09-09 21:26:55 +02:00
KillTheMule
26d08dfd0d
inccommand: fix optimization logic #7224
...
Before this change the preview changes in the buffer viewport were
limited to the size of the preview window ('cmdwinheight').
closes #7220
2017-09-09 15:02:06 +02:00
Justin M. Keyes
618cfe03fc
test: ex_terminal_spec.lua: retry flaky test ( #7245 )
...
https://api.travis-ci.org/jobs/271833660/log.txt
2017-09-07 09:40:37 +02:00
Justin M. Keyes
b9d6bda531
test: FocusGained: press-enter prompt
2017-09-05 18:44:01 +02:00
Justin M. Keyes
ff32bacb2e
test: FocusGained: let UI settle before sending input
...
This significantly increases the likelihood that the :echo'd text will
be included in the next UI flush, instead of being lost.
2017-09-05 15:01:07 +02:00
Justin M. Keyes
6c53c3ee55
eventloop: restore redraw in cmdline K_EVENT handler
...
Restores behavior from commit: 02e86ef04cc1
2017-09-05 15:01:06 +02:00
Justin M. Keyes
4bf953cca4
test: FocusGained/FocusLost
2017-09-05 15:01:06 +02:00
Justin M. Keyes
f9af824832
test: use global_helpers.uname() instead of calling to nvim UUT
2017-09-05 15:01:06 +02:00
Justin M. Keyes
ce852bab04
eventloop: K_EVENT does not finish mapping
...
The "mapping" tests added in 541dde36e3
were flawed:
- Unlike op-pending mode, RPCs are _blocked_ during map-pending. So
a synchronous RPC like nvim_get_current_buf() waits until
'timeoutlen', then the mapping is canceled.
- helpers.expect() also performs a blocking RPC, so again that must not
intervene the two nvim_input() calls.
closes #6166
2017-09-04 22:51:04 +02:00
Justin M. Keyes
3922237b14
test: lint
2017-09-04 10:46:10 +02:00
Matthew Malcomson
541dde36e3
eventloop: K_EVENT should not finish operator
...
normal_finish_command() and normal_prepare() assume that any pending
operator needs to be finished after any subsequent key.
Set `finish_op = false` in nv_event() to indicate that the pending
operator shouldn't be finished in normal_execute().
This is how nv_visual() indicates that 'v' or 'V' in operator-pending
mode should not finish the current pending operator.
fixes #5398
fixes #6166 (partially; mappings are still interrupted)
2017-09-04 08:20:04 +02:00
Matthieu Coudron
f612e99db5
ci: XXX: permissive termclose_spec timer ( #7217 )
...
We probably need to revisit the process_stop() logic.
In the meantime this hack avoids CI noise.
2017-08-26 17:18:46 +02:00
Justin M. Keyes
6e7a8c3fe2
Merge #7081 from justinmk/rpcstop
...
rpc: close channel if stream was closed
2017-08-26 16:41:35 +02:00
James McCoy
46a4099dfb
Merge pull request #7192 from llorens/vim-8.0.0092
...
vim-patch:8.0.0092
2017-08-25 11:21:36 -04:00
Justin M. Keyes
85f3084e21
clipboard: disallow recursion; show hint only once ( #7203 )
...
- Show hint only once per session.
- provider#clipboard#Call(): prevent recursion
- provider#clear_stderr(): use has_key(), because :silent! is still
captured by :redir.
closes #7184
2017-08-22 20:31:54 +02:00
Justin M. Keyes
7f7698649f
Merge #6973 from teto/normal_hl
2017-08-22 20:01:50 +02:00
Matthieu Coudron
4d91369fd7
syntax.c: register 'Normal' highlight group
...
- :hi Normal works with -u NONE
- Makes HL_TABLE and ATTR_ENTYRY a function instead of a macro so that in can be used in gdb.
- Introduces ATTRENTRY_INIT to init attrentry_t
2017-08-22 12:37:59 +02:00
James McCoy
fc7bf1c71d
vim-patch:8.0.0437
...
Problem: The packadd test does not create the symlink correctly and does
not test the right thing.
Solution: Create the directory and symlink correctly.
644df41c44
2017-08-21 20:29:49 -04:00
James McCoy
651c6f9b6e
vim-patch:8.0.0326
...
Problem: Packadd test uses wrong directory name.
Solution: Use the variable name value. (Hirohito Higashi)
24f8f543d4
2017-08-21 20:29:49 -04:00
James McCoy
24a5564196
vim-patch:8.0.0325
...
Problem: Packadd test does not clean up symlink.
Solution: Delete the link. (Hirohito Higashi)
913727e567
2017-08-21 20:29:48 -04:00
James McCoy
a66eca78c2
vim-patch:8.0.0308
...
Problem: When using a symbolic link, the package path will not be inserted
at the right position in 'runtimepath'. (Dugan Chen, Norio Takagi)
Solution: Resolve symbolic links when finding the right position in
'runtimepath'. (Hirohito Higashi)
2f9e575583
2017-08-21 20:29:48 -04:00
Lech Lorens
d2595ba1c4
vim-patch:8.0.0092
...
Problem: C indenting does not support nested namespaces that C++ 17 has.
Solution: Add check that passes double colon inside a name. (Pauli, closes
vim/vim#1214 )
ca8b8d6956
2017-08-21 23:00:51 +02:00
Drew Neil
73286a81cf
Repair tui_spec functional tests
2017-08-21 20:44:03 +01:00
Drew Neil
ac52947838
Repair job_spec functional tests
2017-08-21 20:44:03 +01:00
Drew Neil
642e14d9e7
Repair ex_terminal_spec functional tests
2017-08-21 20:44:03 +01:00
Justin M. Keyes
af993da435
rpc: close channel if stream was closed
...
f_jobstop()/f_rpcstop() .. process_stop() .. process_close_in(proc)
closes the write-stream of a RPC channel. But there might be
a pending RPC notification on the queue, which may get processed just
before the channel is closed.
To handle that case, check the Stream.closed in
channel.c:receive_msgpack().
Before this change, the above scenario could trigger
this assert(!stream->closed) in wstream_write():
0x00007f96e1cd3428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
0x00007f96e1cd502a in __GI_abort () at abort.c:89
0x00007f96e1ccbbd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x768f9b "!stream->closed",
file=file@entry=0x768f70 "../src/nvim/event/wstream.c", line=line@entry=77,
function=function@entry=0x768fb0 <__PRETTY_FUNCTION__.13735> "wstream_write") at assert.c:92
0x00007f96e1ccbc82 in __GI___assert_fail (assertion=0x768f9b "!stream->closed", file=0x768f70 "../src/nvim/event/wstream.c", line=77,
function=0x768fb0 <__PRETTY_FUNCTION__.13735> "wstream_write") at assert.c:101
0x00000000004d2c1f in wstream_write (stream=0x7f96e0a35078, buffer=0x7f96e09f9b40) at ../src/nvim/event/wstream.c:77
0x00000000005857b2 in channel_write (channel=0x7f96e0ae5800, buffer=0x7f96e09f9b40) at ../src/nvim/msgpack_rpc/channel.c:551
0x000000000058567d in on_request_event (argv=0x7ffed792efa0) at ../src/nvim/msgpack_rpc/channel.c:523
0x00000000005854c8 in handle_request (channel=0x7f96e0ae5800, request=0x7ffed792f1b8) at ../src/nvim/msgpack_rpc/channel.c:503
0x00000000005850cb in parse_msgpack (channel=0x7f96e0ae5800) at ../src/nvim/msgpack_rpc/channel.c:423
0x0000000000584f90 in receive_msgpack (stream=0x7f96e0a35218, rbuf=0x7f96e0d1d4c0, c=22, data=0x7f96e0ae5800, eof=false)
at ../src/nvim/msgpack_rpc/channel.c:389
0x00000000004d0b20 in read_event (argv=0x7ffed792f4a8) at ../src/nvim/event/rstream.c:190
0x00000000004ce462 in multiqueue_process_events (this=0x7f96e18172d0) at ../src/nvim/event/multiqueue.c:150
0x000000000059b630 in nv_event (cap=0x7ffed792f620) at ../src/nvim/normal.c:7908
0x000000000058be69 in normal_execute (state=0x7ffed792f580, key=-25341) at ../src/nvim/normal.c:1137
0x0000000000652463 in state_enter (s=0x7ffed792f580) at ../src/nvim/state.c:61
0x000000000058a1fe in normal_enter (cmdwin=false, noexmode=false) at ../src/nvim/normal.c:467
0x00000000005500c2 in main (argc=2, argv=0x7ffed792f8d8) at ../src/nvim/main.c:554
Alternative approach suggested by bfredl is to use close_cb of the
process. My unsuccessful attempt is below. (It seems close_cb is queued
too late, which is the similar problem addressed by this commit):
commit 75fc12c6ab15711bdb7b18c6d42ec9d157f5145e
Author: Justin M. Keyes <justinkz@gmail.com>
Date: Fri Aug 18 01:30:41 2017 +0200
rpc: use Stream's close_cb instead of explicit check in receive_msgpack()
diff --git a/src/nvim/event/process.c b/src/nvim/event/process.c
index 8371d3cd482e..e52da23cdc40 100644
--- a/src/nvim/event/process.c
+++ b/src/nvim/event/process.c
@@ -416,6 +416,10 @@ static void on_process_exit(Process *proc)
static void on_process_stream_close(Stream *stream, void *data)
{
Process *proc = data;
+ ILOG("on_process_stream_close");
+ if (proc->stream_close_cb != NULL) {
+ proc->stream_close_cb(stream, proc->stream_close_data);
+ }
decref(proc);
}
diff --git a/src/nvim/event/process.h b/src/nvim/event/process.h
index 5c00e8e7ecd5..34a8d54f6f8c 100644
--- a/src/nvim/event/process.h
+++ b/src/nvim/event/process.h
@@ -26,6 +26,11 @@ struct process {
Stream *in, *out, *err;
process_exit_cb cb;
internal_process_cb internal_exit_cb, internal_close_cb;
+
+ // Called when any of the process streams (in/out/err) closes.
+ stream_close_cb stream_close_cb;
+ void *stream_close_data;
+
bool closed, detach;
MultiQueue *events;
};
@@ -50,6 +55,8 @@ static inline Process process_init(Loop *loop, ProcessType type, void *data)
.closed = false,
.internal_close_cb = NULL,
.internal_exit_cb = NULL,
+ .stream_close_cb = NULL,
+ .stream_close_data = NULL,
.detach = false
};
}
diff --git a/src/nvim/event/stream.c b/src/nvim/event/stream.c
index 7c865bfe1e8c..c8720d1e45d9 100644
--- a/src/nvim/event/stream.c
+++ b/src/nvim/event/stream.c
@@ -95,7 +95,11 @@ void stream_close(Stream *stream, stream_close_cb on_stream_close, void *data)
void stream_close_handle(Stream *stream)
FUNC_ATTR_NONNULL_ALL
{
+ ILOG("stream=%d", stream);
+ // LOG_CALLSTACK();
if (stream->uvstream) {
+ // problem: this schedules on the queue, but channel.c:receive_msgpack may
+ // be processed before close_cb is called by libuv.
uv_close((uv_handle_t *)stream->uvstream, close_cb);
} else {
uv_close((uv_handle_t *)&stream->uv.idle, close_cb);
@@ -105,6 +109,7 @@ void stream_close_handle(Stream *stream)
static void close_cb(uv_handle_t *handle)
{
Stream *stream = handle->data;
+ ILOG(">>>>>>>>>>>>>>>>>>>>>>> stream=%p stream->internal_close_cb=%p", stream, stream->internal_close_cb);
if (stream->buffer) {
rbuffer_free(stream->buffer);
}
diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c
index 782eabe04e4a..dc2b794e366a 100644
--- a/src/nvim/msgpack_rpc/channel.c
+++ b/src/nvim/msgpack_rpc/channel.c
@@ -128,6 +128,8 @@ uint64_t channel_from_process(Process *proc, uint64_t id, char *source)
source);
incref(channel); // process channels are only closed by the exit_cb
channel->data.proc = proc;
+ channel->data.proc->stream_close_cb = close_cb2;
+ channel->data.proc->stream_close_data = channel;
wstream_init(proc->in, 0);
rstream_init(proc->out, 0);
@@ -387,17 +389,6 @@ static void receive_msgpack(Stream *stream, RBuffer *rbuf, size_t c,
goto end;
}
- if ((chan_wstream(channel) != NULL && chan_wstream(channel)->closed)
- || (chan_rstream(channel) != NULL && chan_rstream(channel)->closed)) {
- char buf[256];
- snprintf(buf, sizeof(buf),
- "ch %" PRIu64 ": stream closed unexpectedly. "
- "closing channel",
- channel->id);
- call_set_error(channel, buf, WARN_LOG_LEVEL);
- goto end;
- }
-
size_t count = rbuffer_size(rbuf);
DLOG("ch %" PRIu64 ": parsing %u bytes from msgpack Stream: %p",
channel->id, count, stream);
@@ -571,23 +562,6 @@ static Stream *chan_wstream(Channel *chan)
abort();
}
-/// Returns the Stream that a Channel reads from.
-static Stream *chan_rstream(Channel *chan)
-{
- switch (chan->type) {
- case kChannelTypeSocket:
- return &chan->data.stream;
- case kChannelTypeProc:
- return chan->data.proc->out;
- case kChannelTypeStdio:
- return &chan->data.std.in;
- case kChannelTypeInternal:
- return NULL;
- }
- abort();
-}
-
-
static bool channel_write(Channel *channel, WBuffer *buffer)
{
bool success = false;
@@ -799,6 +773,12 @@ static void close_cb(Stream *stream, void *data)
decref(data);
}
+static void close_cb2(Stream *stream, void *data)
+{
+ ILOG("close_cb2");
+ close_channel(data);
+}
+
/// @param source description of source function, rplugin name, TCP addr, etc
static Channel *register_channel(ChannelType type, uint64_t id,
MultiQueue *events, char *source)
2017-08-21 01:04:28 +02:00
Justin M. Keyes
88165a798e
clipboard: test g:clipboard validation, fix a bug
...
Also fix `:help foo` highlighting in health.vim
2017-08-20 22:17:03 +02:00
Justin M. Keyes
cc7e344f83
clipboard: remove start_batch_changes() in redir_write()
...
start_batch_changes() doesn't avoid invoking the clipboard
once-per-line, because the loop is actually in ex_echo(), which calls
redir_write() for each message. But we've already entered
start_batch_changes() by then, so that was never the problem.
redir_write at /home/vagrant/old.neovim/build/../src/nvim/message.c:2523
msg_puts_attr_len at /home/vagrant/old.neovim/build/../src/nvim/message.c:1600
msg_outtrans_len_attr at /home/vagrant/old.neovim/build/../src/nvim/message.c:1221
ex_echo at /home/vagrant/old.neovim/build/../src/nvim/eval.c:19433
do_one_cmd at /home/vagrant/old.neovim/build/../src/nvim/ex_docmd.c:2242
Trying to defer _explicit_ clipboard updates is difficult.
:redir @+ | silent echo system('cat foo') | redir END
is essentially equivalent to:
for l in readfile('foo')
let @+ .= l
endfor
We cannot make judgements about when to ignore a script's bad decisions.
start_batch_changes() only works around the case of clipboard=unnamed,
i.e. _implicit_ clipboard updates (`:g/foo/d`). Not explicit
assignment.
2017-08-20 20:01:22 +02:00
Justin M. Keyes
9882e25dc4
clipboard: avoid error flood during :redir
...
redir_write():
- This is a "batch" operation which was not yet covered by
start_batch_changes()
adjust_clipboard_name():
- msg() and friends during :redir will, of course, cause redir_write()
to try to capture that message, which causes recursion.
- EMSG() here is trouble: if it interrupts :redir it is a mess.
Rather than deal with the mess, show a non-error message.
closes #7182
closes #7184
closes #7183
ref #6048
ref #7032
2017-08-20 19:49:42 +02:00
Justin M. Keyes
9a6eb71eba
test/win: give up on this one
2017-08-16 09:13:45 +02:00
Justin M. Keyes
dbb404542b
test/win: place cursor at edge to tickle SIGWINCH
2017-08-16 09:13:44 +02:00
Justin M. Keyes
91c85a6378
test: tty-test.c: keep tty_out
handle around
...
Now the window_split_tab_spec.lua test seems to work.
Also do some cleanup.
2017-08-16 09:13:44 +02:00
Justin M. Keyes
d2d76882f7
win/test: enable more :terminal tests
...
To deal with SIGWINCH limitations on Windows, change some resize tests
to _shrink_ the screen width. ... But this didn't work, so still
ignoring those tests on Windows.
2017-08-16 09:13:44 +02:00
Justin M. Keyes
e0763e94ad
test: tty-test.c: restore win32 SIGWINCH handler
2017-08-16 09:13:44 +02:00
Justin M. Keyes
6a90f53862
test: cleanup
2017-08-16 09:13:44 +02:00
erw7
d3a8c4f992
win/pty: log errors
2017-08-16 09:13:44 +02:00
erw7
1614e805b3
win/test: tty-test: print screen size explicitly with CTRL-Q
...
tty-test.exe causes abnormal termination with low repeatability, try
changing it so as not to use SIGWINCH.
2017-08-16 09:13:44 +02:00
erw7
4b1f21de75
win: support :terminal
2017-08-16 09:13:43 +02:00
Justin M. Keyes
bb70eec177
Merge #6364 'command-line color hook'
2017-08-16 00:20:37 +02:00
ZyX
b1a8dcefee
lua/executor: Fix crash when first string contains NUL and second not
2017-08-15 17:18:05 +03:00
ZyX
93ef823f5e
lua/executor: Move stricmp to vim “module” and document it
2017-08-15 16:34:51 +03:00
ZyX
96b1600bc8
functests: Add test for stricmp
2017-08-15 16:34:25 +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
Nikolai Aleksandrovich Pavlov
bf1b1ea6ee
lua/executor: Fix crash when printing empty string ( #7157 )
2017-08-13 17:37:35 +02:00
James McCoy
ac055d677a
os_stat: return ENOENT on NULL filename arg
...
Closes #4370
Explication:
In the backtrace in #4370 , we see that `buf_write()` was called with
non-NULL `fname` and `sfname` arguments, but they've since _become_
NULL.
#7 0x00000000004de09d in buf_write (buf=0x1dee040, fname=0x0, fname@entry=0x1e985b0 "/home/sean/src/github.com/snczl/virta/pkg/meld/segment.go",
sfname=0x0, sfname@entry=0x1ddfa60 "segment.go", start=1, end=72, eap=eap@entry=0x7ffc6b032e60, append=0,
forceit=0, reset_changed=1, filtering=0)
at /home/travis/build/neovim/bot-ci/build/neovim/src/nvim/fileio.c:2576
This is most likely due to the code that restores those values from
`buf`, which happens just before the fatal call to `os_fileinfo`
```c
/*
* The autocommands may have changed the name of the buffer, which may
* be kept in fname, ffname and sfname.
*/
if (buf_ffname)
ffname = buf->b_ffname;
if (buf_sfname)
sfname = buf->b_sfname;
if (buf_fname_f)
fname = buf->b_ffname;
if (buf_fname_s)
fname = buf->b_sfname;
```
It's worth noting that at this point `ffname` is still non-NULL, so
it _could_ be used. However, our current code is purely more strict
than Vim in this area, which has caused us problems before (e.g.,
`getdigits()`). The commentary for `struct file_buffer` clearly
indicate that all of `b_ffname`, `b_sfname`, and `b_fname` may be
NULL:
```c
/*
* b_ffname has the full path of the file (NULL for no name).
* b_sfname is the name as the user typed it (or NULL).
* b_fname is the same as b_sfname, unless ":cd" has been done,
* then it is the same as b_ffname (NULL for no name).
*/
char_u *b_ffname; /* full path file name */
char_u *b_sfname; /* short file name */
char_u *b_fname; /* current file name */
```
Vim directly calls `stat(2)` which, although it is annotated to tell
the compiler that the path argument is non-NULL, does handle a NULL
pointer by returning a `-1` value and setting `errno` to `EFAULT`.
This satisfies Vim's check, since it treats any `-1` return from
`stat(2)` to mean the file doesn't exist (at least in this code
path).
Note that Vim's mch_stat() implementations on win32 and solaris
clearly cannot accept NULL `name`. But the codepaths that call
mch_stat will NULL `name` tend to be unix-only (eg: u_read_undo)!
2017-08-10 00:56:07 +02:00
ZyX
474aa823dc
Merge branch 'master' into colored-cmdline
2017-08-06 15:25:17 +03:00
ZyX
efb03903eb
functests: Remove wait() from input_spec
2017-08-06 14:43:46 +03:00
Justin M. Keyes
3827d5bc71
input: skip dialogs if no UI is active
...
Treat dialogs in the same way as "silent mode" (`nvim -es`).
References #1984
References #3901
2017-08-06 04:22:45 +02:00
Justin M. Keyes
30996359ef
clint: allow starting brace after enum
2017-08-06 02:51:49 +02:00
Justin M. Keyes
efb0aca0ee
test/helpers: disable powershell logo/banner message
2017-08-06 02:51:48 +02:00
Justin M. Keyes
a31482db4d
terminal: block redraw during c_CTRL-D
...
Unlike the normal wildmenu, the CTRL-D wild-list is not restored by
statusline redraw. (Semantics: ^D is controlled by 'wildoptions' option,
so it's in the "wild..." family.)
TODO: externalize the c_CTRL-D wild-list.
2017-08-05 21:32:34 +02:00
Justin M. Keyes
c695443727
win_redr_status(): skip if wildmenu is showing
...
This might be too coarse, but it passes all tests ...
A more nuanced approach might be: only skip the windows whose
statuslines are overwritten by the wildmenu.
Closes #2255
Closes #7108
vim-patch:8.0.0710 N/A because of the changes in this commit.
2017-08-05 21:32:34 +02:00
Justin M. Keyes
92101947fe
test: job_spec.lua: disable shada in test instance
2017-08-04 22:25:39 +02:00
ZyX
fbe60af538
Merge branch 'master' into colored-cmdline
2017-07-31 02:05:02 +03:00
ckelsel
5cd68b3900
vim-patch:8.0.0124 #7092
...
Problem: Internal error for assert_inrange(1, 1).
Solution: Adjust number of allowed arguments. (Dominique Pelle)
3421566376
2017-07-30 14:15:26 +02:00
Justin M. Keyes
3b45f676c0
menu_get(): doc
2017-07-28 02:34:24 +02:00
Matthieu Coudron
dc685387a3
viml: introduce menu_get() function #6322
...
menu_get({path}, {modes}). See :h menu_get.
2017-07-28 01:27:58 +02:00
ZyX
1011462b40
Revert "functests: Replace wait() with nvim_async"
...
This reverts commit e129607988
.
Tests stopped working in CI.
2017-07-27 18:49:13 +03:00
ZyX
c5857e3f38
ex_getln: Cache highlight callback calling results
2017-07-26 22:56:48 +03:00
ZyX
e129607988
functests: Replace wait() with nvim_async
2017-07-26 22:04:39 +03:00
ZyX
1ba21b4a31
functests: Remove unneeded wait()s
2017-07-26 13:02:45 +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
Justin M. Keyes
d72db1ac8f
test: mouse_spec: remove obnoxious wait times ( #7029 )
...
helpers.skip_fragile() already skips the problematic tests
on the ASan build. But the 15s timeout plus 5s 'mousetime'
cause the tests to take 1+ minutes anyways.
2017-07-15 18:00:00 +02:00
ZyX
69719e658c
Merge branch 'master' into colored-cmdline
2017-07-15 18:56:45 +03:00
Justin M. Keyes
d15317ece4
health.vim: fix test
2017-07-15 16:15:47 +02:00
James McCoy
d67e48379f
test: shada: Replace hard-coded 704 with dynamic version
2017-07-14 06:44:22 -04:00
Nikolai Aleksandrovich Pavlov
702c94aacf
mbyte: Fix crash when using multibyte chars in maparg() return ( #6986 )
...
This is a refactoring typo from #6947 .
Fixes #6985
Combined with #6947 where typo was made it also fixes vim/vim#1827 which was
present in Neovim.
2017-07-09 10:40:46 +02:00
KillTheMule
619838f85d
inccommand: improve performance #6949
...
During a preview, we can stop looking for matches after we got enough
lines for the preview buffer.
Because of this perf improvement, the 'redrawtime' test needs to be
slowed down in a different way: _long_ lines instead of just many lines.
2017-07-08 17:51:42 +02:00
Justin M. Keyes
0ea7e45bc1
'cpoptions': remove "<" flag; ignore <special>
...
Closes #6937 "nvim_get_keymap output is unreliable"
2017-07-08 16:34:35 +02:00
d10n
69e9cda5ac
i_CTRL-O: fix :startinsert at end of line ( #6963 )
...
The gchar_cursor() == NUL check is already done in ins_ctrl_o.
ins_esc changes gchar_cursor() so this if block is probably never
entered.
Issue:
Pressing CTRL-O in insert mode at the end of the line and typing
:startinsert moves the cursor 1 column back, when I expect the cursor
to remain at the end of the line
This is a regression from Vim behavior. Since at least Vim version 7.0,
Vim returns you to insert mode at the end of the line.
091e7d033c
is the first bad neovim commit
Steps to reproduce using `nvim -u NORC`:
`aaaa<C-o>:startinsert<CR>`
Fixes #6962
2017-07-08 12:50:58 +02:00
James McCoy
773ea9dbdc
Merge pull request #6823 from blueyed/fix-term-stop
...
fix SIGTERM/SIGHUP for jobs
2017-07-07 10:29:49 -04:00
James McCoy
5f5f2ce0de
test: tui_spec: Remove unused is_linux variable
2017-07-07 10:07:53 -04:00
Daniel Hahler
f31c26f1af
jobstop/process_stop: send SIGTERM directly
...
This reverts the revert of #6644 (7c1a5d1d4
), and handles it properly
now (with tests).
2017-07-07 13:11:20 +02:00
Justin M. Keyes
105d680aea
Merge #6816 'TUI improvements'
...
Removed these commits (test-suite changes):
e2fba01910
7c809c4bc7
18e7cd9e97
2017-07-07 00:34:37 +02:00
Justin M. Keyes
69f0847ccc
Merge #6959 from ZyX-I/pvs-fixes
2017-07-04 23:50:57 +02:00
Justin M. Keyes
1b70a1da04
Merge #6958 from ZyX-I/fix-6957
2017-07-04 21:56:05 +02:00
ZyX
72b3fd9664
os/fileio: Add ability to use os/fileio.c for file descriptors
...
Code imported from #6299
2017-07-04 18:37:01 +03:00
ZyX
5ab9e9f617
os/fileio: Add msgpack_file_write function
2017-07-04 18:37:01 +03:00
ZyX
91b9ad7d82
shada: Make sure that code does not attempt to read too long items
...
Fixes #6957
2017-07-04 15:41:59 +03:00
ZyX
2208b64891
functests: Ensure different SIDs on successive source() calls
2017-07-04 15:15:23 +03:00
ZyX
480598dcda
functests: Add some more :echo tests which also check for regression
...
Fixes #6954
2017-07-04 02:38:40 +03:00
ZyX
d113d3d737
functests: Make ex_cmds/echo actually use :echo
2017-07-04 02:22:26 +03:00
ZyX
b199194a2c
functests: Copy eval/string_spec.lua to ex_cmds/echo_spec.lua
2017-07-04 02:06:04 +03:00
Justin M. Keyes
008b604bac
Merge #6947 from ZyX-I/consistent-get_keymap
2017-07-03 23:33:08 +02:00
ZyX
35898cff5d
unittests: Fix allocation ordering for tv_dict_add_str()
2017-07-02 20:24:39 +03:00
ZyX
d5916a823a
functests: Test how spaces appear in get_keymap output
2017-07-02 20:08:00 +03:00
James McCoy
4d01725699
test: expand_env_esc: Pass correct buffer size for outlen and assertion
...
Running this test with a mocked passwd file whose $HOME was set to
/home/jamessan/src/debian.org/pkg-vim/deb-packages/neovim/neovim-0.2.0/debian/fakehome
caused the test to fail, since the expanded result was >= 99 bytes. The
test should be reflecting the actual size of the buffer, instead of some
arbitrary other number, anwyay.
2017-07-02 12:52:43 -04:00
ZyX
5fe5d712aa
functests: Use more extensive testing
...
Fixes #6937
2017-07-02 19:50:03 +03:00