Commit Graph

6718 Commits

Author SHA1 Message Date
James McCoy
37e64d79cc
object_to_vim: Fix buffer/window/tabpage conversion on BE systems
Since data.integer is a different (larger) integer type than
data.{buffer,window,tabpage}, we cannot abuse the union by using
data.integer to access the value for all 4 types.  Instead, remove the
{buffer,window,tabpage} members and always use the integer member.

In order to accomodate this, perform distinct validation and coercion
between the Integer type and Buffer/Window/Tabpage types in
object_to_vim, msgpack_rpc helpers, and gendispatch.lua.
2016-11-02 10:06:27 -04:00
James McCoy
87ff2682d7
Use int as the standard type for boolean options.
All options are accessed by passing char_u pointers around, casting the
pointer to the right pointer type for the specific option, and then
dereferencing that pointer.

This dance works fine on little-endian systems when some bool options
are int types (as in Vim) and some are bool types (as would make more
sense), but on big-endian systems *(int *)varp when varp is pointing to
a bool will read random memory.

Therefore, all boolean options must remain a consistent type and int is
currently the easiest to choose.
2016-11-02 10:06:26 -04:00
Justin M. Keyes
349fa0048b Merge #5542 from mhinz/health/clipboard
CheckHealth: add clipboard check
2016-11-02 12:17:32 +01:00
Marco Hinz
3a802e3c16 provider/clipboard.vim: never show a warning on sourcing
Never throw an error when provider/clipboard.vim is sourced for the first time.
Save the error instead and expose it via `provider#clipboard#Error()`, mimicking
provider/python.vim.
2016-11-02 12:06:57 +01:00
Marco Hinz
797d72a997 health/provider.vim: add clipboard check 2016-11-02 12:06:54 +01:00
Marco Hinz
0a1b852cd1 provider/clipboard.vim: refactor 2016-11-02 12:04:43 +01:00
Justin M. Keyes
36c0ec6dd4 tui/suspend_event(): set STDIN to "blocking"
Set STDIN to blocking on "suspend". This was missed in #2598.
See 8a782f1699.

Also on "continue"/SIGCONT explicitly set STDIN back to NON-blocking.
We don't explicitly do that on *startup* (libuv does it internally),
but on "continue" it seems wise to restore libuv's expectations.

Closes #5459
2016-11-02 01:20:16 +01:00
James McCoy
d37c2e5dc2 doc: Remove features from vim_diff which have been merged upstream (#5554)
- TabNew/TabClosed: Introduced in 7.4.2075 and 7.4.2077
- hl-EndOfBuffer: Introduced in 7.4.2213
2016-10-31 17:26:32 +01:00
James McCoy
859e9fa65f Merge pull request #5527 from brcolow/vim-7.4.1730
vim-patch:7.4.[1730,1734,1741,1742,1779,1782]
2016-10-31 10:13:41 -04:00
Justin M. Keyes
ed198737fd Merge #5546 from justinmk/global-ctrlc
ex_global: Catch CTRL-C even if it is mapped.
2016-10-30 14:20:40 +01:00
Justin M. Keyes
49cf0b6ac4 lint 2016-10-30 13:10:29 +01:00
Justin M. Keyes
7cd204dbfa ex_global: Catch CTRL-C even if it is mapped.
Problem: If CTRL-C is mapped, it does not interrupt :global output.
Solution: clear `mapped_ctrl_c` during :global.
2016-10-30 13:10:29 +01:00
James McCoy
6143cfdeec Merge pull request #5543 from jamessan/fix-shada-marks-test
test: Fix shada/marks_spec.lua failure
2016-10-29 12:49:50 -04:00
J Phani Mahesh
3d49fc1f50 CheckHealth: fix check for tmux escape-time (#5545) 2016-10-29 14:48:19 +02:00
James McCoy
93f3896300
test: Fix shada/marks_spec.lua failure
The 'dump and read back mark " from a closed tab' test needs to actually
create a second tab.  Since it wasn't doing so, the 'q!' command caused
nvim to exit and the subsequent 'qall' command fails.
2016-10-28 22:32:14 -04:00
Justin M. Keyes
242c3d5f0b version bump 2016-10-28 15:16:59 +02:00
Justin M. Keyes
cc1ec959f1 NVIM v0.1.6
FEATURES:
0b5a7e4ad5 #4432 API: external UIs can render custom popupmenu
c6ac4f84b1 #4934 API: call any API method from vimscript
31df051ed9 #4568 API: nvim_call_atomic(): multiple calls in a single request
b268ba353a #5424 API: nvim_win_get_number(), nvim_tabpage_get_number()
e7e2844d46 has("nvim-1.2.3") checks for a specific Nvim version
522b885a0d #5295, #5493 `:CheckHealth` checks tmux, terminfo, performance
719dae2e01 #5384 events: allow event processing in getchar()
f25797f869 #5386 API: metadata: Nvim version & API level
22dfe6925d #5389 API: metadata: "since", "deprecated_since"
605e74327a Added QuickFixLine highlight group

CHANGES:
4af6ec746c #5253 perf: Disable clipboard in do_cmdline()
6e9f329d05 #5299 perf: Skip foldUpdate() in insert-mode.
9d4fcec7c6 #5426 perf: Do not auto-update folds for some foldmethods.
eeec0cab58 #5419 tui: Default to normal-mode cursor shape.

FIXES:
e83845285c #5436 tui: Fix "weird characters" / "bleeding termcodes"
10a54ad12e #5243 signal_init: Always unblock SIGCHLD.
bccb49bedb #5316 eval.c: Fix memory leak for detached pty job
626065d385 #5227 tchdir: New tab should inherit CWD.
cd321b7d0f #5292 getcwd(): Return empty string if CWD is invalid.
6127eaef05 shada: Fix non-writeable ShaDa directory handling
ca65514a24 #2789 system(): Respect shellxescape, shellxquote
2daf54ee8d #4874 Restore vim-like tab dragging
0c536b5d8a #5319 syntax.c: Support bg/fg special color-names.
3c53371b0c #4972 from justinmk/schedule-ui_refresh
68bcb32ec4 #4789 tui.c: Do not wait for tui loop on teardown.
c8b6ec2e6a #5409 v:count broken in command-line window
6bc3bcefc6 #5461 fix emoji display
51937e1322 #5470 fix :terminal with :argadd, :argu
79d77da8a0 #5481 external UIs: opening multiple files from command-line
657ba62a84 #5501 rplugin: resolve paths in manifest file
6a6f188d2a #5502 system('foo &', 'bar'): Show error, don't crash.
1ff162c0d9 #5515 os_nodetype: open fd with O_NONBLOCK
2a6c5bb0c4 #5450 modeline: Handle version number overflow.
0ade1bb706 #5225 CI tests now run against Windows!
2016-10-28 15:16:45 +02:00
Justin M. Keyes
5b514b5988 Merge #5535 from justinmk/api_level
api: Nvim version + API level
2016-10-28 14:53:09 +02:00
Justin M. Keyes
c5f5f427c6 api: api_info()['version']
API level is disconnected from NVIM version. The API metadata holds the
current API level, and the lowest backwards-compatible level supported
by this instance.

Release 0.1.6 is the first release that reports the Nvim version and API
level.

    metadata['version'] = {
      major: 0,
      minor: 1,
      patch: 6,
      api_level: 1,
      api_compatible: 0,
      api_prerelease: false,
    }

The API level may remain unchanged across Nvim releases if the API has
not changed.

When changing the API,
    - set NVIM_API_PRERELEASE to true
    - increment NVIM_API_LEVEL (at most once per Nvim version)
    - adjust NVIM_API_LEVEL_COMPAT if backwards-compatibility was broken

api_level_0.mpack was generated from Nvim 0.1.5 with:
    nvim --api-info
2016-10-28 14:33:13 +02:00
Justin M. Keyes
fb4d5b0516 CheckHealth: check for sensible.vim 2016-10-28 13:54:08 +02:00
Rui Abreu Ferreira
f25797f869 api: Nvim version, API level #5386
The API level is disconnected from the NVIM version. The API metadata
holds the current API level, and the lowest backwards-compatible level
supported by this instance.

Release 0.1.6 will be the first release reporting the Nvim version and
API level.

    metadata['version'] = {
      major: 0,
      minor: 1,
      patch: 6,
      prerelease: true,
      api_level: 1,
      api_compatible: 0,
    }

The API level may remain unchanged across Neovim releases if the API has
not changed.

When changing the API the CMake variable NVIM_API_PRERELEASE is set to
true, and  NVIM_API_CURRENT/NVIM_API_COMPATIBILITY are incremented
accordingly.

The functional tests check the API table against fixtures of past
versions of Neovim. It compares all the functions in the old table with
the new one, it does ignore some metadata attributes that do not alter
the function signature or were removed since 0.1.5.  Currently the only
fixture is 0.mpack, generated from Neovim 0.1.5 with nvim --api-info.
2016-10-26 14:23:50 +02:00
Justin M. Keyes
90bf31c742 Merge #5500
Closes #5246
2016-10-26 14:01:49 +02:00
Justin M. Keyes
26b90e95e7 test: Add missing test from vim-patch:7.4.2312 2016-10-26 13:53:14 +02:00
Michael Ennen
e350902b7d vim-patch:7.4.2128 (#5517)
Problem:    Memory leak when saving for undo fails.
Solution:   Free allocated memory. (Hirohito Higashi)

1e2258297b
2016-10-26 13:27:00 +02:00
Florian Larysch
2a6c5bb0c4 modeline: Handle version number overflow. #5450
Closes #5449

A file containing the string "vim" followed by a very large number in a modeline
location will trigger an overflow in getdigits() which is called by
chk_modeline() when trying to parse the version number.

Add getdigits_safe(), which does not assert overflows, but reports them to the
caller.
2016-10-26 13:05:25 +02:00
Michael Ennen
0f32088ea2 vim-patch:7.4.2109 (#5518)
vim-patch:7.4.2109

Problem:    Setting 'display' to "lastline" is a drastic change, while
            omitting it results in lots of "@" lines.
Solution:   Add "truncate" to show "@@@" for a truncated line.

ad9c2a08f0
2016-10-25 21:15:43 +02:00
Justin M. Keyes
e828a5a76b Merge #5530 from justinmk/checkhealth
CheckHealth: more checks. Also hack around an infinite loop.
2016-10-25 20:42:04 +02:00
Justin M. Keyes
e8ddbbdf07 list_features(): Hack around infinite loop.
msg_putchar() is not updating msg_col, this causes an infinite loop. Observed
with execute('version') *nested* in another execute(), in particular this line:
    let buildtype = matchstr(execute('version'), '\v\cbuild type:?\s*[^\n\r\t ]+')
when called by :CheckHealth (see runtime/autoload/health/nvim ..
s:check_performance()).

But invoking some variation of execute('...execute("version")') is not enough to
provoke the bug, maybe it needs to be in a user function?
2016-10-25 15:55:29 +02:00
Justin M. Keyes
c853fd6fab CheckHealth: more checks 2016-10-25 15:55:29 +02:00
Justin M. Keyes
714ec09c6d version: Allow has("nvim-x"), has("nvim-x.y") 2016-10-25 13:08:48 +02:00
Justin M. Keyes
e7e2844d46 version: has("nvim-1.2.3")
Helped-by: Daniel Hahler <git@thequod.de>
2016-10-25 11:40:37 +02:00
Michael Ennen
f6f77272b3 vim-patch:7.4.1782
Problem:    strcharpart() does not work properly with some multi-byte
            characters.
Solution:   Use mb_cptr2len() instead of mb_char2len(). (Hirohito Higashi)

fca6600305
2016-10-24 12:49:17 -07:00
Justin M. Keyes
f96dfae52f doc; vim-patch.sh
Also include missing changes from:
06d2d38ab7
26852128a2
2016-10-24 13:26:55 +02:00
Justin M. Keyes
fb503d73da Merge #5483 from Shougo/vim-0648142
vim-patch 0648142, 91c4937, 06d2d38, 2685212, 269f595
2016-10-24 13:17:41 +02:00
Michael Ennen
6bc0d9b8c7 vim-patch:7.4.1779
Problem:    Using negative index in strcharpart(). (Yegappan Lakshmanan)
Solution:   Assume single byte when using a negative iindex.

73dfe917ba
2016-10-23 22:55:22 -07:00
Michael Ennen
b5dfdf0669 vim-patch:7.4.1742
Problem:    strgetchar() does not work correctly.
Solution:   use mb_cptr2len().  Add a test. (Naruhiko Nishino)

5d18e0eca5
2016-10-23 18:04:46 -07:00
Michael Ennen
9e5dca8490 vim-patch:7.4.1741
Problem:    Not testing utf-8 characters.
Solution:   Move the right asserts to the test_expr_utf8 test.

b22bd46b96
2016-10-23 18:04:46 -07:00
Michael Ennen
763422b036 vim-patch:7.4.1734
Problem:    Test fails when not using utf-8.
Solution:   Split test in regularand utf-8 part.

0f518a8f4d
2016-10-23 18:04:46 -07:00
Michael Ennen
d6e27f90b9 vim-patch:7.4.1730
Problem:    It is not easy to get a character out of a string.
Solution:   Add strgetchar() and strcharpart().

58de0e2dcc
2016-10-23 18:04:28 -07:00
Justin M. Keyes
43309d1993 test/api: Specify handling of VimL errors, v:errmsg.
TODO: Also spec behavior of Press-Enter prompt for these API functions.
2016-10-24 01:10:23 +02:00
Grzegorz Milka
d357a42389 Fix lint errors. 2016-10-23 01:17:39 +02:00
Grzegorz Milka
9755a2ffd5 vim-patch:7.4.2312
Problem:    Crash when autocommand moves to another tab. (Dominique Pelle)
Solution:   When navigating to another window halfway the :edit command go
            back to the right window.

5a49789a9b
2016-10-23 00:41:45 +02:00
Grzegorz Milka
c5c8a82134 vim-patch:7.4.2309
Problem:    Crash when doing tabnext in a BufUnload autocmd. (Dominique Pelle)
Solution:   When detecting that the tab page changed, don't just abort but
            delete the window where w_buffer is NULL.

11fbc2866c
2016-10-23 00:37:13 +02:00
Grzegorz Milka
d7b942b54e vim-patch:7.4.2237
Problem:    Can't use "." and "$" with ":tab".
Solution:   Support a range for ":tab". (Hirohito Higashi)

9b7f8ce9eb
2016-10-23 00:37:13 +02:00
Justin M. Keyes
fdc48cad7d Merge #5523 from justinmk/test-system
test: system(): Avoid indeterminism. Also adjust docs.
2016-10-23 00:33:51 +02:00
Justin M. Keyes
459a6ff058 test: system(): Avoid indeterminism. 2016-10-23 00:13:33 +02:00
Justin M. Keyes
8b8db9e158 api: documentation
Clarify behavior of v:errmsg and the Error object.
2016-10-23 00:13:33 +02:00
Grzegorz Milka
9ca90fdb9f vim-patch:7.4.2212
Problem:    Mark " is not set when closing a window in another tab. (Guraga)
Solution:   Check all tabs for the window to be valid. (based on patch by
            Hirohito Higashi, closes vim/vim#974)

e59215c7dc
2016-10-22 23:43:14 +02:00
Justin M. Keyes
500c485e36 Merge #5499 from tweekmonster/vim-8.0.0041
vim-patch: 8.0.0041, 8.0.0042, 8.0.0043
2016-10-22 23:36:04 +02:00
Grzegorz
e62f681d2d vim-patch:7.4.2227 (#5521)
Problem:    Tab page tests are old style.
Solution:   Change into new style tests. (Hirohito Higashi)

1381d79147
2016-10-22 23:22:50 +02:00