Compare commits

...

2186 Commits

Author SHA1 Message Date
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
5b514b5988 Merge #5535 from justinmk/api_level
api: Nvim version + API level
2016-10-28 14:53:09 +02:00
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
fb4d5b0516 CheckHealth: check for sensible.vim 2016-10-28 13:54:08 +02:00
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
90bf31c742 Merge #5500
Closes #5246
2016-10-26 14:01:49 +02:00
26b90e95e7 test: Add missing test from vim-patch:7.4.2312 2016-10-26 13:53:14 +02:00
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
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
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
e828a5a76b Merge #5530 from justinmk/checkhealth
CheckHealth: more checks. Also hack around an infinite loop.
2016-10-25 20:42:04 +02:00
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
c853fd6fab CheckHealth: more checks 2016-10-25 15:55:29 +02:00
714ec09c6d version: Allow has("nvim-x"), has("nvim-x.y") 2016-10-25 13:08:48 +02:00
e7e2844d46 version: has("nvim-1.2.3")
Helped-by: Daniel Hahler <git@thequod.de>
2016-10-25 11:40:37 +02:00
f96dfae52f doc; vim-patch.sh
Also include missing changes from:
06d2d38ab7
26852128a2
2016-10-24 13:26:55 +02:00
fb503d73da Merge #5483 from Shougo/vim-0648142
vim-patch 0648142, 91c4937, 06d2d38, 2685212, 269f595
2016-10-24 13:17:41 +02:00
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
d357a42389 Fix lint errors. 2016-10-23 01:17:39 +02:00
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
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
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
fdc48cad7d Merge #5523 from justinmk/test-system
test: system(): Avoid indeterminism. Also adjust docs.
2016-10-23 00:33:51 +02:00
459a6ff058 test: system(): Avoid indeterminism. 2016-10-23 00:13:33 +02:00
8b8db9e158 api: documentation
Clarify behavior of v:errmsg and the Error object.
2016-10-23 00:13:33 +02:00
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
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
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
f2af6177fb vim-patch:8.0.0043
Problem:    When using Insert mode completion with 'completeopt' containing
            "noinsert" with CTRL-N the change is not saved for undo.  (Tommy
            Allen)
Solution:   Call stop_arrow() before inserting for any key.
2016-10-22 15:15:27 -04:00
d733beb0be vim-patch:8.0.0042
Problem:    When using Insert mode completion with 'completeopt' containing
            "noinsert" change is not saved for undo.  (Tommy Allen)
Solution:   Call stop_arrow() before inserting for pressing Enter.
2016-10-22 15:15:27 -04:00
c377c8be61 vim-patch:8.0.0041
Problem:    When using Insert mode completion but not actually inserting
            anything an undo item is still created. (Tommy Allen)
Solution:   Do not call stop_arrow() when not inserting anything.
2016-10-22 15:15:21 -04:00
31df051ed9 Merge pull request #4568 from bfredl/multirequest
atomic multi request for async remote plugins
2016-10-22 12:50:50 +02:00
f6968dc0f7 api: call multiple methods atomically (useful in async contexts)
remove unused response_id parameter of handle_nvim_... helpers
2016-10-22 10:51:32 +02:00
e904186277 vim-patch: mark applied #5381
vim-patch:b20617b
Add OSX build to Travis CI. (Christian Brabandt)
b20617b0b0

vim-patch:471a897
Update gitignore for new test binary.  (Oyvind Holm, closes vim/vim#954)
471a897569

vim-patch:2cb70a2
Put building with interfaces on the right target.
2cb70a2744

vim-patch:87776a1
Correct build condition.
87776a1ac1

vim-patch:8de7465
Add missing "then".
8de7465d77

vim-patch:1a9f947
Add a separate build target for the unittests. Hopefully the coverage will be merged then.
1a9f947cde

vim-patch:8211fcb
Run unittests before scripttests.  Hopefully does not mess up coverage.
8211fcbdc9

vim-patch:8e77bad
Add json_test to gitignore (Hirohito Higashi)
8e77bad3c1
2016-10-21 23:00:57 +02:00
1ff162c0d9 os_nodetype: open fd with O_NONBLOCK (#5515)
Closes #5267

Helped-by: oni-link <knil.ino@gmail.com>
2016-10-21 22:03:01 +02:00
82f30bfeda [RFC] vim-patch:7.4.1704 (#5487)
vim-patch:7.4.1704

Problem:    Using freed memory with "wincmd p". (Dominique Pelle)
Solution:   Also clear "prevwin" in other tab pages.

3dda7db4e1
2016-10-21 12:55:57 -04:00
6636e2a259 test: :terminal should not interrupt Press-ENTER
References #2748
2016-10-20 23:41:59 +02:00
5bcb7aa8bf Merge pull request #5441 from Shougo/vim-7.4.1588
vim-patch:7.4.1588
2016-10-20 10:47:42 -04:00
1ad5a970ce Merge pull request #5440 from Shougo/vim-7.4.1565
vim-patch:7.4.1565
2016-10-20 10:28:03 -04:00
978c1fd11f Merge pull request #5503 from jamessan/vim-7.4.1494
vim-patch:7.4.1494
2016-10-20 09:40:07 -04:00
e19234f391 man.vim: silence file call (#5509)
When a file is opened by nvim with ft=man already set, and
"has('vim_starting')", ftplugin/man.vim calls
'execute 'file man://'.ref', this causes nvim to display something like
this:

````
"<name of original file>" 977, 41017C
"man://foo(1)" [Not edited] 977 lines --0%--
Press ENTER or type command to continue
````

This is annoying, because nothing of note has actually happened.

Use cases why you might want to read a man page from a file:

`MANPAGER='bash -c "nvim -c \"set ft=man\" </dev/tty <(col -bx)"' man git`
`nvim -c 'set ft=man' <(man -P cat git)`
2016-10-20 08:35:48 +02:00
13262aef7a Merge pull request #5507 from bfredl/terminal_api
tests: fix racyness in terminal/api_spec.lua
2016-10-19 22:12:37 +02:00
d1070787ca tests: fix racyness in terminal/api_spec.lua
Previously, the nvim_input from the socket channels could be processed
before the input from stdin in rare cases.
2016-10-19 15:21:49 +02:00
2d961403ba Merge pull request #5393 from bfredl/dispatchfix
refactor gendispatch.lua to move verbatim c code to .c files
2016-10-19 15:16:05 +02:00
caf85b80ae api: move verbatim c code out of gendispatch.lua and into c files
Remove max_fname_len check, which caused false successful lookups,
and was an optimization for a very rare case.
2016-10-19 09:06:30 +02:00
9d4fcec7c6 folds: Do not auto-update folds for some foldmethods. #5426 2016-10-19 02:22:55 +02:00
6a6f188d2a Merge #5502 from justinmk/error-write-to-bg-process
system('foo &', 'bar'): Show error, don't crash.
2016-10-19 02:09:29 +02:00
9706664b88 system('foo &', 'bar'): Show error, don't crash.
Closes #3529
Closes #5241

In Vim,
    :echo system('cat - &', 'foo')
works because for both system() and :! Vim writes input to a temp file and uses
shell syntax to redirect the file to the backgrounded `cat` (get_cmd_output()
.. make_filter_cmd()).

In Nvim,
    :echo system('cat - &', 'foo')
fails because we write the input directly via pipes (shell.c:do_os_system()),
but (per POSIX[1]) backgrounded process input stream is redirected from
/dev/null (unless overridden by shell redirection; supported only by some shells
[2]), so our writes are ignored, the process exits quickly, and if we are
writing data larger than the buffer size we'll see EPIPE.

This still works:
    :%w !tee > foo1358.txt &
but this does not:
    :%w !tee foo1358.txt &
though it *should* (why doesn't it?) because we still do the temp file dance
in do_bang() .. do_filter().

[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_03_02
[2] http://unix.stackexchange.com/a/71218
2016-10-19 01:39:05 +02:00
16da3a6fe0 test: system(): backgrounded shell command
These tests are essentially affirming a regression vs Vim. In Vim,
    :echo system('cat - &', 'foo')
returns "foo", because Vim internally wraps the command with shell-specific
syntax to redirect the streams from /dev/null[1].

That can't work in Nvim because we use pipes directly (instead of temp files)
and don't wrap the command with shell-specific redirection syntax.

References #3529
References #5241

[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_03_02
2016-10-19 01:01:27 +02:00
657ba62a84 rplugin: resolve paths in manifest file (#5501)
`:CheckHealth nvim` would always report an outdated manifest if symlinks were
used, because the manifest file contains unresolved paths that get compared
against resolved paths.

Now we resolve paths before they get written to the manifest file.
2016-10-18 23:16:13 +02:00
73da9fdafd hist_char2type: Return '/' for NUL.
During -S execution, ccline.cmdfirstc is NULL, so calling histadd() with
a hist-name of '' would fail.  Mimic Vim's behavior and fallback to '/'
in this scenario, since '' is a documented hist-name as of
vim/vim@3e496b0e.
2016-10-18 10:48:29 -04:00
6bbd4b2298 vim-patch:7.4.1494
Problem:    clr_history() does not work properly.
Solution:   Increment hisptr. Add a test. (Yegappan Lakshmanan)

119d4693e0

Note: Only added a test. The change to `histptr` had already been made.
2016-10-18 10:34:40 -04:00
869a9078e1 Doc: Ruby omni-completion works (#5497) 2016-10-17 19:49:57 +02:00
fbd6b10e1b Merge #5493 from justinmk/checkhealth
CheckHealth: check tmux, terminfo
2016-10-16 20:14:14 +02:00
acdc0b1955 CheckHealth: check terminfo 2016-10-16 18:14:24 +02:00
c40b3b680d CheckHealth: check tmux configuration 2016-10-16 18:08:53 +02:00
6fc122e600 doc 2016-10-16 18:08:53 +02:00
0fa4f98a05 Revert "Makefile: add PREFIX variable"
This reverts commit c13f72ee0a.

References #5447.
2016-10-16 12:17:00 +02:00
97caabc49a test: execute_spec: Adjust screen assertion.
The previous form was passing because it happens immediately before this form;
 but on a very fast(?) server the screen check might miss that form. It's also
 not really want we want to assert anyways.
2016-10-15 22:16:48 +02:00
3a2903c836 vim-patch: 7.4.1619 (#5475)
Problem:    When 'fileformats' is set in the vimrc it applies to new buffers
            but not the initial buffer.
Solution:   Set 'fileformat' when starting up. (Mike Williams)

364fa5c7ec
2016-10-16 00:02:31 +02:00
4169fc8281 vim-patch:7.4.1833 (#5484)
Problem:    Cannot use an Ex command for 'keywordprg'.
Solution:   Accept an Ex command. (Nelo-Thara Wallus)

2ff8b64679
2016-10-15 23:59:23 +02:00
b268ba353a Merge pull request #5424 from jamessan/win-tab-nr
api: Support getting the number of a window/tabpage
2016-10-15 15:29:53 -04:00
885db120fa Merge pull request #5456 from jamessan/char-sign-conversion
Enable CI testing of unsigned char and fix fallout
2016-10-15 15:29:13 -04:00
9477c5bb5b Merge pull request #5384 from bfredl/getchar_event
allow event processing in getchar()
2016-10-15 10:36:34 +02:00
719dae2e01 events: allow event processing in getchar()
this is consistent with vim, and is necessary for plugins that implement
their own input modes using "getchar()" and still want to do async
event processing.
2016-10-15 09:50:59 +02:00
3bb388664d vim-patch:7.4.1565
Problem:    Crash when assert_equal() runs into a NULL string.
Solution:   Check for NULL. (Dominique) Add a test.

f155196444
2016-10-15 14:25:50 +09:00
c91a0dca02 vim-patch:269f595
Updated runtime files.

269f595f9e
2016-10-15 12:21:13 +09:00
f3efb724af vim-patch:2685212
Update runtime files.

26852128a2
2016-10-15 12:15:36 +09:00
40f853398e vim-patch:06d2d38
Updated runtime files.

06d2d38ab7
2016-10-15 12:12:20 +09:00
59aa2eb501 vim-patch:91c4937
Updated runtime files.

91c4937be1
2016-10-15 12:03:57 +09:00
9d087206ab vim-patch:0648142
Update runtime files.

0648142700
2016-10-15 11:51:46 +09:00
41ab095399 vim-patch:7.4.1588
Problem:    Old style test for quickfix.
Solution:   Turn test 96 into a new style test.

1ff2b64b11
2016-10-15 11:09:03 +09:00
79d77da8a0 startup: Remove 'N files to edit' message. #5481
Problem:
    When '--embed' passed to command line arguments, stdin and stdout
    are used for IPC. But when multiple files are passed as
    arguments, nvim wrongly sends 'N files to edit' message to its
    stdout. As the result, attaching to process from frontend failed.

Solution:
    Remove the message because it doesn't fill any purpose.
2016-10-14 18:12:10 +02:00
819b79dbc5 health/provider.vim: Pass errors through. Give more feedback. 2016-10-13 17:55:15 +02:00
c9b9f052cc Revert "tui: Move ui_bridge module to tui/ namespace."
ui_bridge.c is useful for libnvim consumers, not just the built-in TUI.

This reverts commit beb2e4f095.
2016-10-13 16:05:06 +02:00
294c0ba014 health/provider.vim: Fix system([]) invocations.
Closes #5435
2016-10-13 15:17:24 +02:00
5060ebc5d0 test/tui_spec: Force LANG=C
References #5455
2016-10-13 14:20:03 +02:00
5a61ff188c Merge #5257 from jbradaric/vim-7.4.1893
vim-patch:7.4.{1893,1895}
2016-10-13 01:19:09 +02:00
22fe76aec4 Merge #5418 from Shougo/vim-7.4.2158
vim-patch: 7.4.2158, 2162, 2205
2016-10-13 00:44:18 +02:00
6a2d40497a Merge #5427 from Shougo/vim-7.4.1714
vim-patch: 7.4.1765, 7.4.1714
2016-10-13 00:22:23 +02:00
51937e1322 Merge #5470 from justinmk/pr5445 2016-10-13 00:13:39 +02:00
e9fd1244b7 doc
yuck
2016-10-13 00:06:32 +02:00
8fb7972517 doc 2016-10-12 23:52:41 +02:00
3a54ce5a73 vim-patch:7.4.2274 (#5439)
Problem:    Command line completion on "find **/filename" drops sub-directory.
Solution:   Handle this case separately. (Harm te Hennepe, closes vim/vim#932, closes
            vim/vim#939)

73d4e4c892
2016-10-12 23:01:11 +02:00
68f7464eed ui: Blank the next cell for any multi-cell character
Followup for #5461
2016-10-12 16:32:53 -04:00
6b7faf22f4 main.c: "BufReadCmd term://": Skip existing terminal.
Check `exists('b:term_title')` to avoid the BufReadCmd for already-initialized
:terminal buffers.

Move the test for `:argadd`.
Add a test for `:edit<CR>`.
Tweak comments and code style.
2016-10-12 21:37:08 +02:00
6bc3bcefc6 Merge pull request #5461 from jamessan/emoji-ui-regression
ui: Fix the call to utf_ambiguous_width
2016-10-12 12:53:44 -04:00
538255c228 terminal: Move re-edit detection to do_ecmd(). #5445
Closes #4784
2016-10-12 14:56:20 +02:00
cb351c678b Merge pull request #5467 from jszakmeister/prevent-in-tree-builds
build: prevent in-tree builds for the time being, as it's not supported
2016-10-12 04:03:15 -04:00
f098e53e6f Merge pull request #5466 from jszakmeister/fix-generated-files-for-in-tree-build
Fix generated files for in-tree build.
2016-10-12 04:02:47 -04:00
0190b9fb92 Merge #5463 from justinmk/te-skip-writes
term_write(): Skip writes if stream was closed.
2016-10-12 08:45:30 +02:00
b182f247ec eval/term_write(): Skip writes if stream was closed.
If the backing stream for a :terminal was closed (e.g. if the shell exits
unexpectedly) there may be pending input on the loop which will be processed
before the terminal close event (which is queued on the same loop).

terminal_send checks term->closed but this does not reflect the state of the
underlying streams. The terminal.c module in fact has no knowledge of the
streams (this seems intentional: it is abstracted as TerminalOption.write_cb).

The SIGCHLD handler (pty_process_unix.c) is executed immediately, and it
triggers a stream teardown so Stream.closed=false (TerminalJobData.in.closed).
When the pending writes are handled by eval.c:term_write, wstream_write() aborts
because it sees the closed Stream.

To avoid that, this commit checks Stream.closed in eval:term_write() before writing
to the WStream. (As hinted above, we cannot do this in terminal:terminal_send()
because that module cannot inspect the underlying streams.)

References #5445
https://github.com/neovim/neovim/pull/5445#issuecomment-252529766
2016-10-12 04:33:53 +02:00
ef4676ed5b test/terminal: Cover race when :term shell process exits.
References #5445

See https://github.com/neovim/neovim/pull/5445#issuecomment-252529766
2016-10-12 04:33:53 +02:00
baaddf358b build: fix generated file paths when building in-tree 2016-10-11 20:46:27 -04:00
53eddb881c build: prevent in-tree builds for the time being, as it's not supported 2016-10-11 20:20:31 -04:00
1dde512498 UpdateRemotePlugins: Discard duplicate paths. (#5464) 2016-10-12 01:04:59 +02:00
892f55bd20 ui: Fix the call to utf_ambiguous_width
`utf_ambiguous_width` expects the Unicode character, but in 9e1c6596 I
just passed the first UTF-8 byte to the function.  This led to various
display problems because now many multi-cell characters weren't falling
into that part of the branch.

Also, to better align with the existing Vim code, remove the forced
cursor update.  Setting the flag will cause it to happen in the next
UI_CALL.

Thanks to qvacua for all the help investigating the issue!

Closes #5448
2016-10-11 18:59:01 -04:00
f1bc50d7da Merge pull request #5457 from jamessan/wincmd-count
window: Fix cmd_with_count's formatting when sizeof(long) != 8
2016-10-11 18:57:06 -04:00
d545c8e1ce window: Fix cmd_with_count's formatting when sizeof(long) != 8
On architectures where `sizeof(long)` != 8, "%" PRId64 will read junk from
memory.  This was seen on various Debian builds where
test/functional/legacy/close_count_spec.lua would fail due to `1<C-w>c`
emitting an error like `E488: Trailing characters: close-87944975647104`.

Changing the `Prenum` parameter to int64_t ensures it is safe to use
`"%" PRId64`, and make another small step towards removal of the use of
`long`.
2016-10-11 16:22:24 -04:00
1dd98a03aa lint 2016-10-09 22:06:45 -04:00
8fd12805d7 if_cscope: Fix conversion warnings when char defaults to unsigned
../src/nvim/if_cscope.c: In function 'cs_read_prompt':
    ../src/nvim/if_cscope.c:1771:47: warning: comparison is always true due to limited range of data type [-Wtype-limits]
         while ((ch = (char)getc(csinfo[i].fr_fp)) != EOF && ch != CSCOPE_PROMPT[0])
                                                   ^~
    ../src/nvim/if_cscope.c:1804:14: warning: comparison is always false due to limited range of data type [-Wtype-limits]
           if (ch == EOF) {
                  ^~
    ../src/nvim/if_cscope.c:1816:14: warning: negative integer implicitly converted to unsigned type [-Wsign-conversion]
             ch = EOF;
                  ^~~
    ../src/nvim/if_cscope.c:1821:12: warning: comparison is always false due to limited range of data type [-Wtype-limits]
         if (ch == EOF)
                ^~

Since EOF is -1, it will be converted to a large unsigned value to
compare with unsigned char and never match.  Use an int to store the
return from getc so we can safely compare it and, once known to be
valid, cast it to char when storing it into buf.

Signed-off-by: James McCoy <jamessan@jamessan.com>
2016-10-09 21:13:08 -04:00
4192c411a8 Change constack.cs_flags from char to int
This fixes the -Wconversion warning when char's type is unsigned.

    ../src/nvim/ex_eval.c: In function 'ex_while':
    ../src/nvim/ex_eval.c:1000:28: warning: conversion to 'char' from 'int' may alter its value [-Wconversion]
           cstack->cs_lflags &= ~CSL_HAD_LOOP;
                                ^

Signed-off-by: James McCoy <jamessan@jamessan.com>
2016-10-09 21:13:07 -04:00
cb03517fd3 ci: Force unsigned char usage for the 32bit build
Since C leaves whether char is signed or unsigned up to the implementer,
there are different defaults on different architectures.

Forcing unsigned char for one of our CI builds should help catch these
issues moving forward.
2016-10-09 21:12:45 -04:00
4408431086 Merge pull request #5411 from P4Cu/vim-7.4.1549
vim-patch:7.4.1549
2016-10-08 20:51:32 -04:00
27ced483cc Merge pull request #5447 from mhinz/makefile/add-prefix
Makefile: add PREFIX variable
2016-10-08 20:38:32 -04:00
26a6ed55c6 Merge pull request #5451 from jamessan/set-username-hostname
config: Allow setting USERNAME/HOSTNAME from the environment
2016-10-08 20:28:01 -04:00
9b0b281b75 config: Allow setting USERNAME/HOSTNAME from the environment
Allowing this to be controlled externally improves reproducibility, as
well as provides a more useful address to report for "Compiled by".  For
example, I intend to set it to the packaging list when building the
Debian package.

Signed-off-by: James McCoy <jamessan@jamessan.com>
2016-10-08 14:22:36 -04:00
c13f72ee0a Makefile: add PREFIX variable
We use a Makefile which in turn uses cmake. If we wanted to set the install
prefix for cmake, we had to do this so far:

  make CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=/tmp/nvim"

That's long and hard to remember. Following the conventions of other Makefiles,
this now works as well and is equivalent:

  make PREFIX=/tmp/nvim
2016-10-08 18:39:35 +02:00
1984072822 Merge #5428 'vim-patch: 0c1ff16, 939a1ab, 8067a64'. 2016-10-08 17:17:43 +02:00
31f6334aa8 CheckHealth: choose correct path for the latest version (#5446)
If multiple versions of a package are installed, the provider health check could
choose a wrong path:

  /usr/local/lib/python3.5/site-packages/neovim-0.1.10-py3.5.egg-info/PKG-INFO
  /usr/local/lib/python3.5/site-packages/neovim-0.1.9-py3.5.egg-info/PKG-INFO

Prior to this change :CheckHealth could falsely show 0.1.9 as the installed
version, since glob() doesn't enforce any predictable order.

Now we sort all potential paths numerically in descending order and just look at
the first path instead.
2016-10-08 16:34:54 +02:00
91d13bd861 hardcopy.c: Fix -Wmaybe-uninitialized warning. 2016-10-08 00:05:50 +02:00
09e0c96201 lint: Removing dead initializations #5410 2016-10-08 00:01:03 +02:00
1b61bd93ae server_requests_spec: Expect correct window ID. 2016-10-07 17:07:17 +02:00
61024fb4a8 eval: Exit early if argument is invalid. 2016-10-07 17:07:17 +02:00
50bd8297e6 vim-patch:7.4.1895
Problem:    Cannot use a window ID where a window number is expected.
Solution:   Add LOWEST_WIN_ID, so that the window ID can be used where a
            number is expected.

888ccac890
2016-10-07 17:07:16 +02:00
d8079e5ab7 vim-patch:7.4.1893
Problem:    Cannot easily get the window ID for a buffer.
Solution:   Add bufwinid().

b3619a90ea
2016-10-07 17:07:16 +02:00
b6300742d2 Merge #5444 from malept/dont-hardcode-python3-in-checkhealth
Fix Python 2/3 health checks
2016-10-07 12:15:49 +02:00
a8f9d56796 health: fix Python 2 variable names 2016-10-06 22:09:36 -07:00
153e6835f1 health: remove duplicate nvim_path declaration
It's the same as the declaration above it, but hardcoded to use python3
and does not redirect stderr.
2016-10-06 22:09:10 -07:00
2ef1b68751 version.c: mark NA patches (#5380)
NA list:

1653: matchit packadd
1750: channel
1770: termguicolors
1794: GUI Win32
1805: Makefile
1804, 1945: manpager.vim
1811: channel
2115, 2232, 2278, 2319: defaults.vim

included:
1763: spell
2016-10-06 16:22:20 +02:00
e83845285c tui/flush_buf: Don't toggle cursor when called from out() #5436
unibi_format() calls out() multiple times for a given format string.
When data->buf fills up during this process, flush_buf() gets called,
which possibly calls unibi_out() again to toggle the cursor visibility.
However, if we were halfway through outputting an escape sequence, doing
this will clobber it, resulting in junk being displayed.

Fix this by not toggling the cursor visibility when draining a full
buffer in out().
2016-10-06 15:57:24 +02:00
d57f25e5ef doc/vim_diff.txt (#5432) 2016-10-06 09:45:24 +02:00
1ebb75b1ec api: Support getting the number of a window/tabpage
In order to provide better compatibility with the classic bindings, the
API needs to provide the ability to query the number (really index) of
the window/tabpage.

This is needed for neovim/python-client#87, as discussed in
neovim/neovim#1898.

Signed-off-by: James McCoy <jamessan@jamessan.com>
2016-10-04 14:34:35 -04:00
b1edc8abb7 Merge pull request #5366 from NovaDev94/vim-7.4.1740
vim-patch:7.4.1740
2016-10-04 13:14:56 -04:00
7bc86b2bbc vim-patch:0c1ff16
updated runtime files.  Add avra syntax.

0c1ff16b54
2016-10-04 23:34:28 +09:00
d4f32d0789 vim-patch:939a1ab
Updated runtime files.

939a1abe93
2016-10-04 23:33:28 +09:00
31a29e41b0 vim-patch:8067a64
Add missing test file.

8067a64852
2016-10-04 23:25:37 +09:00
fdb0a5e24e vim-patch:7.4.1765
Problem:    Undo options are not together in the options window.
Solution:   Put them together.  (Gary Johnson)

4694a17d1e
2016-10-04 23:18:24 +09:00
c3990ba0e6 vim-patch:7.4.1714
Problem:    Non-GUI specific settings in the gvimrc_example file.
Solution:   Move some settings to the vimrc_example file.  Remove setting
            'hlsearch' again. (suggested by Hirohito Higashi)

54f1b7abf8
2016-10-04 23:14:47 +09:00
eeec0cab58 tui/terminfo_start: Default to normal-mode cursor shape. (#5419)
References #4867

For users who use a "bar" shape in the shell, it's annoying that Nvim starts
with that same cursor shape, despite starting in normal-mode. So default to the
normal-mode "block" shape instead. (Note: technically it's possible some user
may set 'insertmode', and then the opposite problem occurs. But 'insertmode' is
a silly option that shouldn't exist, and any user that uses it probably isn't
fiddling with their cursor shape anyways.)

Also rename the unibilium extensions:
    enter_insert_mode   => set_cursor_shape_bar
    enter_replace_mode  => set_cursor_shape_underline
    exit_insert_mode    => set_cursor_shape_block
to say explicitly what they do in the context of a terminal; it's irrelevant in
this context what purpose they serve in Nvim.
2016-10-02 03:41:11 +02:00
91e9c0a7ee ci: .travis.yml: Minimize scope of osx_image directive. (#5420) 2016-10-02 03:37:17 +02:00
6186df3562 event/multiqueue.c: Rename "queue" to "multiqueue".
`lib/queue.h` implements a basic queue. `event/queue.c` implements
a specialized data structure on top of lib/queue.h; it is not a "normal"
queue.

Rename the specialized multi-level queue implemented in event/queue.c to
"multiqueue", to avoid confusion when reading the code.

Before this change one can eventually notice that "macros (uppercase
symbols) are for the normal queue, lowercase operations are for the
multi-level queue", but that is unnecessary friction for new developers
(or existing developers just visiting this part of the codebase).
2016-10-02 00:24:49 +02:00
db324879d2 vim-patch:7.4.2205
Problem:    'wildignore' always applies to getcompletion().
Solution:   Add an option to use 'wildignore' or not. (Yegappan Lakshmanan)

e9d58a6459
2016-10-01 20:07:27 +09:00
de802fd4d2 vim-patch:7.4.2162
Problem:    Result of getcompletion('', 'sign') depends on previous
            completion.
Solution:   Call set_context_in_sign_cmd(). (Dominique Pelle)

7522f69821
2016-10-01 19:54:35 +09:00
aeebed8d61 vim-patch:7.4.2158
Problem:    Result of getcompletion('', 'cscope') depends on previous
            completion. (Christian Brabandt)
Solution:   Call set_context_in_cscope_cmd().

b650b9878e
2016-10-01 19:54:28 +09:00
9959113746 vim-patch:7.4.1549
Problem:    Test for syntax attributes fails in Win32 GUI.
Solution:   Use an existing font name.

c835293d54
2016-09-30 15:27:18 +02:00
c8b6ec2e6a Merge pull request #5409 from jamessan/toplevel-state
Correct logic for setting NormalState.toplevel
2016-09-30 08:25:15 -04:00
3a59b04c19 Correct logic for setting NormalState.toplevel
In Vim's main_loop function, the main loop is

        while (!cmdwin
    #ifdef FEAT_CMDWIN
                || cmdwin_result == 0
    #endif
                )
        {
    ...
    #ifdef FEAT_EVAL
            /*
             * May perform garbage collection when waiting for a character, but
             * only at the very toplevel.  Otherwise we may be using a List or
             * Dict internally somewhere.
             * "may_garbage_collect" is reset in vgetc() which is invoked through
             * do_exmode() and normal_cmd().
             */
            may_garbage_collect = (!cmdwin && !noexmode);
    #endif
            /*
             * If we're invoked as ex, do a round of ex commands.
             * Otherwise, get and execute a normal mode command.
             */
            if (exmode_active)
            {
                if (noexmode)   /* End of ":global/path/visual" commands */
                    return;
                do_exmode(exmode_active == EXMODE_VIM);
            }
            else
                normal_cmd(&oa, TRUE);
        }

cmdwin_result is set to 0 before calling main_loop to handle the cmdwin
window and gets changed when the user causes a command to execute
(either through pressing <CR> or <C-c>).  This means that when the
cmdwin isn't active OR the user is still editing their command,
main_loop runs and main_loop calls normal_cmd with toplevel true as long
as exmode isn't active.

When the normal mode state was extracted in dae006a9, the conditions for
toplevel and may_garbage_collect were combined.  Since toplevel was set
to always ignore cmdwin, the v:count(1) variables were no longer being
updated when a command was prefixed with a count in the cmdwin.

Closes #5404
2016-09-30 07:29:25 -04:00
724675061c Merge pull request #5358 from jbradaric/vim-7.4.1679
vim-patch:7.4.{1648,1679,1681}
2016-09-28 20:35:29 -04:00
b0aa748e14 vim-patch:7.4.1681
Problem:    Coverity warns for fixed size buffer length (false positive).
Solution:   Add a check for the name length.

ef9d9b94a8
2016-09-28 21:45:07 +02:00
7531410169 vim-patch:7.4.1679
Problem:    Coverity: copying value of v_lock without initializing it.
Solution:   Init v_lock in rettv_list_alloc() and rettv_dict_alloc().

7d2a5796d3
2016-09-28 21:36:11 +02:00
42731a9a15 vim-patch:7.4.1648
Problem:    Compiler has a problem copying a string into di_key[]. (Yegappan
            Lakshmanan)
Solution:   Add dictitem16_T.

bee6c0cf86
2016-09-28 21:36:11 +02:00
87fa495b21 Merge #5395 from justinmk/log 2016-09-28 12:46:03 +02:00
7e6a8310b7 log.c: align/adjust layout
New:
  2016/09/27 18:00:49 INFO  28117/tui_flush:597: ...

Old:
  2016/09/27 18:00:49 [info @ tui_flush:597] 28117 - ...
2016-09-28 03:29:55 +02:00
beb2e4f095 tui: Move ui_bridge module to tui/ namespace. 2016-09-28 03:29:54 +02:00
9c2f4ce20d doc: minor comment tweaks 2016-09-28 03:01:57 +02:00
22dfe6925d Merge pull request #5389 from bfredl/apifix
restore ui_try_resize metadata and filter metadata attributes, and add "since" attribute
2016-09-27 18:25:55 +02:00
45d5b78aec Merge pull request #5357 from jbradaric/vim-7.4.1671
vim-patch:7.4.{1671,1818,1820,1821}
2016-09-27 11:55:05 -04:00
36ffb6a7d8 Merge pull request #5261 from jbradaric/vim-7.4.1961
vim-patch:7.4.1961
2016-09-27 11:16:57 -04:00
78ea090f29 api: add blanket implementation of "since" 2016-09-27 16:54:55 +02:00
50c26017a3 api: define the set of function attributes to expose in the metadata 2016-09-27 16:54:55 +02:00
6f55d1377f api: restore old return type of deprecated ui_try_resize method 2016-09-27 16:10:34 +02:00
ddb9f02712 Merge pull request #5356 from jbradaric/vim-7.4.1670
vim-patch:7.4.1670
2016-09-26 22:51:37 -04:00
f610b807b4 Merge pull request #5372 from jamessan/vim-7.4.1604
vim-patch:7.4.1604,7.4.1620,7.4.1629,7.4.1630,7.4.1642,7.4.1697

Closes #5149
2016-09-26 22:16:17 -04:00
b6f8c35cf7 vim-patch:7.4.1821
Problem:    Test fails on MS-Windows.
Solution:   Sort the completion results.

4ed6b2e2d7
2016-09-25 22:55:13 +02:00
9114790c4c vim-patch:7.4.1820
Problem:    Removing language from help tags too often.
Solution:   Only remove @en when not needed. (Hirohito Higashi)

9ccaae04c6
2016-09-25 22:06:57 +02:00
641d424290 vim-patch:7.4.1818
Problem:    Help completion adds @en to all matches except the first one.
Solution:   Remove "break", go over all items.

89c79b9932
2016-09-25 22:06:57 +02:00
6e55d99f43 vim-patch:7.4.1671
Problem:    When help exists in multiple languages, adding @ab while "ab" is
            the default help language is unnecessary.
Solution:   Leave out "@ab" when not needed. (Ken Takata)

61264d9969
2016-09-25 22:06:57 +02:00
6ca089fd8d option.c: Fix linter errors. 2016-09-25 21:29:12 +02:00
e74c2334f2 vim-patch:7.4.1961
Problem:    When 'insertmode' is reset while doing completion the popup menu
            remains even though Vim is in Normal mode.
Solution:   Ignore stop_insert_mode when the popup menu is visible.  Don't set
            stop_insert_mode when 'insertmode' was already off. (Christian
            Brabandt)

00672e1d3f
2016-09-25 21:29:12 +02:00
4ce24ff9da genunicodetables: Give the unicode directory as the first argument
Let genunicodetables determine which files it needs from the unicode
directory.  cmake just needs to pass the directory and destination file
to the script.
2016-09-24 20:46:09 -04:00
9e1c659666 vim-patch:7.4.1697
Problem:    Display problems when the 'ambiwidth' and 'emoji' options are not
            set properly or the terminal doesn't behave as expected.
Solution:   After drawing an ambiguous width character always position the
            cursor.

cb0700844c
2016-09-24 15:02:51 -04:00
9419a4c86c lint 2016-09-24 14:03:23 -04:00
dafca1ad68 vim-patch:7.4.1642
Problem:    Handling emoji characters as full width has problems with
            backwards compatibility.
Solution:   Only put characters in the 1f000 range in the emoji table.

6a08454b93
2016-09-24 14:03:23 -04:00
e161d6a19d vim-patch:7.4.1630
Problem:    Unicode table for double width is outdated.
Solution:   Update to the latest Unicode standard.

d63aff0a65
2016-09-24 14:03:23 -04:00
1144cc6d9e vim-patch:7.4.1629
Problem:    Handling emoji characters as full width has problems with
            backwards compatibility.
Solution:   Remove ambiguous and double width characters from the emoji table.
            Use a separate table for the character class.
            (partly by Yashuhiro Matsumoto)

b86f10ee10
2016-09-24 14:03:22 -04:00
45598d2e5e vim-patch:7.4.1620
Problem:    Emoji characters are not considered as a kind of word character.
Solution:   Give emoji characters a word class number. (Yashuhiro Matsumoto)

4077b33a83
2016-09-24 14:03:22 -04:00
49735d6fae Update unicode files 2016-09-24 14:03:22 -04:00
d533edf61e vim-patch:7.4.1604
Problem:    Although emoji characters are ambiguous width, best is to treat
            them as full width.
Solution:   Update the Unicode character tables. Add the 'emoji' options.
            (Yasuhiro Matsumoto)

3848e00e01
2016-09-24 14:03:14 -04:00
68bcb32ec4 tui.c: Do not wait for tui loop on teardown. (#4789)
Because terminfo_stop() already ran, there is not much reason to wait
for the loop to teardown.

Helped-by: Björn Linse <bjorn.linse@gmail.com>
Helped-by: oni-link <knil.ino@gmail.com>

Closes #4778
References #3541
---
Bug report:

> After pressing `ZZ` I can find two threads freezing, occupying 100% CPU:
    |-systemd-+
              |-nvim,11567 /home/lz/code/1.rs +set title
              |   `-{nvim},11574

> 11567 has two threads:
    (gdb) info threads
      Id   Target Id         Frame
    * 1    Thread 0x7f7622907780 (LWP 11567) "nvim" 0x00007f76222e66bd in pthread_join () from /usr/lib/libpthread.so.0
      2    Thread 0x7f761f5ff700 (LWP 11574) "nvim" 0x00007ffcec9e9c59 in clock_gettime ()

    (gdb) thread apply all  bt

    Thread 2 (Thread 0x7f761f5ff700 (LWP 11574)):
    #0  0x00007ffcec9e9c59 in clock_gettime ()
    #1  0x00007f76210b9356 in clock_gettime () from /usr/lib/libc.so.6
    #2  0x00007f7622513e3c in ?? () from /usr/lib/libuv.so.1
    #3  0x00007f7622505e94 in uv_run () from /usr/lib/libuv.so.1
    #4  0x00000000004822ed in loop_close (loop=loop@entry=0x7f761f5fe870) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/event/loop.c:87
    #5  0x00000000005a7ec0 in tui_main (bridge=0x7f761f6ac000, ui=0x7f761f69ace0) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/tui/tui.c:234
    #6  0x00000000005a9b47 in ui_thread_run (data=<optimized out>) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/ui_bridge.c:87
    #7  0x00007f7622510d07 in ?? () from /usr/lib/libuv.so.1
    #8  0x00007f76222e5474 in start_thread () from /usr/lib/libpthread.so.0
    #9  0x00007f76210ac69d in clone () from /usr/lib/libc.so.6

    Thread 1 (Thread 0x7f7622907780 (LWP 11567)):
    #0  0x00007f76222e66bd in pthread_join () from /usr/lib/libpthread.so.0
    #1  0x00007f7622510dae in uv_thread_join () from /usr/lib/libuv.so.1
    #2  0x00000000005aac9e in ui_bridge_stop (b=0x7f761f6ac000) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/ui_bridge.c:104
    #3  0x00000000005a90e4 in ui_builtin_stop () at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/ui.c:91
    #4  0x000000000052be09 in mch_exit (r=r@entry=1) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/os_unix.c:143
    #5  0x00000000004db1cc in getout (exitval=exitval@entry=1) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/main.c:623
    #6  0x00000000004fa43c in preserve_exit () at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/misc1.c:2652
    #7  0x000000000052b77a in deadly_signal (signum=1) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/os/signal.c:120
    #8  0x000000000052b7cf in on_signal (handle=<optimized out>, signum=<optimized out>, data=<optimized out>) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/os/signal.c:145
    #9  0x0000000000484178 in signal_event (argv=<optimized out>) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/event/signal.c:44
    #10 0x0000000000483b7f in queue_process_events (queue=0x7f7620417360) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/event/queue.c:142
    #11 0x0000000000482208 in loop_poll_events (loop=0x84dec0 <loop>, ms=ms@entry=4000) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/event/loop.c:56
    #12 0x000000000052a364 in input_poll (ms=ms@entry=4000) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/os/input.c:325
    #13 0x000000000052a3e2 in inbuf_poll (ms=4000) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/os/input.c:347
    #14 0x000000000052a839 in os_inchar (buf=buf@entry=0x0, maxlen=maxlen@entry=0, ms=ms@entry=-1, tb_change_cnt=tb_change_cnt@entry=0) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/os/input.c:107
    #15 0x0000000000592eeb in state_enter (s=s@entry=0x7ffcec9d3560) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/state.c:46
    #16 0x0000000000508533 in normal_enter (cmdwin=cmdwin@entry=false, noexmode=noexmode@entry=false) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/normal.c:464
    #17 0x00000000004dc17e in main (argc=<optimized out>, argv=<optimized out>) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/main.c:538
2016-09-24 15:32:01 +02:00
e65895941c doc/deprecated.txt (#5338)
`deprecated.txt` is a place for deprecated tags to live.
- Encourages aggressive documentation of deprecations without cluttering
  the main help files.
- Provides a single browsable reference of all deprecations.

Other changes:
- Move tags to doc/vim_diff.txt.
- Remove doc/quotes.txt. It has little historical value, except maybe the
  Larry Wall quote.
2016-09-24 15:07:49 +02:00
54d41ff049 runtest.vim: Fix spelling of s:flaky 2016-09-23 14:39:10 -04:00
b9da0bd2c5 Merge branch 'jamessan/vim-019b9c6' 2016-09-23 11:34:58 -04:00
dabf009283 vim-patch:019b9c6
Add new test file.

019b9c644e

The file was already added in 8c1fb99d2d.
This commit just informs vim-patch.sh about the inclusion.

[ci skip]
2016-09-23 11:28:38 -04:00
e6d32c1010 ci: .travis.yml: Upgrade to macOS 10.11 / xcode7.3 (#5378)
Update to a recent, but not bleeding-edge, version of macOS and xcode.
At present, travis defaults to OS X 10.9.5 / Xcode 6.1.
QuickBuild runs macOS 10.10.
2016-09-23 17:06:54 +02:00
3c53371b0c Merge #4972 from justinmk/schedule-ui_refresh
Schedule ui_refresh
2016-09-23 12:31:05 +02:00
b94891421a ui_detach: Schedule refresh on main loop.
Closes #4163
2016-09-22 20:04:32 +02:00
e54c0ab367 test: api_spec
This is an (unsuccessful) attempt to cover #4163.
It covers other behavior, so it's worth keeping.
2016-09-22 20:04:32 +02:00
7307096c5e Merge pull request #5369 from jamessan/vim-patch-preprocessing
vim-patch: Group alternations in preprocess_patch
2016-09-22 08:11:13 -04:00
9d170a493e vim-patch: Group alternations in preprocess_patch
Without the groupings, only the first alternation matches the diff
marker.  For example,

    local na_doc='todo\.txt\|version\d\.txt\|tags'
    ... +'g^diff --git a/runtime/doc/'${na_doc}'...

becomes, after expansion,

    ... +'g^diff --git a/runtime/doc/todo\.txt\|version\d\.txt\|tags'...

so the matches become "^diff --get a/runtime/doc/todo\.txt",
"version\d\.txt", or "tags".  Adding the grouping ensures the expected
behavior of requiring "^diff --get a/runtime/doc/" before every
filename.
2016-09-22 07:16:50 -04:00
e2ad3fbf27 runtest.vim: Fix spelling of (s:)messages 2016-09-21 15:39:18 -04:00
a20a00459c vim-patch:7.4.1740
Problem:    syn-cchar defined with matchadd() does not appear if there are no
            other syntax definitions which matches buffer text.
Solution:   Check for startcol. (Ozaki Kiichi, haya14busa, closes vim/vim#757)

4d58502202
2016-09-22 01:46:30 +07:00
66fa1538ed Merge pull request #5368 from jamessan/vim-7.4.1309
vim-patch:7.4.1309
2016-09-21 13:04:36 -04:00
7063dd9d64 vim-patch:7.4.1309
Problem:    When a test fails not all relevant info is listed.
Solution:   Add the errors to the messages.

00af60bbb6

7.4.1309 was incorrectly marked as applied in #4301.  7.4.1477 relies on
some of the changes that had been made in 7.4.1309, so this fixes the
build after I, pre-emptively, merged #5038.
2016-09-21 12:09:41 -04:00
6cf24be295 Merge pull request #5038 from prollings/vim-7.4.1477
vim-patch:7.4.1477
2016-09-21 10:06:22 -04:00
baf91a455c l10n: Update Ukrainian translation (#5343) 2016-09-20 18:43:26 -04:00
bba6315580 Merge #5362 from justinmk/testcleanup
test: helpers.rmdir(): retry+sleep on failure
2016-09-20 12:32:42 +02:00
911421d328 test: legacy/012_directory_spec: Also use dot-prefix on Windows.
win32 handles dot-prefixed files just fine; Nvim-on-Windows does not
perpetuate the Vim-on-Windows behavior of avoiding dot-prefixed files.
2016-09-20 11:08:14 +02:00
13e5724621 test/helpers.rmdir(): lfs.rmdir() instead of os.remove()
os.remove() fails on empty directories in non-POSIX systems.
https://github.com/keplerproject/luafilesystem/issues/4

lfs.rmdir() "usually" works, so use it instead.

Closes #5236
2016-09-20 11:08:14 +02:00
764f576d64 test/helpers.rmdir(): Retry once after a delay.
Attempt to avoid "Permission denied" on Windows potentially caused by open
filepath handle in sibling process.
2016-09-20 11:08:14 +02:00
efe8311371 Merge pull request #4739 from brcolow/vim-7.4.1266
vim-patch 7.4.1266
2016-09-18 20:34:18 -05:00
8c24592da2 vim-patch 7.4.1266
Problem:    A BufAdd autocommand may cause an ml_get error (Christian
            Brabandt)
Solution:   Increment RedrawingDisabled earlier.

ab9fc7e0cf
2016-09-18 20:49:09 -04:00
7bf0cfb01f vim-patch:7.4.1670
Problem:    Completion doesn't work well for a variable containing "vim/vim#".
Solution:   Recognize the "vim/vim#". (Watiko)

a32095fc8f
2016-09-18 17:26:39 +02:00
4a6b4bbf93 tests: migrate legacy test 12. #4196 2016-09-18 16:38:10 +02:00
7b6786f6f9 version.c: mark NA patches #5335
NA

2108: test_Netbeans
2114: tiny
2116: dosinst.c
2118: Tiny
2122: FEAT_CLIPBOARD
2129, 2130: timer
2131: channel
2133: Tiny
2138: if_py_both
2140: Tiny
2145, 2150: Win32
2153: GUI test
2154: Test_commnunicate()
2155: GUI test
2156: Win32
2157: test_job
2166, 2167: small build
2168: Makefile
2176: if_mzch
2182: term.c
2186: test_timers
2191, 2192: prototype
2193: GUI
2195: vimrun
2199: GUI
2202: small
2203: normal features
2206: ifdef
2207: xpm support feature
2210: configure
2211: mouse
2214: GUI
2216: test check sign feature
2218, 2234: ifdef
2238: term.c
2243: GUI
2247: ifdef
2252, 2253: GUI
2254: if_mzch
2257: if_python
2258, 2260: channel
2261: small
2262: viminfo
2267: Windows
2270: channel
2271: Netbeans
2281: timer
2282: mch_newshellsize()
2285: proto, Makefile
2286: Filelist, Makefile
2287: channel
2288: Windows
2289: Makefile
2290: FEAT_FLOAT
2297, 2298, 2301: channel
2302: Makefile
2304: timer
2308: Makefile
2310: timer
2316: channel
2325: Tiny
2327: channel
2332: timer
2338: small
2340: Makefile
2342: Windows
2344: channel
2345: Makefile
2351: test_Netbeans
2352: Makefile
2358: GUI
2359, 2361: timer
2363: regexp prototype
2365: Makefile, version8.txt, style
2366: bigvim.bat

Implemented

2213: EndOfBuffer
2016-09-18 13:52:07 +02:00
c12801986c Merge #5254 from KillTheMule/vim-7.4.1952
vim-patch:7.4.{1952, 1990, 2033, 2284}
2016-09-18 13:49:39 +02:00
e1079c2a28 insert_enter: Update folds on insert-leave. #5351
Fixes failing test: 045_folding_spec.lua
References #5299
2016-09-18 13:40:50 +02:00
19b47b043d eval.c: Clean up spurious FAIL checks. (#5345)
rettv_list_alloc cannot fail.
2016-09-18 13:18:45 +02:00
89a7a4f02c vim-patch:7.4.2284
Problem:    Comment in scope header file is outdated. (KillTheMule)
Solution:   Point to the help instead. (closes vim/vim#1017)

f4145d8e99
2016-09-17 16:47:21 +02:00
dc6cc4787c api: Establish API naming convention. (#5344)
old name:                   new name:
  --------------------------------------------------
  nvim_name_to_color          nvim_get_color_by_name
  nvim_get_current_buffer     nvim_get_current_buf
  nvim_get_current_window     nvim_get_current_win
  nvim_get_buffers            nvim_list_bufs
  nvim_get_tabpages           nvim_list_tabpages
  nvim_get_windows            nvim_list_wins
  nvim_set_current_buffer     nvim_set_current_buf
  nvim_set_current_window     nvim_set_current_win
  nvim_change_directory       nvim_set_current_dir
  nvim_tabpage_get_window     nvim_tabpage_get_win
  nvim_tabpage_get_windows    nvim_tabpage_list_wins
  nvim_win_get_buffer         nvim_win_get_buf
  nvim_report_error           nvim_err_writeln

Helped-by: Björn Linse <bjorn.linse@gmail.com>
Helped-by: ZyX <kp-pav@yandex.ru>
Helped-by: James McCoy <jamessan@jamessan.com>
2016-09-17 06:30:36 +02:00
3a9da803cc Merge #5326 'vim-patch:7.4.1547' 2016-09-17 06:18:28 +02:00
21eee40cdb test: synIDattr returns empty, not -1
- Behavior changed in 7.4.1547
- Also removed N/A specs: nvim does not support ":hi term=..."
2016-09-16 14:02:59 +02:00
bc1a5db6cc vim-patch:7.4.1547 #5326
Problem:    Getting a cterm highlight attribute that is not set results in the
            string "-1".
Solution:   Return an empty string. (Taro Muraoka)

385111bd86
2016-09-16 14:00:10 +02:00
6e9f329d05 perf: Skip foldUpdate() in insert-mode. #5299
Closes #5270
2016-09-16 01:19:36 +02:00
0c536b5d8a syntax.c: Support bg/fg special color-names. #5319
Refresh colors if changing Normal group
2016-09-16 00:45:57 +02:00
c4199d1866 Merge pull request #5336 from bfredl/del_var
make del_var and set_var not return the old value.
2016-09-15 20:41:16 +02:00
cd08e6cf72 api: make nvim[_obj]_set_var and _del_var not return the old value 2016-09-15 10:44:38 +02:00
c61bf43a90 gendispatch: warn for deprecated alias if the deprecated function has implemation 2016-09-15 10:44:38 +02:00
fee961c8dd Merge #5339 from jamessan/stray-test-processes
test/ui: Stop the terminal job after testing
2016-09-14 21:36:17 -04:00
c28fb221ba Restore output_spec assertion dropped in f332eba 2016-09-14 20:59:09 -04:00
df99e43ba4 tests/ui: Stop the terminal job after testing
When running the tests in a contained environment, the lingering
terminal processes prevent the unmounting of the filesystems in the
contained environment.
2016-09-14 20:56:47 -04:00
5f42184873 api: remove unnecessary initializations causing warnings in api dispatch (#5337)
Left over change from acb7c82 (fix leak when a api function is
incorrectly called with a list.). These initializations are now never
used and causes warnings in static analysis
2016-09-14 13:10:04 +02:00
172d099c32 Merge #5329 from justinmk/remove-misc2
Eliminate misc2.c
2016-09-13 17:23:35 +02:00
ca93b4a299 read_string: Use char if you mean char. 2016-09-13 16:20:09 +02:00
df072c3b2b refactor: eliminate misc2.c
move `call_shell` to misc1.c
Move some fns to state.c
Move some fns to option.c
Move some fns to memline.c
Move `vim_chdir*` fns to file_search.c
Move some fns to new module, bytes.c
Move some fns to fileio.c
2016-09-13 16:20:09 +02:00
7eb4d2f79d vim-patch:7.4.1558 (#5333)
Problem:    It is not easy to find out what windows display a buffer.
Solution:   Add win_findbuf().

9cdf86b86f
2016-09-13 14:05:34 +02:00
a34d3a7244 Merge 'vim-patch.sh' 2016-09-13 12:50:31 +02:00
d61826a85c vim-patch.sh: Use printf instead of echo
Also: neovim => nvim
2016-09-13 12:40:20 +02:00
d5aaa18316 vim-patch.sh: preprocess_patch()
- Remove not-applicable Vim changes such as *.proto, todo.txt, ...

Also:
- support NVIM_SOURCE_DIR override
2016-09-13 11:38:09 +02:00
2daf54ee8d Merge #4874 'Restore vim-like tab dragging' 2016-09-12 03:43:07 +02:00
ac819b8994 CI: Travis macOS: Skip tab left-drag tests.
These tests fail on master, so it's not a regression. Changes in #4874
(parent commit) seem to work (and pass most CI), so skipping these tests
is better than blocking the changes.
2016-09-12 03:42:51 +02:00
b801291bec CI: test: Avoid QuickBuild hang. (#5330)
Delete the CWD using nvim instead of the external lua/test runner process.
2016-09-12 03:18:48 +02:00
c6f5d6b7e0 normal.c: Restore vim-like tab dragging. #4874
Closes #4663
References #3310
2016-09-12 03:11:26 +02:00
4ceacb37d5 man.vim: prevent bell in ':wincmd w' when only one window (#5328) 2016-09-11 20:58:51 +02:00
13db9236fe vim-patch:7.4.1535 (#5327)
Problem:    The feedkeys test has a one second delay.
Solution:   Avoid need_wait_return() to delay. (Hirohito Higashi)

9e496854a9
2016-09-11 15:16:36 +02:00
c4c2969624 vim-patch:7.4.1533 #5320
Problem:    Using feedkeys() with an empty string disregards 'x' option.
Solution:   Make 'x' work with an empty string. (Thinca)

When integrating the patch to nvim, used same logic but different code
based on nvim codebase. New test passed.

74c5bbf134
2016-09-11 03:47:16 +02:00
ca65514a24 Merge #2789 'system(): Respect shellxescape, shellxquote' 2016-09-11 03:27:35 +02:00
395ef5642e shell_escape: rename; refactor
- rename to shell_xescape_xquote
- move to os/shell.c
- disallow NULL argument
- eliminate casts, nesting
- test: empty shellxquote/shellxescape
2016-09-11 03:04:57 +02:00
8dc6c1a7ff Merge #5318 from equalsraf/fix-openbsd
Fix OpenBSD builds
2016-09-10 23:36:25 +02:00
0991041ae7 system(): Respect 'sxe' and 'sxq' #2789
Fixes #2773
2016-09-10 22:21:40 +02:00
0ebd30fba7 third-party: Bump luv to v1.9.1-0
Fixes #4620
2016-09-10 18:43:05 +01:00
aa6705875d Add compiler check for -Wno-static-in-inline
Add compiler check for -Wno-static-in-inline, the option is only
supported in gcc >= 4.4, and some systems still ship with earlier
versions of gcc (see #5300).
2016-09-10 18:43:04 +01:00
4c9e5676cd Disable use of jemalloc in OpenBSD
Works around #3434, turning off the use of jemalloc in OpenBSD.
2016-09-10 18:43:04 +01:00
bccb49bedb Merge #5316 2016-09-10 14:11:12 +02:00
f8a8a56908 eval.c: Fix memory leak for detached pty job 2016-09-08 21:29:20 +02:00
1c9d7270a8 eval.c: Garbage collection frees dictionary before job cleanup
Removing a job too early from the joblist gives garbage collection the
chance to also remove the job dictionary.

Can be triggered with ASAN while waiting 'updatetime'ms (~5 seconds)
before closing the terminal window opened with:

    nvim -u NONE +'call termopen("true",{})'
2016-09-08 21:29:20 +02:00
fe06e2a4a0 doc 2016-09-06 03:43:13 -04:00
d9d2c2fcc0 doc: clarify reltime()
Closes #5301
2016-09-05 20:15:31 -04:00
df99c6493d health.vim: "No healthchecks found" also needs the buffer. 2016-09-05 19:42:28 -04:00
522b885a0d Merge #5295 'health.vim' 2016-09-05 19:34:00 -04:00
3c24704ac8 health.vim: Show results incrementally.
Also:

- improve precision of "No healthcheck found"
- fix SUGGESTIONS syntax group definition
- fix indentation of SUGGESTIONS
2016-09-05 19:22:01 -04:00
31257b450b health.vim: Factor out health#provider#check() 2016-09-05 18:29:47 -04:00
d61a50758c Improve Ruby version check in CheckHealth command
Compare current version number to that of the latest released neovim
rubygem, rather than a hard-coded version.

Note: The `gem list` command introduced here adds about 4 seconds to the
execution time of the CheckHealth command.
2016-09-04 21:26:21 -07:00
ZyX
6127eaef05 shada: Fix non-writeable ShaDa directory handling
Before this change,

    nvim -i /etc/shada

segfaults on exit if the file does not exist and user does not have
permissions to create the file at /etc/shada.

Closes #5296
Reported in #5277
https://github.com/neovim/neovim/issues/5277#issuecomment-243937255
2016-09-04 21:45:48 -04:00
cd321b7d0f getcwd(): Return empty string if CWD is invalid. #5292
Closes #5291

Restores behaviour identical to Vim. If the user calls the VimScript
function 'getcwd()' and the working directory cannot be found (for
example because the directory has been deleted since the last time it
was used) an empty string needs to be returned instead of throwing an
error.
2016-09-04 08:01:31 -04:00
73b8424fad vim-patch:7.4.1913 (#5260)
Problem:    When ":doautocmd" is used modelines are used even when no
            autocommands were executed. (Daniel Hahler)
Solution:   Skip processing modelines. (closes vim/vim#854)

1610d05241
2016-09-04 23:43:41 +02:00
0f381f26cb vim-patch:7.4.1971 (#5262)
Problem:    It is not easy to see unrecognized error lines below the current
            error position.
Solution:   Add ":clist +count".

e8fea0728a
2016-09-04 23:40:12 +02:00
e75e9c10dc test: Add unittest spec for option.c (#5289)
Move typedef expand_T to types.h for tests
Fix lint error for old style comments

Describe 'check_ff_value' valid values as an initial test.

Fix 'get_sts_value' comment inaccuracy and add unit test for it
2016-09-04 09:54:41 +02:00
9bba8ba372 [RFC] man.vim: remove <Plug> mappings (#5290)
- :Man with no arguments opens the manapage for the
  <cWORD> (man buffers) or <cword> (non-man buffers).
- remove now irrelevent comment about -P flag
2016-09-04 03:53:58 +02:00
626065d385 tchdir: New tab should inherit CWD. (#5227)
When a new tabpage gets created it will copy the local working directory
of the previous one, if there is any.
2016-09-04 03:40:01 +02:00
5d8d24f0c2 vim-patch:7.4.1900 (#5259)
Problem:    Using CTRL-] in the help on "{address}." doesn't work.
Solution:   Recognize an item in {}. (Hirohito Higashi, closes vim/vim#814)

28b942a064
2016-09-04 03:30:36 +02:00
a9c5423263 signal_init: unblock all signals on startup. #5283
As discussed on #5243 and #5283.

Helped-by: John Szakmeister <john@szakmeister.net>
Helped-by: Justin M. Keyes <justinkz@gmail.com>
2016-09-03 19:16:23 -04:00
2f6d3e599b Merge #5249 'man.vim' 2016-09-03 14:01:04 -04:00
c9e39f8227 man.vim: Avoid hard redraw.
Use system() instead of :read to avoid a hard redraw.
2016-09-03 13:59:37 -04:00
f8fc8f51c0 man.vim #5249
- fix synopsis highlighting in other locales. Cannot always rely on the first
  line for the section in some locales; instead, use the file path and
  explicitly set b:man_sect to the actual section.
- eliminate separate s:man_args function
- simplify logic: do not reuse buffer content
- introduce b:man_default_sects Fixes #5233
- introduce <Plug>(man_vsplit), <Plug>(man_tab)
- simplify regexps
2016-09-03 12:57:41 -04:00
94dfb6cea2 Merge pull request #5286 from jamessan/strtoimax-error-checking
Fix error-handling of strtoimax boundary conditions
2016-09-03 00:55:27 -04:00
0253766b5d lint: Close resource leak (#5288) 2016-09-03 00:41:55 +02:00
a371f1027e Fix error-handling of strtoimax boundary conditions
strtoimax is only required to set errno if there is an
underflow/overflow.  In those conditions, strtoimax returns
INTMAX_MIN/INTMAX_MAX respectively, so that's the only time we should be
checking the value of errno.

Even in those conditions, errno needs to be set to a known good value
before calling strtoimax to differentiate between "value is actually
INTMAX_MAX/MIN" and "value over/underflows".

Closes #5279
2016-09-02 10:11:32 -04:00
f175b281cf helpers.c: Fix invalid state of failed conversion result for object_to_vim() (#5282)
If a conversion for a container fails in object_to_vim(), the memory for
the container in the returned/converted value is freed, but the returned
value keeps a pointer to the freed memory. Calling later clear_tv() on
this value leads to an invalid memory access.

Set v_type to VAR_UNKNOWN in the converted value on failure, so that
clear_tv() has no effect.
2016-09-01 23:52:58 +02:00
c6ac4f84b1 Merge pull request #4934 from bfredl/api
make the API callable from vimL, rename API functions to common nvim_ prefix
2016-09-01 18:32:37 +02:00
acb7c826b3 api: fix leak when a api function is incorrectly called with a list.
This applies both to msgpack-rpc and eval.
2016-08-31 21:57:06 +02:00
98a08c3e5a api: add tests for calling the api from vimscript 2016-08-31 21:57:06 +02:00
1c22cab2fd api: consistently use nvim_ prefix and update documentation 2016-08-31 21:57:06 +02:00
e536abc1e1 api: Allow blacklist functions that shouldn't be accesible from eval
Blacklist deprecated functions and functions depending on channel_id
2016-08-31 21:57:06 +02:00
7e2348f2b1 eval: use gperf to generate the hash of builtin functions
make api functions highlighted as builtins in vim.vim
2016-08-31 21:57:04 +02:00
87e054bb24 api: When calling get/set_lines from vimL, don't convert between "\n" and "\0". 2016-08-31 21:40:20 +02:00
a2d25b7bf8 api: unify buffer numbers and window ids with handles
also allow handle==0 meaning curbuf/curwin/curtab
2016-08-31 21:40:20 +02:00
3bd3b3b768 api: auto generate api function wrappers for viml 2016-08-31 21:40:20 +02:00
de3a515123 api: rename "msgpack_rpc/defs.h" to "api/private/dispatch.h" and use the header generator. 2016-08-31 21:40:20 +02:00
ZyX
5e59916e84 eval: Use generated hash to look up function list
Problems:
- Disables cross-compiling (alternative: keeps two hash implementations which
  need to be synchronized with each other).
- Puts code-specific name literals into CMakeLists.txt.
- Workaround for lua’s absence of bidirectional pipe communication is rather
  ugly.
2016-08-31 21:40:20 +02:00
abe00d583e eval: add new function entries 2016-08-31 21:40:20 +02:00
ZyX
8fb7273ac0 eval: Move VimL functions list to a lua file
Removes all kinds of problems with sorting, provides a ready-to-use function
list representation for genvimvim.lua, does not require specifying function name
twice (VimL function name (string) + f_ function name).
2016-08-31 21:40:20 +02:00
0ade1bb706 Merge pull request #5225 from equalsraf/windows-functionaltests
Enable functional tests in Appveyor
2016-08-31 21:39:42 +02:00
9ce81f7b2b functionaltest: Create lua helper for os.tmpname()
In Windows Lua's os.tmpname() returns relative paths starting with \s,
prepend them with $TEMP to generate a valid path.

In OS X os.tmpname() returns paths in '/tmp' but they should be in
'/private/tmp'. We cannot use os_name() for platform detection because
some tests use tempname() before nvim is spawned, instead use one of the
following:

1. Set SYSTEM_NAME environment variable before calling the tests, it
   is set from CMAKE_SYSTEM_NAME(i.e. uname -s or 'Windows')
2. Call uname -s
3. Assume windows
2016-08-31 11:32:28 +01:00
7fd771619f vim-patch:7.4.1896 (#5258)
Problem:    Invoking mark_adjust() when adding a new line below the last line
            is pointless.
Solution:   Skip calling mark_adjust() when appending below the last line.

82faa259cc
2016-08-29 14:35:48 -04:00
10a54ad12e signal_init: Always unblock SIGCHLD. (#5243)
Inherited signal mask may block SIGCHLD, which causes libuv to hang at
epoll_wait.

Closes #5230

Helped-by: Nicolas Hillegeer <nicolas@hillegeer.com>
Helped-by: John Szakmeister <john@szakmeister.net>

Note: the #pragma gymnastics are a workaround for broken system headers on
macOS.

  signal.h:
      int  sigaddset(sigset_t *, int);
      #define     sigaddset(set, signo)   (*(set) |= __sigbits(signo), 0)
  sys/_types/_sigset.h:
      typedef __darwin_sigset_t            sigset_t;
  sys/_types.h:
      typedef __uint32_t   __darwin_sigset_t;      /* [???] signal set */

sigset_t is defined as unsigned int, but the sigaddset() ORs it with an int,
mixing the types.  So GCC generates a sign-conversion warning:

  sig.c:9:13: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]
    (*(&s) |= __sigbits((sigset_t) 20), 0);
           ~~ ^~~~~~~~~~~~~~~~~~~~~~~~
  1 warning generated.

System headers are normally ignored when the compiler generates warnings:
https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html

  > GCC gives code found in system headers special treatment. All warnings,
  > other than those generated by ‘#warning’ (see Diagnostics), are suppressed
  > while GCC is processing a system header. Macros defined in a system header
  > are immune to a few warnings wherever they are expanded. This immunity is
  > granted on an ad-hoc basis, when we find that a warning generates lots of
  > false positives because of code in macros defined in system headers.

Instead of the #pragma workaround, we could cast the sigset_t pointer:

    # if defined(__APPLE__)
      sigaddset((int *)&mask, SIGCHLD);
    # else
      sigaddset(&mask, SIGCHLD);
    # endif

but that could break if the headers are later fixed.
2016-08-29 13:39:32 -04:00
0b5a7e4ad5 Merge pull request #4432 from bfredl/pum_ui
allow external UI:s to render the popupmenu
2016-08-29 11:00:24 +02:00
8d6e3f2b88 api/ui: add documentation for remote ui redraw events 2016-08-29 10:17:31 +02:00
c41bacc67c api/ui: add tests for popupmenu_external events
update screen.lua to use new style nvim_ui_attach
2016-08-29 10:17:31 +02:00
e968d72cae api/ui: use ui options instead of one method per feature
Use new nvim_ui_ prefix to avoid breaking change.
2016-08-29 10:17:31 +02:00
999af47be8 api/ui: allow popupmenu to be drawn by external ui 2016-08-29 10:17:31 +02:00
0b3ec84840 Add if_cscope documentation for querytype 'a'
From 802a0d902fca423acb15f835d7b09183883d79a0.
2016-08-26 22:13:56 +02:00
e587b490a0 Lint 2016-08-26 21:50:19 +02:00
59468e3495 vim-patch:7.4.2033
Problem:    'cscopequickfix' option does not accept new value "a".
Solution:   Adjust list of command characters. (Ken Takata)

6d20e17544

All changes applied manually. Definition of `CSQF_CMDS` was moved to
`option_defs.h` in nvim.
2016-08-26 21:50:19 +02:00
1995be8451 vim-patch:7.4.1990
Problem:    Cscope items are not sorted.
Solution:   Put the new "a" command first. (Ken Takata)

80632db65e

All changes applied manually.
2016-08-26 21:50:19 +02:00
86a95c5117 vim-patch:7.4.1952
Problem:    Cscope interface does not support finding assignments.
Solution:   Add the "a" command. (ppettina, closes vim/vim#882)

b12e7ef956

All changes applied manually.
2016-08-26 21:50:18 +02:00
97c6d80ca7 release.sh: Sign the tag.
Also: hacks for BSD sed.
2016-08-26 03:51:52 -04:00
39c628d031 Mark some functional tests as pending in Windows 2016-08-26 08:21:41 +01:00
0089ef6b65 Appveyor: Enable functional tests
Most functional tests don't work on Windows yet, for now enable a subset of the tests in Appveyor builds.
2016-08-26 08:21:41 +01:00
703cf3197f third-party: Windows fix for luv build recipe
The argument quotes in the luv build recipe did not work
in Windows.
2016-08-26 08:09:56 +01:00
bed61041a0 third-party: Build busted in Windows
Busted now builds on Windows, remove the check. In Windows the binary
is called busted.bat.
2016-08-26 08:09:56 +01:00
9da4d0dfee Update to libuv 1.9.1 2016-08-26 08:09:56 +01:00
eb2d547bd5 build: Refactor appveyor/Windows scripts (#5244)
- Join all msys build scripts into one
- Clean up appveyor.yml and generate installer for tagged builds

A side effect of the cosmetic changes is that appveyor artifact
permalinks are easier to use, e.g. for the latest zip in the
master branch

    https://ci.appveyor.com/api/projects/neovim/neovim/artifacts/build/Neovim.zip?branch=master&job=Configuration%3A%20MINGW_64
2016-08-26 01:38:46 -04:00
48dbb75ff6 iconv: Always include errno.h when USE_ICONV is defined (#5251)
When USE_ICONV is defined, iconv.h references various errno constants,
but errno.h is only being included when HAVE_ICONV_H is not defined.
This causes build failures on at least GNU/Hurd.
2016-08-25 22:02:40 -04:00
7bc627b3c8 Merge #5210 'vim-patch:7.4.1898 + :Man modifiers support'. 2016-08-25 21:54:00 -04:00
4af6ec746c Merge #5253 'perf: Disable clipboard in do_cmdline()' 2016-08-25 20:47:00 -04:00
7a589e4a9e lint 2016-08-25 20:36:59 -04:00
41a64586c7 Merge pull request #5232 from bfredl/dictchar_u
eval: remove char_u in  get_dict_(string|number) key parameters
2016-08-25 19:16:03 +02:00
c826ebd3de perf: Disable clipboard in do_cmdline().
For any script--not just `:global` commands--there is no reason to
update the system clipboard until the script is finished, so disable it
during do_cmdline().

Before this change, 'clipboard=unnamedplus' causes scripted editing to
be extremely slow (e.g. `:normal` in a while-loop).

Closes #3534
2016-08-25 11:16:22 -04:00
c79bf4ec99 ops.c: Rename start_global_changes(). 2016-08-25 10:34:47 -04:00
db2aa27df1 man.vim: if reusing a buffer, do not use noautocmd
The commit that added support for modifiers regressed #5168
causing #5172. This commit fixes it again.
2016-08-24 15:41:51 -04:00
470883d705 man.vim: slight refactoring
Addresses problem one in #5240
2016-08-24 11:51:59 -04:00
f5d3f3da6f use bool type for flag mod_entry_T members 2016-08-24 11:51:59 -04:00
10b014ca7b man.vim: set window local options when reusing buffer
This is necessary incase the buffer was previously opened in a different
tab, in which the window options there do not carry over. It is not
explicitly documented in ':help local-options' but that is how it works.
2016-08-24 11:51:59 -04:00
728d582333 man.vim: support for command modifiers
Closes #5235
2016-08-24 11:51:59 -04:00
8a7b15cf35 vim-patch:7.4.1898
Problem:    User commands don't support modifiers.
Solution:   Add the <mods> item. (Yegappan Lakshmanan, closes vim/vim#829)

63a60ded3f
2016-08-24 11:51:59 -04:00
6d8a509e51 eval: remove (char_u *) in constant get_dict_(string|number) parameters
Remove redundant item availibility checks when constructing
complete items from a dict.
2016-08-24 11:04:22 +02:00
4d253b4df5 doc: CONTRIBUTING.md (#5239) 2016-08-23 23:49:09 -04:00
46475a1021 release.sh: Touch NVIM_VERSION_PATCH, show obnoxious message.
git-log-pretty-since.sh: fix bug
2016-08-22 15:39:14 -04:00
2f2e729899 Merge commit 'refs/pull/upstream/5156' 2016-08-22 02:47:10 -04:00
ad43480952 version bump 2016-08-22 00:28:47 -04:00
5b8255e251 NVIM v0.1.5
Features:
    c7d84c5550 PR #4980 Full `:ruby` support!
    c74ce334f2 PR #4624 timers: timer_start(), timer_stop()
    b8e6f04e69 PR #5205 `:CheckHealth` command

    47a15d0256 PR #4865 file: Add buffered reading and writing
        *Much* faster shada file reading (important for startup time).

    71b3e20d0f PR #4723 jobstart() learned 'rpc'
        jobs and RPC channel IDs share the same "namespace".
        jobstart() can starts RPC channels, which allows scripts to handle
        'stderr' on a RPC channel, like a typical non-RPC job.
        jobpid()/jobstop() work on RPC "jobs".
        Deprecates rpcstart().

    4dc4efc36f PR #4449 man.vim rewrite
        `:Man` command is enabled by default.
        New features: completion, window handling, better parsing, and more.

    8a4e5b4bc2 PR #4697 capture() function (renamed to execute())
        Supports nesting, including nested :redir.

    ae6db26b09 PR #5050 'rplugin manifest: default to XDG dir'
    a1682281f4 PR #5214 Restore ":browse oldfiles".
    1f7304b846 Better handling of mouse-clicks on concealed chars.
    5ea4d58a1b PR #5026 terminal: Ensure b:term_title always has a value
    c002310787 tui: Assume 256 colors in most cases.
    a2ecbc2cc0 PR #4929 Always resize the :terminal
    a59330d6fc PR #4925 api_info()
    a160590e40 PR #4813 allow setting cwd in jobstart(), termopen()
    74f6460181 PR #4633: support "special" highlight (undercurl)
    5a5ef1c222 PR #3450 mouse: Implement horizontal scroll.

Windows support:
    All PRs now build on Appveyor targeting win32 and win64!
    Numerous fixes!

Fixes:
    e9061117a5 PR #4646 Prevent data loss for process output streams
    7fa1baf44e PR #4798 'process.c: Fix block in teardown'
    c10fe010f1 Prevent endless loop in printdigraph(). (#5215)
    add41dca98 PR #5192 timers: Avoid crash after processing events
    006f9c0c9c PR #5195 Set the default value for 'packpath'
    6da7d6890c PR #5025 Restore double click
    d622e9c416 readfile(): Less-disruptive readonly check.
        Fixes an issue where nvim unnecessarily "touched" open files.
    fe6ec75725 PR #4964 Handle very long $XDG_DATA_DIRS.
    895f712df8 option: Do not expand options in XDG vars.
    1d8a076157 server_init: Handle server_address_new() failure.
    be531aba77 PR #5042 Fix v:register for clipboard=unnamed,unnamedplus
    204f557a11 PR #4984 'Trigger TabNewEntered with <CTRL-W>T'
    1e93e24f5e PR #4851 synIDattr(): Return RRGGBB value for `fg#`.

Changes:
    acc5d08b37 PR #4690 'termguicolors' option enables "true color".
        NVIM_TUI_ENABLE_TRUE_COLOR is now ignored.
2016-08-21 22:14:28 -04:00
b8e6f04e69 Merge #5205 'CheckHealth' 2016-08-21 22:04:15 -04:00
297677ecf4 remote/host.vim: Avoid "No matching autocommands".
:silent does not silence this message, even :redir does not consume it.
But execute() _does_ consume it, which interferes with the current
implementation of health.vim. It's prudent to avoid it in any case, even
if the implementation of health.vim changes in the future.
2016-08-21 22:03:28 -04:00
45cc14d9a5 CheckHealth: Remove "disable"/"enable" concept
We can add this later if it is proven necessary, but it should not be
because:

1. User can run a subset of checkers via `:CheckHealth plugin1, ...,`
2. Healthcheck is a very rare operation. Optimizing it is not worth the
   code/API complexity.
2016-08-21 22:03:28 -04:00
ed49d9d866 CheckHealth: Accept [plugin1 [, plugin2 [, ...]]] args.
To healthcheck the "foo" plugin:
    :CheckHealth foo
To healthcheck the "foo" and "bar" plugins:
    :CheckHealth foo bar
To run all auto-discovered healthchecks:
    :CheckHealth
2016-08-21 22:03:28 -04:00
545e7a4163 CheckHealth
- Overlay markdown syntax/filetype, don't invent new filetypes/syntaxes.
- migrate s:check_ruby()
- s:indent_after_line1
- Less-verbose output
2016-08-21 21:25:33 -04:00
2cc523c3af CheckHealth
- Use execute() instead of redir
- Fixed logic on suboptimal pyenv/virtualenv checks.
- Move system calls from strings to lists. Fixes #5218
- Add highlighting
- Automatically discover health checkers
- Add tests

Helped-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Helped-by: Tommy Allen <tommy@esdf.io>

Closes #4932
2016-08-21 21:25:33 -04:00
a26d52ea32 Merge pull request #5231 from jamessan/vim-7.4.1700
vim-patch:7.4.1700,7.4.2219
2016-08-21 15:06:58 -04:00
c317fc20b0 ex_cmds: Factor pieces of functionality out of do_sub
* sub_joining_lines: Optimization for :%s/\n//
* sub_grow_buf: Allocation of buffer to contain replacement text
* sub_parse_flags: Parse {flags} from :s command into subflags_T

Although this doesn't reduce do_sub's size enough to satisfy lint, it
covers the more straightforward pieces.
2016-08-20 23:55:26 -04:00
d9ab9160b8 lint 2016-08-20 23:55:26 -04:00
c7e6b58012 vim-patch:7.4.2219
Problem:    Recursive call to substitute gets stuck in sandbox. (Nikolai
            Pavlov)
Solution:   Handle the recursive call. (Christian Brabandt, closes vim/vim#950)
            Add a test.

f5a39447a8

Closes #5118
2016-08-20 23:55:11 -04:00
35ddcc5bb4 vim-patch:7.4.1700
Problem:    Equivalence classes are not properly tested.
Solution:   Add tests for multi-byte and latin1. Fix an error. (Owen Leibman)

22e421549d

src/regexp.c changes weren't applied because they're specific to EBCDIC
handling, which has been dropped from nvim.

The latin1-specific tests were also removed since neovim intends to
remove the ability to have 'encoding' set to anything other than utf8.
2016-08-20 23:54:43 -04:00
71b3e20d0f Merge pull request #4723 from bfredl/rpcstderr
allow stderr handler for rpc jobs and use it to display python/ruby startup error
2016-08-20 12:58:37 +02:00
2d60a15e25 job control: reuse common job code for rpc jobs
This makes stderr and exit callbacks work for rpc jobs
2016-08-20 12:55:35 +02:00
215922120c stream: set data together with callback 2016-08-20 10:25:33 +02:00
1b825a9ada man.vim: Avoid error in legacy vimrcs.
The old man.vim ftplugin advises users to add this to vimrc:

    runtime ftplugin/man.vim

Make this a no-op to avoid sending users on a debugging quest.
2016-08-19 22:57:24 -04:00
12b5c846ba build: initialize variable (#5194) 2016-08-19 17:41:42 -04:00
6f0f8e7f4a Merge #5198 from equalsraf/windows-path-is-absolute
Windows: path_is_absolute()
2016-08-18 18:53:03 -04:00
ccb6af064f path.c: Avoid code duplication for path separator checks 2016-08-18 09:41:09 +01:00
6b94d4d14f Windows: Check drive letter in absolute paths
Check if drive letter is alphabetic character in
path_is_absolute_path().
2016-08-18 09:41:09 +01:00
22e9c51b0f Add Windows support to path_is_absolute()
vim-patch:0
2016-08-18 09:41:08 +01:00
ae6db26b09 Merge #5050 'rplugin manifest: default to XDG dir'
Closes #5152
Closes #5090
2016-08-17 18:39:25 -04:00
f9aa029a8b host.vim: s:GetManifestPath(): octal permissions 2016-08-17 18:30:09 -04:00
acaf480bdc host.vim: s:GetManifestPath(): Create base directory if needed.
If the base directory does not exist, let mkdir(...,'p') create it.
2016-08-17 18:29:45 -04:00
8d8af65659 Linting 2016-08-17 17:48:15 -04:00
605e74327a highlight: Added QuickFixLine highlight group
- Links to Search by default

screen.c: Combine CursorLine with QuickFixLine

- HLF_QFL takes priority over HLF_CUL

docs: Updated to mention QuickFixLine
runtime: Added QuickFixLine to nvimHLGroup
tests: QuickFixLine highlight
2016-08-17 17:48:15 -04:00
4b0b391f9f host.vim: s:GetManifestPath(): Remove for-loop.
Without the for-loop it is easier to follow, more explicit, and fewer
lines.
2016-08-17 17:43:26 -04:00
966f1abd8b tests: Set env variables in RunTests.cmake
- NVIM_RPLUGIN_MANIFEST
- XDG_CONFIG_HOME
- XDG_DATA_HOME
2016-08-17 16:22:21 -04:00
01e33e1c74 runtime: rplugin manifest written to $XDG_DATA_HOME
Uses $NVIM_RPLUGIN_MANIFEST if available
2016-08-17 16:22:15 -04:00
dfb6a5133b vim-patch:7.4.2112 (#5175)
Problem:    getcompletion(.., 'dir') returns a match with trailing "*" when
            there are no matches. (Chdiza)
Solution:   Return an empty list when there are no matches.  Add a trailing
            slash to directories. (Yegappan Lakshmanan)  Add tests for no
            matches. (closes vim/vim#947)

b56195ed00
2016-08-17 09:24:20 -04:00
6b48d25cbf Merge pull request #5228 from bfredl/nullbufhl
api: handle null string in buffer_add_highlight
2016-08-17 11:09:42 +02:00
57ac9b0934 api: handle null string in buffer_add_highlight 2016-08-17 09:34:01 +02:00
c9b29d3884 Merge pull request #5224 from jszakmeister/force-penlight-version
Fix busted tests due to changes in penlight...
2016-08-15 11:59:09 -04:00
1d4506ee17 third-party: force the use of penlight 1.3.2-2 until busted is fixed
penlight 1.4.0 changed how files are being globbed and busted hasn't
been updated accordingly yet.  See Olivine-Labs/busted#528 for more
information.
2016-08-15 05:55:12 -04:00
6647f3c047 third-party: don't build busted in parallel with anything
luarocks has had trouble in the past with multiple build/install
commands running at the same time.
2016-08-15 05:43:25 -04:00
e57988a9fb Merge pull request #5197 from bfredl/screenfix
cleanup of screen tests: remove unnecessary hl_group and ignores of highlights
2016-08-14 22:57:37 +02:00
725074aafc tests: add note to expect() message about snapshot_util() 2016-08-14 21:53:02 +02:00
f332eba16c tests: don't ignore highlights in terminal tests 2016-08-14 21:53:02 +02:00
4de10d43aa tests: don't ignore highlights in completion_spec 2016-08-14 21:53:02 +02:00
f282b8ecac tests: don't ignore highlights in various tests 2016-08-14 21:53:02 +02:00
0a882b4818 tests: don't ignore highlights in screen_basic_spec 2016-08-14 21:53:02 +02:00
82b434dd51 tests: don't ignore highlights in mouse_spec 2016-08-14 21:53:02 +02:00
a63f770bcb tests: don't ignore highlights in syntax_conceal_spec 2016-08-14 21:53:02 +02:00
cc657951a9 tests: don't ignore highlights in highlight_spec 2016-08-14 21:53:02 +02:00
7b29fdd200 tests: don't ignore highlights in searchhl_spec 2016-08-14 21:53:02 +02:00
35b47890dd tests: don't ignore highlights in bufhl_spec 2016-08-14 21:53:02 +02:00
9c4a94f964 tests: remove deprecated hl_colors 2016-08-14 21:53:02 +02:00
884b37fd2a scripts/vim-patch.sh: fix typo (#5221)
[ci skip]
2016-08-14 08:19:46 -04:00
fb98145aa2 Windows: get_past_head() (#5199)
Reported in #4955, get_past_head() is supposed to return a pointer
after the head of the path (/ in UNIX, c:\ in Windows) but the windows
case was removed.

Removed the Mac reference in the comment, since there no special
handling for Mac.

vim-patch:0
2016-08-13 09:08:31 -04:00
79ef4b72d7 man.vim: doc fixes #5171
- Weird tab+space combination used for alignment. All spaces now
- Added back <C-T> mapping (somehow we missed that completely)
- Fixed mistake that <Plug>(Man) opens in a new tab. Also added note at
  top on how the window is chosen/opened.
- Clarified q local mapping
- Removed section that shows an example autocmd to add desired folding
  style.
- Removed random line in `usr_12.txt` about `<Leader>` and backslash.
- :Man supports completion, not auto-completion.

Closes #5171
2016-08-13 08:58:21 -04:00
c10fe010f1 Prevent endless loop in printdigraph(). (#5215)
Calling printdiagraph() with msg_silent != 0 can result in an endless
loop because the loop condition never changes, if msg_col is never
changed.

To fix this, calculate the number of iterations before the loop, which
is always smaller than list_width.
2016-08-11 19:10:32 -04:00
a1682281f4 Merge #5214 from jamessan/browse-modifier
Re-add ":browse" command modifier and use it with ":oldfiles"
2016-08-11 18:58:26 -04:00
8c4c366a9e Merge pull request #5213 from blueyed/unset-cdpath-with-vim-patch
scripts/vim-patch.sh: use "set -p"
2016-08-11 12:50:16 -05:00
6aefd14482 lint 2016-08-11 13:37:42 -04:00
d0c0930acf Restore ":browse oldfiles" behavior from Vim
In 3b12bb225a, ":oldfiles" was taught to
behave like Vim's ":browse oldfiles" if ":oldfiles!" was used.  However,
this conflates the use of ! for abandoning a modified buffer with
choosing one file out of a list of oldfiles.

Now that ":browse" is supported again, ":browse oldfiles" will allow the
user to select an old file, while still complaining if that would cause
a modified buffer to be abandoned.  ":browse oldfiles!" will just
abandon the buffer, as expected.
2016-08-11 13:37:42 -04:00
3e00dc4477 scripts/vim-patch.sh: use privileged mode (set -p)
Without this the "cd scripts/.." might change to another dir (since
CDPATH is looked at before a local path), and then NEOVIM_SOURCE_DIR
might end up being "/somewhere/else\n/somewhere/else" (since the "cd"
prints the dir already in that case).

Closes https://github.com/neovim/neovim/pull/5213.
2016-08-11 18:57:54 +02:00
b805a71495 Re-add support for the :browse command modifier 2016-08-11 09:32:47 -04:00
521ca58ff9 Merge pull request #5212 from nhooyr/ignore-res
ignore .res files generated by the tests in testdir
2016-08-11 07:19:37 -05:00
9768d510fa ignore .res files generated by the tests in testdir 2016-08-11 02:14:02 -04:00
add41dca98 Merge pull request #5192 from bfredl/closetime
timer: do not crash when processing events in the handler
2016-08-10 11:46:38 +02:00
0a51d26b33 timers: do not crash after processing events in the handler 2016-08-10 11:22:28 +02:00
db375102ea doc 2016-08-10 00:47:17 -04:00
3b785b32f9 Merge #5188 from justinmk/travis-test-hack
Disable test on Travis macOS/OSX.
2016-08-09 21:31:30 -04:00
3ff252ca86 man.vim: use -range instead of -count (#5203)
With -count, if the first argument is a number, it is made available
with <count>. Problem is, there is always a default count it is impossible
to tell whether the user set it.

Since v:count and v:count1 still work with 'keywordprg', -count is
unnecessary. But 'keywordprg' still calls ':Man' with a count prefixed.
So it must still accept a count in the line number position, but not consume
the first argument. This is done with -range.

Fixes #5202.
2016-08-09 20:18:04 -04:00
348fcee5fb test: Fix os_name() call. 2016-08-09 15:17:46 -04:00
68d9198501 XXX: CI: Disable hanging test on Travis OSX.
Temporary change to avoid frequent hangs on Travis macOS/OSX builds.
Hang does not occur on Quickbuild OSX (Yosemite) build.
Reverting e9061117a5 avoids the hang, but causes
more serious regressions on many more systems.

Note that the job_spec hang only happens with the gcc-4.9 Travis OSX build.

References #5002
References #5029
2016-08-09 15:17:46 -04:00
3e26c32994 Merge #5184 from equalsraf/windows-literal-path-seps
Windows: Remove use of literal path separators
2016-08-09 10:10:12 -04:00
6348864e29 Appveyor: Generate helptags and build artifacts
Build the default CMake target now that helptag generation is
working again.

For build artifacts create a zip file with an instalation of
Neovim (generated by cpack).
2016-08-09 13:14:43 +01:00
e30b2c2054 Windows: Don't use literal path separators
Per #2471, some path handling functions hardcode the UNIX path
separator '/' causing them to fail in Windows.

When BLACKSLASH_IN_FILENAME is set we may have to check against
psepc and psepcN instead of PATHSEP or use vim_ispathsep_nocolon().
2016-08-09 13:14:43 +01:00
006f9c0c9c Merge pull request #5195 from jamessan/master
Set the default value for 'packpath'
2016-08-08 19:07:54 -05:00
84bf53b803 Set the default value for 'packpath'
As noted in “:help 'packpath'”, the default value is supposed to be the
same as that for 'runtimepath'.  This was missed in the original port of
the packages functionality from Vim.

Closes #5193
2016-08-08 18:19:26 -04:00
abb0928dfb man.vim: handle empty identifier from mapping (#5187)
Regression from #5168. Also changed the Man command's nargs to '+' so
that man#open_page does not need to handle 0 arguments, because that
will never occur.
2016-08-08 01:23:12 -04:00
6da7d6890c Merge #5025 'input.c: Restore double click' 2016-08-07 23:52:27 -04:00
d69194ca8c test: mouse_spec
- Use the default buffer text provided by before_each (avoids extra steps and
  makes the tests more consistent with each other)
- Indent
- Adjust help doc
2016-08-07 23:50:40 -04:00
852ebc6f0b Merge #5185 from justinmk/readfile-perm
readfile(): Ensure `perm` for non-Unix.
2016-08-07 21:55:44 -04:00
5dc28a826e doc: Add if_ruby.txt to doc/help.txt (#5186) 2016-08-07 20:42:13 -04:00
8625c1d104 win32: readfile(): Directories should not show "[Permission Denied]".
77135447e0 introduced:

    if (!newfile) {
      return FAIL;
    }

which changed the semantics of the un-braced `else` in the
`#ifndef UNIX` block immediately above it.

This commit restores the semantics of Vim. Until now it mostly worked by
accident, but on Windows it would mean that opening a directory would
show "[Permission Denied]".
2016-08-07 20:39:37 -04:00
8d09301090 readfile(): Ensure perm for non-Unix.
In the (!read_buffer && !read_stdin) case, always set `perm` for all
platforms. This also means we no longer need to set `perm` in the case
of (fd < 0) for non-Unix.
2016-08-07 19:07:42 -04:00
f1eb303187 Merge #5130 from equalsraf/tb-appveyor
Enable MSYS/MinGW builds in Appveyor
2016-08-07 17:35:10 -04:00
6050d3f15d man.vim: handle 'gdefault' (#5182)
Fixes #5181
2016-08-07 17:30:05 -04:00
6bcaea7c41 Create os_translate_sys_error()
Wrap up uv_translate_sys_error and fallbacks into a new function
os_translate_sys_error(). In windows a copy of the original
uv_translate_sys_error() was imported from libuv.
2016-08-07 21:57:30 +01:00
11ecd20387 Fix vim-patch:7.4.689 2016-08-07 21:57:29 +01:00
25ec29d4e1 Windows: Fix functionaltest fixtures 2016-08-07 21:57:29 +01:00
9da4d1b4cb third-party: Pass along cmake generator in luv recipe 2016-08-07 21:57:29 +01:00
723366d40b third-party: Build libvterm in MinGW
Add build recipe for libvterm in MinGW, a CMakeLists.txt
file is bundled in third-party/cmake/.
2016-08-07 21:57:29 +01:00
04012349f6 third-party: Create path in CopyFilesGlob.cmake 2016-08-07 21:57:28 +01:00
faafd9b70c Build third-party deps in MinGW
Added recipes to build bundled dependencies in native MinGW
toolchains - libuv, luajit, luarocks, msgpack
2016-08-07 21:57:28 +01:00
db7fdcd0ba MSVC: Build third-party dependencies as release DLLs
Using /MT was causing issues when building luarocks, revert it, use the
dynammic runtime and generate release DLLs for the dependencies.
Some refactoring was required because for linking cmake looks for the
import libraries (.lib) but on runtime executables we need the .dll files
to be in the same folder.

The DLLs are placed in the bin/ folder in order for nvim.exe to run
during the build and tests. The install target installs the DLLs with
the nvim binary - uses GetPrerequisites to find runtime DLLs.

Some minor issues that required adjustments:
- [MSVC] FindMsgpack.cmake now looks for msgpack_import.lib instead of
  msgpack.lib
- The lua-client fails to find libuv.lib, instead it looks for uv.lib,
  added second copy of the file to the install command.
- [MSVC] CMAKE_BUILD_TYPE affects the output paths, default to Release.

Part of these changes are credited to @jasonwilliams200OK who fixed the
third-party recipes to consistently use the same build type.
2016-08-07 21:57:28 +01:00
b85bae4cac Merge #5168 from nhooyr/man-rewrite
man.vim: default mapping and general improvements
2016-08-07 16:55:20 -04:00
e8a3477dc7 man.vim: buffers are now listed
- Since the names are set and ':vsplit printf(3)' work, there is no need
to unlist them.
2016-08-07 15:53:31 -04:00
e89eb5d21b man.vim: refactoring and autocmd fix
- man#open_page_command and man#open_page_mapping are now a single
  function
- New autocmd to fix #5172
2016-08-07 15:53:07 -04:00
46492a472a lint 2016-08-07 13:29:36 -04:00
08a5f91481 test: Add tests for double, triple, and quadruple click 2016-08-07 13:21:03 -04:00
563628e617 input.c: restore double click 2016-08-07 13:21:03 -04:00
f665bde183 man.vim: default K mapping
- Also some small improvements in other parts.
2016-08-06 19:49:29 -04:00
64013a5deb man.vim: small syntax improvements (#5170) 2016-08-06 16:17:31 -04:00
4dc4efc36f Merge #4449 'man.vim' 2016-08-04 23:53:11 -04:00
66ceb5a487 man.vim: doc, UX tweaks
s:error: Convention is to highlight the entire message, so stick to that.
2016-08-04 23:52:52 -04:00
42e9606c23 man.vim: rewrite
- Smart autocomplete. It's automatically sorted, filtered for duplicates
  and even formats the candidates based on what is needed. For example,
  `:Man 1 printf<TAB>` will show the pages that are in section 1m as
  'page(sect)' to let you know they are in a more specific section.
- Instead of trying to unset $MANPAGER we use the -P flag to set the
  pager to cat
- Always use the section arg '-s', it makes the code much simpler
  (see comment in s:man-args).
- A manpage name starting with '-' is invalid. It's fine for sections
  because of the use of '-s'.

- The tagstack is an actual stack now, makes it much simpler.
- By using v:count and v:count1, the plugin can explicitly check whether
  the user set a count, instead of relying on a default value (0) that
  is actually a real manpage section.
- Extraction of a manpage reference is much more simple. No giant long
  complicated regexes. Now, the plugin lets `man` handle the actual
  validation. We merely extract the section and page. Syntax regexes are
  a bit more specific though to prevent highlighting everything.
- Multilingual support in the syntax file. Removed the cruft that was only
  relevent to vim. Also simplified and improved many of the regexes.

- Using shellescape when sending the page and sect as arguments
- In general, the code flow is much more obvious.
- man#get_page has been split up into smaller functions with explicit
  responsibilties
- ':help' behavior in opening splits and manpages
- Comments explaining anything that needs explaining and isn't
  immediately obvious.
- If a manpage has already been loaded but if it were to reloaded at the
  current width which is the same as the width at which it was loaded at
  previously, it is not reloaded.

- Use substitute to remove the backspaced instead of `col -b`, as the
  latter doesn't work with other languages.
- Open paths to manpages
- It uses cWORD instead of cword to get the manpage under the cursor, this
  helps with files that do not have (,) in iskeyword. It also means the
  plugin does not set iskeyword locally anymore.
- <Plug>(Man) mapping for easy remapping
- Switched to single quotes wherever possible.
- Updated docs in $VIMRUNTIME/doc/filetype.txt (still need to update
  user-manual)

- Always call tolower on section name. See comment in
  s:extract_page_and_sect_fpage
- Formatting/consistency cleanup
- Automatically map q to ':q<CR>' when invoked as $MANPAGER
- It also fully supports being used as $MANPAGER. Setting the name and
  stuff automatically.
- Split up the setlocals into multiple lines for easier readability
- Better detection of errors by redirecting stderr to /dev/null. If an
  error occured, stdout will be empty.

- Functions return [sect, page] not [page, sect]. Makes more sense with
  how man takes the arguments as sect and then page.
- Pretty prints errors on a single line.
- If no section is given, automatically finds the correct section for
  the buffer name. It also gets the correct page. See the comment in
  s:get_page
- If $MANWIDTH is not set, do not assign directly to $MANWIDTH because
  then $MANWIDTH will always stay set to the same value as we only use
  winwidth(0) when the global $MANWIDTH is empty. Instead we set it
  locally for the command.
- Maintainer notes on all files.
2016-08-04 22:46:53 -04:00
a8e973dea6 ex_messages: remove 'Messages maintainer' (#5160) 2016-08-04 21:01:32 -04:00
fe6ec75725 Merge #4964 from ZyX-I/no-xdg-expand
option: Do not expand options, obtained from XDG vars
2016-08-04 20:59:51 -04:00
d622e9c416 Merge #5159 from justinmk/readfile-readonly-check 2016-08-04 19:18:59 -04:00
a8d1b5f721 readfile(): readonly: Also check "not writable". 2016-08-04 19:02:33 -04:00
b8c27a83b3 readfile(): Less-destructive readonly check.
Fixes #4162
Fixes #4200
Closes #4944

Regression by 4a138137f7. That commit mentions
a "possible race condition" but the cost isn't worth the (unexplained) gain.
2016-08-04 19:01:52 -04:00
5a8ae8d3fe Merge pull request #5148 from munyari/vim-7.4.1603
[RFC] version.c: add completed patches
2016-08-04 21:31:33 +02:00
0d93cd6c46 vim-patch:7.4.1557 (#5117)
Problem:    Windows cannot be identified.
Solution:   Add a unique window number to each window and functions to use it.

86edef664e
2016-08-04 00:22:45 -04:00
a4cb500d98 vim-patch:7.4.1477
Problem:    Test_reltime is flaky, it depends on timing.
Solution:   When it fails run it a second time.

b5760a1ce5
2016-08-04 13:29:29 +10:00
08d11bd42f vim-patch:7.4.1673 (#5141)
Problem:    The justify plugin has to be copied or sourced to be used.
Solution:   Turn it into a package.

2946d0236d

Justification for changes that do not carry over

- `Filelist` does not exist in neovim
- neovim does not have a `README.txt` in `runtime/macros`
2016-08-03 08:07:28 -04:00
e0e15360b8 version.c: add completed patches 2016-08-01 18:10:45 -04:00
f53c8258be MinGW Appveyor builds
- Build for MinGW x86/x86_64. Move build scripts out of the yml file into
  separate batch files.
- The MinGW builds use MSYS to get runtime dependencies, but they do not
  link against the POSIX adaptation layer.
- For now only build the nvim.exe binary, but not the helptags.
2016-08-01 12:57:58 +01:00
55682710a9 Travis: Remove MinGW builds
MinGW builds in Travis have been disabled for a while now, and some
of the upcoming patches will break cross compilation even further.
2016-08-01 12:57:58 +01:00
ba705042ff Merge #4837 from justinmk/os_resolve_shortcut
os_resolve_shortcut
2016-08-01 05:27:20 -04:00
d1d9ac5a3c doc: mention tnoremap
Closes #5097
2016-08-01 04:58:40 -04:00
6fe8c1d051 vim-patch:7.4.1305 #5094
Problem:    "\%1l^#.*" does not match on a line starting with "#".
Solution:   Do not clear the start-of-line flag. (Christian Brabandt)

7c29f38781

Helped-by: jamessan
Helped-by: mhinz
2016-08-01 03:59:04 -04:00
23f591dba0 [RFC] vim-patch:7.4.2011, vim-patch:7.4.2012, vim-patch:7.4.2066 #5106
vim-patch:7.4.2011

Problem:    It is not easy to get a list of command arguments.
Solution:   Add getcompletion(). (Yegappan Lakshmanan)

aa4d73235b

vim-patch:7.4.2012

Problem:    Test for getcompletion() does not pass on all systems.
Solution:   Only test what is supported.

0d3e24be56

vim-patch:7.4.2066

Problem:    getcompletion() not well tested.
Solution:   Add more testing.

c1fb763184
2016-08-01 03:33:38 -04:00
70ae6ac344 vim-patch:7.4.1676 #5143
Problem:    The shellmenu plugin has to be copied or sourced to be used.
Solution:   Turn it into a package.

fead3ac9a3

Justification for changes that do not carry over

- `Filelist` does not exist in neovim
- neovim does not have a `README.txt` in `runtime/macros`
2016-08-01 03:25:03 -04:00
247d1cec06 vim-patch:7.4.1675 #5142
Problem:    The swapmous plugin has to be copied or sourced to be used.
Solution:   Turn it into the swapmouse package.

e101204906

Justification for changes that do not carry over

- `Filelist` does not exist in neovim
- neovim does not have a `README.txt` in `runtime/macros`
2016-08-01 03:23:21 -04:00
172cf079c7 vim-patch:7.4.2013, vim-patch:7.4.2014
vim-patch:7.4.2013

Problem:    Using "noinsert" in 'completeopt' breaks redo.
Solution:   Set compl_curr_match. (Shougo, closes vim/vim#874)

67081e5061

vim-patch:7.4.2014

Problem:    Using "noinsert" in 'completeopt' does not insert match.
Solution:   Set compl_enter_selects. (Shougo, closes #875)

32b808a4bd
2016-08-01 03:07:49 -04:00
2cd3a2d1d8 Merge #4634 'version.c: update' 2016-07-30 18:07:00 -04:00
af95037c96 vim-patch:7.4.1237 (#5092)
Problem:    Can't translate message without adding a line break.
Solution:   Join the two parts of the message.

d9ea9069f5
2016-07-31 14:39:08 -04:00
aa2c439940 eval.c: rename capture() to execute() (#5132) 2016-07-31 13:23:29 -04:00
f4187c46bd version.c: update 2016-07-30 18:06:27 -04:00
02346f9bc7 os_resolve_shortcut: Report conversion error. 2016-07-30 15:28:13 -04:00
f2d5ba65b5 mbyte.c: Move utf8/utf16 functions to mbyte.c 2016-07-30 15:28:13 -04:00
23aadb6948 utf16_to_utf8 2016-07-30 15:28:13 -04:00
d96b359410 os_resolve_shortcut: cleanup 2016-07-30 15:28:12 -04:00
618aad3811 os_resolve_shortcut: Remove legacy win16 codepath. 2016-07-30 15:28:12 -04:00
6b33e9b103 utf8_to_utf16: adapt libuv's fs__capture_path 2016-07-30 15:28:12 -04:00
771d42e426 os_resolve_shortcut: initial port from Vim source 2016-07-30 15:28:12 -04:00
faca814116 matchit.vim: preserve jumplist (#5124) 2016-07-30 12:48:40 -04:00
9b210c1fa9 Merge pull request #5076 from fwalch/travis/osx-deps
Travis: Use caching instead of pre-compiled deps for OSX.
2016-07-30 17:58:22 +02:00
3455e66cfc Travis: Build 3rd-party dependencies with system's default compiler.
Using GCC 4.9 for building the dependencies caused some linker error on
OS X.
2016-07-30 10:21:04 +02:00
3d1084f264 Travis: Fix accidental building of 3rd-party dependencies.
Running tests from the top-level Makefile will use the third-party
dependencies from .deps instead of the ones from the Travis cache.
2016-07-30 10:21:04 +02:00
66a4c95866 Travis: Use caching instead of pre-compiled deps for OSX. 2016-07-30 10:21:04 +02:00
bd8ef4ea24 test: fix 2016-07-29 08:58:27 -04:00
c168dc32b9 Remove redundant includes of unistd.h (#5126) 2016-07-29 08:53:01 -04:00
149518c6b3 doc: gentle transition steps; stub XDG section
Closes #4951
2016-07-29 00:51:02 -04:00
e5781d005a Merge #2850 2016-07-28 18:51:06 -04:00
7a56967f8c A bit of linting 2016-07-28 18:50:34 -04:00
1f7304b846 mouse.c: Adjust clicked column if chars are concealed (#5087)
syntax.c: Added syn_get_concealed_id()

tests: Added tests for mouse clicks on concealed text.
2016-07-28 14:14:53 -04:00
56f178058a man: fix description of XDG_DATA_HOME (#5120)
If not set `XDG_DATA_HOME` is defaulted to `~/.local/share`; the data are stored under the `$XDG_DATA_HOME/nvim`.
2016-07-27 08:52:35 -04:00
ea690e4038 version.c: Update to 7.4.2107
1601: Filelist, Makefile
1602: info files
1609: Filelist
1610: if_ole, directX
1611: FEAT_VERTSPLIT
1612, 1613: small feature
1615: tiny feature
1616-1618, 1621-1628, 1631, 1635: channel fix
1632, 1633: Makefile fix
1636: getln.c
1646: Python eval
1651: MS-DOS
1655: remote_expr() fix
1657, 1659, 1661, 1662, 1665-1669, 1680: channel
1672, 1674: dvorak plugin
1678: if_mzch
1683: dosinst.c
1684: README
1687, 1717, 1722: channel
1688: if_mzch
1689: if_ruby
1690: ifdef
1693: if_perl
1694: Win32 GUI
1698: Makefile
1705: guifont in Windows
1706: __ARGS
1709: ifdef
1713: GTK GUI
1721: vimtbar plugin
1724: tabline with GUI
1725: fix for ANSI C
1726: compiler warning for ex_smile
1729, 1746: if_perl
1733: Makefile
1736, 1743, 1744, 1747: if_python
1737: UNUSED
1745: README
1749: GTK
1756: dll path
1760: compiler warnings
1764: job
1766: INSTALL_pc.txt
1767: configure
1770: true color
1771: ifdef
1772, 1775: Makefile
1773: compiler warnings
1774, 1778: true color
1776: term.c
1777: channel
1784: true color
1786: term.c
1787, 1789-1791: channel
1788: NSIS support
1794: Win32 GUI
1795-1798: term.c
1800: ifdef
1801: Makefile
1803: GTK3
1807, 1810, 1811, 1814, 1817, 1822, 1824-1829: channel
1819: Compiler warning
1830: os_mswin.c
1843: if_python
1845: channel
1846: term.c
1848: if_perl
1849, 1850, 1853, 1855-1859: channel
1852: GUI test
1854: termguicolors
1860: timer
1863: if_xxx
1864: if_python
1865: eval.c leak
1869: if_perl
1870: if_mzch
1872: if_perl
1873: timer in GUI
1874: Win32
1877-1880: channel
1883: ViVim, gui_mac
1885: MinGW
1886, 1887: channel
1890: GUI
1891: channel
1892, 1894: balloon
1899: GUI_GTK
1901: GUI_Win32
1902, 1906: channel
1908: NetBeans
1915: gui_menu
1916: test_channel
1917-1921: viminfo
1922: if_ruby
1924: function(void)
1925, 1926, 1931-1933, 1938, 1939, 1943: viminfo
1927: if_mzch
1929: if_ruby
1930: ifdef
1934: Makefile
1935: GUI
1942: termguicolors
1944: Make_MSVC
1946: Filelist
1947: viminfo
1951: Makefile, if_ruby
1957, 1958: if_perl
1959: channel
1963: Win32 cygpty
1965, 1969: channel
1974: GUI
1982, 1987, 1988: viminfo
1983: Filelist Makefile ifdef protocol
1985: VMS build filename_upper_camel
1995: GUI
1998: channel
2001: ifdef
2003, 2004: cursor flicker in GUI
2016: Make_cyg
2020: ifdef
2025: GUI_GTK
2026: channel
2027: ifdef
2030, 2032, 2034: Make cygwin MinGW
2035: ACL support
2037, 2038: small build
2039-2041: channel
2042: GUI_GTK
2045: channel
2048: legacy
2052, 2053: Makefile
2054: ifdef
2055, 2057, 2063: eval.c refactoring
2056: prototype
2059, 2060: Makefile
2070: spell.h
2078: term.c
2079: test_netbeans
2089, 2092: GUI
2091: term.c
2102: GUI tiny
2105: configure

Included
1732: auto completion folds
2016-07-27 19:53:31 +09:00
67062d20ed CMake: fix USE_BUNDLED_LIBUV
Closes #5114.
2016-07-25 20:56:52 +02:00
fbb2cd791d vim-patch:7.4.1179 (#5112)
Problem:    test_writefile and test_viml do not delete the tempfile.
Solution:   Delete the tempfile. (Charles Cooper)  Add DeleteTheScript().

f4f79b84a5
2016-07-25 08:12:24 -04:00
2bb4c43f2f Merge pull request #5020 from jamessan/vim-7.4.1663
vim-patch:7.4.1663,7.4.1682,7.4.1703
2016-07-24 12:29:06 -05:00
a4987bac3e lint 2016-07-23 20:42:46 -04:00
452707e0b0 vim-patch:7.4.1703
Problem:    Can't assert for not equal and not matching.
Solution:   Add assert_notmatch() and assert_notequal().

b50e5f5686
2016-07-23 20:42:46 -04:00
f1d912c584 vim-patch:7.4.1682
Problem:    Coverity: no check for NULL.
Solution:   Add check for invalid argument to assert_match().

72188e9aae
2016-07-23 20:42:46 -04:00
aece3ffa7d vim-patch:7.4.1663
Problem:    In tests it's often useful to check if a pattern matches.
Solution:   Add assert_match().

ea6553bec3
2016-07-23 20:42:46 -04:00
8c1fb99d2d vim-patch:7.4.1491 #5048
Problem:    Visual-block shift breaks multi-byte characters.
Solution:   Compute column differently. (Yasuhiro Matsumoto) Add a test.

20b4f463f4
2016-07-18 11:39:40 -04:00
7563972fd9 vim-patch:7.4.1365 (#5037)
Problem:    Cannot execute a single test function.
Solution:   Add an argument to filter the functions with. (Yasuhiro Matsumoto)

befb366aff
2016-07-20 01:40:04 -04:00
92866042d9 coverity/150263: s/STRCPY/STRLCPY/, bounds check (#5036) 2016-07-20 01:35:44 -04:00
77937c4edd Merge #5058 2016-07-18 11:22:43 -04:00
9c3bd3e427 test: Update test_alot.vim
These tests should be here, not in the Makefile.
2016-07-18 11:17:16 -04:00
1d8a076157 server_init: Handle server_address_new() failure.
Closes #3364
2016-07-18 11:02:30 -04:00
d0c0b10b4c vim-patch:7.4.1186 (#5091)
Problem:    Error messages for security context are hard to translate.
Solution:   Use one string with %s. (Ken Takata)

4a1314cb9c
2016-07-19 23:47:25 -04:00
0595da8d0b Merge #5062 from blueyed/fix-genvimvim-funcnames
genvimvim.lua: fix matching functions
2016-07-19 14:03:36 -04:00
90d1ad3975 fixup! fixup! genvimvim.lua: fix matching functions 2016-07-19 12:37:19 +02:00
291c3c6ff3 Merge #5077 from fwalch/travis/fix-gcov
Travis: Fix coveralls upload.
2016-07-17 11:03:53 -04:00
f639c97c72 Travis: Run GCov on GCC-5 build.
Running coveralls with llvm-cov doesn't seem to work.
2016-07-17 13:57:16 +02:00
0aa687a15d Travis: Fix coveralls upload. 2016-07-17 12:42:43 +02:00
7fa1baf44e Merge #4798 'process.c: Fix block in teardown' 2016-07-16 03:36:12 -04:00
ff93c9bd90 test: PTY descendants should not prevent exit. 2016-07-16 03:34:59 -04:00
4d4c92535a Merge #5068 'justinmk/output_spec' 2016-07-14 23:29:38 -04:00
ed3b3aa9cd test: output_spec
Reference: https://github.com/neovim/neovim/issues/3772#issuecomment-162334005
2016-07-14 23:28:23 -04:00
329f922f14 fixup! genvimvim.lua: fix matching functions 2016-07-14 00:42:55 +02:00
e63c6ca8f2 genvimvim.lua: fix matching functions
Fixes https://github.com/neovim/neovim/issues/5060.
2016-07-13 18:51:24 +02:00
09c58f721b Merge pull request #5059 from joshtriplett/busted-specify-lua-interpreter
Pass busted the path to the detected Lua interpreter
2016-07-13 17:09:26 +01:00
be531aba77 Merge pull request #5042 from bfredl/unnamedunnamedplus
clipboard: make v:register=='+' when clipboard=unnamed,unnamedplus
2016-07-13 10:11:30 +02:00
5ea4d58a1b Merge #5026 from joshtriplett/term-title-statusline
Please support setting terminal title in :terminal
2016-07-13 04:04:30 -04:00
98fb0f12c4 vim-patch:7.4.1548
Problem:    Two tests fail.
Solution:   Adjust the expected error number. Remove check for type.

5a2800fd14
2016-07-13 17:59:29 +10:00
a3dc7ef445 vim-patch:7.4.1546
Problem:    Sticky type checking is more annoying than useful.
Solution:   Remove the error for changing a variable type.

f6f32c38bf

Note: There are a bunch of other changes to eval.txt that I believe are
N/A and not related to this patch.
2016-07-13 17:47:46 +10:00
fc98d2d96d Pass busted the path to the detected Lua interpreter
Otherwise, busted may run a different interpreter than the one we
detected, without the capabilities we expect.  (For instance, we might
have detected the luajit interpreter, but busted might run the lua
interpreter, without the ffi module.)
2016-07-13 00:37:50 -07:00
72ad5a16e7 Fix String_eq() (#5051)
Change implementation to compare sequences of bytes instead of C
strings.

The former implementation would return "false positives" in these cases:

"\0a" and "\0b": C strings are NUL-terminated, so it would compare two
                 empty strings.

"a" and "ab":    If both strings aren't the same length, it would
                 compare only up to the length of the shorter one.

Fixes #5046.
2016-07-12 22:16:43 -04:00
83aea9ccf5 Document terminal buffer-local variables
Include an example of using them in 'statusline'.
2016-07-12 14:42:17 -07:00
448dd2adfa Add missing translation from vim-patch:5e9b2fa
The UTF-8 Japanese translation of "Word '%.*s' added to %s" was missed
in 404dc5420b, which caused a segfault due
to the missing '%.*s'.

Closes #5055
2016-07-12 22:42:17 +01:00
d529ca0103 terminal: Ensure b:term_title always has a value
Factor out a helper function to set b:term_title, and call it during
terminal initialization as well, to set the initial title to the term://
URL.

This makes it much easier to use b:term_title in a statusline, with just
`setlocal statusline=%{b:term_title}`, rather than needing an expression
to handle the unset case.
2016-07-12 14:42:17 -07:00
6ea2bde065 clipboard: fix v:register when clipboard=unnamed,unnamedplus 2016-07-12 22:30:51 +02:00
335be4272e window: Silence clang-analyzer null dereference error (#5032) 2016-07-12 00:43:06 -04:00
dcbd1c7b13 vim-patch:7.4.1147 (#5005)
Problem:    Conflict for "chartab". (Kazunobu Kuriyama)
Solution:   Rename the global one to something less obvious.  Move it into
            src/chartab.c.

88e8f9f144
2016-07-10 17:05:06 -04:00
29060a592c vim-patch.sh: ignore coloring and pagers (#5030) 2016-07-10 15:21:45 -04:00
b771ec8baa install: Include *.rb in runtime files. 2016-07-10 14:43:14 -04:00
c7d84c5550 Merge #4980 'Support legacy :ruby commands'. 2016-07-10 14:16:12 -04:00
ZyX
56fcabbd05 option: Silence linter 2016-07-10 02:04:27 +03:00
ZyX
9767b9f00f functests: Also make sure that set all& does not expand 2016-07-10 02:04:27 +03:00
ZyX
3878626c05 functests: Add tests for XDG defaults 2016-07-10 02:04:27 +03:00
ZyX
5fc72882cc option: Also escape commas in options other then &runtimepath 2016-07-10 02:04:27 +03:00
ZyX
1a92585e32 option.h: Turn OPT_* list into a enum 2016-07-10 02:04:27 +03:00
ZyX
c47624482c option: Also do not expand XDG defaults with set& 2016-07-10 02:04:27 +03:00
ZyX
895f712df8 option: Do not expand options, obtained from XDG vars
It is a wrong thing to do, this makes valid variable values be treated 
incorrectly: in

    XDG_DATA_HOME='/home/$foo/.local/share'

`$foo` should be treated literally and not expanded to `foo` environment 
variable value.

Also makes option_expand not try to expand too long strings even if these too 
long strings are default values. Previously it thought that default values 
should always be expanded. Also does not try to expand NULL should it be the 
default value just in case.

Fixes #4961
2016-07-10 02:04:27 +03:00
5573e1a350 Merge #4991 'vim-patch:7.4.1140' 2016-07-09 16:55:41 -04:00
ef72303a1f op_replace: fix guard; avoid strlen (#4963)
Closes #4943
2016-07-09 07:07:59 -04:00
d3981fee21 Remove if_ruby from list of unimplemented features 2016-07-09 04:05:03 -07:00
adaacdd71a Merge #4648 from jamessan/packages
packages (vim-patch:7.4.{1384,1388,1396,1478,1479,1480,1486,1492,1499,1528,1550,1551,1552,1553,1554,1596,1649,1712,1840,1973,1986})
2016-07-09 06:58:27 -04:00
340b186230 Install neovim RubyGem on CI 2016-07-08 16:58:18 -07:00
4b461b472f Add documentation around Ruby provider 2016-07-08 16:58:17 -07:00
ce91baf94b Add Ruby diagnosis to :CheckHealth command 2016-07-08 16:58:17 -07:00
3e2daf7125 vim-patch:7.4.1140
Problem:    Recognizing <sid> does not work when the language is Turkish.
            (Christian Brabandt)
Solution:   Use MB_STNICMP() instead of STNICMP().

e266d6d664

Note: Added new test
2016-07-08 16:50:22 +10:00
059e9785dc lint 2016-07-08 01:45:21 -04:00
86b4f6856b vim-patch:7.4.1986
Problem:    Compiler warns for loss of data.
Solution:   Use size_t instead of int. (Christian Brabandt)

fef524bbff
2016-07-08 01:45:21 -04:00
c147766389 vim-patch:7.4.1973
Problem:    On MS-Windows the package directory may be added at the end
            because of forward/backward slash differences. (Matthew
            Desjardins)
Solution:   Ignore slash differences.

4c5717ed8a
2016-07-08 01:45:21 -04:00
520a4f06e2 vim-patch:7.4.1840
Problem:    When using packages an "after" directory cannot be used.
Solution:   Add the "after" directory of the package to 'runtimepath' if it
            exists.

a570244531
2016-07-08 01:45:21 -04:00
e686b613ec vim-patch:03413f4
Updated runtime files.

03413f4416

Ignore changes to
* doc/Makefile, doc/help.txt: Related to Vim's version8 documentation
* doc/gui_x11.txt, doc/todo.txt, doc/vim.1, gvim.desktop, vim.desktop:
  Irrelevant to Neovim
* doc/quickref.txt, doc/options.txt: As of yet unported 'emoji'
* doc/tags, syntax/vim.vim: Generated at build time
2016-07-08 01:45:21 -04:00
23b2ee0771 vim-patch:7.4.1712
Problem:    For plugins in packages, plugin authors need to take care of all
            dependencies.
Solution:   When loading "start" packages and for :packloadall, first add all
            directories to 'runtimepath' before sourcing plugins.

49b2732644
2016-07-08 01:45:21 -04:00
3f689ed327 vim-patch:7db8f6f
Updated runtime files.

7db8f6f4f8

Ignore changes to
* doc/tags: Generated at build time
* doc/channel.txt, doc/todo.txt: Irrelevant to Neovim
* pack/dist/opt/matchit/doc/matchit.txt: matchit is enabled by default,
  so description of how to enable isn't needed.
2016-07-08 01:45:20 -04:00
31734c6ab0 Generate tags and install docs for included packages 2016-07-08 01:45:20 -04:00
d65563ae9c Reword §05.4 to describe using the new vimball package 2016-07-08 01:45:20 -04:00
b418f3d6f2 Move vimball plugin into an optional package 2016-07-08 01:45:20 -04:00
99e51b81e6 vim-patch:7.4.1649
Problem:    The matchit plugin needs to be copied to be used.
Solution:   Put the matchit plugin in an optional package.

aedfcbe1e6

Ignore changes to
* Filelist, src/Makefile: Irrelevant to NeoVim
* runtime/vimrc_example.vim, runtime/macros/*, runtime/pack/*: matchit
  is enabled by default in Neovim.
2016-07-08 01:45:20 -04:00
5f471b2486 vim-patch:4f3f668
Updated runtime files.

4f3f668c84

Ignore changes to
* doc/channel.txt: Channel related docs
* doc/tags: Generated at build time
* doc/todo.txt: Irrelevant to Neovim
2016-07-08 01:45:20 -04:00
0b2633b1bb vim-patch:e18c0b3
Updated runtime files.

e18c0b3981

Ignore changes to
* doc/channel.txt, runtime/tools/demoserver.py: Channel related changes
* doc/if_lua.txt, doc/if_perl.txt, doc/if_pyth.txt, doc/if_ruby.txt,
  doc/if_tcl.txt, doc/todo.txt: Irrelevant to Neovim
* doc/tags: Generated at build time
2016-07-08 01:45:20 -04:00
4bd14e921b vim-patch:7.4.1596
Problem:    Memory leak. (Coverity)
Solution:   Free the pattern.

ba8cd122ef
2016-07-08 01:45:20 -04:00
443d335ce3 vim-patch:7.4.1554
Problem:    Completion for :colorscheme does not use 'packpath'.
Solution:   Make it work, add a test. (Hirohito Higashi)

52f9c19015
2016-07-08 01:45:20 -04:00
53613e7fcd vim-patch:7.4.1553
Problem:    ":runtime" does not use 'packpath'.
Solution:   Add "what" argument.

8dcf259d90
2016-07-08 01:45:20 -04:00
080476882b vim-patch:7.4.1552
Problem:    ":colorscheme" does not use 'packpath'.
Solution:   Also use in "start" and "opt" directories in 'packpath'.

7f8989dd8a
2016-07-08 01:45:15 -04:00
55dcf0918c vim-patch:7.4.1551
Problem:    Cannot generate help tags in all doc directories.
Solution:   Make ":helptags ALL" work.

6bef5306e4
2016-07-08 01:43:37 -04:00
26f74fdf61 vim-patch:7.4.1550
Problem:    Cannot load packages early.
Solution:   Add the ":packloadall" command.

2d8f56acb3
2016-07-08 01:43:37 -04:00
ea18b4a60f vim-patch:77cdfd1
Updated runtime files.

77cdfd1038

Ignore changes to:
* doc/channel.txt, doc/eval.txt: Channel related docs
* doc/options.txt: GUI related docs
* doc/tags: Generated at build time
* doc/todo.txt: Irrelevant for Neovim
2016-07-08 01:43:36 -04:00
1f54d253e1 vim-patch:7.4.1528
Problem:    Using "ever" for packages is confusing.
Solution:   Use "start", as it's related to startup.

af1a0e371e
2016-07-08 01:43:36 -04:00
4ca9e13637 vim-patch:5f148ec
Update runtime files.

5f148ec0b5

Ignore changes to
* doc/channel.txt, doc/eval.txt: Channel related docs
* doc/tags: Generated at build time
* doc/todo.txt: Irrelevant to Neovim
2016-07-08 01:43:36 -04:00
8ecdc571b0 vim-patch:7.4.1499
Problem:    No error message when :packadd does not find anything.
Solution:   Add an error message. (Hirohito Higashi)

be82c25486
2016-07-08 01:43:36 -04:00
85e539c996 vim-patch:7.4.1492
Problem:    No command line completion for ":packadd".
Solution:   Implement completion. (Hirohito Higashi)

35ca0e7a1c
2016-07-08 01:43:36 -04:00
5f3813daf4 vim-patch:328da0d
Update runtime files.

328da0dcb7

Ignore changes to
* doc/channel.txt, doc/eval.txt: Channel related docs
* doc/tags: Generated at build time
* doc/todo.txt: Irrelevant to Neovim
2016-07-08 01:43:36 -04:00
2f72f34f04 vim-patch:7.4.1486
Problem:    ":loadplugin" is not optimal, some people find it confusing.
Solution:   Only use ":packadd" with an optional "!".

f365482736
2016-07-08 01:43:36 -04:00
67d8e58631 vim-patch:7.4.1480
Problem:    Cannot add a pack direcory without loading a plugin.
Solution:   Add the :packadd command.

91715873d1
2016-07-08 01:43:30 -04:00
d43ac790f2 vim-patch:7.4.1479
Problem:    No testfor ":loadplugin".
Solution:   Add a test.  Fix how option is being set.

863c1a9079
2016-07-08 01:39:12 -04:00
9dc621e77d vim-patch:7.4.1478
Problem:    ":loadplugin" doesn't take care of ftdetect files.
Solution:   Also load ftdetect scripts when appropriate.

1bdd42627d
2016-07-08 01:39:10 -04:00
8f2505e594 vim-patch:dae8d21
Updated runtime files

dae8d21dd2

Ignore changes to
* doc/eval.txt: Channel related docs
* doc/help.txt, doc/index.txt, doc/os_390.txt: Removal of obsolete features, which
  already happened in Neovim
* doc/tags: Generated at build time
* doc/todo.txt, doc/version5.txt: Irrelevant to Neovim
2016-07-08 01:38:21 -04:00
28300a1293 vim-patch:f391327
Updated runtime files.

f391327adb

Ignore changes to
* doc/todo.txt: Irrelevant for Neovim
* doc/channel.txt: Channel docs
* doc/tags, syntax/vim.vim: Generated at build time
2016-07-08 01:38:21 -04:00
562b17260f vim-patch:7.4.1396
Problem:    Compiler warnings for conversions.
Solution:   Add type cast.

1daae446e5
2016-07-08 01:38:21 -04:00
bca53fdca0 vim-patch:7.4.1388
Problem:    Compiler warning. (Cesar Romani)
Solution:   Initialize variable.

bdcd752750
2016-07-08 01:38:21 -04:00
e902a172ef vim-patch:7.4.1384
Problem:    It is not easy to use a set of plugins and their dependencies.
Solution:   Add packages, ":loadopt", 'packpath'.

f6fee0e2d4
2016-07-08 01:38:16 -04:00
6cee9d1a17 vim-patch:7.4.1111 (#5004)
Problem:    test_expand fails on MS-Windows.
Solution:   Always use forward slashes.  Remove references to test27.

f60b796fa9
2016-07-06 09:13:48 -04:00
8641e3a156 test: TUI colors: Skip TERM=linux on non-linux. (#5015)
Also skip TERM=screen (GNU, so probably not common on BSD)
2016-07-06 09:11:26 -04:00
5f1a153831 os/fs: Rename os_file_exists to os_path_exists (#4973)
Because the old name did not indicate that the function
would return true on directories as well.
2016-07-06 01:40:25 -04:00
bd6dad06dd Travis: Enable before_cache script for MacOS. (#5007)
Travis now seems to support caching on MacOS.
2016-07-04 20:51:34 -04:00
a5358688bc doc 2016-07-03 05:22:09 -04:00
f3056988ed ci: Reduce verbosity of low-risk tasks. 2016-07-03 04:39:36 -04:00
6e2c02bc6d doc
Closes #4777
2016-07-03 03:53:42 -04:00
b23b561329 Update jemalloc to 4.2.1 (#4993) 2016-07-03 02:26:47 -04:00
086aa99292 test/functional: sleep() 2016-07-03 02:22:55 -04:00
c402f6e7a9 Merge #5001 from justinmk/t_colors
TUI: infer 256 colors more liberally; listen to unibilium in other cases
2016-07-03 01:55:09 -04:00
173d366a5b test: TUI colors ('t_Co') 2016-07-03 01:29:00 -04:00
c002310787 tui: Assume 256 colors in most cases.
Assume 256 colors if:
  - $TERM contains "xterm" or "256"
  - $COLORTERM contains "256"

Closes #2912
2016-07-03 01:21:33 -04:00
0a3c0205c5 Add :ruby, :rubyfile, and :rubydo ex commands 2016-07-02 21:45:48 -07:00
fab62141c8 options: Default t_Co to 256.
This commit doesn't change any behavior, only moves the init out of main.c We
_could_ move some initialization from tui.c:terminfo_start to an earlier phase,
in order to avoid mis-reporting 't_Co' during startup. But this will be messy,
and gains very little: TERM=linux works "good enough" as long as we correct t_Co
in tui.c:terminfo_start (c5b02d5a7).
2016-07-02 20:36:31 -04:00
c5b02d5a7a options: Set 't_Co' from unibilium + fix_terminfo.
Closes #3428
References #4999

The Linux "virtual consoles" available on Alt-F1...Alt-F7 (i.e.
tty1-tty7) support only 8 colors (actually, it's 16 colors when counted
together with "bold/bright" attribute) and 8 background colors (those in
some cases can be upped to 16 too, by using "blink" attribute - but this
might be more risky, in case some legacy consoles really show it as
blinking? I'm not sure about that.) This limit is buried deep in kernel
sources for default tty drivers. Trying to use the Neovim's default 256
colors in this case gives totally bad colors, breaking all color schemes
and sometimes rendering parts of the text invisible. A simple change
enables code paths for handling 8/16 colors, which are still present in
Neovim codebase.
2016-07-02 20:32:58 -04:00
f80eb768c7 vim-patch:7.4.1121 (#4989)
Problem:    test_expand leaves files behind.
Solution:   Edit another file before deleting, otherwise the swap file
            remains.

08b270a8a4
2016-07-02 20:22:59 -04:00
c6eff87a25 Merge PR #4994 'vim-patch:7.4.1716'
Fixes https://github.com/neovim/neovim/issues/4992
2016-07-02 02:04:46 +02:00
0d9593ff14 Tests: check 'autochdir' on startup 2016-07-02 01:03:05 +02:00
59487e18a7 vim-patch:7.4.1716
Problem:    'autochdir' doesn't work for the first file. (Rob Hoelz)
Solution:   Call DO_AUTOCHDIR after startup. (Christian Brabandt)

baec5c1768
2016-07-01 18:51:28 +02:00
6f4f654231 Merge pull request #4880 from bfredl/zerotimer
make timers work correctly when timeout or repeat is zero
2016-07-01 17:34:28 +02:00
c8da12b9a6 Add test for :drop
Cf. https://github.com/neovim/neovim/pull/4995
2016-07-01 15:25:49 +02:00
ce31c21c7d Fix regression of :drop introduced in 1a91000
A single line was deleted from `ex_drop()` in 1a91000 when fixing clint
warnings causing the `:drop` command to not work correctly if the buffer
is not already open in a window.

Fixes #4981
2016-07-01 11:42:18 +02:00
0d5edcef4a rplugin: Manifest file name fallback (#4935) 2016-06-30 20:50:07 -04:00
8e804c911e vim-patch:7.4.1136
Problem:    Wrong argument to assert_exception() causes a crash. (reported by
            Coverity)
Solution:   Check for NULL pointer.  Add a test.

da5dcd9366
2016-06-30 22:35:06 +10:00
5c754a2d22 timers: make repeat=0 work one-shot (consistent with vim) 2016-06-29 18:57:18 +02:00
2c39e0b03f timers: make timers work with zero timeout 2016-06-29 18:57:18 +02:00
204f557a11 Merge #4984 'Trigger TabNewEntered with <CTRL-W>T'
Closes #4979
2016-06-28 05:00:54 -04:00
43536568ba [RFC] Fix #4979: Trigger TabNewEntered also with <CTRL-W>T
Original patch by @fmoralesc
2016-06-28 23:50:05 +02:00
f266ff2650 doc: remove obsolete reference (#4978) 2016-06-27 22:00:27 -04:00
9fb8adf3ad Update version.c (#4974)
Only update some entries that are already in `version.c`. Mercilessly stolen from https://github.com/neovim/neovim/pull/4634. At least one possible contributor got confused by it not being as-up-do-date-as-it-coul-be(tm). We shouldn't have that.

1005, 1010: :smile
1039: small Build
1058, 1073, 1079, 1097: alloc
1555, 1556, 1573: Makefile
1560, 1579: channel
2016-06-27 09:09:46 -04:00
e9061117a5 Merge #4646 from oni-link/fix.issue.4569.3
Fix for missing output (#4569, ...)
2016-06-26 14:36:24 -04:00
ae9cb1fe07 Merge #4969 from ZyX-I/update-unicode
Update unicode files
2016-06-26 14:05:16 -04:00
ZyX
a9546b5e78 version: State that 1960 was included 2016-06-26 19:18:37 +03:00
ZyX
6e79a4d7f6 Update unicode files 2016-06-26 19:16:11 +03:00
57b56e37e5 ci: Remove MSAN build until it is fixed. (#4966)
Closes #4956
2016-06-25 18:49:28 -04:00
c69ccca56d Merge #4965 from justinmk/fixup4453
ex_cmds2.c: lint
2016-06-25 18:24:09 -04:00
2b7d13fb19 ex_cmds2.c: cleanup 2016-06-25 18:07:20 -04:00
26d8ab51da Merge #4607 from ZyX-I/luaviml'/lua'/encode_vim_to_object
Remove recursion from various serializers/converters
2016-06-25 15:44:39 -04:00
be0f96ab73 Merge pull request #4962 from neovim/ZyX-I-patch-1
doc: Add missing /site/ path component to &runtimepath description

Fixes #4957
2016-06-25 22:33:44 +03:00
65ced8e994 doc: Add missing /site/ path component to &runtimepath description 2016-06-25 22:32:49 +03:00
ZyX
142d00e8da unittests/*/helpers: Fix testlint errors 2016-06-24 17:38:33 +03:00
ZyX
7900e38a8f option: Make all pointers in set_string_option constant 2016-06-24 17:23:29 +03:00
ZyX
458a4d0444 *: Fix linter errors
Also adds one exception to linter rules:

    typedef struct {
      kvec_t(Object) stack;
    } EncodedData;

is completely valid (from the style guide point of view) code.
2016-06-24 17:16:11 +03:00
ZyX
50f5bb8ade kvec: Do not bother with making capacity a power of 2
This avoids gcc warnings about undefined behaviour.
2016-06-24 17:07:10 +03:00
ZyX
0d56118d86 msgpack_rpc: Fix crash in log_server_msg
It appears that used msgpack library is not able to parse back message created 
by msgpack_rpc_from_object() if nesting level is too high, so log_server_msg now 
cares about msgpack_unpack_next() return value. Also error message from 
server_notifications_spec.lua is not readable if something is wrong (though at 
least now it does not crash when parsing deeply nested structures).

log_server_msg() in the test reports

    [msgpack-rpc] nvim -> client(1) [error]        "parse error"
2016-06-24 16:53:26 +03:00
ZyX
2968dc7bdd fixup! unittests: Add tests for vim_to_object function 2016-06-24 16:53:26 +03:00
ZyX
554005ea9a option: Handle NULL string in set_option_value 2016-06-24 16:53:26 +03:00
ZyX
f2f9ab6f35 eval: Also make clear_tv non-recursive 2016-06-24 16:53:26 +03:00
ZyX
e07da3a71b kvec,typval_encode: Add new vector: the one with preallocated array 2016-06-24 16:53:26 +03:00
ZyX
90b8cf133e msgpack_rpc: Also make msgpack_from_*/msgpack_to_* functions not recur
This removes some stack overflows in new test regarding deeply nested variables.
Now in place of crashing vim_to_object/msgpack_rpc_from_object/etc it crashes
clear_tv with stack overflow.
2016-06-24 16:53:26 +03:00
ZyX
6b06bdafa2 unittests: Add tests for vim_to_object function 2016-06-24 16:53:26 +03:00
ZyX
da15b5c1f3 api/helpers: Use typval_encode.h for vim_to_object
This ought to prevent stack overflow, but I do not see this actually working:
*lua* code crashes with stack overflow when trying to deserialize msgpack from
Neovim, Neovim is fine even if nesting level is increased 100x (though test
becomes very slow); not sure how recursive function may survive this. So it
looks like there are currently only two positive effects:

1. NULL lists are returned as empty (#4596).
2. Functional tests are slightly more fast. Very slightly. Checked for Release
   build for test/functional/eval tests because benchmarking of debug mode is
   not very useful.
2016-06-24 16:53:26 +03:00
47a15d0256 Merge #4865 from ZyX-I/file-buffered-read
Use buffered reading/writing for ShaDa files
2016-06-24 09:18:26 -04:00
1a91000251 ex_cmds2.c:style: Silence all clint warnings 2016-06-24 17:50:50 +05:30
ZyX
4741c8b234 unittests: Fix testlint errors 2016-06-24 09:29:51 +03:00
ZyX
96a57e1bc6 os/fileio: Use readv often 2016-06-24 01:07:09 +03:00
ZyX
6580dfeddd unittests: Fix kFileNoSymlink test on FreeBSD
Actual value on FreeBSD is -31, UV_EMLINK was obtained from
/usr/include/asm-generic/errno-base.h (there EMLINK is defined as 31 there).
This may actually be something else, but I do not think so as “Too many links”
description also fits in. [Man page][1] agrees with me, search for `[EMLINK]`
([linux man page][2] also specifies ELOOP explicitly in a similar section).

[1]: https://www.freebsd.org/cgi/man.cgi?query=open&sektion=2
[2]: http://man7.org/linux/man-pages/man3/open.3p.html
2016-06-24 00:07:57 +03:00
ZyX
75bd39d49c *: Satisfy linter (newest type casts rule) 2016-06-24 00:07:56 +03:00
ZyX
a3b05a03b6 unittests: Fix bug somewhere that makes file_read tests SEGV 2016-06-24 00:07:56 +03:00
ZyX
2dd154457c file: Move src/nvim/file.* to src/nvim/os/fileio.* 2016-06-24 00:07:55 +03:00
ZyX
fec7983ecd unittests: Add tests for file.c
Also fixes some errors found.
2016-06-24 00:07:54 +03:00
ZyX
3e7c8e7149 unittests: Add os_write test
New os/fs.c functions are now all tested.
2016-06-23 21:17:51 +03:00
ZyX
4b9d2caec2 shada: Do not forget to close ShaDa reader
Previously there was file descriptor leak, not detected by sanitizers. Now it is 
file descriptor leak with a small memory leak which is detected by ASAN what 
fails one of the tests (actually, “ShaDa support code leaves .tmp.z in-place 
when there is error in original ShaDa and it has .tmp.a … .tmp.x”, but error is 
reported at the next test because leaks are not detected until Neovim exit and 
Neovim exit happens when clear()/reset() is called which happens in before_each 
only).
2016-06-23 21:17:51 +03:00
ZyX
a8f3849bc0 file: Use own constants, do not rely on fcntl.h
One of the reasons is that O_RDONLY is zero, which makes checking whether file
is opened read- or write-only harder. It is not guaranteed that on other system
O_WRONLY will not be zero (e.g. because file can only be opened in read-write
mode).
2016-06-23 21:17:51 +03:00
ZyX
2ac5f1138b unittests: Add os_close, os_read and os_readv tests 2016-06-23 21:17:51 +03:00
ZyX
516b7071ca file: Add buffered reading and writing
Still no busted tests. Not tested without HAVE_PREADV.
2016-06-23 21:17:51 +03:00
ZyX
11dda658d6 file,os/fs,shada: Separate opening, closing, writing and reading files
Moves low-level functions handling to os/fs.c. Adds file.c with a proxy
interface.

Target: while leaving syscalls handling is os.c (partially handled by libuv),
add buffering for reading and writing to file.c.
2016-06-23 21:17:51 +03:00
65af001f2b Merge pull request #4952 from bfredl/counttest
test: fix command_count_spec
2016-06-23 19:02:40 +02:00
e8a8342132 test: fix command_count_spec
The test hit wait_return if x or .x.swp exists in the project root directory.
2016-06-23 16:54:19 +02:00
c475e3f8d1 cmake: remove unused includes (#4947) 2016-06-22 22:46:21 -04:00
dff0dd2611 Merge pull request #4949 from jamessan/vim-7.4.1592
vim-patch:7.4.1592
2016-06-22 22:04:00 -04:00
438c5d27b0 lint 2016-06-22 21:21:05 -04:00
cde1d818d0 vim-patch:7.4.1592
Problem:    Quickfix code using memory after being freed. (Dominique Pelle)
Solution:   Detect that the window was closed. (Hirohito Higashi)

0899d69803
2016-06-22 21:10:07 -04:00
a2ecbc2cc0 Merge #4929 from mhinz/fix-term
Fix #3864
Fix #4820
2016-06-21 12:27:58 -04:00
1a8d9e9d54 Add tests for new feature 2016-06-20 23:10:46 +02:00
a05e7a6bca Make existing tests work with new feature 2016-06-20 23:10:41 +02:00
cc8f477d18 Always resize the embedded vterm properly 2016-06-20 18:20:45 +02:00
7df9dd33a1 Merge #4933 from ZyX-I/fix-matchparen-spec
Make matchparen_spec.lua fail if matchparen is not available
2016-06-20 01:30:59 -04:00
8a4e5b4bc2 Merge #4697 'capture() function'. 2016-06-20 00:55:41 -04:00
d5ddebe9e2 Merge #4938 from justinmk/coverity
coverity/149459: CHECKED_RETURN (false positive)
2016-06-18 15:56:04 -04:00
8c28baa7c7 doc: api_info 2016-06-18 15:01:51 -04:00
cf89160d6e coverity/149459: CHECKED_RETURN (false positive) 2016-06-18 15:01:50 -04:00
1e93e24f5e Merge #4851 2016-06-18 13:09:01 -04:00
abeb2f020f test/highlight_spec: Test "gui" arg of synIDattr().
Also use less "regular" values for cterm colors.
2016-06-18 13:07:59 -04:00
86b138b25d synIDattr(): return RRGGBB value for [fg|bg|sp]# #4851
add tests for synIDattr() with [fg|bg|sp]#

add tests for synIDattr and various #RGB colors

synIDattr: test for ui_rgb_attached()

test: fix tests for synIDattr fg/bg/sp
2016-06-18 12:25:11 -04:00
cbda7d85f8 build: Revert 464bc16.
This was more trouble than it is worth:

- remove_directory fails if doc/ is not owned by the user
- some devs build in-tree, then deleting doc/ breaks the build
- `make install` isn't affected by the stale files at all: the tags are
  built before install-time

So, reverting this change means only that devs who use a build/
directory will need to delete build/runtime/doc/ on the occasion that we
rename a doc file.
2016-06-18 12:22:42 -04:00
a59330d6fc Merge pull request #4925 from bfredl/apiinfo
eval: add api_info()
2016-06-17 21:49:56 +02:00
ZyX
2126ec0c5b functests: Fix matchparen_spec.lua 2016-06-17 20:38:03 +03:00
16424caeda eval: add api_info()
Previously, the api metadata was only accessible frow within nvim as
msgpackparse(systemlist('nvim --api-info'))[0]
2016-06-17 18:47:45 +02:00
51fe40a033 Merge #4923 from justinmk/doc
doc: cleanup
2016-06-16 01:48:05 -04:00
1b1be69cd6 Merge pull request #4841 from jamessan/vim-7.4.1126
vim-patch:7.4.1126
2016-06-16 01:27:17 -04:00
464bc16f81 build: Purge docs before rebuilding.
If a help file is renamed, stale help files in the build workspace will
cause duplicate tags (which causes the build to fail). To avoid this,
always delete build/runtime/doc/ before building helptags.
2016-06-16 00:31:54 -04:00
742787fe9e doc: consolidate nvim.txt 2016-06-15 22:50:38 -04:00
2dbf040048 doc: uppercase RPC 2016-06-15 22:50:37 -04:00
37f560aedf doc/python: cleanup
- Move info to providers.txt
- Remove "nvim-" prefix.
- Brevity, clarity, ...
2016-06-15 22:50:37 -04:00
7718f8f24c doc/provider: cleanup
- Move design/impl discussion to develop.txt
- Move clipboard notes to provider.txt
2016-06-15 19:31:11 -04:00
c698ed0531 doc: cleanup 2016-06-15 19:31:11 -04:00
30a7d551ee doc/terminal: cleanup 2016-06-15 19:31:11 -04:00
4bad05ba97 doc/clipboard: cleanup 2016-06-15 19:31:11 -04:00
aaec820e6e doc: Remove gui_w32.txt
It's no longer relevant, except for 2 sections which are tracked as issues #4927
and #4928.
2016-06-15 19:29:27 -04:00
cc6edfe357 doc: remove "nvim-" qualfier from tags
It is almost never necessary to qualify documentation as "Nvim
specific".

The main exception to this is vim_diff.txt.
2016-06-15 19:29:27 -04:00
23a3e58f02 doc: msgpack_rpc: De-emphasize the transport protocol.
Tighten our jargon, avoid mentioning "msgpack" everywhere we mention the
RPC API. Prefer "RPC API" when speaking about the remote API.

Though it's conceivable that we may one day support some protocol other
than msgpack, that isn't relevant to most of our discussion of the API,
including this document.

The file name msgpack_rpc.txt is preserved to avoid totally breaking
URLs.
2016-06-15 19:29:26 -04:00
bd20892bdf doc: Move spell design discussion.
It is worth preserving, but let it live in spell.txt so we can dedicate
develop.txt to nvim-specific discussion.
2016-06-15 19:29:26 -04:00
0d3ff4b55d vim-patch:7.4.1126
Problem:    Can only get the directory of the current window.
Solution:   Add window and tab arguments to getcwd() and haslocaldir().
            (Thinca, Hirohito Higashi)

c970330676
2016-06-15 18:04:05 -04:00
ef273f97be Merge pull request #4924 from jamessan/test-cleanup
Functional test cleanup
2016-06-15 10:44:26 -04:00
d45a665b00 test: functional: Remove unnecessary use of clipboard register
menu_spec.lua yanks to the clipboard, but never pastes from it.  This
can leave a child xsel process waiting around for something to paste the
content, causing the test process to hang.

Since the test isn't explicitly trying to exercise the clipboard, simply
use the default register.
2016-06-15 09:54:27 -04:00
bec5fd5809 test: functional: Remove test_bkc_* files after testing 2016-06-15 09:54:22 -04:00
aa22b5fd9a Add new functionality to the = marker in the STL
This new functionality is explained in the documentation.

Also, many tests have been added to the buffer_spec.lua file
2016-06-14 20:10:11 +02:00
20447ba098 runtime: Add script for Python diagnostic information (#4885) 2016-06-13 14:56:16 -04:00
28cc5a0646 Merge #3745 from cacplate/ops_Wconversion
Enable -Wconversion in ops.c
2016-06-13 04:33:30 -04:00
0ea01c1586 vim-patch:7.4.1352 (#4914)
Problem:    The test script lists all functions before executing them.
Solution:   Only list the function currently being executed.

93bf558cae
2016-06-13 00:05:42 -04:00
e247e3acdd tui/input.c: Handle Ctrl-Z (suspend) for TERM=linux (#3100) (#4911)
Fix #3100.

On virtual consoles (Alt-F1, etc.), the Ctrl-Z combination was lost.
2016-06-12 00:56:37 -04:00
e7ab3e7e59 test: Use clipboard fixture instead of user's clipboard (#4903) 2016-06-11 12:58:57 -04:00
871fc6c1e1 Merge #4839 from ZyX-I/luaviml'/lua'/encode_vim_to_object'/functests
Check sanitizer results right after the test
2016-06-11 12:36:44 -04:00
f0c1a06792 Merge #4908 from ZyX-I/clint-checks-2
Add more clint checks
2016-06-11 12:14:58 -04:00
2902153648 Remove some unnecessary function attributes (#4909)
This removes attribute FUNC_ATTR_NONNULL_ALL for functions without
a pointer parameter.
2016-06-11 11:56:39 -04:00
ZyX
244967bff9 clint: Add rules that forbids spaces after a cast operator
https://neovim.io/develop/style-guide.xml#Horizontal_Whitespace

Note that this errors out for e.g.

    if (has_mbyte) mb_copy_char((const char_u **)(&f), &t); \

(found in macros.h:151) or

    #define ECMD_SET_HELP   0x02    /* set b_help flag of (new) buffer before

(found in ex_cmds.h:11) (note `(new) buffer`). I left this as-is because these 
pieces of code are already caught by another rule (braces near if and `/*`-style 
comments). Other false positives I found were:

1. `FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_WARN_UNUSED_RESULT`: rejected by 
   requiring type name to start with `[a-zA-Z_]` (this makes `1` not be 
   incorrectly recognized as a type).
2. `#define FOO(var) (var)`: rejected by creating `cast_line`.
3. `(expr) * (expr)`: rejected by constructing regexp so that unary operators 
   require no spaces after them.
4. `int f(void) FUNC_ATTR_PURE`: rejected by requiring line to start with 
   a space.
5. `"." STR(NVIM_VERSION_PATCH) NVIM_VERSION_PRERELEASE`: not rejected, such 
   thing should be rare and it would be easy to get rid of the false positive by 
   e.g. breaking line.

Struct literals like `(MyStruct) { 4, 2 }` are not checked:

1. I am not sure whether they are under this rule at all (this is not a cast).
2. It would be hard to get rid of false positives (like the example with `if` 
   above, but now for *valid* `if() {}`s).
2016-06-11 00:08:59 +03:00
ZyX
92d5809052 func_attr: Fix other new linter errors 2016-06-11 00:08:59 +03:00
ZyX
ce234b0da5 *: Fix new linter errors 2016-06-11 00:08:58 +03:00
ZyX
3676ad4530 clint: Reject indented preprocessor directives
This is also not allowed by the style guide:
https://neovim.io/develop/style-guide.xml#Preprocessor_Directives.
2016-06-11 00:08:58 +03:00
ZyX
739f066afe *: Also fix the adjacent errors 2016-06-11 00:08:58 +03:00
ZyX
d359bb3f60 *: Fix errors from new linter checks 2016-06-11 00:08:57 +03:00
ZyX
3d64bd2b3a clint: Do not allow aligning line continuation characters
Rejected by https://neovim.io/develop/style-guide.xml#Horizontal_Whitespace.

Note: what to do with “empty” lines is not described in the style guide, neither
it is checked.
2016-06-11 00:08:54 +03:00
ZyX
6881fcd203 functests: Do not use setup/teardown where before_/after_each is needed
When skipping these test blocks they may error out:

    Error → test/functional/shell/viml_system_spec.lua @ 154
    system() with output containing NULs setup
    ./test/functional/helpers.lua:75: attempt to index upvalue 'session' (a nil value)

    stack traceback:
            ./test/functional/helpers.lua:75: in function 'request'
            ./test/functional/helpers.lua:166: in function 'nvim_feed'
            ./test/functional/helpers.lua:195: in function 'feed'
            test/functional/shell/viml_system_spec.lua:14: in function <test/functional/shell/viml_system_spec.lua:13>

    Error → test/functional/shell/viml_system_spec.lua @ 155
    system() with output containing NULs teardown
    ./test/functional/helpers.lua:75: attempt to index upvalue 'session' (a nil value)

    stack traceback:
            ./test/functional/helpers.lua:75: in function 'eval'
            test/functional/shell/viml_system_spec.lua:21: in function <test/functional/shell/viml_system_spec.lua:20>
2016-06-10 21:50:50 +03:00
ZyX
ff470bb853 functests: Check logs in lua code
It is otherwise impossible to determine which test failed sanitizer/valgrind
check. test/functional/helpers.lua module return was changed so that tests which
do not provide after_each function to get new check will automatically fail.
2016-06-10 21:50:49 +03:00
a160590e40 Merge #4813 'runtime: clipboard: start daemons in /'. 2016-06-10 03:05:28 -04:00
5832809344 Merge pull request #4875 from shotat/vim-7.4.1130
vim-patch:7.4.1130
2016-06-09 21:58:57 -04:00
a581364acc Merge pull request #4802 from brcolow/vim-7.4.1090
vim-patch:7.4.{1090,1094}
2016-06-09 21:57:32 -04:00
b3f6b30751 Merge pull request #4788 from brcolow/vim-7.4.1051
vim-patch:7.4.{1051,1068}
2016-06-09 21:56:49 -04:00
56e9e81115 Merge pull request #4738 from brcolow/vim-7.4.1223
vim-patch:7.4.1223
2016-06-09 21:18:29 -04:00
b1c9d7d237 vim-patch:7.4.1223
Problem:    Crash when setting v:errors to a number.
Solution:   Free the typval without assuming its type. (Yasuhiro Matsumoto)

a542c680a8
2016-06-09 21:18:09 -04:00
9e94ffd422 Merge pull request #4758 from jbradaric/vim-7.4.1394
vim-patch:7.4.1394,7.4.1397,7.4.1464,7.4.1468
2016-06-09 15:58:37 -04:00
1e6fa9338e vim-patch:7.4.1068
Problem:    Wrong way to check for unletting internal variables.
Solution:   Use a better way. (Olaf Dabrunz)

71bcfdf301
2016-06-09 12:27:28 -07:00
326ae7c8ce vim-patch:7.4.1051
Problem:    Segfault when unletting "count".
Solution:   Check for readonly and locked first. (Dominique Pelle)
            Add a test.

af8af8bfac
2016-06-09 12:27:28 -07:00
7db5ad4e4d vim-patch:7.4.1094
Problem:    Test for :hardcopy fails on MS-Windows.
Solution:   Check for the +postscript feature.

ccb80989f2
2016-06-09 12:14:20 -07:00
86406ffc80 eval.c: Fix linter errors. 2016-06-09 20:34:43 +02:00
6c550a4f13 vim-patch:7.4.1468
Problem:    Sort test doesn't test with "1" argument.
Solution:   Also test ignore-case sorting. (Yasuhiro Matsumoto)

51d1d53680
2016-06-09 20:34:43 +02:00
b2d15fbebc vim-patch:7.4.1464
Problem:    When the argument of sort() is zero or empty it fails.
Solution:   Make zero work as documented. (suggested by Yasuhiro Matsumoto)

5131c144fe
2016-06-09 20:34:43 +02:00
82da7eed34 vim-patch:7.4.1397
Problem:    Sort test fails on MS-Windows.
Solution:   Correct the compare function.

0bb6108eb4
2016-06-09 20:34:43 +02:00
81b9b37e01 vim-patch:7.4.1394
Problem:    Can't sort inside a sort function.
Solution:   Use a struct to store the sort parameters. (Jacob Niehus)

0b962473dd
2016-06-09 20:34:43 +02:00
e355624748 Fix style according to linter 2016-06-09 15:47:35 +02:00
06bbb79e63 vim-patch:7.4.1153
Problem:    Autocommands triggered by quickfix cannot always get the current
            title value.
Solution:   Call qf_fill_buffer() later. (Christian Brabandt)

6920c72d4d

Helped by @mhinz
2016-06-09 11:12:51 +02:00
38d98bba68 tests: Migrate legacy test 34. (#2849) 2016-06-08 00:25:53 -04:00
15afd30e04 test: Fix path to valgrind suppressions (#4892) 2016-06-08 00:24:23 -04:00
7e74ba4108 Merge pull request #4804 from brcolow/vim-7.4.1150
vim-patch:7.4.{1150,1151}
2016-06-08 00:23:48 -04:00
00fc216e2b Merge #4890 from jamessan/vim-38a5563
vim-patch:38a5563,e0fa374,decb14d
2016-06-07 16:00:31 -04:00
e056e5d558 vim-patch:decb14d
Update channel.txt

decb14d68c

NA since it's related to Channels
2016-06-07 12:58:30 -04:00
48aa28a3eb vim-patch:e0fa374
Updated runtime files.

e0fa3742ea

Ignore changes to
* doc/channel.txt: Channel related docs
* doc/netbeans.txt, doc/os_dos.txt, doc/todo.txt: Not relevant to Neovim
* doc/tags: Generated at build time
2016-06-07 12:19:50 -04:00
e453825aa5 vim-patch:38a5563
Update runtime files.

38a55639d6

Ignore changes to
* doc/channel.txt, doc/eval.txt, doc/various.txt: Channel related docs
* doc/tags: Generated at build time
* doc/todo.txt, doc/vi_diff.txt: Not relevant to neovim
2016-06-07 12:02:56 -04:00
8849c209cc Merge #4888 from jamessan/vim-13d5aee
vim-patch:13d5aee,705ada1,298b440,5e9b2fa,7c764f7,681baaf,cbebd48
2016-06-07 10:32:28 -04:00
18cbe74af7 vim-patch:cbebd48
Updated runtime files.

cbebd4879c

Ignore changes to
* doc/channel.txt, doc/eval.txt: Channel related docs
* doc/tags: Generated at build time
* doc/todo.txt: Not relevant to Neovim
* ftplugin/man.vim: Change already present in autoload/man.vim
2016-06-07 06:46:37 -04:00
e2941ecfbe vim-patch:681baaf
Update runtime files.

681baaf4a4

Ignore changes to
* doc/channel.txt, doc/eval.txt, doc/usr_41.txt: Channel related docs
* doc/tags: Generated at build time
* doc/todo.txt: Not relevant to Neovim
2016-06-07 06:46:37 -04:00
8f32fad257 vim-patch:7c764f7
Make the python script executable.

7c764f7bbf
2016-06-07 06:46:36 -04:00
404dc5420b vim-patch:5e9b2fa
Updated runtime files and translations.

5e9b2fa9bb

Ignore changes to
* doc/tags: generated at build time
* doc/develop.txt, doc/todo.txt, doc/netbeans.txt, doc/vim-ja.UTF-8.1,
  doc/xxd-ja.UTF-8.1, lang/menu_*: Not applicable to Neovim
* doc/editing.txt: Crypt related
* doc/change.txt, doc/insert.txt, doc/various.txt: Removal of ex_extra
  tags, which already happened in Neovim
* doc/vim-ja.UTF-8.1, doc/xxd-ja.UTF-8.1
2016-06-07 06:46:36 -04:00
24a329b53a vim-patch:7.4.1151
Problem:    Missing change to eval.c
Solution:   Also change feedkeys().

5f8a14b9de
2016-06-07 01:14:25 -07:00
96546fb696 runtime: clipboard: start daemons in /
This avoids the issue of nvim started daemons causing mountpoints to be
unmountable. This is currently the only place in runtime/ where this
calling convention occurred.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2016-06-07 17:26:49 +10:00
bc99b4c483 doc: update docs to reflect new cwd option
The termopen() docs don't need to be updated because they link to
jobstart().

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2016-06-07 17:26:49 +10:00
1bb8930c92 test: add tests for cwd handling
Add both a test for cwd=/ and cwd=/tmp/nvim.XXXXX, to make sure that we
don't have regressions in cwd handling.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2016-06-07 17:26:49 +10:00
d966018466 Merge #4878 'build: always regenerate help tags' 2016-06-07 01:57:04 -04:00
374b3a6f4c vim-patch:298b440
Update runtime files.

298b440930

Ignore changes to
* doc/netbeans.txt
* doc/tags: generated at build time
* doc/todo.txt
* doc/usr_41.txt, doc/various.txt: +channel related docs
2016-06-06 23:08:26 -04:00
2cbb8d0540 vim-patch:705ada1
Update a few runtime files.

705ada1aff

Ignored changes to
* doc/eval.txt, all json related documentation
* doc/if_mzsch.txt
* doc/tags, generated at build time
2016-06-06 23:08:26 -04:00
7634764e4c vim-patch:13d5aee
Update runtime files

13d5aeef56

Ignored changes to
* doc/develop.txt, since they were all in the "Coding Style"
  section, which is completely different between Vim and Neovim.
* doc/tags, doc/todo.txt
* syntax/vim.vim, generated at build time
2016-06-06 23:08:26 -04:00
2c44d92572 eval: allow setting cwd in {jobstart,termopen}()
Processes in vim are always started in the current directory, which
causes issues when the process is a daemon and the current directory is
a mountpoint. Fix this by adding an option to set the cwd of the new
process with jobstart(). In addition, fix termopen() so that it actually
uses the cwd option from the dict (it couldn't previously set the cwd
value due to dead code).

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2016-06-07 03:48:03 +10:00
704b58e54a build: define helptags target which always runs.
Specify that the ${GENERATED_HELP_TAGS} "command" (output) depends on
`helptags` so that it always regenerates the doc/ tags. (cmake "targets"
always run, whereas "commands" are contingent on their dependencies. But
we don't define doc/ dependencies because they are circular.)
2016-06-06 11:05:09 -04:00
234346312e test: expand_spec: clean up fixtures 2016-06-06 11:04:09 -04:00
5f5f2d8945 test: rmdir(): recursively delete 2016-06-06 11:04:09 -04:00
af161dcfb8 build: define doc_html task
Defines a dependency on the doc tags.
2016-06-06 11:04:05 -04:00
ee508e6e07 .gitignore: cleanup 2016-06-06 11:02:15 -04:00
93274bfda7 runtime/doc: remove doctags
nvim is a dependency of the main tags task, and it's very unlikely that
one would need to build tags without having nvim available.
2016-06-06 11:02:15 -04:00
999590b313 Testlint. (#4881) 2016-06-05 08:26:47 -04:00
d97a97d7e8 Merge pull request #4879 from justinmk/test55
tests: Migrate legacy test 55
2016-06-05 04:42:46 -04:00
5a387dddc6 Fix indents. 2016-06-05 04:26:33 -04:00
dfaf720442 Testlinting. 2016-06-05 04:26:18 -04:00
c156a18280 Merge pull request #2844 from lucc/test10
tests: migrate legacy test 10
2016-06-05 04:22:52 -04:00
ef6b6e9a09 Merge #4854 2016-06-05 04:17:29 -04:00
cc8a2e7aad log: Rename to $NVIM_LOG_FILE 2016-06-05 04:14:54 -04:00
78c6f5c06d vim-patch:7.4.1056 (#4870)
Problem:    Don't know why finding spell suggestions is slow.
Solution:   Add some code to gather profiling information.

ca1fe98517
2016-06-05 04:00:58 -04:00
6ed9d47a6e pty_process: split into plat-specific files (#3976) 2016-06-04 20:02:56 -04:00
40e7efe91c vim-patch:7.4.1150
Problem:    'langmap' applies to the first character typed in Select mode.
            (David Watson)
Solution:   Check for SELECTMODE. (Christian Brabandt, closes #572)
            Add the 'x' flag to feedkeys().

25281634cd
2016-06-04 13:08:48 -07:00
14648cb741 vim-patch:7.4.1130
Problem:    Memory leak in :vimgrep.
Solution:   Call FreeWild(). (Yegappan Lakshmanan)

61ff4dd6a4

mark 1130 as NA
2016-06-05 01:12:02 +09:00
02e6914a93 Merge pull request #4860 from jamessan/tab-win-precedence
tcd: Determine correct scope from user input
2016-06-04 11:05:05 -04:00
8958863e26 tui/input.c: Add mouse release event (#4873) 2016-06-04 09:13:41 -04:00
667c1dc4de vim-patch:7.4.1108 (#4872)
Problem:    Expanding "~" halfway a file name.
Solution:   Handle the file name as one name. (Marco Hinz)  Add a test.
            Closes vim/vim#564.

58adb14739
2016-06-03 23:18:40 -04:00
2d9c7dd840 Merge pull request #4871 from justinmk/housekeeping
reorg; doc
2016-06-03 17:12:29 -04:00
b3b25c2490 doc: precision, concision, elision
Single point of truth (SPOT): Do not sprinkle "contributing" guidelines
across various resources; CONTRIBUTING.md is the authority.

DRY: Do not repeat guidelines in CONTRIBUTING.md which are covered by
ISSUE_TEMPLATE.md
2016-06-03 17:11:10 -04:00
f421757e57 reorg 2016-06-03 14:15:36 -04:00
abe47d5f64 CMake: Search all possibly usable Lua executables. (#4858) 2016-06-03 12:21:29 -04:00
8bf94f8f0d Merge pull request #4869 from jamessan/vim-7.4.1142
vim-patch:7.4.1142,7.4.1695
2016-06-02 14:53:21 -04:00
1a21a0cc4f Merge pull request #4868 from jamessan/vim-85084ef
vim-patch:85084ef
2016-06-02 14:42:12 -04:00
17cb95b222 Make clint happy again 2016-06-02 11:10:42 -04:00
29e618c93c vim-patch:7.4.1695
Problem:    ":syn reset" clears the effect ":syn iskeyword". (James McCoy)
Solution:   Remove clearing the syntax keywords.

8bc189e81a
2016-06-02 10:30:36 -04:00
1b6681e073 vim-patch:7.4.1142
Problem:    Cannot define keyword characters for a syntax file.
Solution:   Add the ":syn iskeyword" command. (Christian Brabandt)

b8060fe862
2016-06-02 10:28:46 -04:00
d5380d85ae vim-patch:85084ef
Update help files.

85084ef1e9

Ignored changes to:
* doc/editing.txt related to encryption
* doc/eval.txt related to perleval()
* doc/if_mzsch.txt
* doc/tags
* doc/todo.txt
2016-06-02 09:39:31 -04:00
634d59f646 msgpack-gen: Fix for Lua 5.1. (#4857)
goto statement was only introduced in Lua 5.2.
2016-06-01 19:14:09 -04:00
568da8ef3b vimpatch.sh: bug fix in find_git_remote regex (#4863)
vimpatch.sh: fix awk expr
2016-06-01 15:02:20 -04:00
4e9f7684f6 tcd: Determine correct scope from user input
If a user specifies both {window} and {tab}, `getcwd()`/`haslocaldir()`
are using "tab" as the scope that should be reported.  However, it
should be using "window" as the scope, within the specified tab page.
2016-06-01 07:02:31 -04:00
f735ee90c2 tcd: Use user-provided tab page for getcwd()/haslocaldir()
The initial implementation for `:tcd` always used `curtab` to find the
specified window.  This would result in either inaccurate information or
an unexpected error (e.g., when there are more windows in the
user-specified tab page vs. the current tab page).
2016-06-01 06:48:41 -04:00
a3f11ad27a test/functional: cd_spec: Add tests for {getcwd,haslocaldir}(-1, -1) 2016-06-01 06:48:41 -04:00
a1303c2e11 test/functional: cd_spec: Add tests for using explicit args 2016-06-01 06:48:41 -04:00
197f384891 test/functional: cd_spec: Use named keys for directories table
The directories table contains the names of the expected directory names
for varying scopes of the :cd tests.  Using named indexes, instead of
numbered, makes the test more readable.
2016-06-01 06:48:41 -04:00
690970acff test/functional: Allow arbitrary arguments to cwd/lwd functions
Build wcwd/tcwd and wlwd/tlwd on top of the reworked cwd/lwd functions.
This will allow for easier testing of `getcwd()`/`haslocaldir()` in
arbitrary windows and/or tab pages.
2016-06-01 06:48:41 -04:00
0afe63e925 Merge pull request #4829 from bfredl/timerclose
timers: stop all timers on teardown
2016-06-01 12:07:17 +02:00
d6d8073939 timers: stop all timers on teardown 2016-06-01 11:09:15 +02:00
c16cb06656 Merge pull request #4859 from justinmk/travisllvm
travis: remove LLVM apt PPA; fallback to clang 3.4
2016-06-01 02:04:40 -04:00
b121d85376 travis: remove LLVM apt PPA; fallback to clang 3.4
LLVM has shut down their apt PPA until further notice.
2016-05-31 19:03:00 -04:00
4adee66980 Merge pull request #4846 from ZyX-I/luaviml'/lua'/encode_vim_to_object'/typval_encode
eval: Refactor eval/encode
2016-05-31 13:51:31 -04:00
3dd3d129d3 Merge pull request #4844 from ZyX-I/rename-main-loop
Rename main loop variable from loop to main_loop
2016-05-31 13:49:04 -04:00
4276a03e81 Merge pull request #4853 from ZyX-I/fix-4852
unittests: Also remove event_teardown
2016-05-31 12:38:07 -04:00
ZyX
d0bd023881 log: Move log to $NVIM_LOG_FILE_PATH, falling back to the old location
Closes #3561
2016-05-31 16:36:49 +03:00
ZyX
c571e80273 unittests: Also remove event_teardown
`event_teardown` is there from 974752c, by aktau. It was introduced with 
`init_homedir` and `event_init`. Then both were removed by justinmk in 
99a9161bac (`init_homedir`) and 
49c5689f45 (`event_init`), but `event_teardown` 
was not removed. Now this may cause a crash. More details in #4852.

Closes #4852
2016-05-31 15:41:24 +03:00
ZyX
8f8b6658d7 typval_encode: Do not use new vector type
For string() it looks like no optimization, sometimes performance is even worse. 
Since it was designed to avoid heap allocations in clear_tv let’s see whether it 
will make any difference once clear_tv uses typval_encode to avoid stack 
overflow in the disabled test.
2016-05-30 23:35:22 +03:00
ZyX
d9137b1a3a kvec,typval_encode: Add new vector: the one with preallocated array 2016-05-30 23:34:28 +03:00
ZyX
139c1bb48b eval/encode: Move main macros from encode.c to typval_encode.h 2016-05-30 23:31:17 +03:00
bd9715a9b5 Merge pull request #4843 from ZyX-I/refactor-queue
lib/queue: Refactor queue.h
2016-05-30 15:49:04 -04:00
30531bc38d Merge pull request #4845 from ZyX-I/luaviml'/lua'/encode_vim_to_object'/refactor-kvec
lib/kvec.h refactorings
2016-05-30 15:43:58 -04:00
ZyX
cafd4a4d06 lib/queue: Actually remove all _QUEUE macros 2016-05-30 22:08:20 +03:00
ZyX
9ce921a516 lib/queue: Refactor queue.h
Changes:

1. Linter finds no errors now.
2. Most of macros changed to `static inline … FUNC_ATTR_ALWAYS_INLINE` functions
   (that was the purpose: they are easier to debug).
3. Queue is now not a pair of void* pointers, but a struct with two QUEUE
   pointers, next and prev. This should not affect anything, except that _QUEUE
   private macros can really be avoided without reducing readability and they do
   not need any casts.
2016-05-30 22:08:20 +03:00
ZyX
7a44f9e343 lib/kvec: Fix remaining linter errors 2016-05-30 21:26:30 +03:00
ZyX
1ce1b85cc6 lib/kvec: Make code cleaner 2016-05-30 21:20:00 +03:00
ZyX
d007c2977b lib/kvec: Do not use kv_init unless needed 2016-05-30 21:19:52 +03:00
ZyX
8cfb272c74 lib/kvec: Remove useless type argument from kv_push macros 2016-05-30 21:14:39 +03:00
ZyX
77540a0458 *: Rename main loop variable from loop to main_loop
Current name is inappropriate for the following reasons:

1. It is often masked by local `loop` variables.
2. It cannot be searched for. There are many `loop` variables where `loop` is
   some local variable. There are many cases when “loop” word is used in
   a comment.
3. It is in any case bad idea to use a generic name as a name of the global
   variable. Best if global has module prefix: this is why it is in `main.h`:
   `main_loop` both stands for “a main loop” and “a loop defined in `main.*`”.

Since I have no idea how to list every occurrence of this variable method used
to rename it is “remove it from globals.h, try to compile, fix errors”. Thus if
some occurrence was hidden under false `#if` branch it was not replaced.
2016-05-30 20:58:15 +03:00
c4da27095c remove some asserts and lint 2016-05-30 12:16:48 -04:00
c2a1821611 ops.c: enable -Wconversion warning 2016-05-30 12:05:08 -04:00
748898b4dd Merge pull request #4198 from daynin/string-tests
tests: add tests for vim_strsave_escaped() function
2016-05-29 13:10:26 -04:00
c793423374 add test for vim_strsave_escaped() function 2016-05-29 13:26:39 +03:00
ecbc9dbdfe Merge pull request #4740 from brcolow/vim-7.4.1276
vim-patch:7.4.1276
2016-05-29 00:05:49 -04:00
1e70ebe849 Merge pull request #4756 from jbradaric/vim-7.4.1119
vim-patch:7.4.1119,7.4.1123,7.4.1132,7.4.1161
2016-05-29 00:03:54 -04:00
5fed9f5626 Merge pull request #4830 from blueyed/proider-pythonx-handle-127
provider/pythonx: handle exit code 127 from pyenv
2016-05-28 21:05:08 -04:00
ff00e289cf Merge pull request #4832 from justinmk/do_source_fuss
do_source: less fuss about fopen_noinh_readbin
2016-05-28 19:01:15 -04:00
7e65cc22ea Merge pull request #4833 from jamessan/multi-remote-fix
vim-patch.sh: Only print the first neovim/neovim remote name
2016-05-28 17:05:12 -04:00
e50b4fd36d vim-patch.sh: Only print the first neovim/neovim remote name
If a user has multiple remotes set for neovim/neovim, then
find_get_remote was returning 'remote1\nremote2\n', which breaks
anything trying to use it.  Since we're just using this remote to fetch
from, any one will do.
2016-05-28 14:16:10 -04:00
8c127c77a6 fopen_noinh_readbin: restore WIN32 decision 2016-05-28 12:57:22 -04:00
fe0c3999ca do_source: less fuss about fopen_noinh_readbin 2016-05-28 12:48:32 -04:00
1786844498 Merge pull request #4831 from blueyed/provider-pythonx-robust-comparison
provider/pythonx: use robust comparison (via vint)
2016-05-28 11:46:08 -04:00
1ea1626764 provider/pythonx: use robust comparison (via vint) 2016-05-28 17:16:24 +02:00
dab5d1368a provider/pythonx: handle exit code 127 from pyenv
This also checks the major/min version only for expected return codes.

With pyenv, you might get the following (return code 127):

    pyenv: python3.4: command not found

    The `python3.4' command exists in these Python versions:
      3.4.3
      3.4.3/envs/tmp-3.4.3-eElS6Y
      tmp-3.4.3-eElS6Y
2016-05-28 17:10:16 +02:00
1e593436d0 process.c: Close events are processed too late
Compiling with macro -DEXITFREE opens a code path on which the event
loop is used after it was teared down, because not all close events
were processed yet.
2016-05-28 11:25:13 +02:00
677eae6b0f process.c: Fix a block when in teardown mode
nvim blocking can be tested with "nvim +te +'!xclip' +qa"

By closing all handles for a pty process, we unblock the event loop if
the process has not terminated yet.
2016-05-28 11:25:13 +02:00
48e945e588 Merge pull request #2825 from lucc/legacy/listlbr
tests: Migrate legacy test listlbr.
2016-05-27 21:06:09 -04:00
c29cc50b3a Merge pull request #4825 from ZyX-I/fix-4822
eval: Stop executing *eval() function at error
2016-05-27 20:58:57 -04:00
f5642a171f Merge pull request #4817 from bfredl/remoteui
api: refactor remote ui to use API dispatch generation
2016-05-27 20:58:14 -04:00
f5cf6f8de4 Merge pull request #4826 from jamessan/vim-345efa0
vim-patch:345efa0
2016-05-27 20:52:10 -04:00
d89bf31f6b Merge pull request #4827 from equalsraf/tb-dummy-tui
Windows: Don't build the TUI is systems where it is not supported
2016-05-27 20:50:13 -04:00
46aac2a09a Windows: Don't build the TUI is systems where it is not supported
The TUI can be enabled/disabled at build time with -DFEAT_TUI, default is ON for
UNIX, and OFF for non UNIX. When off, Neovim prints a message to stderr, along
with a list of the server endpoints.
2016-05-27 23:43:40 +01:00
c11f22d6c5 vim-patch:345efa0
Update runtime files

345efa013d

Ignored changes to:
* doc/tags
* doc/todo.txt
* doc/various.txt, since the MEM_PROFILING #ifdef doesn't exist in
  Neovim
2016-05-27 12:56:48 -04:00
ZyX
5758432be2 eval: Stop executing *eval() function at error
Fixes #4822
Closes #4823
2016-05-27 15:11:53 +03:00
dd539366fc api: refactor remote ui to use API dispatch generation 2016-05-27 13:18:04 +02:00
1d63672c77 Merge pull request #4821 from jamessan/vim-7.4.1096
vim-patch:7.4.1096,7.4.1567
2016-05-27 04:22:52 -04:00
41c0dfd545 Port capture() function
https://groups.google.com/forum/#!msg/vim_dev/H3Z3ChSUh_4/beZs6KzYdBsJ
2016-05-27 10:33:44 +09:00
bfbc974d13 Merge pull request #4819 from jamessan/vim-acb4f22
vim-patch:acb4f22
2016-05-25 21:46:03 -04:00
d693a22de3 vim-patch:acb4f22
Updated runtime files.

acb4f221c7

Ignored changes to:
* doc/eval.txt since alloc_fail isn't relevant for neovim
* doc/index.txt for unmerge :smile command
* doc/tags, syntax/vim.vim since they're generated at build time
* doc/todo.txt
2016-05-25 21:05:01 -04:00
ccef5c9c77 vim-patch:7.4.1567
Problem:    Crash in assert_fails().
Solution:   Check for NULL. (Dominique Pelle)  Add a test.

1abb502635
2016-05-25 21:02:52 -04:00
bc306ab5aa vim-patch:7.4.1096
Problem:    Need several lines to verify a command produces an error.
Solution:   Add assert_fails(). (suggested by Nikolay Pavlov)
            Make the quickfix alloc test actually work.

a260b87d9d
2016-05-25 17:13:05 -04:00
2115fcdfd5 Merge pull request #4815 from bfredl/timerfix
timers: racy case found on travis
2016-05-25 13:56:55 +02:00
2519638796 timers: racy situation found on travis 2016-05-25 12:51:17 +02:00
c74ce334f2 Merge pull request #4624 from bfredl/timers
implement timers and process events during sleep
2016-05-25 11:00:54 +02:00
1e22076a65 Merge pull request #4741 from brcolow/vim-7.4.1281
vim-patch:7.4.1281
2016-05-25 04:30:50 -04:00
b37b5a59af vim-patch:7.4.1281
Problem:    No test for skipping over code that isn't evaluated.
Solution:   Add a test with code that would fail when not skipped.

ea8c219ca8

Also add Test 91 from 7.4.1157 to test_viml.vim.
2016-05-25 00:52:38 -07:00
52348a1f8c Merge pull request #4807 from jamessan/vim-7.4.1053
vim-patch:7.4.{1053,1071}
2016-05-25 02:54:08 -04:00
d46772588b Merge pull request #4812 from jamessan/vim-a61018d
vim-patch:a61018d,4d1c0a4,7.4.1064
2016-05-24 22:39:13 -04:00
3d12192521 vim-patch:7.4.1064
Problem:    When a spell file has single letter compounding creating
            suggestions takes an awful long time.
Solution:   Add th eNOCOMPOUNDSUGS flag.

7b877b3605
2016-05-24 22:07:37 -04:00
ca7e43100a vim-patch:4d1c0a4
NA runtime update (original commit message below) since Neovim doesn't
have runtime/spell/.

Update to newer English spell files,

but without the COMPOUND rules that make suggestions very slow.

4d1c0a4441
2016-05-24 21:13:23 -04:00
a3f398992f vim-patch:a61018d
NA runtime update (original commit message below) since Neovim doesn't
have runtime/spell/.

Revert English spell file update

a61018d7e0
2016-05-24 20:54:16 -04:00
4a40231317 vim-patch:7.4.1071
Problem:    New style tests are executed in arbitrary order.
Solution:   Sort the test function names. (Hirohito Higashi)
            Fix the quickfix test that depended on the order.

cfc0a350a9
2016-05-24 20:49:19 -04:00
da9b6b1de0 vim-patch:7.4.1053
Problem:    Insufficient testing for quickfix commands.
Solution:   Add a new style quickfix test. (Yegappan Lakshmanan)

da59dd5da6
2016-05-24 20:49:19 -04:00
5cc87d4dab cmdline: Redraw the cmdline after processing events
vim-patch:7.4.1603

TODO(bfredl): if we allow events in HITRETURN and ASKMORE states,
we need to add the necessary redraws as well.
2016-05-24 22:11:37 +02:00
61e8adb25e eval: implement timers. vim-patch: 7.4.1578, 7.4.1831
For the moment, timers are triggered during sleep,
but not in wait-for-input modes, like press-RETURN or f_getchar()
2016-05-24 22:08:56 +02:00
71e3aec029 Update migrated test after patch recent patches in master.
The following upstream patches that modified the original test have reached
master: 7.4.798, 7.4.818, 7.4.883, 7.4.977.  The changes are incorporated into
the migrated test.

Also improve readability and some string delimiters.
2016-05-23 10:39:24 +02:00
1e1325bd18 tests: Migrate legacy test listlbr. 2016-05-23 10:39:24 +02:00
b4848c5d14 test: Clean up after migration of legacy test 55. 2016-05-23 10:17:36 +02:00
1afb1cc6bc test: Fix migrated test 55.
There is still one TODO item in the test file as it was necessary to comment
out one line in order to get the test to pass.
2016-05-23 10:17:32 +02:00
726a6abfb7 test: Split migrated legacy test 55.
The test is split into several it() blocks to find the part of the test that
is making trouble.
2016-05-23 10:17:32 +02:00
3734052a76 tests: Migrate legacy test 55. 2016-05-23 10:17:32 +02:00
9b6988e62a tests: Update migrated legacy test 30 for patch 7.4.643.
The patch was merged into master at f104ce2d.
2016-05-23 10:15:24 +02:00
87e0621857 tests: Migrate legacy test 30.
The original test did also create additional auxiliary files which where never
used.  They are not created any longer.
2016-05-23 10:15:24 +02:00
9d1b072db0 Remove old version of legacy test 10.
These files where last changed in revision 7 (vim version 7.0001) in Vim's
original mercurial repository but are not executed by the makefile.
2016-05-23 10:14:32 +02:00
7d6b9ddc15 tests: Migrate legacy test 10. 2016-05-23 10:14:20 +02:00
176f223ea3 Merge pull request #4808 from justinmk/small.vim
test: Remove references to tiny.vim/small.vim/mbyte.vim
2016-05-22 17:51:52 -04:00
e70cae426c test: Remove references to tiny.vim/small.vim/mbyte.vim
Vim creates these scripts in test1 depending on what build features
are enabled so that tests that use these features are skiped if
necessary. Because Neovim only has one type of build (and the features
+eval, +windows, and +multi-byte are enabled in this build) they are
not necessary.
2016-05-22 15:55:38 -04:00
39c015bd11 Merge pull request #2824 from lucc/legacy/close_count
tests: migrate legacy close_count
2016-05-22 15:33:40 -04:00
a441356858 Merge pull request #4806 from justinmk/nodetype
os_nodetype: Return NODE_NORMAL if os_stat fails.
2016-05-22 15:31:03 -04:00
96f834a842 os_nodetype: Return NODE_NORMAL if os_stat fails.
Conforms to Vim's mch_nodetype. Regression by 7db4a15.
buf_write() expects NODE_WRITABLE for character devices such as
/dev/stderr.

Closes #4772
2016-05-22 15:12:02 -04:00
849d61b551 Merge pull request #4786 from jbradaric/vim-7.4.1516
vim-patch:7.4.1516,7.4.1521
2016-05-22 12:55:30 -04:00
d8d159c123 Merge pull request #4787 from brcolow/vim-7.4.1050
vim-patch:7.4.1050
2016-05-22 12:24:30 -04:00
c3ebfff18b Merge pull request #4793 from brcolow/vim-7.4.1061
vim-patch:7.4.1061
2016-05-22 12:21:41 -04:00
46a080015f host.vim: s:RegistrationCommands(): Normalize slashes.
Closes #4795
2016-05-22 11:34:24 -04:00
7b57ab1480 vim-patch:7.4.1090
Problem:    No tests for :hardcopy and related options.
Solution:   Add test_hardcopy.

b5690794cf
2016-05-20 23:32:01 -07:00
34957f7ab9 Merge #4800 'syntax: foo=NONE should clear hi group' 2016-05-21 01:25:15 -04:00
582fb03f51 test/syntax: foo=NONE clears hi group 2016-05-21 01:19:39 -04:00
1f4af4c86e syntax: foo=NONE clears hi group
Closes #4767
2016-05-21 01:19:15 -04:00
8e20ba9fbd Merge pull request #4737 from jamessan/vim-7.4.1017
https://github.com/neovim/neovim/pull/4789C] vim-patch:7.4.1017,7.4.1018,7.4.1034
2016-05-21 00:05:37 -04:00
853440053c vim-patch:7.4.1034
Problem:    There is no test for the 'backspace' option behavior.
Solution:   Add a test. (Hirohito Higashi)

aac624bacd
2016-05-20 21:43:15 -04:00
d5168064bf vim-patch:7.4.1018
Problem:    Failure running tests.
Solution:   Add missing change to list of old style tests.

af2dff8fbc
2016-05-20 21:43:15 -04:00
8a379aacd7 vim-patch:7.4.1017
Problem:    When there is a backslash in an option ":set -=" doesn't work.
Solution:   Handle a backslash better. (Jacob Niehus)  Add a new test, merge
            in old test.

8f79acdf7e
2016-05-20 21:43:15 -04:00
9d3449852b Merge pull request #4779 from equalsraf/tb-lua-without-unittest
Allow building without Luajit
2016-05-20 15:30:09 -04:00
6e68cc570c Fixes suggested by @justinmk and @jbradaric 2016-05-20 12:16:09 -07:00
08cf8f4d15 tests: Modernize legacy/close_count. 2016-05-20 11:25:24 +02:00
95442026e8 tests: Migrate legacy test close_count. 2016-05-20 11:25:24 +02:00
66adc2daee Merge #4744 'highlight listchar in cursorline' 2016-05-20 04:07:50 -04:00
723497f030 test: listchars 2016-05-20 04:04:49 -04:00
4eb4a5cdb2 screen.c: Fix listchars hl for space/nbsp in visual mode. 2016-05-20 04:04:49 -04:00
f598bb7b3c test: cursorline, listchars 2016-05-20 04:04:48 -04:00
391d8ff3d8 lint 2016-05-20 04:04:48 -04:00
9dc08dd692 test: Update to meet new expectations. 2016-05-20 03:54:21 -04:00
33486c8ebd Let the highlight of listchars override cursorline
Closes #3670
2016-05-20 03:54:20 -04:00
114fd52230 file_perm_spec: Fix the test condition on Windows. 2016-05-20 09:19:16 +02:00
56cb1eb9f9 Merge pull request #4791 from brcolow/vim-7.4.1059
vim-patch:7.4.1059
2016-05-20 00:55:59 -04:00
620806ec07 vim-patch:7.4.1061
Problem:    Compiler warning for ignoring return value of fwrite().
Solution:   Do use the return value. (idea: Charles Campbell)

285bf84b4b
2016-05-19 21:47:52 -07:00
3e1ab7c8d6 vim-patch:7.4.1059
Problem:    Code will never be executed.
Solution:   Remove the code.

fd39d08fb6
2016-05-19 21:34:57 -07:00
dc88173b1b Merge #2821 'test: migrate legacy test breakindent' 2016-05-20 00:30:01 -04:00
1ead15ad81 Merge pull request #4790 from brcolow/vim-7.4.1057
vim-patch:7.4.1057
2016-05-20 00:24:35 -04:00
817438f16c vim-patch:7.4.1057
Problem:    Typos in the :options window.
Solution:   Fix the typos. (Dominique Pelle)

2b7db933b0
2016-05-19 21:23:08 -07:00
0838d59a7c Merge pull request #4782 from jamessan/alt-hub-cli
vim-patch.sh: Support sociomatic/git-hub for submit_pr
2016-05-19 22:26:24 -04:00
74f6460181 Merge #4633: support "special" highlight (undercurl)
Closes #2040
Closes #3370
2016-05-19 22:20:52 -04:00
2ebf365db9 vim-patch:7.4.1050
Problem:    Warning for unused var with tiny features. (Tony Mechelynck)
Solution:   Add #ifdef.  Use vim_snprintf().  Reduce number of statements.

c71982b239
2016-05-19 14:46:38 -07:00
07382048b0 vim-patch:7.4.1521
Problem:    File permission test fails on MS-Windows.
Solution:   Expect a different permission.

8322e1f06e
2016-05-19 22:46:50 +02:00
093f8d5376 vim-patch:7.4.1516
Problem:    Cannot change file permissions.
Solution:   Add setfperm().

8049253b96
2016-05-19 22:46:50 +02:00
1fabc63907 Merge pull request #4761 from bfredl/gcc61warnings
Fix warnings with gcc 6.1
2016-05-19 21:55:11 +02:00
1a194fad22 Fix warnings with gcc 6.1
The intentional behavior of do_sub was checked in vim
2016-05-19 20:53:04 +02:00
d5c89b1896 cmake: Allow building without Luajit
By default Neovim searched a Luajit instalation and linked against
the luajit library.

In practice Neovim only requires luajit to run the unit tests. All other
targets only require lua and the correct lua modules. This commit:

1. Remove the strict dependency on Luajit
2. Makes the unittest target depend on the lua 'ffi' module.
   If the module is not available the target is not enabled
   and a message is displayed.
2016-05-19 17:55:19 +01:00
509089d053 Merge pull request #4657 from brcolow/vim-7.4.1036
vim-patch: 7.4.1036
2016-05-19 09:06:04 -04:00
8759a77dc2 vim-patch.sh: Show if a patch includes runtime files 2016-05-19 06:40:51 -04:00
957c91d5d0 vim-patch.sh: Add support for sociomatic/git-hub 2016-05-19 06:40:47 -04:00
af3d4b4049 vim-patch.sh: Rename check_executable to require_executable
check_executable now just wraps the "exists && executable" check.  This
will be needed to allow fallbacks for commands.
2016-05-19 06:40:37 -04:00
9c7038c475 Merge pull request #4780 from jamessan/vim-7.4.1046
vim-patch:7.4.1046
2016-05-18 22:30:09 -04:00
b907c85fb4 vim-patch:7.4.1046
Problem:    No test coverage for menus.
Solution:   Load the standard menus and check there is no error.

2d6c800272
2016-05-18 22:15:56 -04:00
c17f6c5396 Merge pull request #4753 from dmerejkowsky/cmake-ninja-test-output
test: Fix running tests from Ninja
2016-05-18 00:13:28 -04:00
a69c3fbc8a Merge pull request #4734 from jbradaric/vim-7.4.1102
vim-patch:7.4.1102, 7.4.1110, 7.4.1832
2016-05-18 00:08:47 -04:00
2582754bdd Fix running tests from Ninja 2016-05-17 23:23:32 +02:00
e5eea7fa06 test: Screen also checks 'special' when testing attribute equality 2016-05-17 16:36:41 -04:00
954aeafa89 Linting 2016-05-17 16:36:41 -04:00
724fc88597 test: Edit the special color test 2016-05-17 16:36:38 -04:00
a5ac389e5c test: Add a test for the new guisp highlighting feature.
Screen.lua needed a little cosmetical adjustment to print out the color nicely.
2016-05-17 16:32:07 -04:00
f6a82c1d4f test: Fix tests failing 2016-05-17 16:31:56 -04:00
244cfe86b5 syntax: Add support for the "special" color used for undercurls 2016-05-17 16:31:42 -04:00
91796f70ed vim-patch:7.4.1832
Problem:    Memory leak in debug commands.
Solution:   Free memory before overwriting the pointer. (hint by Justin Keyes)

dc303bce10
2016-05-17 21:00:31 +02:00
12cfe7775f ex_cmds2: Fix memory leak. 2016-05-17 20:54:42 +02:00
dd0e8a03fc 108_backtrace_debug_comands: Fix linter errors. 2016-05-17 20:54:42 +02:00
2a0f726b18 Remove unnecessary forward function declarations. 2016-05-17 20:54:42 +02:00
5fdb6043d7 vim-patch:7.4.1110
Problem:    Test 108 fails when language is French.
Solution:   Force English messages. (Dominique Pelle)

8c600052fa
2016-05-17 20:54:42 +02:00
b4cbfd3c08 vim-patch:7.4.1102
Problem:    Debugger has no stack backtrace support.
Solution:   Add "backtrace", "frame", "up" and "down" commands. (Alberto
            Fanjul, closes vim/vim#433)

f1f60f859c
2016-05-17 20:54:42 +02:00
087623aa3c vim-patch: 7.4.1036
Problem:    Only terminals with up to 256 colors work properly.
Solution:   Use the 256 color behavior for all terminals with 256 or more
            colors. (Robert de Bath)

fa03fd6c4a
2016-05-17 11:30:08 -07:00
cf29b4025d vim-patch:7.4.1276
Problem:    Warning for not using return value of fcntl().
Solution:   Explicitly ignore the return value.

fbc4b4db3a
2016-05-17 11:24:25 -07:00
c9b1ad3a57 Merge pull request #4768 from justinmk/char_u
msg_puts_printf: remove char_u
2016-05-17 02:36:22 -04:00
7d11cc6912 Merge pull request #4759 from jbradaric/vim-7.4.1513
vim-patch:7.4.1513
2016-05-17 02:35:12 -04:00
50cf32775d Merge pull request #4769 from jamessan/vim-7.4.1568
vim-patch:7.4.1568,7.4.1571,7.4.1728
2016-05-17 02:16:56 -04:00
3f3a3cb65f Merge pull request #4770 from jamessan/vim-patch-list
vim-patch.sh: Ignore “git describe” failures in list_vim_patches
2016-05-17 01:31:02 -04:00
de570a0b84 vim-patch.sh: Ignore “git describe” failures in list_vim_patches
It's acceptable for “git describe --tags --exact-match …” to fail, since
all runtime updates commits are untagged.  All that matters is that we
get a tag when one exists.

Therefore, ignore the failure status of the git describe call, relying
on the captured output instead.
2016-05-17 01:03:18 -04:00
4e101310d5 msg_puts_printf: remove char_u 2016-05-17 00:28:40 -04:00
ab60a73b6a ci: test: Replace hard-coded commands with Makefile's targets 2016-05-17 00:04:40 -04:00
5bd65e31da Makefile: Ensure tags are generated before running oldtest 2016-05-17 00:04:40 -04:00
c3c409c70f vim-patch:7.4.1728
patch 7.4.1728
Problem:    The help for functions require a space after the "(".
Solution:   Make CTRL-] on a function name ignore the arguments. (Hirohito
            Higashi)

81edd171a9
2016-05-17 00:04:40 -04:00
850f91c51c vim-patch:7.4.1571
patch 7.4.1571
Problem:    No test for ":help"
Solution:   Add a test for what 7.4.1568 fixed. (Higashi Higashi)

8e15ffcde7
2016-05-17 00:04:40 -04:00
10c819d453 vim-patch:7.4.1568
patch 7.4.1568
Problem:    Using CTRL-] in help on option in parentheses doesn't work.
Solution:   Skip the "(" in "('". (Hirohito Higashi)

00f9e0dbbd
2016-05-17 00:04:40 -04:00
39af303600 Merge pull request #4742 from brcolow/shellcheck-lint
Run shellcheck (shell scripting linter) on shell scripts.
2016-05-16 23:27:27 -04:00
68717132b1 indent/lua.vim: fix indent of nested elseif 2016-05-16 00:26:36 -04:00
33ba27b002 Merge pull request #3522 from wdv4758h/clang-3.7-options
build: fix '-fno-sanitize-recover' warning in Clang 3.7
2016-05-16 00:20:20 -04:00
71450b54aa Merge pull request #4743 from jamessan/vim-7.4.1037
vim-patch:7.4.1037,fa73534
2016-05-15 22:50:17 -04:00
082abb7ca6 Merge pull request #4760 from justinmk/term-use-after-free
term_close use-after-free
2016-05-15 20:33:12 -04:00
3cc2a28198 Merge pull request #4527 from philix/env-refactor
os/env.c: cosmetic changes, restrict pointers
2016-05-15 20:03:50 -04:00
f583bc94fc term_close: fix use-after-free
Closes #4393
2016-05-15 19:47:24 -04:00
8dd91ddb73 test: term_close use-after-free
References #4393
2016-05-15 19:47:24 -04:00
df376d2e49 Merge pull request #4764 from justinmk/term-double-free
test: ex_terminal() double-free
2016-05-15 18:18:21 -04:00
bbc13e6459 Merge pull request #4765 from jdelkins/doit
clipboard: support "doit" tool
2016-05-15 18:17:07 -04:00
9b1e819c8c clipboard: support "doit" tool 2016-05-15 16:53:49 -05:00
36fb600a9e ex_terminal(): fix double-free
Closes #4554
2016-05-15 17:02:14 -04:00
d81556513d vim-patch:7.4.1513
Problem:    "J" fails if there are not enough lines. (Christian Neukirchen)
Solution:   Reduce the count, only fail on the last line.

41e0f2f48f
2016-05-15 22:42:17 +02:00
3320b99816 test: ex_terminal() double-free
References #4554
2016-05-15 16:40:37 -04:00
128579f7fc os/env.c: document remove_tail() properly 2016-05-15 21:29:21 +02:00
a453c5ce24 os/env.c: declare srcp and dst as restrict in expand_env_esc()
...and small refactorings:

 - Style changes
 - Variable renames
 - Changes in variable scope

This change won't bring new problems (undefined behavior) as `memcpy` is
already being used in the function.
2016-05-15 21:29:16 +02:00
8cdf908ddb Merge pull request #2717 from lucc/test68
tests: Migrate legacy test 68.
2016-05-15 12:18:41 -04:00
049be74257 os/env.c: cosmetic changes done during review of the file 2016-05-15 15:37:53 +02:00
bfc823f972 fixup2: process.c: Prevent data loss for process output streams
The only data loss should be, if a process forked a child that keeps
sending data after the parent terminated.
While not in teardown mode we could keep reading child data, but then
`:!cmd` would block after `cmd` exited. In teardown mode we want to exit
nvim so we cannot keep reading child data.
2016-05-15 02:54:09 +02:00
14ea366f24 fixup: process.c: Prevent data loss for process output streams
* Get system buffer size for upper data limit. Otherwise data loss
  if this buffer is too big.
* Test whether teardown needs special handling.
2016-05-15 02:54:09 +02:00
1c83e9eb82 shell.c: Fix missing output
The whole stream buffer is now put on screen at once instead of only
data up to the last newline. This has some advantages:

* RBuffer cannot wrap around, so we never forget to output second
  half of the buffer.
* Stream data is not delayed anymore, because we don't have to wait for
  a newline.

This works by remembering the last used screen column.
2016-05-15 02:54:09 +02:00
f0967b0f4c process.c: Prevent data loss for process output streams
For a terminating process, it's output streams could be closed,
before all data is read.
2016-05-15 02:54:09 +02:00
92fe357a52 vim-patch:fa73534
Updated runtime files.

fa7353428f

Missing in runtime/doc: if_tcl.txt, tags, todo.txt, version5.txt.  Some
other changes related to binary nrformats were already merged.
2016-05-14 17:16:18 -04:00
fcd5d3ad21 Linting fixups for vim-patch:7.4.1037 2016-05-14 17:16:18 -04:00
8c399d6b37 vim-patch:7.4.1037
Problem:    Using "q!" when there is a modified hidden buffer does not unload
            the current buffer, resulting in the need to abandon it again.
Solution:   When using "q!" unload the current buffer when needed. (Yasuhiro
            Matsumoto, Hirohito Higashi)

027387f70c
2016-05-14 17:16:18 -04:00
529e2ab178 Merge pull request #4755 from jszakmeister/fix-endian-h-on-bsd
Fix be64toh() detection on BSDs.
2016-05-14 17:06:57 -04:00
a1de2ea154 Merge pull request #4757 from KillTheMule/fix-tui_spec
Fix tui_spec.lua for QB/Travis
2016-05-14 16:50:05 -04:00
104181ea03 Merge pull request #4563 from KillTheMule/vim-patch-1259
vim-patch: 7.4.1259
2016-05-14 16:47:24 -04:00
a1f9760a59 Fix tui_spec.lua for QB/Travis
This was not a problem locally, but would often/sometimes/etc. (YMMV) fail on QB
and/or travis. This seems to fix it. Quoting @justinmk: "I have a feeling this
is just a bug in the bracketed paste special-cases in the existing code".
2016-05-14 21:41:00 +02:00
d3a904309b Fix be64toh() detection on BSDs.
This was noticed due to a user issue (#4750) when building Neovim 0.1.4
via ports.  The crux of the issue is that we did not detect the
be64toh() macro, because there is no endian.h on FreeBSD (along with
several other BSDs).  So we were defaulting to our builtin version of
be64toh().  However, it appears that sys/endian.h was being picked up by
an include (likely msgpack.h) and so be64toh() was actually defined and
corrupting our definition of it.

So the answer here was to use the correct include file in our check, and
export that information in the config.h.  Then we use that information
to include the right header in shada.c.

This fixes #4750.
2016-05-14 12:47:20 -04:00
36a57a9e8a Fix linter warnings in test. 2016-05-14 16:05:41 +02:00
055c9e1be6 vim-patch:7.4.1161
Problem:    ":argadd" without argument is supposed to add the current buffer
            name to the arglist.
Solution:   Make it work as documented. (Coot, closes vim/vim#577)

2faa29f896
2016-05-14 15:57:50 +02:00
02fb6ee458 vim-patch:7.4.1132
Problem:    Old style tests for the argument list.
Solution:   Add more new style tests. (Yegappan Lakshmanan)

99dbe291f5
2016-05-14 15:51:30 +02:00
dfdf7c02be vim-patch:7.4.1123
Problem:    Using ":argadd" when there are no arguments results in the second
            argument to be the current one. (Yegappan Lakshmanan)
Solution:   Correct the w_arg_idx value.

a24f0a550f
2016-05-14 15:51:30 +02:00
1573aa0b0a vim-patch:7.4.1119
Problem:    argidx() has a wrong value after ":%argdelete". (Yegappan
            Lakshmanan)
Solution:   Correct the value of w_arg_idx.  Add a test.

72defda84e
2016-05-14 12:39:41 +02:00
d02cfe8061 Merge pull request #4733 from AdnoC/hi-link-cleared-group
Fix linking a cleared highlight group

Closes #4549
Closes #2756
Closes #4236
2016-05-12 02:55:22 -04:00
954f983bc1 Run shellcheck (shell scripting linter) on shell scripts.
There are a total of 5 shell scripts in the Neovim source tree.
All but runtime\macros\less.sh had warnings/errors when run through
Shellcheck (http://www.shellcheck.net/).

This commit fixes all warnings/errors and also changes the shebang to
"#!/bin/sh" when possible (this was not possible for vim-patch.sh
because it uses many bashisms).

The shellcheck errors that were fixed are:
SC2068: Double quote array expansions to avoid re-splitting elements.
SC2086: Double quote to prevent globbing and word splitting.
SC2124: Assigning an array to a string! Assign as array, or use *
    instead of @ to concatenate
SC2155: Declare and assign separately to avoid masking return values.
2016-05-11 21:06:26 -07:00
a5a1768918 Merge pull request #4727 from bfredl/citestlint
travis: run testlint in lint build
2016-05-11 09:09:25 -04:00
80e84550b2 Merge pull request #4724 from KillTheMule/more-testlint
Testlinting.
2016-05-11 09:08:13 -04:00
2a74cba614 Makefile: let "lint" target run both clint and testlint 2016-05-10 23:25:34 +02:00
130a1a6bb2 test/syntax: Add testing for linking to cleared highlight groups 2016-05-10 16:08:57 -04:00
e63e49d49b syntax: Allow cleared highlight groups to be linked 2016-05-10 16:08:53 -04:00
cdc32e72f9 Testlinting.
Missed in
fd3088b425
2016-05-10 19:29:11 +02:00
0415b36865 Mark 871 as merged, see
https://github.com/neovim/neovim/pull/4631
2016-05-10 19:23:58 +02:00
6ed201c5b5 vim-patch:7.4.1259
Problem:    No test for what patch 7.3.414 fixed.
Solution:   Add a test. (Elias Diem)

3fc3e14282
2016-05-10 19:23:53 +02:00
48b2faead8 test/functional/helpers.lua: Fix dedent() #4735
The character class %s also matches a newline in lua, that's not really what we
want here. It works in the other cases in this function, so I left them, but
the final gsub should preserve newlines.
2016-05-10 06:59:45 -04:00
a524200ca7 Merge pull request #4729 from jbradaric/vim-7.4.1047
vim-patch 7.4.1047, 7.4.1048, 7.4.1049
2016-05-12 01:08:36 -04:00
aa8ccef719 Merge pull request #4730 from jbradaric/vim-7.4.1052
vim-patch:7.4.1052
2016-05-12 01:08:01 -04:00
47fefba529 Merge pull request #4731 from jbradaric/vim-7.4.1054
vim-patch:7.4.1054
2016-05-12 01:03:32 -04:00
dd9dc7ae87 vim-patch:7.4.1054
Problem:    Illegal memory access.
Solution:   Check for missing pattern. (Dominique Pelle)

2795e21eaa
2016-05-10 21:27:17 +02:00
6bdf82bf6f vim-patch:7.4.1052
Problem:    Illegal memory access with weird syntax command. (Dominique Pelle)
Solution:   Check for column past end of line.

04bff88df6
2016-05-10 21:21:54 +02:00
1c4989c2a3 vim-patch:7.4.1049
Problem:    Wordcount test still still fails on MS-Windows.
Solution:   Set 'fileformats' to "unix".

485dace817
2016-05-10 20:59:32 +02:00
6e9e5d23ce vim-patch:7.4.1048
Problem:    Wordcount test still fail on MS-Windows.
Solution:   Set 'fileformat' to "unix".

c7803a1c42
2016-05-10 20:58:39 +02:00
ae7500457e vim-patch:7.4.1047
Problem:    Tests fail on MS-Windows.
Solution:   Set 'selection' to inclusive.

7f68203168
2016-05-10 20:57:32 +02:00
bac9db0313 doc/starting.txt: fix numbering #4728 2016-05-10 06:50:09 -04:00
acc5d08b37 'termguicolors' #4690
TODO: Only works at startup (i.e., in the user's init.vim/vimrc/--cmd),
      but it should probably work at any time.

---

patch 7.4.1799
Problem:    'guicolors' is a confusing option name.
Solution:   Use 'termguicolors' instead. (Hirohito Higashi)
61be73bb0f

patch 7.4.1806
Problem:    'termguicolors' option missing from the options window.
Solution:   Add the entry.
8e3d1b6326

patch 7.4.1808
Problem:    Using wrong feature name to check for 'termguicolors'.
Solution:   Use the right feature name. (Ken Takata)
8a24b794b8

patch 7.4.1809
Problem:    Using wrong short option name for 'termguicolors'.
Solution:   Use the option name.
868cfc19bb
2016-05-10 06:04:26 -04:00
0bfc1f33a0 Merge pull request #4588 from KillTheMule/vim-patch-1285
vim-patch: 7.4.1285
2016-05-10 03:02:07 -04:00
219a8bdb36 Add documentation for reltimefloat()
from 03413f4416

Also adjust  the entries for reltime() and reltimestr().
2016-05-08 20:15:07 +02:00
65b7499872 vim-patch:cb00f03
Add missing test file.

cb00f03933

Converted to a lua test. Change the tolerance of the test to avoid false
positives on travis.
2016-05-08 20:15:07 +02:00
dc91397463 vim-patch:7.4.1285
Problem:    Cannot measure elapsed time.
Solution:   Add reltimefloat().

79c2c881bb

Applied manually. None of the ifdef's applies anymore, and proftime_T was
changed into an uint64_T, so the function profile_float to convert proftime_T to
float is not needed in nvim.
2016-05-08 20:15:07 +02:00
b02ba11cb1 Merge pull request #4707 from sach1t/wconversion-getchar 2016-05-07 23:20:15 +02:00
16217b2854 getchar.c wconversion: Change types 2016-05-07 23:01:43 +02:00
8f2ac8a731 Enable -Wconversion for getchar.c 2016-05-07 23:01:43 +02:00
f4979d368c Merge pull request #4715 from jamessan/vim-7.4.1007
vim-patch:7.4.1007, 7.4.1010
2016-05-06 17:42:49 -04:00
aa4c172a10 version.c: Mark 7.4.1010 as NA
7.4.1010 relies on the “:smile” command that was added in 7.4.1005,
which was also marked NA.
2016-05-06 15:55:35 -04:00
3b492387ee vim-patch:7.4.1007
Problem:    When a symbolic link points to a file in the root directory, the
            swapfile is not correct.
Solution:   Do not try getting the full name of a file in the root directory.
            (Milly, closes vim/vim#501)

e3303cb081

This was already fixed in Neovim by c708061.
2016-05-06 15:49:20 -04:00
6c3ead6684 Merge pull request #4350 from DarkDefender/term_color
Fix guessing incorrect color index in terminal
2016-05-06 14:47:56 -04:00
6396beb432 vim-patch:7.4.1091 #4627
Problem:    When making a change while need_wait_return is set there is a two
            second delay.
Solution:   Do not assume the ATTENTION prompt was given when need_wait_return
            was set already.

b01f357791
2016-05-06 10:39:39 -04:00
71ac92efc7 Merge pull request #4720 from jbradaric/vim-7.4.1042
vim-patch:7.4.1042
2016-05-10 01:40:32 -04:00
a2b888d383 Merge pull request #4695 from KillTheMule/vim-7.4.896
vim-patch:7.4.896
2016-05-10 01:31:55 -04:00
d06c4a2391 Merge pull request #4717 from jamessan/vim-7.4.1015
vim-patch:7.4.1015
2016-05-10 01:27:55 -04:00
691e3bbc99 Linting. 2016-05-08 20:24:02 +02:00
24dac220d3 vim-patch:7.4.896
Problem:    Editing a URL, which netrw should handle, doesn't work.
Solution:   Avoid changing slashes to backslashes. (Yasuhiro Matsumoto)

b4f6a46b01

Cherry-picked from https://github.com/neovim/neovim/pull/810, rebased.
2016-05-08 20:24:02 +02:00
2b238814d7 vim-patch:7.4.1042
Problem:    g-CTRL-G shows the word count, but there is no way to get the word
            count in a script.
Solution:   Add the wordcount() function. (Christian Brabandt)

ed767a2073
2016-05-08 00:23:42 +02:00
fa65e95039 Linting all the days 2016-05-06 20:53:22 -04:00
3a35f63640 vim-patch:7.4.1015
Problem:    The column is not restored properly when the matchparen plugin is
            used in Insert mode and the cursor is after the end of the line.
Solution:   Set the curswant flag. (Christian Brabandt).  Also fix
            highlighting the match of the character before the cursor.

c21d67e33c
2016-05-06 20:49:19 -04:00
79b4951953 version.c: update N/A. #4660
vim-patch:7.4.1562 is N/A because do_helptags(..) no longer has a dirname
argument and dirname is explicitly allocated in the method body, so it must be
freed.

Helped-by: oni-link
2016-05-06 10:17:59 -04:00
c7f02f4f8d Merge pull request #4639 from brcolow/vim-7.4.1347
vim-patch: 7.4.1347
2016-05-10 01:22:25 -04:00
9fe0302385 Merge pull request #4628 from brcolow/vim-7.4.1101
vim-patch: 7.4.1101
2016-05-10 01:19:27 -04:00
31373e400d Merge pull request #4718 from jszakmeister/fix-some-failing-tests
Fix some failing tests.
2016-05-09 14:03:15 -04:00
69d1bc1a47 test/functional: clear the temp directory before each tempfile test
It's possible that the first test encounters a temp directory with files
in it, due to a previous test causing the first test to fail.  Instead,
let's clean up before and after the test to make sure the temp area is
pristine before and after the test.
2016-05-06 20:53:53 -04:00
e91afdcda6 test/functional: fix a dependency on the previous test suite
While trying to debug an issue, I discovered that the tests for illegal
arguments depended on the prior suite having run and started a session.
Let's remove that unintentional dependency by starting our own session
before each test.
2016-05-06 19:55:14 -04:00
508ee7f245 test/functional: prefix the cd command with silent to prevent hanging
In longer directory paths, the test can hang waiting for the user to hit
enter to continue.  Let's use the silent prefix to avoid this.
2016-05-06 19:53:57 -04:00
90995ba788 Merge pull request #4705 from equalsraf/tb-fix-os-nodetype
Windows: Fix os_nodetype() default return
2016-05-06 09:42:58 -04:00
ca1230b601 Windows: Fix os_nodetype() default return 2016-05-06 10:09:46 +01:00
4682b21ef2 Merge pull request #4654 from KillTheMule/testlint
Satisfy testlint.
2016-05-06 01:13:39 -04:00
86eb339120 vim-patch: 7.4.1086 #4626
Problem:    Crash with an extremely long buffer name.
Solution:   Limit the return value of vim_snprintf(). (Dominique Pelle)

507edf63df
2016-05-06 01:10:29 -04:00
c72b60645c Windows: find_file_in_path: Handle absolute path. #4711
Originally in vim/vim.
2016-05-06 00:53:47 -04:00
5185b75f7e Merge pull request #4712 from jamessan/runtime-patches
vim-patch:{40a346d,89b24fc,27a82e3}
2016-05-06 00:05:32 -04:00
9aed8c3eb4 version.c: Mark 7.4.1005 as NA, per discussion in #4191 2016-05-05 21:48:13 -04:00
c6ff71e00c vim-patch:27a82e3
Add new file left out from patch 7.4.1034.

27a82e31ee
2016-05-05 21:13:47 -04:00
e443915d8b vim-patch:89b24fc
Update ignored files.  Delete file that should have been deleted by patch 7.4.1016.

89b24fcfc2
2016-05-05 20:39:48 -04:00
1253c99eb8 vim-patch:40a346d
Update gitignore for files created when running tests.

40a346dc19
2016-05-05 20:39:15 -04:00
22ea7be77b Merge pull request #4540 from KillTheMule/vim-patch-1236
vim-patch: 7.4.1236
2016-05-04 22:03:37 -04:00
1bbe513591 Merge pull request #4677 from KillTheMule/vim-7.4.889
vim-patch:7.4.889
2016-05-04 21:56:05 -04:00
4ac5a0a924 Merge pull request #4644 from KillTheMule/vim-7.4.882
vim-patch:7.4.882
2016-05-04 21:53:10 -04:00
a62cc5f807 Merge pull request #4678 from KillTheMule/vim-7.4.672
vim-patch:7.4.672
2016-05-04 21:32:53 -04:00
e2cc3f98fb Merge pull request #4704 from KillTheMule/vim-runtime-patches-all
vim-patch:{a0f849e, d7464be, b4ff518, e392eb4, d042dc8, 2c5e8e8, 256972a, cc7ff3f}
2016-05-04 13:56:28 -04:00
6a32852137 Fix typo that seems to have been around forever
Could not find when it was fixed in the vim source, it originates in 7.001, and
is fixed as of today, but my git-fu did not discern a relevant patch. I don't
think it matters much.
2016-05-04 17:02:43 +02:00
2d4e7311aa vim-patch:cc7ff3f
Update English spell files.

cc7ff3fcd8

NA for neovim, included so the scripts can pick that up.
2016-05-03 21:24:22 +02:00
7b29dfc43a vim-patch:256972a
Updated runtime files.

256972a984

Missing files in runtime/doc: todo.txt, tags. Patch to runtime/doc/syntax.txt
was applied manually in part, for no discernible reason.
2016-05-03 21:22:45 +02:00
b634cfcc19 vim-patch:2c5e8e8
Updated runtime files.

2c5e8e80ea

Missing files in runtime/doc: if_ruby.txt, tags, todo.txt. Ignored changes to
runtime/syntax/vim.vim.
2016-05-03 21:15:47 +02:00
9d1c52239a vim-patch:d042dc8
Update runtime files.

d042dc825c

Missing in runtime/doc: hangulin.txt, tags, todo.txt. The changes to options.txt
do not apply for nvim. man.vim is very different in nvim, some changes applied
manually, others discarded.
2016-05-03 21:13:41 +02:00
95d376dc88 vim-patch:e392eb4
Update runtime files.

e392eb41f8

Files runtime/doc/tags and runtime/doc/todo.txt did not exist. Ignored
runtime/syntax/vim.vim. One change in runtime/doc/windows.txt had already been
applied.
2016-05-03 21:09:03 +02:00
367b1893e7 vim-patch:b4ff518
Updated runtime files.

b4ff518d95

Missing files: runtime/doc/tags, runtime/doc/todo.txt. Changes to
runtime/doc/if_pyth.txt, runtime/doc/options.txt and runtime/doc/quickref.txt
did not aply. Excluded runtime/syntax/vim.vim.
2016-05-03 21:03:17 +02:00
c535cc7dde vim-patch:d7464be
Updated runtime files.

d7464be974

Applied cleanly except for runtime/docs/todo.txt and runtime/docs/tags.
2016-05-03 20:59:26 +02:00
3c45e3b42a vim-patch:a0f849e
Update runtime files.

a0f849ee40

Missing files runtime/doc/tags and runtime/doc/todo.txt. Excluded
runtime/syntax/vim.vim, since we diverged quite a bit from vim in this file.
2016-05-03 19:25:18 +02:00
490804ed33 Merge pull request #4680 from equalsraf/tb-windows-winsock2
Windows: Include winsock2.h before windows.h
2016-05-02 20:45:21 -04:00
11f41a3c8c Add test for vim-patch 7.4.672 2016-05-02 21:10:53 +02:00
3e1ca9a2db Linting. 2016-05-02 21:10:50 +02:00
00c35ab3b4 vim-patch:7.4.672
Problem:    When completing a shell command, directories in the current
            directory are not listed.
Solution:   When "." is not in $PATH also look in the current directory for
            directories.

b5971141df

Most of it applied manually.
2016-05-02 21:09:43 +02:00
d542de4a76 Merge pull request #4688 from ZyX-I/clint-checks
Add check for boolean operators placement
2016-05-01 17:30:38 -04:00
ZyX
cf4e1fb0f4 *: Fix new linter errors
Originally there were 128 new errors, so I thought this is a good idea to fix 
all of them. Of course, this commit also fixes many suppressed errors.
2016-05-01 20:35:51 +03:00
ZyX
a1f985f60a clint: Check that boolean operator is placed on the next line
I have not found in the style guide words about other operators, so they are not
tested. This adds 128 new errors.
2016-05-01 19:42:42 +03:00
91afb30b66 Merge pull request #4681 from equalsraf/tb-msvc-varmacros
MSVC: Avoid variadic macro bug in STATIC_ASSERT
2016-05-01 09:42:17 -04:00
121987c5cc Merge pull request #4597 from bfredl/motion
convert MCHAR operator and register types to enum MotionType
2016-05-01 13:43:39 +02:00
6cc15ccc3b normal: convert MCHAR etc operator and register types to enum MotionType 2016-05-01 13:40:01 +02:00
2a8ceb160c MSVC: Avoid variadic macro bug in STATIC_ASSERT
MSVC does not handle __VA_ARGS__ as expected in STATIC_ASSERT, avoid its use
to work around it since we don't need it. The underlying issue seems to be one
of

    https://connect.microsoft.com/VisualStudio/Feedback/Details/1232378
    https://connect.microsoft.com/VisualStudio/Feedback/Details/1099052

The bug only seems to manifest when using multiple variadic macros that call
each other.
2016-04-30 20:31:02 +01:00
e4903f8b70 Windows: Include winsock2.h before windows.h
winsock2.h is incompatible with winsock.h (included by windows.h) and must
be included first. For reference see

    https://msdn.microsoft.com/en-us/library/windows/desktop/ms737629%28v=vs.85%29.aspx
2016-04-30 20:30:11 +01:00
3dc8cdc150 Merge pull request #4676 from ZyX-I/fix-hist_char2type-crash
ex_getln: Do not crash with :append/:insert/:change
2016-04-30 14:42:13 -04:00
cd3461b004 Merge pull request #4679 from equalsraf/tb-windows-lc
Windows: without libintl use LC_CTYPE instead of LC_MESSAGES
2016-04-29 20:41:19 -04:00
5f6e63bf38 Windows: without libintl use LC_CTYPE instead of LC_MESSAGES
If libintl is not available, LC_MESSAGES is not defined. For now fallback to
using LC_CTYPE.

Neovim and Vim have diverged significantly in ex_cmds2.c concerning this logic.
In other locations the fallback is actually LC_COLLATE, but in this case Vim
calls get_mess_env() (which in turn falls back to LC_CTYPE).

In Neovim get_mess_env() is only available with libint. This means we are not
completely consistent with Vim when handling LC_ environment variables and do
not build against libintl.
2016-04-29 23:26:05 +01:00
7dab6d4d8f Merge pull request #4675 from barraponto/patch-1
Increase readability of unit conversion.
2016-04-29 18:20:58 -04:00
8be91867b3 vim-patch:7.4.889
Problem:    Triggering OptionSet from setwinvar() isn't tested.
Solution:   Add a test. (Christian Brabandt)

74b738d414

Mark 7.4.889 as merged

Done in

9bd8fcde1e
2016-04-29 20:14:53 +02:00
fd3088b425 Even though the patch is not needed for neovim, add a test for the bugfix 2016-04-29 19:47:20 +02:00
0786ebe305 vim-patch:7.4.882
Problem:    When leaving the command line window with CTRL-C while a
            completion menu is displayed the menu isn't removed.
Solution:   Force a screen update. (Hirohito Higashi)

5f1fea28f5

Applied manually.
2016-04-29 19:46:53 +02:00
ZyX
37f1ee0084 ex_getln: Do not crash with :append/:insert/:change
This change effectively disables history for lines inserted using this method. 
Not a big problem since it does not work for them in Vim in first place.

Also solves a bug(?): ex_window() run while in :append mode opens search history 
in Vim for some reason. Now it opens empty cmdline window.
2016-04-29 19:10:50 +03:00
126e475807 Merge pull request #4674 from equalsraf/tb-include-fcntl
Add missing include fcntl.h
2016-04-29 09:43:14 -04:00
b21c6fbf14 Increase readability of unit conversion. 2016-04-29 10:23:02 -03:00
d0a3f8b73f Add missing include fcntl.h
In Windows, open() flags like O_RDONLY need fcntl.h.
2016-04-29 08:24:07 +01:00
a1d326a251 Merge pull request #1112 from justinmk/os_nodetype
os_nodetype: impl with libuv
2016-04-29 00:42:55 -04:00
7db4a15e95 os_nodetype: impl with libuv 2016-04-29 00:22:43 -04:00
43e7c40051 Merge pull request #4670 from equalsraf/tb-remove-unix-guard
Remove old UNIX ifdef from buf_write()
2016-04-28 22:38:32 -04:00
136374ec6f Remove old UNIX ifdef from buf_write()
When backupcopy=auto buf_write assumes backupcopy=yes when the file is a
hard/symbolic link. However this check was guarded by a UNIX ifdef. The
check itself is portable and the guard can be removed.

Added a couple tests to check the behaviour of bkc=auto and bkc=no
with a symbolic link.

Reported in #4525
2016-04-28 23:58:21 +01:00
eefcc50f2c Merge pull request #4668 from fwalch/archlinux-filetypes
Runtime: Re-add support for Arch Linux PKGBUILDs.
2016-04-28 16:32:52 -04:00
9cd2488334 Runtime: Re-add support for Arch Linux PKGBUILDs.
Originally done in #1087, but was accidentally removed in #4595.

Resolves #4613, resolves #4667.
2016-04-28 22:18:05 +02:00
ee4d1f2cce vim-patch:7.4.1236
Problem:    When "syntax manual" was used switching between buffers removes
            the highlighting.
Solution:   Set the syntax option without changing the value. (Anton
            Lindqvist)

885f24fbca

Patch applied cleanly to the nvim sources except for version.c.
2016-04-28 21:11:03 +02:00
360d0513d1 Satisfy testlint.
For that, make luatest ignore the preload.lua files.
2016-04-28 19:30:17 +02:00
81e0874a54 option.c: include header for completeopt_was_set 2016-04-28 00:09:33 -04:00
860a0194a4 Merge pull request #4661 from brcolow/vim-7.4.1401
vim-patch: 7.4.1401
2016-04-27 23:16:54 -04:00
ef4c0070ce Merge pull request #4652 from HiPhish/coverity-defects
Fix coverity errors in `haslocaldir()` and `getcwd()`.
2016-04-27 23:15:08 -04:00
c6594d73c6 Merge pull request #4625 from brcolow/vim-7.4.1075
vim-patch: 7.4.1075
2016-04-27 21:54:48 -04:00
4ff793eaab Merge pull request #4655 from brcolow/vim-7.4.1035
vim-patch: 7.4.1035
2016-04-27 21:53:05 -04:00
b447b865cd Merge #4591 2016-04-27 21:48:35 -04:00
f931e78fe4 test: matchparen_spec.lua
Covers vim-patch 7.4.1296
2016-04-27 21:48:18 -04:00
61e25f995c vim-patch:7.4.1296
Problem:    Cursor changes column with up motion when the matchparen plugin
            saves and restores the cursor position. (Martin Kunev)
Solution:   Make sure curswant is updated before invoking the autocommand.

f068dcafcf

Applied manually.

Could reproduce the bug with vim/vim@4d8747c but not with vim/vim@2693ca2,
so it must have appeared inbetween. For discussion, see

https://groups.google.com/forum/#!msg/vim_dev/t2sdeFhkybs/WEtLJpCODQAJ
http://vim.1045645.n5.nabble.com/Cursor-behaviour-change-td5726895.html

Could not reproduce with current nvim master.
2016-04-27 21:44:13 -04:00
2d5520fb25 Merge pull request #4622 from Shougo/vim-7.4.1753
vim-patch:7.4.1753
2016-04-27 21:01:03 -04:00
c0de12c3c5 vim-patch: 7.4.1401
Problem:    Having 'autochdir' set during startup and using diff mode doesn't
            work. (Axel Bender)
Solution:   Don't use 'autochdir' while still starting up. (Christian
            Brabandt)

6bd364e084
2016-04-27 16:28:38 -07:00
f644d8d88e Fix coverity errors in haslocaldir() and getcwd.
The Vim function `haslocaldir()` would crash if the users called it with
the two arguments `-1, -1`. Now it returns `0` in that case.

The coverity issue was complaining about a NULL dereference, but there
can never be a case where the pointer `tp` is NULL and being
dereferenced. An assertion has been put in place to satisfy coverity.

Furthermore the functions themselves have been cleaned up. First of all
the documentation comment for the different scopes has been extended and
a macro for the minimum scope has been introduced. In both functions any
time a scope is used as a range (e.g. in a loop) macros instead of
actuals scopes are used, that makes the functions more robust if new
scopes are added.

Second, in the implementation of `getcwd()` there was a superfluous
loop, it has been removed completely. I also changed all `goto end` to
plaing `return` statements by moving the allocation of `cwd` down, that
way there is no need for `goto` anymore.
2016-04-27 18:53:00 +02:00
de0ea44698 vim-patch: 7.4.1101
Problem:    With 'rightleft' and concealing the cursor may move to the wrong
            position.
Solution:   Compute the column differently when 'rightleft' is set. (Hirohito
            Higashi)

e39b3d9fb4
2016-04-26 23:43:42 -07:00
7209d3c59a vim-patch: 7.4.1075
Problem:    Crash when using an invalid command.
Solution:   Fix generating the error message. (Dominique Pelle)

05fe017c1a
2016-04-26 23:33:22 -07:00
6bb4b9f57f vim-patch:7.4.1006 #4605
Problem:    The fix in patch 7.3.192 is not tested.
Solution:   Add a test, one for each regexp engine. (Elias Diem)

96c664af27

The patch was applied to 044_099_regexp_multibyte_magic_spec.lua as
these two legacy tests (44 and 99) were merged together (and
de-duplicated) in Neovim.
2016-04-27 00:37:05 -04:00
2adb8acebd Merge pull request #4649 from justinmk/vimpatches
vim-patch:7.4.1092
2016-04-27 00:04:36 -04:00
ec916bb983 Merge pull request #4630 from jamessan/vim-7.4.613
vim-patch:7.4.613
2016-04-26 23:48:16 -04:00
e4146dd7df remove disable_char_avail_for_testing()
test_cursor_func.vim hangs at the call to
disable_char_avail_for_testing(). The test does not actually need this
function (and it correctly fails if the fix from 7.4.1300 is reverted).
Given that disable_char_avail_for_testing is a gigantic hack, if we can
avoid it let's do so.
2016-04-26 23:32:01 -04:00
cc410185c0 vim-patch: 7.4.1035
Problem:    An Ex range gets adjusted for folded lines even when the range is
            not using line numbers.
Solution:   Only adjust line numbers for folding. (Christian Brabandt)

a3306958dc
2016-04-26 20:22:11 -07:00
ea483231c5 Merge pull request #4593 from ZyX-I/length-functions
Make some function accept strings with length in place of just strings
2016-04-26 23:12:42 -04:00
0d6fe73d7b vim-patch:7.4.1118
Problem:    Tests hang in 24 line terminal.
Solution:   Set the 'more' option off.

a99b90437a
2016-04-26 22:37:00 -04:00
e861af85f8 Merge pull request #4647 from justinmk/vimpatches
version.c: update NA; vim-patch:7.4.998
2016-04-26 00:01:46 -04:00
17294977bd Merge pull request #4631 from KillTheMule/vim-7.4.871
vim-patch:7.4.871
2016-04-25 23:20:23 -04:00
204629a1a0 regexp_nfa.c: Fix various linter errors 2016-04-25 06:36:13 -04:00
ee9cca892c vim-patch:7.4.613
Problem:    The NFA engine does not implement the 'redrawtime' time limit.
Solution:   Implement the time limit.

70781ee403
2016-04-25 06:36:08 -04:00
67d5a1aae2 vim-patch:7.4.1092
Problem:    It is not simple to test for an exception and give a proper error
            message.
Solution:   Add assert_exception().

a803c7f940
2016-04-25 06:34:29 -04:00
db9c22adb9 legacy test: Makefile 2016-04-25 06:34:29 -04:00
cf434d2ae4 Satisfy the linter. 2016-04-25 06:34:28 -04:00
3d73956b96 Add documentation for disable_char_avail_for_testing, handpicked from
6463ca229c
7823a3bd2e
2016-04-25 06:34:28 -04:00
11fd965554 vim-patch:7.4.1300
Problem:    Cannot test CursorMovedI because there is typeahead.
Solution:   Add disable_char_avail_for_testing().

2ab375e54e

Most of it manually applied.
2016-04-25 06:34:28 -04:00
ad99d0bf7e vim-patch:5a46a58
Add missing test file.

5a46a58eb6
2016-04-25 06:34:28 -04:00
ef977c6b68 vim-patch:7.4.998 2016-04-25 05:25:32 -04:00
5797f40646 version.c: update NA
7.4.797:

- Modified function redraw_asap was removed in
  e0e41b30c6,
  together with its only caller check_termcode.
- Grepping for the following regexps did not yield any result in
  nvim/src and its subdirectories: rows.*\*.*Columns (lines modified
  often), ScreenLinesC\[r\] (one of the sources of the bug),
  msg_scrolled followed by grepping for NORMAL (another line that was
  changed for the bug)
- The out-of-bound access was on the array *screenlineC[MAX_MCO] (see
  the diff). I grepped for MAX_MCO an checked every array of that length
  for out-of-bounds access in its scope (I did not check for called
  functions, e.g. utfc_ptr2char(p, u8cc) where u8cc was of length
  MAX_MCO). I did not find any.
- The code for drawing on the screen was moved to the TUI, which was
  newly written.

7.4.733:

- test_listchars was converted to a lua test in
  https://github.com/neovim/neovim/pull/2492
- Since no file is sourced anymore, the behavior of the lua test should
  not depend on the setting of ff
2016-04-25 05:25:31 -04:00
ef205c3851 Merge pull request #4325 from watiko/vim-7.4.984
vim-patch:7.4.{984,1093}
2016-04-25 04:17:45 -04:00
6f98034686 Merge pull request #4632 from KillTheMule/vim-7.4.822
vim-patch:7.4.822
2016-04-25 04:12:04 -04:00
588bc1d958 Merge #4303 'vim-patch:7.4.{951,1143,1144}'. 2016-04-25 03:56:33 -04:00
121e76db6f Merge pull request #4273 from watiko/vim-7.4.957
vim-patch:7.4.{941,942,957}
2016-04-25 03:20:45 -04:00
5a5ef1c222 mouse: Implement horizontal scroll. #3450
- Code from Vim source.
- Removed the check for 'guioptions'
- mouse_spec.lua: test <ScrollWheelLeft> and <ScrollWheelRight>
- Move horizontal scroll logic to mouse.c
- Remove 'gui_' from the function names
- Renamed variables to be more specific (as opposed to generic p, w).
- Marked some functions as `static`
2016-04-25 01:31:44 -04:00
dfe85dd80a Merge pull request #4642 from justinmk/unittest-event_init
test/unit: ensure event_init()
2016-04-25 01:10:55 -04:00
49c5689f45 test/unit: ensure event_init()
Closes #4635
References #4630
References https://github.com/neovim/neovim/pull/4070#discussion_r50626558
2016-04-25 00:42:44 -04:00
6e5343d230 test: shell_spec: rename variable 2016-04-24 23:58:11 -04:00
7925ffc872 version bump 2016-04-24 21:58:07 -04:00
4dcd19d9bc NVIM v0.1.4
Features:
  5ebffaa :tcd for tab-local working directory (like :lcd, but for tabs)
  d835c03 remote/define.vim: support remote function "range"
  007d573 json_encode/json_decode (with sophisticated error detection) #4131
  b50afb4 clipboard: support "lemonade" tool

Fixes:
  cc1beec eval.c: Fix heap corruption error. #4592
  4043725 mbyte.c: Fix invalid memory access in utfc_ptr2char_len #4574
  4eb5827 Enable syntax/filetype by default. #4558

Changes:
  5c6592f v:windowid is writeable (useful for GUIs) #4608
2016-04-24 21:46:34 -04:00
4f5a18237b release.sh: Automate release process. 2016-04-24 21:46:09 -04:00
9cf91a8691 vim-patch: 7.4.1347
Problem:    When there is any error Vim will use a non-zero exit code.
Solution:   When using ":silent!" do not set the exit code. (Yasuhiro
            Matsumoto)

8b778d5599
2016-04-24 12:52:29 -07:00
ab63f5d934 Merge pull request #4636 from blueyed/vim-patch-fix-find_git_remote
vim-patch.sh: fix/improve pattern with find_git_remote
2016-04-24 14:44:50 -04:00
a9f97226ae vim-patch.sh: fix/improve pattern with find_git_remote 2016-04-24 19:07:41 +02:00
1cc869ffb9 Merge pull request #4571 from bfredl/pumtest
more screen tests for completion popupmenu
2016-04-24 16:01:29 +02:00
3c4544c532 tests/ui: screen tests for completion popupmenu 2016-04-24 15:17:39 +02:00
23e8d6d94b Linting. 2016-04-23 23:43:39 +02:00
445f0d7eed vim-patch:7.4.822
Problem:    More problems reported by coverity.
Solution:   Avoid the warnings. (Christian Brabandt)

cde8854730

Applied manually. Files that do not exst anymore: gui.c gui_w16.c gui_w32.c
if_xcmdsrv.c os_unix.c
2016-04-23 23:43:32 +02:00
3098b18a2b vim-patch.sh: Query git for name of neovim remote
Rather than assume the user named their neovim/neovim remote "upstream",
parse the information from "git remote -v".
2016-04-23 15:32:43 -04:00
98fb53e0eb Happy little, happy little, happy little linter 2016-04-22 21:19:47 +02:00
e6b8893337 vim-patch:7.4.871
Problem:    Vim leaks memory, when 'wildignore' filters out all matches.
Solution:   Free the files array when it becomes empty.

7b256fe744

The only nontrivial part of 7.4.871 missing (renamings of variables are in
another commit; freeing *files after 0 matches was already there, just FAIL was
not returned in that case)
2016-04-22 20:19:36 +02:00
c107d4a2d6 The trivial part of 7.4.871 2016-04-22 20:19:29 +02:00
3d7a6e4d54 Merge pull request #4367 from jbradaric/vim-7.4.1107
vim-patch:7.4.{1107,1114,1116,1117,1120}
2016-04-22 04:11:45 -04:00
c4de9c7cc9 version.c: update. #4301
NA patches:

238, 244 SMACK support
1220 Tiny build
1221 configure
1222 Tiny build
1224 Makefile
1225 old style functions
1226 GRESOURCE_HDR
1227 compiler warning
1240, 1241 Makefile
1242 FEAT_EVAL
1243 Compiler warning
1245, 1251 Filelist
1270, 1272, 1280 if_python
1277 ifdef
1290 job
1292 Compiler warning
1320, 1323, 1326, 1332 Makefile
1334, 1339 char_u cast for Windows
1340 Windows build
1344, 1345 Windows
1348 Windows GUI
1349 if_mzscheme
1350 RealWaitForChar()
1154, 1156, 1157, 1160, 1163-1168, 1173, 1178, 1181, 1188, 1269, 1278, 1279 json
1229-1235, 1238, 1239, 1244, 1246-1250, 1252-1258, 1260-1268, 1274-1275, 1283, channel/job
1286-1289, 1291, 1293-1295, 1297-1299, 1301-1304, 1306-1319, 1321, 1322, 1324, channel/job
1325, 1327-1331, 1333, 1335-1338, 1341-1343 channel/job
1351, 1353, 1355-1362, 1369-1374, 1376 channel/job
1354 Makefile
1363 Tiny Build
1364, 1368, 1375 Remove Win16 code
1367 json
1387 Win16
1377-1382, 1385, 1386, 1389, 1393, 1395, 1398, 1404 channel
1383 GVimExt
1390 configure
1391 Compiler warning
1392 Makefile
1399 MS-DOS
1400 if_perl
1402, 1409 GTK-3 support
1403 ifdef Quickfix
1407, 1408 JSON
1411 wrong indent
1412 wrong indent
1413, 1418, 1421-1423 channel
1414, 1415 Appveyor
1416 char_u fix
1417 Filelist
1419 --not-a-terminal
1420, 1424 Makefile

1426, 1435, 1438, 1441, 1447, 1449 channel
1427 C89
1428 DirectWrite
1429 Win32 GUI
1430, 1434, 1439, 1444-1446, 1448, 1450 JSON
1431 if_scope
1432 GUI GTK
1433 if_sniff
1436 Filelist
1437 isnan(), isinf()
1440 Windows build
1442 if_ole
1443 GTK3

1451, 1452, 1454, 1457, 1459, 1461, 1465, 1466, 1469-1472 channel
1453 Makefile
1455 JSON
1460, 1462 functions prototypes
1463 configure
1467 FEAT_FLOAT
1473, 1474 ifdef
1475 push_raw_key()

1476 UNUSED
1481 ifdef
1482-1485, 1493, 1496, 1501-1507, 1509, 1510, 1512, 1514, 1515, 1517-1520, 1522-1524 channel
1487 isinf()
1488 add_to_input_buf_csi()
1489 MSVC
1490, 1497, 1525 GUI GTK
1495 Compiler Warning
1498 JSON
1508 Makefile

1526, 1527, 1529-1532, 1534, 1536, 1537 channel

Included patches:
1346 #3035
1405 fix the flick in complete()
1406 #4064
1500 from neovim
1511
1757 #4509
2016-04-22 03:53:05 -04:00
e57238a644 vim-patch:7.4.1753
Problem:    "noinsert" in 'completeopt' is sometimes ignored.
Solution:   Set the variables when the 'completeopt' was set. (Ozaki Kiichi)

c020042083
2016-04-22 07:19:25 +09:00
cef624ee9e Merge pull request #4618 from bfredl/regcrash
eval: make sure getreg() returns a valid list for an unset register (vim-patch:7.4.1755)
2016-04-21 20:11:27 +02:00
ce17d03180 eval: let getreg() return valid list for an undefined register
vim-patch:7.4.1755
this prevents a crash when the list is used in setreg() later
2016-04-21 18:11:06 +02:00
5ebffaae4e Merge #3229 ':tcd' 2016-04-21 03:15:52 -04:00
89e6973fe2 tcd: doc, error messages 2016-04-21 03:15:08 -04:00
ec71d87b81 Implement tab-local working directory feature.
New ex commands: 'tcd', 'tchdir'
Changed Vimscript functions: 'haslocaldir', 'getcwd'

The ex-commands ':tcd' and ':tchdir' are the tab-local equivalents of
':lcd' and ':lchdir'. There are no new Vimscript functions introduced,
instead the functions 'haslocaldir' and 'getcwd' take in optional
arguments. See the documentation for details

Since there is now different levels of local directory a simple boolean
at source level is no longer sufficient; a new enumeration type is used
for the scope-level from now on.

The documentation has been accommodated for these new commands and
functional tests have been written to test the feature.
2016-04-20 12:52:31 +02:00
9e1cacecbe Fix another linter error. 2016-04-20 10:00:07 +02:00
5734e21873 delete_spec: Fix linter errors. 2016-04-20 08:25:51 +02:00
2dfc8de1cf Merge tempfile.c back into fileio.c 2016-04-20 08:25:51 +02:00
425fcdb5b4 vim-patch:7.4.1120
Problem:    delete(x, 'rf') fails if a directory is empty. (Lcd)
Solution:   Ignore not finding matches in an empty directory.

336bd622c3
2016-04-20 08:25:51 +02:00
29b737e92b vim-patch:7.4.1117
Problem:    No longer get "." and ".." in directory list.
Solution:   Do not skip "." and ".." unless EW_DODOT is set.

d82103ed85
2016-04-20 08:25:51 +02:00
a252fca38e Fix linter errors. 2016-04-20 08:25:51 +02:00
9e385404b3 vim-patch:7.4.1116
Problem:    delete(x, 'rf') does not delete files starting with a dot.
Solution:   Also delete files starting with a dot.

b0967d587f
2016-04-20 08:25:51 +02:00
88a735166b vim-patch:7.4.1114
Problem:    delete() does not work well with symbolic links.
Solution:   Recognize symbolik links.

43a34f9f74
2016-04-20 08:25:51 +02:00
50a7517a6d vim-patch:7.4.1107
Problem:    Vim can create a directory but not delete it.
Solution:   Add an argument to delete() to make it possible to delete a
            directory, also recursively.

da440d21a6
2016-04-20 08:25:16 +02:00
a7a0bf54e3 Merge pull request #4610 from KillTheMule/vim-7.4.819
vim-patch:7.4.819
2016-04-20 01:36:30 -04:00
cd10cdd1b4 Merge pull request #4589 from gregorias/patch_1113
vim-patch: 7.4.1113
2016-04-20 01:34:29 -04:00
7029dec0ae vim-patch:7.4.819
Problem:    Beeping when running the tests.
Solution:   Fix 41 beeps. (Roland Eggner)

901e58c243

Applied cleanly, except for files test29.in, test4.in, test61.in, test82.in,
test83.in, test90.in, test95.in, which were all converted to lua tests, and
version.c.

Some beeps remain, but this is much better.
2016-04-19 22:01:26 +02:00
02fa6b18d6 vim-patch:7.4.1113
Problem:    Using {ns} in variable name does not work. (lilydjwg)
Solution:   Fix recognizing colon.  Add a test.
2016-04-19 19:54:52 +02:00
5c6592fdab v:windowid #4608
Set v:windowid as writeable (but read only in the sandbox).

References #3626
2016-04-19 02:49:34 -04:00
ba9bdb3e70 Merge pull request #4604 from dbarnett/vim-60cce2f
vim-patch:60cce2f
2016-04-19 01:02:25 -04:00
1cb8afed78 doc: remove redundant, outdated section.
The new content from bf635102 is retained.
2016-04-19 00:57:25 -04:00
43fe335eda vim-patch:60cce2f
Update runtime files.

60cce2fb73
2016-04-18 21:50:37 -07:00
0ba12c6691 Merge pull request #4603 from dbarnett/vim-ca63501
vim-patch:ca63501
2016-04-19 00:44:26 -04:00
0d264abdd0 vim-patch:ca63501
Update various runtime files.

ca63501fbc
2016-04-18 21:36:16 -07:00
f3d6c443d9 Merge pull request #4602 from dbarnett/vim-12969c0
vim-patch:12969c0
2016-04-19 00:29:09 -04:00
bf63510228 vim-patch:12969c0
Update documentation and syntax files.

12969c04fe
2016-04-18 21:16:14 -07:00
ef92cca7cc Merge pull request #4601 from dbarnett/vim-f913281
vim-patch:f913281 (runtime/doc/)
2016-04-19 00:09:17 -04:00
376ba4e734 Merge pull request #4599 from Shougo/fixerror
Fix loading remote plugin error
2016-04-18 23:23:13 -04:00
49dde999c0 vim-patch:f913281 (runtime/doc/)
Updated and new runtime files.

f91328100d
2016-04-18 20:15:22 -07:00
2ebc58d25a Fix loading remote plugin error 2016-04-19 06:52:04 +09:00
ba97f73560 Merge pull request #3951 from cacplate/misc1_Wconversion
Enable -Wconversion in misc1.c
2016-04-18 20:17:56 +02:00
1b1b920ba8 Merge #4553 2016-04-18 05:43:21 -04:00
a347b29aa3 test: remote/define.vim: Add some spice. 2016-04-18 05:42:27 -04:00
c4117d4b2f test: format 2016-04-18 05:40:24 -04:00
4a200ceafa test: remote/define.vim: range 2016-04-18 05:40:15 -04:00
d835c030f2 remote/define.vim: support remote function "range" 2016-04-18 05:24:46 -04:00
8d12e28d94 Merge pull request #4018 from justinmk/vim-35e7594
vim-patch:35e7594
2016-04-18 04:02:00 -04:00
05baf936c0 vim-patch.sh: recognize malformed patches.
vim-patch:fc39ecf (committed in aae7e8b)
vim-patch:541f92d (committed in cc52060)
vim-patch:88774fd (committed in 896f548)

This commit message forces vim-patch.sh to recognize these patches
which were committed with only 6 chars (vim-patch.sh requires 7).
2016-04-18 03:00:50 -04:00
8a14750dd3 test: convert test_marks.in.
vim-patch:35e7594
35e7594dd4
    "Add missing test files from 7.4.634 to the repository."

The discrepancy between the expected getpos() result of the old test
[0, 15, 2, 0] and the converted test [0, 3, 2, 0] is just a matter of how
the buffer is constructed: in the old Vim test the buffer has a bunch of
junk at the top.

The central purpose of the test is to verify that the getpost("'a") does
*not* return [0, 0, 0, 0].
2016-04-18 03:00:43 -04:00
28b9a2864a Merge pull request #4590 from Streetwalrus/issue4471
rplugin: Don't chain events.
2016-04-18 02:28:58 -04:00
e5147ce6a0 rplugin: Ignore modeline while chaining events 2016-04-18 09:21:22 +03:00
40cc5ba0e2 Merge pull request #4595 from dbarnett/vim-fc39ec
vim-patch:fc39ec (runtime/filetype.vim changes)
2016-04-18 01:54:45 -04:00
946807898b vim-patch:fc39ec (runtime/filetype.vim)
Update runtime files.

fc39ecf8de

Add remaining runtime/filetype.vim changes that were missing in 289588.
2016-04-17 22:49:49 -07:00
ZyX
191fb638f4 *: Fix linter errors 2016-04-18 03:37:24 +03:00
ZyX
fdb68e35e4 ex_getln: Make get_histtype return HIST_DEFAULT if needed 2016-04-18 03:37:23 +03:00
ca280c28b4 Merge pull request #4594 from dbarnett/vim-88774f
vim-patch:88774f
2016-04-17 20:34:49 -04:00
007d573147 Merge pull request #4131 from ZyX-I/json-functions
Add JSON support
2016-04-17 20:24:23 -04:00
896f548eee vim-patch:88774f
Updated runtime files and Italian messages.

88774fdd23
2016-04-17 17:19:00 -07:00
a3dfd1627e misc1.c: enable -Wconversion 2016-04-17 20:15:40 -04:00
ZyX
a64114eba0 functests: Make json_functions_spec use new NIL where appropriate 2016-04-18 02:48:20 +03:00
ZyX
28275fe5c3 *: Fix preincrement lint errors 2016-04-18 02:48:20 +03:00
ZyX
45304b482c eval/encode: Simplify loop in encode_list_write
Patch made up by oni-link.
2016-04-18 02:48:20 +03:00
ZyX
bda0165514 eval/encode: Make sure that encoder can encode NULL variables
Adds two undocumented v: variables: _null_list and _null_dict because I do not 
know a reproducible way to get such lists (though I think I heard about this) 
and dictionaries (do not remember hearing about them). NULL strings are obtained 
using $XXX_UNEXISTENT_VAR_XXX.

Fixes crash in json_encode($XXX_UNEXISTENT_VAR_XXX). Other added tests worked 
fine before this commit.
2016-04-18 02:48:20 +03:00
ZyX
c4f1b5a938 eval/encode: Adjust buffer sizes passed to vim_snprintf 2016-04-18 02:48:20 +03:00
ZyX
3e435df42c functests: Replace \xXX escapes with \DDD in lua code 2016-04-18 02:48:20 +03:00
ZyX
fd92e648ac eval/encode: Dump FF character correctly 2016-04-18 02:48:20 +03:00
ZyX
494b1c9bee *: Make set_vim_var_\* functions have proper argument types 2016-04-18 02:48:20 +03:00
ZyX
9af400f979 eval: Treat [] and [""] as any other empty string 2016-04-18 02:48:20 +03:00
ZyX
af7ff808c7 eval: Fix overflow in error message in f_json_decode 2016-04-18 02:48:20 +03:00
ZyX
9709cf2cdb documentation: Update assert_{false,true}() and empty() documentation
Also removes a note regarding the performance of `empty(long_list)` vs
`len(long_list) == 0` because this has nothing to do with the actual state:
first checks that list is not NULL and pointer to its first element is also not
NULL, second gets length by comparing list with NULL and falls back to
`tv->vval.v_list->lv_len` if not. `len(long_list)` *may* still be *slightly*
slower, but the slow down has nothing to do with the length of the list, is
hardly noticeable and depends on how good compiler is at inlining and what
exactly have author of the plugin written (I mean `len(long_list) == 0` vs
`empty(long_list)` vs `!len(long_list)`).
2016-04-18 02:48:20 +03:00
ZyX
25bb08dad9 api: Add warnings about the returned value to \*del_var functions 2016-04-18 02:48:20 +03:00
ZyX
4f8b686435 documentation,functests: State that UTF-8-only support is intentional 2016-04-18 02:48:20 +03:00
ZyX
c129f6cfaf eval/decode: Accept \r as space character 2016-04-18 02:48:20 +03:00
ZyX
d06c2a1b18 eval/decode: Do not overflow when parsing -
Also makes if’s less nested.
2016-04-18 02:48:20 +03:00
ZyX
2b0d46195b eval/decode: Clarify meaning of some pointer arguments 2016-04-18 02:48:20 +03:00
ZyX
0c598774d8 eval/decode: Fix typo in internal error message 2016-04-18 02:48:20 +03:00
ZyX
515fea1ef0 eval/decode: Reject even more numbers
Rejects leading zeroes and numbers like 1.e+5 (decimal dot with missing number 
with signed exponent).
2016-04-18 02:48:20 +03:00
ZyX
69ce17878e *: Fix linter errors 2016-04-18 02:48:20 +03:00
ZyX
1bada1fde0 documentation: Update type() documentation 2016-04-18 02:48:20 +03:00
ZyX
82f249f829 message: Remove useless emsg* functions, leaving only emsgf 2016-04-18 02:48:20 +03:00
ZyX
9a56fcb2e8 eval/decode: Rewrite json_decode_string end as suggested by oni-link 2016-04-18 02:48:20 +03:00
ZyX
9c543f2e24 eval/decode: Reject more numbers, accept 1e5 2016-04-18 02:48:20 +03:00
ZyX
032ac502ff eval/decode: Do not loose high surrogates followed by high surrogates 2016-04-18 02:48:20 +03:00
ZyX
eb806c9620 eval/decode: Make sure that error messages do not cause overflow 2016-04-18 02:48:20 +03:00
ZyX
52c6cc2189 eval/decode: Make sure that parsing strings does not overflow 2016-04-18 02:48:20 +03:00
ZyX
224d7df630 eval/decode: Make sure that blank input does not crash Neovim 2016-04-18 02:48:20 +03:00
ZyX
394830631f eval/decode: Make sure that U+00C3 is parsed correctly 2016-04-18 02:48:20 +03:00
ZyX
b725f6b428 functests: Make sure that json functions are tested with C messages 2016-04-18 02:48:20 +03:00
ZyX
4eb5d05f01 eval/decode: Avoid overflow when parsing incomplete null/true/false
Note: second test does not crash or produce asan errors, even though it should.
2016-04-18 02:48:20 +03:00
ZyX
4a29995fe7 eval/decode: Rename brackets in error messages
U+007D is officially RIGHT CURLY BRACKET.
U+005D is officially RIGHT SQUARE BRACKET.
2016-04-18 02:48:20 +03:00
ZyX
1fc84ae2cd eval/decode: Record that obj may be freed 2016-04-18 02:48:20 +03:00
ZyX
4ff5d6e41c eval/decode: Also use VAR_UNLOCKED in old code 2016-04-18 02:48:20 +03:00
ZyX
54cc6d8025 eval: Remove assert expression
GCC on travis thinks that
1. It is not constant.
2. Left-hand operand of comma has no effect (-Werror=unused-variable).
2016-04-18 02:48:20 +03:00
ZyX
6a35f2ac8b eval: Do not break when VimVarIndex and vimvars order mismatches
Also makes sure that compiler will error out when new name is longer then 
vv_filler.
2016-04-18 02:48:20 +03:00
ZyX
942e0b338c encode: Handle incomplete surrogates like \uSURR\uOTHR properly 2016-04-18 02:48:20 +03:00
ZyX
406562ac6d encode: Fail to dump NaN and infinity
Thanks to vim/vim#654
2016-04-18 02:48:20 +03:00
ZyX
7cdd01983a api/documentation: Add a warning that nil may mean v:null 2016-04-18 02:48:20 +03:00
ZyX
2f67786796 eval: Rename json* functions to json_* 2016-04-18 02:48:20 +03:00
ZyX
f1ced96c28 api: Replace set_var(name, NIL) with del_var(name) 2016-04-18 02:47:13 +03:00
ZyX
af6603a6b4 eval/encode: Remove unneeded variable, add missing include 2016-04-18 02:47:13 +03:00
ZyX
4913a25dec eval/encode: Free memory just in case
After string_convert() with .vc_fail=true these blocks should never be entered 
because they indicate invalid unicode.
2016-04-18 02:47:13 +03:00
ZyX
209427e972 eval/encode: Reduce length of encode_list_write
Changes suggested by oni-link.
2016-04-18 02:47:13 +03:00
ZyX
f0bd4a1494 eval/encode: Fix invalid UTF-8 strings handling:
1. Do not allow reading past buffer end when creating error messages.
2. Fix surrogate pairs range, avoid magic constants.
2016-04-18 02:47:13 +03:00
ZyX
77776b09c6 eval/encode: Fix writing strings starting with NL to list
Error [found][1] by oni-link.

[1]: https://github.com/neovim/neovim/pull/4131/files#r52239384
2016-04-18 02:47:13 +03:00
ZyX
c27395ddc8 eval: Fix QuickBuild failures
Compiler used by one VM in QuickBuild has found a number of false positives.
Everything is fine on travis.

List of failures:

From [QuickBuild][1], build [7429][2]:

    14:38:19,945 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval.c: In function ‘assert_bool’:
    14:38:19,945 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval.c:7551:40: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
    14:38:20,058 WARN  - cc1: all warnings being treated as errors

. This is not making much sense (7551:40 is `!=` in `{SpecialVarValue} !=
({bool}?{SpecialVarValue}:{SpecialVarValue})`), but this error is present.

---

Also fail from [build][3] [4930][4]:

    15:47:00,853 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval/encode.c: In function ‘encode_read_from_list’:
    15:47:00,853 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval/encode.c:258:30: error: conversion to ‘char’ from ‘int’ may alter its value [-Werror=conversion]

, pointing to `:` in `{char} = ({char} == {const} ? {const} : {char})` where
`{const}` is character constant like `'\n'`. I have no idea where exactly it saw
conversion, so simply casted everything to (char).

---

[Build][5] error:

    08:32:03,472 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval.c: In function ‘tv_equal’:
    08:32:03,472 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval.c:5077:1: error: control reaches end of non-void function [-Werror=return-type]

---

Build [4949][7]:

    11:28:00,578 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval.c: In function ‘f_type’:
    11:28:00,578 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval.c:16085:24: error: ‘n’ may be used uninitialized in this function [-Werror=uninitialized]
    11:28:00,581 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval.c: In function ‘f_empty’:
    11:28:00,581 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/eval.c:8505:24: error: ‘n’ may be used uninitialized in this function [-Werror=uninitialized]

[1]: http://neovim-qb.szakmeister.net/wicket/page?5-1.ILinkListener-content-buildTab-panel-masterStep-body-children-0-step-body-children-2-body-children-3-step-body-children-0-step-body-children-0-step-head-logLink
[2]: http://neovim-qb.szakmeister.net/build/4929
[3]: http://neovim-qb.szakmeister.net/build/4930
[4]: http://neovim-qb.szakmeister.net/wicket/page?1-1.ILinkListener-content-buildTab-panel-masterStep-body-children-0-step-body-children-1-body-children-3-step-body-children-0-step-body-children-0-step-head-logLink
[5]: http://neovim-qb.szakmeister.net/build/4948/step_status
[7]: http://neovim-qb.szakmeister.net/build/4949
2016-04-18 02:47:13 +03:00
ZyX
fa26eee85b version: Record that vim-7.4.1271 is kinda of there 2016-04-18 02:46:55 +03:00
ZyX
569e404622 eval/encode: Fix non-utf-8 &encoding handling, add tests 2016-04-18 02:46:34 +03:00
ZyX
7124329bd9 *: Fix memory leaks found by clang sanitizer 2016-04-18 02:46:34 +03:00
ZyX
d4106f6df3 shada: Make sure that NIL and EXT values can also be parsed back
Note: currently they are both *dumped*, but parsing them produces an error. This
is inappropriate: variables should either be skipped with error message when
dumping or should be read back properly.

It also appears that I did not have test for “has wrong variable value type”
error, so nothing got removed from errors_spec.
2016-04-18 02:46:34 +03:00
ZyX
0aa3e7b7ce eval: Port parts of 7.4.1267 that are not already present 2016-04-18 02:46:34 +03:00
ZyX
b7cb8f0597 eval: Make assert_true and assert_false accept v:true and v:false 2016-04-18 02:45:49 +03:00
ZyX
c91c0171dd *: Fix gcc warnings 2016-04-18 02:45:49 +03:00
ZyX
6cdf45e298 eval: Change dv_lock type to VarLockStatus 2016-04-18 02:45:49 +03:00
ZyX
f4ea114c67 eval/decode: Fix vim_str2nr invocation 2016-04-18 02:45:49 +03:00
ZyX
33778c36cc *: Fix linter errors 2016-04-18 02:45:49 +03:00
ZyX
6167ce6df2 eval: Remove v:none
To get v:none back just rever this commit. This will not make json*() functions
compatible with Vim though.
2016-04-18 02:45:49 +03:00
ZyX
a3b87fc19b eval: Remove get_vim_var_tv function 2016-04-18 02:45:49 +03:00
ZyX
e303ea8a19 eval/decode: Add support for special maps
Special dictionaries representing map are created when encountering duplicate
key or when key is empty or contains NUL.

Also checks that values are separated by a comma/colon properly.
2016-04-18 02:45:49 +03:00
ZyX
2c378fdfaf eval/decode: Parse strings with NUL to special dictionaries 2016-04-18 02:45:49 +03:00
ZyX
634e51d12b eval/*: Fix some linter errors 2016-04-18 02:45:49 +03:00
ZyX
57700def79 doc: Update documentation regarding converting from/to &encoding 2016-04-18 02:45:49 +03:00
ZyX
5814e29cdb eval/decode: Fix surrogate pairs processing 2016-04-18 02:45:49 +03:00
ZyX
ea82270d30 eval/decode: Fail on control and invalid unicode characters 2016-04-18 02:45:49 +03:00
ZyX
cddd7d47c3 eval/decode: Make msgpackparse() function use new v: vars 2016-04-18 02:45:49 +03:00
ZyX
ed6756563c eval/decode: Replace INIT_SPECIAL_DICT macros with inline function 2016-04-18 02:45:49 +03:00
ZyX
700b32a2b3 eval: Move some decoding functions to eval/decode.c 2016-04-18 02:45:49 +03:00
ZyX
3c39219550 eval: Get rid of VV_LEN constant 2016-04-18 02:45:49 +03:00
ZyX
85244e68e3 vim: Move *MSG* macros to message.h
Note: OUT* macros were removed because they are no longer used anywhere.
2016-04-18 02:45:49 +03:00
ZyX
41b44d114c eval: Move encode.c to eval/encode.c 2016-04-18 02:45:49 +03:00
ZyX
704accfbfa cmake: Refactor code that creates directories and lists C files 2016-04-18 02:45:49 +03:00
ZyX
e213ba1506 eval: Add jsondecode() function 2016-04-18 02:45:49 +03:00
ZyX
0f0e2bdfd4 encode: Do not use default case for v_type 2016-04-18 02:44:03 +03:00
ZyX
f5c35ba109 functests/msgpack: Test dumping special nil and bool dicts 2016-04-18 02:44:03 +03:00
ZyX
6e5498c3e3 runtime/msgpack: Add support for special values 2016-04-18 02:44:03 +03:00
ZyX
d70a322c40 eval: Add special variables v:false, v:null, v:none 2016-04-18 02:44:03 +03:00
ZyX
18903bd9b8 eval: Add special variable type 2016-04-18 02:44:03 +03:00
ZyX
256a5d2522 encode: Add a hint for static analyzer that cur_tv is not NULL 2016-04-18 02:44:03 +03:00
ZyX
68e58444b4 eval: Add jsonencode() function
Ref #3471
2016-04-18 02:44:03 +03:00
ZyX
c3efad5398 functests(msgpack): Fix location of one of the tests 2016-04-18 02:44:03 +03:00
ZyX
f21cb425fb functests(msgpack): Fix test names 2016-04-18 02:44:03 +03:00
ZyX
44cbf45d26 eval: Split out typval_T dumping functions to nvim/encode.c 2016-04-18 02:44:03 +03:00
ZyX
5674546580 ex_getln: Make get_histtype accept length argument 2016-04-18 02:43:43 +03:00
ZyX
c0bab19cf5 option: Allow zero-length options
Code that expected NUL-terminated strings allowed them and this behaviour is
actually used.
2016-04-18 02:43:43 +03:00
ZyX
9261f1597f option: Use findoption_len in do_set 2016-04-18 02:43:43 +03:00
ZyX
1168dbe343 option: Add find_key_option_len function 2016-04-18 02:43:43 +03:00
ZyX
459900b100 option: Add findoption_len function
It is like findoption(), but works with non-NUL-terminated strings.
2016-04-18 02:43:43 +03:00
ZyX
ebabdff5cd keymap: Make replace_termcodes and friends accept length and cpo_flags
Reasons:
- One does not have to do `s[len] = NUL` to work with these functions if they do
  not need to replace the whole string: thus `s` may be const.
- One does not have to save/restore p_cpo to work with them.
2016-04-18 02:43:43 +03:00
83c683f5e1 Merge pull request #4565 from KillTheMule/vim-patch-1282
vim-patch:7.4.{1000, 1001, 1030, 1282, 1284}
2016-04-17 19:19:06 -04:00
aae7e8b7dd Merge pull request #4585 from dbarnett/vim-fc39ec
vim-patch:fc39ec
2016-04-17 18:44:25 -04:00
cc1beecf81 Merge pull request #4592 from oni-link/fix.issue.4582
eval.c: Fix heap corruption error when constructing sourcing_name
2016-04-17 18:25:43 -04:00
164bcaf5c9 eval.c: Fix heap corruption error when constructing sourcing_name
A wrong format specifier and not enough allocated memory for
sourcing_name could lead to a heap corruption.

Original patch by Rui Abreu Ferreira (@equalsraf)

Fixes #4582
2016-04-17 23:31:47 +02:00
4043725991 Merge pull request #4574 from oni-link/fix.utfc_ptr2char_len
mbyte.c: Fix invalid memory access in utfc_ptr2char_len
2016-04-17 16:59:14 -04:00
e90f52f7ac Merge pull request #4586 from oni-link/fix.on.process.exit
eval.c: Fix cut off of terminal exit message
2016-04-17 15:22:05 -04:00
cd00aa6ae4 mbyte_spec.lua: Fix indentation 2016-04-17 21:07:42 +02:00
a8fec15899 mbyte_spec.lua: Fix wording 2016-04-17 21:07:22 +02:00
4b097c85d8 Merge pull request #4579 from Shougo/lemonade
Add lemonade support for clipboard feature
2016-04-17 14:50:24 -04:00
2eb5d73438 eval.c: Fix cut off of terminal exit message
The message array in on_process_exit() is too short
for a status > 99.
2016-04-17 11:09:55 +02:00
2895883154 vim-patch:fc39ec
Update runtime files.

fc39ecf8de
2016-04-16 23:06:24 -07:00
b50afb4651 clipboard: support "lemonade" tool 2016-04-17 13:38:57 +09:00
a7a3605c0f Merge pull request #4583 from KillTheMule/robust-completion
Make completion_spec.lua more robust
2016-04-16 23:08:12 +02:00
e6e843ebc0 Make completion_spec.lua more robust
Having a tags file in the calling directory of make test would make this test
fail, so disable tag file completion for it. Disable all other options except the
current buffer, to, applying the principle of least surprise.
2016-04-16 22:40:43 +02:00
cfe4352897 mbyte.c: Unittest for utfc_ptr2char_len() 2016-04-15 21:17:33 +02:00
2c827cea12 Add new style test test_viml.vim to the build 2016-04-15 20:17:07 +02:00
1b1960ab90 Satisfy the linter 2016-04-15 20:17:07 +02:00
f09f6ba2e4 Update version.c to 7.4.1284 2016-04-15 20:17:07 +02:00
8a2cf943f7 vim-patch:7.4.1284
Problem:    Test 49 fails.
Solution:   Check for a different error message.

dc94a26a64

Applied cleanly except for version.c.
2016-04-15 20:17:07 +02:00
e34cdf6e79 vim-patch:7.4.1030
Problem:    test49 is still slow.
Solution:   Move more tests from old to new style.

a2cce86307

Applied cleanly except for version.c.
2016-04-15 20:17:07 +02:00
a0fec5d3db vim-patch:7.4.1001
Problem:    test_viml isn't run.
Solution:   Include change in makefile.

f49e240c2d

Applied cleanly except for version.c. Needs to be added to the build system.
2016-04-15 20:17:07 +02:00
622164d403 vim-patch:7.4.1000
Problem:    Test 49 is slow and doesn't work on MS-Windows.
Solution:   Start moving parts of test 49 to test_viml.

c06624661a

Applied cleanly except Makefile changes. File src/nvim/testdir/runtest.vim was
configured to set nocp for all tests. This option is not in nvim anymore, so it
was removed.
2016-04-15 20:17:07 +02:00
824a6877ea vim-patch:7.4.1282
Problem:    Crash when evaluating the pattern of ":catch" causes an error.
            (Dominique Pelle)
Solution:   Block error messages at this point.

768ce2435a

Applied manually. Could not reproduce the crash both using vim and nvim,
therefore could not device a test.

Should be merged anyways, since it's in vim?
2016-04-15 20:17:07 +02:00
11e8ec0cac mbyte.c: Fix invalid memory access in utfc_ptr2char_len
To get an UTF-8 character, utf_ptr2char() is used.
But this function can read more than maxlen bytes, if an incomplete
byte sequence is used(first byte specifies a length > maxlen).
2016-04-15 17:35:50 +02:00
4eb58273cd Merge pull request #4558 from justinmk/filetype
defaults: Enable syntax/filetype for real.
2016-04-15 02:42:46 -04:00
523ff9c55c test: defaults_spec.lua 2016-04-15 02:23:27 -04:00
54188cddde test: move server_spec.lua
Old layout was too granular, we do not need a server/ folder.
2016-04-15 02:23:27 -04:00
cf7d6a7a0b defaults: Enable syntax/filetype for real.
Fixes a bug in #4252: we enabled filetype/syntax if -u was passed,
but not otherwise. So it did not work for an empty or missing vimrc.
2016-04-15 02:23:26 -04:00
01eafc0c17 tests: fix indeterministic oldfiles! test 2016-04-14 18:11:39 +02:00
69d74f588a Merge pull request #4566 from ZyX-I/more-lint
Add more lint checks: space before asterisk and preincrement/predecrement
2016-04-13 08:56:31 -04:00
982198143d Merge PR #4398 'Update lua client' 2016-04-13 09:24:29 -03:00
c18d5917e3 Update lua client to 0.0.1-24
The new version of the lua client uses libmpack as a backend, and some test
scripts had to be updated to reflect that.
2016-04-13 09:21:32 -03:00
ZyX
4a6328a8eb clint: Add rule for preincrement/predecrement 2016-04-13 03:06:35 +03:00
ZyX
0cb2c39ec4 clint: Add diagnostics for things like char* foo or (char*)
Asterisk should be preceded by a space except the following cases:

1. `foo[*idx_ptr]`
2. `++*foo` (though I would prefer to write this as `++(*foo)`)
3. `(*foo)->bar`, `if (*p)`
4. `char **foo`
5. `/* comment */`
6. `!*p`

Note: `[^ (*/![]` is followed by `+` to make error position easier to find. It
is not needed to find location of the problem.
2016-04-13 03:06:34 +03:00
10a8bb02ac third-party: Add missing *_host dependencies to luarocks packages 2016-04-11 23:07:52 -03:00
4ae7acd152 Add luv as a third party dependency
Luv is a simple lua binding to libuv, which is now used by neovim lua client.
The bundled luv installation a bit different from other dependencies in that it
is installed two times:

- The "BuildLuv.cmake" script downloads and installs a static version of luv
  using its normal cmake build script. This static version will be used later.
- Luv default rockspec is replaced with the alternate under the "rockspecs"
  directory(the alternate rockspec plays nicer with neovim build system)
- The alternate rockspec is used to build/install the lua module and make it
  available to lua scripts.
2016-04-11 23:07:52 -03:00
584b8eddb4 Mark cursor_spec.lua indeterministic test as pending 2016-04-11 23:07:52 -03:00
f5f11b9e2f Remove indeterminism in oldfiles_spec.lua
If Nvim is in a "Press ENTER..." screen before the `get_vvar()` call, the test
will hang.
2016-04-11 23:07:52 -03:00
3f698b8106 Allow a lua debugger to be specified on functionaltest-lua target 2016-04-11 23:07:52 -03:00
704f3dd855 Synchronize shada reset helper with other functional tests 2016-04-11 23:07:52 -03:00
906271b53d main.c: Free msgpack packer in --api-info handler to make ASAN happy 2016-04-11 23:07:51 -03:00
f47a20a266 Merge pull request #4562 from dbarnett/vim-f2571c
vim-patch:f2571c
2016-04-11 13:02:04 -04:00
cf32ca5137 vim-patch:f2571c
Updated runtime files.

f2571c61d5
2016-04-11 09:23:31 -07:00
fe4d814c0f Merge pull request #4559 from ZyX-I/undodir-undo-doc-update
documentation: Update information about default location of undo files
2016-04-11 00:08:16 -04:00
ZyX
b25b6048ca documentation: Update information about default location of undo files 2016-04-11 07:00:57 +03:00
c56aceff88 Merge pull request #4557 from mikewadsten/bugfix/issue-4537-cscope-segfault
cscope: Fix mismatched types in ':cscope show' output
2016-04-10 20:56:01 -04:00
80471df208 cscope: Fix mismatched types in ':cscope show' output
Type long on 32-bit systems is typically 32 bits, but
PRId64 is 64 bits. This mismatch leads to bad output
or segfaults on :cs show.

Fixes #4537
2016-04-10 19:11:17 -05:00
91c5005da8 Merge pull request #4555 from justinmk/spell
spell: fix SpellFileMissing handler
2016-04-10 04:52:10 -04:00
8d37201ed2 spell: Fix argument and avoid redundant prompt.
In #3027 we deferred the "missing spell file" prompt until VimEnter, but
we were sending the wrong argument (should be "en", not "en_us").
This also caused redundant prompts if user answers "No" to the download
prompt invoked by the SpellFileMissing event.

Closes #3966
Closes #4406
2016-04-10 04:27:39 -04:00
3462f46cb8 spellfile.vim: less pestering
- Always auto-create spell/ directory, don't ask.
- Don't ask where to put .spl file if only 1 choice exists.
- Always download .sug file, don't ask.
- Use blackhole register for :delete and :g//d.
- Formatting: expand tabs.
2016-04-10 04:27:25 -04:00
1bf1ffc734 Merge pull request #4505 from watiko/vim-runtimes
vim-patch:86ae720,f913281,dd1616e
2016-04-10 01:43:07 -04:00
bf2c2b34cf Merge pull request #4357 from jbradaric/vim-7.4.1105
vim-patch:7.4.1105
2016-04-09 14:14:55 -04:00
d227c843bf complete: noinsert/noselect should not set 'modified'. #4509 2016-04-09 13:36:37 -04:00
5330aa104b doc: formatting #4543 2016-04-08 18:01:07 -04:00
2df8f88b3c doc: Fix tiny typo in :bufdo section
[ci skip]
2016-04-08 17:58:14 -04:00
d44b2c9483 Merge pull request #4546 from KillTheMule/vim-patch-sh
vim-patch.sh: Fetch the whole vim repository and fix a regexp
2016-04-08 17:50:54 -04:00
e605faaa2f version bump 2016-04-08 17:26:07 -04:00
7cdbf3f97a vim-patch.sh: Fetch the whole vim repository and fix a regexp
Make get_vim_sources fetch the whole repository (it's not THAT big) so we can
pick up all the patches. The regexp didn't pick up the NA patches if there was a
comma after NA, so I extended it (I allowed arbitray things after NA, so maybe
someone can write a comment or so, should not lead to confusion).
2016-04-08 20:13:24 +02:00
f4f80a238b NVIM v0.1.3
Features:
  f2ae5a9 Add TextYankPost and TextDeletePost autocmds
  44b2cef bufhl: new mechanism for plugins to add highlights to a buffer
  39c3842 Make set{qf,loc}list() take {title}
  77a7ca4 'shortmess': Add "F" flag. #4446
  99d4c8c keymap: Support <D-...> (super/command key).

Fixes:
  14c9b30 terminal.c: temporary fix for incorrect paste handling

Notable changes:
  50e129f defaults: Enable syntax and filetype plugins.
  4e39eee upgrade libvterm (improves terminal reflow)
2016-04-07 22:04:21 -04:00
90e8bdc898 Update ISSUE_TEMPLATE.md
[ci skip]
2016-04-06 21:23:25 -04:00
666714f74f Merge pull request #4477 from Antoine-H/master
Fixed some Wconversion in charset.c
2016-04-06 15:33:57 +02:00
52a830fec6 Enabled -Wconversion in charset.c 2016-04-06 13:32:02 +00:00
47d44e00a2 Merge pull request #4269 from cacplate/pr-3667
buffer.c: change return type to bool (adoption of #3667)
2016-04-04 11:22:28 +02:00
c54ccfbb52 Merge pull request #4508 from Xerkus/hotfix/remote-plugins-wrong-condition
Fix condition for lazy loading remote plugins defintions
2016-04-03 19:20:46 -05:00
55844eee10 buffer.c: change return type to bool
Co-authored-by: Wayne Rowcliffe (@war1025)
2016-04-03 15:39:33 -04:00
c8d830e896 Merge pull request #4519 from Shougo/vim-7.4.1425
vim-patch:7.4.1425
2016-04-02 15:14:00 +02:00
1a9be28c75 vim-patch:7.4.1425
Problem:    There are still references to MS-DOS support.
Solution:   Remove most of the help txt and install instructions. (Ken Takata)

6e722e2f94
2016-04-02 11:24:23 +09:00
28d3def5b0 Merge pull request #4083 from bfredl/oob
api/buffer: add get/set_lines with more flexible out-of-bounds handling and deprecate the line_slice functions
2016-04-01 16:56:30 +02:00
6eda7c0e5f api/buffer: deprecate old line and line slice functions 2016-04-01 11:30:00 +02:00
8eb8ebf905 tests: update tests to use [gs]et_lines instead of [gs]et_line_slice 2016-04-01 11:29:51 +02:00
f3645e422f api/buffer: add tests for buffer_[gs]et_lines 2016-04-01 11:29:51 +02:00
51c7818d42 api/buffer: introduce buffer_[gs]et_lines with new indexing convention.
-1 is index past the end, and -2 is the index of the last element.
This eliminates the need for include_start/include_end.

Allow the handling of out-of-bounds to be configurable.
2016-04-01 11:29:51 +02:00
b8643f69c1 Merge PR #4492 'vim-patch:7.4.{1641,1643,1652,1654}' 2016-03-31 19:22:38 -03:00
4b8f27338f Merge pull request #4510 from bfredl/termfix
terminal.c: temporary fix for incorrect paste handling
2016-03-31 11:43:02 -07:00
14c9b30f2e terminal.c: temporary fix for incorrect paste handling 2016-03-31 15:14:25 +02:00
6e8757255e rplugin: Fix wrong condition for lazy loading remote plugins 2016-03-31 08:58:22 +10:00
7558f42f7d vim-patch:7.4.1654
Problem:    Crash when using expand('%:S') in a buffer without a name.
Solution:   Don't set a NUL. (James McCoy, closes vim/vim#714)

52c6eaffd4
2016-03-30 08:30:35 -04:00
62c0d99474 vim-patch:7.4.1652
Problem:    Old style test for fnamemodify().
Solution:   Turn it into a new style test.

610cc1b9b3
2016-03-30 08:30:35 -04:00
e4d1bf7177 vim-patch:7.4.1643
Problem:    Terminating file name has side effects.
Solution:   Restore the character. (mostly by James McCoy, closes vim/vim#713)

d4caf5c16a
2016-03-30 08:30:35 -04:00
5f0c76b243 vim-patch:7.4.1641
Problem:    Using unterminated string.
Solution:   Add NUL before calling vim_strsave_shellescape(). (James McCoy)

5ca84ce4aa
2016-03-30 08:30:35 -04:00
a9e0d734d7 Merge pull request #4441 from cacplate/pr-2842 2016-03-29 16:28:18 -03:00
beccc3e3a1 vim-patch:dd1616e
Correct optwin script, update PHP complete.

dd1616e6ce
2016-03-29 23:05:51 +09:00
15b5bb038b vim-patch:f913281
Updated and new runtime files.

f91328100d
2016-03-29 21:58:28 +09:00
ce832238c8 vim-patch:86ae720
Updated runtime files.

86ae720d75
2016-03-29 21:41:37 +09:00
06b40d31c1 path.c: enable -Wconversion 2016-03-27 23:42:39 -04:00
ae686092f8 Correctly reset qf_list_T in qf_free() 2016-03-25 00:04:13 +09:00
2e2b5759cf Merge pull request #4480 from migueldvb/docs
doc: Update path to colors directory in syntax highlighting docs
2016-03-20 21:31:58 -04:00
075f84cbea Update path to colors directory in syntax highlighting docs 2016-03-20 21:22:51 -04:00
5730ad9376 Merge pull request #4461 from bfredl/pum_k_event
K_EVENT should not hide the popupmenu
2016-03-18 16:39:57 -04:00
cfcc6be73e Merge pull request #4456 from jamessan/sorted-globs
cmake: Create generated files in a consistent order
2016-03-18 16:26:32 -04:00
d61b576940 Merge pull request #4459 from fflorent/vim-7.4.1574
vim-patch:7.4.1574
2016-03-18 12:34:45 -04:00
df15f97889 vim-patch:7.4.1574
Problem:    ":undo 0" does not work. (Florent Fayolle)
Solution:   Make it undo all the way. (closes vim/vim#688)

d22e9465f6
2016-03-18 13:11:44 +01:00
5aa0159f01 edit.c: K_EVENT should not hide the popupmenu
Nor should K_FOCUSGAINED and K_FOCUSLOST.
2016-03-17 13:26:51 +01:00
6b22a742c7 Merge pull request #4431 from philix/memfile-cleanups
Review of the memfile.c API and small refactorings
2016-03-17 00:36:22 -04:00
d7511f5cde Merge #4446 2016-03-17 00:23:38 -04:00
5a9d3be54c test: minor changes 2016-03-17 00:21:48 -04:00
77a7ca458b 'shortmess': Add "F" flag. #4446
Add "Don't give the file editing message" flag in shortmess option.

Add the UI tests by @fmoralesc
Fix the changes for Vim 7.4.1570
2016-03-17 00:07:38 -04:00
3e85aee48c Review of the memfile.c API and small refactorings
- Create `mf_free_fnames()` that frees and nullifies `mf_[f]fname`
- Create `mf_set_fnames()` to set the `mf_fname` and the `mf_ffname`
  altoghether
- Have `mf_do_open` return a bool to indicate success so that calles
	don't have to check `memfile_T::mf_fd` (file descriptor)
- Inline `mf_write_block`
2016-03-16 19:12:00 -03:00
f3ac99b72d cmake: Create generated files in a consistent order 2016-03-15 14:24:38 -04:00
c94575fded Merge pull request #4418 from bfredl/remove_script_host
python: remove script_host.py that now is in neovim/python-client
2016-03-15 13:31:36 +01:00
89bb5a8ab8 python: move script_host.py to python-client 2016-03-15 12:32:18 +01:00
e7a9c006e1 Merge pull request #4168 from noahfrederick/patch-1
man.vim: parse page names containing dash or dot
2016-03-13 14:48:45 -04:00
b030c90506 Merge pull request #4440 from djrenren/nvim-in-macros
Replace vim with nvim in macros
2016-03-11 18:22:02 -05:00
ffaaf5df31 runtime/macros: replace "vim" with "nvim" 2016-03-11 16:37:25 -05:00
66a75fb835 Merge pull request #4410 from alexgenco/ruby_rplugin
Ruby remote plugin support
2016-03-11 12:33:41 -05:00
26d189e9a1 Merge pull request #4438 from bfredl/pyfindpackage
rplugin: let the python host identify packages
2016-03-11 16:56:33 +01:00
6c4d3362c5 rplugin: let the python host identify packages 2016-03-11 11:31:09 +01:00
1c066e671d rplugin: Silence :doautocmd. #4384 2016-03-11 01:22:41 -05:00
3cb9970acf Ruby remote plugin support 2016-03-10 19:01:44 -08:00
662eea8287 quickfix.c: enable -Wconversion 2016-03-10 14:24:37 -05:00
bb020df0f5 rplugin: Initialize remote plugins lazily. #4384 2016-03-10 10:34:57 -05:00
e7485ab1c9 Merge pull request #2877 from lucc/test88
test: Migrate legacy test 88.
2016-03-10 10:16:44 -05:00
316d38d98c tests: Update migrated legacy test 88 for patch 7.4.639.
The patch was merged into master at d25a59f4.
2016-03-09 23:55:16 +01:00
925c020a1b tests: Modernize legacy test 88. 2016-03-09 23:55:13 +01:00
87c208a43f tests: Migrate legacy test 88. 2016-03-09 23:54:26 +01:00
d9ecd06627 build: Specify old behavior for POLICY CMP0059.
This is needed as long as we support cmake older than 2.8.12. When we
bump the minimum version to 2.8.12, we can use target_compile_options()
and add_compile_options() instead.

Closes #4389
2016-03-09 10:25:45 -05:00
de33c9f005 Merge pull request #4409 from nhooyr/master
complete: disable folding when completing
2016-03-09 10:15:01 -05:00
0b468fd0cf complete: disable folding when completing
Fixes vim/vim#643
2016-03-09 10:04:15 -05:00
a40a4e2431 Merge pull request #4427 from nicdumz/vim-7.4.1511
vim-patch:7.4.1511
2016-03-09 01:33:14 -05:00
7bd570cd9a vim-patch:7.4.1511
Problem:    Statusline highlighting is sometimes wrong.
Solution:   Check for Highlight type. (Christian Brabandt)

af6e36ff16
2016-03-08 17:11:27 +01:00
890ce792af Merge pull request #4356 from watiko/fix-hi-normal-adjast
syntax.c: Avoid the 'background' adjustment when true color enabled
2016-03-08 09:46:57 -05:00
0e15d1cefa syntax.c: Avoid the 'background' adjustment when true color enabled 2016-03-08 21:16:04 +09:00
37b3a4c607 Merge PR #4423 'Make functional tests compatible with lua' 2016-03-07 15:20:16 -03:00
6674930d7c Add travis build for lua functionaltest 2016-03-07 14:38:46 -03:00
646ab30858 Add Lua 5.1 as a third party dep
Also add a functionaltest-lua target to run the functional tests using the lua
interpreter and corresponding helper to top-level Makefile
2016-03-07 14:38:39 -03:00
96af115c71 Normalize nan/-nan in plugin/msgpack_spec.lua
-NaN doesn't exist in the IEEE 754 spec, it is a hardware-specific detail
abstracted away by luajit(and not by lua or nvim), so there's no need to test
it.  Normalize all tests that involve -nan so the suite will be compatible with
both Lua and Luajit.
2016-03-07 13:08:48 -03:00
34a1bc1a46 Remove goto statement in lua code.
`goto` is another luajit extension not compatible with 5.1.
2016-03-07 03:58:35 -03:00
c6ec148f2d Rewrite hexadecimal escape sequences as decimal in lua strings
The hexadecimal notation is a Luajit extension which is not compatible with Lua
5.1. While Lua 5.2 does support hexadecimal sequences, it is better to target
Lua 5.1 for maximum compatibility with Luajit(which has fully compatible with
5.1 API/ABI).
2016-03-07 03:58:35 -03:00
35d8d10a6a Remove dependency on ffi module 2016-03-07 03:58:29 -03:00
bd81239f2f Merge pull request #4324 from watiko/vim-7.4.973
vim-patch:7.4.973
2016-03-05 18:00:08 -05:00
1895f6ffab Merge pull request #4415 from oni-link/fix.leak
ex_eval: Fix memory leak
2016-03-05 15:05:44 -05:00
2ea02ff635 ex_eval: Fix memory leak
Parameter should_free, indicating that the caller has to  free the
returned pointer from get_exception_string(), is not set to true if
type == ET_ERROR.
2016-03-05 20:46:59 +01:00
6d2ed7c0eb tests: Migrate legacy test tagcase 2016-03-06 00:32:58 +09:00
07cc1aaae2 vim-patch:7.4.957
Problem:    Test_tagcase fails when using another language than English.
Solution:   Set the messages language to C. (Kenichi Ito)

bc96c29ffc
2016-03-06 00:32:58 +09:00
755d4e82b1 vim-patch:7.4.942
Problem:    test_tagcase breaks for small builds.
Solution:   Bail out of the test early. (Hirohito Higashi)

60422e68a3
2016-03-06 00:32:39 +09:00
2ac9a3905c buffer_defs.h: Fix lint errors 2016-03-06 00:32:39 +09:00
c78aeb0d46 vim-patch:7.4.941
Problem:    There is no way to ignore case only for tag searches.
Solution:   Add the 'tagcase' option. (Gary Johnson)

0f6562e903
2016-03-06 00:32:39 +09:00
3d9e9a92cf vim-patch:7.4.973
Problem:    When pasting on the command line line breaks result in literal
            <CR> characters. This makes pasting a long file name difficult.
Solution:   Skip the characters.

6f62fed349
2016-03-06 00:03:46 +09:00
43456e43de ex_getln.c: Enable middle click pasting in command mode 2016-03-06 00:03:46 +09:00
091ef2fbe4 man.vim: prefer cmd-line to normal-mode commands 2016-03-05 09:12:54 -05:00
42e710eacb man.vim: clean up regex/string comparisons
- Explicitly specify case sensitivity when comparing strings
- Clean up unnecessarily complex `if` statements
2016-03-05 09:12:54 -05:00
9fb9d2929f man.vim: fixes to argument handling and parsing
- Define a collection of legal characters when parsing page and section
  in `s:parse_page_and_section()` instead of relying on 'iskeyword',
  which is unreliable.
- Allow non-numeric section names (e.g., `3c`).
- Simplify argument handling in `man#get_page()` to accommodate
  non-numeric section names.

Fixes #4165.
2016-03-05 09:12:54 -05:00
0e9f7a7b36 Merge pull request #4412 from justinmk/libvterm
deps: upgrade libvterm
2016-03-04 20:46:52 -05:00
4e39eee13c deps: upgrade libvterm
New feature: `VTermState->mode.bracketpaste`
  Enabled by default, but note that `vterm_state_reset()` disables it.
  03981def6b
References #3476

New feature: `vterm_state_set_unrecognised_fallbacks`
  acf7f19713

Oh, and terminal reflow works now.
Closes #2514 (but not #3864, that's a bit more tricky)
2016-03-04 20:13:46 -05:00
8991b4b095 Merge pull request #4320 from watiko/vim-7.4.958
vim-patch:7.4.958
2016-03-04 13:12:59 -05:00
c2c180fbb3 Merge pull request #4401 from mhinz/help-term-startinsert
Doc: autocmd for always switching to insert mode (:term)
2016-03-04 10:09:04 -05:00
03fe4ad9b1 Doc: switch to terminal mode automatically 2016-03-04 12:55:59 +01:00
ed1925e0d1 Lint: fix line length >80
Introduced here:

4bfac00aa3 (diff-2bf87eef9f7b99dcea4b0c55beee2d63R78)
2016-03-04 12:23:21 +01:00
c3b6cd300f Merge pull request #4402 from jbradaric/vim-7.4.1141
vim-patch:7.4.1141
2016-03-03 23:39:58 -05:00
fb4655beb1 Merge pull request #4390 from justinmk/clangformat
clang-format configuration
2016-03-03 23:37:18 -05:00
4bfac00aa3 Windows: XDG: Update default paths. #4403
The previous defaults were including the nvim suffix, causing it to
apear twice in the final paths.

kXDGDataHome and kXDGConfigHome are now set as %LOCALAPPDATA%,
kXDGCacheHome is set as $TEMP.

In Windows there is no distinction between configuration and data
storage, but we don't want to place all files under the same path.
get_xdg_home() now appends a different path suffix for kXDGDataHome.

- Configuration files are saved under %LOCALAPPDATA%\nvim
- Data files are saved under %LOCALAPPDATA%\nvim-data
2016-03-03 23:26:11 -05:00
75fbc23ead vim-patch:7.4.1141
Problem:    Using searchpair() with a skip expression that uses syntax
            highlighting sometimes doesn't work. (David Fishburn)
Solution:   Reset next_match_idx. (Christian Brabandt)

6773a348da
2016-03-03 22:34:26 +01:00
c6df1b387c clang-format configuration
Recommend by oni-link at:
https://github.com/neovim/neovim/pull/487#issuecomment-39935391
2016-03-02 23:56:38 -05:00
32238018e4 Merge PR #4375 'Proper type checking for set{qf,loc}list()' 2016-03-02 15:55:58 +01:00
67eeb8a798 Tests: check error messages from set{qf,loc}list() 2016-03-02 15:09:39 +01:00
53aa569918 Proper type checking for set{qf,loc}list()
Prior to this change, type errors were silently ignored. They're explicit now.

  setqflist(list, action, title)
  setloclist(win, list, action, title)

"list" (required) must be a list.
"action" (optional) must a string.
"title" (optional) must a string or number that gets converted to a string.

An error is thrown otherwise.
2016-03-02 15:06:37 +01:00
5ef3e40b37 edit.c: change return type to bool
Co-authored-by: Wayne Rowcliffe (@war1025)
2016-03-02 08:37:19 -05:00
9d1e076056 Merge PR #4388 'Clean up tests' 2016-03-02 12:37:58 +01:00
a528d56ba0 Tests: add autocmd_spec.lua 2016-03-02 12:37:50 +01:00
d9e631f1b5 Tests: clean up tabnew_spec.lua 2016-03-02 12:37:50 +01:00
1addc45e78 test: Remove migrated legacy test from Makefile 2016-03-02 17:32:24 +09:00
29a1807de8 tests: Migrate legacy test sort 2016-03-02 17:32:24 +09:00
04ff218c16 vim-patch:7.4.1144
Problem:    Can't build on several systems.
Solution:   Include float.h. (Christian Robinson, closes vim/vim#570 vim/vim#571)

17576a1e33
2016-03-02 17:32:24 +09:00
313810ccad vim-patch:7.4.1143
Problem:    Can't sort on floating point numbers.
Solution:   Add the "f" flag to ":sort".  (Alex Jakushev)  Also add the "f"
            flag to sort().

f7edf40448
2016-03-02 17:32:24 +09:00
f6dca79f3a vim-patch:7.4.951
Problem:    Sorting number strings does not work as expected. (Luc Hermitte)
Solution:   Add the 'N" argument to sort()

b00da1d6d1
2016-03-02 17:32:24 +09:00
9e3ebb6711 vim-patch:7.4.1093
Problem:    Typo in test goes unnoticed.
Solution:   Fix the typo. Give error for wrong arguments to cursor().
            (partly by Hirohito Higashi) Add a test for cursor().

24c4d539ee
2016-03-02 16:41:53 +09:00
d5904160d7 tests: Migrate legacy test searchpos 2016-03-02 16:41:09 +09:00
4d5d76c086 vim-patch:7.4.984
Problem:    searchpos() always starts searching in the first column, which is
            not what some people expect. (Brett Stahlman)
Solution:   Add the 'z' flag: start at the specified column.

ad4d8a192a
2016-03-02 16:29:21 +09:00
55c0621ff3 vim-patch:7.4.958
Problem:    Vim checks if the directory "$TMPDIR" exists.
Solution:   Do not check if the name starts with "$".

e1a61991d9

---

see: "$TMPDIR bug"
     https://groups.google.com/d/msg/vim_dev/UWjbjOf9tEY/wfwnkh41AwAJ
2016-03-02 15:51:39 +09:00
576c5f7b74 Merge pull request #4323 from watiko/vim-7.4.961
vim-patch:7.4.961
2016-03-02 01:48:21 -05:00
badf227e6f Merge pull request #4319 from watiko/vim-7.4.952
vim-patch:7.4.952
2016-03-02 01:31:45 -05:00
56bfdd7934 Merge #4265 'vim-patch:7.4.925'. 2016-03-02 01:24:38 -05:00
36cb847d09 Merge #4231 'vim-patch:7.4.857'. 2016-03-02 01:08:38 -05:00
be7d6ba6c1 Trigger TabNew before TabEnter 2016-03-01 21:52:37 +01:00
c00da817c4 Merge PR #3657 'Correct max numbers of args for some functions' 2016-03-01 18:06:35 +01:00
6bfd88dec1 Tests: add function_spec.lua 2016-03-01 17:07:18 +01:00
e76bc505e9 Correct max numbers of args for some functions
Closes #3650.
2016-03-01 17:06:59 +01:00
b16b27a1be Fix guessing incorrect color index in terminal
This should fix issue #2323
2016-03-01 13:55:39 +01:00
2ee37cc285 Fix :%s/\n//
Fixes #4352.
2016-03-01 02:06:05 +01:00
888b8abeb0 Doc: make definitions jumpable
References #3640.
2016-02-29 16:33:39 +01:00
1dd986562f Merge pull request #4304 from bfredl/yank
Add v:event variable and TextYankPost autocommand
2016-02-29 16:09:28 +01:00
e17e5547d7 clint.py: a function name starting with for is not a for statement 2016-02-29 16:07:50 +01:00
c1487b9685 ops.c: breakout shared register type formatting code 2016-02-29 16:07:50 +01:00
2359f6f144 TextYankPost: add information to v:event and update tests 2016-02-29 16:07:50 +01:00
7ab9ff88e6 eval: add v:event, which will contain data events want to propagate to their receivers.
Add helper functions dict_clear and dict_set_keys_readonly.
2016-02-29 16:06:41 +01:00
88da85a3cd Tests: fix according to lualint 2016-02-29 13:48:59 +01:00
f2ae5a9cc0 Add TextYankPost and TextDeletePost autocmds
Reviewed by @watiko

Ported from de53ab72c8
2016-02-29 13:21:59 +01:00
9c4b34be28 Merge pull request #4373 from justinmk/qfcrash
qf_fill_buffer: Avoid buffer overflow.
2016-02-28 20:15:02 -05:00
0c5f74ae4d coverity/56808: STRING_OVERFLOW
This was caught by FORTIFY_SOURCE (and coverity).

Fixes #4371
2016-02-28 19:19:34 -05:00
0c2ba7554f Merge pull request #3900 from ZyX-I/inf-nan-string
Make it possible to eval() all floating-point values dumped by string()
2016-02-28 11:48:54 -05:00
8ade191b7a Merge pull request #4364 from ZyX-I/proper-e-term
Replace hack used to run TermOpen with nested modifier
2016-02-28 11:46:04 -05:00
9d41060c32 Merge pull request #4289 from phanimahesh/refactor/wconversion/ex_cmds2.c
Enable -Wconversion for ex_cmds2.c
2016-02-28 11:21:21 +01:00
de7165d351 eval: Update documentation.
Extracted from vim-patch:da440d21a6b94d7f525fa7be9b1417c78dd9aa4c
2016-02-28 10:38:45 +01:00
ZyX
0409cfded5 functests: Improve screen:expect error reporting 2016-02-28 08:15:52 +03:00
ZyX
a16d4a2b62 functests: Make test more robust 2016-02-28 08:12:55 +03:00
ZyX
712f057ed9 functests: Make sure that setting scrollback size works from TermOpen 2016-02-28 07:34:36 +03:00
ZyX
92d4dfdca5 ci: Disable -Wc11-extensions on FreeBSD
Closes #4363.
2016-02-28 06:58:47 +03:00
ZyX
c6eeefa339 main: Move term:// protocol name to a macros 2016-02-28 06:29:38 +03:00
ZyX
b32396170f main: Make using :edit term:// run TermOpen event
Ref #4306
2016-02-28 04:54:23 +03:00
ZyX
a1493215a2 Revert "Merge pull request #4362 from justinmk/termopen"
This reverts commit b01db02de4, reversing
changes made to 62321e5132.
2016-02-28 04:34:27 +03:00
b01db02de4 Merge pull request #4362 from justinmk/termopen
term: publish TermOpen in "e term://" handler.
2016-02-27 19:08:41 -05:00
62321e5132 Merge pull request #4358 from jbradaric/vim-7.4.1112
vim-patch:7.4.1112
2016-02-27 19:08:28 -05:00
ba1348edc5 Merge pull request #4361 from watiko/vim-nas
version.c: Mark vim-patches NA
2016-02-27 18:25:53 -05:00
0f604e1da2 version.c: Mark vim-patches NA
NA patch list:
  892: (MS-Win, iconv)
       9d6ca1cc5e

  904: ({,g}vim.desktop)
       6407b3e80d
       1d8d9c0bec
       vim-patch:1d8d9c0bec84ac799a2f62a5ac81eade3eaf638a

  905: (if_py_both)
       d424747d58

  909: (src/Makefile)
       de59ba33aa

  914: (src/term.c, logical-not-parentheses)
       98b30a473a

  943: (src/testdir/Makefile, test_writefile)
       48a969b488

  947: (src/testdir/Make_ming.mak, Test_listchars)
       5311c02f25

  956: (empty) Missing parts are in other runtime comitts.
       f882d9f89d

  969: (cast) HAVE_AVAIL_MEM was removed.
       35be4534c0

  993: (if_py_both)
       52f6ae1366

Already merged patch list:
  vim-patch:35e7594dd429f7a8a06cefd61c3e8d48b9bd74e2
  vim-patch:44132a10aeb45c957959cafb4ac39d3f478be98c
  vim-patch:974
2016-02-28 05:42:41 +09:00
2af36df86d eval: Fix linter error. 2016-02-27 19:05:30 +01:00
8d5e60d8af vim-patch:7.4.1112
Problem:    When using ":next" with an illegal file name no error is reported.
Solution:   Give an error message.

2db5c3b3ce
2016-02-27 18:47:04 +01:00
2ab9e96742 ex_cmds2.c:style: silence clint after -Wconversion changes
use ///< to document all struct and enum fields
2016-02-27 23:08:41 +05:30
a6d0e3696c enable -Wconversion for ex_cmds2.c 2016-02-27 23:08:29 +05:30
11cf3680e4 vim-patch:7.4.1105
Problem:    When using slices there is a mixup of variable name and namespace.
Solution:   Recognize variables that can't be a namespace. (Hirohito Higashi)

9bbf63dbf8
2016-02-27 18:29:16 +01:00
3e0fab6b7c Merge pull request #4332 from Jun-T/editorconfig
.editorconfig
2016-02-27 10:42:53 -05:00
b6170db1a1 Avoid internal errors with setloclist()
All syntastic users experienced this problem:

  E685: Internal error: get_tv_string_buf()

It's reproducable with:

  :call setloclist(0, [''])

So, not given optional arguments to setloclist() lead to some fields not
inizilied and the code took the wrong branches.
2016-02-26 18:52:17 +01:00
23f8696317 Merge pull request #4277 from Jun-T/lang2locale
build: install *.mo into the "standard" directory
2016-02-26 10:24:48 -05:00
1e7c6380fe tests: Migrate legacy test breakindent. 2016-02-25 17:15:09 +01:00
bb56564900 Merge pull request #4335 from HarmtH/update-doc
Correct documention on order autocmds
2016-02-25 10:36:51 -05:00
1abad9978f Merge pull request #4274 from DarkDefender/patch-1
Adjust terminal text color if it is bold
2016-02-25 10:35:04 -05:00
79d30bab54 Merge pull request #4346 from bfredl/minilint
build system: allow linting a single file and revert #4216
2016-02-25 10:24:52 -05:00
3402d07abe Merge PR #4337 'Make set{qf,loc}list() take {title}' 2016-02-25 13:15:33 +01:00
97324c96a4 Tests: add errorlist_spec.lua 2016-02-25 12:50:17 +01:00
39c3842621 Make set{qf,loc}list() take {title}
Add an extra argument to these functions to set w:quickfix_title.

This is a modified version of a patch from vim_dev. Discussion here:

  https://groups.google.com/forum/#!topic/vim_dev/X7VVPd4Do5s

Credits go to Christian "chrisbra" Brabandt and Daniel "blueyed" Hahler.
2016-02-25 12:50:12 +01:00
281a9b2cea Revert "build system: avoid more unneccesary recompiles"
This was not the correct way to fix the issue.
2016-02-25 11:36:56 +01:00
5c1597cad1 cmake: allow linting a specific file
For instance to only lint "edit.c"
make lint LINT_FILE="src/nvim/edit.c"
2016-02-25 11:31:34 +01:00
2ced866925 tests: Migrate legacy test 68. 2016-02-24 22:21:25 +01:00
8160e875a0 Merge pull request #4339 from philix/fix-undo-diagram
Fix the ASCII-art diagram in undo.c
2016-02-24 08:55:07 -05:00
78ded07954 Fix the ASCII-art diagram in undo.c
Set \t to 8 spaces and `retab`.
2016-02-24 02:14:23 -03:00
9a3b7fa906 Tests: fix according to lualint 2016-02-24 01:42:38 +01:00
72d9d5e917 term: publish TermOpen in "e term://" handler.
After 87a49405b0, terminal_open() is not
nested by default. The default "term://" handler depended on that, but
it should instead explicitly raise TermOpen.

References #4306
2016-02-23 19:10:54 -05:00
b10c9b4f5b Merge pull request #1817 from bfredl/bufmatch
support buffer-associated highlighting by external plugins
2016-02-23 23:32:21 +01:00
2a4ea9a546 docs: start api docs and document highlight mechanism 2016-02-23 21:29:02 +01:00
3b1800be94 bufhl: fix unittests and lint
msgpack_rpc_dispatch doesn't exist anymore
2016-02-23 21:29:02 +01:00
06b9d2a6f2 bufhl: add tests for adding and clearing highlights 2016-02-23 21:29:01 +01:00
44b2cef83a bufhl: new mechanism for plugins to add highlights to a buffer 2016-02-23 21:29:01 +01:00
18605d6785 Merge pull request #4327 from ffleming/coverity-71530
coverity/71530: Prefer STRLCPY to STRCPY in option.c
2016-02-23 14:51:41 -05:00
b25dfecb18 Merge pull request #4329 from justinmk/libuv
Update to libuv 1.8.0
2016-02-23 14:37:48 -05:00
5993a38ba3 Merge pull request #4064 from oni-link/cs_print_tags_priv
Fix some problems with cs_print_tags_priv()
2016-02-23 14:36:40 -05:00
7feef42e8a coverity/71530: Prefer STRLCPY to STRCPY in option.c
Addresses Coverity CID 71530

Prefer sizeof(NameBuff)

Add braces for Travis lint

Break long line

Properly align parameters in multi-line function call
2016-02-23 08:27:27 -08:00
564f57d1e5 Fix terminal true color bold colors
Now the terminal should also correctly output true color codes
2016-02-23 16:15:47 +01:00
f57b9c57df Correct documention on order autocmds
The order of executed autocmds TabEnter and WinEnter is wrongly stated
in the documentation. TabEnter is executed after WinEnter.
2016-02-23 12:24:43 +01:00
47b5294b0f Merge pull request #4330 from justinmk/set_vim_var_dict
set_vim_var_dict: Allow NULL `val`.
2016-02-23 04:27:52 -05:00
ac1f941edb add .editorconfig 2016-02-23 18:03:27 +09:00
5c09d5c3de set_vim_var_dict: Allow NULL val.
Closes #3006
2016-02-23 02:56:40 -05:00
6f833c7881 Merge pull request #4328 from justinmk/coverity
coverity/71532: STRING_OVERFLOW
2016-02-23 00:13:13 -05:00
1a15cf84c2 build: install *.mo into the "standard" directory
Change POROJECT_NAME to 'nvim', and use it as the gettext
domain name. The *.mo files, previously installed as
$runtime/lang/xx/LC_MESSAGES/nvim.mo, are now installed as
$prefix/locale/xx/LC_MESSAGES/nvim.mo.
2016-02-23 13:39:56 +09:00
62cf44b8ab Update to libuv 1.8.0 2016-02-22 19:28:52 -05:00
9b99cf4a6e coverity/71532: STRING_OVERFLOW 2016-02-22 19:16:55 -05:00
37d6004251 Merge pull request #4315 from justinmk/compl_flicker
completion: Avoid flicker
2016-02-22 14:05:33 -05:00
63606bb409 vim-patch:7.4.961
Problem:    Test107 fails in some circunstances.
Solution:   When using "zt", "zb" and "z=" recompute the fraction.

9dc2ce398b
2016-02-23 01:19:10 +09:00
c8b574f749 ins_complete: Avoid semi-global state. 2016-02-22 10:00:05 -05:00
faf828b476 Merge pull request #4318 from lucc/legacy_test_makefile
test: Reformat legacy test makefile.
2016-02-22 09:13:40 -05:00
f0add77de5 vim-patch:7.4.952
Problem:    'lispwords' is tested in the old way.
Solution:   Make a new style test for 'lispwords'.

6cd1345307
2016-02-22 22:47:18 +09:00
94b1403ad5 test: Reformat legacy test makefile.
This will hopefully reduce the number of merge conflicts when merging the
outstanding legacy test migrations.
2016-02-22 13:02:41 +01:00
e71de26aba Merge pull request #4317 from justinmk/superkey
keymap: Support <D-...> (super/command key).
2016-02-22 04:25:34 -05:00
99d4c8c29c keymap: Support <D-...> (super/command key).
Adds support for:
  - api:vim_input("<D-a>")
  - ":nnoremap <C-D-S-...>" and permutations thereof

UIs must capture the modifier and send it as "<D-...>" to vim_input().

Note: Before this commit, any arbitrary ":nnoremap <{foo}-{bar}>"
mapping could already be invoked with feedkeys("\<{foo}-{bar}>"). This
commit supports "D-" as a modifier that can be combined with "C-", "A-",
"S-" in any order.

For non-GUI (terminal) support, user must:
  :set <D-a>={CSI sequence}
then send the {CSI sequence} from their terminal. But this does not work
yet (regression #2204).

Closes #2190
2016-02-22 02:41:40 -05:00
9403ce82bc vim-patch:7.4.936 #4271
Problem:    Crash when dragging with the mouse.
Solution:   Add safety check for NULL pointer. Check mouse position for valid
            value. (Hirohito Higashi)

294a7e55b0

---

see: "Crash while mouse-selecting in two-buffer mode"
     https://github.com/vim/vim/issues/486

Fix #3704
2016-02-22 01:12:47 -05:00
bfe9ebcbe1 Merge pull request #4272 from watiko/vim-7.4.937
vim-patch:7.4.937
2016-02-22 01:11:42 -05:00
95230ec702 Merge pull request #4267 from watiko/vim-7.4.932
vim-patch:7.4.{926,932,933}
2016-02-22 01:10:50 -05:00
44179d7444 Merge pull request #4263 from watiko/vim-7.4.901
vim-patch:7.4.901
2016-02-22 01:03:51 -05:00
73676ad37b Merge pull request #4262 from watiko/vim-7.4.893
vim-patch:7.4.{891,893,912}
2016-02-22 01:02:18 -05:00
2eb09c826d vim-patch:7.4.878 #4258
Problem:    Coverity error for clearing only one byte of struct.
Solution:   Clear the whole struct. (Dominique Pelle)

69b67f7e77
2016-02-22 00:51:13 -05:00
2f98888db6 Merge pull request #4310 from jbradaric/vim-7.4.939
vim-patch:7.4.939
2016-02-22 00:48:54 -05:00
f08fd41282 Merge pull request #4250 from jbradaric/vim-7.4.895
vim-patch:7.4.895
2016-02-22 00:45:51 -05:00
9e00724c38 Merge pull request #4307 from jbradaric/vim-7.4.870
vim-patch:7.4.870
2016-02-22 00:41:55 -05:00
609dad3799 Revert "Enable link-time optimisations on Release build."
This reverts commit 1132b67b5b.
See https://github.com/neovim/neovim/pull/4313#discussion_r53570725
2016-02-22 00:37:16 -05:00
d9291954b9 Merge pull request #4259 from watiko/vim-7.4.881
vim-patch:7.4.{879,881}
2016-02-22 00:34:24 -05:00
6395dd64a4 Merge pull request #4167 from lucc/test11
tests: migrate legacy test 11
2016-02-21 23:49:36 -05:00
dd4b661dbd Merge pull request #4243 from lucc/test36
tests: Migrate legacy test 36.
2016-02-21 23:47:15 -05:00
d92db14241 completion: Avoid flicker. 2016-02-21 15:58:38 -05:00
d4778104b5 Merge pull request #4079 from fwalch/vim-patch/review-improvements
vim-patch.sh: Improvements for review functionality, submission option.
2016-02-21 15:33:21 -05:00
44166a150c Merge pull request #4314 from justinmk/mksession_terminal
mksession: Restore buftype=terminal windows.
2016-02-21 15:22:05 -05:00
81b68b0af3 Merge pull request #4247 from watiko/vim-7.4.903
vim-patch:7.4.{831,832,845,903}
2016-02-21 15:21:53 -05:00
4bd848f24f mksession: Restore buftype=terminal windows.
Closes #4311
2016-02-21 14:42:31 -05:00
ZyX
90cbd70d1a documentation: Add notes to eval.txt and vim_diff.txt 2016-02-21 21:58:58 +03:00
09e4c244ee Merge pull request #4313 from Yamakaky/flto
Enable link-time optimisations on Release build.
2016-02-21 13:14:57 -05:00
1132b67b5b Enable link-time optimisations on Release build.
Fixes https://github.com/neovim/neovim/issues/3136
2016-02-21 18:33:28 +01:00
693bf1dafb path.c: Fulfill the @returns conditions
Original-author: oni-link <knil.ino@gmail.com>
2016-02-21 22:07:42 +09:00
d6c894efaf vim-patch:7.4.903
Problem:    MS-Windows: When 'encoding' differs from the current code page,
            expandinig wildcards may cause illegal memory access.
Solution:   Allocate a longer buffer. (Ken Takata)

7314efd87d
2016-02-21 22:06:39 +09:00
6bbd149e98 vim-patch:7.4.845
Problem:    Compiler warning for possible loss of data.
Solution:   Add a type cast. (Erich Ritz)

5df1ed2de3
2016-02-21 22:06:39 +09:00
6ea1047585 vim-patch:7.4.832
Problem:    $HOME in `=$HOME . '/.vimrc'` is expanded too early.
Solution:   Skip over `=expr` when expanding environment names.

be83b73ddb

---

To reproduce:

```sh
nvim -u NONE -c 'e `=$HOME . "/.vimrc"`'
```
2016-02-21 22:06:39 +09:00
c8561ecf26 vim-patch:7.4.831
Problem:    When expanding `=expr` on the command line and encountering an
            error, the command is executed anyway.
Solution:   Bail out when an error is detected.

3f188935ec
2016-02-21 22:06:23 +09:00
82293b94c3 ex_docmd: Fix code style in ex_match 2016-02-21 11:21:45 +01:00
29b393e43a vim-patch:7.4.939
Problem:    Memory leak when encountering a syntax error.
Solution:   Free the memory. (Dominique Pelle)

9a7d58e42e
2016-02-21 11:15:08 +01:00
fc51f86b72 Merge pull request #4296 from mhinz/fix-termclose
Make TermClose event return the associated buffer
2016-02-21 02:04:13 -05:00
6732f0193a Tests: check <abuf> from TermClose 2016-02-21 02:39:01 +01:00
fe8b2fabe7 Make TermClose event return the associated buffer
<abuf> from the TermClose event now returns the correct buffer number.

Prior to this change it would always return the buffer number of the current
buffer, which is obviously wrong in an async environment.
2016-02-21 02:38:55 +01:00
51055c14a6 Merge pull request #4306 from justinmk/termau
terminal_open: do not force autocmds
2016-02-20 16:02:50 -05:00
5b263ac6ad vim-patch:7.4.870
Problem:    May get into an invalid state when using getchar() in an
            expression mapping.
Solution:   Anticipate mod_mask to change. (idea by Yukihiro Nakadaira)

2455c4ede8
2016-02-20 19:15:13 +01:00
44024f2c65 Merge #4249 'tests: migrate charsearch' 2016-02-20 10:52:18 -05:00
1b8caf3d75 test: charsearch: Fix error/typo in legacy test.
Error was reported upstream in vim/vim#650, fixed in 7.4.1366.
Typo was fixed upstream in 7.4.1041.
2016-02-20 10:52:02 -05:00
4a02dc0828 tests: Remove old charset test after migration. 2016-02-20 07:57:55 +01:00
76c9bd00d0 tests: Migrate legacy charsearch test. 2016-02-20 07:53:37 +01:00
3e3db580fd Merge pull request #4298 from tomxtobin/fix-help-typo
doc: Remove stray "<" in options help
2016-02-19 23:16:17 +01:00
af67f022ca Merge pull request #4264 from watiko/vim-7.4.922
vim-patch:7.4.922
2016-02-19 22:07:46 +01:00
e87c7fcb39 Remove stray "<" in options help
Normally this would end an example, but there's no example block here.
2016-02-19 14:13:17 -05:00
00347ec781 Merge pull request #4240 from jbradaric/vim-7.4.888
vim-patch:7.4.888
2016-02-19 04:06:29 -05:00
87a49405b0 terminal_open: do not force autocmds 2016-02-19 03:03:11 -05:00
12938b82fb Merge pull request #4294 from justinmk/coverity
coverity
2016-02-19 02:38:42 -05:00
156df2c81b coverity/135593: Error handling issues (CHECKED_RETURN)
Harmless issue (HI): retval is intentionally ignored, as is the wont of
didset_options() and friends.
2016-02-19 02:00:23 -05:00
06e53aa487 coverity/135589: (FP) Null pointer dereferences
False positive: buflist_findnr() should not be NULL in this case because
it is given a buffer number that (should be) guaranteed to exist.
2016-02-19 02:00:22 -05:00
91254bd9d8 Merge pull request #4280 from mhinz/add-issue-template
Add ISSUE_TEMPLATE.md
2016-02-18 18:33:16 -05:00
a6a6f70128 Add ISSUE_TEMPLATE.md
This is a new Github feature:

  https://github.com/blog/2111-issue-and-pull-request-templates
2016-02-19 00:28:36 +01:00
f887037a8f Merge pull request #4276 from justinmk/coverity135578
coverity/135578: Memory - illegal accesses
2016-02-17 10:45:24 -05:00
0d6cd2b808 option_defs.h: Introduce SHM_ABBREVIATIONS
Helped-by: ZyX <kp-pav@yandex.ru>
2016-02-17 21:04:24 +09:00
5b63488c25 option_defs.h: Fix "set shm+=a" 2016-02-17 21:04:20 +09:00
0b67bb8c25 option_defs.h: Improve coding style 2016-02-17 21:04:20 +09:00
4612821946 vim-patch:7.4.925
Problem:    User may yank or put using the register being recorded in.
Solution:   Add the recording register in the message. (Christian Brabandt,
            closes vim/vim#470)

a0ed84a268
2016-02-17 21:04:20 +09:00
498eb02049 Merge pull request #4239 from jbradaric/vim-7.4.885
vim-patch:7.4.885
2016-02-17 04:31:21 -05:00
bd7de9dac9 vim-patch:7.4.859 #4238
Problem:    Vim doesn't recognize all htmldjango files.
Solution:   Recognize a comment. (Daniel Hahler, PR #410)

d8986fd914
2016-02-17 04:28:01 -05:00
e4e5815242 Merge pull request #4244 from watiko/vim-7.4.830
vim-patch:7.4.{830,833}
2016-02-17 04:26:29 -05:00
b2b3768bb4 Merge pull request #4234 from watiko/vim-7.4.977
vim-patch:7.4.{818,883,977}
2016-02-17 04:10:50 -05:00
af1745a763 Merge pull request #4230 from jbradaric/vim-7.4.853
vim-patch:7.4.{853,856}
2016-02-17 04:08:57 -05:00
9198b06ea6 Merge pull request #4229 from jbradaric/vim-7.4.847
vim-patch:7.4.847
2016-02-17 04:04:27 -05:00
560a346d57 vim-patch:7.4.844 #4228
Problem:    When '#' is in 'isident' the is# comparator doesn't work.
Solution:   Don't use vim_isIDc(). (Yasuhiro Matsumoto)

37a8de17d4
2016-02-17 03:59:58 -05:00
5f54519b4f Merge pull request #4213 from jbradaric/vim-7.4.835
vim-patch:7.4.{835,843,877}
2016-02-17 03:49:57 -05:00
6dc39d84cf Merge pull request #4188 from jbradaric/vim-7.4.868
vim-patch:7.4.868
2016-02-17 03:45:12 -05:00
e65fce8ed3 vim-patch.sh: Replace #<number> with vim/vim#<number> in commit messages. 2016-02-17 00:18:19 +01:00
cc6299ecbc vim-patch.sh: Support multi-patch pull requests.
* Calling "vim-patch.sh -p" on a checked-out branch already created with
  "-p" will re-use the branch and append commits.

* Fetch upstream/master before checking out branch on first call of "-p".

* Reverted creation of commit in submit step ("-s") to previous behavior:
  Create an empty commit with correct commit message when "-p" is called.

* Submitting a pull request with "-s" will create a correct pull request
  message even if multiple patches have been ported in one single branch
  with "-p".
2016-02-17 00:18:19 +01:00
775a16b0b7 vim-patch.sh: Add -s (submit pull request) option.
When calling "vim-patch.sh -s" on a checked-out branch created with
"vim-patch.sh -p", create commit from staged changes, push to origin,
create pull request (using hub), and clean up patch files.
2016-02-17 00:18:19 +01:00
07eabc062e vim-patch.sh: Use .patch files only. 2016-02-17 00:18:19 +01:00
b768d8a09c vim-patch.sh: Improvements for review functionality.
* Support pull requests with multiple commits.
 * Offer to clean up files after review.
 * Always use full commit hash in assign_commit_details().
2016-02-17 00:18:19 +01:00
db20edef69 vim-patch:7.4.937
Problem:    Segfault reading unitialized memory.
Solution:   Do not read match \z0, it does not exist. (Marius Gedminas, closes
            vim/vim#497)

5ad075c073
2016-02-17 03:00:13 +09:00
c9f4f828d5 version.c: Mark 7.4.935 NA
Problem:    test_utf8 fails on MS-Windows when executed with gvim.
Solution:   Use the insert flag on feedkeys() to put the string before the
            ":" that was already read when checking for available chars.

6040256d8b

---

feedkeys() is not used by legacy test utf8.
2016-02-16 22:56:47 +09:00
9036f1644f vim-patch:7.4.933
Problem:    Crash when using longest completion match.
Solution:   Fix array index.

e4eda3bc71
2016-02-16 22:56:02 +09:00
9648bf795a coverity/135578: Memory - illegal accesses
Harmless issue, but doesn't hurt to satisfy coverity here.
2016-02-16 04:25:59 -05:00
30b452b470 ex_docmd: Don't use pre-increment. 2016-02-16 07:20:47 +01:00
3b34c992bc vim-patch:7.4.895
Problem:    Custom command line completion does not work for a command
            containing digits.
Solution:   Skip over the digits. (suggested by Yasuhiro Matsumoto)

23d1b62746
2016-02-16 07:18:48 +01:00
5af9ae9e60 Merge pull request #4171 from cacplate/pr-3694
diff.c: change return type to bool (adoption of #3694)
2016-02-15 23:07:31 +01:00
089368c15f Doc: correct default value 2016-02-15 19:55:51 +01:00
b3bdf9f356 diff.c: change return type to bool
Co-authored-by: Wayne Rowcliffe (@war1025)
2016-02-15 12:41:08 -05:00
4f3ea0379e vim-patch:7.4.932
Problem:    test_utf8 has confusing dummy command.
Solution:   Use a real command instead of a colon.

8f08dab18d
2016-02-16 00:18:42 +09:00
3680332325 vim-patch:7.4.926
Problem:    Completing the longest match doesn't work properly with multi-byte
            characters.
Solution:   When using multi-byte characters use another way to find the
            longest match. (Hirohito Higashi)

4f8fa1633c
2016-02-16 00:15:52 +09:00
d4bb84367f vim-patch:7.4.922
Problem:    Leaking memory with ":helpt {dir-not-exists}".
Solution:   Free dirname. (Dominique Pelle)

1c2836e268

---

see: "[patch] command :helpt {dir} leaks memory when directory does not exist"
     https://groups.google.com/d/msg/vim_dev/WbcIbZ9YdUA/4eow2c3_AgAJ
2016-02-15 22:38:19 +09:00
4a4c3fdfcd vim-patch:7.4.901
Problem:    When a BufLeave autocommand changes folding in a way it syncs
            undo, undo can be corrupted.
Solution:   Prevent undo sync. (Jacob Niehus)

e7d1376b63

---

see: "[bug] [patch] Setting foldmethod in WinLeave autocommand can corrupt undo state"
     https://groups.google.com/d/msg/vim_dev/xF5uMLb1vwY/Jn4RglosDgAJ
2016-02-15 22:28:45 +09:00
ade2298735 vim-patch:7.4.912
Problem:    Wrong indenting for C++ constructor.
Solution:   Recognize ::.  (Anhong)

e01f4f86ce
2016-02-15 21:08:22 +09:00
72d5a88af5 vim-patch:7.4.893
Problem:    C indenting is wrong below a "case (foo):" because it is
            recognized as a C++ base class construct.  Issue #38.
Solution:   Check for the case keyword.

d1b15dec4d
2016-02-15 19:13:15 +09:00
1eeadd7098 test: Fix lint error 2016-02-15 11:05:17 +01:00
9bd8fcde1e test: Add test cases to legacy test autocmd_option 2016-02-15 11:05:17 +01:00
b535df1554 eval: Fix linter error. 2016-02-15 11:05:17 +01:00
de23395fa7 vim-patch:7.4.888
Problem:    The OptionSet autocommands are not triggered from setwinvar().
Solution:   Do not use switch_win() when not needed. (Hirohito Higashi)

ba117c23df
2016-02-15 11:05:17 +01:00
2d5cba630c vim-patch:7.4.891
Problem:    Indentation of array initializer is wrong.
Solution:   Avoid that calling find_start_rawstring() changes the position
            returned by find_start_comment(), add a test. (Hirohito Higashi)

089af18d1f
2016-02-15 19:02:52 +09:00
7609a96a35 Merge pull request #4260 from watiko/vim-7.4.887
vim-patch:7.4.887
2016-02-15 04:17:25 -05:00
ec6fcf3b1c vim-patch:7.4.887
Problem:    Using uninitialized memory for regexp with back reference.
            (Dominique Pelle)
Solution:   Initialize end_lnum.

c2b717ebd6

---

see: "[bug] use of uninitialized memory in regexp_nfa.c with invalid back reference"
     https://groups.google.com/d/msg/vim_dev/JWmrT5-NnPQ/U_TgaRW8AwAJ
2016-02-15 18:10:30 +09:00
baee9fe286 Merge pull request #4220 from watiko/vim-7.4.792
vim-patch:7.4.792
2016-02-15 03:55:23 -05:00
ceccaf7a5e test: Remove files of old test 36. 2016-02-15 09:30:17 +01:00
109d53b7b9 test: Migrate legacy test 36.
The test was split into several blocks reusing the same input file.  As it is
complicated to send text in different encodings and with control characters
from the test suite to nvim and back the results are written to a temp file
and loaded into the test from there.
2016-02-15 09:25:49 +01:00
0581ec396c test: Remove old files for legacy test 11. 2016-02-15 09:09:23 +01:00
291715286b test: Migrate legacy test 11.
Some parts of the test depend on gzip(1).  They are skipped if gzip is not
available.

Some `:write` and `:edit` commands produce messages and "hit enter" prompts
that had to be treated with an extra `feed('<C-L>')`.  In the original test
file this was not neccessary because it was `:source!`ed.
2016-02-15 09:09:16 +01:00
e0727ced13 vim-patch:7.4.881
Problem:    Test 49 fails.
Solution:   Add line number to check of call stack.

0a777ab989
2016-02-15 16:27:05 +09:00
5b1a536d50 vim-patch:7.4.879
Problem:    Can't see line numbers in nested function calls.
Solution:   Add line number to the file name. (Alberto Fanjul)

1d6328ca00
2016-02-15 16:08:16 +09:00
1e995ea2fd Merge #4140 'vim-patch:7.4.771'. 2016-02-15 01:48:30 -05:00
69234f4a76 test: search_mbyte_spec: minor cleanup
mbyte.vim, small.vim are not relevant to migrated legacy tests.
2016-02-15 01:47:43 -05:00
e0ca30553b Merge pull request #4166 from lucc/legacy/command_count
tests: Migrate legacy test command_count.
2016-02-15 01:10:15 -05:00
02612a3fc9 Merge pull request #4254 from Shougo/remote
Improve remote plugin scripts
2016-02-15 00:27:43 -05:00
e3bf1385e6 Merge pull request #4252 from justinmk/filetype
defaults: Enable filetypes, syntax
2016-02-14 17:20:55 -05:00
cc2dce45d0 startup: Avoid VimL global. Introduce TriState enum.
- `syntax_on` is documented. Rather than introduce a new undocumented
  VimL global `g:syntax_off`, use a module-local flag.
- Rename "maybe" functions to follow style guidelines (use standard
  module prefix)
2016-02-14 16:23:04 -05:00
6c9c08c370 startup: respect earlier :filetype and :syntax.
If user invokes :filetype or :syntax before startup defaults are
applied, don't clobber their choices.
2016-02-14 15:38:11 -05:00
da6299445a ex_docmd: rename force_enable_filetype().
It is no longer forcing anything.
2016-02-14 15:20:32 -05:00
9c2c24ec48 syntax: don't override user settings 2016-02-14 15:20:32 -05:00
cae0904160 syntax: avoid extra global macro 2016-02-14 15:20:31 -05:00
50e129f5a7 defaults: Enable syntax and filetype plugins. 2016-02-14 15:20:31 -05:00
75f6817a51 Merge pull request #4216 from bfredl/rebuild
build system: avoid more unneccesary recompiles
2016-02-14 12:07:55 +01:00
8d7ab23b49 build system: avoid more unneccesary recompiles 2016-02-14 11:41:28 +01:00
d19af41db4 Merge pull request #4248 from watiko/vim-nas
version.c: Mark patches NA
2016-02-13 18:47:23 -05:00
41794f6b58 Improve remote plugin scripts 2016-02-14 08:24:49 +09:00
0b21956edb version.c: Mark patches NA
NA patch list:

684: vim_tempfile() was refactored
     e5c421cfd7

725: str_to_reg() was refactored
     659c94d483

752: (Unicode 8.0) automatically generates these tables
     66312acf14

767: (clientserver)
     fafeee6b9e

804: (xxd)
     43fe32900c

812: ml_add_stack() was refactored by e53dda90bd
     fbd302ff38

821: (coverity)
     handled by 33cecbbf16
                aca6dc5001
                bb674e0fcd
     bd8539aac3

827: (src/Makefile)
     8cba8ba3e0

838: (crypt, ifdef)
     8060687905

839: (cast) vim_strnsave()'s 2nd argument type is already size_t
     6ed535dbc0

860: (empty commit) missing parts are in other runtime comitts
     a122b5e98a

865: (uninitializing) handled by 7f99d210fd
     ed84b76021

866: (netbeans)
     93c88e0f6a

873: (netbeans, unused) related to 866
     b8603882b1

897: (clientserver)
     4e86150ec5

---

NA runtime patch:

vim-patch:e2db6c9
2016-02-14 08:05:39 +09:00
364d764889 Merge #2674 2016-02-13 15:22:12 -05:00
7567afbbe5 test: completion_spec: minor edits 2016-02-13 15:21:28 -05:00
6c99667b6e vim-patch:7.4.833
Problem:    More side effects of ":set all&" are missing. (Björn Linse)
Solution:   Call didset_options() and add didset_options2() to collect more
            side effects to take care of.  Still not everything...

e68c25c677
2016-02-12 19:41:10 +09:00
b6fdc3eb47 vim-patch:7.4.830
Problem:    Resetting 'encoding' when doing ":set all&" causes problems.
            (Bjorn Linse) Display is not updated.
Solution:   Do not reset 'encoding'. Do a full redraw.

b341dda575

---

":set all&" does not reset 'encoding' in neovim.
2016-02-12 16:09:51 +09:00
f03ab69a35 Merge pull request #4237 from Jun-T/shada-symlink
resolve symlink in shada_spec test
2016-02-11 18:23:15 -05:00
d12460123e vim-patch:7.4.885
Problem:    When doing an upwards search without wildcards the search fails if
            the initial directory doesn't exist.
Solution:   Fix the non-wildcard case. (Stefan Kempf)

c79a5452ac
2016-02-11 22:55:00 +01:00
a21becf7ee vim-patch:7.4.877
Problem:    ":find" sometimes fails. (Excanoe)
Solution:   Compare current characters instead of previous ones.

4d0c7bc74a
2016-02-11 22:31:19 +01:00
edbc97225d test: shada_spec: resolve symlink
If the build directory path has symlinks in it, 'make functionaltest'
fails at shada_spec.lua:177 because readme_fname has symlink but
nvim resolves the symlink when writing it into the shada file.
2016-02-12 00:03:39 +09:00
8ba32e219f Merge pull request #4235 from watiko/vim-7.4.828
vim-patch:7.4.828
2016-02-11 09:32:53 -05:00
d115b58cdc vim-patch:7.4.828
Problem:    Crash when using "syn keyword x c". (Dominique Pelle)
Solution:   Initialize the keyword tabble. (Raymond Ko, PR 397)

670acbc70f

---

see: "fix crash due to hash table not being initialized"
     https://github.com/vim/vim/pull/397

To reproduce:

```sh
nvim -u NONE -c ow -c 'sy keyword x c'
```
2016-02-11 19:06:54 +09:00
adb73b6025 Merge pull request #4204 from watiko/vim-7.4.915
vim-patch:7.4.{749,915}
2016-02-11 03:45:08 -05:00
63d750f310 Merge pull request #4186 from watiko/vim-7.4.929
vim-patch:7.4.{734,743,929}
2016-02-11 03:35:09 -05:00
eab6ed778d vim-patch:7.4.977
Problem:    'linebreak' does not work properly when using "space" in
            'listchars'.
Solution:   (Hirohito Higashi, Christian Brabandt)

9bc01ebb95
2016-02-11 17:08:36 +09:00
8eb0d43c12 vim-patch:7.4.883
Problem:    Block-mode replace works characterwise instead of blockwise after
            column 147. (Issue #422)
Solution:   Set Visual mode. (Christian Brabandt)

10ad1d90da
2016-02-11 16:45:08 +09:00
66571f64a4 vim-patch:7.4.818
Problem:    'linebreak' breaks c% if the last Visual selection was block.
            (Chris Morganiser, Issue 389)
Solution:   Handle Visual block mode differently. (Christian Brabandt)

89c17c02ca
2016-02-11 16:37:11 +09:00
bfab33ef79 vim-patch:7.4.931 (NA)
Problem:    Test 94 fails on some systems.
Solution:   Set 'encoding' to utf-8.

cfcd1ddd10

---

Neovim cannot change encoding after start-up.
2016-02-11 15:14:36 +09:00
51c3e0aa80 vim-patch:7.4.929
Problem:    "gv" after paste selects one character less if 'selection' is
            "exclusive".
Solution:   Increment the end position. (Christian Brabandt)

d29c6fea94
2016-02-11 15:13:30 +09:00
663e1ed158 vim-patch:7.4.743
Problem:    "p" in Visual mode causes an unexpected line split.
Solution:   Advance the cursor first. (Yukihiro Nakadaira)

c004bc2726
2016-02-11 15:13:30 +09:00
4a0e10fb2c vim-patch:7.4.734
Problem:    ml_get error when using "p" in a Visual selection in the last
            line.
Solution:   Change the behavior at the last line. (Yukihiro Nakadaira)

d009e86826
2016-02-11 15:13:30 +09:00
b137ebdd17 tests: Migrate legacy test match_conceal 2016-02-11 15:08:31 +09:00
133ef7e465 vim-patch:7.4.792
Problem:    Can only conceal text by defining syntax items.
Solution:   Use matchadd() to define concealing. (Christian Brabandt)

6561d52ecb
2016-02-11 15:08:31 +09:00
162d4bb3c6 vim-patch:7.4.857
Problem:    Dragging the current tab with the mouse doesn't work properly.
Solution:   Take the current tabpage index into account. (Hirohito Higashi)

4a4b821085
2016-02-10 22:51:16 +01:00
14c543231c vim-patch:7.4.847
Problem:    "vi)d" may leave a character behind.
Solution:   Skip over multi-byte character. (Christian Brabandt)

8667d66ca9
2016-02-10 22:35:24 +01:00
84281bf675 Merge pull request #4205 from watiko/vim-7.4.737
vim-patch:7.4.737
2016-02-10 20:51:14 +01:00
953e140a18 Merge pull request #4224 from fmoralesc/docs-term
doc: remove references to 'term' and other tty related options.
2016-02-10 11:01:23 -05:00
11f43360d1 doc: remove references to 'term' and other tty related options.
Re: https://github.com/neovim/neovim/issues/4218
2016-02-10 16:52:48 +01:00
9b9695ab8e Merge pull request #4221 from Jun-T/install-mo
install *.mo files correctly
2016-02-10 10:37:24 -05:00
c74dc9dd6c Merge pull request #4225 from bfredl/helptags
build: if helptags generation fails, echo the message
2016-02-10 10:27:08 -05:00
81f54f909e set VIMPACKAGE to "nvim" 2016-02-10 21:34:10 +09:00
222a1655f5 cmake: if helptags generation fails, echo the message 2016-02-10 13:23:23 +01:00
c2384597ef Merge pull request #4217 from fmoralesc/vim-7.4.735
vim-patch: 7.4.735 is NA
2016-02-10 11:17:47 +01:00
c5c53ed8b4 vim-patch:7.4.735 (NA)
Problem:    Wrong argument for sizeof().
Solution:   Use a pointer argument. (Chris Hall)

e2e4b98622

This was already handled in nvim.
2016-02-10 10:25:18 +01:00
0690c3358d install *.mo files correctly 2016-02-10 16:45:37 +09:00
6d57b48a53 vim-patch:7.4.737
Problem:    On MS-Windows vimgrep over arglist doesn't work (Issue 361)
Solution:   Only escape backslashes in ## expansion when it is not used as the
            path separator. (James McCoy)

6e8d3b0d41

---

Fix a lint error for the closing parenthesis.
NOLINT does not help to do this.
2016-02-10 16:19:33 +09:00
e7615ddc22 CMake: Add #include in _FORTIFY_SOURCE check. #4214
Some toolchains apparently set _FORTIFY_SOURCE=2 in internal header
files. Include <string.h> (which in turn should include such internal
header files) before checking the value of _FORTIFY_SOURCE to catch
that.

Fixes #4183.
2016-02-10 00:17:55 +01:00
313c24a31b vim-patch:7.4.856
Problem:    "zt" still doesn't work well with filler lines. (Gary Johnson)
Solution:   Check for filler lines above the cursor. (Christian Brabandt)

a09a2c5857
2016-02-10 00:00:29 +01:00
37288e522a vim-patch:7.4.853
Problem:    "zt" in diff mode does not always work properly. (Gary Johnson)
Solution:   Don't count filler lines twice. (Christian Brabandt)

cf619daa8e
2016-02-09 23:51:28 +01:00
b86553c7ad file_search: Change return type of ff_wc_equal to bool.
This makes sense since the function returns only TRUE or FALSE.
2016-02-09 23:12:50 +01:00
c9898e0ec3 vim-patch:7.4.843
Problem:    Still possible to go beyond the end of a string.
Solution:   Check for NUL also in second string. (Dominique Pelle)

d43f0951bc
2016-02-09 23:08:24 +01:00
ab8a771dbd file_search: Declare loop variables inside the loop. 2016-02-09 23:08:24 +01:00
e8dd996703 vim-patch:7.4.835
Problem:    Comparing utf-8 sequences does not handle different byte sizes
            correctly.
Solution:   Get the byte size of each character. (Dominique Pelle)

f6470c288c
2016-02-09 23:08:24 +01:00
586daa6b4c buffer_defs: Remove spaces in member declarations. 2016-02-09 22:47:25 +01:00
cdd2bdabee Fix linter errors. 2016-02-09 22:47:25 +01:00
35d50ab5b9 vim-patch:7.4.868
Problem:    'smarttab' is also effective when 'paste' is enabled. (Alexander
            Monakov)
Solution:   Disable 'smarttab' when 'paste' is set. (Christian Brabandt)
            Do the same for 'expandtab'.

54f018cd59
2016-02-09 22:47:25 +01:00
dcdb50b64b Merge pull request #4212 from jbradaric/vim-7.4.834
vim-patch:7.4.834
2016-02-09 22:26:30 +01:00
f19e4dd1df vim-patch:7.4.834
Problem:    gettabvar() doesn't work after Vim start. (Szymon Wrozynski)
Solution:   Handle first window in tab still being NULL. (Christian Brabandt)

7e47d1ac6a
2016-02-09 20:21:26 +01:00
3be74ac634 Merge pull request #4103 from cacplate/pr-3695
charset.c: change return type to bool
2016-02-09 18:18:53 +01:00
35b6a020b9 charset.c: change return type to bool
Co-authored-by: Wayne Rowcliffe
2016-02-09 11:13:04 -05:00
8b5cc1230a Syntax: skip over ]
The ported patch for 7.4.825 removed code that is needed to walk over "]" by
accident.

0: 52692d3cd3
1: 1560d07045

Fixes #4207.
2016-02-09 15:28:52 +01:00
25a70469f4 Merge pull request #4187 from watiko/vim-7.4.742
vim-patch:7.4.742
2016-02-09 02:19:17 -05:00
6fbb9ceb5e Merge pull request #4184 from watiko/vim-7.4.732
vim-patch:7.4.732
2016-02-09 02:14:38 -05:00
7c2b2ea9c9 Merge pull request #4178 from watiko/vim-7.4.708
vim-patch:7.4.{708,717}
2016-02-09 02:10:57 -05:00
b9701c2a2b Merge #4152 'vim-patch:7.4.{798,800,805,810,811,814,815,816,817,820,825}'. 2016-02-09 01:58:54 -05:00
17ae27190d Merge #4136 vim-patch:7.4.{755,758,760} 2016-02-09 01:41:04 -05:00
18be6e0b30 vim-patch:979243b
Update help files.

https://github.com/vim/vim/commit/979243b
2016-02-09 01:36:29 -05:00
0429b7714f vim-patch:7.4.760
Problem:    Spelling mistakes are not displayed after ":syn spell".
Solution:   Force a redraw after ":syn spell" command. (Christian Brabandt)

5081d20247
2016-02-09 01:36:29 -05:00
b0cfb6905a vim-patch:7.4.758
Problem:    When 'conceallevel' is 1 and quitting the command-line window with
            CTRL-C the first character ':' is erased.
Solution:   Reset 'conceallevel' in the command-line window. (Hirohito
            Higashi)

fa67fbe6b8
2016-02-09 01:36:29 -05:00
a9a25fda42 vim-patch:7.4.755
Problem:    It is not easy to count the number of characters.
Solution:   Add the skipcc argument to strchars(). (Hirohito Higashi, Ken
            Takata)

641e48c224
2016-02-09 01:36:29 -05:00
31aa060bca vim-patch:7.4.801
Problem:    Test for ":diffoff" doesn't catch all potential problems.
Solution:   Add a :diffthis and a :diffoff command. (Olaf Dabrunz)

278236000f
2016-02-09 01:17:02 -05:00
39e5d9287e Merge #4139 'vim-patch:7.4.{768,769}'. 2016-02-09 01:04:54 -05:00
81ccfc576f vim-patch:7.4.769
Problem:    Behavior of :diffoff is not tested.
Solution:   Add a bit of testing. (Olaf Dabrunz)

2693ca21ce
2016-02-09 01:03:33 -05:00
32e33aabdf vim-patch:7.4.768
Problem:    :diffoff only works properly once.
Solution:   Also make :diffoff work when used a second time. (Olaf Dabrunz)

4392996461
2016-02-09 01:03:33 -05:00
69e5427be1 vim-patch:7.4.915
Problem:    When removing from 'path' and then adding, a comma may go missing.
            (Malcolm Rowe)
Solution:   Fix the check for P_ONECOMMA. (closes #471)

174674743d
2016-02-09 14:44:53 +09:00
c90c47072f vim-patch:7.4.749
Problem:    For some options two consecutive commas are OK. (Nikolay Pavlov)
Solution:   Add the P_ONECOMMA flag.

0e7c4b99c6
2016-02-09 14:44:53 +09:00
cb5ee26540 Merge pull request #4094 from justinmk/_GNU_SOURCE
cmake: Linux: define _GNU_SOURCE.
2016-02-09 00:34:14 -05:00
d402841b54 version bump 2016-02-09 00:21:54 -05:00
b33c777493 NVIM v0.1.2
Features:
  ef66249 tabline: Add %[] atom to the tabline, for random commands on click
  f338ea7 job control: implement jobpid() to get PID of job
  d0d5d17 job control: add 'detach' option to jobstart
  7ad3f07 Add support for binary numbers

Fixes:
  291495a regexp_nfa.c: Speed up find_match_text()
  317d5ca input: Do not set high-bit; preserve ALT modifier.
  3b7c409 shell: Unquote &shell* options before using them

Notable changes:
  49b06a8 encoding: Always use "utf-8" as default for &encoding
  79a6983 ui: revert "gui_running" hack

Other changes:
  b4b4536 version: semver.org compliance
  c6aa716 reproducible builds: Stop using __{DATE,TIME}__
  46bd3c0 clipboard: Check $DISPLAY. Prefer xsel. #4150
  f6ecd12 job control: don't kill PTY processes on exit
  49f0417 clipboard: Detach clipboard helper, so contents is kept after nvim exit
  38435e8 python: Add missing I/O methods to RedirectStream
  d26b01d eval: Use better error messages when failing to dump values
  62d137c Remove swapsync.
2016-02-09 00:01:18 -05:00
392964617a vimrc_example.vim: Update vimrc path. #4203 2016-02-08 23:29:18 -05:00
bf6c5bc225 Fix lint errors 2016-02-09 09:39:52 +09:00
f8f92a2360 doc: Add whitespace before parens. #4202 2016-02-08 13:43:27 -05:00
ba8ec7e963 vim-patch:7.4.742
Problem:    Cannot specify a vertical split when loading a buffer for a
            quickfix command.
Solution:   Add the "vsplit" value to 'switchbuf'. (Brook Hong)

a594d77ffc
2016-02-07 17:54:37 +09:00
827e267800 Merge pull request #4175 from watiko/vim-7.4.700
vim-patch:7.4.700
2016-02-07 01:33:01 -05:00
cc52060245 vim-patch:541f92 #4173
Updated runtime files.

https://github.com/vim/vim/commit/541f92
2016-02-07 01:13:30 -05:00
bd3ea7227e Merge pull request #4176 from watiko/vim-7.4.689
vim-patch:7.4.689
2016-02-07 01:01:03 -05:00
0ef0c17837 Merge pull request #4185 from justinmk/ci_mingw
CI/travis: get MinGW from our mirror
2016-02-07 00:09:39 -05:00
5e876388e5 CI/travis: get MinGW from our mirror.
sourceforge download has been failing randomly, which causes build
failures.
2016-02-06 23:43:16 -05:00
1ecbfd19db vim-patch:7.4.689
Problem:    On MS-Windows, when 'autochdir' is set, diff mode with files in
            different directories does not work. (Axel Bender)
Solution:   Remember the current directory and use it where needed. (Christian
            Brabandt)

d87c36ea5e

---

see: "autochdir + encoding=utf8 messes up diff"
     https://groups.google.com/d/msg/vim_dev/QrE4Y2LMJR8/uxigns5KGxYJ
2016-02-07 13:40:07 +09:00
b12e5fa8bd CI/travis: Move check to before_script.sh.
Avoids some duplication.
2016-02-06 23:19:26 -05:00
9b19335c6e vim-patch:7.4.693 #4172
Problem:    Session file is not correct when there are multiple tab pages.
Solution:   Reset the current window number for each tab page. (Jacob Niehus)

695baeefe1

---

see: "[patch] wincmd error during session restore"
     https://groups.google.com/d/msg/vim_dev/NykQ0UuOjXc/_MZi4sv9vp0J

What I did for testing:

```sh
mkdir /tmp/test_session
cd $_

function test_session() {
  $1 -u NONE -i NONE -N ~/.vimrc \
    -c 'wincmd s'      \
    -c 'wincmd v'      \
    -c 'wincmd T'      \
    -c 'normal 1gt'    \
    -c '2wincmd w'     \
    -c 'mks! test.vis' \
    -c 'qa'
  $1 -u NONE -i NONE -N -S test.vis
}

test_session vim
test_session nvim
test_session /path/to/your/neovim/repository/build/bin/nvim
```
2016-02-06 22:54:36 -05:00
8b2b9b83b7 vim-patch:7.4.732
Problem:    The cursor line is not always updated for the "O" command.
Solution:   Reset the VALID_CROW flag. (Christian Brabandt)

d0d0fe09cf
2016-02-07 08:22:34 +09:00
1ce80d8676 Merge pull request #4174 from jamessan/msgpack-version-check
cmake: Fix search for msgpack when old system lib is installed
2016-02-06 12:44:40 -05:00
1d1574e0ac cmake: Use find_package(Msgpack)'s version in pkg_search_module
Avoid duplicating information by using the Msgpack_FIND_VERSION variable
exported by find_package() inside FindMsgpack's pkg_search_module call.
2016-02-05 21:23:19 -05:00
79e7c03f91 cmake: msgpack: Check all lib names per directory
By default, find_library() searches all directories for one possible
name and then looks for the next name.  To make sure we're building
against the same headers and libraries, look for all names in a
directory before moving to the next one.
2016-02-05 19:46:53 -05:00
2be51f5e85 cmake: msgpack: Add more thorough version check
In 33bc332, version constraints were added to pkg_search_module(), but
that only affects the set of directories searched by
find_library()/find_path().

Once the header directory is found, parse the version from
version_master.h so it can be checked by the find_package() call in the
root CMakeLists.txt.
2016-02-05 19:46:53 -05:00
70ab198221 vim-patch:7.4.717
Problem:    ":let list += list" can change a locked list.
Solution:   Check for the lock earlier. (Olaf Dabrunz)

1cd5e613b0
2016-02-06 05:54:15 +09:00
fef753fa6d vim-patch:7.4.708
Problem:    gettext() is called too often.
Solution:   Do not call gettext() for messages until they are actually used.
            (idea by Yasuhiro Matsumoto)

77354e78a8
2016-02-06 05:54:15 +09:00
d9cada146f Merge pull request #4157 from watiko/vim-7.4.694
vim-patch:7.4.{662,694}
2016-02-05 10:02:38 -05:00
7b955802b3 vim-patch:7.4.688 #4159
Problem:    When "$" is in 'cpo' the popup menu isn't undrawn correctly.
            (Issue 166)
Solution:   When using the popup menu remove the "$".

478c46e50f

NOTE: To reproduce in nvim:
    nvim -u NONE -c 'exe "norm iaaa iabbbbbb acc" | norm yyp' -c 'set cpo+=$'
2016-02-05 09:54:03 -05:00
46bd3c0f77 clipboard: Check $DISPLAY. Prefer xsel. #4150 2016-02-05 09:51:56 -05:00
3cf8ad6f48 tests: Add test case for legacy test 45 2016-02-05 14:09:03 +09:00
86c5696c27 tests: Migrate legacy test 45. 2016-02-05 13:55:27 +09:00
69e448d1d8 vim-patch:7.4.700
Problem:    Fold can't be opened after ":move". (Ein Brown)
Solution:   Delete the folding information and update it afterwards.
            (Christian Brabandt)

d5f6933d5c
2016-02-05 12:21:14 +09:00
ec663d8069 tests: Remove old test files for command_count. 2016-02-04 19:33:16 +01:00
ad83cd82e1 tests: Simplify migrated legacy test. 2016-02-04 19:25:07 +01:00
c1b0c45bee tests: Fix migrated legacy test.
The test involves argument and buffer numbers.  Therefore it was necessary to
use a custom testing session to ensure that the initial buffer corresponds to
an argument.
2016-02-04 19:23:47 +01:00
153fe65c01 tests: Migrate legacy test command_count. 2016-02-04 19:20:59 +01:00
add02b675d Merge pull request #4155 from justinmk/gui_running
ui: revert "gui_running" hack
2016-02-04 01:21:26 -05:00
863e1c91a6 Merge pull request #4158 from neovim/coverity-135004
coverity/135004: Null pointer dereferences
2016-02-03 11:40:40 -05:00
f5c112c949 coverity/135004: Null pointer dereferences 2016-02-03 16:27:28 +03:00
4cbe52b3a3 tests: Migrate legacy test textobjects 2016-02-03 21:56:22 +09:00
7aaffb7001 vim-patch:7.4.694
Problem:    Running tests changes the .viminfo file.
Solution:   Disable viminfo in the text objects test.

29d54df5cd
2016-02-03 21:56:22 +09:00
924cacd2fc vim-patch:7.4.662
Problem:    When 'M' is in the 'cpo' option then selecting a text object in
            parenthesis does not work correctly.
Solution:   Keep 'M' in 'cpo' when finding a match. (Hirohito Higashi)

438b64ab71
2016-02-03 21:56:22 +09:00
4f4b8ea448 CMake: Avoid dependency cycles in helptags targets. #3983
Declare dependency in terms of directory, rather than individual doc
files to avoid target dependency cycles.  This still maintains install
targets at doc file level.
2016-02-03 01:43:12 -05:00
79a6983c0c ui: revert "gui_running" hack
Plugins (YCM, dispatch.vim) use gui_running to decide behavior; so do
some colorschemes. Up to now, nvim lied about gui_running for the
benefit of colorschemes and the detriment of all _other_ plugins that
check this condition. That's counterproductive: a user employs at most
_one_ colorscheme but may use many other plugins which expect the Vim
legacy semantics of gui_running.

Moreover, colorschemes usually don't _need_ to check gui_running: they
can instead set cterm{fg,bg} and gui{fg,bg} in the same :highlight call.

It is reasonable for users who want "true color" to modify their
colorscheme once (or request upstream to do so) in order to avoid
running into quirks in any other plugins.

Closes #2782
2016-02-03 01:21:59 -05:00
8e92b7f9fc Merge pull request #4153 from watiko/vim-7.4.643
vim-patch:7.4.643
2016-02-02 22:18:42 -05:00
a4ea4dac45 Merge #4120 'vim-patch:7.4.740' 2016-02-02 22:09:05 -05:00
ac88c35d32 test: Do not depend on helptags. 2016-02-02 22:07:53 -05:00
f104ce2d15 vim-patch:7.4.643
Problem:    Using the default file format for Mac files. (Issue 77)
Solution:   Reset the try_mac counter in the right place. (Oswald)

c6b7217ff5
2016-02-03 06:38:38 +09:00
52692d3cd3 vim-patch:7.4.825
Problem:    Invalid memory access for ":syn keyword x a[".
Solution:   Do not skip over the NUL. (Dominique Pelle)

1560d07045
2016-02-02 20:33:43 +01:00
8d5cfe4ffc vim-patch:7.4.820
Problem:    Invalid memory access in file_pat_to_reg_pat.
Solution:   Avoid looking before the start of a string. (Dominique Pelle)

8fee878fe2
2016-02-02 20:29:41 +01:00
3d15cab29d Tests: fix according to lualint 2016-02-02 20:23:12 +01:00
5feff1c415 vim-patch:7.4.817
Problem:    Invalid memory access in file_pat_to_reg_pat().
Solution:   Use vim_isspace() instead of checking for a space only. (Dominique
            Pelle)

2288afed42
2016-02-02 20:20:23 +01:00
3c0a082894 vim-patch:7.4.816
Problem:    Invalid memory access when doing ":fun X(".
Solution:   Check for missing ')'. (Dominique Pelle)

dd8a5286e1
2016-02-02 20:09:45 +01:00
105f98fbf8 vim-patch:7.4.815
Problem:    Invalid memory access when doing ":call g:".
Solution:   Check for an empty name. (Dominique Pelle)

73627d0bd4
2016-02-02 20:06:35 +01:00
ce2ff1ac01 vim-patch:7.4.814
Problem:    Illegal memory access with "sy match a fold".
Solution:   Check for empty string. (Dominique Pelle)

382197865c
2016-02-02 19:58:30 +01:00
f20818de31 vim-patch:7.4.811
Problem:    Invalid memory access when using "exe 'sc'".
Solution:   Avoid going over the end of the string. (Dominique Pelle)

204b93f958
2016-02-02 19:54:04 +01:00
2b2f9ccf8c vim-patch:7.4.810
Problem:    With a sequence of commands using buffers in diff mode E749 is
            given. (itchyny)
Solution:   Skip unloaded buffer. (Hirohito Higashi)

9dd33af4ba
2016-02-02 18:54:09 +01:00
cfce719c66 vim-patch:7.4.805
Problem:    The ruler shows "Bot" even when there are only filler lines
            missing. (Gary Johnson)
Solution:   Use "All" when the first line and one filler line are visible.

29bc9db36e
2016-02-02 18:41:44 +01:00
cdc7250cd8 vim-patch:7.4.800
Problem:    Using freed memory when triggering CmdUndefined autocommands.
Solution:   Set pointer to NULL. (Dominique Pelle)

829aef1eb4
2016-02-02 18:34:31 +01:00
ffd143be82 vim-patch:7.4.798
Problem:    Repeating a change in Visual mode does not work as expected.
            (Urtica Dioica)
Solution:   Make redo in Visual mode work better. (Christian Brabandt)

31b259bf95
2016-02-02 18:29:23 +01:00
5308585adf Merge pull request #3871 from ZyX-I/tabline-clicks
Allow running random code on tabline clicks
2016-02-01 22:31:02 -05:00
ZyX
18d1ba3422 runtime/msgpack: Fix msgpack#string that expects old string() behavior 2016-02-02 00:54:00 +03:00
ZyX
610b48c5b0 functests: Add string() function tests 2016-02-02 00:54:00 +03:00
ZyX
b2ea083eeb eval: Return different values when dividing by zero
Fixes #3263
2016-02-02 00:54:00 +03:00
ZyX
2873a17c55 eval: Use str2float() to represent inf and nan values
Closes #3248
2016-02-02 00:46:10 +03:00
ZyX
ad5cb87d7a eval: Add +tablineat feature 2016-02-01 21:40:46 +03:00
ZyX
1a356e6439 documentation: Reword help 2016-02-01 21:40:46 +03:00
ZyX
3f314d40be functests: Improve tabline click tests 2016-02-01 21:40:46 +03:00
ZyX
64038bf4e2 tabline: Switch to functions, handle different click types 2016-02-01 21:40:06 +03:00
ZyX
ef662498b1 tabline: Add %[] atom to the tabline, for random commands on click
Currently untested and undocumented.
2016-02-01 21:40:06 +03:00
ZyX
3e3d2d783c option: Refactor 'statusline' option flags from #defines to enum 2016-02-01 21:40:06 +03:00
830678d5f9 version.c: update
Thanks to @sethjackson, @oni-link, @equalsraf, @jusga

included patches:
 697 Already included e4975f8
1013
1149 Revert 7.4.1013

NA patches:
1002 Windows Test
1003 Travis CI
1004 Makefile
1008 Drop OS/2 support
1009 ARCHIE is already removed in neovim
1011 if_perl
1012 if_python
1014 Cygwin support
1016 Drop OS/2 support
1019 Makefile fix
1020 Windows fix
1021 Makefile fix
1022 Remove outdated description
1023 Makefile fix
1024 Windows fix
1025 Makefile fix
1026 Makefile fix
1027 if_python fix
1028 Nsis version file
1031 if_python
1033 Windows fix
1038 configure fix
1040 tee.c
1043 INSTALL_mac.txt
1044 ifdef FEAT_EVAL
1045 Travis fix
1060 old style test README fix
1062 Makefile fix
1063 Makefile fix
1065 if_python, if_lua, if_perl, if_ruby fix
1066 Windows build
1067 Makefile fix
1069 Compiler warning
1070 if_tcl
1074 GUI Compiler warning
1077 Windows build documentation
1078 Windows build
1080 Windows GUI
1082 Windows GUI
1083 GVimExt
1095 Makefile
1098 style fix
1099 crypt
1100 Cygwin Makefile
1103 filelist
1104 if_mzscheme
1106 Windows Makefile
1109 Windows
1115 Windows Makefile
1124 Windows
1125 if_perl
1127 if_perl
1128 Windows junction delete() fix
1129 if_python
1131 viminfo
1133 ARGS() macro
1134 Windows
1135 Windows
1138 GUI
1139 Windows
1144 float.h
1145 configure fix
1146 if_python3 fix
1148 Makefile fix
1155 feature remove
1158 ARGS macro
1159 ARGS macro
1162 if_mzscheme
1171 Makefile fix
1172 configure fix
1175 MinGW Cygwin build
1176 channel prototype fix
1185 if_tcl
1190 configure fix
1192 FEAT non multibyte fix
1196-1203 ARGS macro
1204 GUI Motif
1205-1208 old style function
1209 Athena support
1210 old style function
1211 old style function
1212 GUI Motif
1213-1215 old style function
1216 HAVE_STDARG_H
1218 old style function
1219 FEAT_FLOAT
2016-02-01 04:04:14 -05:00
815ba27f75 legacy2luatest: Use before_each instead of setup.
This will avoid confusion if additional `it()` blocks are added.
(`setup()` only runs once per `describe()` block, whereas `before_each()`
runs before each `it()`).
2016-02-01 09:09:08 +01:00
208f9dd09d vim-patch:7.4.740
Problem:    ":1quit" works like ":.quit". (Bohr Shaw)
Solution:   Don't exit Vim when a range is specified. (Christian Brabandt)

c7a0d32c83
2016-02-01 09:04:08 +01:00
63a12e1e2d Remove unused variables from the test. 2016-02-01 08:54:13 +01:00
696adeb0f6 Use before_each instead of setup in the test. 2016-02-01 08:52:38 +01:00
76086b36b7 Merge pull request #4145 from pra85/patch-1
typo in doc/nvim_provider.txt
2016-02-01 02:50:26 -05:00
be1d5a61be Merge pull request #4129 from jbradaric/vim-7.4.745
vim-patch:7.4.{745,746,747,748}
2016-02-01 02:49:27 -05:00
cabf079ae4 search: Fix linter errors. 2016-02-01 08:48:57 +01:00
02cf813eff Add test files for patch 7.4.771.
vim-patch:efcabd6892ad89a4585fb77aa94c3b1802b784ab
2016-02-01 08:48:36 +01:00
1ac6601841 doc: fix typo in doc/nvim_provider.txt
Spelling mistake - 
`peform` > `perform`
2016-02-01 13:15:26 +05:30
59ef994f8f vim-patch:7.4.741 #4121
Problem:    When using += with ":set" a trailing comma is not recognized.
            (Issue 365)
Solution:   Don't add a second comma. Add a test. (partly by Christian
            Brabandt)

a7b7b1cef9
2016-02-01 02:28:51 -05:00
99067b7e56 Merge pull request #4113 from jbradaric/vim-7.4.709
vim-patch:7.4.709
2016-02-01 02:16:29 -05:00
fe1ba0487a Merge pull request #3994 from sethjackson/pathext
Windows: use $PATHEXT to find executables in path
2016-02-01 02:06:49 -05:00
e2231bc372 Merge pull request #4144 from george-b/manwidth
Respect $MANWIDTH
2016-02-01 01:49:43 -05:00
1d995bb357 Merge pull request #4013 from watiko/vim-increment
Vim patches related to increment and marks
2016-02-01 01:47:37 -05:00
948361760c Respect $MANWIDTH
If $MANWIDTH is set do not override it otherwise use winwidth.
2016-02-01 00:39:24 -06:00
5ee87c68b7 Merge pull request #4024 from sethjackson/io-include
Windows: include <io.h>
2016-02-01 01:24:57 -05:00
ee5c4f8a2b Merge pull request #4030 from sethjackson/unistd
config: Remove HAVE_UNISTD_H
2016-02-01 00:07:23 -05:00
228d236bdf Fix lint error 2016-02-01 03:47:09 +09:00
fa924f4604 tests: Migrate legacy test increment. 2016-02-01 03:47:09 +09:00
2016365ffe vim-patch:7.4.1089
Problem:    Repeating CTRL-A doesn't work.
Solution:   Call prep_redo_cmd(). (Hirohito Higashi)

ef2b5036b3
2016-02-01 03:47:09 +09:00
cb724182ff vim-patch:7.4.1088
Problem:    Coverity warns for uninitialized variables.  Only one is an actual
            problem.
Solution:   Move the conditions.  Don't use endpos if handling an error.

7ae4fbca55
2016-02-01 03:47:09 +09:00
8f212568aa vim-patch:7.4.1087
Problem:    CTRL-A and CTRL-X do not work properly with blockwise visual
            selection if there is a mix of Tab and spaces.
Solution:   Add OP_NR_ADD and OP_NR_SUB. (Hirohito Higashi)

d79e55016c
2016-02-01 03:47:09 +09:00
3a94e06abb vim-patch:7.4.1085
Problem:    The CTRL-A and CTRL-X commands do not update the '[ and '] marks.
Solution:   (Yukihiro Nakadaira)

a52dfaed10
2016-02-01 03:47:09 +09:00
40149a9dbf vim-patch:7.4.634
Problem:    Marks are not restored after redo + undo.
Solution:   Fix the way marks are restored. (Olaf Dabrunz)

f65aad5554
35e7594dd4
2016-02-01 03:47:09 +09:00
2f52ae18e7 vim-patch:7.4.1084
Problem:    Using "." to repeat CTRL-A in Visual mode increments the wrong
            numbers.
Solution:   Append right size to the redo buffer. (Ozaki Kiichi)

e1edc1caba
2016-02-01 03:47:09 +09:00
594e3a64de vim-patch:7.4.1076
Problem:    CTRL-A does not work well in right-left mode.
Solution:   Remove reversing the line, add a test. (Hirohito Higashi)

6a3c8aff04
2016-02-01 03:47:09 +09:00
63560c9c89 vim-patch:7.4.1072
Problem:    Increment test is old style.
Solution:   Make the increment test a new style test. (Hirohito Higashi)

450919587d
44132a10ae
2016-02-01 03:47:08 +09:00
ddba89c9b6 vim-patch:7.4.1065
Problem:    Cannot use the "dll" options on MS-Windows.
Solution:   Support the options on all platforms.  Use the built-in name as
            the default, so that it's clear what Vim is looking for.

25e4fcde76
2016-02-01 03:47:08 +09:00
a6e4271c15 vim-patch:7.4.1029
Problem:    test_increment fails on systems with 32 bit long.
Solution:   Only test with 32 bits.

d3343960d7
2016-02-01 03:47:08 +09:00
a5f361e470 vim-patch:7.4.1027
Problem:    No support for binary numbers.
Solution:   Add "bin" to nrformats. (Jason Schulz)

887c1fea4a
2016-02-01 03:47:08 +09:00
7fc996abf6 vim-patch:7.0212
Add missing test case (test59's test 8-8).

8fd89f0fe7
0b23879827
2016-02-01 03:44:46 +09:00
1e94262efe vim-patch:7.4.848
Problem:    CTRL-A on hex number in Visual block mode is incorrect.
Solution:   Account for the "0x". (Hirohito Higashi)

5adfea1ac6
2016-02-01 03:43:37 +09:00
61a3b14726 vim-patch:7.4.823
Problem:    Cursor moves after CTRL-A on alphabetic character.
Solution:   (Hirohito Higashi, test by Christian Brabandt)

25c2f6783a
2016-02-01 03:43:37 +09:00
9664f513f4 vim-patch:7.4.807
Problem:    After CTRL-V CTRL-A mode isn't updated. (Hirohito Higashi)
Solution:   Clear the command line or update the displayed command.

0bbcb5c8ef
2016-02-01 03:43:37 +09:00
d21aaef456 vim-patch:7.4.806
Problem:    CTRL-A in Visual mode doesn't work properly with "alpha" in
            'nrformat'.
Solution:   Make it work. (Christian Brabandt)

cc218ab3ca
2016-02-01 03:43:37 +09:00
43fd126298 vim-patch:7.4.782
Problem:    Still a few problems with CTRL-A and CTRL-X in Visual mode.
Solution:   Fix the reported problems. (Christian Brabandt)

5d1bc78a2b
2016-02-01 03:43:37 +09:00
b20b8f9f04 vim-patch:7.4.780
Problem:    Compiler complains about uninitialized variable and clobbered
            variables.
Solution:   Add Initialization.  Make variables static.

1db43b1145
2016-02-01 03:43:37 +09:00
d050d6390d vim-patch:7.4.779
Problem:    Using CTRL-A in a line without a number moves the cursor. May
            cause a crash when at the start of the line. (Urtica Dioica)
Solution:   Do not move the cursor if no number was changed.

3ec3261980
2016-02-01 03:43:36 +09:00
b3dbc9d90b vim-patch:7.4.778
Problem:    Coverity warns for uninitialized variable.
Solution:   Change condition of assignment.

ae2fe73abc
2016-02-01 03:43:36 +09:00
5ef1cb5c2e vim-patch:7.4.765
Problem:    CTRL-A and CTRL-X in Visual mode do not always work well.
Solution:   Improvements for increment and decrement. (Christian Brabandt)

9bb1930af9
2016-02-01 03:43:36 +09:00
6d1b948b6b vim-patch:7.4.764
Problem:    test_increment fails on MS-Windows. (Ken Takata)
Solution:   Clear Visual mappings. (Taro Muraoka)

6a57cce048
2016-02-01 03:43:36 +09:00
4d074e39ea vim-patch:7.4.754
Problem:    Using CTRL-A in Visual mode does not work well. (Gary Johnson)
Solution:   Make it increment all numbers in the Visual area. (Christian
            Brabandt)

3a304b2382
2016-02-01 03:43:36 +09:00
7d2d4b1918 vim-patch:7.4.771
Problem:    Search does not handle multi-byte character at the start position
            correctly.
Solution:   Take byte size of character into account. (Yukihiro Nakadaira)

5f1e68b7bc
2016-01-30 21:31:11 +01:00
da4bf813da Windows: use $PATHEXT to find executables in path.
is_executable_in_path() searches for executables in $PATH, but on
Windows executable files have extensions available in the environment
var $PATHEXT. This commit changes is_executable_in_path() to append
those extensions to the filename.

This patch diverges from standard Vim, in that Vim only checked for
the given filename if it already has an extensions. This one always
checks for the given filename.
2016-01-30 15:09:18 -05:00
515b7e3eff vim-patch:7.4.748
Problem:    Buffer overflow.
Solution:   Make the buffer larger. (Kazunobu Kuriyama)

6a7e2a668b
2016-01-30 14:45:07 +01:00
a984203bd6 Fix linter errors. 2016-01-30 14:42:06 +01:00
7179f43666 vim-patch:7.4.747
Problem:    ":cnext" may jump to the wrong column when setting
            'virtualedit=all' (cs86661)
Solution:   Reset the coladd field. (Hirohito Higashi)

b8c890035e
2016-01-30 14:41:52 +01:00
73234bfec6 vim-patch:7.4.746
Problem:    ":[count]tag" is not always working. (cs86661)
Solution:   Set cur_match a bit later. (Hirohito Higashi)

01cf376da1
2016-01-30 12:29:41 +01:00
f8ad215d25 vim-patch:7.4.745
Problem:    The entries added by matchaddpos() are returned by getmatches()
            but can't be set with setmatches(). (Lcd)
Solution:   Fix setmatches(). (Christian Brabandt)

0fce425772
2016-01-30 12:16:32 +01:00
8f22031708 Merge pull request #4117 from watiko/vim-7.4.963
Vim 7.4.{639,753,949,963}
2016-01-29 20:41:03 -05:00
5ffe1425c9 Merge pull request #3165 from blueyed/dont-wrap-DECSCUSR-for-tmux
[RFC] Do not use TMUX_WRAP for DECSCUSR sequence

Reviewed-by: Felipe Morales
Reviewed-by: Justin M. Keyes
Reviewed-by: Michael Reed
2016-01-29 19:22:27 -05:00
0e546d8b38 Do not use TMUX_WRAP for DECSCUSR sequence
Wrapping it will send it to the terminal "directly", which might change the
cursor of another pane, e.g. when starting Neovim and changing to
another pane directly.

tmux has a terminfo extension (Ss/Se) to handle and translate the
DECSCUSR sequences internally.  This can be controlled through
`terminal-overrides`, but does not appear to be able to handle the
uncommon sequences for Konsole.
2016-01-29 23:22:56 +01:00
fd14f64e26 tests: add always complete test 2016-01-29 22:03:30 +08:00
edb5fb88aa edit.c: fix incorrect redo buffer 2016-01-29 22:03:23 +08:00
b55726b350 edit.c: fix flicker in popup menu 2016-01-29 22:03:11 +08:00
4c960c3d78 Merge #3077 'test_eval' 2016-01-29 00:23:53 -05:00
41f6a10a9b test: eval_spec.lua: minor cleanup 2016-01-29 00:20:47 -05:00
d671dae58c Merge pull request #4124 from justinmk/vim-7.4.1137
vim-patch:7.4.1137
2016-01-29 00:06:49 -05:00
aa17b4b4bc vim-patch:7.4.1137
Problem:    Illegal memory access when using :copen and :cclose.
Solution:   Avoid that curbuf is invalid. (suggestion by Justin M. Keyes)
            Add a test.

62ef797496
2016-01-28 23:56:58 -05:00
aa8b3b60ee Merge pull request #4118 from nicdumz/vim-83d1b19
[RFC] vim-patch: 3 runtime commits
2016-01-28 19:05:50 -05:00
73e83e8566 Merge pull request #4096 from justinmk/coverity125476
coverity/125476: RI: Null pointer dereference
2016-01-28 17:00:49 -05:00
1574c4a115 Merge pull request #4119 from jamessan/minimum-msgpack-version
cmake: msgpack: Ensure at least version 1.0 is found
2016-01-28 12:53:03 -05:00
a31f9161b0 vim-patch:7.4.709
Problem:    ":tabmove" does not work as documented.
Solution:   Make it work consistently.  Update documentation and add tests.
            (Hirohito Higashi)

40ce3a4e1f
2016-01-28 18:25:25 +01:00
33bc33274a cmake: msgpack: Ensure at least version 1.0 is found
Neovim's code relies on functionality introduced in msgpack-c 1.0.0
(at least MSGPACK_OBJECT_FLOAT enum value), so enforce that minimum
version.
2016-01-28 09:01:05 -05:00
92f889dada vim-patch:ba172f2
Remove local-additions entries from help.txt.

https://github.com/vim/vim/commit/ba172f2
2016-01-28 13:54:37 +01:00
487609c075 vim-patch:0a63ded
Updated runtime files.

https://github.com/vim/vim/commit/0a63ded
2016-01-28 13:53:53 +01:00
2e000a1acd vim-patch:83d1b19
More updated runtime files.

83d1b19015

Left out:
- doc/tags
- doc/todo.txt
- runtime/tutor/de.*
- runtime/syntax/vim.vim that seems to have already been
  applied/autogenerated without the has(...) tests
2016-01-28 13:43:43 +01:00
db51ff10f4 vim-patch:7.4.963
Problem:    test_listlbr_utf8 sometimes fails.
Solution:   Don't use a literal multibyte character but <C-V>uXXXX. Do not
            dump the screen highlighting. (Christian Brabandt, closes #518)

1c57fe8b94
2016-01-28 20:52:41 +09:00
8721e1fe08 vim-patch:7.4.949
Problem:    When using 'colorcolumn' and there is a sign with a fullwidth
            character the highlighting is wrong. (Andrew Stewart)
Solution:   Only increment vcol when in the right state. (Christian Brabandt)

32a214e78d
2016-01-28 20:52:41 +09:00
8771e84db7 vim-patch:7.4.753
Problem:    Appending in Visual mode with 'linebreak' set does not work
            properly.  Also when 'selection' is "exclusive". (Ingo Karkat)
Solution:   Recalculate virtual columns. (Christian Brabandt)

74db34cc91
2016-01-28 20:52:41 +09:00
d25a59f4d0 vim-patch:7.4.639
Problem:    Combination of linebreak and conceal doesn't work well.
Solution:   Fix the display problems. (Christian Brabandt)

8fc6bc7126
2016-01-28 20:52:40 +09:00
db77b7bc9e file_pat_to_reg_pat(): handle empty string. 2016-01-28 00:46:38 -05:00
50393ef178 Merge #4112 'vim-patch:7.4.698' 2016-01-28 00:10:28 -05:00
52f160f352 eval_defs.h: fix comment 2016-01-27 23:59:33 -05:00
069a220f32 Merge pull request #4080 from jbradaric/vim-7.4.704
vim-patch:7.4.704
2016-01-27 23:49:00 -05:00
164fb2a688 Merge pull request #4098 from jusga/vim-7.4.656
vim-patch:7.4.656
2016-01-27 23:41:19 -05:00
d459a0891c Merge pull request #4111 from nicdumz/vim-5a5f459
vim-patch:5a5f459
2016-01-27 22:57:08 -05:00
894fcb778e glob2regpat(): handle empty string. 2016-01-27 22:19:50 -05:00
ccab78046c vim-patch:7.4.698
Problem:    Various problems with locked and fixed lists and dictionaries.
Solution:   Disallow changing locked items, fix a crash, add tests. (Olaf
            Dabrunz)

9bc174b69d
2016-01-27 22:02:35 +01:00
71980676f0 vim-patch:5a5f459
Original commit: https://github.com/vim/vim/commit/5a5f459

commit 5a5f45917dbf542cb00617fa5ef70a14898495dd
Author: Bram Moolenaar <Bram@vim.org>
Date:   Mon Apr 13 12:43:06 2015 +0200

    Updated runtime files.

(1) Merged manually vimrc_example.vim
(2) Left out README.txt, doc/tags, doc/todo.txt, tutor/tutor.de,
tutor.de.utf-8, ga.po
2016-01-27 14:22:48 +01:00
6c77ea1cb6 tests: Remove legacy test files for eval test. 2016-01-27 12:59:06 +01:00
e78fc534dd tests: Migrate recent patches of legacy eval test.
As the work of this migration did take quite some time, some changes where
made in master after this branch was started.  These are ported to the new
test file.
2016-01-27 12:54:45 +01:00
4b13cbc76d tests: Comments and typos after review.
Helped-by: Justin M. Keyes <justinkz@gmail.com>
2016-01-27 12:52:13 +01:00
fb3a6b925b tests: Resurrect unused part of legacy eval test.
The old test_eval.in file did a `:wq` on line 168.  The following 60 lines
where not used and there was no expected output for them in test_eval.ok.
This test code is now used in several test cases in the new test file.
2016-01-27 12:48:20 +01:00
c13dc2b762 tests: Split converted eval test into it() blocks. 2016-01-27 12:43:53 +01:00
8cfef01193 tests: Debug converted eval test. 2016-01-27 12:40:41 +01:00
3571fdac6f tests: Migrate legacy eval test. 2016-01-27 12:37:56 +01:00
765d394f18 vim-patch:ac809999
ac80999985
2016-01-27 03:20:07 -05:00
c15e796211 coverity/125476: RI: Null pointer dereference 2016-01-27 02:39:42 -05:00
130611fca3 Merge pull request #4107 from oni-link/remove.strlen
search.c: searchit(): Remove strlen() check
2016-01-27 01:31:21 -05:00
18ca2035fe search.c: searchit(): Remove strlen() check
While in the `while` loop at line 603 of function searchit(), memory
address ptr+matchpos is always valid. The strlen() check should not be
necessary to verify this.

Also added a check to prevent reading a line after the end of the
buffer.
2016-01-26 19:04:18 +01:00
9b0b3a0883 Merge pull request #4093 from oni-link/fix.issue.3486
regexp_nfa.c: Speed up find_match_text()
2016-01-26 10:18:06 -05:00
1937c6e480 vim_str2nr: cleanup #4104
Fixes unused assignments found by clang-scan.
2016-01-26 09:15:25 -05:00
299044d4ef vim-patch:7.4.656
Problem:    Missing changes for glob() in one file.
Solution:   Add the missing changes.

d8b77f7dc0
2016-01-25 21:45:26 +01:00
45b378259e Merge pull request #2710 from lucc/test83
Migrate legacy test 83.
2016-01-25 14:14:06 -05:00
ce0e66260f Merge pull request #4039 from cacplate/pr-3696
window.c: change return types to bool (adoption of #3696)
2016-01-25 14:12:12 -05:00
e74fa00c38 Merge pull request #4097 from fmoralesc/4071
plugin/tutor: Fix locale handling
2016-01-25 19:11:05 +01:00
1715b79d39 plugin/tutor: Fix locale handling
Fixes issue #4071
2016-01-25 17:44:46 +01:00
2772144cbf window.c: change return types to bool
Co-authored-by: Wayne Rowcliffe (@war1025)
2016-01-25 08:47:31 -05:00
91a1680205 tests: Improve test 83 and add pending() call.
If nvim was compiled without `has("iconv")` this test is skipped.
2016-01-25 09:51:39 +01:00
66f89ae321 tests: Migrate legacy test 83. 2016-01-25 09:39:59 +01:00
63d0f6e94a Merge pull request #4095 from justinmk/coverity134885
coverity/134885: Using uninitialized value
2016-01-25 00:02:12 -05:00
41434e6881 coverity/134885: Using uninitialized value
Case: (dobin > 1) && (pre != 0)
2016-01-24 23:17:13 -05:00
b5f6f43095 cmake: Linux: define _GNU_SOURCE.
Closes #4042
2016-01-24 21:18:44 -05:00
291495a7b0 regexp_nfa.c: Speed up find_match_text()
An extra test in commit 0a116c828d was
introduced, to check for end of string with a call to strlen(). This was
necessary, because an incorrect length for invalid byte sequences was
used to step through the string. This slowed down find_match_text()
compared to vim's version.

To speed up things, the extra check was removed and a sequence length
of 1 for invalid byte sequences is used.

Fixes issue #3486
2016-01-24 23:38:38 +01:00
e1d81178cc Merge pull request #4069 from jusga/vim-7.4.680
vim-patch:7.4.680
2016-01-24 16:14:53 -05:00
31047607f8 Merge pull request #4073 from jbradaric/vim-7.4.654
vim-patch:7.4.654
2016-01-24 16:05:20 -05:00
a15cfb4d52 Merge pull request #4089 from jbradaric/vim-7.4.722
vim-patch:7.4.722
2016-01-24 13:02:14 +01:00
c5f37c0fc0 Merge pull request #4090 from jbradaric/vim-7.4.739
vim-patch:7.4.739
2016-01-24 12:58:44 +01:00
7c94b2c343 vim-patch:7.4.739
Problem:    In a string "\U" only takes 4 digits, while after CTRL-V U eight
            digits can be used.
Solution:   Make "\U" also take eight digits. (Christian Brabandt)

acc39888cd
2016-01-24 10:31:53 +01:00
3915ac2409 vim-patch:7.4.722
Problem:    0x202f is not recognized as a non-breaking space character.
Solution:   Add 0x202f to the list. (Christian Brabandt)

73284b973a
2016-01-24 09:55:40 +01:00
4d0c511354 strings: Change order of operands in condition.
utf_ptr2char only needs to be called for l > 1.
2016-01-24 09:16:34 +01:00
d22a821ce3 regexp: Remove a leftover line.
It was replaced with `case 0xc3: case 0xc4: case 0xc5:`.
2016-01-24 09:15:59 +01:00
ee56470157 vim-patch:7.4.704
Problem:    Searching for a character matches an illegal byte and causes
            invalid memory access. (Dominique Pelle)
Solution:   Do not match an invalid byte when search for a character in a
            string.  Fix equivalence classes using negative numbers, which
            result in illegal bytes.

d82a2a990b
2016-01-24 09:15:30 +01:00
4172ce4eb0 Merge pull request #4072 from jbradaric/vim-7.4.642
vim-patch:7.4.642
2016-01-23 14:47:45 -05:00
d4430dc3eb Merge pull request #4007 from brcolow/vim-7.4.718
vim-patch:7.4.718
2016-01-23 14:37:31 -05:00
c8b487ae40 Merge pull request #4078 from jbradaric/vim-7.4.685
vim-patch:7.4.685
2016-01-23 10:07:24 -05:00
50c4c56967 vim-patch:dbcf19d
Add test files for patch 7.4.680.

dbcf19dc49
2016-01-23 15:33:31 +01:00
f583e51209 vim-patch:7.4.685
Problem:    When there are illegal utf-8 characters the old regexp engine may
            go past the end of a string.
Solution:   Only advance to the end of the string. (Dominique Pelle)

0e462411ca
2016-01-23 13:57:07 +01:00
0ccd1ef725 vim-patch:5837f1f #4066
Update runtime files.

5837f1f447
2016-01-23 12:05:15 +01:00
feb70192a8 cmake: Search for both libmsgpackc and libmsgpack #4075
libmsgpack was the old C++ library provided by msgpack-c.  The C library
is libmsgpackc.

The C++ support became header-only, but there was a bug
(msgpack/msgpack-c#395) wherein using msgpack-c's CMake build system
would only install libmsgpack instead of libmsgpackc.

Searching for both libraries, but preferring libmsgpackc, allows for
building against older msgpack-c releases and prepares for the upcoming
msgpack-c release which fixes the aforementioned issues.

Signed-off-by: James McCoy <jamessan@jamessan.com>
2016-01-22 23:03:14 +01:00
ce17037e3e window: Skip backslash only if followed by space 2016-01-22 21:06:20 +01:00
8048699f7d vim-patch:7.4.718
Problem:    Autocommands triggered by quickfix cannot get the current title
            value.
Solution:   Set w:quickfix_title earlier. (Yannick)
            Also move the check for a title into the function.

81278efadf
2016-01-22 12:52:01 -07:00
34904efd9d window: Fix code style. 2016-01-22 19:48:52 +01:00
b8ed507e3b window: Fix linter errors. 2016-01-22 19:28:17 +01:00
8b86f1103a vim-patch:7.4.642
Problem:    When using "gf" escaped spaces are not handled.
Solution:   Recognize escaped spaces.

d45c07ac74
2016-01-22 19:28:17 +01:00
22230196cb vim-patch:7.4.654
Problem:    glob() and globpath() cannot include links to non-existing files.
            (Charles Campbell)
Solution:   Add an argument to include all links with glob(). (James McCoy)
            Also for globpath().

a245bc79b4
2016-01-22 19:26:23 +01:00
f1aec23c09 vim-patch:7.4.680
Problem:    CTRL-W in Insert mode does not work well for multi-byte
            characters.
Solution:   Use mb_get_class(). (Yasuhiro Matsumoto)

310f2d59b2
2016-01-22 11:55:00 +01:00
15cd8916df cs_print_tags_priv: Clean up function.
* Style changes
* Variable removal
* Comment update
2016-01-21 17:24:12 +01:00
dd0b358af5 cs_print_tags_priv: Clear first output line to screen end
Using `:cscope find s <cword>` with the cursor on a very short word like
`key` does not output the first line on the screen correctly: Output is
`Cscope tag: keyrd>` instead of
`Cscope tag: key`.

To fix this, clear the screen line after the first line was printed.
2016-01-21 16:52:50 +01:00
a649299e76 coverity/133892: Resource leak
Variable tbuf going out of scope leaks the storage it points to.

We don't have to use the copy tbuf of a match. Because matches are always in
ctags style, we can operate on them directly.
2016-01-21 16:37:58 +01:00
f2558890f5 coverity/133858: Out-of-bounds access
Allocating insufficient memory for the terminating NUL of the string.

False positive, we allocating more memory than we need.
2016-01-21 16:37:58 +01:00
7a8e41e8ee coverity/13753: Dereference null return value
Dereferencing a pointer that might be null(ptag) when calling strlen().

False positive. A match always contains a tab, so ptag is never null.
Because matches are always in ctags style, we can rewrite the code to
not use strtok().
2016-01-21 16:37:58 +01:00
bcbcf235f6 Merge pull request #4012 from jbradaric/vim-7.4.729
vim-patch:7.4.729
2016-01-21 02:35:15 -05:00
5bfbf968dd Merge pull request #4054 from watiko/vim-7.4.603
vim-patch:7.4.603
2016-01-21 02:11:32 -05:00
8887ccffa6 Merge pull request #4049 from watiko/vim-7.4.616
vim-patch:7.4.616
2016-01-21 02:05:40 -05:00
542c79f20d test: printf_spec: fix missing setup
before_each(clear) is required to init the test harness for single-test
runs, and also to ensure a known environment for each test.
2016-01-21 01:34:56 -05:00
9eb6a44564 Merge #3916 "Add support for binary numbers". 2016-01-21 01:34:36 -05:00
5fa082fa85 tests: Migrate legacy test 39. 2016-01-21 14:05:02 +09:00
03d8adda8e vim-patch.sh: List in chronological order. #4034 2016-01-20 22:16:56 -05:00
a2ec5a569b Merge pull request #4061 from Pyrohh/doc
[RFC] doc: The ":drop" command is always available
2016-01-20 19:23:29 -05:00
d70b57264b Merge pull request #4052 from sethjackson/anchor
[RFC] gitignore: Anchor errors.json
2016-01-20 17:04:31 -05:00
23a83d24a6 doc: The ":drop" command is always available 2016-01-20 17:02:32 -05:00
297075bf47 Merge pull request #3944 from bfredl/detach
job control: add `detach` option and `jobpid` function and teardown PTY processes correctly.
2016-01-20 11:55:40 +01:00
f6ecd127b9 job control: don't kill PTY processes on exit
These will automatically recieve SIGHUP on closing PTY master.
2016-01-20 11:09:29 +01:00
4618307a6c job control: add tests for 'jobpid' and 'detach' 2016-01-20 11:09:29 +01:00
f338ea7835 job control: implement jobpid() to get PID of job 2016-01-20 11:09:29 +01:00
49f0417988 clipboard: Detach clipboard helper, so contents is kept after nvim exit 2016-01-20 11:09:29 +01:00
d0d5d17b69 job control: add 'detach' option to jobstart 2016-01-20 11:09:25 +01:00
ac0f979501 vim-patch:7.4.603
Problem:    'foldcolumn' may be set such that it fills the whole window, not
            leaving space for text.
Solution:   Reduce the foldcolumn width when there is not sufficient room.
            (idea by Christian Brabandt)

1c93429c48
2016-01-20 18:30:28 +09:00
a480614cb0 gitignore: Anchor errors.json 2016-01-19 21:55:43 -05:00
a118abca77 Add eol to listchars for mouse specification tests
This is consistent with VIM behavior. When showing a visual selection,
VIM only extends it past the last character if eol is in listchars (even
if nolist is set).
2016-01-19 08:47:49 +01:00
1c91dc8a5e screen: Fix linting errors 2016-01-19 08:25:54 +01:00
21afabb9e8 vim-patch:7.4.729
Problem:    Occasional crash with 'list' set.
Solution:   Fix off-by-one error. (Christian Brabandt)
2016-01-19 08:25:54 +01:00
c90784836b vim-patch:7.4.616
Problem:    Cannot insert a tab in front of a block.
Solution:   Correctly compute aop->start. (Christian Brabandt)

f2c03d7301
2016-01-19 12:29:37 +09:00
33321f2c85 config: Remove HAVE_UNISTD_H.
Unix systems must have this header but Windows does not have it at all.

Since src/nvim/os/unix_defs.h includes <unistd.h> without the guard
in order to avoid including this in the numerous places we would
need <unistd.h> on Unix we just include src/nvim/os/os.h which will pull
in <unistd.h> for us.
2016-01-18 13:48:47 -05:00
ee0e214427 Merge pull request #4046 from strokirk/fix-redirectstream-iobase
python: Add missing I/O methods to RedirectStream
2016-01-18 13:44:26 -05:00
74d450aa7b Merge pull request #4044 from sethjackson/utime
[RFC] config: Remove duplicate check for HAVE_UTIME_H
2016-01-18 13:05:25 -05:00
38435e8a05 python: Add missing I/O methods to RedirectStream
`RedirectStream` is used to redirect `stdout` and `stderr`, but are
missing certain I/O methods available on other file-like objects.
This causes external plugins (like `colorama`) to crash.

Inheriting from `io.IOBase` adds an abstract implementation of these
methods, which will at least keep the python code running.

Fixes #4045
2016-01-18 17:22:11 +01:00
9c811c6ba6 Merge pull request #4038 from sethjackson/build-type-cache
Defer setting CMAKE_BUILD_TYPE CACHE property
2016-01-18 10:13:54 -05:00
51d95d1438 config: Remove duplicate check for HAVE_UTIME_H. 2016-01-18 09:22:25 -05:00
1eaa2227e9 CMake: Defer setting CACHE CMAKE_BUILD_TYPE.
The Visual Studio CMake generator fails to configure if
CACHE CMAKE_BUILD_TYPE is set before CMAKE_BUILD_TYPE.
2016-01-18 09:18:18 -05:00
f5ae5fa799 MSVC+CMake: avoid get_target_property. #4004
When using the Visual Studio generator don't use get_target_property for
custom command, because it returns unexpanded VS variables (e.g.
$(Configuration)) within the result as part of the LOCATION path.

The single case where this is a problem is for getting the output path for
nvim-test, instead we use a path here.
2016-01-17 22:59:55 -05:00
3875d0bdf6 Merge pull request #4037 from watiko/fix-doc-mem
doc: Remove MEM_PROFILE related description
2016-01-17 22:53:02 -05:00
1a958345e2 Merge pull request #3981 from watiko/vim-7.4.991
Vim 7.4.9{78,80,81,91}
2016-01-17 22:51:06 -05:00
a119db78d7 doc: Remove MEM_PROFILE related description
This feature was already removed.

83161200c4
2016-01-18 12:45:30 +09:00
5f33f581a7 Merge pull request #4035 from heewa/fix-ycm-path
fix YouCompleteMe db path in config
2016-01-17 22:41:55 -05:00
92f7dc1c4b Merge pull request #3967 from cacplate/pr-3698
Change return type to bool in fileio.c (adoption of PR 3698)
2016-01-17 21:53:49 -05:00
9c2a156faa Improve YCM contrib: Fix db path 2016-01-17 20:50:10 -05:00
d1aa549735 Merge pull request #3997 from cacplate/do_init
remove DO_INIT macro
2016-01-17 19:30:33 -05:00
9b550a8760 vim-patch.sh: Fix listing of NA patches. #4034 2016-01-17 19:18:45 -05:00
a29b08ca5a fileio: Change return types to bool
Co-authored-by: Wayne Rowcliffe (@war1025)
2016-01-17 10:53:50 -05:00
d858315e59 globals: remove DO_INIT macro and replace usage by INIT 2016-01-17 10:46:52 -05:00
8099275082 Windows: include <io.h>.
if_csope.c uses _open_osfhandle so include the necessary header.
Futher we need <io.h> for read/write/close/lseek.

See: https://msdn.microsoft.com/en-us/library/bdts1c9x.aspx
2016-01-17 09:33:23 -05:00
55a345c3e7 Merge pull request #4027 from sethjackson/fcntl
[RFC] Windows: Include <fcntl.h> for file constants
2016-01-17 03:06:26 -05:00
a3a7afded6 Merge pull request #4025 from Pyrohh/nofollow
[RFC] os/win_defs.h: Define O_NOFOLLOW
2016-01-17 03:05:11 -05:00
4f18e0f678 Windows: Include <fcntl.h> for file constants.
This header is required by POSIX for the constants (O_RDONLY, etc.)
but we were only including it on Unix systems as a side effect of
including <unistd.h>.
2016-01-17 00:28:53 -05:00
3b4d1ab180 os/win_defs.h: Define O_NOFOLLOW
It's not present on Windows; see the discussion in #4024.
2016-01-16 18:58:28 -05:00
a7ade5c832 misc: UNIX => Unix #4022
Although UNIX is a registered trademark of The Open Group, it doesn't
really matter whether we refer to these systems as UNIX, Unix, or
Unix-like. So, for consistency, refer to them collectively as Unix.

Related:
http://www.greens.org/about/unix.html
http://www.unixica.com/html/unixunix.html
2016-01-16 18:34:31 -05:00
0735b05c82 doc: Remove reference to gettimeofday()
We use libuv for high resolution time now so this note is irrelevant.
2016-01-16 14:13:05 -05:00
e4fb777252 doc: Remove more references to MS-DOS
Among other things, this includes:
- lies about command.com
- references to pcterm
2016-01-16 14:12:56 -05:00
ba3123c88f doc: cleanup. #4032 #4033 2016-01-16 01:01:54 -05:00
704882e8dc Merge pull request #4029 from sethjackson/fcntl
[RFC] config: Remove HAVE_FCNTL_H
2016-01-17 11:58:05 -05:00
3920e7680d Merge pull request #4020 from sethjackson/uv-include
[RFC] Windows: Include <uv.h> for S_IFLNK
2016-01-17 11:56:47 -05:00
5dfbe6685d config: Remove HAVE_FCNTL_H.
We do not use it and all systems we support have <fcntl.h>.
2016-01-17 09:40:07 -05:00
d38d6486f2 Windows: Include <uv.h> for S_IFLNK.
S_IFLNK is not defined on Windows but libuv defines it for us.
2016-01-17 09:33:43 -05:00
f82e982bda Fix lint issues 2016-01-15 20:32:00 -08:00
7ad3f077dc Add support for binary numbers 2016-01-15 18:21:06 -08:00
dddbf9c5fa Merge pull request #4021 from jusga/vim-f3c2afb
vim-patch:f3c2afb
2016-01-15 12:03:44 -05:00
fec466c72e vim-patch:f3c2afb
Update a few runtime files.

f3c2afb77f
2016-01-15 16:09:46 +01:00
6f88dca92d tests: Migrate legacy test cdo. 2016-01-15 23:50:04 +09:00
4eba134a55 vim-patch:7.4.991
Problem:    When running new style tests the output is not visible.
Solution:   Add the testdir/messages file and show it.  Update the list of
            test names.

096c8bb40d
2016-01-15 23:50:04 +09:00
9d18492793 vim-patch:7.4.981
Problem:    An error in a test script goes unnoticed.
Solution:   Source the test script inside try/catch. (Hirohito Higashi)

4686b323e4
2016-01-15 23:50:04 +09:00
1231f0b001 vim-patch:7.4.980
Problem:    Tests for :cdo, :ldo, etc. are outdated.
Solution:   Add new style tests for these commands. (Yegappan Lakshmanan)

57d7971b5f
2016-01-15 23:50:04 +09:00
85d06fef16 vim-patch:7.4.978
Problem:    test_cdo fails when using another language than English.
Solution:   Set the language to C. (Dominique Pelle)

c42b9c670e
2016-01-15 23:50:04 +09:00
8b173a1de5 tests: Remove needless line continuation. 2016-01-15 23:50:04 +09:00
f433f569a3 Revert ROOT_UID removal
It helps clarify intent for those unaware of root's UID.

see https://github.com/neovim/neovim/pull/4015#discussion_r49822371
2016-01-15 03:03:18 -05:00
d4fb5920d3 Merge pull request #4019 from Pyrohh/fcntl
[RFC] test: sys/fcntl.h  ->  fcntl.h
2016-01-15 00:33:49 -05:00
0b23dec35e Merge pull request #4015 from Pyrohh/os_defs_more
[RFC] Misc. macro cleanup
2016-01-15 00:27:06 -05:00
07265d221f Misc. macro cleanup
- ROOT_UID's comment is misleading, as it's always defined to 0.

- SEEK_{SET,END} & O_NOFOLLOW should already be defined on Unix-like
  systems in <stdio.h> and <fcntl.h>, respectively.  In any case,
  neither of those #ifdef blocks should be in the middle of source files.

- The S_IS{LNK,DIR,...} macros should only be undefined on Windows.
2016-01-14 23:38:26 -05:00
729064af5f test: sys/fcntl.h -> fcntl.h
POSIX.1-2008[1] says that the latter should be used, and all of our
supported platforms would seem to support this scheme, apparently even
Windows[2].

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html
[2]: https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx
2016-01-14 23:36:58 -05:00
24fbb2c866 Merge pull request #4014 from jusga/vim-2b8388b
vim-patch:2b8388b
2016-01-14 23:14:23 -05:00
4034670568 doc: Remove references to the Mac GUI #4016
We don't support it.
2016-01-14 23:04:58 -05:00
65394777d5 Merge pull request #4017 from sethjackson/rgb
[RFC] Windows: Undefine the Windows RGB macro
2016-01-14 22:58:31 -05:00
755e56ba66 Windows: Undefine the Windows RGB macro.
Windows provides a RGB macro but we have our own in macros.h.
Undefine the Windows one before including macros.h.

See: https://msdn.microsoft.com/en-us/library/dd162937%28v=vs.85%29.aspx
2016-01-14 21:40:56 -05:00
964e52e81f Merge pull request #4009 from sethjackson/swapsync
[RFC] Remove 'swapsync'
2016-01-14 15:38:19 -05:00
68550b0d63 Merge pull request #3990 from sethjackson/remove-gtk-docs
[RFC] Remove references to GTK GUI support + some no-ops
2016-01-14 15:37:15 -05:00
7a7a758786 doc: Remove references to GTK.
We don't support it.
2016-01-14 13:16:10 -05:00
62d137ce09 Remove swapsync.
It's complete overkill.
2016-01-14 13:13:32 -05:00
cf0ff1dd0f vim-patch:2b8388b
Updated runtime files.

2b8388bd01
2016-01-14 17:58:15 +01:00
bf7bc4dcf0 Merge pull request #4005 from sethjackson/stack-protector
[RFC] MinGW: don't use -fstack-protector
2016-01-13 23:49:13 -05:00
54a1fb77e7 MinGW: don't use -fstack-protector
Mingw-w64 fails to link when using -fstack-protector flags, disabled the
flag check for non Unix system.
2016-01-13 23:09:27 -05:00
269f3ac779 Merge pull request #4010 from watiko/vim-7.4.614
vim-patch:7.4.614
2016-01-13 23:03:58 -05:00
c2ab844133 vim-patch:7.4.716 #4006
Problem:    When using the 'c' flag of ":substitute" and selecting "a" or "l"
            at the prompt the flags are not remembered for ":&&". (Ingo
            Karkat)
Solution:   Save the flag values and restore them. (Hirohito Higashi)

cad2fc9935
2016-01-13 22:25:31 -05:00
b1b8759fc3 vim-patch:7.4.614
Problem:    There is no test for what patch 7.4.601 fixes.
Solution:   Add a test. (Christian Brabandt)

d7ce7a9ad2
2016-01-14 12:22:45 +09:00
62f1aaedb1 vim-patch:7.4.715 #4003
Problem:    Invalid memory access when there are illegal bytes.
Solution:   Get the length from the text, not from the character. (Dominique
            Pelle)

2186ffa2c7
2016-01-13 22:12:53 -05:00
2c76651438 Merge pull request #4002 from brcolow/7.4.714
Vim 7.4.714
2016-01-13 22:06:10 -05:00
59e1f8996d Merge pull request #4008 from brcolow/vim-7.4.721
Vim 7.4.721
2016-01-13 22:01:56 -05:00
da9e519ba1 vim-patch:7.4.721
Problem:    When 'list' is set Visual mode does not highlight anything in
            empty lines. (mgaleski)
Solution:   Check the value of lcs_eol in another place. (Christian Brabandt)

d59c099120
2016-01-13 18:19:13 -07:00
39ef219535 vim-patch:7.4.714
Problem:    Illegal memory access when there are illegal bytes.
Solution:   Check the byte length of the character. (Dominique Pelle)

069dd08d8d
2016-01-13 16:52:44 -07:00
573d65c738 Merge pull request #3992 from Pyrohh/shada
[RFC] shada.c: Fix HAVE_BE64TOH check
2016-01-13 16:16:52 -05:00
852aaa5d42 shada.c: Fix HAVE_BE64TOH check
Mentioned here:

  https://github.com/neovim/neovim/pull/3985#issuecomment-170663426

HAVE_BE64TOH is defined in `config/config.h', which is included by
`vim.h'.  Since the HAVE_BE64TOH check in `shada.c' is evaluated before
`vim.h' is included, it always evaluates to false, meaning that
be64toh() in shada.c is always used instead of the one in <endian.h>.

Moving the HAVE_BE64TOH block to after where `vim.h' is included seems
to fix the issue.
2016-01-13 15:56:20 -05:00
7f3999ac80 Merge pull request #3996 from justinmk/ctrlc
vim-patch:7.4.569, 7.4.573
2016-01-13 03:27:23 -05:00
5c87d40acd vim patches 7.4.955/974/975/989. #3919
Helped by @Shougo.

vim-patch:7.4.955
vim-patch:7.4.974
vim-patch:7.4.975
vim-patch:7.4.989

Port upstream vim patches 955, 974, 975 and 989. Mark patches
964, 968, 970, and 971, and 982 as NA. Update patch list to 1022.

patch 7.4.955
Problem:    Vim doesn't recognize .pl6 and .pod6 files.
Solution:   Recognize them as perl6 and pod6. (Mike Eve)

patch 7.4.974
Problem:    When using :diffsplit the cursor jumps to the first line.
Solution:   Put the cursor on the line related to where the cursor was before
            the split.

patch 7.4.975
Problem:    Using ":sort" on a very big file sometimes causes text to be
            corrupted. (John Beckett)
Solution:   Copy the line into a buffer before calling ml_append().

patch 7.4.989
Problem:    Leaking memory when hash_add() fails. Coverity error 99126.
Solution:   When hash_add() fails free the memory.

778 marked as not NA as it will be needed once vim patch 754 is merged

Marked as NA:
964 test 87 was deleted
968 tests 86/87 were deleted
970 guarded by: `# if defined(FEAT_GUI_GTK) || defined(PROTO`
    and is inside a function that no longer exists
971 function table already sorted correctly
982 marked as NA because Neovim tests are only specified in exactly one location
2016-01-13 03:23:19 -05:00
8bfb521417 Merge pull request #3977 from sethjackson/output-paths
Fix build output paths for Visual Studio generator
2016-01-13 02:55:30 -05:00
8eeda7169a terminal: less babysitting of mapped_ctrl_c
process_interrupts() checks get_real_state() so we can avoid some
housekeeping of mapped_ctrl_c in terminal-mode.
2016-01-13 02:40:57 -05:00
3dfbeabf35 vim-patch:7.4.569/573
vim-patch:7.4.569
vim-patch:7.4.573
Helped-by: @glts https://github.com/neovim/neovim/pull/2621

Problem:    Having CTRL-C interrupt or not does not check the mode of the
            mapping. (Ingo Karkat)
Solution:   Use a bitmask with the map mode. (Christian Brabandt)

651863c94a

Problem:    Mapping CTRL-C in Visual mode doesn't work. (Ingo Karkat)
Solution:   Call get_real_state() instead of using State directly.

5000869712
2016-01-13 01:56:36 -05:00
420fe1fe73 Merge pull request #3995 from sethjackson/crt-externs
[RFC] config: Cleanup unused identifiers.
2016-01-12 20:52:29 -05:00
7c79ea70ef config: Cleanup unused identifiers.
HAVE_CRT_EXTERNS_H is unused since a3ec68c.
SIZEOF_OFF_T is unused since f916cf0.
HAVE_LIBGEN_H was never used.
2016-01-12 20:31:18 -05:00
e8fab975f8 Merge pull request #3993 from Pyrohh/os_defs
[RFC] Stop using <stropts.h>
2016-01-12 17:15:36 -05:00
5db511b6f1 Stop using <stropts.h>
In Vim, at least the constant `I_PUSH` is used from <stropts.h>, but
Neovim doesn't seem to use anything from said header.

Besides that, POSIX.1-2008[1] marks this header as obsolescent, and
there don't seem to be many platforms that even have it.

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stropts.h.html#tag_13_52_11
2016-01-12 16:40:22 -05:00
ddf3e27959 Merge pull request #3985 from Pyrohh/_max_path
[RDY]  os/*_defs.h: MAXNAMLEN cleanup
2016-01-12 12:57:30 -05:00
f65d58907d os/*_defs.h: MAXNAMLEN cleanup
For non-Windows systems, we assume that NAME_MAX is in <limits.h>, as
specified in POSIX.1-2008[1]. For Windows, which doesn't have NAME_MAX,
just define it ourselves to _MAX_PATH[2].

Also, remove two (now unused) HAVE_*_H checks.

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
[2]: https://msdn.microsoft.com/en-us/library/930f87yf.aspx

Helped-by: Seth Jackson
2016-01-12 12:26:15 -05:00
a1c770ca27 Merge pull request #3291 from sethjackson/env-separator
Windows: use ';' as env $PATH separator
2016-01-12 09:47:22 -05:00
970b5f2752 Merge pull request #3984 from cacplate/has_event
Remove redundant functions to replace for the general has_event function
2016-01-12 09:45:09 -05:00
7497dbee16 doc: Remove references to Motif GUI support #3893
We don't support it.
2016-01-11 18:36:13 -05:00
7c0f6d2380 Windows: use ';' as env $PATH separator.
In Windows the separator character in the PATH environment is ';' instead
of ':'. Add a new define ENV_SEPCHAR to be used instead of hardcoding
the character literal.
2016-01-11 16:36:13 -05:00
879c668d14 fileio: Replace some event checking functions with one has_event 2016-01-11 08:45:19 -05:00
3b94756feb Merge pull request #3982 from justinmk/nohighbit
input: Do not set high-bit. Preserve META modifier.
2016-01-11 00:48:28 -05:00
317d5ca7b0 input: Do not set high-bit; preserve ALT modifier.
Background: Vim internally prefers to represent ALT/META chords as
single-byte keys, by setting the high bit of the key byte.
extract_modifiers() _discards_ the meta/alt modifier, but we need it for
libvterm and libtermkey.

Closes #2440
Closes #3727
Closes #2017
References #2277
References #2254

https://github.com/neovim/neovim/issues/2017#issuecomment-140423557
> We [not libtermkey] are setting the high bit for some reason

https://github.com/neovim/neovim/issues/176#issuecomment-77834715
> libvtermkey requires the leading esc to parse alt/meta

https://github.com/neovim/neovim/pull/3246#issuecomment-136328450
> A program could do better than the current logic on some terminals, by
> asking for pure 8bit mode (S8C1T) and then immediately querying the
> mode again. If the result comes back as an 8bit single-byte CSI, then
> it can presume the mode setting was successful, and now the ESC prefix
> byte won't be seen in multibyte sequences; only as an Alt- prefix or
> a real Escape key. On such a terminal, it could therefore avoid
> needing to use that waiting timeout.
2016-01-11 00:29:58 -05:00
223aafb1a7 Merge pull request #3980 from ZyX-I/shell-unquote
shell: Unquote &shell* options before using them
2016-01-10 21:26:11 -05:00
ZyX
3b7c4093e2 shell: Unquote &shell* options before using them 2016-01-11 05:24:44 +03:00
095320a67d Merge pull request #3979 from sethjackson/maxnamlen
Windows: define MAXNAMLEN for Windows
2016-01-10 15:27:02 -05:00
1ce329e7dd Fix build output paths for Visual Studio generator
The Visual Studio cmake generator creates subdirectories inside
the build path for different build configuration. But this breaks some of our
cmake scripts, like the help tags installer, that assume the targets are
built in that location. Updated CMakeLists.txt to remove extra paths.
2016-01-10 14:16:30 -05:00
4fc85e5c87 Windows: define MAXNAMLEN for Windows.
MAXNAMLEN can be defined using _MAX_PATH from stdlib.h
which will fix the BASENAMELEN definition too.
2016-01-10 14:13:19 -05:00
dd8812c7cb Merge pull request #3978 from justinmk/32bit
portability: fix cast
2016-01-10 14:12:15 -05:00
a641b74140 portability: fix cast.
PRId64 format expects int64_t.
Regression from c6e481cba5.
2016-01-10 13:55:13 -05:00
73b8c89518 Merge pull request #2667 from equalsraf/tb-min-log
cmake: Pass MIN_LOG_LEVEL as compiler definition
2016-01-10 12:21:52 -05:00
72d03cc961 cmake: Pass -DMIN_LOG_LEVEL as compiler definition
- Check if MIN_LOG_LEVEL value is a number 0-3, default to
  INFO (1) or ignore it in Release mode
- When TRAVIS_CI_BUILD is ON the default is DEBUG (0)
- Add local.mk.example
2016-01-10 17:06:53 +00:00
5999749e07 Merge pull request #3974 from sethjackson/cpack
CMake: Add CPack settings to CMakeLists.txt
2016-01-10 11:23:33 -05:00
97ed0e8dd3 Merge pull request #3972 from jusga/vim-e271909
vim-patch:e271909
2016-01-10 10:26:19 -05:00
fd10729bc8 CMake: Add CPack settings to CMakeLists.txt 2016-01-10 09:50:35 -05:00
6bed244488 vim-patch:e271909
Updated syntax files.

e271909625
2016-01-10 12:47:35 +01:00
57cfb95758 win32: Fix syntax error in #ifndef block. #3968
The block is only compiled if the system is NOT WIN32, but the closing
parenthesis for the statement opened outside the block is closed inside
the block.
2016-01-10 01:38:09 -05:00
c6e481cba5 portability: use portable format specifier 2016-01-10 01:34:49 -05:00
9bf694ff0b Merge #3857 'Vim 7.4.{944,945,946,950,953,1032,1055}'. 2016-01-10 01:33:05 -05:00
f350655ddd Improve coding style 2016-01-10 10:44:57 +09:00
59b04d856b tests: Make helper.source() return tempname. 2016-01-10 10:44:57 +09:00
feed81f45f tests: Fix OSX's tempname issue. 2016-01-10 10:44:57 +09:00
d37dc0b314 tests: Rename 100_undo_level to 100_lispwords. 2016-01-10 10:44:57 +09:00
9c5ab23ef2 tests: Migrate legacy test undolevels. 2016-01-10 10:44:57 +09:00
d8e07deff6 tests: Migrate legacy test assert. 2016-01-10 10:44:57 +09:00
6c8e572d09 vim-patch:7.4.1055
Problem:    Running "make newtests" in src/testdir has no output.
Solution:   List the messages file when a test fails. (Christian Brabandt)
            Update the list of tests.

e7893a4088
2016-01-10 10:44:56 +09:00
3a6cef9ee6 vim-patch:7.4.1032
Problem:    message from assert_false() does not look nice.
Solution:   Handle missing sourcing_name. Use right number of spaces. (Watiko)
            Don't use line number if it's zero.

cbfe32953a
2016-01-10 09:01:30 +09:00
2586459118 vim-patch:7.4.953
Problem:    When a test script navigates to another buffer the .res file is
            created with the wrong name.
Solution:   Use the "testname" for the .res file. (Damien)

de0ad40cb3
2016-01-10 09:01:30 +09:00
47fac915f3 vim-patch:7.4.950
Problem:    v:errors is not initialized.
Solution:   Initialze it to an empty list. (Thinca)

4649ded287
2016-01-10 09:01:30 +09:00
588b09277b vim-patch:7.4.946
Problem:    Missing changes in source file.
Solution:   Include changes to the eval.c file.

bbfbaf9741
2016-01-10 09:01:30 +09:00
008c014cbe vim-patch:7.4.945
Problem:    New style testing is incomplete.
Solution:   Add the runtest script to the list of distributed files.
            Add the new functions to the function overview.
            Rename the functions to match Vim function style.
            Move undolevels testing into a new style test script.

683fa185a4
2016-01-10 09:01:30 +09:00
593df501b3 vim-patch:7.4.944
Problem:    Writing tests for Vim script is hard.
Solution:   Add assertEqual(), assertFalse() and assertTrue() functions.  Add
            the v:errors variable.  Add the runtest script. Add a first new
            style test script.

43345546ae
2016-01-10 09:01:30 +09:00
50db0312f9 build: ensure static jemalloc. #3970
Otherwise the dynamic library is built also and find_library will prefer
that over the static one. That results in linking against the dynamic
library which will not be found after install.

This code:
  8b3c399b6d/third-party/CMakeLists.txt (L130)
should prevent the above problem, but it doesn't hurt to be explicit.
2016-01-09 12:23:02 -05:00
c15446222b Merge pull request #3962 from sethjackson/windows-98
[RFC] doc: Remove references to Windows 98
2016-01-09 00:20:49 -05:00
665bd8de59 doc: Remove references to Windows 98. 2016-01-08 22:13:32 -05:00
36f17ce87e vim-patch.sh: fix regression 2016-01-08 19:12:36 -05:00
3706701d9b Merge pull request #3965 from jusga/vim-e3faf44
vim-patch:e3faf44
2016-01-08 19:01:07 -05:00
a42800ba45 Merge pull request #3963 from Pyrohh/contrib
[RFC] CONTRIBUTING.md: Remove outdated info
2016-01-08 18:28:59 -05:00
94fabe4d59 CONTRIBUTING.md: Remove outdated info
- Remove mention of "build-issues" and "runtime-issues" sections from
  the "Troubleshooting" page; they're already mentioned at the top of
  the section: "Before reporting an issue, see the ...".

- As of [1], clint-ignored-files.txt isn't used anymore.

[1]: 57eaefbb23
2016-01-08 17:47:09 -05:00
4bc3bcab22 vim-patch:e3faf44
Updated runtime files.

e3faf44bef
2016-01-08 23:14:47 +01:00
d51a27b7e5 Remove 'restorescreen' option
The relevant code was never actually in Neovim, most likely due to being
unifdef(1)'d out during the initial import.

see `:h hidden-options'
2016-01-08 14:59:18 -05:00
3b23d733dd Merge pull request #3943 from ZyX-I/better-fref-error
eval: Use better error messages when failing to dump values
2016-01-08 09:29:37 -05:00
af5c34f8a5 Merge pull request #3839 from justinmk/reprobuilds
semver (semantic versioning) compliance
2016-01-08 02:10:19 -05:00
b4b4536339 version: semver.org compliance
We use `git describe` to stamp pre-release versions (dev builds). But
`git describe` uses the result of the most-recent tag (the current
_release_ version)--so we must munge it with the _next_ (i.e.
unreleased) version.

Also fix non-git builds: do not invoke git_describe(NVIM_VERSION_MEDIUM)
if we're not in a git tree, else it gets the dummy value
"HEAD-HASH-NOTFOUND".

Example :version output in non-git build:
  NVIM 0.1.2-dev

Example :version output in git build:
  NVIM v0.1.2-176-g9c3c2b5
2016-01-08 01:09:22 -05:00
7643245470 BuildLibuv.cmake: make case consistent 2016-01-08 01:09:22 -05:00
fec35dc976 screen.c: Remove out of date comment
This was forgotten in 10b2a0e529
2016-01-07 15:29:33 -05:00
e57e303c6b Merge pull request #3956 from oni-link/cov.62611
coverity/62611: Nesting level does not match indentation
2016-01-07 10:11:21 -05:00
23669bd7df coverity/62611: Nesting level does not match indentation
The nested line was the else-branch of an if-then-else block that dealt
with cryptography, but after commit
85338fe1d5 (Remove cryptography) removed
the if-then part, the indentation of this line was not adjusted.
2016-01-07 12:31:05 +01:00
2d39eea9f0 Merge pull request #3952 from Pyrohh/repro-builds
build: Stop using __{DATE,TIME}__
2016-01-06 17:57:44 -05:00
c6aa71605f build: Stop using __{DATE,TIME}__
Recording the compilation time modifies the source for dubious gain, and
interferes with reproducible builds [1].

[1] https://reproducible-builds.org/
2016-01-06 17:24:21 -05:00
ZyX
c6f6033482 eval: Do not use msgpack#string for error messages 2016-01-07 00:54:58 +03:00
ZyX
bd4ca22cf0 documentation: Update documentation 2016-01-07 00:54:57 +03:00
ZyX
efaf76e623 functests: Update tests 2016-01-07 00:54:57 +03:00
ec580da5f4 doc: Clarify Windows feature tests for eval(). 2016-01-06 15:46:25 -05:00
0298b004f8 Merge pull request #3945 from sethjackson/win32-winnt
MinGW: libuv needs -D_WIN32_WINNT=0x0600
2016-01-06 02:45:07 -05:00
bd529ea3f3 MinGW: libuv needs -D_WIN32_WINNT=0x0600
Without this compilation fails due to a missing symbol: SRWLOCK in libuv
headers. _WIN32_WINNT defines the Windows header version that is to be used,
and it seems libuv requires this version. See

    b471b33da8
2016-01-04 19:51:09 -05:00
ZyX
d26b01d4bd eval: Use better error messages when failing to dump values
Examples:

    let g:SR = [[]]
    call add(g:SR[0], g:SR)
    wshada
    " E952: Unable to dump variable g:SR: container references itself in index 0, index 0

    let g:F = {'_TYPE': v:msgpack_types.map, '_VAL': [[{'abc': 1}, function("tr")]]}
    wshada
    " E951: Error while dumping variable g:F, key {'abc': 1} at index 0 from special map, key '': attempt to dump function reference
    " (no msgpack#string available)
    " E951: Error while dumping variable g:F, key {="abc": 1} at index 0 from special map, key '': attempt to dump function reference
    " (msgpack#string available)

    let g:F = {'_TYPE': v:msgpack_types.map, '_VAL': [[g:SR, function("tr")]]}
    wshada
    " E951: Error while dumping variable g:F, key [[[[{E724@0}]]]] at index 0 from special map, index 1: attempt to dump function reference

    call msgpackdump([g:SR])
    " E952: Unable to dump msgpackdump() argument, index 0: container references itself in index 0, index 0

Not tested yet.
2016-01-04 17:20:16 +03:00
074d3dc1f3 Merge pull request #3938 from sethjackson/s-islnk
Fix S_ISLNK definition in os_defs.h
2016-01-03 14:11:09 -05:00
3ce8de7c8f Fix S_ISLNK definition in os_defs.h. 2016-01-03 13:51:58 -05:00
59eaba2894 Merge pull request #3655 from bfredl/enc_default
Default to encoding=utf-8
2016-01-02 18:05:52 -05:00
70f6e2ce52 encoding: update tests 2016-01-02 23:22:13 +01:00
5a6633bc34 encoding: Update documentation 2016-01-02 23:21:57 +01:00
04bdeeb8b2 encoding: cleanup defaults of iskeyword, isprint and fileencodings 2016-01-02 23:21:51 +01:00
49b06a8f2a encoding: Always use "utf-8" as default for &encoding
Preverve the locale-depedency for fileencodings=default
2016-01-02 23:15:53 +01:00
cb62594042 Merge pull request #3927 from sethjackson/if-cscope
Windows: Bring back code branch for if_cscope
2016-01-02 12:35:21 -05:00
c9df429887 Merge pull request #3928 from justinmk/fix_ci_target
test: change CI_TARGET reference to CI
2016-01-02 01:21:42 -05:00
22a928aeac test: change CI_TARGET reference to CI
Travis defines[1] $CI for its builds, whereas $CI_TARGET is
a Neovim-specific env var from 6483a198e4
that lost prominence in d2eb4a9346.

[1] https://docs.travis-ci.com/user/environment-variables/
2016-01-01 23:58:42 -05:00
6f25ba0550 CI/travis: enable gcov for one build only. #3926 2016-01-01 22:20:16 -05:00
b2f9bfbff0 Windows: Bring back code branch for if_cscope.
The Vim code for windows in if_cscope.c/.h was removed during the refactor,
added missing code for error_closing().
2016-01-01 20:58:04 -05:00
4d27bd6bfe Merge pull request #3920 from sethjackson/vim-spec
Windows: Fix api/vim_spec.lua functional test
2016-01-01 17:22:40 -05:00
adf11f3478 Merge pull request #3925 from sethjackson/uv-uid-t
Windows: Make the os_get_uname argument portable
2016-01-01 14:56:11 -05:00
f1344bc219 Merge pull request #3903 from justinmk/vim-7.4.605
vim-patch:7.4.605
2016-01-01 14:38:17 -05:00
3fd62f9612 file_pat_to_reg_pat, buflist_findpat: const params
file_pat_to_reg_pat() and buflist_findpat() do not modify the data of
these parameters.
2016-01-01 14:26:32 -05:00
ff0253127e Windows: Make the os_get_uname argument portable.
Since uid_t is not defined on Windows use uv_uid_t instead.
We now use uv_uid_t everywhere except one place in src/nvim/main.c
which is wrapped in a #ifdef UNIX check.
2016-01-01 14:13:56 -05:00
df4ac79761 Merge pull request #3911 from sethjackson/have-fsync-guard
os_fsync
2016-01-01 12:13:40 -05:00
a79ebeeea4 Merge pull request #3707 from bfredl/oapblock
[use oap->motion_type also to represent block motion type
2016-01-01 08:17:05 -05:00
303ac3f283 normal: use oap->motion_type also to represent block motion type
Previously oap->motion_type == MCHAR would be blockwise if
oap->block_mode was set.
2016-01-01 12:56:51 +01:00
648aebb8b6 Port fsync() to libuv. 2016-01-01 00:12:28 -05:00
a48508de0d test/functional: Fix api/vim_spec.lua.
On Windows the default file format is DOS i.e. newlines are \r\n
instead of \n.
2015-12-31 23:28:55 -05:00
04cd3eef24 Merge pull request #3918 from sethjackson/servertest
Windows: fix serverstart functional test
2015-12-31 17:12:57 -05:00
6d5a5b02f6 Merge pull request #3304 from sethjackson/wildignorecase
Windows: Ignore EW_ICASE in do_path_expand
2015-12-31 17:02:57 -05:00
568ee1e3c2 Windows: Ignore EW_ICASE in do_path_expand
The do_path_expand() function is still using the unix_expandpath
variant from Vim. For Windows it should behave as the old
dos_expandpath() function. This commit adds an ifdef to ignore
EW_ICASE flag in this function, otherwise all matches fail on Windows
if wildignorecase is set.
2015-12-31 16:14:12 -05:00
091e885d44 Windows: fix serverstart functional test 2015-12-31 16:07:43 -05:00
68fb815bf1 Merge pull request #3881 from sethjackson/msvc-ui-call
MSVC: Fix UI_CALL for MSVC
2015-12-31 00:16:07 -05:00
8b3c399b6d build: use our mirror of LuaJIT-2.0.4.tar.gz
Point to new location.
2015-12-30 23:40:04 -05:00
bd39e2354f Merge pull request #3910 from Shougo/version
Update version.c to 7.4.1000
2015-12-30 20:24:21 -05:00
6a7535cd84 Update version.c to 7.4.1000
NA patches list:
607 Compiler warning
620 Compiler warning
624 result check for realloc
628 volatile add, but no code in neovim
641 tabnew fix, but no code in neovim
661 no K_CURSORHOLD in neovim
841 add ifdef
842 Windows GUI
854 CONTRIBUTION.md
863 FEAT_DIFF
864 Tiny build
923 add ifdef
924 configure changes
927 if_ruby
928 client server
930 Windows GUI
934 Appveyor
938 X11 and GTK GUI fix
940 term
948 ifdef
954 if_lua
959 term
960 Windows build
962 Makefile fix
965 ifdef fix
966 configure fix
967 Makefile fix
976 configure fix
979 crypt feature
985 if_ruby
986 test fix in Windows
987 if_ruby
988 build rule
990 Appveyor
992 build fix in Windows
994 tests for Windows
995 GTK GUI
996 GTK GUI
997 Travis CI
999 Makefile change
2015-12-31 10:05:37 +09:00
76bf21de26 vim-patch:7.4.605
Problem:    The # register is not writable, it cannot be restored after
            jumping around.
Solution:   Make the # register writable. (Marcin Szamotulski)

3b3a9498d1
2015-12-30 01:16:32 -05:00
d8a2007d47 Merge pull request #3869 from oni-link/fix.issue.3844
helpers.c: Handle msgpack str/bin objects with length 0 correctly
2015-12-30 01:01:23 -05:00
930ee40ad3 build: use our mirror of LuaJIT-2.0.4.tar.gz
The luajit.org download URL:
  http://luajit.org/download/LuaJIT-2.0.4.tar.gz
is breaking our travis builds because of connection problems.
2015-12-30 00:41:52 -05:00
541ba61ac9 Merge pull request #3874 from sethjackson/win-defs
MSVC: Define STDOUT_FILENO and STDERR_FILENO
2015-12-29 12:59:55 -05:00
6ee58e67cb Merge pull request #3879 from sethjackson/open-osfhandle
Windows: Fix cast in if_cscope.c
2015-12-26 17:42:50 +01:00
9040d7aed7 Merge pull request #3849 from Shougo/vim-7.4.675
vim-patch:7.4.675
2015-12-26 17:39:38 +01:00
f4e3c13bcc Merge pull request #3868 from Shougo/vim-7.4.608
vim-patch:7.4.608, 7.4.612
2015-12-26 17:27:40 +01:00
f0538639c0 Merge #2927 'vim-patch:7.4.858' 2015-12-25 08:34:40 -05:00
39555dc8c4 test: Makefile: add legacy cdo test 2015-12-25 08:34:07 -05:00
7f99d210fd vim-patch:7.4.858
Problem:    It's a bit clumsy to execute a command on a list of matches.
Solution:   Add the ":ldo", ":lfdo", ":cdo" and ":cfdo" commands. (Yegappan
            Lakshmanan)

aa23b37942
2015-12-24 08:08:50 +01:00
25eaacd10f doc: os_dos.txt: Remove more references to MS-DOS/Windows 95 #3889 2015-12-23 15:13:05 -05:00
91b8ab3d21 doc: Remove references to neXtaw GUI support #3892
We never supported it.
2015-12-22 19:14:11 -05:00
b654a2b324 doc: Fix invalid reference
found with `make -C runtime/doc html`
2015-12-22 18:50:10 -05:00
9649537f4c doc: mbyte.txt: Remove some low-hanging fruit
- Nvim has no concept of "huge" or "normal" features: the overwhelming
  majority of features are compiled in by default
- Nvim does not link to X (X11), so doesn't support setting things via
  ~/.Xresources, among many other things
2015-12-22 18:44:26 -05:00
47b9ac9013 doc: Remove references to Athena GUI support #3891
We don't support Athena anymore.
2015-12-22 18:39:51 -05:00
b9d1a7f810 doc: vi_diff: Update supported OS list #3890
We do not support every Unix flavor in existence so note
that here.

We do not support Windows 95 or NT. Update the list to
the Windows versions we do support.

We only support OS X not classic Mac OS so note that too.
2015-12-22 18:20:46 -05:00
944658e2e1 doc: Remove a reference to Windows ME #3888
We don't support Windows 95, Windows ME, or Windows 2000 anymore.
2015-12-22 15:52:27 -05:00
fbfe564b3c gitignore: Ignore errors.json
It's generated by `make lint`.
2015-12-22 15:22:21 -05:00
aa0af927da doc: os_win32: More cleanup #3884
Follow-up to ee1f8ea

Roger Knobbe is still mentioned in intro.txt, for anyone wondering.
2015-12-22 14:33:16 -05:00
5403924f7c doc: Remove some references to MS-DOS #3886
We don't support MS-DOS.
2015-12-22 14:14:28 -05:00
efb30a0068 Windows: Remove unused function #3878
The only call site was removed in 902ad8d.
2015-12-22 13:50:59 -05:00
c5d0c280d3 MSVC: Fix UI_CALL macro for MSVC.
The UI_CALL macro uses variadic macros and relies on the non standard
GCC extension. MSVC already applies similar behavior for the regular
__VA_ARGS__ removing the comma.
In MSVC UI_CALL can be implemented by calling UI_CALL_MORE directly.
2015-12-22 09:35:34 -05:00
ee1f8eab0c doc: Remove references to Windows 3.1 #3883 2015-12-21 22:48:57 -05:00
53a1db1a10 Windows: Fix cast in if_cscope.c. 2015-12-21 15:21:21 -05:00
eb53ec5ba2 MSVC: Define STDOUT_FILENO and STDERR_FILENO. 2015-12-21 00:01:16 -05:00
8373aaf44e helpers.c: Handle msgpack str/bin objects with length 0 correctly
When converting a msgpack object to a String object, strings (and byte
arrays) with length 0 are handled as errors. This is fixed by
always using the msgpack data pointer as a valid pointer. For a NULL
pointer there is nothing to copy.

Test by @snoe

Fixes #3844
2015-12-21 00:23:53 +01:00
376b973a0a Tests: fix according to lualint 2015-12-20 22:41:40 +01:00
e9161799bf Merge pull request #3867 from Shougo/vim-7.4.604
vim-patch:7.4.604
2015-12-20 15:31:45 -05:00
90537ae970 vim-patch:7.4.604
Problem:    Running tests changes viminfo.
Solution:   Disable viminfo.

6bf7c523ad
2015-12-19 12:58:01 +09:00
884c124130 vim-patch:7.4.608, 7.4.612
Problem:    test_eval fails when the clipboard feature is missing.
Solution:   Skip part of the test. Reduce the text used.

4ac163ae5f

Problem:    test_eval fails on Mac.
Solution:   Use the * register instead of the + register. (Jun Takimoto)

e08dd4e49e
2015-12-19 11:07:45 +09:00
e123675bcc Merge pull request #3722 from ZyX-I/fix-3721
shada: Continue dumping when variables failed to dump
2015-12-18 11:55:15 -05:00
ZyX
5c112c0cb9 shada: Free wms->hms in shada_write_exit
Otherwise there should be memory leak.
2015-12-18 19:29:49 +03:00
ZyX
ea67bf808b shada: Continue dumping when variables failed to dump
Closes #3721
2015-12-18 19:29:49 +03:00
f638572164 Merge pull request #3863 from justinmk/vim-8a94d87
vim-patch:8a94d87
2015-12-18 10:51:37 -05:00
65f11d0a00 vim-patch:8a94d87
Update runtime files.

8a94d873aa
2015-12-17 21:56:41 -05:00
1e7a553ed7 vim-patch.sh: force LC_ALL=C for preprocessing
Any patch may contain mixed encodings, so we must process them as byte
arrays. E.g. with stock `sed` on OS X patch
8a94d873aa8c753a8522ea86a049bdf2abd0c507 causes this error:
    sed: RE error: illegal byte sequence
To avoid that, set LC_ALL=C.

Also remove redundant *.patch creation from review_pr().
2015-12-17 21:28:54 -05:00
ecdf18edbb Merge pull request #3860 from justinmk/vim-0122c40
vim-patch:0122c40
2015-12-17 15:23:35 -05:00
cb0b89f8ba vim-patch:0122c40
Update runtime files.

0122c4070f
2015-12-17 05:14:40 -05:00
5b30ba7b99 Merge pull request #3859 from justinmk/vim-83caecf
vim-patch:83caecf
2015-12-17 05:06:07 -05:00
7581046b60 Merge pull request #3858 from justinmk/vim-9da7ff7
vim-patch:9da7ff7
2015-12-17 04:57:53 -05:00
1f27ccb77f vim-patch:83caecf
Updated runtime files.

83caecf314
2015-12-17 04:52:20 -05:00
aa4cc17bb0 vim-patch:9da7ff7
Updated runtime files.

9da7ff70cc
2015-12-17 04:40:15 -05:00
9d64d75031 vim-patch.sh: fix order of non-tagged patches
Sort non-tagged patches in descending order, like tagged patches.
2015-12-17 04:07:03 -05:00
b051f33814 Merge pull request #3851 from brcolow/vim-7.4.682
vim-patch:7.4.682
2015-12-16 23:44:02 -05:00
67f03f33a7 vim-patch:7.4.682
Problem: The search highlighting and match highlighting replaces the
cursorline highlighting, this doesn't look good.
Solution: Combine the highlighting. (Yasuhiro Matsumoto)

09deeb7c94
2015-12-16 13:13:04 -07:00
f9647d99b4 Merge pull request #3842 from sethjackson/cross-compile
Fix CMakeLists.txt search paths for cross compile
2015-12-16 10:18:15 -05:00
c42cb49a96 Merge pull request #3846 from sethjackson/win-defs
MSVC: Define S_IXUSR.
2015-12-16 10:12:49 -05:00
aa36af214a MSVC: Define S_IXUSR. 2015-12-16 05:46:49 -05:00
75cfd3c0ca Merge pull request #3848 from Shougo/vim-7.4.665
vim-patch:7.4.665
vim-patch:7.4.671
2015-12-15 21:54:22 -05:00
5cb01bafa8 Merge pull request #3847 from Pyrohh/move-uncrustify
Move uncrustify.cfg to contrib/
2015-12-15 21:24:37 -05:00
243b492c0d contrib: Move uncrustify.cfg to contrib/
It hasn't been used in quite a while, so it's probably safe to move it
out of the repository root.
2015-12-15 15:34:49 -05:00
e1abbe6b67 vim-patch:7.4.675
Problem:    When a FileReadPost autocommand moves the cursor inside a line it
            gets moved back.
Solution:   When checking whether an autocommand moved the cursor store the
            column as well. (Christian Brabandt)

eab316bdf9
2015-12-16 05:24:38 +09:00
4cc38e04c7 vim-patch:7.4.665, 671
Problem:    'linebreak' does not work properly with multi-byte characters.
Solution:   Compute the pointer offset with mb_head_off().  (Yasuhiro
            Matsumoto)

76feaf1bfe

Problem:    Warning for shadowing a variable.
Solution:   Rename off to mb_off. (Kazunobu Kuriyama)

4df702999d
2015-12-16 05:18:25 +09:00
8be2ab11de Fix CMakeLists.txt search paths for cross compile 2015-12-15 13:53:46 -05:00
1946f96a16 Merge pull request #3841 from sethjackson/fname-illegal
Windows: define FNAME_ILLEGAL
2015-12-14 23:27:27 -05:00
e117544d72 Windows: define FNAME_ILLEGAL. 2015-12-14 17:45:35 -05:00
77c0f9a62b Merge #3623 'vim-patch:7.4.{670,723,803}' 2015-12-13 14:18:05 -05:00
ad34a376eb Fix linting errors. 2015-12-13 13:06:48 +01:00
c3ac16cfeb Solve warnings. 2015-12-13 13:06:48 +01:00
3b472e55b3 vim-patch:7.4.803
Problem:    C indent does not support C11 raw strings. (Mark Lodato)
Solution:   Do not change indent inside the raw string.

f7bb86dc59
2015-12-13 13:06:48 +01:00
b079622716 Appease clint. 2015-12-13 13:06:48 +01:00
238a8d33fa vim-patch:7.4.723
Problem:    For indenting, finding the C++ baseclass can be slow.
Solution:   Cache the result. (Hirohito Higashi)

4032cfdf17
2015-12-13 13:06:39 +01:00
123361f187 vim-patch:7.4.670
Problem:    Using 'cindent' for Javascript is less than perfect.
Solution:   Improve indenting of continuation lines. (Hirohito Higashi)

dcefba9934
2015-12-13 11:55:37 +01:00
8a34d21b0d Merge pull request #3706 from Pyrohh/version_commit
Remove "Commit:" field from `--version` output
2015-12-13 03:00:09 -05:00
7387816dcb Merge pull request #3481 from fabiopozzi/improve-it-translation
l10n: it translation
2015-12-13 02:14:26 -05:00
f406ae412e Merge pull request #3838 from Shougo/vim-7.4.658
vim-patch:7.4.658
2015-12-13 01:47:34 -05:00
c3e4e0e383 Merge pull request #3837 from Shougo/vim-7.4.645
vim-patch:7.4.645
2015-12-13 01:45:17 -05:00
cd1be8350d Merge pull request #3834 from Shougo/vim-7.4.635
vim-patch:7.4.635
2015-12-13 01:42:34 -05:00
0488fea0de vim-patch:7.4.635
Problem:    If no NL or CR is found in the first block of a file then the
            'fileformat' may be set to "mac". (Issue 77)
Solution:   Check if a CR was found. (eswald)

05eb612ff3
2015-12-13 15:06:35 +09:00
3c9d8ac99e Merge #3718 'vim-patch:7.4.655' 2015-12-13 00:35:09 -05:00
014d692013 Merge pull request #3835 from Shougo/vim-7.4.640
vim-patch:7.4.640
2015-12-13 00:31:30 -05:00
28821397f6 Merge pull request #3836 from sethjackson/set-init-3
Windows: Remove broken check for WIN3264
2015-12-13 00:24:44 -05:00
1b6e7f9e39 test: fixeol_spec: setup/teardown
Without this cleanup, test will fail if run multiple times.
2015-12-13 00:21:11 -05:00
aca51f3d93 Merge #3443 'vim-patch:7.4.{785,795,898}' 2015-12-13 00:09:07 -05:00
a9b4cedb08 Windows: Remove broken check for WIN3264.
We do not define WIN3264 so this check was broken.

Futher since UNIX is defined on all Unix platforms
we support we can simply remove this #ifdef.
2015-12-12 23:30:43 -05:00
815fe24604 vim-patch:7.4.658
Problem:    'formatexpr' is evaluated too often.
Solution:   Only invoke it when beyond the 'textwidth' column, as it is
            documented. (James McCoy)

0f8dd840fc
2015-12-13 13:10:31 +09:00
d1ec3f661a vim-patch:7.4.645
Problem:    When splitting the window in a BufAdd autocommand while still in
            the first, empty buffer the window count is wrong.
Solution:   Do not reset b_nwindows to zero and don't increment it.

8da9bbfd02
2015-12-13 13:01:46 +09:00
ebdb802bf5 Merge pull request #3816 from sethjackson/win-setenv
Windows: Implement os_setenv()
2015-12-12 22:57:02 -05:00
f1b9a59ed6 vim-patch:7.4.640
Problem:    After deleting characters in Insert mode such that lines are
            joined undo does not work properly. (issue 324)
Solution:   Use Insstart instead of Insstart_orig. (Christian Brabandt)

c3bbad085c
2015-12-13 12:53:30 +09:00
810d31a430 Windows: Implement os_setenv() using _putenv_s()
Windows does not have setenv(), instead the _putenv_s() function is used - added
a function check and fatal errors. Implemented os_setenv() for Windows.

Vim supports the original putenv() function if no alternative is available.
Neovim only supports systems where safer alternatives exist, so the check for
putenv() was removed from config/CMakeLists.txt.
2015-12-12 22:33:10 -05:00
f183cc14de doc: nvim_python: mention --upgrade. #3832 2015-12-12 20:56:17 -05:00
5c4a5d0677 Merge pull request #3589 from ZyX-I/remove-internal_refcount
eval: Replace internal_refcount hack with proper copyID setting
2015-12-12 20:41:00 -05:00
291a43e1dd Fix indenting nested elseifs
Currently,
```
if bool then
  --stuff
elseif bool2 then
  --morestuff
elseif bool3 then
  --more stuff
else
  --fail
end
```

Would get indented out strangely when using =. Now it behaves correctly.
2015-12-12 17:07:25 -08:00
ZyX
5b96d370df eval: Use list_unref in place of decrementing refcount directly 2015-12-13 03:44:54 +03:00
ZyX
1cf7de074b eval: Replace internal_refcount hack with proper copyID setting 2015-12-13 03:44:53 +03:00
cc203e4b93 Merge pull request #3753 from watiko/vim-7.4.790
Vim 7.4.{786,787,789,790}
2015-12-12 17:43:23 -05:00
f37ad6af36 Merge pull request #3807 from ZyX-I/improve-clint
Make clint.py better follow our style guide
2015-12-12 17:32:05 -05:00
ZyX
a35c45732c shada: Fix all linter errors in src/nvim/shada.*
This commit is an example of fixing incorrect code which previously passed
through linter.
2015-12-13 00:47:46 +03:00
2b12406f2e Merge pull request #3824 from sethjackson/pstrcmp
Windows: Remove UNIX guard for pstrcmp()
2015-12-12 14:45:46 -05:00
3b74ee1ce9 Merge pull request #3825 from sethjackson/modname
Windows: Remove unnecessary codepath from modname
2015-12-12 14:32:46 -05:00
158dc2b7a7 Merge pull request #3826 from sethjackson/remove-getscript
Remove getscript.vim
2015-12-12 11:38:23 -05:00
5262cf2f19 Remove getscript.vim. 2015-12-12 09:18:51 -05:00
7f8365e302 Windows: Remove unnecessary codepath from modname.
File names starting with periods are perfectly acceptable on Windows
file systems. The only place where this is not acceptable is on
MS-DOS FAT file systems which only support 8.3 file names.

See here:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx

Since Neovim does not support MS-DOS or 8.3 file names (#605)
we can drop this codepath.

It was not compiling anyways since we do not define WIN3264.
2015-12-11 20:26:38 -05:00
fe143ac439 Windows: Remove UNIX guard for pstrcmp()
@equalsraf: I took a look at the Vim source pstrcmp() is actually used in the
dos_expandpath(misc1.c). The only difference between the UNIX and WIN32 version
of the functions is the _cdecl call convention annotation - the body of the
function is identical. Neovim kept the comment from the Unix function but not
from the Windows variant. Seems to me its safe to use the same function for
both - and just correct the comment.
2015-12-11 19:10:06 -05:00
1b56425662 Make clint status valid 2015-12-12 08:15:34 +09:00
74341ca5ca Fix the memory leaking 2015-12-12 05:28:27 +09:00
8c684b2fdb Revert char to char_u 2015-12-12 04:26:22 +09:00
a3a8df8359 tests: Improve legacy autocmd_option.
* Compare tables instead of strings
 * Add neovim specific test
2015-12-12 03:34:17 +09:00
ZyX
e796632240 clint: Check indentation and alignment inside expressions 2015-12-11 19:08:46 +03:00
81960df9f5 statusline: Check width before advancing pointer. #3818
Closes #3763

Helped-by: oni-link <knil.ino@gmail.com>
2015-12-10 03:19:02 -05:00
fcf829963e Merge pull request #3813 from Shougo/remote
Fix UpdateRemotePlugins fails problem
2015-12-09 23:26:19 -05:00
bf65b3ab45 Merge pull request #3804 from sethjackson/signal-guards
Add guards for SIGPIPE and SIGQUIT
2015-12-09 23:17:07 -05:00
87abe073d9 Merge pull request #3783 from sethjackson/log-file-def
Update USR_LOG_FILE definition.
2015-12-09 21:29:49 -05:00
ZyX
74c960007f clint: Check for spaces after { and before } 2015-12-09 19:55:34 +03:00
ZyX
4c0ac1ca26 clint: Do not special-case for() semicolons 2015-12-09 18:37:13 +03:00
f338fee482 Fix UpdateRemotePlugins fails problem 2015-12-10 00:09:55 +09:00
f40c8c4c23 Merge pull request #3805 from sethjackson/windows-home
Windows: Define HOME environment variable
2015-12-09 09:52:48 -05:00
3abbdb2f41 Windows: Define HOME environment variable
- Bring back Vim code for settings $HOME in Windows from
  $HOMEDRIVE$HOMEPATH
- vim-patch:0
2015-12-08 22:55:40 -05:00
ZyX
86c0bd14ec clint: Disallow old style comments everywhere, except for macros 2015-12-08 13:54:20 +03:00
ZyX
77836ff01b clint: Make sure that braces are always used for if and other clauses 2015-12-08 13:22:31 +03:00
67a7b1785c Add guards for SIGPIPE and SIGQUIT
In some systems the signals SIGPIPE and SIGQUIT are not available.
2015-12-08 00:17:34 -05:00
0ab4f2f18f Update USR_LOG_FILE definition. 2015-12-07 19:26:26 -05:00
6d583f8587 Merge pull request #3780 from sethjackson/header-guards
Add missing guard for HAVE_UNISTD_H
2015-12-07 03:16:03 -05:00
f838755fc0 Merge pull request #3782 from sethjackson/mingw-luajit
MinGW: Add libluajit-5.1 lib name to FindLuaJit
2015-12-07 03:14:54 -05:00
618c8d0e82 Merge pull request #3793 from mhinz/docs/remove-shell-cmd
Docs: remove references to removed :shell command
2015-12-06 10:15:13 -05:00
b6b84cb94f Docs: remove reference to removed :shell command
References #3791.
2015-12-06 14:21:22 +01:00
3a60f927b8 Improve coding style 2015-12-06 07:41:09 +09:00
7be12edd38 Remove "Commit:" field from --version output
If nvim is built from a non-tagged commit, the truncated commit hash is
already appended to the main version string (e.g., "NVIM v0.1.0-83-g959f260 ..."),
making the "Commit:" field redundant.

Regarding the truncated hash length: we don't have nearly enough commits
to worry about collisions, and probably won't ever, so the default
length should be fine.
2015-12-05 16:15:32 -05:00
655f1b7513 MinGW: Add libluajit-5.1 lib name to FindLuaJit 2015-12-02 23:07:22 -05:00
07eaff7c26 Add missing guard for HAVE_UNISTD_H 2015-12-02 19:54:33 -05:00
8c00c34b91 tests: Keep each autocmd_option's test in isolation. 2015-11-28 20:15:28 +09:00
597547e797 Use vim_snprintf instead of sprintf 2015-11-28 20:15:28 +09:00
972b43459b Improve coding style 2015-11-28 19:48:17 +09:00
cf673f60c6 Improve coding style 2015-11-28 18:24:57 +09:00
d9c0293824 tests: Improve legacy test autocmd_option. 2015-11-28 17:22:53 +09:00
21956adb6e tests: Migrate legacy test autocmd_option. 2015-11-28 17:22:53 +09:00
fe9d91ceb6 vim-patch:7.4.790
Problem:    Test fails when the autochdir feature is not available.  Test
            output contains the test script.
Solution:   Check for the autochdir feature. (Kazunobu Kuriyama)  Only write
            the relevant test output.

d113a80c77
2015-11-28 17:22:53 +09:00
09f6066bb4 vim-patch:7.4.789
Problem:    Using freed memory and crash. (Dominique Pellej)
Solution:   Correct use of pointers. (Hirohito Higashi)

9cac424d05
2015-11-28 17:22:52 +09:00
789041c282 vim-patch:7.4.787
Problem:    snprintf() isn't available everywhere.
Solution:   Use vim_snprintf(). (Ken Takata)

fb9bc4829a
2015-11-28 17:22:52 +09:00
119545190c vim-patch:7.4.786
Problem:    It is not possible for a plugin to adjust to a changed setting.
Solution:   Add the OptionSet autocommand event. (Christian Brabandt)

537443018d
2015-11-28 17:22:28 +09:00
98f9ff730b vim-patch:7.4.898
Problem:    The 'fixendofline' option is set on with ":edit".
Solution:   Don't set the option when clearing a buffer. (Yasuhiro Matsumoto)

04dfd51229
2015-11-22 20:06:07 +01:00
8d07058097 vim-patch:7.4.795
Problem:    The 'fixeol' option is not copied to a new window.
Solution:   Copy the option value. (Yasuhiro Matsumoto)

b388be0abf
2015-11-22 20:03:41 +01:00
b1d7b5294a Convert legacy test for fixeol to lua test. 2015-11-22 20:03:41 +01:00
a86d4b323e vim-patch:7.4.785
Problem:    On some systems automatically adding the missing EOL causes
            problems. Setting 'binary' has too many side effects.
Solution:   Add the 'fixeol' option, default on. (Pavel Samarkin)

34d72d4b6c
2015-11-22 20:03:41 +01:00
cfa2107e33 vim-patch:7.4.655
Problem:    Text deleted by "dit" depends on indent of closing tag.
            (Jan Parthey)
Solution:   Do not adjust oap->end in do_pending_operator(). (Christian
            Brabandt)

b6c2735c56
2015-11-22 02:52:50 +01:00
c9067dbe8a build: fix '-fno-sanitize-recover' warning in Clang 3.7 2015-11-03 14:19:04 +08:00
36af4af27a Improved it translation: make check-po-it now OK.
Fixed some fuzzy translation matches.
Fixed all make check-po-it errors, now it builds OK.
2015-10-20 22:01:58 +02:00
913 changed files with 73954 additions and 43335 deletions

View File

@ -1,3 +0,0 @@
# libuv queue.h pointer arithmetic is not accepted by asan
fun:queue_node_data
fun:dictwatcher_node_data

View File

@ -3,8 +3,6 @@
set -e
set -o pipefail
if [[ -n "${CI_TARGET}" ]]; then
exit
if [[ -n "${GCOV}" ]]; then
coveralls --gcov "$(which "${GCOV}")" --encoding iso-8859-1 || echo 'coveralls upload failed.'
fi
coveralls --gcov "$(which "${GCOV}")" --encoding iso-8859-1 || echo 'coveralls upload failed.'

View File

@ -3,12 +3,6 @@
set -e
set -o pipefail
if [[ "${TRAVIS_OS_NAME}" != linux ]]; then
# Caches are only enabled for Travis's Linux container infrastructure,
# but this script is still executed on OS X.
exit
fi
# Don't cache pip's log and selfcheck.
rm -rf "${HOME}/.cache/pip/log"
rm -f "${HOME}/.cache/pip/selfcheck.json"
@ -16,7 +10,7 @@ rm -f "${HOME}/.cache/pip/selfcheck.json"
# Update the third-party dependency cache only if the build was successful.
if [[ -f "${SUCCESS_MARKER}" ]]; then
rm -rf "${HOME}/.cache/nvim-deps"
mv -T "${DEPS_BUILD_DIR}" "${HOME}/.cache/nvim-deps"
mv "${DEPS_BUILD_DIR}" "${HOME}/.cache/nvim-deps"
touch "${CACHE_MARKER}"
echo "Updated third-party dependencies (timestamp: $(stat -c '%y' "${CACHE_MARKER}"))."
fi

View File

@ -12,13 +12,13 @@ if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
fi
echo "Upgrade Python 2's pip."
pip2.7 install --user --upgrade pip
pip2.7 -q install --user --upgrade pip
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
echo "Install Python 3."
brew install python3
echo "Upgrade Python 3's pip."
pip3 install --user --upgrade pip
pip3 -q install --user --upgrade pip
else
# TODO: Replace with upgrade when Travis gets python3-pip package.
echo "Install pip for Python 3."

View File

@ -25,10 +25,10 @@ if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
# That allows to test changing the group of the file by `os_fchown`.
sudo dscl . -create /Groups/chown_test
sudo dscl . -append /Groups/chown_test GroupMembership "${USER}"
else
# Compile dependencies.
build_deps
fi
# Compile dependencies.
build_deps
rm -rf "${LOG_DIR}"
mkdir -p "${LOG_DIR}"

44
.ci/build.bat Normal file
View File

@ -0,0 +1,44 @@
:: These are native MinGW builds, but they use the toolchain inside
:: MSYS2, this allows using all the dependencies and tools available
:: in MSYS2, but we cannot build inside the MSYS2 shell.
echo on
if "%CONFIGURATION%" == "MINGW_32" (
set ARCH=i686
set BITS=32
) else (
set ARCH=x86_64
set BITS=64
)
:: We cannot have sh.exe in the PATH (MinGW)
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
set PATH=C:\msys64\mingw%BITS%\bin;C:\Windows\System32;C:\Windows;%PATH%
:: The default cpack in the PATH is not CMake
set PATH=C:\Program Files (x86)\CMake\bin\cpack.exe;%PATH%
:: Build third-party dependencies
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Su" || goto :error
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S mingw-w64-%ARCH%-cmake mingw-w64-%ARCH%-perl mingw-w64-%ARCH%-python2 mingw-w64-%ARCH%-diffutils gperf" || goto :error
mkdir .deps
cd .deps
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ..\third-party\ || goto :error
mingw32-make VERBOSE=1 || goto :error
cd ..
:: Build Neovim
mkdir build
cd build
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUSTED_OUTPUT_TYPE=gtest -DGPERF_PRG="C:\msys64\usr\bin\gperf.exe" .. || goto :error
mingw32-make VERBOSE=1 || goto :error
bin\nvim --version || goto :error
:: Functional tests
mingw32-make functionaltest VERBOSE=1 || goto :error
:: Build artifacts
cpack -G ZIP -C Release
if defined APPVEYOR_REPO_TAG_NAME cpack -G NSIS -C Release
goto :EOF
:error
exit /b %errorlevel%

View File

@ -1,14 +1,9 @@
build_deps() {
if [[ "${BUILD_32BIT}" == ON ]]; then
if [[ "${BUILD_MINGW}" == ON ]]; then
>&2 echo "32-bit MinGW builds not supported."
exit 1
fi
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
fi
if [[ "${BUILD_MINGW}" == ON ]]; then
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_MINGW}"
if [[ "${FUNCTIONALTEST}" == "functionaltest-lua" ]]; then
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
fi
rm -rf "${DEPS_BUILD_DIR}"
@ -16,10 +11,15 @@ build_deps() {
# If there is a valid cache and we're not forced to recompile,
# use cached third-party dependencies.
if [[ -f "${CACHE_MARKER}" ]] && [[ "${BUILD_NVIM_DEPS}" != true ]]; then
echo "Using third-party dependencies from Travis's cache (last updated: $(stat -c '%y' "${CACHE_MARKER}"))."
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
local statcmd="stat -f '%Sm'"
else
local statcmd="stat -c '%y'"
fi
echo "Using third-party dependencies from Travis's cache (last updated: $(${statcmd} "${CACHE_MARKER}"))."
mkdir -p "$(dirname "${DEPS_BUILD_DIR}")"
mv -T "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}"
mv "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}"
else
mkdir -p "${DEPS_BUILD_DIR}"
fi
@ -28,7 +28,7 @@ build_deps() {
# update CMake configuration and update to newer deps versions.
cd "${DEPS_BUILD_DIR}"
echo "Configuring with '${DEPS_CMAKE_FLAGS}'."
cmake ${DEPS_CMAKE_FLAGS} "${TRAVIS_BUILD_DIR}/third-party/"
CC= cmake ${DEPS_CMAKE_FLAGS} "${TRAVIS_BUILD_DIR}/third-party/"
if ! ${MAKE_CMD}; then
exit 1
@ -42,16 +42,8 @@ build_nvim() {
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
fi
if [[ "${BUILD_32BIT}" == ON ]]; then
if [[ "${BUILD_MINGW}" == ON ]]; then
>&2 echo "32-bit MinGW builds not supported."
exit 1
fi
CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
fi
if [[ "${BUILD_MINGW}" == ON ]]; then
CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_MINGW}"
fi
mkdir -p "${BUILD_DIR}"
cd "${BUILD_DIR}"

View File

@ -53,7 +53,7 @@ run_unittests() {
}
run_functionaltests() {
if ! ${MAKE_CMD} -C "${BUILD_DIR}" functionaltest; then
if ! ${MAKE_CMD} -C "${BUILD_DIR}" ${FUNCTIONALTEST}; then
asan_check "${LOG_DIR}"
valgrind_check "${LOG_DIR}"
exit 1
@ -63,6 +63,7 @@ run_functionaltests() {
}
run_oldtests() {
${MAKE_CMD} -C "${BUILD_DIR}" helptags
if ! make -C "${TRAVIS_BUILD_DIR}/src/nvim/testdir"; then
reset
asan_check "${LOG_DIR}"
@ -83,8 +84,9 @@ install_nvim() {
exit 1
}
local genvimsynf=syntax/vim/generated.vim
# Check that all runtime files were installed
for file in doc/tags syntax/vim/generated.vim $(
for file in doc/tags $genvimsynf $(
cd runtime ; git ls-files | grep -e '.vim$' -e '.ps$' -e '.dict$' -e '.py$' -e '.tutor$'
) ; do
if ! test -e "${INSTALL_PREFIX}/share/nvim/runtime/$file" ; then
@ -93,6 +95,13 @@ install_nvim() {
fi
done
# Check that generated syntax file has function names, #5060.
local gpat='syn keyword vimFuncName .*eval'
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf"; then
echo "It appears that $genvimsynf does not contain $gpat."
exit 1
fi
for file in $(
cd runtime ; git ls-files | grep -e '.awk$' -e '.sh$' -e '.bat$'
) ; do

View File

@ -9,22 +9,19 @@ fi
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
brew install gettext
elif [[ "${BUILD_MINGW}" == ON ]]; then
# TODO: When Travis gets a recent version of Mingw-w64 use packages:
# binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-dev mingw-w64-tools
echo "Downloading MinGW..."
curl -sSL "http://downloads.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/gcc-4.8-release/i686-w64-mingw32-gcc-4.8.0-linux64_rubenvb.tar.xz" | tar xJf - -C "${HOME}/.local"
brew reinstall -s libtool
fi
# Set CC to default to avoid compilation problems
# when installing Python modules.
# Use default CC to avoid compilation problems when installing Python modules.
echo "Install neovim module and coveralls for Python 2."
CC=cc pip2.7 install --user --upgrade neovim cpp-coveralls
CC=cc pip2.7 -q install --user --upgrade neovim cpp-coveralls
echo "Install neovim module for Python 3."
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
CC=cc pip3 install --user --upgrade neovim
CC=cc pip3 -q install --user --upgrade neovim
else
CC=cc pip3.3 install --user --upgrade neovim
CC=cc pip3.3 -q install --user --upgrade neovim
fi
echo "Install neovim RubyGem."
gem install --no-document --version ">= 0.2.0" neovim

View File

@ -3,14 +3,6 @@
set -e
set -o pipefail
# TODO: Stop here for MinGW builds,
# building Neovim doesn't work yet.
if [[ "${BUILD_MINGW}" == ON ]]; then
echo "Neovim doesn't build on MinGW yet; stopping build."
touch "${SUCCESS_MARKER}"
exit
fi
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${CI_DIR}/common/build.sh"
source "${CI_DIR}/common/test.sh"

View File

@ -4,7 +4,7 @@ set -e
set -o pipefail
if [[ -n "${CI_TARGET}" ]]; then
make lint
make "${CI_TARGET}"
exit 0
fi
@ -12,9 +12,6 @@ fi
# as $USER, while retaining the environment variables defined and belonging
# to secondary groups given above in usermod.
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
# Set up precompiled third-party dependencies.
eval "$(curl -Ss https://raw.githubusercontent.com/neovim/bot-ci/master/scripts/travis-setup.sh) deps-x64"
sudo -E su "${USER}" -c ".ci/run_tests.sh"
else
.ci/run_tests.sh

12
.editorconfig Normal file
View File

@ -0,0 +1,12 @@
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
charset = utf_8
[Makefile]
indent_style = tab
tab_width = 4

22
.gitignore vendored
View File

@ -23,11 +23,10 @@ tags
# Files generated by the tests
/src/nvim/testdir/del
/src/nvim/testdir/mbyte.vim
/src/nvim/testdir/small.vim
/src/nvim/testdir/tiny.vim
/src/nvim/testdir/test*.out
/src/nvim/testdir/test*.res
/src/nvim/testdir/test.log
/src/nvim/testdir/messages
/src/nvim/testdir/viminfo
/src/nvim/testdir/test.ok
/src/nvim/testdir/*.failed
@ -44,26 +43,13 @@ tags
# luarocks, not added as a subtree because of the large number of blobs
/third-party/luarocks
# luajit files
/third-party/luajit/src/host/buildvm
/third-party/luajit/src/host/buildvm_arch.h
/third-party/luajit/src/host/minilua
/third-party/luajit/src/jit/vmdef.lua
/third-party/luajit/src/libluajit.a
/third-party/luajit/src/lj_bcdef.h
/third-party/luajit/src/lj_ffdef.h
/third-party/luajit/src/lj_folddef.h
/third-party/luajit/src/lj_libdef.h
/third-party/luajit/src/lj_recdef.h
/third-party/luajit/src/lj_vm.s
/third-party/luajit/src/luajit
# local make targets
local.mk
# runtime/doc
/runtime/doc/*.html
/runtime/doc/tags.ref
/runtime/doc/doctags
/runtime/doc/errors.log
# clint errors, generated by `make lint`
/errors.json

View File

@ -8,12 +8,10 @@ env:
# Travis has 1.5 virtual cores according to
# http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
- MAKE_CMD="make -j2"
# Update PATH for pip and MinGW.
- PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:$HOME/.local/mingw32/bin:$PATH"
# Update PATH for pip.
- PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:$PATH"
# LLVM symbolizer path.
- LLVM_SYMBOLIZER="$(which llvm-symbolizer-3.6)"
# Force verification of DLOG macros.
- CFLAGS="-DMIN_LOG_LEVEL=0"
- LLVM_SYMBOLIZER="$(which llvm-symbolizer-3.4)"
# Build directory for Neovim.
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
# Build directory for third-party dependencies.
@ -28,20 +26,17 @@ env:
- CMAKE_FLAGS="-DTRAVIS_CI_BUILD=ON
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
-DUSE_GCOV=ON
-DBUSTED_OUTPUT_TYPE=gtest
-DDEPS_PREFIX=$DEPS_BUILD_DIR/usr"
-DDEPS_PREFIX=$DEPS_BUILD_DIR/usr
-DMIN_LOG_LEVEL=0"
- DEPS_CMAKE_FLAGS="-DDEPS_DOWNLOAD_DIR:PATH=$DEPS_DOWNLOAD_DIR"
# Additional CMake flags for 32-bit builds.
- CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32
-DCMAKE_IGNORE_PATH=/lib:/usr/lib:/usr/local/lib
-DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
# Additional CMake flags for MinGW builds.
- CMAKE_FLAGS_MINGW="-DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/mingw32-w64-cross-travis.toolchain.cmake"
# Environment variables for Clang sanitizers.
- ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:log_path=$LOG_DIR/asan"
- ASAN_SYMBOLIZER_PATH="$LLVM_SYMBOLIZER"
- MSAN_SYMBOLIZER_PATH="$LLVM_SYMBOLIZER"
- TSAN_OPTIONS="external_symbolizer_path=$LLVM_SYMBOLIZER log_path=$LOG_DIR/tsan"
- UBSAN_OPTIONS="log_path=$LOG_DIR/ubsan"
# Environment variables for Valgrind.
@ -55,41 +50,38 @@ env:
# if the tests were successful, but don't have this information
# available in before_cache (which is run before after_success).
- SUCCESS_MARKER="$BUILD_DIR/.tests_successful"
# default target name for functional tests
- FUNCTIONALTEST=functionaltest
matrix:
include:
- os: linux
env: CI_TARGET=clint
env: CI_TARGET=lint
- os: linux
compiler: gcc-5
env: GCOV=gcov-5
env: GCOV=gcov-5 CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
- os: linux
compiler: gcc-5
env: FUNCTIONALTEST=functionaltest-lua
- os: linux
# Travis creates a cache per compiler.
# Set a different value here to store 32-bit
# dependencies in a separate cache.
compiler: gcc-5 -m32
env: GCOV=gcov-5 BUILD_32BIT=ON
env: BUILD_32BIT=ON
- os: linux
compiler: clang-3.6
env: GCOV=llvm-cov-3.6 CLANG_SANITIZER=ASAN_UBSAN
compiler: clang
env: CLANG_SANITIZER=ASAN_UBSAN
- os: linux
compiler: clang-3.6
env: GCOV=llvm-cov-3.6 CLANG_SANITIZER=MSAN
- os: linux
compiler: clang-3.6
compiler: clang
env: CLANG_SANITIZER=TSAN
- os: osx
compiler: clang
env: GCOV=gcov
osx_image: xcode7.3 # macOS 10.11
- os: osx
compiler: gcc-4.9
env: GCOV=gcov-4.9
- os: linux
env: BUILD_MINGW=ON
osx_image: xcode7.3 # macOS 10.11
fast_finish: true
allow_failures:
# TODO: Remove when all MSan errors have been fixed.
- env: GCOV=llvm-cov-3.6 CLANG_SANITIZER=MSAN
before_install: .ci/before_install.sh
install: .ci/install.sh
@ -103,13 +95,12 @@ addons:
sources:
# TODO: Remove PPA when Travis gets Python >=3.3.
- deadsnakes
- llvm-toolchain-precise-3.6
- ubuntu-toolchain-r-test
packages:
- autoconf
- automake
- build-essential
- clang-3.6
- clang-3.4
- cmake
- g++-5-multilib
- g++-multilib
@ -118,7 +109,7 @@ addons:
- gdb
- libc6-dev-i386
- libtool
- llvm-3.6-dev
- llvm-3.4-dev
- pkg-config
- python3.3-dev
- unzip

View File

@ -1,13 +1,25 @@
cmake_minimum_required(VERSION 2.8.7)
project(NEOVIM)
project(nvim)
if(POLICY CMP0059)
cmake_policy(SET CMP0059 OLD) # Needed until cmake 2.8.12. #4389
endif()
# Point CMake at any custom modules we may ship
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
# We don't support building in-tree.
include(PreventInTreeBuilds)
# Prefer our bundled versions of dependencies.
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding dependencies")
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
if(CMAKE_CROSSCOMPILING AND NOT UNIX)
list(INSERT CMAKE_FIND_ROOT_PATH 0 ${DEPS_PREFIX})
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX}/../host/bin)
else()
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
endif()
# used for check_c_compiler_flag
include(CheckCCompilerFlag)
@ -35,37 +47,40 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(USE_FNAME_CASE TRUE)
endif()
# Set available build types for CMake GUIs.
# A different build type can still be set by -DCMAKE_BUILD_TYPE=...
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
STRINGS "Debug" "Dev" "Release" "MinSizeRel" "RelWithDebInfo")
# Set default build type.
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "CMAKE_BUILD_TYPE not given, defaulting to 'Dev'.")
set(CMAKE_BUILD_TYPE "Dev" CACHE STRING "Choose the type of build." FORCE)
endif()
# Version tokens
# - In a git repo, these tokens are _ignored_.
# - If the current HEAD is tagged, the tag name is used.
# - Otherwise the result of `git describe` is used.
# - If not in a git repo (e.g. a tarball) these tokens set the version string.
# Set available build types for CMake GUIs.
# A different build type can still be set by -DCMAKE_BUILD_TYPE=...
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
STRINGS "Debug" "Dev" "Release" "MinSizeRel" "RelWithDebInfo")
# If not in a git repo (e.g., a tarball) these tokens define the complete
# version string, else they are combined with the result of `git describe`.
set(NVIM_VERSION_MAJOR 0)
set(NVIM_VERSION_MINOR 1)
set(NVIM_VERSION_PATCH 1)
set(NVIM_VERSION_PATCH 6)
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
# API level
set(NVIM_API_LEVEL 1) # Bump this after any API change.
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
set(NVIM_API_PRERELEASE false)
file(TO_CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR}/.git FORCED_GIT_DIR)
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT)
if(NVIM_VERSION_COMMIT) # is a git repo
git_get_exact_tag(NVIM_VERSION_MEDIUM)
if(NVIM_VERSION_MEDIUM) # is a tagged release
unset(NVIM_VERSION_COMMIT)
else() # is a dev build
git_describe(NVIM_VERSION_MEDIUM)
get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT)
endif()
if(NVIM_VERSION_COMMIT) # is a git repo
git_describe(NVIM_VERSION_MEDIUM)
# `git describe` annotates the most recent tagged release; for pre-release
# builds we must replace that with the unreleased version.
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+"
"v${NVIM_VERSION_MAJOR}.${NVIM_VERSION_MINOR}.${NVIM_VERSION_PATCH}"
NVIM_VERSION_MEDIUM
${NVIM_VERSION_MEDIUM})
endif()
set(NVIM_VERSION_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
@ -150,7 +165,11 @@ if(${INIT_FLAGS_NAME})
set(CMAKE_REQUIRED_FLAGS "${${INIT_FLAGS_NAME}}")
endif()
# Include <string.h> because some toolchains define _FORTIFY_SOURCE=2 in
# internal header files, which should in turn be #included by <string.h>.
check_c_source_compiles("
#include <string.h>
#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 1
#error \"_FORTIFY_SOURCE > 1\"
#endif
@ -199,11 +218,18 @@ if(MSVC)
else()
add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter
-Wstrict-prototypes -std=gnu99)
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
# 3.4.1 used there.
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
add_definitions(-Wno-c11-extensions)
endif()
endif()
if(MINGW)
# Use POSIX compatible stdio in Mingw
add_definitions(-D__USE_MINGW_ANSI_STDIO)
add_definitions(-D_WIN32_WINNT=0x0600)
endif()
# OpenBSD's GCC (4.2.1) doesn't have -Wvla
@ -212,12 +238,16 @@ if(HAS_WVLA_FLAG)
add_definitions(-Wvla)
endif()
check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG)
check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG)
if(HAS_FSTACK_PROTECTOR_STRONG_FLAG)
add_definitions(-fstack-protector-strong)
elseif(HAS_FSTACK_PROTECTOR_FLAG)
add_definitions(-fstack-protector --param ssp-buffer-size=4)
if(UNIX)
# -fstack-protector breaks non Unix builds even in Mingw-w64
check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG)
check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG)
if(HAS_FSTACK_PROTECTOR_STRONG_FLAG)
add_definitions(-fstack-protector-strong)
elseif(HAS_FSTACK_PROTECTOR_FLAG)
add_definitions(-fstack-protector --param ssp-buffer-size=4)
endif()
endif()
check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG)
@ -231,6 +261,10 @@ option(
if(TRAVIS_CI_BUILD)
message(STATUS "Travis CI build enabled.")
add_definitions(-Werror)
if(DEFINED ENV{BUILD_32BIT})
# Get some test coverage for unsigned char
add_definitions(-funsigned-char)
endif()
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug)
@ -246,6 +280,10 @@ if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
# For O_CLOEXEC, O_DIRECTORY, and O_NOFOLLOW flags on older systems
# (pre POSIX.1-2008: glibc 2.11 and earlier). #4042
add_definitions(-D_GNU_SOURCE)
endif()
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_NAME STREQUAL "SunOS")
@ -265,23 +303,25 @@ endif()
include_directories("${PROJECT_BINARY_DIR}/config")
include_directories("${PROJECT_SOURCE_DIR}/src")
# Modules used by platform auto-detection
include(CheckLibraryExists)
find_package(LibUV REQUIRED)
include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
find_package(Msgpack REQUIRED)
find_package(Msgpack 1.0.0 REQUIRED)
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
find_package(LuaJit REQUIRED)
include_directories(SYSTEM ${LUAJIT_INCLUDE_DIRS})
if(UNIX)
option(FEAT_TUI "Enable the Terminal UI" ON)
else()
option(FEAT_TUI "Enable the Terminal UI" OFF)
endif()
find_package(Unibilium REQUIRED)
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
if(FEAT_TUI)
find_package(Unibilium REQUIRED)
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
find_package(LibTermkey REQUIRED)
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
find_package(LibTermkey REQUIRED)
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
endif()
find_package(LibVterm REQUIRED)
include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS})
@ -300,7 +340,12 @@ if((CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN) AND NOT CMAKE_C_COMPILER_ID MA
message(FATAL_ERROR "Sanitizers are only supported for Clang.")
endif()
option(ENABLE_JEMALLOC "enable jemalloc" ON)
if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
message(STATUS "detected OpenBSD; disabled jemalloc. #5318")
option(ENABLE_JEMALLOC "enable jemalloc" OFF)
else()
option(ENABLE_JEMALLOC "enable jemalloc" ON)
endif()
if (ENABLE_JEMALLOC)
if(CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN)
@ -328,15 +373,22 @@ endif()
set(CMAKE_THREAD_PREFER_PTHREAD ON)
find_package(Threads REQUIRED)
# Place targets in bin/ or lib/ for all build configurations
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
foreach(CFGNAME ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${CFGNAME} CFGNAME)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/lib)
endforeach()
# Find Lua interpreter
include(LuaHelpers)
set(LUA_DEPENDENCIES lpeg MessagePack bit)
set(LUA_DEPENDENCIES lpeg mpack bit)
if(NOT LUA_PRG)
foreach(CURRENT_LUA_PRG luajit lua)
foreach(CURRENT_LUA_PRG luajit lua5.1 lua5.2 lua)
# If LUA_PRG is set find_program() will not search
unset(LUA_PRG CACHE)
unset(LUA_PRG_WORKS)
@ -360,13 +412,20 @@ endif()
message(STATUS "Using the Lua interpreter ${LUA_PRG}.")
# Setup busted.
find_program(BUSTED_PRG busted)
find_program(BUSTED_PRG NAMES busted busted.bat)
find_program(BUSTED_LUA_PRG busted-lua)
if(NOT BUSTED_OUTPUT_TYPE)
set(BUSTED_OUTPUT_TYPE "utfTerminal")
if(WIN32)
set(BUSTED_OUTPUT_TYPE "plainTerminal")
else()
set(BUSTED_OUTPUT_TYPE "utfTerminal")
endif()
endif()
find_program(LUACHECK_PRG luacheck)
find_program(GPERF_PRG gperf)
include(InstallHelpers)
file(GLOB MANPAGES
@ -377,6 +436,16 @@ install_helper(
FILES ${MANPAGES}
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
# MIN_LOG_LEVEL for log.h
if(DEFINED MIN_LOG_LEVEL)
if(NOT MIN_LOG_LEVEL MATCHES "^[0-3]$")
message(FATAL_ERROR "MIN_LOG_LEVEL must be a number DEBUG (0), INFO (1), WARNING (2) or ERROR (3)")
endif()
message(STATUS "Log level set to ${MIN_LOG_LEVEL}")
else()
message(STATUS "Log level not specified, defaulting to INFO(1)")
endif()
# Go down the tree.
add_subdirectory(src/nvim)
@ -401,14 +470,30 @@ if(BUSTED_PRG)
if(POLICY CMP0026)
cmake_policy(SET CMP0026 OLD)
endif()
get_target_property(TEST_LIBNVIM_PATH nvim-test LOCATION)
if(CMAKE_GENERATOR MATCHES "Visual Studio")
set(TEST_LIBNVIM_PATH ${CMAKE_BINARY_DIR}/lib/nvim-test.dll)
else()
get_target_property(TEST_LIBNVIM_PATH nvim-test LOCATION)
endif()
# When running tests from 'ninja' we need to use the
# console pool: to do so we need to use the USES_TERMINAL
# option, but this is only available in CMake 3.2
set(TEST_TARGET_ARGS)
if(NOT (${CMAKE_VERSION} VERSION_LESS 3.2.0))
list(APPEND TEST_TARGET_ARGS "USES_TERMINAL")
endif()
configure_file(
test/config/paths.lua.in
${CMAKE_BINARY_DIR}/test/config/paths.lua)
set(UNITTEST_PREREQS nvim-test unittest-headers)
set(FUNCTIONALTEST_PREREQS nvim tty-test shell-test)
if(WIN32)
set(FUNCTIONALTEST_PREREQS nvim shell-test)
else()
set(FUNCTIONALTEST_PREREQS nvim tty-test shell-test)
endif()
set(BENCHMARK_PREREQS nvim tty-test)
# Useful for automated build systems, if they want to manually run the tests.
@ -421,41 +506,72 @@ if(BUSTED_PRG)
add_custom_target(benchmark-prereqs
DEPENDS ${BENCHMARK_PREREQS})
add_custom_target(unittest
COMMAND ${CMAKE_COMMAND}
-DBUSTED_PRG=${BUSTED_PRG}
-DLUA_PRG=${LUA_PRG}
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
-DBUILD_DIR=${CMAKE_BINARY_DIR}
-DTEST_TYPE=unit
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${UNITTEST_PREREQS})
check_lua_module(${LUA_PRG} "ffi" LUA_HAS_FFI)
if(LUA_HAS_FFI)
add_custom_target(unittest
COMMAND ${CMAKE_COMMAND}
-DBUSTED_PRG=${BUSTED_PRG}
-DLUA_PRG=${LUA_PRG}
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
-DBUILD_DIR=${CMAKE_BINARY_DIR}
-DTEST_TYPE=unit
-DSYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${UNITTEST_PREREQS}
${TEST_TARGET_ARGS})
else()
message(WARNING "The Luajit ffi is not available in ${LUA_PRG}"
", disabling unit tests")
endif()
add_custom_target(functionaltest
COMMAND ${CMAKE_COMMAND}
-DBUSTED_PRG=${BUSTED_PRG}
-DLUA_PRG=${LUA_PRG}
-DNVIM_PRG=$<TARGET_FILE:nvim>
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
-DBUILD_DIR=${CMAKE_BINARY_DIR}
-DTEST_TYPE=functional
-DSYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${FUNCTIONALTEST_PREREQS})
DEPENDS ${FUNCTIONALTEST_PREREQS}
${TEST_TARGET_ARGS})
add_custom_target(benchmark
COMMAND ${CMAKE_COMMAND}
-DBUSTED_PRG=${BUSTED_PRG}
-DLUA_PRG=${LUA_PRG}
-DNVIM_PRG=$<TARGET_FILE:nvim>
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
-DBUILD_DIR=${CMAKE_BINARY_DIR}
-DTEST_TYPE=benchmark
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${BENCHMARK_PREREQS})
DEPENDS ${BENCHMARK_PREREQS}
${TEST_TARGET_ARGS})
endif()
if(BUSTED_LUA_PRG)
add_custom_target(functionaltest-lua
COMMAND ${CMAKE_COMMAND}
-DBUSTED_PRG=${BUSTED_LUA_PRG}
-DLUA_PRG=${LUA_PRG}
-DNVIM_PRG=$<TARGET_FILE:nvim>
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
-DBUILD_DIR=${CMAKE_BINARY_DIR}
-DTEST_TYPE=functional
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${FUNCTIONALTEST_PREREQS}
${TEST_TARGET_ARGS})
endif()
if(LUACHECK_PRG)
@ -463,5 +579,18 @@ if(LUACHECK_PRG)
COMMAND ${CMAKE_COMMAND}
-DLUACHECK_PRG=${LUACHECK_PRG}
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-P ${PROJECT_SOURCE_DIR}/cmake/RunTestsLint.cmake)
endif()
set(CPACK_PACKAGE_NAME "Neovim")
set(CPACK_PACKAGE_VENDOR "neovim.io")
set(CPACK_PACKAGE_VERSION ${NVIM_VERSION_MEDIUM})
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Neovim")
# Set toplevel directory/installer name as Neovim
set(CPACK_PACKAGE_FILE_NAME "Neovim")
set(CPACK_TOPLEVEL_TAG "Neovim")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set(CPACK_NSIS_MODIFY_PATH ON)
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
include(CPack)

View File

@ -1,168 +1,115 @@
# Contributing to Neovim
## Getting started
Getting started
---------------
- Help us review [open pull requests](https://github.com/neovim/neovim/pulls)!
- Look for [entry-level issues][entry-level] to work on.
- [Documentation](https://github.com/neovim/neovim/labels/documentation)
improvements are also much appreciated.
- Look at [Waffle][waffle] to see who is working on what issues.
- If needed, refer to [the wiki][wiki-contributing] for guidance.
If you want to help but don't know where to start, here are some
low-risk/isolated tasks:
## Reporting problems
- Help us [review pull requests](#reviewing)!
- Merge a [Vim patch].
- Try a [complexity:low] issue.
- Fix [clang-scan] or [coverity](#coverity) warnings.
Before reporting an issue, see the following wiki articles:
Reporting problems
------------------
- [Troubleshooting][wiki-troubleshooting]
- [Frequently asked questions][wiki-faq]
- Check the [**FAQ**][wiki-faq].
- Search [existing issues][github-issues] (including closed!)
- Update Neovim to the latest version to see if your problem persists.
- If you're using a plugin manager, comment out your plugins, then add them back
in one by one, to narrow down the cause of the issue.
- Crash reports which include a stacktrace are 10x more valuable.
- [Bisecting][git-bisect] to the cause of a regression often leads to an
immediate fix.
If your issue isn't mentioned there:
Pull requests ("PRs")
---------------------
- Verify that it hasn't already been reported.
- If not already running the latest version of Neovim, update to it to see if
your problem persists.
- If you're experiencing compile or runtime warnings/failures, try searching for
the error message(s) you received (if any) on [Neovim's issue tracker][github-issues].
- For build issues, see
[Troubleshooting#build-issues][wiki-troubleshooting-build-issues].
- For runtime issues, see
[Troubleshooting#runtime-issues][wiki-troubleshooting-runtime-issues].
If your issue isn't mentioned there, try reproducing it using `nvim`
with the smallest possible `vimrc` (or none at all via `nvim -u NONE`),
to rule out bugs in plugins you're using.
If you're using a plugin manager, comment out your plugins, then add
them back in one by one.
Include as much detail as possible; we generally need to know:
- What operating system you're using.
- Which version of Neovim you're using. To get this, run `nvim --version` from
a shell, or run `:version` from inside `nvim`.
- Whether the bug is present in Vim (not Neovim), and if so which version of
Vim. It's fine to report Vim bugs on the Neovim bug tracker, but it saves
everyone time if we know from the start that the bug is not a regression
caused by Neovim.
- This isn't required, but what commit introduced the issue for you. You can
use [`git bisect`][git-bisect] for this.
## Submitting contributions
- Make it clear in the issue tracker what you are working on.
- Be descriptive in your pull request description: what is it for, why is it
needed, etc.
- Do ***not*** make cosmetic changes to unrelated files in the same pull
request. This creates noise, making reviews harder to do. If your text
editor strips all trailing whitespace in a file when you edit it, disable
it.
### Tagging in the issue tracker
When submitting pull requests (commonly referred to as "PRs"), include one of
the following tags prepended to the title:
- `[WIP]` - Work In Progress: the PR will change, so while there is no
immediate need for review, the submitter still might appreciate it.
- `[RFC]` - Request For Comment: the PR needs reviewing and/or comments.
- `[RDY]` - Ready: the PR has been reviewed by at least one other person and
has no outstanding issues.
Assuming the above criteria has been met, feel free to change your PR's tag
yourself, as opposed to waiting for a contributor to do it for you.
### Branching & history
- Do ***not*** work on your PR on the master branch, [use a feature branch
instead][git-feature-branch].
- [Rebase your feature branch onto][git-rebasing] (upstream) master before
- To avoid duplicate work, you may want to create a `[WIP]` pull request so that
others know what you are working on.
- Avoid cosmetic changes to unrelated files in the same commit: extra noise
makes reviews more difficult.
- Use a [feature branch][git-feature-branch] instead of the master branch.
- [Rebase your feature branch][git-rebasing] onto (upstream) master before
opening the PR.
- Keep up to date with changes in (upstream) master so your PR is easy to
merge.
- [Try to actively tidy your history][git-history-rewriting]: combine related
commits with interactive rebasing, separate monolithic commits, etc. If your
PR is still `[WIP]`, feel free to force-push to your feature branch to tidy
your history.
- After addressing the review comments, it's fine to rebase and force-push to
your review.
- Try to [tidy your history][git-history-rewriting]: combine related commits
with interactive rebasing, separate monolithic commits, etc.
### For code pull requests
### Stages: WIP, RFC, RDY
#### Testing
Pull requests have three stages: `[WIP]` (Work In Progress), `[RFC]` (Request
For Comment) and `[RDY]` (Ready).
We are unlikely to merge your PR if the Travis build fails:
- Untagged PRs are assumed to be `[RFC]`, i.e. you are requesting a review.
- Prepend `[WIP]` to the PR title if you are _not_ requesting feedback and the
work is still in flux.
- Prepend `[RDY]` to the PR title if you are _done_ with the PR and are only
waiting on it to be merged.
- Travis builds are compiled with the [`-Werror`][gcc-warnings] flag, so if
your PR introduces any compiler warnings then the Travis build will fail.
- If any tests fail, the Travis build will fail.
See [Building Neovim#running-tests][wiki-building-running-tests] for
information on running tests locally.
Tests passing locally doesn't guarantee they'll pass in the Travis
build, as different compilers and platforms will be used.
- Travis runs [Valgrind][valgrind] for the GCC/Linux build, but you may also
do so locally by running the following from a shell: `VALGRIND=1 make test`
For example, a typical workflow is:
#### Coding style
1. You open a `[WIP]` PR where the work is _not_ ready for feedback, you just want to
let others know what you are doing.
2. Once the PR is ready for review, you replace `[WIP]` in the title with `[RFC]`.
You may add fix up commits to address issues that come up during review.
3. Once the PR is ready for merging, you rebase/squash your work appropriately and
then replace `[RFC]` in the title with `[RDY]`.
We have a [style guide][style-guide] that all new code should follow.
However, large portions of the existing Vim codebase violate it to some
degree, and fixing them would increase merge conflicts and add noise to `git
blame`.
### Commit messages
Weigh those costs when making cosmetic changes. In general, avoid pull
requests dominated by style changes, but feel free to fix up lines that you
happen to be modifying anyway. Fix anything that looks outright
[barbarous](http://www.orwell.ru/library/essays/politics/english/e_polit), but
otherwise prefer to leave things as they are.
For new code, run `make lint` (which runs [clint.py][clint]) to detect style
errors. Make sure that the file(s) you intend to be linted are not in
`clint-ignored-files.txt`. It's not perfect, so some warnings may be false
positives/negatives. To have `clint.py` ignore certain cases, put `// NOLINT`
at the end of the line.
We also provide a configuration file for [`clang-format`][clang-format], which
can be used to format code according to the style guidelines. Be aware that
this formatting method might need user supervision. To have `clang-format`
ignore certain line ranges, use the following special comments:
```c
int formatted_code;
// clang-format off
void unformatted_code ;
// clang-format on
void formatted_code_again;
```
### Commit guidelines
The purpose of these guidelines is to *make reviews easier* and make the
[VCS][vcs] logs more valuable.
Follow [commit message hygiene][hygiene] to *make reviews easier* and to make
the VCS/git logs more valuable.
- Try to keep the first line under 72 characters.
- If necessary, include further description after a blank line.
- Don't make the description too verbose by including obvious things, but
don't spare clarifications for anything that may be not so obvious.
Some commit messages are pages long, and that's fine if there's no
better place for those comments to live.
- **Recommended:** Prefix logically-related commits with a consistent
identifier in each commit message. For already used identifiers, see the
commit history for the respective file(s) you're editing.
[For example](https://github.com/neovim/neovim/commits?author=elmart),
the following commits are related by task (*Introduce nvim namespace*) and
sub-task (*Contrib YCM*).
<br/> `Introduce nvim namespace: Contrib YCM: Fix style issues`
<br/> `Introduce nvim namespace: Contrib YCM: Fix build dir calculation`
- Sub-tasks can be *activity-oriented* (doing different things on the same area)
or *scope-oriented* (doing the same thing in different areas).
- Granularity helps, but it's conceptual size that matters, not extent size.
- Use the [imperative voice][imperative]: "Fix bug" rather than "Fixed bug" or "Fixes bug."
- **Prefix the commit subject with a _scope_:** `doc:`, `test:`, `foo.c:`,
`runtime:`, ...
- For commits that contain only style/lint changes, a single-word subject
line is preferred: `style` or `lint`.
- A blank line must separate the subject from the description.
- Use the _imperative voice_: "Fix bug" rather than "Fixed bug" or "Fixes bug."
### Reviewing pull requests
### Automated builds (CI)
Using a checklist during reviews is highly recommended, so we [provide one at
the wiki][wiki-review-checklist]. If you think it could be improved, feel free
to edit it.
Each pull request must pass the automated builds ([travis CI] and [quickbuild]).
- CI builds are compiled with [`-Werror`][gcc-warnings], so if your PR
introduces any compiler warnings, the build will fail.
- If any tests fail, the build will fail.
See [Building Neovim#running-tests][wiki-run-tests] to run tests locally.
Passing locally doesn't guarantee passing the CI build, because of the
different compilers and platforms tested against.
- CI runs [ASan] and other analyzers. To run valgrind locally:
`VALGRIND=1 make test`
- The `lint` build ([#3174][3174]) checks modified lines _and their immediate
neighbors_. This is to encourage incrementally updating the legacy style to
meet our style guidelines.
- A single word (`lint` or `style`) is sufficient as the subject line of
a commit that contains only style changes.
- [How to investigate QuickBuild failures](https://github.com/neovim/neovim/pull/4718#issuecomment-217631350)
### Coverity
[Coverity](https://scan.coverity.com/projects/neovim-neovim) runs against the
master build. If you want to view the defects, just request access at the
_Contributor_ level. An Admin will grant you permission.
Use this commit-message format for coverity fixes:
coverity/<id>: <description of what fixed the defect>
where `<id>` is the Coverity ID (CID). For example see [#804](https://github.com/neovim/neovim/pull/804).
Reviewing
---------
To help review pull requests, start with [this checklist][review-checklist].
Reviewing can be done on GitHub, but you may find it easier to do locally.
Using [`hub`][hub], you can do the following to create a new branch with the
contents of a pull request, such as [#1820][github-pr-1820]:
Using [`hub`][hub], you can create a new branch with the contents of a pull
request, e.g. [#1820][1820]:
hub checkout https://github.com/neovim/neovim/pull/1820
@ -171,12 +118,6 @@ commits in the feature branch which aren't in the `master` branch; `-p`
shows each commit's diff. To show the whole surrounding function of a change
as context, use the `-W` argument as well.
You may find it easier to instead use an interactive program for code reviews,
such as [`tig`][tig].
[clang-format]: http://clang.llvm.org/docs/ClangFormat.html
[clint]: clint.py
[entry-level]: https://github.com/neovim/neovim/issues?labels=entry-level&state=open
[gcc-warnings]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
[git-bisect]: http://git-scm.com/book/tr/v2/Git-Tools-Debugging-with-Git
[git-feature-branch]: https://www.atlassian.com/git/tutorials/comparing-workflows
@ -184,18 +125,17 @@ such as [`tig`][tig].
[git-history-rewriting]: http://git-scm.com/book/en/v2/Git-Tools-Rewriting-History
[git-rebasing]: http://git-scm.com/book/en/v2/Git-Branching-Rebasing
[github-issues]: https://github.com/neovim/neovim/issues
[github-pr-1820]: https://github.com/neovim/neovim/pull/1820
[1820]: https://github.com/neovim/neovim/pull/1820
[hub]: https://hub.github.com/
[imperative]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[hygiene]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[style-guide]: http://neovim.io/develop/style-guide.xml
[tig]: https://github.com/jonas/tig
[valgrind]: http://valgrind.org/
[vcs]: https://en.wikipedia.org/wiki/Revision_control
[waffle]: https://waffle.io/neovim/neovim
[wiki-building-running-tests]: https://github.com/neovim/neovim/wiki/Building-Neovim#running-tests
[wiki-contributing]: https://github.com/neovim/neovim/wiki/Contributing
[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
[wiki-run-tests]: https://github.com/neovim/neovim/wiki/Building-Neovim#running-tests
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ
[wiki-review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
[wiki-troubleshooting-build-issues]: https://github.com/neovim/neovim/wiki/Troubleshooting#build-issues
[wiki-troubleshooting-runtime-issues]: https://github.com/neovim/neovim/wiki/Troubleshooting#runtime-issues
[wiki-troubleshooting]: https://github.com/neovim/neovim/wiki/Troubleshooting
[review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
[3174]: https://github.com/neovim/neovim/issues/3174
[travis CI]: https://travis-ci.org/neovim/neovim
[quickbuild]: http://neovim-qb.szakmeister.net/dashboard
[Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
[clang-scan]: https://neovim.io/doc/reports/clang/
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow

16
ISSUE_TEMPLATE.md Normal file
View File

@ -0,0 +1,16 @@
- `nvim --version`:
- Vim (version: ) behaves differently?
- Operating system/version:
- Terminal name/version:
- `$TERM`:
### Actual behaviour
### Expected behaviour
### Steps to reproduce using `nvim -u NORC`
```
nvim -u NORC
```

View File

@ -45,6 +45,11 @@ ifneq (,$(USE_BUNDLED_DEPS))
BUNDLED_CMAKE_FLAG := -DUSE_BUNDLED=$(USE_BUNDLED_DEPS)
endif
ifneq (,$(findstring functionaltest-lua,$(MAKECMDGOALS)))
BUNDLED_LUA_CMAKE_FLAG := -DUSE_BUNDLED_LUA=ON
$(shell [ -x .deps/usr/bin/lua ] || rm build/.ran-*)
endif
# For use where we want to make sure only a single job is run. This does issue
# a warning, but we need to keep SCRIPTS argument.
SINGLE_MAKE = export MAKEFLAGS= ; $(MAKE)
@ -74,19 +79,25 @@ build/.ran-third-party-cmake:
ifeq ($(call filter-true,$(USE_BUNDLED_DEPS)),)
mkdir -p .deps
cd .deps && \
cmake -G '$(BUILD_TYPE)' $(BUNDLED_CMAKE_FLAG) \
cmake -G '$(BUILD_TYPE)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
$(DEPS_CMAKE_FLAGS) ../third-party
endif
mkdir -p build
touch $@
oldtest: | nvim
oldtest: | nvim helptags
+$(SINGLE_MAKE) -C src/nvim/testdir $(MAKEOVERRIDES)
helptags: | nvim
+$(BUILD_CMD) -C build helptags
functionaltest: | nvim
+$(BUILD_CMD) -C build functionaltest
testlint: | nvim
functionaltest-lua: | nvim
+$(BUILD_CMD) -C build functionaltest-lua
testlint: | build/.ran-cmake deps
$(BUILD_CMD) -C build testlint
unittest: | nvim
@ -107,10 +118,12 @@ distclean: clean
install: | nvim
+$(BUILD_CMD) -C build install
lint:
cmake -DLINT_PRG=./clint.py \
clint:
cmake -DLINT_PRG=./src/clint.py \
-DLINT_DIR=src \
-DLINT_SUPPRESS_URL="$(DOC_DOWNLOAD_URL_BASE)$(CLINT_ERRORS_FILE_PATH)" \
-P cmake/RunLint.cmake
.PHONY: test testlint functionaltest unittest lint clean distclean nvim libnvim cmake deps install
lint: clint testlint
.PHONY: test testlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install

View File

@ -1,61 +1,59 @@
![Neovim](https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo.png)
[![Neovim](https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo.png)](https://neovim.io)
[Website](http://neovim.io) |
[Community](http://neovim.io/community/) |
[Wiki](https://github.com/neovim/neovim/wiki) |
[Documentation](http://neovim.io/doc) |
[Mailing List](https://groups.google.com/forum/#!forum/neovim) |
[Twitter](http://twitter.com/Neovim) |
[Bountysource](https://www.bountysource.com/teams/neovim)
[Documentation](https://neovim.io/doc) |
[Twitter](https://twitter.com/Neovim) |
[Community](https://neovim.io/community/) |
[Gitter **Chat**](https://gitter.im/neovim/neovim)
[![Travis Build Status](https://travis-ci.org/neovim/neovim.svg?branch=master)](https://travis-ci.org/neovim/neovim)
[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/cf1jwc29198748we/branch/master?svg=true)](https://ci.appveyor.com/project/neovim/neovim/branch/master)
[![Pull requests waiting for review](https://badge.waffle.io/neovim/neovim.svg?label=RFC&title=RFCs)](https://waffle.io/neovim/neovim)
[![Coverage Status](https://img.shields.io/coveralls/neovim/neovim.svg)](https://coveralls.io/r/neovim/neovim)
[![Coverity Scan Build](https://scan.coverity.com/projects/2227/badge.svg)](https://scan.coverity.com/projects/2227)
[![Clang Scan Build](http://neovim.io/doc/reports/clang/badge.svg)](http://neovim.io/doc/reports/clang)
[![Join the chat at https://gitter.im/neovim/neovim](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/neovim/neovim?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Clang Scan Build](https://neovim.io/doc/reports/clang/badge.svg)](https://neovim.io/doc/reports/clang)
<a href="https://buildd.debian.org/neovim"><img src="https://www.debian.org/logos/openlogo-nd-25.png" width="13" height="15">Debian</a>
Neovim is a project that seeks to aggressively refactor Vim in order to:
- Simplify maintenance and encourage [contributions](https://github.com/neovim/neovim/wiki/Contributing)
- Simplify maintenance and encourage [contributions](CONTRIBUTING.md)
- Split the work between multiple developers
- Enable the implementation of new/modern user interfaces without any
modifications to the core source
- Enable advanced [external UIs] without modifications to the core
- Improve extensibility with a new [plugin architecture](https://github.com/neovim/neovim/wiki/Plugin-UI-architecture)
For lots more details, see
For more details, see
[the wiki](https://github.com/neovim/neovim/wiki/Introduction)!
### What's been done so far
- Automatic [history merge](https://github.com/neovim/neovim/pull/2506) between multiple editor instances
- [XDG-compliant](https://github.com/neovim/neovim/pull/3470) configuration
- Embedded [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html)
- Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
- [MessagePack](https://msgpack.org) remote API
- [Pushdown automaton](https://github.com/neovim/neovim/pull/3413) for state transitions
See the [progress page](https://github.com/neovim/neovim/wiki/Progress) for a comprehensive list.
[![Throughput Graph](https://graphs.waffle.io/neovim/neovim/throughput.svg)](https://waffle.io/neovim/neovim/metrics)
### What's being worked on now
What's been done so far
-----------------------
- Port all IO to [libuv](https://github.com/libuv/libuv/blob/master/README.md)
- Convert legacy tests to Lua tests
- VimL => Lua translator
- RPC API based on [MessagePack](https://msgpack.org)
- Embedded [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html)
- Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
- [Shared data (shada)](https://github.com/neovim/neovim/pull/2506) among multiple editor instances
- [XDG base directories](https://github.com/neovim/neovim/pull/3470) support
- [libuv](https://github.com/libuv/libuv/)-based platform/OS/"mch" layer
- [Pushdown automaton](https://github.com/neovim/neovim/pull/3413) input model
- 1000s of new tests
- Legacy tests converted to Lua tests
### How do I get it?
See [`:help nvim-features`][nvim-features] for a comprehensive list.
There is a formula for OSX/homebrew, a PKGBUILD for Arch Linux, RPM, deb, and
What's being worked on now
--------------------------
See the [Roadmap].
How do I get it?
----------------
There is a Debian package, homebrew formula, PKGBUILD for Arch Linux, RPM, and
more. See [the wiki](https://github.com/neovim/neovim/wiki/Installing-Neovim)!
### Contributing
...would be awesome! See [the wiki](https://github.com/neovim/neovim/wiki/Contributing) for more details.
### License
License
-------
Neovim is licensed under the terms of the Apache 2.0 license, except for
parts that were contributed under the Vim license.
@ -81,5 +79,8 @@ See `LICENSE` for details.
features. The money goes to Uganda anyway.
[license-commit]: https://github.com/neovim/neovim/commit/b17d9691a24099c9210289f16afb1a498a89d803
[nvim-features]: https://neovim.io/doc/user/vim_diff.html#nvim-features
[Roadmap]: https://neovim.io/roadmap/
[external UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui-projects
<!-- vim: set tw=80: -->

View File

@ -1,23 +1,10 @@
version: '{build}'
skip_tags: true
os: Windows Server 2012 R2
environment:
GYP_MSVS_VERSION: 2015
matrix:
- GENERATOR: Visual Studio 14 Win64
DEPS_PATH: deps64
- GENERATOR: Visual Studio 14
DEPS_PATH: deps32
matrix:
# Allow builds to fail
allow_failures:
- os: Windows Server 2012 R2
configuration:
- MINGW_64
- MINGW_32
install: []
build_script:
# See http://help.appveyor.com/discussions/problems/539-cloning-gyp-fails
- git config --global url."http://".insteadOf https://
- mkdir %DEPS_PATH%
- cd %DEPS_PATH%
- cmake -G "%GENERATOR%" ..\third-party\
- cmake --build .
- cd ..
- call .ci\build.bat
artifacts:
- path: build/Neovim.zip
- path: build/Neovim.exe

View File

@ -34,7 +34,7 @@ endif()
if(MSVC)
list(APPEND LUAJIT_NAMES lua51)
elseif(MINGW)
list(APPEND LUAJIT_NAMES libluajit)
list(APPEND LUAJIT_NAMES libluajit libluajit-5.1)
else()
list(APPEND LUAJIT_NAMES luajit-5.1)
endif()

View File

@ -7,7 +7,9 @@
if(NOT MSGPACK_USE_BUNDLED)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_MSGPACK QUIET msgpack)
pkg_search_module(PC_MSGPACK QUIET
msgpackc>=${Msgpack_FIND_VERSION}
msgpack>=${Msgpack_FIND_VERSION})
endif()
else()
set(PC_MSGPACK_INCLUDEDIR)
@ -19,19 +21,38 @@ endif()
set(MSGPACK_DEFINITIONS ${PC_MSGPACK_CFLAGS_OTHER})
find_path(MSGPACK_INCLUDE_DIR msgpack.h
find_path(MSGPACK_INCLUDE_DIR msgpack/version_master.h
HINTS ${PC_MSGPACK_INCLUDEDIR} ${PC_MSGPACK_INCLUDE_DIRS}
${LIMIT_SEARCH})
# If we're asked to use static linkage, add libmsgpack.a as a preferred library name.
if(MSGPACK_INCLUDE_DIR)
file(READ ${MSGPACK_INCLUDE_DIR}/msgpack/version_master.h msgpack_version_h)
string(REGEX REPLACE ".*MSGPACK_VERSION_MAJOR +([0-9]+).*" "\\1" MSGPACK_VERSION_MAJOR "${msgpack_version_h}")
string(REGEX REPLACE ".*MSGPACK_VERSION_MINOR +([0-9]+).*" "\\1" MSGPACK_VERSION_MINOR "${msgpack_version_h}")
string(REGEX REPLACE ".*MSGPACK_VERSION_REVISION +([0-9]+).*" "\\1" MSGPACK_VERSION_REVISION "${msgpack_version_h}")
set(MSGPACK_VERSION_STRING "${MSGPACK_VERSION_MAJOR}.${MSGPACK_VERSION_MINOR}.${MSGPACK_VERSION_REVISION}")
else()
set(MSGPACK_VERSION_STRING)
endif()
# If we're asked to use static linkage, add libmsgpack{,c}.a as a preferred library name.
if(MSGPACK_USE_STATIC)
list(APPEND MSGPACK_NAMES
"${CMAKE_STATIC_LIBRARY_PREFIX}msgpackc${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${CMAKE_STATIC_LIBRARY_PREFIX}msgpack${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()
list(APPEND MSGPACK_NAMES msgpack)
if(MSVC)
# The import library for the msgpack DLL has a different name
list(APPEND MSGPACK_NAMES msgpack_import)
else()
list(APPEND MSGPACK_NAMES msgpackc msgpack)
endif()
find_library(MSGPACK_LIBRARY NAMES ${MSGPACK_NAMES}
# Check each directory for all names to avoid using headers/libraries from
# different places.
NAMES_PER_DIR
HINTS ${PC_MSGPACK_LIBDIR} ${PC_MSGPACK_LIBRARY_DIRS}
${LIMIT_SEARCH})
@ -43,6 +64,7 @@ set(MSGPACK_INCLUDE_DIRS ${MSGPACK_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set MSGPACK_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(Msgpack DEFAULT_MSG
MSGPACK_LIBRARY MSGPACK_INCLUDE_DIR)
find_package_handle_standard_args(Msgpack
REQUIRED_VARS MSGPACK_LIBRARY MSGPACK_INCLUDE_DIR
VERSION_VAR MSGPACK_VERSION_STRING)

View File

@ -8,8 +8,6 @@ function(check_lua_module LUA_PRG_PATH MODULE RESULT_VAR)
RESULT_VARIABLE module_missing
ERROR_QUIET)
if(module_missing)
message(STATUS
"[${LUA_PRG_PATH}] The '${MODULE}' lua package is required for building Neovim")
set(${RESULT_VAR} False PARENT_SCOPE)
else()
set(${RESULT_VAR} True PARENT_SCOPE)
@ -29,6 +27,8 @@ function(check_lua_deps LUA_PRG_PATH MODULES RESULT_VAR)
foreach(module ${MODULES})
check_lua_module(${LUA_PRG_PATH} ${module} has_module)
if(NOT has_module)
message(STATUS
"[${LUA_PRG_PATH}] The '${module}' lua package is required for building Neovim")
set(${RESULT_VAR} False PARENT_SCOPE)
return()
endif()

View File

@ -0,0 +1,23 @@
function(PreventInTreeBuilds)
get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH)
get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH)
if("${srcdir}" STREQUAL "${bindir}")
message("")
message("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
message("Neovim doesn't support in-tree builds. It's recommended that you")
message("use a build/ subdirectory:")
message(" mkdir build")
message(" cd build")
message(" cmake <OPTIONS> ..")
message("")
message("Make sure to cleanup some CMake artifacts from this failed build")
message("with:")
message(" rm -rf CMakeFiles CMakeCache.txt")
message("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
message("")
message(FATAL_ERROR "Stopping build.")
endif()
endfunction()
PreventInTreeBuilds()

View File

@ -2,7 +2,11 @@ get_filename_component(LINT_DIR ${LINT_DIR} ABSOLUTE)
get_filename_component(LINT_PREFIX ${LINT_DIR} PATH)
set(LINT_SUPPRESS_FILE "${LINT_PREFIX}/errors.json")
file(GLOB_RECURSE LINT_FILES ${LINT_DIR}/*.c ${LINT_DIR}/*.h)
if(DEFINED ENV{LINT_FILE})
file(GLOB_RECURSE LINT_FILES "$ENV{LINT_FILE}")
else()
file(GLOB_RECURSE LINT_FILES ${LINT_DIR}/*.c ${LINT_DIR}/*.h)
endif()
set(LINT_ARGS)

View File

@ -2,6 +2,9 @@ get_filename_component(BUSTED_DIR ${BUSTED_PRG} PATH)
set(ENV{PATH} "${BUSTED_DIR}:$ENV{PATH}")
set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime)
set(ENV{NVIM_RPLUGIN_MANIFEST} ${WORKING_DIR}/Xtest_rplugin_manifest)
set(ENV{XDG_CONFIG_HOME} ${WORKING_DIR}/Xtest_xdg/config)
set(ENV{XDG_DATA_HOME} ${WORKING_DIR}/Xtest_xdg/share)
if(NVIM_PRG)
set(ENV{NVIM_PROG} "${NVIM_PRG}")
@ -25,15 +28,19 @@ if(DEFINED ENV{TEST_FILTER})
set(TEST_TAG "--filter=$ENV{TEST_FILTER}")
endif()
set(ENV{SYSTEM_NAME} ${SYSTEM_NAME})
execute_process(
COMMAND ${BUSTED_PRG} ${TEST_TAG} ${TEST_FILTER} -v -o ${BUSTED_OUTPUT_TYPE}
--lazy --helper=${TEST_DIR}/${TEST_TYPE}/preload.lua
--lua=${LUA_PRG} --lazy --helper=${TEST_DIR}/${TEST_TYPE}/preload.lua
--lpath=${BUILD_DIR}/?.lua ${TEST_PATH}
WORKING_DIRECTORY ${WORKING_DIR}
ERROR_VARIABLE err
RESULT_VARIABLE res
${EXTRA_ARGS})
file(REMOVE ${WORKING_DIR}/Xtest_rplugin_manifest)
file(REMOVE_RECURSE ${WORKING_DIR}/Xtest_xdg)
if(NOT res EQUAL 0)
message(STATUS "Output to stderr:\n${err}")
message(FATAL_ERROR "Running ${TEST_TYPE} tests failed with error: ${res}.")

View File

@ -1,5 +1,7 @@
set(IGNORE_FILES "${TEST_DIR}/*/preload.lua")
execute_process(
COMMAND ${LUACHECK_PRG} -q ${TEST_DIR}
COMMAND ${LUACHECK_PRG} -q ${TEST_DIR} --exclude-files ${IGNORE_FILES}
WORKING_DIRECTORY ${TEST_DIR}
ERROR_VARIABLE err
RESULT_VARIABLE res

View File

@ -0,0 +1,30 @@
# In Windows we need to find dependency DLLs and install them along with our
# binaries. This script uses the following variables:
#
# - BINARY: The binary file whose dependencies need to be installed
# - DST: The destination path
# - CMAKE_PREFIX_PATH: A list of directories to search for dependencies
if(NOT DEFINED BINARY)
message(FATAL_ERROR "Missing required argument -DBINARY=")
endif()
if(NOT DEFINED DST)
message(FATAL_ERROR "Missing required arguments -DDST=")
endif()
if(NOT DEFINED CMAKE_PREFIX_PATH)
message(FATAL_ERROR "Missing required arguments -DCMAKE_PREFIX_PATH=")
endif()
include(GetPrerequisites)
get_prerequisites(${BINARY} DLLS 1 1 "" "${CMAKE_PREFIX_PATH}")
foreach(DLL_NAME ${DLLS})
find_program(DLL_PATH ${DLL_NAME})
if(NOT DLL_PATH)
message(FATAL_ERROR "Unable to find dependency ${DLL_NAME}")
endif()
message("Copying ${DLL_NAME} to ${DST}")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${DLL_PATH} ${DST})
unset(DLL_PATH CACHE)
endforeach()

View File

@ -8,7 +8,6 @@ include(CheckCSourceCompiles)
check_type_size("int" SIZEOF_INT)
check_type_size("long" SIZEOF_LONG)
check_type_size("intmax_t" SIZEOF_INTMAX_T)
check_type_size("off_t" SIZEOF_OFF_T)
check_type_size("size_t" SIZEOF_SIZE_T)
check_type_size("long long" SIZEOF_LONG_LONG)
check_type_size("void *" SIZEOF_VOID_PTR)
@ -16,32 +15,27 @@ check_type_size("void *" SIZEOF_VOID_PTR)
check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON)
# Headers
check_include_files(dirent.h HAVE_DIRENT_H)
check_include_files(fcntl.h HAVE_FCNTL_H)
check_include_files(iconv.h HAVE_ICONV_H)
check_include_files(langinfo.h HAVE_LANGINFO_H)
check_include_files(libgen.h HAVE_LIBGEN_H)
check_include_files(locale.h HAVE_LOCALE_H)
check_include_files(pwd.h HAVE_PWD_H)
check_include_files(strings.h HAVE_STRINGS_H)
check_include_files(stropts.h HAVE_STROPTS_H)
check_include_files(sys/param.h HAVE_SYS_PARAM_H)
check_include_files(sys/wait.h HAVE_SYS_WAIT_H)
if(NOT HAVE_SYS_WAIT_H AND UNIX)
# See if_cscope.c
message(SEND_ERROR "header sys/wait.h is required for UNIX")
message(SEND_ERROR "header sys/wait.h is required for Unix")
endif()
check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
check_include_files(utime.h HAVE_UTIME_H)
check_include_files(unistd.h HAVE_UNISTD_H)
check_include_files(utime.h HAVE_UTIME_H)
check_include_files(sys/uio.h HAVE_SYS_UIO_H)
# Functions
check_function_exists(fseeko HAVE_FSEEKO)
check_function_exists(fsync HAVE_FSYNC)
check_function_exists(getpwent HAVE_GETPWENT)
check_function_exists(getpwnam HAVE_GETPWNAM)
check_function_exists(getpwuid HAVE_GETPWUID)
check_function_exists(uv_translate_sys_error HAVE_UV_TRANSLATE_SYS_ERROR)
check_function_exists(readv HAVE_READV)
if(Iconv_FOUND)
set(HAVE_ICONV 1)
@ -51,7 +45,10 @@ if(JEMALLOC_FOUND)
set(HAVE_JEMALLOC 1)
endif()
check_function_exists(putenv HAVE_PUTENV)
check_function_exists(_putenv_s HAVE_PUTENV_S)
if(WIN32 AND NOT HAVE_PUTENV_S)
message(SEND_ERROR "_putenv_s() function not found on your system.")
endif()
check_function_exists(opendir HAVE_OPENDIR)
check_function_exists(readlink HAVE_READLINK)
check_function_exists(setenv HAVE_SETENV)
@ -73,6 +70,14 @@ if(HAVE_LANGINFO_H)
check_symbol_exists(CODESET "langinfo.h" HAVE_NL_LANGINFO_CODESET)
endif()
check_include_files("endian.h" HAVE_ENDIAN_H)
check_include_files("sys/endian.h" HAVE_SYS_ENDIAN_H)
set(ENDIAN_INCLUDE_FILE "endian.h")
if(HAVE_SYS_ENDIAN_H AND NOT HAVE_ENDIAN_H)
set(ENDIAN_INCLUDE_FILE "sys/endian.h")
endif()
set(SI "#include <stdint.h>\n")
set(MS "int main(int argc,char**argv)\n{\n uint64_t i=0x0102030405060708ULL;")
set(ME "}")
@ -80,7 +85,7 @@ check_c_source_compiles("
#define _BSD_SOURCE 1
#define _DEFAULT_SOURCE 1
${SI}
#include <endian.h>
#include <${ENDIAN_INCLUDE_FILE}>
#ifndef be64toh
# error No be64toh macros
#endif
@ -98,10 +103,10 @@ endif()
if (NOT "${HAVE_BE64TOH}")
if (NOT "${CMAKE_CROSSCOMPILING}")
# It is safe to make ORDER_BIG_ENDIAN not defined if
# - HAVE_BE64TOH is true. In this case be64toh will be used unconditionally in
# - HAVE_BE64TOH is true. In this case be64toh will be used unconditionally in
# any case and ORDER_BIG_ENDIAN will not be examined.
# - CMAKE_CROSSCOMPILING *and* HAVE_BE64TOH are both false. In this case
# be64toh function which uses cycle and arithmetic operations is used which
# - CMAKE_CROSSCOMPILING *and* HAVE_BE64TOH are both false. In this case
# be64toh function which uses cycle and arithmetic operations is used which
# will work regardless of endianess. Function is sub-optimal though.
check_c_source_runs("
${SI}
@ -137,12 +142,16 @@ configure_file (
find_program(WHOAMI_PROG whoami)
find_program(HOSTNAME_PROG hostname)
if (NOT DEFINED USERNAME AND EXISTS ${WHOAMI_PROG})
if (DEFINED ENV{USERNAME})
set(USERNAME $ENV{USERNAME})
elseif (NOT DEFINED USERNAME AND EXISTS ${WHOAMI_PROG})
execute_process(COMMAND ${WHOAMI_PROG}
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE USERNAME)
endif()
if (EXISTS ${HOSTNAME_PROG})
if (DEFINED ENV{HOSTNAME})
set(HOSTNAME $ENV{HOSTNAME})
elseif (EXISTS ${HOSTNAME_PROG})
execute_process(COMMAND ${HOSTNAME_PROG}
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE HOSTNAME)

View File

@ -5,7 +5,6 @@
#define SIZEOF_INT @SIZEOF_INT@
#define SIZEOF_LONG @SIZEOF_LONG@
#define SIZEOF_OFF_T @SIZEOF_OFF_T@
#if @SIZEOF_VOID_PTR@ == 8
#define ARCH_64
@ -13,25 +12,25 @@
#define ARCH_32
#endif
#define PROJECT_NAME "@PROJECT_NAME@"
#define LOCALE_INSTALL_DIR "@CMAKE_INSTALL_FULL_LOCALEDIR@"
#cmakedefine HAVE__NSGETENVIRON
#cmakedefine HAVE_CRT_EXTERNS_H
#cmakedefine HAVE_FCNTL_H
#cmakedefine HAVE_FD_CLOEXEC
#cmakedefine HAVE_FSEEKO
#cmakedefine HAVE_FSYNC
#cmakedefine HAVE_GETPWENT
#cmakedefine HAVE_GETPWNAM
#cmakedefine HAVE_GETPWUID
#cmakedefine HAVE_ICONV
#cmakedefine HAVE_ICONV_H
#cmakedefine HAVE_LANGINFO_H
#cmakedefine HAVE_LIBGEN_H
#cmakedefine HAVE_LOCALE_H
#cmakedefine HAVE_NL_LANGINFO_CODESET
#cmakedefine HAVE_NL_MSG_CAT_CNTR
#cmakedefine HAVE_PUTENV
#cmakedefine HAVE_PUTENV_S
#cmakedefine HAVE_PWD_H
#cmakedefine HAVE_READLINK
#cmakedefine HAVE_UV_TRANSLATE_SYS_ERROR
// TODO: add proper cmake check
// #define HAVE_SELINUX 1
#cmakedefine HAVE_SETENV
@ -42,19 +41,23 @@
#cmakedefine HAVE_STRCASECMP
#cmakedefine HAVE_STRINGS_H
#cmakedefine HAVE_STRNCASECMP
#cmakedefine HAVE_STROPTS_H
#cmakedefine HAVE_SYS_PARAM_H
#cmakedefine HAVE_SYS_UTSNAME_H
#cmakedefine HAVE_SYS_WAIT_H
#cmakedefine HAVE_UNISTD_H
#cmakedefine HAVE_UTIME
#cmakedefine HAVE_UTIME_H
#cmakedefine HAVE_UTIMES
#cmakedefine HAVE_WORKING_LIBINTL
#cmakedefine UNIX
#cmakedefine USE_FNAME_CASE
#cmakedefine HAVE_SYS_UIO_H
#ifdef HAVE_SYS_UIO_H
#cmakedefine HAVE_READV
# ifndef HAVE_READV
# undef HAVE_SYS_UIO_H
# endif
#endif
#define FEAT_CSCOPE
#cmakedefine FEAT_TUI
#ifndef UNIT_TESTING
#cmakedefine HAVE_JEMALLOC
@ -62,5 +65,6 @@
#cmakedefine HAVE_BE64TOH
#cmakedefine ORDER_BIG_ENDIAN
#define ENDIAN_INCLUDE_FILE <@ENDIAN_INCLUDE_FILE@>
#endif // AUTO_CONFIG_H

View File

@ -5,9 +5,12 @@
#define NVIM_VERSION_MINOR @NVIM_VERSION_MINOR@
#define NVIM_VERSION_PATCH @NVIM_VERSION_PATCH@
#define NVIM_VERSION_PRERELEASE "@NVIM_VERSION_PRERELEASE@"
#cmakedefine NVIM_VERSION_COMMIT "@NVIM_VERSION_COMMIT@"
#cmakedefine NVIM_VERSION_MEDIUM "@NVIM_VERSION_MEDIUM@"
#define NVIM_API_LEVEL @NVIM_API_LEVEL@
#define NVIM_API_LEVEL_COMPAT @NVIM_API_LEVEL_COMPAT@
#define NVIM_API_PRERELEASE @NVIM_API_PRERELEASE@
#define NVIM_VERSION_CFLAGS "@NVIM_VERSION_CFLAGS@"
#define NVIM_VERSION_BUILD_TYPE "@NVIM_VERSION_BUILD_TYPE@"

View File

@ -9,7 +9,7 @@ def DirectoryOfThisScript():
def GetDatabase():
compilation_database_folder = os.path.join(DirectoryOfThisScript(),
'..', '..', 'build')
'..', 'build')
if os.path.exists(compilation_database_folder):
return ycm_core.CompilationDatabase(compilation_database_folder)
return None

View File

@ -31,6 +31,11 @@
#
# CMAKE_BUILD_TYPE := Debug
# By default, nvim's log level is INFO (1) (unless CMAKE_BUILD_TYPE is
# "Release", in which case logging is disabled).
# The log level must be a number DEBUG (0), INFO (1), WARNING (2) or ERROR (3).
# CMAKE_EXTRA_FLAGS += -DMIN_LOG_LEVEL=1
# By default, nvim uses bundled versions of its required third-party
# dependencies.
# Uncomment these entries to instead use system-wide installations of

View File

@ -1,4 +1,4 @@
.Dd November 11, 2015
.Dd January 28, 2016
.Dt NVIM 1
.Os
.Sh NAME
@ -75,7 +75,7 @@ Can be used to edit files starting with a hyphen
.Pq Sq - .
.It Fl -literal
Interpret filenames literally, that is, do not expand wildcards.
Has no effect on UNIX-like systems, where the shell expands wildcards.
Has no effect on Unix-like systems, where the shell expands wildcards.
.It Fl e
Ex mode.
See
@ -353,7 +353,7 @@ Like
but used to store data not generally edited by the user,
namely swap, backup, and ShaDa files.
Defaults to
.Pa ~/.local/share/nvim
.Pa ~/.local/share
if not set.
.It Ev VIMINIT
A string of Ex commands to be executed at startup.
@ -373,11 +373,24 @@ Used to set the 'shell' option, which determines the shell used by the
command.
.It Ev NVIM_TUI_ENABLE_CURSOR_SHAPE
If defined, change the cursor shape to a vertical bar while in insert mode.
Requires that the host terminal support the DECSCUSR CSI escape sequence.
Has no effect in GUIs.
.It Ev NVIM_TUI_ENABLE_TRUE_COLOR
If defined, assume the host terminal supports 24 bit colors.
Requires that the host terminal supports the DECSCUSR CSI escape sequence.
Has no effect in GUIs.
.Pp
Depending on the terminal emulator, using this option with
.Nm
under
.Xr tmux 1
might require adding the following to
.Pa ~/.tmux.conf :
.Bd -literal -offset indent
set -ga terminal-overrides ',*:Ss=\eE[%p1%d q:Se=\eE[2 q'
.Ed
.Pp
See
.Ic terminal-overrides
in the
.Xr tmux 1
manual page for more information.
.El
.Sh FILES
.Bl -tag -width "~/.config/nvim/init.vim"

View File

@ -1,9 +0,0 @@
odie <<-EOS.undent
Whoops, the neovim Homebrew Formula has moved! Please instead run:
brew tap neovim/homebrew-neovim
brew install --HEAD neovim
Thanks!
EOS

View File

@ -2,6 +2,8 @@ set(SYN_VIM_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/genvimvim.lua)
set(GENERATED_RUNTIME_DIR ${PROJECT_BINARY_DIR}/runtime)
set(GENERATED_SYN_VIM ${GENERATED_RUNTIME_DIR}/syntax/vim/generated.vim)
set(GENERATED_HELP_TAGS ${GENERATED_RUNTIME_DIR}/doc/tags)
set(GENERATED_PACKAGE_DIR ${GENERATED_RUNTIME_DIR}/pack/dist/opt)
set(FUNCS_DATA ${PROJECT_BINARY_DIR}/funcs_data.mpack)
file(MAKE_DIRECTORY ${GENERATED_RUNTIME_DIR})
file(MAKE_DIRECTORY ${GENERATED_RUNTIME_DIR}/syntax)
@ -9,15 +11,57 @@ file(MAKE_DIRECTORY ${GENERATED_RUNTIME_DIR}/syntax/vim)
add_custom_command(OUTPUT ${GENERATED_SYN_VIM}
COMMAND ${LUA_PRG} ${SYN_VIM_GENERATOR}
${PROJECT_SOURCE_DIR}/src/nvim ${GENERATED_SYN_VIM}
${PROJECT_SOURCE_DIR}/src/nvim ${GENERATED_SYN_VIM} ${FUNCS_DATA}
DEPENDS
${SYN_VIM_GENERATOR}
${PROJECT_SOURCE_DIR}/src/nvim/ex_cmds.lua
${PROJECT_SOURCE_DIR}/src/nvim/auevents.lua
${PROJECT_SOURCE_DIR}/src/nvim/options.lua
${PROJECT_SOURCE_DIR}/src/nvim/eval.c
${FUNCS_DATA}
)
if(POLICY CMP0054)
cmake_policy(SET CMP0054 OLD)
endif()
file(GLOB PACKAGES ${PROJECT_SOURCE_DIR}/runtime/pack/dist/opt/*)
set(GENERATED_PACKAGE_TAGS)
foreach(PACKAGE ${PACKAGES})
get_filename_component(PACKNAME ${PACKAGE} NAME)
file(GLOB "${PACKNAME}_DOC_FILES" ${PACKAGE}/doc/*.txt)
if("${PACKNAME}_DOC_FILES")
file(MAKE_DIRECTORY ${GENERATED_PACKAGE_DIR}/${PACKNAME})
add_custom_target("${PACKNAME}-tags"
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PACKAGE} ${GENERATED_PACKAGE_DIR}/${PACKNAME}
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
-u NONE -i NONE -e --headless -c "helptags doc" -c quit
DEPENDS
nvim
WORKING_DIRECTORY "${GENERATED_PACKAGE_DIR}/${PACKNAME}"
)
add_custom_command(OUTPUT "${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/tags"
DEPENDS
"${PACKNAME}-tags"
)
set("${PACKNAME}_DOC_NAMES")
foreach(DF "${${PACKNAME}_DOC_FILES}")
get_filename_component(F ${DF} NAME)
list(APPEND "${PACKNAME}_DOC_NAMES" ${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/${F})
endforeach()
install_helper(
FILES ${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/tags "${${PACKNAME}_DOC_NAMES}"
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/pack/dist/opt/${PACKNAME}/doc)
list(APPEND GENERATED_PACKAGE_TAGS "${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/tags")
endif()
endforeach()
file(GLOB DOCFILES ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt)
set(BUILDDOCFILES)
@ -26,25 +70,25 @@ foreach(DF ${DOCFILES})
list(APPEND BUILDDOCFILES ${GENERATED_RUNTIME_DIR}/doc/${F})
endforeach()
add_custom_command(OUTPUT ${BUILDDOCFILES}
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/runtime/doc ${GENERATED_RUNTIME_DIR}/doc
DEPENDS
${DOCFILES})
add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
add_custom_target(helptags
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/runtime/doc ${GENERATED_RUNTIME_DIR}/doc
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
-u NONE
-i NONE
-es
--headless
-c "helptags ++t ."
-c quit
-u NONE -i NONE -e --headless -c "helptags ++t doc" -c quit
DEPENDS
${BUILDDOCFILES}
nvim
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}"
)
add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
DEPENDS
helptags
)
add_custom_target(doc_html
COMMAND make html
DEPENDS
${GENERATED_HELP_TAGS}
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}/doc"
)
@ -53,6 +97,7 @@ add_custom_target(
DEPENDS
${GENERATED_SYN_VIM}
${GENERATED_HELP_TAGS}
${GENERATED_PACKAGE_TAGS}
)
# CMake is painful here. It will create the destination using the user's
@ -81,7 +126,7 @@ endforeach()
file(GLOB_RECURSE RUNTIME_FILES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
*.vim *.dict *.py *.ps *.tutor)
*.vim *.dict *.py *.rb *.ps *.tutor)
foreach(F ${RUNTIME_FILES})
get_filename_component(BASEDIR ${F} PATH)

File diff suppressed because it is too large Load Diff

View File

@ -1,667 +0,0 @@
" ---------------------------------------------------------------------
" getscript.vim
" Author: Charles E. Campbell
" Date: Jan 21, 2014
" Version: 36
" Installing: :help glvs-install
" Usage: :help glvs
"
" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
"redraw!|call inputsave()|call input("Press <cr> to continue")|call inputrestore()
" ---------------------------------------------------------------------
" Initialization: {{{1
" if you're sourcing this file, surely you can't be
" expecting vim to be in its vi-compatible mode!
if exists("g:loaded_getscript")
finish
endif
let g:loaded_getscript= "v36"
if &cp
echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
finish
endif
if v:version < 702
echohl WarningMsg
echo "***warning*** this version of getscript needs vim 7.2"
echohl Normal
finish
endif
let s:keepcpo = &cpo
set cpo&vim
"DechoTabOn
" ---------------------------
" Global Variables: {{{1
" ---------------------------
" Cygwin Detection ------- {{{2
if !exists("g:getscript_cygwin")
if has("win32") || has("win95") || has("win64") || has("win16")
if &shell =~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$'
let g:getscript_cygwin= 1
else
let g:getscript_cygwin= 0
endif
else
let g:getscript_cygwin= 0
endif
endif
" wget vs curl {{{2
if !exists("g:GetLatestVimScripts_wget")
if executable("wget")
let g:GetLatestVimScripts_wget= "wget"
elseif executable("curl")
let g:GetLatestVimScripts_wget= "curl"
else
let g:GetLatestVimScripts_wget = 'echo "GetLatestVimScripts needs wget or curl"'
let g:GetLatestVimScripts_options = ""
endif
endif
" options that wget and curl require:
if !exists("g:GetLatestVimScripts_options")
if g:GetLatestVimScripts_wget == "wget"
let g:GetLatestVimScripts_options= "-q -O"
elseif g:GetLatestVimScripts_wget == "curl"
let g:GetLatestVimScripts_options= "-s -O"
else
let g:GetLatestVimScripts_options= ""
endif
endif
" by default, allow autoinstall lines to work
if !exists("g:GetLatestVimScripts_allowautoinstall")
let g:GetLatestVimScripts_allowautoinstall= 1
endif
" set up default scriptaddr address
if !exists("g:GetLatestVimScripts_scriptaddr")
let g:GetLatestVimScripts_scriptaddr = 'http://vim.sourceforge.net/script.php?script_id='
endif
"" For debugging:
"let g:GetLatestVimScripts_wget = "echo"
"let g:GetLatestVimScripts_options = "options"
" ---------------------------------------------------------------------
" Check If AutoInstall Capable: {{{1
let s:autoinstall= ""
if g:GetLatestVimScripts_allowautoinstall
if (has("win32") || has("gui_win32") || has("gui_win32s") || has("win16") || has("win64") || has("win32unix") || has("win95")) && &shell != "bash"
" windows (but not cygwin/bash)
let s:dotvim= "vimfiles"
if !exists("g:GetLatestVimScripts_mv")
let g:GetLatestVimScripts_mv= "ren"
endif
else
" unix
let s:dotvim= ".vim"
if !exists("g:GetLatestVimScripts_mv")
let g:GetLatestVimScripts_mv= "mv"
endif
endif
if exists("g:GetLatestVimScripts_autoinstalldir") && isdirectory(g:GetLatestVimScripts_autoinstalldir)
let s:autoinstall= g:GetLatestVimScripts_autoinstalldir"
elseif exists('$HOME') && isdirectory(expand("$HOME")."/".s:dotvim)
let s:autoinstall= $HOME."/".s:dotvim
endif
" call Decho("s:autoinstall<".s:autoinstall.">")
"else "Decho
" call Decho("g:GetLatestVimScripts_allowautoinstall=".g:GetLatestVimScripts_allowautoinstall.": :AutoInstall: disabled")
endif
" ---------------------------------------------------------------------
" Public Interface: {{{1
com! -nargs=0 GetLatestVimScripts call getscript#GetLatestVimScripts()
com! -nargs=0 GetScript call getscript#GetLatestVimScripts()
silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts()
" ---------------------------------------------------------------------
" GetLatestVimScripts: this function gets the latest versions of {{{1
" scripts based on the list in
" (first dir in runtimepath)/GetLatest/GetLatestVimScripts.dat
fun! getscript#GetLatestVimScripts()
" call Dfunc("GetLatestVimScripts() autoinstall<".s:autoinstall.">")
" insure that wget is executable
if executable(g:GetLatestVimScripts_wget) != 1
echoerr "GetLatestVimScripts needs ".g:GetLatestVimScripts_wget." which apparently is not available on your system"
" call Dret("GetLatestVimScripts : wget not executable/availble")
return
endif
" insure that fnameescape() is available
if !exists("*fnameescape")
echoerr "GetLatestVimScripts needs fnameescape() (provided by 7.1.299 or later)"
return
endif
" Find the .../GetLatest subdirectory under the runtimepath
for datadir in split(&rtp,',') + ['']
if isdirectory(datadir."/GetLatest")
" call Decho("found directory<".datadir.">")
let datadir= datadir . "/GetLatest"
break
endif
if filereadable(datadir."GetLatestVimScripts.dat")
" call Decho("found ".datadir."/GetLatestVimScripts.dat")
break
endif
endfor
" Sanity checks: readability and writability
if datadir == ""
echoerr 'Missing "GetLatest/" on your runtimepath - see :help glvs-dist-install'
" call Dret("GetLatestVimScripts : unable to find a GetLatest subdirectory")
return
endif
if filewritable(datadir) != 2
echoerr "(getLatestVimScripts) Your ".datadir." isn't writable"
" call Dret("GetLatestVimScripts : non-writable directory<".datadir.">")
return
endif
let datafile= datadir."/GetLatestVimScripts.dat"
if !filereadable(datafile)
echoerr "Your data file<".datafile."> isn't readable"
" call Dret("GetLatestVimScripts : non-readable datafile<".datafile.">")
return
endif
if !filewritable(datafile)
echoerr "Your data file<".datafile."> isn't writable"
" call Dret("GetLatestVimScripts : non-writable datafile<".datafile.">")
return
endif
" --------------------
" Passed sanity checks
" --------------------
" call Decho("datadir <".datadir.">")
" call Decho("datafile <".datafile.">")
" don't let any event handlers interfere (like winmanager's, taglist's, etc)
let eikeep = &ei
let hlskeep = &hls
let acdkeep = &acd
set ei=all hls&vim noacd
" Edit the datafile (ie. GetLatestVimScripts.dat):
" 1. record current directory (origdir),
" 2. change directory to datadir,
" 3. split window
" 4. edit datafile
let origdir= getcwd()
" call Decho("exe cd ".fnameescape(substitute(datadir,'\','/','ge')))
exe "cd ".fnameescape(substitute(datadir,'\','/','ge'))
split
" call Decho("exe e ".fnameescape(substitute(datafile,'\','/','ge')))
exe "e ".fnameescape(substitute(datafile,'\','/','ge'))
res 1000
let s:downloads = 0
let s:downerrors= 0
" Check on dependencies mentioned in plugins
" call Decho(" ")
" call Decho("searching plugins for GetLatestVimScripts dependencies")
let lastline = line("$")
" call Decho("lastline#".lastline)
let firstdir = substitute(&rtp,',.*$','','')
let plugins = split(globpath(firstdir,"plugin/**/*.vim"),'\n')
let plugins = plugins + split(globpath(firstdir,"AsNeeded/**/*.vim"),'\n')
let foundscript = 0
" this loop updates the GetLatestVimScripts.dat file
" with dependencies explicitly mentioned in the plugins
" via GetLatestVimScripts: ... lines
" It reads the plugin script at the end of the GetLatestVimScripts.dat
" file, examines it, and then removes it.
for plugin in plugins
" call Decho(" ")
" call Decho("plugin<".plugin.">")
" read plugin in
" evidently a :r creates a new buffer (the "#" buffer) that is subsequently unused -- bwiping it
$
" call Decho(".dependency checking<".plugin."> line$=".line("$"))
" call Decho("..exe silent r ".fnameescape(plugin))
exe "silent r ".fnameescape(plugin)
exe "silent bwipe ".bufnr("#")
while search('^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+','W') != 0
let depscript = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+\s\+\(.*\)$','\1','e')
let depscriptid = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\(\d\+\)\s\+.*$','\1','')
let llp1 = lastline+1
" call Decho("..depscript<".depscript.">")
" found a "GetLatestVimScripts: # #" line in the script;
" check if its already in the datafile by searching backwards from llp1,
" the (prior to reading in the plugin script) last line plus one of the GetLatestVimScripts.dat file,
" for the script-id with no wrapping allowed.
let curline = line(".")
let noai_script = substitute(depscript,'\s*:AutoInstall:\s*','','e')
exe llp1
let srchline = search('^\s*'.depscriptid.'\s\+\d\+\s\+.*$','bW')
if srchline == 0
" this second search is taken when, for example, a 0 0 scriptname is to be skipped over
let srchline= search('\<'.noai_script.'\>','bW')
endif
" call Decho("..noai_script<".noai_script."> depscriptid#".depscriptid." srchline#".srchline." curline#".line(".")." lastline#".lastline)
if srchline == 0
" found a new script to permanently include in the datafile
let keep_rega = @a
let @a = substitute(getline(curline),'^"\s\+GetLatestVimScripts:\s\+','','')
echomsg "Appending <".@a."> to ".datafile." for ".depscript
" call Decho("..Appending <".@a."> to ".datafile." for ".depscript)
exe lastline."put a"
let @a = keep_rega
let lastline = llp1
let curline = curline + 1
let foundscript = foundscript + 1
" else " Decho
" call Decho("..found <".noai_script."> (already in datafile at line#".srchline.")")
endif
let curline = curline + 1
exe curline
endwhile
" llp1: last line plus one
let llp1= lastline + 1
" call Decho(".deleting lines: ".llp1.",$d")
exe "silent! ".llp1.",$d"
endfor
" call Decho("--- end dependency checking loop --- foundscript=".foundscript)
" call Decho(" ")
" call Dredir("BUFFER TEST (GetLatestVimScripts 1)","ls!")
if foundscript == 0
setlocal nomod
endif
" --------------------------------------------------------------------
" Check on out-of-date scripts using GetLatest/GetLatestVimScripts.dat
" --------------------------------------------------------------------
" call Decho("begin: checking out-of-date scripts using datafile<".datafile.">")
setlocal lz
1
" /^-----/,$g/^\s*\d/call Decho(getline("."))
1
/^-----/,$g/^\s*\d/call s:GetOneScript()
" call Decho("--- end out-of-date checking --- ")
" Final report (an echomsg)
try
silent! ?^-------?
catch /^Vim\%((\a\+)\)\=:E114/
" call Dret("GetLatestVimScripts : nothing done!")
return
endtry
exe "norm! kz\<CR>"
redraw!
let s:msg = ""
if s:downloads == 1
let s:msg = "Downloaded one updated script to <".datadir.">"
elseif s:downloads == 2
let s:msg= "Downloaded two updated scripts to <".datadir.">"
elseif s:downloads > 1
let s:msg= "Downloaded ".s:downloads." updated scripts to <".datadir.">"
else
let s:msg= "Everything was already current"
endif
if s:downerrors > 0
let s:msg= s:msg." (".s:downerrors." downloading errors)"
endif
echomsg s:msg
" save the file
if &mod
silent! w!
endif
q!
" restore events and current directory
exe "cd ".fnameescape(substitute(origdir,'\','/','ge'))
let &ei = eikeep
let &hls = hlskeep
let &acd = acdkeep
setlocal nolz
" call Dredir("BUFFER TEST (GetLatestVimScripts 2)","ls!")
" call Dret("GetLatestVimScripts : did ".s:downloads." downloads")
endfun
" ---------------------------------------------------------------------
" GetOneScript: (Get Latest Vim Script) this function operates {{{1
" on the current line, interpreting two numbers and text as
" ScriptID, SourceID, and Filename.
" It downloads any scripts that have newer versions from vim.sourceforge.net.
fun! s:GetOneScript(...)
" call Dfunc("GetOneScript()")
" set options to allow progress to be shown on screen
let rega= @a
let t_ti= &t_ti
let t_te= &t_te
let rs = &rs
set t_ti= t_te= nors
" put current line on top-of-screen and interpret it into
" a script identifer : used to obtain webpage
" source identifier : used to identify current version
" and an associated comment: used to report on what's being considered
if a:0 >= 3
let scriptid = a:1
let srcid = a:2
let fname = a:3
let cmmnt = ""
" call Decho("scriptid<".scriptid.">")
" call Decho("srcid <".srcid.">")
" call Decho("fname <".fname.">")
else
let curline = getline(".")
if curline =~ '^\s*#'
let @a= rega
" call Dret("GetOneScript : skipping a pure comment line")
return
endif
let parsepat = '^\s*\(\d\+\)\s\+\(\d\+\)\s\+\(.\{-}\)\(\s*#.*\)\=$'
try
let scriptid = substitute(curline,parsepat,'\1','e')
catch /^Vim\%((\a\+)\)\=:E486/
let scriptid= 0
endtry
try
let srcid = substitute(curline,parsepat,'\2','e')
catch /^Vim\%((\a\+)\)\=:E486/
let srcid= 0
endtry
try
let fname= substitute(curline,parsepat,'\3','e')
catch /^Vim\%((\a\+)\)\=:E486/
let fname= ""
endtry
try
let cmmnt= substitute(curline,parsepat,'\4','e')
catch /^Vim\%((\a\+)\)\=:E486/
let cmmnt= ""
endtry
" call Decho("curline <".curline.">")
" call Decho("parsepat<".parsepat.">")
" call Decho("scriptid<".scriptid.">")
" call Decho("srcid <".srcid.">")
" call Decho("fname <".fname.">")
endif
" plugin author protection from downloading his/her own scripts atop their latest work
if scriptid == 0 || srcid == 0
" When looking for :AutoInstall: lines, skip scripts that have 0 0 scriptname
let @a= rega
" call Dret("GetOneScript : skipping a scriptid==srcid==0 line")
return
endif
let doautoinstall= 0
if fname =~ ":AutoInstall:"
" call Decho("case AutoInstall: fname<".fname.">")
let aicmmnt= substitute(fname,'\s\+:AutoInstall:\s\+',' ','')
" call Decho("aicmmnt<".aicmmnt."> s:autoinstall=".s:autoinstall)
if s:autoinstall != ""
let doautoinstall = g:GetLatestVimScripts_allowautoinstall
endif
else
let aicmmnt= fname
endif
" call Decho("aicmmnt<".aicmmnt.">: doautoinstall=".doautoinstall)
exe "norm z\<CR>"
redraw!
" call Decho('considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid)
echo 'considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid
" grab a copy of the plugin's vim.sourceforge.net webpage
let scriptaddr = g:GetLatestVimScripts_scriptaddr.scriptid
let tmpfile = tempname()
let v:errmsg = ""
" make up to three tries at downloading the description
let itry= 1
while itry <= 3
" call Decho(".try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr)
if has("win32") || has("win16") || has("win95")
" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)."|bw!")
new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)|bw!
else
" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr))
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr)
endif
if itry == 1
exe "silent vsplit ".fnameescape(tmpfile)
else
silent! e %
endif
setlocal bh=wipe
" find the latest source-id in the plugin's webpage
silent! 1
let findpkg= search('Click on the package to download','W')
if findpkg > 0
break
endif
let itry= itry + 1
endwhile
" call Decho(" --- end downloading tries while loop --- itry=".itry)
" testing: did finding "Click on the package..." fail?
if findpkg == 0 || itry >= 4
silent q!
call delete(tmpfile)
" restore options
let &t_ti = t_ti
let &t_te = t_te
let &rs = rs
let s:downerrors = s:downerrors + 1
" call Decho("***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">")
echomsg "***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">"
" call Dret("GetOneScript : srch for /Click on the package/ failed")
let @a= rega
return
endif
" call Decho('found "Click on the package to download"')
let findsrcid= search('src_id=','W')
if findsrcid == 0
silent q!
call delete(tmpfile)
" restore options
let &t_ti = t_ti
let &t_te = t_te
let &rs = rs
let s:downerrors = s:downerrors + 1
" call Decho("***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">")
echomsg "***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">"
let @a= rega
" call Dret("GetOneScript : srch for /src_id/ failed")
return
endif
" call Decho('found "src_id=" in description page')
let srcidpat = '^\s*<td class.*src_id=\(\d\+\)">\([^<]\+\)<.*$'
let latestsrcid= substitute(getline("."),srcidpat,'\1','')
let sname = substitute(getline("."),srcidpat,'\2','') " script name actually downloaded
" call Decho("srcidpat<".srcidpat."> latestsrcid<".latestsrcid."> sname<".sname.">")
silent q!
call delete(tmpfile)
" convert the strings-of-numbers into numbers
let srcid = srcid + 0
let latestsrcid = latestsrcid + 0
" call Decho("srcid=".srcid." latestsrcid=".latestsrcid." sname<".sname.">")
" has the plugin's most-recent srcid increased, which indicates that it has been updated
if latestsrcid > srcid
" call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."]: need to update <".sname.">")
let s:downloads= s:downloads + 1
if sname == bufname("%")
" GetLatestVimScript has to be careful about downloading itself
let sname= "NEW_".sname
endif
" -----------------------------------------------------------------------------
" the plugin has been updated since we last obtained it, so download a new copy
" -----------------------------------------------------------------------------
" call Decho(".downloading new <".sname.">")
echomsg ".downloading new <".sname.">"
if has("win32") || has("win16") || has("win95")
" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='.latestsrcid)."|q")
new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='.latestsrcid)|q
else
" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='))
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id=').latestsrcid
endif
" --------------------------------------------------------------------------
" AutoInstall: only if doautoinstall has been requested by the plugin itself
" --------------------------------------------------------------------------
" call Decho("checking if plugin requested autoinstall: doautoinstall=".doautoinstall)
if doautoinstall
" call Decho(" ")
" call Decho("Autoinstall: getcwd<".getcwd()."> filereadable(".sname.")=".filereadable(sname))
if filereadable(sname)
" call Decho("<".sname."> is readable")
" call Decho("exe silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall))
exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall)
let curdir = fnameescape(substitute(getcwd(),'\','/','ge'))
let installdir= curdir."/Installed"
if !isdirectory(installdir)
call mkdir(installdir)
endif
" call Decho("curdir<".curdir."> installdir<".installdir.">")
" call Decho("exe cd ".fnameescape(s:autoinstall))
exe "cd ".fnameescape(s:autoinstall)
" determine target directory for moves
let firstdir= substitute(&rtp,',.*$','','')
let pname = substitute(sname,'\..*','.vim','')
" call Decho("determine tgtdir: is <".firstdir.'/AsNeeded/'.pname." readable?")
if filereadable(firstdir.'/AsNeeded/'.pname)
let tgtdir= "AsNeeded"
else
let tgtdir= "plugin"
endif
" call Decho("tgtdir<".tgtdir."> pname<".pname.">")
" decompress
if sname =~ '\.bz2$'
" call Decho("decompress: attempt to bunzip2 ".sname)
exe "sil !bunzip2 ".shellescape(sname)
let sname= substitute(sname,'\.bz2$','','')
" call Decho("decompress: new sname<".sname."> after bunzip2")
elseif sname =~ '\.gz$'
" call Decho("decompress: attempt to gunzip ".sname)
exe "sil !gunzip ".shellescape(sname)
let sname= substitute(sname,'\.gz$','','')
" call Decho("decompress: new sname<".sname."> after gunzip")
elseif sname =~ '\.xz$'
" call Decho("decompress: attempt to unxz ".sname)
exe "sil !unxz ".shellescape(sname)
let sname= substitute(sname,'\.xz$','','')
" call Decho("decompress: new sname<".sname."> after unxz")
else
" call Decho("no decompression needed")
endif
" distribute archive(.zip, .tar, .vba, ...) contents
if sname =~ '\.zip$'
" call Decho("dearchive: attempt to unzip ".sname)
exe "silent !unzip -o ".shellescape(sname)
elseif sname =~ '\.tar$'
" call Decho("dearchive: attempt to untar ".sname)
exe "silent !tar -xvf ".shellescape(sname)
elseif sname =~ '\.tgz$'
" call Decho("dearchive: attempt to untar+gunzip ".sname)
exe "silent !tar -zxvf ".shellescape(sname)
elseif sname =~ '\.taz$'
" call Decho("dearchive: attempt to untar+uncompress ".sname)
exe "silent !tar -Zxvf ".shellescape(sname)
elseif sname =~ '\.tbz$'
" call Decho("dearchive: attempt to untar+bunzip2 ".sname)
exe "silent !tar -jxvf ".shellescape(sname)
elseif sname =~ '\.txz$'
" call Decho("dearchive: attempt to untar+xz ".sname)
exe "silent !tar -Jxvf ".shellescape(sname)
elseif sname =~ '\.vba$'
" call Decho("dearchive: attempt to handle a vimball: ".sname)
silent 1split
if exists("g:vimball_home")
let oldvimballhome= g:vimball_home
endif
let g:vimball_home= s:autoinstall
exe "silent e ".fnameescape(sname)
silent so %
silent q
if exists("oldvimballhome")
let g:vimball_home= oldvimballhome
else
unlet g:vimball_home
endif
else
" call Decho("no dearchiving needed")
endif
" ---------------------------------------------
" move plugin to plugin/ or AsNeeded/ directory
" ---------------------------------------------
if sname =~ '.vim$'
" call Decho("dearchive: attempt to simply move ".sname." to ".tgtdir)
exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".tgtdir
else
" call Decho("dearchive: move <".sname."> to installdir<".installdir.">")
exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".installdir
endif
if tgtdir != "plugin"
" call Decho("exe silent !".g:GetLatestVimScripts_mv." plugin/".shellescape(pname)." ".tgtdir)
exe "silent !".g:GetLatestVimScripts_mv." plugin/".shellescape(pname)." ".tgtdir
endif
" helptags step
let docdir= substitute(&rtp,',.*','','e')."/doc"
" call Decho("helptags: docdir<".docdir.">")
exe "helptags ".fnameescape(docdir)
exe "cd ".fnameescape(curdir)
endif
if fname !~ ':AutoInstall:'
let modline=scriptid." ".latestsrcid." :AutoInstall: ".fname.cmmnt
else
let modline=scriptid." ".latestsrcid." ".fname.cmmnt
endif
else
let modline=scriptid." ".latestsrcid." ".fname.cmmnt
endif
" update the data in the <GetLatestVimScripts.dat> file
call setline(line("."),modline)
" call Decho("update data in ".expand("%")."#".line(".").": modline<".modline.">")
" else " Decho
" call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."], no need to update")
endif
" restore options
let &t_ti = t_ti
let &t_te = t_te
let &rs = rs
let @a = rega
" call Dredir("BUFFER TEST (GetOneScript)","ls!")
" call Dret("GetOneScript")
endfun
" ---------------------------------------------------------------------
" Restore Options: {{{1
let &cpo= s:keepcpo
unlet s:keepcpo
" ---------------------------------------------------------------------
" Modelines: {{{1
" vim: ts=8 sts=2 fdm=marker nowrap

157
runtime/autoload/health.vim Normal file
View File

@ -0,0 +1,157 @@
function! s:enhance_syntax() abort
syntax keyword healthError ERROR
highlight link healthError Error
syntax keyword healthWarning WARNING
highlight link healthWarning WarningMsg
syntax keyword healthInfo INFO
highlight link healthInfo ModeMsg
syntax keyword healthSuccess SUCCESS
highlight link healthSuccess Function
syntax keyword healthSuggestion SUGGESTIONS
highlight link healthSuggestion String
" We do not care about markdown syntax errors in :CheckHealth output.
highlight! link markdownError Normal
endfunction
" Runs the specified healthchecks.
" Runs all discovered healthchecks if a:plugin_names is empty.
function! health#check(plugin_names) abort
let healthchecks = empty(a:plugin_names)
\ ? s:discover_health_checks()
\ : s:to_fn_names(a:plugin_names)
tabnew
setlocal wrap breakindent
setlocal filetype=markdown bufhidden=wipe
call s:enhance_syntax()
if empty(healthchecks)
call setline(1, 'ERROR: No healthchecks found.')
else
redraw|echo 'Running healthchecks...'
for c in healthchecks
let output = ''
call append('$', split(printf("\n%s\n%s", c, repeat('=',72)), "\n"))
try
let output = "\n\n".execute('call '.c.'()')
catch
if v:exception =~# '^Vim\%((\a\+)\)\=:E117.*\V'.c
let output = execute(
\ 'call health#report_error(''No healthcheck found for "'
\ .s:to_plugin_name(c)
\ .'" plugin.'')')
else
let output = execute(
\ 'call health#report_error(''Failed to run healthcheck for "'
\ .s:to_plugin_name(c)
\ .'" plugin. Exception:''."\n".v:exception)')
endif
endtry
call append('$', split(output, "\n") + [''])
redraw
endfor
endif
setlocal nomodified
redraw|echo ''
endfunction
" Starts a new report.
function! health#report_start(name) abort
echo "\n## " . a:name
endfunction
" Indents lines *except* line 1 of a string if it contains newlines.
function! s:indent_after_line1(s, columns) abort
let lines = split(a:s, "\n", 0)
if len(lines) < 2 " We do not indent line 1, so nothing to do.
return a:s
endif
for i in range(1, len(lines)-1) " Indent lines after the first.
let lines[i] = substitute(lines[i], '^\s*', repeat(' ', a:columns), 'g')
endfor
return join(lines, "\n")
endfunction
" Format a message for a specific report item
function! s:format_report_message(status, msg, ...) abort " {{{
let output = ' - ' . a:status . ': ' . s:indent_after_line1(a:msg, 4)
let suggestions = []
" Optional parameters
if a:0 > 0
let suggestions = type(a:1) == type("") ? [a:1] : a:1
if type(suggestions) != type([])
echoerr "Expected String or List"
endif
endif
" Report each suggestion
if len(suggestions) > 0
let output .= "\n - SUGGESTIONS:"
endif
for suggestion in suggestions
let output .= "\n - " . s:indent_after_line1(suggestion, 10)
endfor
return output
endfunction " }}}
" Use {msg} to report information in the current section
function! health#report_info(msg) abort " {{{
echo s:format_report_message('INFO', a:msg)
endfunction " }}}
" Reports a successful healthcheck.
function! health#report_ok(msg) abort " {{{
echo s:format_report_message('SUCCESS', a:msg)
endfunction " }}}
" Reports a health warning.
function! health#report_warn(msg, ...) abort " {{{
if a:0 > 0
echo s:format_report_message('WARNING', a:msg, a:1)
else
echo s:format_report_message('WARNING', a:msg)
endif
endfunction " }}}
" Reports a failed healthcheck.
function! health#report_error(msg, ...) abort " {{{
if a:0 > 0
echo s:format_report_message('ERROR', a:msg, a:1)
else
echo s:format_report_message('ERROR', a:msg)
endif
endfunction " }}}
function! s:filepath_to_function(name) abort
return substitute(substitute(substitute(a:name, ".*autoload/", "", ""),
\ "\\.vim", "#check", ""), "/", "#", "g")
endfunction
function! s:discover_health_checks() abort
let healthchecks = globpath(&runtimepath, 'autoload/health/*.vim', 1, 1)
let healthchecks = map(healthchecks, '<SID>filepath_to_function(v:val)')
return healthchecks
endfunction
" Translates a list of plugin names to healthcheck function names.
function! s:to_fn_names(plugin_names) abort
let healthchecks = []
for p in a:plugin_names
call add(healthchecks, 'health#'.p.'#check')
endfor
return healthchecks
endfunction
" Extracts 'foo' from 'health#foo#check'.
function! s:to_plugin_name(fn_name) abort
return substitute(a:fn_name,
\ '\v.*health\#(.+)\#check.*', '\1', '')
endfunction

View File

@ -0,0 +1,158 @@
let s:suggest_faq = 'See https://github.com/neovim/neovim/wiki/FAQ'
function! s:check_config() abort
call health#report_start('Configuration')
let sensible_pi = globpath(&runtimepath, '**/sensible.vim', 1, 1)
if empty(sensible_pi)
call health#report_ok('no issues found')
else
call health#report_info("found sensible.vim plugin:\n".join(sensible_pi, "\n"))
call health#report_error("sensible.vim plugin is not needed; Nvim has the same defaults built-in."
\ ." Also, sensible.vim sets 'ttimeoutlen' to a sub-optimal value.",
\ ["Remove sensible.vim plugin, or wrap it in a `if !has('nvim')` check."])
endif
endfunction
" Load the remote plugin manifest file and check for unregistered plugins
function! s:check_rplugin_manifest() abort
call health#report_start('Remote Plugins')
let existing_rplugins = {}
for item in remote#host#PluginsForHost('python')
let existing_rplugins[item.path] = 'python'
endfor
for item in remote#host#PluginsForHost('python3')
let existing_rplugins[item.path] = 'python3'
endfor
let require_update = 0
for path in map(split(&runtimepath, ','), 'resolve(v:val)')
let python_glob = glob(path.'/rplugin/python*', 1, 1)
if empty(python_glob)
continue
endif
let python_dir = python_glob[0]
let python_version = fnamemodify(python_dir, ':t')
for script in glob(python_dir.'/*.py', 1, 1)
\ + glob(python_dir.'/*/__init__.py', 1, 1)
let contents = join(readfile(script))
if contents =~# '\<\%(from\|import\)\s\+neovim\>'
if script =~# '/__init__\.py$'
let script = fnamemodify(script, ':h')
endif
if !has_key(existing_rplugins, script)
let msg = printf('"%s" is not registered.', fnamemodify(path, ':t'))
if python_version ==# 'pythonx'
if !has('python2') && !has('python3')
let msg .= ' (python2 and python3 not available)'
endif
elseif !has(python_version)
let msg .= printf(' (%s not available)', python_version)
else
let require_update = 1
endif
call health#report_warn(msg)
endif
break
endif
endfor
endfor
if require_update
call health#report_warn('Out of date', ['Run `:UpdateRemotePlugins`'])
else
call health#report_ok('Up to date')
endif
endfunction
function! s:check_performance() abort
call health#report_start('Performance')
" check buildtype
let buildtype = matchstr(execute('version'), '\v\cbuild type:?\s*[^\n\r\t ]+')
if empty(buildtype)
call health#report_error('failed to get build type from :version')
elseif buildtype =~# '\v(MinSizeRel|Release|RelWithDebInfo)'
call health#report_ok(buildtype)
else
call health#report_info(buildtype)
call health#report_warn(
\ "Non-optimized build-type. Nvim will be slower.",
\ ["Install a different Nvim package, or rebuild with `CMAKE_BUILD_TYPE=RelWithDebInfo`.",
\ s:suggest_faq])
endif
endfunction
function! s:check_tmux() abort
if empty($TMUX) || !executable('tmux')
return
endif
call health#report_start('tmux')
" check escape-time
let suggestions = ["Set escape-time in ~/.tmux.conf:\nset-option -sg escape-time 10",
\ s:suggest_faq]
let cmd = 'tmux show-option -qvgs escape-time'
let out = system(cmd)
let tmux_esc_time = substitute(out, '\v(\s|\r|\n)', '', 'g')
if v:shell_error
call health#report_error('command failed: '.cmd."\n".out)
elseif empty(tmux_esc_time)
call health#report_error('escape-time is not set', suggestions)
elseif tmux_esc_time > 500
call health#report_error(
\ 'escape-time ('.tmux_esc_time.') is higher than 300ms', suggestions)
else
call health#report_ok('escape-time: '.tmux_esc_time.'ms')
endif
" check $TERM
call health#report_info('$TERM: '.$TERM)
if $TERM !~# '\v(tmux-256color|screen-256color)'
call health#report_error(
\ '$TERM should be "screen-256color" or "tmux-256color" when running tmux.',
\ ["Set default-terminal in ~/.tmux.conf:\nset-option -g default-terminal \"screen-256color\"",
\ s:suggest_faq])
endif
endfunction
function! s:check_terminfo() abort
if !executable('infocmp')
return
endif
call health#report_start('terminfo')
let suggestions = [
\ "Set key_backspace to \\177 (ASCII BACKSPACE). Run these commands:\n"
\ .'infocmp $TERM | sed ''s/kbs=^[hH]/kbs=\\177/'' > $TERM.ti'
\ ."\n"
\ .'tic $TERM.ti',
\ s:suggest_faq]
let cmd = 'infocmp -L'
let out = system(cmd)
let kbs_entry = matchstr(out, 'key_backspace=\S*')
if v:shell_error
call health#report_error('command failed: '.cmd."\n".out)
elseif !empty(matchstr(out, '\Vkey_backspace=^H'))
call health#report_error('key_backspace (kbs) entry is ^H (ASCII DELETE): '
\ .kbs_entry, suggestions)
else
call health#report_info('key_backspace terminfo entry: '
\ .(empty(kbs_entry) ? '? (not found)' : kbs_entry))
endif
endfunction
function! health#nvim#check() abort
call s:check_config()
call s:check_performance()
call s:check_rplugin_manifest()
call s:check_terminfo()
call s:check_tmux()
endfunction

View File

@ -0,0 +1,377 @@
function! s:is_bad_response(s) abort
return a:s =~? '\v(^unable)|(^error)'
endfunction
function! s:trim(s) abort
return substitute(a:s, '^\_s*\|\_s*$', '', 'g')
endfunction
" Simple version comparison.
function! s:version_cmp(a, b) abort
let a = split(a:a, '\.')
let b = split(a:b, '\.')
for i in range(len(a))
if a[i] > b[i]
return 1
elseif a[i] < b[i]
return -1
endif
endfor
return 0
endfunction
" Fetch the contents of a URL.
function! s:download(url) abort
if executable('curl')
let rv = system(['curl', '-sL', a:url])
return v:shell_error ? 'curl error: '.v:shell_error : rv
elseif executable('python')
let script = "
\try:\n
\ from urllib.request import urlopen\n
\except ImportError:\n
\ from urllib2 import urlopen\n
\\n
\response = urlopen('".a:url."')\n
\print(response.read().decode('utf8'))\n
\"
let rv = system(['python', '-c', script])
return empty(rv) && v:shell_error
\ ? 'python urllib.request error: '.v:shell_error
\ : rv
endif
return 'missing `curl` and `python`, cannot make pypi request'
endfunction
" Get the latest Neovim Python client version from PyPI.
function! s:latest_pypi_version() abort
let pypi_version = 'unable to get pypi response'
let pypi_response = s:download('https://pypi.python.org/pypi/neovim/json')
if !empty(pypi_response)
try
let pypi_data = json_decode(pypi_response)
catch /E474/
return 'error: '.pypi_response
endtry
let pypi_version = get(get(pypi_data, 'info', {}), 'version', 'unable to parse')
endif
return pypi_version
endfunction
" Get version information using the specified interpreter. The interpreter is
" used directly in case breaking changes were introduced since the last time
" Neovim's Python client was updated.
"
" Returns: [
" {python executable version},
" {current nvim version},
" {current pypi nvim status},
" {installed version status}
" ]
function! s:version_info(python) abort
let pypi_version = s:latest_pypi_version()
let python_version = s:trim(system([
\ a:python,
\ '-c',
\ 'import sys; print(".".join(str(x) for x in sys.version_info[:3]))',
\ ]))
if empty(python_version)
let python_version = 'unable to parse python response'
endif
let nvim_path = s:trim(system([
\ a:python,
\ '-c',
\ 'import neovim; print(neovim.__file__)']))
let nvim_path = v:shell_error ? '' : nvim_path
if empty(nvim_path)
return [python_version, 'unable to find nvim executable', pypi_version, 'unable to get nvim executable']
endif
" Assuming that multiple versions of a package are installed, sort them
" numerically in descending order.
function! s:compare(metapath1, metapath2)
let a = matchstr(fnamemodify(a:metapath1, ':p:h:t'), '[0-9.]\+')
let b = matchstr(fnamemodify(a:metapath2, ':p:h:t'), '[0-9.]\+')
return a == b ? 0 : a > b ? 1 : -1
endfunction
let nvim_version = 'unable to find nvim version'
let base = fnamemodify(nvim_path, ':h')
let metas = glob(base.'-*/METADATA', 1, 1) + glob(base.'-*/PKG-INFO', 1, 1)
let metas = sort(metas, 's:compare')
if !empty(metas)
for meta_line in readfile(metas[0])
if meta_line =~# '^Version:'
let nvim_version = matchstr(meta_line, '^Version: \zs\S\+')
break
endif
endfor
endif
let version_status = 'unknown'
if !s:is_bad_response(nvim_version) && !s:is_bad_response(pypi_version)
if s:version_cmp(nvim_version, pypi_version) == -1
let version_status = 'outdated'
else
let version_status = 'up to date'
endif
endif
return [python_version, nvim_version, pypi_version, version_status]
endfunction
" Check the Python interpreter's usability.
function! s:check_bin(bin) abort
if !filereadable(a:bin)
call health#report_error(printf('"%s" was not found.', a:bin))
return 0
elseif executable(a:bin) != 1
call health#report_error(printf('"%s" is not executable.', a:bin))
return 0
endif
return 1
endfunction
function! s:check_python(version) abort
call health#report_start('Python ' . a:version . ' provider')
let python_bin_name = 'python'.(a:version == 2 ? '' : '3')
let pyenv = resolve(exepath('pyenv'))
let pyenv_root = exists('$PYENV_ROOT') ? resolve($PYENV_ROOT) : 'n'
let venv = exists('$VIRTUAL_ENV') ? resolve($VIRTUAL_ENV) : ''
let host_prog_var = python_bin_name.'_host_prog'
let host_skip_var = python_bin_name.'_host_skip_check'
let python_bin = ''
let python_multiple = []
if exists('g:'.host_prog_var)
call health#report_info(printf('Using: g:%s = "%s"', host_prog_var, get(g:, host_prog_var)))
endif
let [python_bin_name, pythonx_errs] = provider#pythonx#Detect(a:version)
if empty(python_bin_name)
call health#report_warn('No Python interpreter was found with the neovim '
\ . 'module. Using the first available for diagnostics.')
if !empty(pythonx_errs)
call health#report_warn(pythonx_errs)
endif
let old_skip = get(g:, host_skip_var, 0)
let g:[host_skip_var] = 1
let [python_bin_name, pythonx_errs] = provider#pythonx#Detect(a:version)
let g:[host_skip_var] = old_skip
endif
if !empty(python_bin_name)
if exists('g:'.host_prog_var)
let python_bin = exepath(python_bin_name)
endif
let python_bin_name = fnamemodify(python_bin_name, ':t')
endif
if !empty(pythonx_errs)
call health#report_error('Python provider error', pythonx_errs)
endif
if !empty(python_bin_name) && empty(python_bin) && empty(pythonx_errs)
if !exists('g:'.host_prog_var)
call health#report_info(printf('`g:%s` is not set. Searching for '
\ . '%s in the environment.', host_prog_var, python_bin_name))
endif
if !empty(pyenv)
if empty(pyenv_root)
call health#report_warn(
\ 'pyenv was found, but $PYENV_ROOT is not set.',
\ ['Did you follow the final install instructions?']
\ )
else
call health#report_ok(printf('pyenv found: "%s"', pyenv))
endif
let python_bin = s:trim(system(
\ printf('"%s" which %s 2>/dev/null', pyenv, python_bin_name)))
if empty(python_bin)
call health#report_warn(printf('pyenv couldn''t find %s.', python_bin_name))
endif
endif
if empty(python_bin)
let python_bin = exepath(python_bin_name)
if exists('$PATH')
for path in split($PATH, ':')
let path_bin = path.'/'.python_bin_name
if path_bin != python_bin && index(python_multiple, path_bin) == -1
\ && executable(path_bin)
call add(python_multiple, path_bin)
endif
endfor
if len(python_multiple)
" This is worth noting since the user may install something
" that changes $PATH, like homebrew.
call health#report_info(printf('There are multiple %s executables found. '
\ . 'Set "g:%s" to avoid surprises.', python_bin_name, host_prog_var))
endif
if python_bin =~# '\<shims\>'
call health#report_warn(printf('"%s" appears to be a pyenv shim.', python_bin), [
\ 'The "pyenv" executable is not in $PATH,',
\ 'Your pyenv installation is broken. You should set '
\ . '"g:'.host_prog_var.'" to avoid surprises.',
\ ])
endif
endif
endif
endif
if !empty(python_bin)
if empty(venv) && !empty(pyenv) && !exists('g:'.host_prog_var)
\ && !empty(pyenv_root) && resolve(python_bin) !~# '^'.pyenv_root.'/'
call health#report_warn('pyenv is not set up optimally.', [
\ printf('Suggestion: Create a virtualenv specifically '
\ . 'for Neovim using pyenv and use "g:%s". This will avoid '
\ . 'the need to install Neovim''s Python client in each '
\ . 'version/virtualenv.', host_prog_var)
\ ])
elseif !empty(venv) && exists('g:'.host_prog_var)
if !empty(pyenv_root)
let venv_root = pyenv_root
else
let venv_root = fnamemodify(venv, ':h')
endif
if resolve(python_bin) !~# '^'.venv_root.'/'
call health#report_warn('Your virtualenv is not set up optimally.', [
\ printf('Suggestion: Create a virtualenv specifically '
\ . 'for Neovim and use "g:%s". This will avoid '
\ . 'the need to install Neovim''s Python client in each '
\ . 'virtualenv.', host_prog_var)
\ ])
endif
endif
endif
if empty(python_bin) && !empty(python_bin_name)
" An error message should have already printed.
call health#report_error(printf('"%s" was not found.', python_bin_name))
elseif !empty(python_bin) && !s:check_bin(python_bin)
let python_bin = ''
endif
" Check if $VIRTUAL_ENV is active
let virtualenv_inactive = 0
if exists('$VIRTUAL_ENV')
if !empty(pyenv)
let pyenv_prefix = resolve(s:trim(system([pyenv, 'prefix'])))
if $VIRTUAL_ENV != pyenv_prefix
let virtualenv_inactive = 1
endif
elseif !empty(python_bin_name) && exepath(python_bin_name) !~# '^'.$VIRTUAL_ENV.'/'
let virtualenv_inactive = 1
endif
endif
if virtualenv_inactive
let suggestions = [
\ 'If you are using Zsh, see: http://vi.stackexchange.com/a/7654/5229',
\ ]
call health#report_warn(
\ '$VIRTUAL_ENV exists but appears to be inactive. '
\ . 'This could lead to unexpected results.',
\ suggestions)
endif
" Diagnostic output
call health#report_info('Executable: ' . (empty(python_bin) ? 'Not found' : python_bin))
if len(python_multiple)
for path_bin in python_multiple
call health#report_info('Other python executable: ' . path_bin)
endfor
endif
if !empty(python_bin)
let [pyversion, current, latest, status] = s:version_info(python_bin)
if a:version != str2nr(pyversion)
call health#report_warn('Got an unexpected version of Python.' .
\ ' This could lead to confusing error messages.')
endif
if a:version == 3 && str2float(pyversion) < 3.3
call health#report_warn('Python 3.3+ is recommended.')
endif
call health#report_info('Python'.a:version.' version: ' . pyversion)
call health#report_info(printf('%s-neovim Version: %s', python_bin_name, current))
if s:is_bad_response(current)
let suggestions = [
\ 'Error found was: ' . current,
\ 'Use the command `$ pip' . a:version . ' install neovim`',
\ ]
call health#report_error(
\ 'Neovim Python client is not installed.',
\ suggestions)
endif
if s:is_bad_response(latest)
call health#report_warn('Unable to contact PyPI.')
call health#report_error('HTTP request failed: '.latest)
endif
if s:is_bad_response(status)
call health#report_warn('Latest Neovim Python client version: ('.latest.')')
elseif !s:is_bad_response(latest)
call health#report_ok('Latest Neovim Python client is installed: ('.status.')')
endif
endif
endfunction
function! s:check_ruby() abort
call health#report_start('Ruby provider')
let ruby_version = systemlist('ruby -v')[0]
let ruby_prog = provider#ruby#Detect()
let suggestions =
\ ['Install or upgrade the neovim RubyGem using `gem install neovim`.']
if empty(ruby_prog)
let ruby_prog = 'not found'
let prog_vers = 'not found'
call health#report_error('Missing Neovim RubyGem', suggestions)
else
silent let latest_gem = get(systemlist("gem list -ra '^neovim$' 2>/dev/null | " .
\ "awk -F'[()]' '{print $2}' | " .
\ 'cut -d, -f1'), 0, 'not found')
let latest_desc = ' (latest: ' . latest_gem . ')'
silent let prog_vers = systemlist(ruby_prog . ' --version')[0]
if v:shell_error
let prog_vers = 'not found' . latest_desc
call health#report_warn('Neovim RubyGem is not up-to-date.', suggestions)
elseif s:version_cmp(prog_vers, latest_gem) == -1
let prog_vers .= latest_desc
call health#report_warn('Neovim RubyGem is not up-to-date.', suggestions)
else
call health#report_ok('Found up-to-date neovim RubyGem')
endif
endif
call health#report_info('Ruby Version: ' . ruby_version)
call health#report_info('Host Executable: ' . ruby_prog)
call health#report_info('Host Version: ' . prog_vers)
endfunction
function! health#provider#check() abort
call s:check_python(2)
call s:check_python(3)
call s:check_ruby()
endfunction

View File

@ -1,149 +1,261 @@
let s:man_tag_depth = 0
let s:man_sect_arg = ''
let s:man_find_arg = '-w'
" Maintainer: Anmol Sethi <anmol@aubble.com>
if &shell =~# 'fish$'
let s:man_cmd = 'man ^/dev/null'
else
let s:man_cmd = 'man 2>/dev/null'
endif
let s:man_find_arg = "-w"
" TODO(nhooyr) Completion may work on SunOS; I'm not sure if `man -l` displays
" the list of searched directories.
try
if !has('win32') && $OSTYPE !~? 'cygwin\|linux' && system('uname -s') =~? 'SunOS' && system('uname -r') =~? '^5'
let s:man_sect_arg = '-s'
if !has('win32') && $OSTYPE !~? 'cygwin\|linux' && system('uname -s') =~? 'SunOS' && system('uname -r') =~# '^5'
let s:man_find_arg = '-l'
endif
catch /E145:/
" Ignore the error in restricted mode
endtry
function man#get_page(...) abort
let invoked_from_man = (&filetype ==# 'man')
if a:0 == 0
echoerr 'argument required'
function! man#open_page(count, count1, mods, ...) abort
if a:0 > 2
call s:error('too many arguments')
return
elseif a:0 > 2
echoerr 'too many arguments'
return
elseif a:0 == 2
let [page, sect] = [a:2, 0 + a:1]
elseif type(1) == type(a:1)
let [page, sect] = ['<cword>', a:1]
elseif a:0 == 0
let ref = &filetype ==# 'man' ? expand('<cWORD>') : expand('<cword>')
if empty(ref)
call s:error('no identifier under cursor')
return
endif
elseif a:0 ==# 1
let ref = a:1
else
let [page, sect] = [a:1, '']
" Combine the name and sect into a manpage reference so that all
" verification/extraction can be kept in a single function.
" If a:2 is a reference as well, that is fine because it is the only
" reference that will match.
let ref = a:2.'('.a:1.')'
endif
if page == '<cword>'
let page = expand('<cword>')
endif
let [page, sect] = s:parse_page_and_section(sect, page)
if 0 + sect > 0 && s:find_page(sect, page) == 0
let sect = ''
endif
if s:find_page(sect, page) == 0
echo 'No manual entry for '.page
return
endif
exec 'let s:man_tag_buf_'.s:man_tag_depth.' = '.bufnr('%')
exec 'let s:man_tag_lin_'.s:man_tag_depth.' = '.line('.')
exec 'let s:man_tag_col_'.s:man_tag_depth.' = '.col('.')
let s:man_tag_depth = s:man_tag_depth + 1
let editcmd = 'edit'
" Use an existing 'man' window, else open a new one.
if &filetype !=# 'man'
let thiswin = winnr()
wincmd b
if winnr() > 1
exe "norm! " . thiswin . "\<C-W>w"
while 1
if &filetype == 'man'
break
endif
wincmd w
if thiswin == winnr()
break
endif
endwhile
endif
if &filetype !=# 'man'
let editcmd = 'tabnew'
endif
endif
silent exec editcmd.' man://'.page.(empty(sect)?'':'('.sect.')')
setlocal modifiable
silent keepjumps norm! 1G"_dG
let $MANWIDTH = winwidth(0)
silent exec 'r!/usr/bin/man '.s:cmd(sect, page).' | col -b'
" Remove blank lines from top and bottom.
while getline(1) =~ '^\s*$'
silent keepjumps norm! gg"_dd
endwhile
while getline('$') =~ '^\s*$'
silent keepjumps norm! G"_dd
endwhile
setlocal nomodified
setlocal filetype=man
if invoked_from_man || editcmd ==# 'tabnew'
call s:set_window_local_options()
endif
endfunction
function s:set_window_local_options() abort
setlocal colorcolumn=0 foldcolumn=0 nonumber
setlocal nolist norelativenumber nofoldenable
endfunction
function man#pop_page() abort
if s:man_tag_depth > 0
let s:man_tag_depth = s:man_tag_depth - 1
exec "let s:man_tag_buf=s:man_tag_buf_".s:man_tag_depth
exec "let s:man_tag_lin=s:man_tag_lin_".s:man_tag_depth
exec "let s:man_tag_col=s:man_tag_col_".s:man_tag_depth
exec s:man_tag_buf."b"
exec s:man_tag_lin
exec "norm! ".s:man_tag_col."|"
exec "unlet s:man_tag_buf_".s:man_tag_depth
exec "unlet s:man_tag_lin_".s:man_tag_depth
exec "unlet s:man_tag_col_".s:man_tag_depth
unlet s:man_tag_buf s:man_tag_lin s:man_tag_col
endif
endfunction
" Expects a string like 'access' or 'access(2)'.
function s:parse_page_and_section(sect, str) abort
try
let save_isk = &iskeyword
setlocal iskeyword-=(,)
let page = substitute(a:str, '(*\(\k\+\).*', '\1', '')
let sect = substitute(a:str, '\(\k\+\)(\([^()]*\)).*', '\2', '')
if sect == page || -1 == match(sect, '^[0-9 ]\+$')
let sect = a:sect
let [sect, name] = man#extract_sect_and_name_ref(ref)
if a:count ==# a:count1
" v:count defaults to 0 which is a valid section, and v:count1 defaults to
" 1, also a valid section. If they are equal, count explicitly set.
let sect = string(a:count)
endif
let [sect, name, path] = s:verify_exists(sect, name)
catch
let &l:iskeyword = save_isk
echoerr 'man.vim: failed to parse: "'.a:str.'"'
call s:error(v:exception)
return
endtry
return [page, sect]
endfunction
function s:cmd(sect, page) abort
if 0 + a:sect > 0
return s:man_sect_arg.' '.a:sect.' '.a:page
call s:push_tag()
let bufname = 'man://'.name.(empty(sect)?'':'('.sect.')')
if a:mods !~# 'tab' && s:find_man()
noautocmd execute 'silent edit' bufname
else
noautocmd execute 'silent' a:mods 'split' bufname
endif
return a:page
let b:man_sect = sect
call s:read_page(path)
endfunction
function s:find_page(sect, page) abort
let where = system('/usr/bin/man '.s:man_find_arg.' '.s:cmd(a:sect, a:page))
if where !~ "^/"
if matchstr(where, " [^ ]*$") !~ "^ /"
function! man#read_page(ref) abort
try
let [sect, name] = man#extract_sect_and_name_ref(a:ref)
let [b:man_sect, name, path] = s:verify_exists(sect, name)
catch
" call to s:error() is unnecessary
return
endtry
call s:read_page(path)
endfunction
function! s:read_page(path) abort
setlocal modifiable
setlocal noreadonly
silent keepjumps %delete _
" Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db).
" http://comments.gmane.org/gmane.editors.vim.devel/29085
" Respect $MANWIDTH, or default to window width.
let cmd = 'env MANPAGER=cat'.(empty($MANWIDTH) ? ' MANWIDTH='.winwidth(0) : '')
let cmd .= ' '.s:man_cmd.' '.shellescape(a:path)
silent put =system(cmd)
" remove all the backspaced text
execute 'silent keeppatterns keepjumps %substitute,.\b,,e'.(&gdefault?'':'g')
while getline(1) =~# '^\s*$'
silent keepjumps 1delete _
endwhile
setlocal filetype=man
endfunction
" attempt to extract the name and sect out of 'name(sect)'
" otherwise just return the largest string of valid characters in ref
function! man#extract_sect_and_name_ref(ref) abort
if a:ref[0] ==# '-' " try ':Man -pandoc' with this disabled.
throw 'manpage name cannot start with ''-'''
endif
let ref = matchstr(a:ref, '[^()]\+([^()]\+)')
if empty(ref)
let name = matchstr(a:ref, '[^()]\+')
if empty(name)
throw 'manpage reference cannot contain only parentheses'
endif
return [get(b:, 'man_default_sects', ''), name]
endif
let left = split(ref, '(')
" see ':Man 3X curses' on why tolower.
" TODO(nhooyr) Not sure if this is portable across OSs
" but I have not seen a single uppercase section.
return [tolower(split(left[1], ')')[0]), left[0]]
endfunction
function! s:get_path(sect, name) abort
if empty(a:sect)
let path = system(s:man_cmd.' '.s:man_find_arg.' '.shellescape(a:name))
if path !~# '^\/'
throw 'no manual entry for '.a:name
endif
return path
endif
" '-s' flag handles:
" - tokens like 'printf(echo)'
" - sections starting with '-'
" - 3pcap section (found on macOS)
" - commas between sections (for section priority)
return system(s:man_cmd.' '.s:man_find_arg.' -s '.shellescape(a:sect).' '.shellescape(a:name))
endfunction
function! s:verify_exists(sect, name) abort
let path = s:get_path(a:sect, a:name)
if path !~# '^\/'
let path = s:get_path(get(b:, 'man_default_sects', ''), a:name)
if path !~# '^\/'
let path = s:get_path('', a:name)
endif
endif
" We need to extract the section from the path because sometimes
" the actual section of the manpage is more specific than the section
" we provided to `man`. Try ':Man 3 App::CLI'.
" Also on linux, it seems that the name is case insensitive. So if one does
" ':Man PRIntf', we still want the name of the buffer to be 'printf' or
" whatever the correct capitilization is.
let path = path[:len(path)-2]
return s:extract_sect_and_name_path(path) + [path]
endfunction
let s:tag_stack = []
function! s:push_tag() abort
let s:tag_stack += [{
\ 'buf': bufnr('%'),
\ 'lnum': line('.'),
\ 'col': col('.'),
\ }]
endfunction
function! man#pop_tag() abort
if !empty(s:tag_stack)
let tag = remove(s:tag_stack, -1)
silent execute tag['buf'].'buffer'
call cursor(tag['lnum'], tag['col'])
endif
endfunction
" extracts the name and sect out of 'path/name.sect'
function! s:extract_sect_and_name_path(path) abort
let tail = fnamemodify(a:path, ':t')
if a:path =~# '\.\%([glx]z\|bz2\|lzma\|Z\)$' " valid extensions
let tail = fnamemodify(tail, ':r')
endif
let sect = matchstr(tail, '\.\zs[^.]\+$')
let name = matchstr(tail, '^.\+\ze\.')
return [sect, name]
endfunction
function! s:find_man() abort
if &filetype ==# 'man'
return 1
elseif winnr('$') ==# 1
return 0
endif
let thiswin = winnr()
while 1
wincmd w
if &filetype ==# 'man'
return 1
elseif thiswin ==# winnr()
return 0
endif
endif
return 1
endwhile
endfunction
function! s:error(msg) abort
redraw
echohl ErrorMsg
echon 'man.vim: ' a:msg
echohl None
endfunction
let s:mandirs = join(split(system(s:man_cmd.' '.s:man_find_arg), ':\|\n'), ',')
" see man#extract_sect_and_name_ref on why tolower(sect)
function! man#complete(arg_lead, cmd_line, cursor_pos) abort
let args = split(a:cmd_line)
let l = len(args)
if l > 3
return
elseif l ==# 1
let name = ''
let sect = ''
elseif a:arg_lead =~# '^[^()]\+([^()]*$'
" cursor (|) is at ':Man printf(|' or ':Man 1 printf(|'
" The later is is allowed because of ':Man pri<TAB>'.
" It will offer 'priclass.d(1m)' even though section is specified as 1.
let tmp = split(a:arg_lead, '(')
let name = tmp[0]
let sect = tolower(get(tmp, 1, ''))
elseif args[1] !~# '^[^()]\+$'
" cursor (|) is at ':Man 3() |' or ':Man (3|' or ':Man 3() pri|'
" or ':Man 3() pri |'
return
elseif l ==# 2
if empty(a:arg_lead)
" cursor (|) is at ':Man 1 |'
let name = ''
let sect = tolower(args[1])
else
" cursor (|) is at ':Man pri|'
if a:arg_lead =~# '\/'
" if the name is a path, complete files
" TODO(nhooyr) why does this complete the last one automatically
return glob(a:arg_lead.'*', 0, 1)
endif
let name = a:arg_lead
let sect = ''
endif
elseif a:arg_lead !~# '^[^()]\+$'
" cursor (|) is at ':Man 3 printf |' or ':Man 3 (pr)i|'
return
else
" cursor (|) is at ':Man 3 pri|'
let name = a:arg_lead
let sect = tolower(args[1])
endif
" We remove duplicates incase the same manpage in different languages was found.
return uniq(sort(map(globpath(s:mandirs,'man?/'.name.'*.'.sect.'*', 0, 1), 's:format_candidate(v:val, sect)'), 'i'))
endfunction
function! s:format_candidate(path, sect) abort
if a:path =~# '\.\%(pdf\|in\)$' " invalid extensions
return
endif
let [sect, name] = s:extract_sect_and_name_path(a:path)
if sect ==# a:sect
return name
elseif sect =~# a:sect.'.\+$'
" We include the section if the user provided section is a prefix
" of the actual section.
return name.'('.sect.')'
endif
endfunction

View File

@ -356,6 +356,8 @@ let s:MSGPACK_STANDARD_TYPES = {
\type(''): 'binary',
\type([]): 'array',
\type({}): 'map',
\type(v:true): 'boolean',
\type(v:null): 'nil',
\}
""
@ -379,7 +381,7 @@ endfunction
""
" Dump boolean value.
function s:msgpack_dump_boolean(v) abort
return a:v._VAL ? 'TRUE' : 'FALSE'
return (a:v is v:true || (a:v isnot v:false && a:v._VAL)) ? 'TRUE' : 'FALSE'
endfunction
""
@ -395,7 +397,8 @@ endfunction
""
" Dump floating-point value.
function s:msgpack_dump_float(v) abort
return string(type(a:v) == type({}) ? a:v._VAL : a:v)
return substitute(string(type(a:v) == type({}) ? a:v._VAL : a:v),
\'\V\^\(-\)\?str2float(''\(inf\|nan\)'')\$', '\1\2', '')
endfunction
""

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
" Maintainer: Dávid Szabó ( complex857 AT gmail DOT com )
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" URL: https://github.com/shawncplus/phpcomplete.vim
" Last Change: 2014 Dec 01
" Last Change: 2015 Jul 13
"
" OPTIONS:
"
@ -141,71 +141,80 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
if a:base != ""
let context = substitute(context, '\s*[$a-zA-Z_0-9\x7f-\xff]*$', '', '')
end
else
let context = ''
end
let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(getline(0, line('.')))
try
let winheight = winheight(0)
let winnr = winnr()
if context =~? '^use\s'
return phpcomplete#CompleteUse(a:base)
endif
let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(getline(0, line('.')))
if context =~ '\(->\|::\)$'
" {{{
" Get name of the class
let classname = phpcomplete#GetClassName(line('.'), context, current_namespace, imports)
if context =~? '^use\s' || context ==? 'use'
return phpcomplete#CompleteUse(a:base)
endif
" Get location of class definition, we have to iterate through all
if classname != ''
if classname =~ '\'
" split the last \ segment as a classname, everything else is the namespace
let classname_parts = split(classname, '\')
let namespace = join(classname_parts[0:-2], '\')
let classname = classname_parts[-1]
if context =~ '\(->\|::\)$'
" {{{
" Get name of the class
let classname = phpcomplete#GetClassName(line('.'), context, current_namespace, imports)
" Get location of class definition, we have to iterate through all
if classname != ''
if classname =~ '\'
" split the last \ segment as a classname, everything else is the namespace
let classname_parts = split(classname, '\')
let namespace = join(classname_parts[0:-2], '\')
let classname = classname_parts[-1]
else
let namespace = '\'
endif
let classlocation = phpcomplete#GetClassLocation(classname, namespace)
else
let namespace = '\'
let classlocation = ''
endif
let classlocation = phpcomplete#GetClassLocation(classname, namespace)
if classlocation != ''
if classlocation == 'VIMPHP_BUILTINOBJECT' && has_key(g:php_builtin_classes, tolower(classname))
return phpcomplete#CompleteBuiltInClass(context, classname, a:base)
endif
if filereadable(classlocation)
let classfile = readfile(classlocation)
let classcontent = ''
let classcontent .= "\n".phpcomplete#GetClassContents(classlocation, classname)
let sccontent = split(classcontent, "\n")
let visibility = expand('%:p') == fnamemodify(classlocation, ':p') ? 'private' : 'public'
return phpcomplete#CompleteUserClass(context, a:base, sccontent, visibility)
endif
endif
return phpcomplete#CompleteUnknownClass(a:base, context)
" }}}
elseif context =~? 'implements'
return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports)
elseif context =~? 'extends\s\+.\+$' && a:base == ''
return ['implements']
elseif context =~? 'extends'
let kinds = context =~? 'class\s' ? ['c'] : ['i']
return phpcomplete#CompleteClassName(a:base, kinds, current_namespace, imports)
elseif context =~? 'class [a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*'
" special case when you've typed the class keyword and the name too, only extends and implements allowed there
return filter(['extends', 'implements'], 'stridx(v:val, a:base) == 0')
elseif context =~? 'new'
return phpcomplete#CompleteClassName(a:base, ['c'], current_namespace, imports)
endif
if a:base =~ '^\$'
return phpcomplete#CompleteVariable(a:base)
else
let classlocation = ''
return phpcomplete#CompleteGeneral(a:base, current_namespace, imports)
endif
if classlocation != ''
if classlocation == 'VIMPHP_BUILTINOBJECT' && has_key(g:php_builtin_classes, tolower(classname))
return phpcomplete#CompleteBuiltInClass(context, classname, a:base)
endif
if filereadable(classlocation)
let classfile = readfile(classlocation)
let classcontent = ''
let classcontent .= "\n".phpcomplete#GetClassContents(classlocation, classname)
let sccontent = split(classcontent, "\n")
let visibility = expand('%:p') == fnamemodify(classlocation, ':p') ? 'private' : 'public'
return phpcomplete#CompleteUserClass(context, a:base, sccontent, visibility)
endif
endif
return phpcomplete#CompleteUnknownClass(a:base, context)
" }}}
elseif context =~? 'implements'
return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports)
elseif context =~? 'extends\s\+.\+$'
return ['implements']
elseif context =~? 'extends'
let kinds = context =~? 'class\s' ? ['c'] : ['i']
return phpcomplete#CompleteClassName(a:base, kinds, current_namespace, imports)
elseif context =~? 'class [a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*'
" special case when you've typed the class keyword and the name too, only extends and implements allowed there
return filter(['extends', 'implements'], 'stridx(v:val, a:base) == 0')
elseif context =~? 'new'
return phpcomplete#CompleteClassName(a:base, ['c'], current_namespace, imports)
endif
if a:base =~ '^\$'
return phpcomplete#CompleteVariable(a:base)
else
return phpcomplete#CompleteGeneral(a:base, current_namespace, imports)
endif
finally
silent! exec winnr.'resize '.winheight
endtry
endfunction
" }}}
@ -244,12 +253,13 @@ function! phpcomplete#CompleteUse(base) " {{{
if has_key(tag, 'namespace')
let patched_ctags_detected = 1
endif
if tag.kind ==? 'n' && tag.name =~? '^'.namespace_match_pattern
let patched_ctags_detected = 1
call add(namespaced_matches, {'word': tag.name, 'kind': 'n', 'menu': tag.filename, 'info': tag.filename })
elseif has_key(tag, 'namespace') && (tag.kind ==? 'c' || tag.kind ==? 'i') && tag.namespace ==? namespace_for_class
elseif has_key(tag, 'namespace') && (tag.kind ==? 'c' || tag.kind ==? 'i' || tag.kind ==? 't') && tag.namespace ==? namespace_for_class
call add(namespaced_matches, {'word': namespace_for_class.'\'.tag.name, 'kind': tag.kind, 'menu': tag.filename, 'info': tag.filename })
elseif (tag.kind ==? 'c' || tag.kind ==? 'i')
elseif (tag.kind ==? 'c' || tag.kind ==? 'i' || tag.kind ==? 't')
call add(no_namespace_matches, {'word': namespace_for_class.'\'.tag.name, 'kind': tag.kind, 'menu': tag.filename, 'info': tag.filename })
endif
endfor
@ -272,6 +282,10 @@ function! phpcomplete#CompleteUse(base) " {{{
endfor
endif
for comp in res
let comp.word = substitute(comp.word, '^\\', '', '')
endfor
return res
endfunction
" }}}
@ -304,7 +318,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
\ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
if f_name =~? '^'.substitute(a:base, '\\', '\\\\', 'g')
let f_args = matchstr(i,
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\({\|$\)')
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|$\)')
let int_functions[f_name.'('] = f_args.')'
endif
endfor
@ -326,6 +340,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
let ext_functions = {}
let ext_constants = {}
let ext_classes = {}
let ext_traits = {}
let ext_interfaces = {}
let ext_namespaces = {}
@ -420,7 +435,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
endif
endif
endif
elseif tag.kind ==? 'c' || tag.kind ==? 'i'
elseif tag.kind ==? 'c' || tag.kind ==? 'i' || tag.kind ==? 't'
let info = ' - '.tag.filename
let key = ''
@ -441,6 +456,8 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
let ext_classes[key] = info
elseif tag.kind ==? 'i'
let ext_interfaces[key] = info
elseif tag.kind ==? 't'
let ext_traits[key] = info
endif
endif
endif
@ -463,7 +480,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
endfor
for [interfacename, info] in items(g:php_builtin_interfacenames)
if interfacename =~? '^'.base
let builtin_interfaces[leading_slash.interfacename] = info
let builtin_interfaces[leading_slash.g:php_builtin_interfaces[tolower(interfacename)].name] = info
endif
endfor
endif
@ -511,6 +528,8 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
else
let ext_interfaces[imported_name] = ' '.import.name.' - '.import.filename
endif
elseif import.kind ==? 't'
let ext_traits[imported_name] = ' '.import.name.' - '.import.filename
endif
" no builtin interfaces
@ -540,6 +559,9 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
" Add external interfaces
call extend(all_values, ext_interfaces)
" Add external traits
call extend(all_values, ext_traits)
" Add built-in classes
call extend(all_values, builtin_classnames)
@ -566,6 +588,8 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
elseif has_key(ext_interfaces, i) || has_key(builtin_interfaces, i)
let info = has_key(ext_interfaces, i) ? ext_interfaces[i] : builtin_interfaces[i].' - builtin'
let final_list += [{'word':i, 'kind': 'i', 'menu': info, 'info': i.info}]
elseif has_key(ext_traits, i)
let final_list += [{'word':i, 'kind': 't', 'menu': ext_traits[i], 'info': ext_traits[i]}]
elseif has_key(int_constants, i) || has_key(builtin_constants, i)
let info = has_key(int_constants, i) ? int_constants[i] : ' - builtin'
let final_list += [{'word':i, 'kind': 'd', 'menu': info, 'info': i.info}]
@ -622,7 +646,7 @@ function! phpcomplete#CompleteUnknownClass(base, context) " {{{
let f_name = matchstr(i,
\ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
let f_args = matchstr(i,
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\({\|$\)')
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|$\)')
let int_functions[f_name.'('] = f_args.')'
endfor
@ -784,7 +808,7 @@ function! phpcomplete#CompleteClassName(base, kinds, current_namespace, imports)
let tags = []
if len(tag_match_pattern) >= g:phpcomplete_min_num_of_chars_for_namespace_completion
let tags = phpcomplete#GetTaglist('^'.tag_match_pattern)
let tags = phpcomplete#GetTaglist('^\c'.tag_match_pattern)
endif
if len(tags)
@ -861,6 +885,39 @@ function! phpcomplete#CompareCompletionRow(i1, i2) " {{{
endfunction
" }}}
function! s:getNextCharWithPos(filelines, current_pos) " {{{
let line_no = a:current_pos[0]
let col_no = a:current_pos[1]
let last_line = a:filelines[len(a:filelines) - 1]
let end_pos = [len(a:filelines) - 1, strlen(last_line) - 1]
if line_no > end_pos[0] || line_no == end_pos[0] && col_no > end_pos[1]
return ['EOF', 'EOF']
endif
" we've not reached the end of the current line break
if col_no + 1 < strlen(a:filelines[line_no])
let col_no += 1
else
" we've reached the end of the current line, jump to the next
" non-blank line (blank lines have no position where we can read from,
" not even a whitespace. The newline char does not positionable by vim
let line_no += 1
while strlen(a:filelines[line_no]) == 0
let line_no += 1
endwhile
let col_no = 0
endif
" return 'EOF' string to signal end of file, normal results only one char
" in length
if line_no == end_pos[0] && col_no > end_pos[1]
return ['EOF', 'EOF']
endif
return [[line_no, col_no], a:filelines[line_no][col_no]]
endfunction " }}}
function! phpcomplete#EvaluateModifiers(modifiers, required_modifiers, prohibited_modifiers) " {{{
" if theres no modifier, and no modifier is allowed and no modifier is required
if len(a:modifiers) == 0 && len(a:required_modifiers) == 0
@ -924,7 +981,7 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) "
let f_name = matchstr(i,
\ 'function\s*&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
let f_args = matchstr(i,
\ 'function\s*&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\({\|\_$\)')
\ 'function\s*&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|\_$\)')
if f_name != '' && stridx(f_name, '__') != 0
let c_functions[f_name.'('] = f_args
if g:phpcomplete_parse_docblock_comments
@ -1322,8 +1379,8 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
" Get Structured information of all classes and subclasses including namespace and includes
" try to find the method's return type in docblock comment
for classstructure in classcontents
let doclock_target_pattern = 'function\s\+&\?'.method.'\|\(public\|private\|protected\|var\).\+\$'.method
let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), doclock_target_pattern)
let docblock_target_pattern = 'function\s\+&\?'.method.'\|\(public\|private\|protected\|var\).\+\$'.method
let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), docblock_target_pattern)
if doc_str != ''
break
endif
@ -1475,21 +1532,19 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
return ''
endif
if line =~? '\v^\s*(abstract\s+|final\s+)*\s*class'
let class_name = matchstr(line, '\c\s*class\s*\zs'.class_name_pattern.'\ze')
if line =~? '\v^\s*(abstract\s+|final\s+)*\s*class\s'
let class_name = matchstr(line, '\cclass\s\+\zs'.class_name_pattern.'\ze')
let extended_class = matchstr(line, '\cclass\s\+'.class_name_pattern.'\s\+extends\s\+\zs'.class_name_pattern.'\ze')
let classname_candidate = a:context =~? 'parent::' ? extended_class : class_name
else
let i += 1
continue
if classname_candidate != ''
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, class_candidate_imports, methodstack)
" return absolute classname, without leading \
return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
endif
endif
if classname_candidate != ''
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, class_candidate_imports, methodstack)
" return absolute classname, without leading \
return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
endif
let i += 1
endwhile
elseif a:context =~? '(\s*new\s\+'.class_name_pattern.'\s*)->'
let classname_candidate = matchstr(a:context, '\cnew\s\+\zs'.class_name_pattern.'\ze')
@ -1602,26 +1657,26 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
endif
endif
" in-file lookup for typehinted function arguments
" - the function can have a name or be anonymous (e.g., function qux() { ... } vs. function () { ... })
" - the type-hinted argument can be anywhere in the arguments list.
if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.class_name_pattern.'\s\+'.object && !object_is_array
let f_args = matchstr(line, '\cfunction\(\s\+'.function_name_pattern.'\)\?\s*(\zs.\{-}\ze)')
let args = split(f_args, '\s*\zs,\ze\s*')
for arg in args
if arg =~# object.'\(,\|$\)'
let classname_candidate = matchstr(arg, '\s*\zs'.class_name_pattern.'\ze\s\+'.object)
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
" function declaration line
if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*('
let function_lines = join(reverse(copy(lines)), " ")
" search for type hinted arguments
if function_lines =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.class_name_pattern.'\s\+'.object && !object_is_array
let f_args = matchstr(function_lines, '\cfunction\(\s\+'.function_name_pattern.'\)\?\s*(\zs.\{-}\ze)')
let args = split(f_args, '\s*\zs,\ze\s*')
for arg in args
if arg =~# object.'\(,\|$\)'
let classname_candidate = matchstr(arg, '\s*\zs'.class_name_pattern.'\ze\s\+'.object)
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
break
endif
endfor
if classname_candidate != ''
break
endif
endfor
if classname_candidate != ''
break
endif
endif
" if we see a function declaration, try loading the docblock for it and look for matching @params
if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.object
" search for docblock for the function
let match_line = substitute(line, '\\', '\\\\', 'g')
let sccontent = getline(0, a:start_line - i)
let doc_str = phpcomplete#GetDocBlock(sccontent, match_line)
@ -1641,13 +1696,16 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
endif
" assignment for the variable in question with a variable on the right hand side
if line =~# '^\s*'.object.'\s*=&\?\s*'.variable_name_pattern
if line =~# '^\s*'.object.'\s*=&\?\s\+\(clone\)\?\s*'.variable_name_pattern
" try to find the next non-comment or string ";" char
let start_col = match(line, '^\s*'.object.'\C\s*=\zs&\?\s*'.variable_name_pattern)
let filelines = reverse(lines)
let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col])
let start_col = match(line, '^\s*'.object.'\C\s*=\zs&\?\s\+\(clone\)\?\s*'.variable_name_pattern)
let filelines = reverse(copy(lines))
let [pos, char] = s:getNextCharWithPos(filelines, [len(filelines) - i, start_col])
let chars_read = 1
let last_pos = pos
" function_boundary == 0 if we are not in a function
let real_lines_offset = len(function_boundary) == 1 ? 1 : function_boundary[0][0]
" read while end of the file
while char != 'EOF' && chars_read < 1000
let last_pos = pos
@ -1655,7 +1713,11 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
let chars_read += 1
" we got a candidate
if char == ';'
let synIDName = synIDattr(synID(pos[0] + 1, pos[1] + 1, 0), 'name')
" pos values is relative to the function's lines,
" line 0 need to be offsetted with the line number
" where te function was started to get the line number
" in real buffer terms
let synIDName = synIDattr(synID(real_lines_offset + pos[0], pos[1] + 1, 0), 'name')
" it's not a comment or string, end search
if synIDName !~? 'comment\|string'
break
@ -1663,7 +1725,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
endif
endwhile
let prev_context = phpcomplete#GetCurrentInstruction(last_pos[0] + 1, last_pos[1], b:phpbegin)
let prev_context = phpcomplete#GetCurrentInstruction(real_lines_offset + last_pos[0], last_pos[1], b:phpbegin)
if prev_context == ''
" cannot get previous context give up
return
@ -1683,12 +1745,14 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
" assignment for the variable in question with a function on the right hand side
if line =~# '^\s*'.object.'\s*=&\?\s*'.function_invocation_pattern
" try to find the next non-comment or string ";" char
let start_col = match(line, '\C^\s*'.object.'\s*=\zs&\?\s*'.function_invocation_pattern)
let filelines = reverse(lines)
let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col])
let filelines = reverse(copy(lines))
let [pos, char] = s:getNextCharWithPos(filelines, [len(filelines) - i, start_col])
let chars_read = 1
let last_pos = pos
" function_boundary == 0 if we are not in a function
let real_lines_offset = len(function_boundary) == 1 ? 1 : function_boundary[0][0]
" read while end of the file
while char != 'EOF' && chars_read < 1000
let last_pos = pos
@ -1696,7 +1760,11 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
let chars_read += 1
" we got a candidate
if char == ';'
let synIDName = synIDattr(synID(pos[0] + 1, pos[1] + 1, 0), 'name')
" pos values is relative to the function's lines,
" line 0 need to be offsetted with the line number
" where te function was started to get the line number
" in real buffer terms
let synIDName = synIDattr(synID(real_lines_offset + pos[0], pos[1] + 1, 0), 'name')
" it's not a comment or string, end search
if synIDName !~? 'comment\|string'
break
@ -1704,7 +1772,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
endif
endwhile
let prev_context = phpcomplete#GetCurrentInstruction(last_pos[0] + 1, last_pos[1], b:phpbegin)
let prev_context = phpcomplete#GetCurrentInstruction(real_lines_offset + last_pos[0], last_pos[1], b:phpbegin)
if prev_context == ''
" cannot get previous context give up
return
@ -1807,6 +1875,9 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{
if has_key(g:php_builtin_classes, tolower(a:classname)) && (a:namespace == '' || a:namespace == '\')
return 'VIMPHP_BUILTINOBJECT'
endif
if has_key(g:php_builtin_interfaces, tolower(a:classname)) && (a:namespace == '' || a:namespace == '\')
return 'VIMPHP_BUILTINOBJECT'
endif
if a:namespace == '' || a:namespace == '\'
let search_namespace = '\'
@ -1819,7 +1890,7 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{
let i = 1
while i < line('.')
let line = getline(line('.')-i)
if line =~? '^\s*\(abstract\s\+\|final\s\+\)*\s*class\s*'.a:classname.'\(\s\+\|$\)' && tolower(current_namespace) == search_namespace
if line =~? '^\s*\(abstract\s\+\|final\s\+\)*\s*\(class\|interface\|trait\)\s*'.a:classname.'\(\s\+\|$\|{\)' && tolower(current_namespace) == search_namespace
return expand('%:p')
else
let i += 1
@ -1831,7 +1902,9 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{
let no_namespace_candidate = ''
let tags = phpcomplete#GetTaglist('^'.a:classname.'$')
for tag in tags
if tag.kind == 'c' || tag.kind == 'i'
" We'll allow interfaces and traits to be handled classes since you
" can't have colliding names with different kinds anyway
if tag.kind == 'c' || tag.kind == 'i' || tag.kind == 't'
if !has_key(tag, 'namespace')
let no_namespace_candidate = tag.filename
else
@ -1981,7 +2054,7 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
silent! below 1new
silent! 0put =cfile
call search('\(class\|interface\)\_s\+'.a:class_name.'\(\>\|$\)')
call search('\c\(class\|interface\|trait\)\_s\+'.a:class_name.'\(\>\|$\)')
let cfline = line('.')
call search('{')
let endline = line('.')
@ -1989,13 +2062,62 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
let content = join(getline(cfline, endline), "\n")
" Catch extends
if content =~? 'extends'
let extends_class = matchstr(content, 'class\_s\+'.a:class_name.'\_s\+extends\_s\+\zs'.class_name_pattern.'\ze')
let extends_string = matchstr(content, '\(class\|interface\)\_s\+'.a:class_name.'\_.\+extends\_s\+\zs\('.class_name_pattern.'\(,\|\_s\)*\)\+\ze\(extends\|{\)')
let extended_classes = map(split(extends_string, '\(,\|\_s\)\+'), 'substitute(v:val, "\\_s\\+", "", "g")')
else
let extends_class = ''
let extended_classes = ''
endif
" Catch implements
if content =~? 'implements'
let implements_string = matchstr(content, 'class\_s\+'.a:class_name.'\_.\+implements\_s\+\zs\('.class_name_pattern.'\(,\|\_s\)*\)\+\ze')
let implemented_interfaces = map(split(implements_string, '\(,\|\_s\)\+'), 'substitute(v:val, "\\_s\\+", "", "g")')
else
let implemented_interfaces = []
endif
call searchpair('{', '', '}', 'W')
let classcontent = join(getline(cfline, line('.')), "\n")
let class_closing_bracket_line = line('.')
let classcontent = join(getline(cfline, class_closing_bracket_line), "\n")
let used_traits = []
" move back to the line next to the class's definition
call cursor(endline + 1, 1)
let keep_searching = 1
while keep_searching != 0
" try to grab "use..." keywords
let [lnum, col] = searchpos('\c^\s\+use\s\+'.class_name_pattern, 'cW', class_closing_bracket_line)
let syn_name = synIDattr(synID(lnum, col, 0), "name")
if syn_name =~? 'string\|comment'
call cursor(lnum + 1, 1)
continue
endif
let trait_line = getline(lnum)
if trait_line !~? ';'
" try to find the next line containing ';'
let l = lnum
let search_line = trait_line
" add lines from the file until theres no ';' in them
while search_line !~? ';' && l > 0
" file lines are reversed so we need to go backwards
let l += 1
let search_line = getline(l)
let trait_line .= ' '.substitute(search_line, '\(^\s\+\|\s\+$\)', '', 'g')
endwhile
endif
let use_expression = matchstr(trait_line, '^\s*use\s\+\zs.\{-}\ze;')
let use_parts = map(split(use_expression, '\s*,\s*'), 'substitute(v:val, "\\s+", " ", "g")')
let used_traits += map(use_parts, 'substitute(v:val, "\\s", "", "g")')
call cursor(lnum + 1, 1)
if [lnum, col] == [0, 0]
let keep_searching = 0
endif
endwhile
silent! bw! %
let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(a:file_lines[0:cfline])
" go back to original window
exe phpcomplete_original_window.'wincmd w'
@ -2008,21 +2130,35 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
\ 'mtime': getftime(full_file_path),
\ })
if extends_class != ''
let [extends_class, namespace] = phpcomplete#ExpandClassName(extends_class, current_namespace, imports)
if namespace == ''
let namespace = '\'
endif
let classlocation = phpcomplete#GetClassLocation(extends_class, namespace)
if classlocation == "VIMPHP_BUILTINOBJECT"
let result += [phpcomplete#GenerateBuiltinClassStub(g:php_builtin_classes[tolower(extends_class)])]
elseif classlocation != '' && filereadable(classlocation)
let full_file_path = fnamemodify(classlocation, ':p')
let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), extends_class)
elseif tolower(current_namespace) == tolower(namespace)
" try to find the declaration in the same file.
let result += phpcomplete#GetClassContentsStructure(full_file_path, a:file_lines, extends_class)
endif
let all_extends = used_traits
if len(extended_classes) > 0
call extend(all_extends, extended_classes)
endif
if len(implemented_interfaces) > 0
call extend(all_extends, implemented_interfaces)
endif
if len(all_extends) > 0
for class in all_extends
let [class, namespace] = phpcomplete#ExpandClassName(class, current_namespace, imports)
if namespace == ''
let namespace = '\'
endif
let classlocation = phpcomplete#GetClassLocation(class, namespace)
if classlocation == "VIMPHP_BUILTINOBJECT"
if has_key(g:php_builtin_classes, tolower(class))
let result += [phpcomplete#GenerateBuiltinClassStub('class', g:php_builtin_classes[tolower(class)])]
endif
if has_key(g:php_builtin_interfaces, tolower(class))
let result += [phpcomplete#GenerateBuiltinClassStub('interface', g:php_builtin_interfaces[tolower(class)])]
endif
elseif classlocation != '' && filereadable(classlocation)
let full_file_path = fnamemodify(classlocation, ':p')
let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), class)
elseif tolower(current_namespace) == tolower(namespace) && match(join(a:file_lines, "\n"), '\c\(class\|interface\|trait\)\_s\+'.class.'\(\>\|$\)') != -1
" try to find the declaration in the same file.
let result += phpcomplete#GetClassContentsStructure(full_file_path, a:file_lines, class)
endif
endfor
endif
return result
@ -2039,43 +2175,53 @@ function! phpcomplete#GetClassContents(classlocation, class_name) " {{{
endfunction
" }}}
function! phpcomplete#GenerateBuiltinClassStub(class_info) " {{{
let re = 'class '.a:class_info['name']." {"
for [name, initializer] in items(a:class_info.constants)
let re .= "\n\tconst ".name." = ".initializer.";"
endfor
for [name, info] in items(a:class_info.properties)
let re .= "\n\t// @var $".name." ".info.type
let re .= "\n\tpublic $".name.";"
endfor
for [name, info] in items(a:class_info.static_properties)
let re .= "\n\t// @var ".name." ".info.type
let re .= "\n\tpublic static ".name." = ".info.initializer.";"
endfor
for [name, info] in items(a:class_info.methods)
if name =~ '^__'
continue
endif
let re .= "\n\t/**"
let re .= "\n\t * ".name
let re .= "\n\t *"
let re .= "\n\t * @return ".info.return_type
let re .= "\n\t */"
let re .= "\n\tpublic function ".name."(".info.signature."){"
let re .= "\n\t}"
endfor
for [name, info] in items(a:class_info.static_methods)
let re .= "\n\t/**"
let re .= "\n\t * ".name
let re .= "\n\t *"
let re .= "\n\t * @return ".info.return_type
let re .= "\n\t */"
let re .= "\n\tpublic static function ".name."(".info.signature."){"
let re .= "\n\t}"
endfor
function! phpcomplete#GenerateBuiltinClassStub(type, class_info) " {{{
let re = a:type.' '.a:class_info['name']." {"
if has_key(a:class_info, 'constants')
for [name, initializer] in items(a:class_info.constants)
let re .= "\n\tconst ".name." = ".initializer.";"
endfor
endif
if has_key(a:class_info, 'properties')
for [name, info] in items(a:class_info.properties)
let re .= "\n\t// @var $".name." ".info.type
let re .= "\n\tpublic $".name.";"
endfor
endif
if has_key(a:class_info, 'static_properties')
for [name, info] in items(a:class_info.static_properties)
let re .= "\n\t// @var ".name." ".info.type
let re .= "\n\tpublic static ".name." = ".info.initializer.";"
endfor
endif
if has_key(a:class_info, 'methods')
for [name, info] in items(a:class_info.methods)
if name =~ '^__'
continue
endif
let re .= "\n\t/**"
let re .= "\n\t * ".name
let re .= "\n\t *"
let re .= "\n\t * @return ".info.return_type
let re .= "\n\t */"
let re .= "\n\tpublic function ".name."(".info.signature."){"
let re .= "\n\t}"
endfor
endif
if has_key(a:class_info, 'static_methods')
for [name, info] in items(a:class_info.static_methods)
let re .= "\n\t/**"
let re .= "\n\t * ".name
let re .= "\n\t *"
let re .= "\n\t * @return ".info.return_type
let re .= "\n\t */"
let re .= "\n\tpublic static function ".name."(".info.signature."){"
let re .= "\n\t}"
endfor
endif
let re .= "\n}"
return { 'class': a:class_info['name'],
return { a:type : a:class_info['name'],
\ 'content': re,
\ 'namespace': '',
\ 'imports': {},
@ -2099,8 +2245,11 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{
" start backward serch for the comment block
while l != 0
let line = a:sccontent[l]
" if comment end found save line position and end search
if line =~? '^\s*\*/'
" if it's a one line docblock like comment and we can just return it right away
if line =~? '^\s*\/\*\*.\+\*\/\s*$'
return substitute(line, '\v^\s*(\/\*\*\s*)|(\s*\*\/)\s*$', '', 'g')
"... or if comment end found save line position and end search
elseif line =~? '^\s*\*/'
let comment_end = l
break
" ... or the line doesn't blank (only whitespace or nothing) end search
@ -2122,6 +2271,7 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{
endif
let l -= 1
endwhile
" no docblock comment start found
if comment_start == -1
return ''
@ -2270,19 +2420,48 @@ endfunction!
" }}}
function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
let original_window = winnr()
silent! below 1new
silent! 0put =a:file_lines
normal! G
" clear out classes, functions and other blocks
while 1
let block_start_pos = searchpos('\c\(class\|trait\|function\|interface\)\s\+\_.\{-}\zs{', 'Web')
if block_start_pos == [0, 0]
break
endif
let block_end_pos = searchpairpos('{', '', '}\|\%$', 'W', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
if block_end_pos != [0, 0]
" end of the block found, just delete it
silent! exec block_start_pos[0].','.block_end_pos[0].'d _'
else
" block pair not found, use block start as beginning and the end
" of the buffer instead
silent! exec block_start_pos[0].',$d _'
endif
endwhile
normal! G
" grab the remains
let file_lines = reverse(getline(1, line('.') - 1))
silent! bw! %
exe original_window.'wincmd w'
let namespace_name_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*'
let file_lines = reverse(copy(a:file_lines))
let i = 0
let file_length = len(file_lines)
let imports = {}
let current_namespace = '\'
while i < file_length
let line = file_lines[i]
if line =~? '^\s*namespace\s*'.namespace_name_pattern
let current_namespace = matchstr(line, '^\s*namespace\s*\zs'.namespace_name_pattern.'\ze')
if line =~? '^\(<?php\)\?\s*namespace\s*'.namespace_name_pattern
let current_namespace = matchstr(line, '\c^\(<?php\)\?\s*namespace\s*\zs'.namespace_name_pattern.'\ze')
break
endif
@ -2303,11 +2482,11 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
let use_line .= ' '.substitute(search_line, '\(^\s\+\|\s\+$\)', '', 'g')
endwhile
endif
let use_expression = matchstr(use_line, '^\s*use\s\+\zs.\{-}\ze;')
let use_expression = matchstr(use_line, '^\c\s*use\s\+\zs.\{-}\ze;')
let use_parts = map(split(use_expression, '\s*,\s*'), 'substitute(v:val, "\\s+", " ", "g")')
for part in use_parts
if part =~? '\s\+as\s\+'
let [object, name] = split(part, '\s\+as\s\+')
let [object, name] = split(part, '\s\+as\s\+\c')
let object = substitute(object, '^\\', '', '')
let name = substitute(name, '^\\', '', '')
else
@ -2343,7 +2522,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
break
endif
" if the name matches with the extracted classname and namespace
if (tag.kind == 'c' || tag.kind == 'i') && tag.name == classname
if (tag.kind == 'c' || tag.kind == 'i' || tag.kind == 't') && tag.name == classname
if has_key(tag, 'namespace')
let patched_ctags_detected = 1
if tag.namespace == namespace_for_classes
@ -2386,7 +2565,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
let tags = phpcomplete#GetTaglist('^'.import['name'].'$')
for tag in tags
" search for the first matchin namespace, class, interface with no namespace
if !has_key(tag, 'namespace') && (tag.kind == 'n' || tag.kind == 'c' || tag.kind == 'i')
if !has_key(tag, 'namespace') && (tag.kind == 'n' || tag.kind == 'c' || tag.kind == 'i' || tag.kind == 't')
call extend(import, tag)
let import['builtin'] = 0
break
@ -2445,7 +2624,7 @@ endfunction
function! phpcomplete#ExpandClassName(classname, current_namespace, imports) " {{{
" if there's an imported class, just use that class's information
if has_key(a:imports, a:classname) && (a:imports[a:classname].kind == 'c' || a:imports[a:classname].kind == 'i')
if has_key(a:imports, a:classname) && (a:imports[a:classname].kind == 'c' || a:imports[a:classname].kind == 'i' || a:imports[a:classname].kind == 't')
let namespace = has_key(a:imports[a:classname], 'namespace') ? a:imports[a:classname].namespace : ''
return [a:imports[a:classname].name, namespace]
endif

View File

@ -37,29 +37,38 @@ if executable('pbcopy')
let s:copy['*'] = s:copy['+']
let s:paste['*'] = s:paste['+']
let s:cache_enabled = 0
elseif executable('xclip')
let s:copy['+'] = 'xclip -quiet -i -selection clipboard'
let s:paste['+'] = 'xclip -o -selection clipboard'
let s:copy['*'] = 'xclip -quiet -i -selection primary'
let s:paste['*'] = 'xclip -o -selection primary'
elseif executable('xsel')
elseif exists('$DISPLAY') && executable('xsel')
let s:copy['+'] = 'xsel --nodetach -i -b'
let s:paste['+'] = 'xsel -o -b'
let s:copy['*'] = 'xsel --nodetach -i -p'
let s:paste['*'] = 'xsel -o -p'
elseif exists('$DISPLAY') && executable('xclip')
let s:copy['+'] = 'xclip -quiet -i -selection clipboard'
let s:paste['+'] = 'xclip -o -selection clipboard'
let s:copy['*'] = 'xclip -quiet -i -selection primary'
let s:paste['*'] = 'xclip -o -selection primary'
elseif executable('lemonade')
let s:copy['+'] = 'lemonade copy'
let s:paste['+'] = 'lemonade paste'
let s:copy['*'] = 'lemonade copy'
let s:paste['*'] = 'lemonade paste'
elseif executable('doitclient')
let s:copy['+'] = 'doitclient wclip'
let s:paste['+'] = 'doitclient wclip -r'
let s:copy['*'] = s:copy['+']
let s:paste['*'] = s:paste['+']
else
echom 'clipboard: No clipboard tool available. See :help nvim-clipboard'
echom 'clipboard: No clipboard tool available. See :help clipboard'
finish
endif
let s:clipboard = {}
function! s:clipboard.get(reg)
let reg = a:reg == '"' ? '+' : a:reg
if s:selections[reg].owner > 0
return s:selections[reg].data
if s:selections[a:reg].owner > 0
return s:selections[a:reg].data
end
return s:try_cmd(s:paste[reg])
return s:try_cmd(s:paste[a:reg])
endfunction
function! s:clipboard.set(lines, regtype, reg)
@ -83,6 +92,8 @@ function! s:clipboard.set(lines, regtype, reg)
end
let selection.data = [a:lines, a:regtype]
let argv = split(s:copy[a:reg], " ")
let selection.detach = s:cache_enabled
let selection.cwd = "/"
let jobid = jobstart(argv, selection)
if jobid <= 0
echohl WarningMsg

View File

@ -1,5 +1,5 @@
" The Python provider uses a Python host to emulate an environment for running
" python-vim plugins. See ":help nvim-provider" for more information.
" python-vim plugins. See ":help provider".
"
" Associating the plugin with the Python host is the first step because plugins
" will be passed as command-line arguments
@ -24,12 +24,10 @@ if s:prog == ''
finish
endif
let s:plugin_path = expand('<sfile>:p:h').'/script_host.py'
" The Python provider plugin will run in a separate instance of the Python
" host.
call remote#host#RegisterClone('legacy-python-provider', 'python')
call remote#host#RegisterPlugin('legacy-python-provider', s:plugin_path, [])
call remote#host#RegisterPlugin('legacy-python-provider', 'script_host.py', [])
function! provider#python#Call(method, args)
if s:err != ''

View File

@ -1,5 +1,5 @@
" The Python3 provider uses a Python3 host to emulate an environment for running
" python3 plugins. See ":help nvim-provider" for more information.
" python3 plugins. See ":help provider".
"
" Associating the plugin with the Python3 host is the first step because
" plugins will be passed as command-line arguments
@ -24,12 +24,10 @@ if s:prog == ''
finish
endif
let s:plugin_path = expand('<sfile>:p:h').'/script_host.py'
" The Python3 provider plugin will run in a separate instance of the Python3
" host.
call remote#host#RegisterClone('legacy-python3-provider', 'python3')
call remote#host#RegisterPlugin('legacy-python3-provider', s:plugin_path, [])
call remote#host#RegisterPlugin('legacy-python3-provider', 'script_host.py', [])
function! provider#python3#Call(method, args)
if s:err != ''

View File

@ -5,6 +5,47 @@ endif
let s:loaded_pythonx_provider = 1
let s:stderr = {}
let s:job_opts = {'rpc': v:true}
" TODO(bfredl): this logic is common and should be builtin
function! s:job_opts.on_stderr(chan_id, data, event)
let stderr = get(s:stderr, a:chan_id, [''])
let last = remove(stderr, -1)
let a:data[0] = last.a:data[0]
call extend(stderr, a:data)
let s:stderr[a:chan_id] = stderr
endfunction
function! provider#pythonx#Require(host) abort
let ver = (a:host.orig_name ==# 'python') ? 2 : 3
" Python host arguments
let prog = (ver == '2' ? provider#python#Prog() : provider#python3#Prog())
let args = [prog, '-c', 'import sys; sys.path.remove(""); import neovim; neovim.start_host()']
" Collect registered Python plugins into args
let python_plugins = remote#host#PluginsForHost(a:host.name)
for plugin in python_plugins
call add(args, plugin.path)
endfor
try
let channel_id = jobstart(args, s:job_opts)
if rpcrequest(channel_id, 'poll') ==# 'ok'
return channel_id
endif
catch
echomsg v:throwpoint
echomsg v:exception
for row in get(s:stderr, channel_id, [])
echomsg row
endfor
endtry
throw remote#host#LoadErrorForHost(a:host.orig_name,
\ '$NVIM_PYTHON_LOG_FILE')
endfunction
function! provider#pythonx#Detect(major_ver) abort
let host_var = (a:major_ver == 2) ?
\ 'g:python_host_prog' : 'g:python3_host_prog'
@ -44,7 +85,7 @@ endfunction
function! s:check_interpreter(prog, major_ver, skip) abort
let prog_path = exepath(a:prog)
if prog_path == ''
if prog_path ==# ''
return [0, a:prog . ' not found in search path or not executable.']
endif
@ -57,8 +98,8 @@ function! s:check_interpreter(prog, major_ver, skip) abort
" Try to load neovim module, and output Python version.
" Return codes:
" 0 Neovim module can be loaded.
" 1 Something else went wrong.
" 2 Neovim module cannot be loaded.
" Otherwise something else went wrong (e.g. 1 or 127).
let prog_ver = system([ a:prog , '-c' ,
\ 'import sys; ' .
\ 'sys.path.remove(""); ' .
@ -67,7 +108,8 @@ function! s:check_interpreter(prog, major_ver, skip) abort
\ 'exit(2*int(pkgutil.get_loader("neovim") is None))'
\ ])
if prog_ver
if v:shell_error == 2 || v:shell_error == 0
" Check version only for expected return codes.
if prog_ver !~ '^' . a:major_ver
return [0, prog_path . ' is Python ' . prog_ver . ' and cannot provide Python '
\ . a:major_ver . '.']
@ -77,12 +119,16 @@ function! s:check_interpreter(prog, major_ver, skip) abort
endif
endif
if v:shell_error == 1
if v:shell_error == 2
return [0, prog_path . ' does not have the neovim module installed. '
\ . 'See ":help provider-python".']
elseif v:shell_error == 127
" This can happen with pyenv's shims.
return [0, prog_path . ' does not exist: ' . prog_ver]
elseif v:shell_error
return [0, 'Checking ' . prog_path . ' caused an unknown error. '
\ . 'Please report this at github.com/neovim/neovim.']
elseif v:shell_error == 2
return [0, prog_path . ' does have not have the neovim module installed. '
\ . 'See ":help nvim-python".']
\ . '(' . v:shell_error . ', output: ' . prog_ver . ')'
\ . ' Please report this at github.com/neovim/neovim.']
endif
return [1, '']

View File

@ -0,0 +1,78 @@
" The Ruby provider helper
if exists('g:loaded_ruby_provider')
finish
endif
let g:loaded_ruby_provider = 1
let s:stderr = {}
let s:job_opts = {'rpc': v:true}
function! s:job_opts.on_stderr(chan_id, data, event)
let stderr = get(s:stderr, a:chan_id, [''])
let last = remove(stderr, -1)
let a:data[0] = last.a:data[0]
call extend(stderr, a:data)
let s:stderr[a:chan_id] = stderr
endfunction
function! provider#ruby#Detect() abort
return exepath('neovim-ruby-host')
endfunction
function! provider#ruby#Prog()
return s:prog
endfunction
function! provider#ruby#Require(host) abort
let args = [provider#ruby#Prog()]
let ruby_plugins = remote#host#PluginsForHost(a:host.name)
for plugin in ruby_plugins
call add(args, plugin.path)
endfor
try
let channel_id = jobstart(args, s:job_opts)
if rpcrequest(channel_id, 'poll') ==# 'ok'
return channel_id
endif
catch
echomsg v:throwpoint
echomsg v:exception
for row in get(s:stderr, channel_id, [])
echomsg row
endfor
endtry
throw remote#host#LoadErrorForHost(a:host.orig_name, '$NVIM_RUBY_LOG_FILE')
endfunction
function! provider#ruby#Call(method, args)
if s:err != ''
echoerr s:err
return
endif
if !exists('s:host')
try
let s:host = remote#host#Require('legacy-ruby-provider')
catch
let s:err = v:exception
echohl WarningMsg
echomsg v:exception
echohl None
return
endtry
endif
return call('rpcrequest', insert(insert(a:args, 'ruby_'.a:method), s:host))
endfunction
let s:err = ''
let s:prog = provider#ruby#Detect()
let s:plugin_path = expand('<sfile>:p:h') . '/script_host.rb'
if empty(s:prog)
let s:err = 'Cannot find the neovim RubyGem. Try :CheckHealth'
endif
call remote#host#RegisterClone('legacy-ruby-provider', 'ruby')
call remote#host#RegisterPlugin('legacy-ruby-provider', s:plugin_path, [])

View File

@ -1,249 +0,0 @@
"""Legacy python/python3-vim emulation."""
import imp
import logging
import os
import sys
import neovim
__all__ = ('ScriptHost',)
logger = logging.getLogger(__name__)
debug, info, warn = (logger.debug, logger.info, logger.warn,)
IS_PYTHON3 = sys.version_info >= (3, 0)
if IS_PYTHON3:
basestring = str
if sys.version_info >= (3, 4):
from importlib.machinery import PathFinder
@neovim.plugin
class ScriptHost(object):
"""Provides an environment for running python plugins created for Vim."""
def __init__(self, nvim):
"""Initialize the legacy python-vim environment."""
self.setup(nvim)
# context where all code will run
self.module = imp.new_module('__main__')
nvim.script_context = self.module
# it seems some plugins assume 'sys' is already imported, so do it now
exec('import sys', self.module.__dict__)
self.legacy_vim = nvim.with_hook(LegacyEvalHook())
sys.modules['vim'] = self.legacy_vim
def setup(self, nvim):
"""Setup import hooks and global streams.
This will add import hooks for importing modules from runtime
directories and patch the sys module so 'print' calls will be
forwarded to Nvim.
"""
self.nvim = nvim
info('install import hook/path')
self.hook = path_hook(nvim)
sys.path_hooks.append(self.hook)
nvim.VIM_SPECIAL_PATH = '_vim_path_'
sys.path.append(nvim.VIM_SPECIAL_PATH)
info('redirect sys.stdout and sys.stderr')
self.saved_stdout = sys.stdout
self.saved_stderr = sys.stderr
sys.stdout = RedirectStream(lambda data: nvim.out_write(data))
sys.stderr = RedirectStream(lambda data: nvim.err_write(data))
def teardown(self):
"""Restore state modified from the `setup` call."""
for plugin in self.installed_plugins:
if hasattr(plugin, 'on_teardown'):
plugin.teardown()
nvim = self.nvim
info('uninstall import hook/path')
sys.path.remove(nvim.VIM_SPECIAL_PATH)
sys.path_hooks.remove(self.hook)
info('restore sys.stdout and sys.stderr')
sys.stdout = self.saved_stdout
sys.stderr = self.saved_stderr
@neovim.rpc_export('python_execute', sync=True)
def python_execute(self, script, range_start, range_stop):
"""Handle the `python` ex command."""
self._set_current_range(range_start, range_stop)
exec(script, self.module.__dict__)
@neovim.rpc_export('python_execute_file', sync=True)
def python_execute_file(self, file_path, range_start, range_stop):
"""Handle the `pyfile` ex command."""
self._set_current_range(range_start, range_stop)
with open(file_path) as f:
script = compile(f.read(), file_path, 'exec')
exec(script, self.module.__dict__)
@neovim.rpc_export('python_do_range', sync=True)
def python_do_range(self, start, stop, code):
"""Handle the `pydo` ex command."""
self._set_current_range(start, stop)
nvim = self.nvim
start -= 1
stop -= 1
fname = '_vim_pydo'
# define the function
function_def = 'def %s(line, linenr):\n %s' % (fname, code,)
exec(function_def, self.module.__dict__)
# get the function
function = self.module.__dict__[fname]
while start <= stop:
# Process batches of 5000 to avoid the overhead of making multiple
# API calls for every line. Assuming an average line length of 100
# bytes, approximately 488 kilobytes will be transferred per batch,
# which can be done very quickly in a single API call.
sstart = start
sstop = min(start + 5000, stop)
lines = nvim.current.buffer.get_line_slice(sstart, sstop, True,
True)
exception = None
newlines = []
linenr = sstart + 1
for i, line in enumerate(lines):
result = function(line, linenr)
if result is None:
# Update earlier lines, and skip to the next
if newlines:
end = sstart + len(newlines) - 1
nvim.current.buffer.set_line_slice(sstart, end,
True, True,
newlines)
sstart += len(newlines) + 1
newlines = []
pass
elif isinstance(result, basestring):
newlines.append(result)
else:
exception = TypeError('pydo should return a string ' +
'or None, found %s instead'
% result.__class__.__name__)
break
linenr += 1
start = sstop + 1
if newlines:
end = sstart + len(newlines) - 1
nvim.current.buffer.set_line_slice(sstart, end, True, True,
newlines)
if exception:
raise exception
# delete the function
del self.module.__dict__[fname]
@neovim.rpc_export('python_eval', sync=True)
def python_eval(self, expr):
"""Handle the `pyeval` vim function."""
return eval(expr, self.module.__dict__)
def _set_current_range(self, start, stop):
current = self.legacy_vim.current
current.range = current.buffer.range(start, stop)
class RedirectStream(object):
def __init__(self, redirect_handler):
self.redirect_handler = redirect_handler
def write(self, data):
self.redirect_handler(data)
def writelines(self, seq):
self.redirect_handler('\n'.join(seq))
def flush(self):
pass
class LegacyEvalHook(neovim.SessionHook):
"""Injects legacy `vim.eval` behavior to a Nvim instance."""
def __init__(self):
super(LegacyEvalHook, self).__init__(from_nvim=self._string_eval)
def _string_eval(self, obj, session, method, kind):
if method == 'vim_eval':
if IS_PYTHON3:
if isinstance(obj, (int, float)):
return str(obj)
elif isinstance(obj, (int, long, float)):
return str(obj)
return obj
# This was copied/adapted from nvim-python help
def path_hook(nvim):
def _get_paths():
return discover_runtime_directories(nvim)
def _find_module(fullname, oldtail, path):
idx = oldtail.find('.')
if idx > 0:
name = oldtail[:idx]
tail = oldtail[idx+1:]
fmr = imp.find_module(name, path)
module = imp.find_module(fullname[:-len(oldtail)] + name, *fmr)
return _find_module(fullname, tail, module.__path__)
else:
return imp.find_module(fullname, path)
class VimModuleLoader(object):
def __init__(self, module):
self.module = module
def load_module(self, fullname, path=None):
# Check sys.modules, required for reload (see PEP302).
if fullname in sys.modules:
return sys.modules[fullname]
return imp.load_module(fullname, *self.module)
class VimPathFinder(object):
@staticmethod
def find_module(fullname, path=None):
"Method for Python 2.7 and 3.3."
try:
return VimModuleLoader(
_find_module(fullname, fullname, path or _get_paths()))
except ImportError:
return None
@staticmethod
def find_spec(fullname, path=None, target=None):
"Method for Python 3.4+."
return PathFinder.find_spec(fullname, path or _get_paths(), target)
def hook(path):
if path == nvim.VIM_SPECIAL_PATH:
return VimPathFinder
else:
raise ImportError
return hook
def discover_runtime_directories(nvim):
rv = []
for path in nvim.list_runtime_paths():
if not os.path.exists(path):
continue
path1 = os.path.join(path, 'pythonx')
if IS_PYTHON3:
path2 = os.path.join(path, 'python3')
else:
path2 = os.path.join(path, 'python2')
if os.path.exists(path1):
rv.append(path1)
if os.path.exists(path2):
rv.append(path2)
return rv

View File

@ -0,0 +1,8 @@
begin
require "neovim/ruby_provider"
rescue LoadError
warn(
"Your neovim RubyGem is missing or out of date. " +
"Install the latest version using `gem install neovim`."
)
end

View File

@ -1,7 +1,7 @@
"python3complete.vim - Omni Completion for python
" Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
" Version: 0.9
" Last Updated: 18 Jun 2009
" Last Updated: 18 Jun 2009 (small fix 2015 Sep 14 from Debian)
"
" Roland Puntaier: this file contains adaptations for python3 and is parallel to pythoncomplete.vim
"
@ -359,6 +359,7 @@ class PyParser:
def __init__(self):
self.top = Scope('global',0)
self.scope = self.top
self.parserline = 0
def _parsedotname(self,pre=None):
#returns (dottedname, nexttoken)

View File

@ -377,6 +377,7 @@ class PyParser:
def __init__(self):
self.top = Scope('global',0)
self.scope = self.top
self.parserline = 0
def _parsedotname(self,pre=None):
#returns (dottedname, nexttoken)

View File

@ -1,7 +1,7 @@
function! remote#define#CommandOnHost(host, method, sync, name, opts)
let prefix = ''
if has_key(a:opts, 'range')
if has_key(a:opts, 'range')
if a:opts.range == '' || a:opts.range == '%'
" -range or -range=%, pass the line range in a list
let prefix = '<line1>,<line2>'
@ -30,7 +30,7 @@ function! remote#define#CommandOnHost(host, method, sync, name, opts)
exe s:GetCommandPrefix(a:name, a:opts)
\ .' call remote#define#CommandBootstrap("'.a:host.'"'
\ . ', "'.a:method.'"'
\ . ', "'.a:sync.'"'
\ . ', '.string(a:sync)
\ . ', "'.a:name.'"'
\ . ', '.string(a:opts).''
\ . ', "'.join(forward_args, '').'"'
@ -94,7 +94,7 @@ function! remote#define#AutocmdOnHost(host, method, sync, name, opts)
let bootstrap_def = s:GetAutocmdPrefix(a:name, a:opts)
\ .' call remote#define#AutocmdBootstrap("'.a:host.'"'
\ . ', "'.a:method.'"'
\ . ', "'.a:sync.'"'
\ . ', '.string(a:sync)
\ . ', "'.a:name.'"'
\ . ', '.string(a:opts).''
\ . ', "'.escape(forward, '"').'"'
@ -133,7 +133,7 @@ function! remote#define#FunctionOnHost(host, method, sync, name, opts)
exe 'autocmd! '.group.' FuncUndefined '.a:name
\ .' call remote#define#FunctionBootstrap("'.a:host.'"'
\ . ', "'.a:method.'"'
\ . ', "'.a:sync.'"'
\ . ', '.string(a:sync)
\ . ', "'.a:name.'"'
\ . ', '.string(a:opts)
\ . ', "'.group.'"'
@ -157,6 +157,9 @@ endfunction
function! remote#define#FunctionOnChannel(channel, method, sync, name, opts)
let rpcargs = [a:channel, '"'.a:method.'"', 'a:000']
if has_key(a:opts, 'range')
call add(rpcargs, '[a:firstline, a:lastline]')
endif
call s:AddEval(rpcargs, a:opts)
let function_def = s:GetFunctionPrefix(a:name, a:opts)
@ -187,7 +190,7 @@ let s:next_gid = 1
function! s:GetNextAutocmdGroup()
let gid = s:next_gid
let s:next_gid += 1
let group_name = 'RPC_DEFINE_AUTOCMD_GROUP_'.gid
" Ensure the group is defined
exe 'augroup '.group_name.' | augroup END'
@ -218,7 +221,11 @@ endfunction
function! s:GetFunctionPrefix(name, opts)
return "function! ".a:name."(...)\n"
let res = "function! ".a:name."(...)"
if has_key(a:opts, 'range')
let res = res." range"
endif
return res."\n"
endfunction

View File

@ -1,11 +1,10 @@
let s:hosts = {}
let s:plugin_patterns = {}
let s:remote_plugins_manifest = fnamemodify(expand($MYVIMRC, 1), ':h')
\.'/.'.fnamemodify($MYVIMRC, ':t').'-rplugin~'
let s:plugins_for_host = {}
" Register a host by associating it with a factory(funcref)
function! remote#host#Register(name, pattern, factory)
function! remote#host#Register(name, pattern, factory) abort
let s:hosts[a:name] = {'factory': a:factory, 'channel': 0, 'initialized': 0}
let s:plugin_patterns[a:name] = a:pattern
if type(a:factory) == type(1) && a:factory
@ -19,7 +18,7 @@ endfunction
" as `source`, but it will run as a different process. This can be used by
" plugins that should run isolated from other plugins created for the same host
" type
function! remote#host#RegisterClone(name, orig_name)
function! remote#host#RegisterClone(name, orig_name) abort
if !has_key(s:hosts, a:orig_name)
throw 'No host named "'.a:orig_name.'" is registered'
endif
@ -34,7 +33,10 @@ endfunction
" Get a host channel, bootstrapping it if necessary
function! remote#host#Require(name)
function! remote#host#Require(name) abort
if empty(s:plugins_for_host)
call remote#host#LoadRemotePlugins()
endif
if !has_key(s:hosts, a:name)
throw 'No host named "'.a:name.'" is registered'
endif
@ -51,7 +53,7 @@ function! remote#host#Require(name)
endfunction
function! remote#host#IsRunning(name)
function! remote#host#IsRunning(name) abort
if !has_key(s:hosts, a:name)
throw 'No host named "'.a:name.'" is registered'
endif
@ -72,7 +74,7 @@ endfunction
"
" The third item in a declaration is a boolean: non zero means the command,
" autocommand or function will be executed synchronously with rpcrequest.
function! remote#host#RegisterPlugin(host, path, specs)
function! remote#host#RegisterPlugin(host, path, specs) abort
let plugins = remote#host#PluginsForHost(a:host)
for plugin in plugins
@ -116,19 +118,80 @@ function! remote#host#RegisterPlugin(host, path, specs)
endfunction
function! remote#host#LoadRemotePlugins()
if filereadable(s:remote_plugins_manifest)
exe 'source '.s:remote_plugins_manifest
" Get the path to the rplugin manifest file.
function! s:GetManifestPath() abort
let manifest_base = ''
if exists('$NVIM_RPLUGIN_MANIFEST')
return fnamemodify($NVIM_RPLUGIN_MANIFEST, ':p')
endif
let dest = has('win32') ? '$LOCALAPPDATA' : '$XDG_DATA_HOME'
if !exists(dest)
let dest = has('win32') ? '~/AppData/Local' : '~/.local/share'
endif
let dest = fnamemodify(expand(dest), ':p')
if !empty(dest) && !filereadable(dest)
let dest .= ('/' ==# dest[-1:] ? '' : '/') . 'nvim'
call mkdir(dest, 'p', 0700)
let manifest_base = dest
endif
return manifest_base.'/rplugin.vim'
endfunction
" Old manifest file based on known script locations.
function! s:GetOldManifestPath() abort
let prefix = exists('$MYVIMRC')
\ ? $MYVIMRC
\ : matchstr(get(split(execute('scriptnames'), '\n'), 0, ''), '\f\+$')
return fnamemodify(expand(prefix, 1), ':h')
\.'/.'.fnamemodify(prefix, ':t').'-rplugin~'
endfunction
function! s:GetManifest() abort
let manifest = s:GetManifestPath()
if !filereadable(manifest)
" Check if an old manifest file exists and move it to the new location.
let old_manifest = s:GetOldManifestPath()
if filereadable(old_manifest)
call rename(old_manifest, manifest)
endif
endif
return manifest
endfunction
function! remote#host#LoadRemotePlugins() abort
let manifest = s:GetManifest()
if filereadable(manifest)
execute 'source' fnameescape(manifest)
endif
endfunction
function! s:RegistrationCommands(host)
function! remote#host#LoadRemotePluginsEvent(event, pattern) abort
autocmd! nvim-rplugin
call remote#host#LoadRemotePlugins()
if exists('#'.a:event.'#'.a:pattern) " Avoid 'No matching autocommands'.
execute 'silent doautocmd <nomodeline>' a:event a:pattern
endif
endfunction
function! s:RegistrationCommands(host) abort
" Register a temporary host clone for discovering specs
let host_id = a:host.'-registration-clone'
call remote#host#RegisterClone(host_id, a:host)
let pattern = s:plugin_patterns[a:host]
let paths = globpath(&rtp, 'rplugin/'.a:host.'/'.pattern, 0, 1)
let paths = map(paths, 'tr(resolve(v:val),"\\","/")') " Normalize slashes #4795
let paths = uniq(sort(paths))
if empty(paths)
return []
endif
@ -138,7 +201,9 @@ function! s:RegistrationCommands(host)
endfor
let channel = remote#host#Require(host_id)
let lines = []
let registered = []
for path in paths
unlet! specs
let specs = rpcrequest(channel, 'specs', path)
if type(specs) != type([])
" host didn't return a spec list, indicates a failure while loading a
@ -151,9 +216,10 @@ function! s:RegistrationCommands(host)
call add(lines, " \\ ".string(spec).",")
endfor
call add(lines, " \\ ])")
call add(registered, path)
endfor
echomsg printf("remote/host: %s host registered plugins %s",
\ a:host, string(map(copy(paths), "fnamemodify(v:val, ':t')")))
\ a:host, string(map(registered, "fnamemodify(v:val, ':t')")))
" Delete the temporary host clone
call rpcstop(s:hosts[host_id].channel)
@ -163,26 +229,29 @@ function! s:RegistrationCommands(host)
endfunction
function! s:UpdateRemotePlugins()
function! remote#host#UpdateRemotePlugins() abort
let commands = []
let hosts = keys(s:hosts)
for host in hosts
if has_key(s:plugin_patterns, host)
let commands = commands
\ + ['" '.host.' plugins']
\ + s:RegistrationCommands(host)
\ + ['', '']
try
let commands +=
\ ['" '.host.' plugins']
\ + s:RegistrationCommands(host)
\ + ['', '']
catch
echomsg v:throwpoint
echomsg v:exception
endtry
endif
endfor
call writefile(commands, s:remote_plugins_manifest)
call writefile(commands, s:GetManifest())
echomsg printf('remote/host: generated rplugin manifest: %s',
\ s:GetManifest())
endfunction
command! UpdateRemotePlugins call s:UpdateRemotePlugins()
let s:plugins_for_host = {}
function! remote#host#PluginsForHost(host)
function! remote#host#PluginsForHost(host) abort
if !has_key(s:plugins_for_host, a:host)
let s:plugins_for_host[a:host] = []
end
@ -190,38 +259,22 @@ function! remote#host#PluginsForHost(host)
endfunction
" Registration of standard hosts
" Python/Python3 {{{
function! s:RequirePythonHost(host)
let ver = (a:host.orig_name ==# 'python') ? 2 : 3
" Python host arguments
let args = ['-c', 'import sys; sys.path.remove(""); import neovim; neovim.start_host()']
" Collect registered Python plugins into args
let python_plugins = remote#host#PluginsForHost(a:host.name)
for plugin in python_plugins
call add(args, plugin.path)
endfor
try
let channel_id = rpcstart((ver == '2' ?
\ provider#python#Prog() : provider#python3#Prog()), args)
if rpcrequest(channel_id, 'poll') == 'ok'
return channel_id
endif
catch
echomsg v:exception
endtry
throw 'Failed to load Python host. You can try to see what happened '.
\ 'by starting Neovim with the environment variable '.
\ '$NVIM_PYTHON_LOG_FILE set to a file and opening '.
\ 'the generated log file. Also, the host stderr will be available '.
\ 'in Neovim log, so it may contain useful information. '.
\ 'See also ~/.nvimlog.'
function! remote#host#LoadErrorForHost(host, log) abort
return 'Failed to load '. a:host . ' host. '.
\ 'You can try to see what happened by starting nvim with '.
\ a:log . ' set and opening the generated log file.'.
\ ' Also, the host stderr is available in messages.'
endfunction
call remote#host#Register('python', '*.py', function('s:RequirePythonHost'))
call remote#host#Register('python3', '*.py', function('s:RequirePythonHost'))
" }}}
" Registration of standard hosts
" Python/Python3
call remote#host#Register('python', '*',
\ function('provider#pythonx#Require'))
call remote#host#Register('python3', '*',
\ function('provider#pythonx#Require'))
" Ruby
call remote#host#Register('ruby', '*.rb',
\ function('provider#ruby#Require'))

View File

@ -1,6 +1,4 @@
" Vim script to download a missing spell file
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2012 Jan 08
if !exists('g:spellfile_URL')
" Prefer using http:// when netrw should be able to use it, since
@ -43,22 +41,23 @@ function! spellfile#LoadFile(lang)
if len(dirlist) == 0
let dir_to_create = spellfile#WritableSpellDir()
if &verbose || dir_to_create != ''
echomsg 'spellfile#LoadFile(): There is no writable spell directory.'
echomsg 'spellfile#LoadFile(): No (writable) spell directory found.'
endif
if dir_to_create != ''
if confirm("Shall I create " . dir_to_create, "&Yes\n&No", 2) == 1
" After creating the directory it should show up in the list.
call mkdir(dir_to_create, "p")
let [dirlist, dirchoices] = spellfile#GetDirChoices()
endif
call mkdir(dir_to_create, "p")
" Now it should show up in the list.
let [dirlist, dirchoices] = spellfile#GetDirChoices()
endif
if len(dirlist) == 0
echomsg 'Failed to create: '.dir_to_create
return
else
echomsg 'Created '.dir_to_create
endif
endif
let msg = 'Cannot find spell file for "' . a:lang . '" in ' . &enc
let msg .= "\nDo you want me to try downloading it?"
let msg = 'No spell file for "' . a:lang . '" in ' . &enc
let msg .= "\nDownload it?"
if confirm(msg, "&Yes\n&No", 2) == 1
let enc = &encoding
if enc == 'iso-8859-15'
@ -78,78 +77,77 @@ function! spellfile#LoadFile(lang)
" Careful: Nread() may have opened a new window for the error message,
" we need to go back to our own buffer and window.
if newbufnr != winbufnr(0)
let winnr = bufwinnr(newbufnr)
if winnr == -1
" Our buffer has vanished!? Open a new window.
echomsg "download buffer disappeared, opening a new one"
new
setlocal bin fenc=
else
exe winnr . "wincmd w"
endif
let winnr = bufwinnr(newbufnr)
if winnr == -1
" Our buffer has vanished!? Open a new window.
echomsg "download buffer disappeared, opening a new one"
new
setlocal bin fenc=
else
exe winnr . "wincmd w"
endif
endif
if newbufnr == winbufnr(0)
" We are back the old buffer, remove any (half-finished) download.
g/^/d
" We are back the old buffer, remove any (half-finished) download.
g/^/d_
else
let newbufnr = winbufnr(0)
let newbufnr = winbufnr(0)
endif
let fname = a:lang . '.ascii.spl'
echo 'Could not find it, trying ' . fname . '...'
call spellfile#Nread(fname)
if getline(2) !~ 'VIMspell'
echo 'Sorry, downloading failed'
exe newbufnr . "bwipe!"
return
echo 'Download failed'
exe newbufnr . "bwipe!"
return
endif
endif
" Delete the empty first line and mark the file unmodified.
1d
1d_
set nomod
let msg = "In which directory do you want to write the file:"
for i in range(len(dirlist))
let msg .= "\n" . (i + 1) . '. ' . dirlist[i]
endfor
let dirchoice = confirm(msg, dirchoices) - 2
if len(dirlist) == 1
let dirchoice = 0
else
let msg = "In which directory do you want to write the file:"
for i in range(len(dirlist))
let msg .= "\n" . (i + 1) . '. ' . dirlist[i]
endfor
let dirchoice = confirm(msg, dirchoices) - 2
endif
if dirchoice >= 0
if exists('*fnameescape')
let dirname = fnameescape(dirlist[dirchoice])
let dirname = fnameescape(dirlist[dirchoice])
else
let dirname = escape(dirlist[dirchoice], ' ')
let dirname = escape(dirlist[dirchoice], ' ')
endif
setlocal fenc=
exe "write " . dirname . '/' . fname
" Also download the .sug file, if the user wants to.
let msg = "Do you want me to try getting the .sug file?\n"
let msg .= "This will improve making suggestions for spelling mistakes,\n"
let msg .= "but it uses quite a bit of memory."
if confirm(msg, "&No\n&Yes") == 2
g/^/d
let fname = substitute(fname, '\.spl$', '.sug', '')
echo 'Downloading ' . fname . '...'
call spellfile#Nread(fname)
if getline(2) =~ 'VIMsug'
1d
exe "write " . dirname . '/' . fname
set nomod
else
echo 'Sorry, downloading failed'
" Go back to our own buffer/window, Nread() may have taken us to
" another window.
if newbufnr != winbufnr(0)
let winnr = bufwinnr(newbufnr)
if winnr != -1
exe winnr . "wincmd w"
endif
endif
if newbufnr == winbufnr(0)
set nomod
endif
endif
" Also download the .sug file.
g/^/d_
let fname = substitute(fname, '\.spl$', '.sug', '')
echo 'Downloading ' . fname . '...'
call spellfile#Nread(fname)
if getline(2) =~ 'VIMsug'
1d_
exe "write " . dirname . '/' . fname
set nomod
else
echo 'Download failed'
" Go back to our own buffer/window, Nread() may have taken us to
" another window.
if newbufnr != winbufnr(0)
let winnr = bufwinnr(newbufnr)
if winnr != -1
exe winnr . "wincmd w"
endif
endif
if newbufnr == winbufnr(0)
set nomod
endif
endif
endif

View File

@ -1,8 +1,8 @@
" Vim OMNI completion script for SQL
" Language: SQL
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
" Version: 15.0
" Last Change: 2013 May 13
" Version: 16.0
" Last Change: 2015 Dec 29
" Homepage: http://www.vim.org/scripts/script.php?script_id=1572
" Usage: For detailed help
" ":help sql.txt"
@ -16,6 +16,12 @@
" look backwards to a FROM clause and find the first table
" and complete it.
"
" Version 16.0 (Dec 2015)
" - NF: If reseting the cache and table, procedure or view completion
" had been used via dbext, have dbext delete or recreate the
" dictionary so that new objects are picked up for the
" next completion.
"
" Version 15.0 (May 2013)
" - NF: Changed the SQL precached syntax items, omni_sql_precache_syntax_groups,
" to use regular expressions to pick up extended syntax group names.
@ -103,7 +109,7 @@ endif
if exists('g:loaded_sql_completion')
finish
endif
let g:loaded_sql_completion = 150
let g:loaded_sql_completion = 160
let s:keepcpo= &cpo
set cpo&vim
@ -459,6 +465,29 @@ function! sqlcomplete#Complete(findstart, base)
let s:tbl_cols = []
let s:syn_list = []
let s:syn_value = []
if s:sql_file_table != ""
if g:loaded_dbext >= 2300
call DB_DictionaryDelete("table")
else
DBCompleteTables!
endif
endif
if s:sql_file_procedure != ""
if g:loaded_dbext >= 2300
call DB_DictionaryDelete("procedure")
else
DBCompleteProcedures!
endif
endif
if s:sql_file_view != ""
if g:loaded_dbext >= 2300
call DB_DictionaryDelete("view")
else
DBCompleteViews!
endif
endif
let s:sql_file_table = ""
let s:sql_file_procedure = ""
let s:sql_file_view = ""

View File

@ -1,6 +1,6 @@
" Vim autoload file for the tohtml plugin.
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
" Last Change: 2013 Jun 19
" Last Change: 2013 Sep 03
"
" Additional contributors:
"
@ -302,7 +302,7 @@ func! tohtml#Convert2HTML(line1, line2) "{{{
else "{{{
let win_list = []
let buf_list = []
windo | if &diff | call add(win_list, winbufnr(0)) | endif
windo if &diff | call add(win_list, winbufnr(0)) | endif
let s:settings.whole_filler = 1
let g:html_diff_win_num = 0
for window in win_list

View File

@ -251,13 +251,14 @@ endfunction
" Tutor Cmd: {{{1
function! s:Locale()
let l:lang = ""
if exists('v:lang') && v:lang =~ '\a\a'
let l:lang = v:lang
elseif $LC_ALL =~ '\a\a'
let l:lang = $LC_ALL
elseif $LANG =~ '\a\a'
let l:lang = $LANG
else
let l:lang = 'en_US'
endif
return split(l:lang, '_')
endfunction

View File

@ -2,6 +2,7 @@
" Compiler: GNU C Compiler
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2010-10-14
" added line suggested by Anton Lindqvist 2016 Mar 31
if exists("current_compiler")
finish
@ -24,6 +25,7 @@ CompilerSet errorformat=
\%f:%l:\ %trror:\ %m,
\%f:%l:\ %tarning:\ %m,
\%f:%l:\ %m,
\%f:\\(%*[^\\)]\\):\ %m,
\\"%f\"\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,
\%D%*\\a[%*\\d]:\ Entering\ directory\ [`']%f',
\%X%*\\a[%*\\d]:\ Leaving\ directory\ [`']%f',

View File

@ -1,7 +1,7 @@
" Vim compiler file
" Compiler: HTML Tidy
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2013 Jul 7
" Last Change: 2016 Apr 21
if exists("current_compiler")
finish
@ -12,8 +12,8 @@ if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
CompilerSet makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes\ %
CompilerSet makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes\ %:S
" sample warning: foo.html:8:1: Warning: inserting missing 'foobar' element
" sample error: foo.html:9:2: Error: <foobar> is not recognized!
CompilerSet errorformat=%f:%l:%c:\ Error:%m,%f:%l:%c:\ Warning:%m,%-G%.%#
" foo.html:8:1: Warning: inserting missing 'foobar' element
" foo.html:9:2: Error: <foobar> is not recognized!
CompilerSet errorformat=%f:%l:%c:\ %trror:%m,%f:%l:%c:\ %tarning:%m,%-G%.%#

View File

@ -6,32 +6,14 @@
AWK = awk
# Set to $(VIMTARGET) when executed from src/Makefile.
VIMEXE = vim
DOCS = $(wildcard *.txt)
HTMLS = $(DOCS:.txt=.html)
.SUFFIXES:
.SUFFIXES: .c .o .txt .html
all: tags html
# Use Vim to generate the tags file. Can only be used when Vim has been
# compiled and installed. Supports multiple languages.
vimtags: $(DOCS)
$(VIMEXE) -u NONE -es -c "helptags ++t ." -c quit
# Use "doctags" to generate the tags file. Only works for English!
tags: doctags $(DOCS)
./doctags $(DOCS) | LANG=C LC_ALL=C sort >tags
uniq -d -2 tags
doctags: doctags.c
$(CC) doctags.c -o doctags
# Awk version of .txt to .html conversion.
html: noerrors tags $(HTMLS)
html: noerrors $(HTMLS)
@if test -f errors.log; then cat errors.log; fi
noerrors:
@ -54,5 +36,5 @@ tags.ref tags.html: tags
$(AWK) -f maketags.awk tags >tags.html
clean:
-rm -f doctags *.html tags.ref $(HTMLS) errors.log
-rm -f *.html tags.ref $(HTMLS) errors.log

110
runtime/doc/api.txt Normal file
View File

@ -0,0 +1,110 @@
*api.txt* {Nvim}
NVIM REFERENCE MANUAL by Thiago de Arruda
C API for Nvim *API* *api*
1. Introduction |api-intro|
2. API Types |api-types|
3. API metadata |api-metadata|
4. Buffer highlighting |api-highlights|
==============================================================================
1. Introduction *api-intro*
Nvim exposes a public API for external code to interact with the Nvim core.
The API is used by external processes to interact with Nvim using the
msgpack-rpc protocol, see |msgpack-rpc|. The API is used from vimscript to
access some new Nvim core features. See |eval-api| for how api functions are
called from vimscript. Later on, Nvim might be embeddable in C applications as
libnvim, and the application will then control the embedded instance by calling
the C API directly.
==============================================================================
2. API Types *api-types*
Nvim's C API uses custom types for all functions. Some are just typedefs
around C99 standard types, and some are Nvim-defined data structures.
Boolean -> bool
Integer (signed 64-bit integer) -> int64_t
Float (IEEE 754 double precision) -> double
String -> {char* data, size_t size} struct
Additionally, the following data structures are defined:
Array
Dictionary
Object
The following handle types are defined as integer typedefs, but are
discriminated as separate types in an Object:
Buffer -> enum value kObjectTypeBuffer
Window -> enum value kObjectTypeWindow
Tabpage -> enum value kObjectTypeTabpage
==============================================================================
3. API metadata *api-metadata*
Nvim exposes metadata about the API as a Dictionary with the following keys:
version Nvim version, API level/compatibility
functions API function signatures
types Custom handle types defined by Nvim
error_types Possible error types returned by API functions
This metadata is mostly useful for external programs accessing the API via
RPC, see |rpc-api|.
==============================================================================
4. Buffer highlighting *api-highlights*
Nvim allows plugins to add position-based highlights to buffers. This is
similar to |matchaddpos()| but with some key differences. The added highlights
are associated with a buffer and adapts to line insertions and deletions,
similar to signs. It is also possible to manage a set of highlights as a group
and delete or replace all at once.
The intended use case are linter or semantic highlighter plugins that monitor
a buffer for changes, and in the background compute highlights to the buffer.
Another use case are plugins that show output in an append-only buffer, and
want to add highlights to the outputs. Highlight data cannot be preserved
on writing and loading a buffer to file, nor in undo/redo cycles.
Highlights are registered using the |nvim_buf_add_highlight| function, see the
generated API documentation for details. If an external highlighter plugin is
adding a large number of highlights in a batch, performance can be improved by
calling |nvim_buf_add_highlight| as an asynchronous notification, after first
(synchronously) reqesting a source id. Here is an example using wrapper
functions in the python client:
>
src = vim.new_highlight_source()
buf = vim.current.buffer
for i in range(5):
buf.add_highlight("String",i,0,-1,src_id=src)
# some time later
buf.clear_highlight(src)
<
If the highlights don't need to be deleted or updated, just pass -1 as
src_id (this is the default in python). |nvim_buf_clear_highlight| can be used
to clear highlights from a specific source, in a specific line range or the
entire buffer by passing in the line range 0, -1 (the latter is the default
in python as used above).
An example of calling the api from vimscript: >
call nvim_buf_set_lines(0, 0, 0, v:true, ["test text"])
let src = nvim_buf_add_highlight(0, 0, "String", 1, 0, 4)
call nvim_buf_add_highlight(0, src, "Identifier", 0, 5, -1)
" later
call nvim_buf_clear_highlight(0, src, 0, -1)
>
==============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 7.4. Last change: 2014 Sep 23
*autocmd.txt* For Vim version 7.4. Last change: 2016 Mar 26
VIM REFERENCE MANUAL by Bram Moolenaar
@ -256,8 +256,8 @@ Name triggered by ~
Options
|FileType| when the 'filetype' option has been set
|Syntax| when the 'syntax' option has been set
|EncodingChanged| after the 'encoding' option has been changed
|TermChanged| after the value of 'term' has changed
|OptionSet| after setting any option
Startup and exit
|VimEnter| after doing all the startup stuff
@ -307,6 +307,8 @@ Name triggered by ~
|InsertCharPre| when a character was typed in Insert mode, before
inserting it
|TextYankPost| when some text is yanked or deleted
|TextChanged| after a change was made to the text in Normal mode
|TextChangedI| after a change was made to the text in Insert mode
@ -554,9 +556,6 @@ CursorMoved After the cursor was moved in Normal or Visual
CursorMovedI After the cursor was moved in Insert mode.
Not triggered when the popup menu is visible.
Otherwise the same as CursorMoved.
*EncodingChanged*
EncodingChanged Fires off after the 'encoding' option has been
changed. Useful to set up fonts, for example.
*FileAppendCmd*
FileAppendCmd Before appending to a file. Should do the
appending to the file. Use the '[ and ']
@ -615,9 +614,6 @@ FileChangedShell When Vim notices that the modification time of
*FileChangedShellPost*
FileChangedShellPost After handling a file that was changed outside
of Vim. Can be used to update the statusline.
*FileEncoding*
FileEncoding Obsolete. It still works and is equivalent
to |EncodingChanged|.
*FileReadCmd*
FileReadCmd Before reading a file with a ":read" command.
Should do the reading of the file. |Cmd-event|
@ -721,6 +717,18 @@ InsertCharPre When a character is typed in Insert mode,
It is not allowed to change the text |textlock|.
The event is not triggered when 'paste' is
set.
*TextYankPost*
TextYankPost Just after a |yank| or |deleting| command, but not
if the black hole register |quote_| is used nor
for |setreg()|. Pattern must be * because its
meaning may change in the future.
Sets these |v:event| keys:
operator
regcontents
regname
regtype
Recursion is ignored.
It is not allowed to change the text |textlock|.
*InsertEnter*
InsertEnter Just before starting Insert mode. Also for
Replace mode and Virtual Replace mode. The
@ -745,6 +753,26 @@ MenuPopup Just before showing the popup menu (under the
o Operator-pending
i Insert
c Command line
*OptionSet*
OptionSet After setting an option. The pattern is
matched against the long option name.
The |v:option_old| variable indicates the
old option value, |v:option_new| variable
indicates the newly set value, the
|v:option_type| variable indicates whether
it's global or local scoped and |<amatch>|
indicates what option has been set.
Usage example: Check for the existence of the
directory in the 'backupdir' and 'undodir'
options, create the directory if it doesn't
exist yet.
Note: It's a bad idea to reset an option
during this autocommand, this may break a
plugin. You can always use `:noa` to prevent
triggering this autocommand.
*QuickFixCmdPre*
QuickFixCmdPre Before a quickfix command is run (|:make|,
|:lmake|, |:grep|, |:lgrep|, |:grepadd|,
@ -877,8 +905,7 @@ TermClose When a terminal buffer ends.
{Nvim} *TermOpen*
TermOpen When a terminal buffer is starting. This can
be used to configure the terminal emulator by
setting buffer variables.
See |nvim-terminal-emulator| for details.
setting buffer variables. |terminal-emulator|
*TermResponse*
TermResponse After the response to |t_RV| is received from
the terminal. The value of |v:termresponse|
@ -954,6 +981,13 @@ WinLeave Before leaving a window. If the window to be
==============================================================================
6. Patterns *autocmd-patterns* *{pat}*
The {pat} argument can be a comma separated list. This works as if the
command was given with each pattern separately. Thus this command: >
:autocmd BufRead *.txt,*.info set et
Is equivalent to: >
:autocmd BufRead *.txt set et
:autocmd BufRead *.info set et
The file pattern {pat} is tested for a match against the file name in one of
two ways:
1. When there is no '/' in the pattern, Vim checks for a match against only
@ -1022,7 +1056,7 @@ The pattern is interpreted like mostly used in file names:
[^ch] match any character but 'c' and 'h'
Note that for all systems the '/' character is used for path separator (even
MS-DOS). This was done because the backslash is difficult to use in a pattern
Windows). This was done because the backslash is difficult to use in a pattern
and to make the autocommands portable across different systems.
*autocmd-changes*
@ -1060,7 +1094,7 @@ Instead of a pattern buffer-local autocommands use one of these forms:
Examples: >
:au CursorHold <buffer> echo 'hold'
:au CursorHold <buffer=33> echo 'hold'
:au CursorHold <buffer=abuf> echo 'hold'
:au BufNewFile * au CursorHold <buffer=abuf> echo 'hold'
All the commands for autocommands also work with buffer-local autocommands,
simply use the special string instead of the pattern. Examples: >
@ -1119,6 +1153,9 @@ name!
:aug[roup] {name} Define the autocmd group name for the
following ":autocmd" commands. The name "end"
or "END" selects the default group.
To avoid confusion, the name should be
different from existing {event} names, as this
most likely will not do what you intended.
*:augroup-delete* *E367*
:aug[roup]! {name} Delete the autocmd group {name}. Don't use

View File

@ -1,4 +1,4 @@
*change.txt* For Vim version 7.4. Last change: 2014 Jun 26
*change.txt* For Vim version 7.4. Last change: 2016 Mar 08
VIM REFERENCE MANUAL by Bram Moolenaar
@ -97,10 +97,10 @@ These commands delete text. You can repeat them with the `.` command
An exception for the d{motion} command: If the motion is not linewise, the
start and end of the motion are not in the same line, and there are only
blanks before the start and after the end of the motion, the delete becomes
linewise. This means that the delete also removes the line of blanks that you
might expect to remain. Use the |o_v| operator to force the motion to be
characterwise.
blanks before the start and there are no non-blanks after the end of the
motion, the delete becomes linewise. This means that the delete also removes
the line of blanks that you might expect to remain. Use the |o_v| operator to
force the motion to be characterwise.
Trying to delete an empty region of text (e.g., "d0" in the first column)
is an error when 'cpoptions' includes the 'E' flag.
@ -108,7 +108,9 @@ is an error when 'cpoptions' includes the 'E' flag.
*J*
J Join [count] lines, with a minimum of two lines.
Remove the indent and insert up to two spaces (see
below).
below). Fails when on the last line of the buffer.
If [count] is too big it is reduce to the number of
lines available.
*v_J*
{Visual}J Join the highlighted lines, with a minimum of two
@ -366,13 +368,54 @@ Adding and subtracting ~
CTRL-A Add [count] to the number or alphabetic character at
or after the cursor.
*v_CTRL-A*
{Visual}CTRL-A Add [count] to the number or alphabetic character in
the highlighted text. {not in Vi}
*v_g_CTRL-A*
{Visual}g CTRL-A Add [count] to the number or alphabetic character in
the highlighted text. If several lines are
highlighted, each one will be incremented by an
additional [count] (so effectively creating a
[count] incrementing sequence). {not in Vi}
For Example, if you have this list of numbers:
1. ~
1. ~
1. ~
1. ~
Move to the second "1." and Visually select three
lines, pressing g CTRL-A results in:
1. ~
2. ~
3. ~
4. ~
*CTRL-X*
CTRL-X Subtract [count] from the number or alphabetic
character at or after the cursor.
*v_CTRL-X*
{Visual}CTRL-X Subtract [count] from the number or alphabetic
character in the highlighted text. {not in Vi}
On MS-Windows, this is mapped to cut Visual text
|dos-standard-mappings|. If you want to disable the
mapping, use this: >
silent! vunmap <C-X>
<
*v_g_CTRL-X*
{Visual}g CTRL-X Subtract [count] from the number or alphabetic
character in the highlighted text. If several lines
are highlighted, each value will be decremented by an
additional [count] (so effectively creating a [count]
decrementing sequence). {not in Vi}
The CTRL-A and CTRL-X commands work for (signed) decimal numbers, unsigned
octal and hexadecimal numbers and alphabetic characters. This depends on the
'nrformats' option.
binary/octal/hexadecimal numbers and alphabetic characters.
This depends on the 'nrformats' option:
- When 'nrformats' includes "bin", Vim assumes numbers starting with '0b' or
'0B' are binary.
- When 'nrformats' includes "octal", Vim considers numbers starting with a '0'
to be octal, unless the number includes a '8' or '9'. Other numbers are
decimal and may have a preceding minus sign.
@ -386,6 +429,10 @@ octal and hexadecimal numbers and alphabetic characters. This depends on the
under or after the cursor. This is useful to make lists with an alphabetic
index.
For decimals a leading negative sign is considered for incrementing or
decrementing, for binary, octal and hex values, it won't be considered. To
ignore the sign Visually select the number before using CTRL-A or CTRL-X.
For numbers with leading zeros (including all octal and hexadecimal numbers),
Vim preserves the number of characters in the number when possible. CTRL-A on
"0077" results in "0100", CTRL-X on "0x100" results in "0x0ff".
@ -397,6 +444,10 @@ octal number.
Note that when 'nrformats' includes "octal", decimal numbers with leading
zeros cause mistakes, because they can be confused with octal numbers.
Note similarly, when 'nrformats' includes "bin", binary numbers with a leading
'0x' or '0X' can be interpreted as hexadecimal rather than binary since '0b'
are valid hexadecimal digits.
The CTRL-A command is very useful in a macro. Example: Use the following
steps to make a numbered list.
@ -578,9 +629,9 @@ For MS-Windows: $TMP, $TEMP, $USERPROFILE, current-dir.
may add [flags], see |:s_flags|.
Note that after `:substitute` the '&' flag can't be
used, it's recognized as a pattern separator.
The space between `:substitute` and the 'c', 'g' and
'r' flags isn't required, but in scripts it's a good
idea to keep it to avoid confusion.
The space between `:substitute` and the 'c', 'g',
'i', 'I' and 'r' flags isn't required, but in scripts
it's a good idea to keep it to avoid confusion.
:[range]~[&][flags] [count] *:~*
Repeat last substitute with same substitute string
@ -789,6 +840,36 @@ either the first or second pattern in parentheses did not match, so either
:s/\([ab]\)\|\([cd]\)/\1x/g modifies "a b c d" to "ax bx x x"
<
*:sc* *:sce* *:scg* *:sci* *:scI* *:scl* *:scp* *:sg* *:sgc*
*:sge* *:sgi* *:sgI* *:sgl* *:sgn* *:sgp* *:sgr* *:sI* *:si*
*:sic* *:sIc* *:sie* *:sIe* *:sIg* *:sIl* *:sin* *:sIn* *:sIp*
*:sip* *:sIr* *:sir* *:sr* *:src* *:srg* *:sri* *:srI* *:srl*
*:srn* *:srp*
2-letter and 3-letter :substitute commands ~
List of :substitute commands
| c e g i I n p l r
| c :sc :sce :scg :sci :scI :scn :scp :scl ---
| e
| g :sgc :sge :sg :sgi :sgI :sgn :sgp :sgl :sgr
| i :sic :sie --- :si :siI :sin :sip --- :sir
| I :sIc :sIe :sIg :sIi :sI :sIn :sIp :sIl :sIr
| n
| p
| l
| r :src --- :srg :sri :srI :srn :srp :srl :sr
Exceptions:
:scr is `:scriptnames`
:se is `:set`
:sig is `:sign`
:sil is `:silent`
:sn is `:snext`
:sp is `:split`
:sl is `:sleep`
:sre is `:srewind`
Substitute with an expression *sub-replace-expression*
*sub-replace-\=* *s/\=*
When the substitute string starts with "\=" the remainder is interpreted as an
@ -832,13 +913,13 @@ This replaces each 'E' character with a euro sign. Read more in |<Char->|.
:promptf[ind] [string]
Put up a Search dialog. When [string] is given, it is
used as the initial search string.
{only for Win32, Motif and GTK GUI}
{only for Win32 GUI}
*:promptr* *:promptrepl*
:promptr[epl] [string]
Put up a Search/Replace dialog. When [string] is
given, it is used as the initial search string.
{only for Win32, Motif and GTK GUI}
{only for Win32 GUI}
4.4 Changing tabs *change-tabs*
@ -892,7 +973,7 @@ inside of strings can change! Also see 'softtabstop' option. >
:reg[isters] {arg} Display the contents of the numbered and named
registers that are mentioned in {arg}. For example: >
:dis 1a
:reg 1a
< to display registers '1' and 'a'. Spaces are allowed
in {arg}.
@ -1058,16 +1139,17 @@ Rationale: In Vi the "y" command followed by a backwards motion would
With a linewise yank command the cursor is put in the first line, but the
column is unmodified, thus it may not be on the first yanked character.
There are nine types of registers: *registers* *E354*
There are ten types of registers: *registers* *E354*
1. The unnamed register ""
2. 10 numbered registers "0 to "9
3. The small delete register "-
4. 26 named registers "a to "z or "A to "Z
5. four read-only registers ":, "., "% and "#
6. the expression register "=
7. The selection and drop registers "*, "+ and "~
8. The black hole register "_
9. Last search pattern register "/
5. three read-only registers ":, "., "%
6. alternate buffer register "#
7. the expression register "=
8. The selection and drop registers "*, "+ and "~
9. The black hole register "_
10. Last search pattern register "/
1. Unnamed register "" *quote_quote* *quotequote*
Vim fills this register with text deleted with the "d", "c", "s", "x" commands
@ -1109,7 +1191,7 @@ letters to replace their previous contents or as uppercase letters to append
to their previous contents. When the '>' flag is present in 'cpoptions' then
a line break is inserted before the appended text.
5. Read-only registers ":, "., "% and "#
5. Read-only registers ":, ". and "%
These are '%', '#', ':' and '.'. You can use them only with the "p", "P",
and ":put" commands and with CTRL-R.
*quote_.* *quote.* *E29*
@ -1120,8 +1202,6 @@ and ":put" commands and with CTRL-R.
('textwidth' and other options affect what is inserted).
*quote_%* *quote%*
"% Contains the name of the current file.
*quote_#* *quote#*
"# Contains the name of the alternate file.
*quote_:* *quote:* *E30*
": Contains the most recent executed command-line. Example: Use
"@:" to repeat the previous command-line command.
@ -1129,15 +1209,33 @@ and ":put" commands and with CTRL-R.
one character of it was typed. Thus it remains unchanged if
the command was completely from a mapping.
6. Expression register "= *quote_=* *quote=* *@=*
*quote_#* *quote#*
6. Alternate file register "#
Contains the name of the alternate file for the current window. It will
change how the |CTRL-^| command works.
This register is writable, mainly to allow for restoring it after a plugin has
changed it. It accepts buffer number: >
let altbuf = bufnr(@#)
...
let @# = altbuf
It will give error |E86| if you pass buffer number and this buffer does not
exist.
It can also accept a match with an existing buffer name: >
let @# = 'buffer_name'
Error |E93| if there is more than one buffer matching the given name or |E94|
if none of buffers matches the given name.
7. Expression register "= *quote_=* *quote=* *@=*
This is not really a register that stores text, but is a way to use an
expression in commands which use a register. The expression register is
read-only; you cannot put text into it. After the '=', the cursor moves to
the command-line, where you can enter any expression (see |expression|). All
normal command-line editing commands are available, including a special
history for expressions. When you end the command-line by typing <CR>, Vim
computes the result of the expression. If you end it with <Esc>, Vim abandons
the expression. If you do not enter an expression, Vim uses the previous
read-write.
When typing the '=' after " or CTRL-R the cursor moves to the command-line,
where you can enter any expression (see |expression|). All normal
command-line editing commands are available, including a special history for
expressions. When you end the command-line by typing <CR>, Vim computes the
result of the expression. If you end it with <Esc>, Vim abandons the
expression. If you do not enter an expression, Vim uses the previous
expression (like with the "/" command).
The expression must evaluate to a String. A Number is always automatically
@ -1150,35 +1248,23 @@ If the "= register is used for the "p" command, the String is split up at <NL>
characters. If the String ends in a <NL>, it is regarded as a linewise
register.
7. Selection and drop registers "*, "+ and "~
8. Selection and drop registers "*, "+ and "~
Use these registers for storing and retrieving the selected text for the GUI.
See |quotestar| and |quoteplus|. When the clipboard is not available or not
working, the unnamed register is used instead. For Unix systems and Mac OS X,
see |nvim-clipboard|.
see |primary-selection|.
*quote_~* *quote~* *<Drop>*
The read-only "~ register stores the dropped text from the last drag'n'drop
operation. When something has been dropped onto Vim, the "~ register is
filled in and the <Drop> pseudo key is sent for notification. You can remap
this key if you want; the default action (for all modes) is to insert the
contents of the "~ register at the cursor position.
{only available when compiled with the |+dnd| feature, currently only with the
GTK GUI}
Note: The "~ register is only used when dropping plain text onto Vim.
Drag'n'drop of URI lists is handled internally.
8. Black hole register "_ *quote_*
9. Black hole register "_ *quote_*
When writing to this register, nothing happens. This can be used to delete
text without affecting the normal registers. When reading from this register,
nothing is returned.
9. Last search pattern register "/ *quote_/* *quote/*
10. Last search pattern register "/ *quote_/* *quote/*
Contains the most recent search-pattern. This is used for "n" and 'hlsearch'.
It is writable with `:let`, you can change it to have 'hlsearch' highlight
other matches without actually searching. You can't yank or delete into this
register. The search direction is available in |v:searchforward|.
Note that the valued is restored when returning from a function
Note that the value is restored when returning from a function
|function-search-undo|.
*@/*
@ -1390,10 +1476,10 @@ When you hit Return in a C-comment, Vim will insert the middle comment leader
for the new line: " * ". To close this comment you just have to type "/"
before typing anything else on the new line. This will replace the
middle-comment leader with the end-comment leader and apply any specified
alignment, leaving just " */". There is no need to hit BackSpace first.
alignment, leaving just " */". There is no need to hit Backspace first.
When there is a match with a middle part, but there also is a maching end part
which is longer, the end part is used. This makes a C style comment work
When there is a match with a middle part, but there also is a matching end
part which is longer, the end part is used. This makes a C style comment work
without requiring the middle part to end with a space.
Here is an example of alignment flags at work to make a comment stand out
@ -1597,7 +1683,7 @@ Vim has a sorting function and a sorting command. The sorting function can be
found here: |sort()|, |uniq()|.
*:sor* *:sort*
:[range]sor[t][!] [i][u][r][n][x][o] [/{pattern}/]
:[range]sor[t][!] [b][f][i][n][o][r][u][x] [/{pattern}/]
Sort lines in [range]. When no range is given all
lines are sorted.
@ -1605,10 +1691,18 @@ found here: |sort()|, |uniq()|.
With [i] case is ignored.
Options [n][f][x][o][b] are mutually exclusive.
With [n] sorting is done on the first decimal number
in the line (after or inside a {pattern} match).
One leading '-' is included in the number.
With [f] sorting is done on the Float in the line.
The value of Float is determined similar to passing
the text (after or inside a {pattern} match) to
str2float() function. This option is available only
if Vim was compiled with Floating point support.
With [x] sorting is done on the first hexadecimal
number in the line (after or inside a {pattern}
match). A leading "0x" or "0X" is ignored.
@ -1617,10 +1711,13 @@ found here: |sort()|, |uniq()|.
With [o] sorting is done on the first octal number in
the line (after or inside a {pattern} match).
With [u] only keep the first of a sequence of
identical lines (ignoring case when [i] is used).
Without this flag, a sequence of identical lines
will be kept in their original order.
With [b] sorting is done on the first binary number in
the line (after or inside a {pattern} match).
With [u] (u stands for unique) only keep the first of
a sequence of identical lines (ignoring case when [i]
is used). Without this flag, a sequence of identical
lines will be kept in their original order.
Note that leading and trailing white space may cause
lines to be different.

View File

@ -1,4 +1,4 @@
*cmdline.txt* For Vim version 7.4. Last change: 2014 Sep 06
*cmdline.txt* For Vim version 7.4. Last change: 2015 Dec 17
VIM REFERENCE MANUAL by Bram Moolenaar
@ -97,6 +97,11 @@ CTRL-E or <End> *c_CTRL-E* *c_<End>* *c_End*
*c_<LeftMouse>*
<LeftMouse> Move the cursor to the position of the mouse click.
*c_<MiddleMouse>*
<MiddleMouse> Paste the contents of the clipboard (for X11 the primary
selection). This is similar to using CTRL-R *, but no CR
characters are inserted between lines.
CTRL-H *c_<BS>* *c_CTRL-H* *c_BS*
<BS> Delete the character in front of the cursor.
*c_<Del>* *c_Del*
@ -379,7 +384,7 @@ CTRL-N After using 'wildchar' which got multiple matches, go to next
<S-Tab> *c_CTRL-P* *c_<S-Tab>*
CTRL-P After using 'wildchar' which got multiple matches, go to
previous match. Otherwise recall older command-line from
history. <S-Tab> only works with the GUI and with MS-DOS.
history. <S-Tab> only works with the GUI.
*c_CTRL-A*
CTRL-A All names that match the pattern in front of the cursor are
inserted.
@ -482,6 +487,8 @@ followed by another Vim command:
:argdo
:autocmd
:bufdo
:cdo
:cfdo
:command
:cscope
:debug
@ -490,8 +497,9 @@ followed by another Vim command:
:function
:global
:help
:helpfind
:lcscope
:ldo
:lfdo
:make
:normal
:promptfind
@ -562,6 +570,7 @@ starts editing the three files "foo bar", "goes to" and "school ".
When you want to use the special characters '"' or '|' in a command, or want
to use '%' or '#' in a file name, precede them with a backslash. The
backslash is not required in a range and in the ":substitute" command.
See also |`=|.
*:_!*
The '!' (bang) character after an Ex command makes the command behave in a
@ -711,13 +720,13 @@ to insert special things while typing you can use the CTRL-R command. For
example, "%" stands for the current file name, while CTRL-R % inserts the
current file name right away. See |c_CTRL-R|.
Note: If you want to avoid the special characters in a Vim script you may want
to use |fnameescape()|.
Note: If you want to avoid the effects of special characters in a Vim script
you may want to use |fnameescape()|. Also see |`=|.
In Ex commands, at places where a file name can be used, the following
characters have a special meaning. These can also be used in the expression
function expand() |expand()|.
function |expand()|.
% Is replaced with the current file name. *:_%* *c_%*
# Is replaced with the alternate file name. *:_#* *c_#*
This is remembered for every window.
@ -752,6 +761,7 @@ it, no matter how many backslashes.
# alternate.file
\# #
\\# \#
Also see |`=|.
*:<cword>* *:<cWORD>* *:<cfile>* *<cfile>*
*:<sfile>* *<sfile>* *:<afile>* *<afile>*
@ -773,13 +783,13 @@ Note: these are typed literally, they are not special keys!
<afile> only when the file name isn't used to match with
(for FileType, Syntax and SpellFileMissing events).
<sfile> When executing a ":source" command, is replaced with the
file name of the sourced file. *E498*
When executing a function, is replaced with
"function {function-name}"; function call nesting is
indicated like this:
"function {function-name1}..{function-name2}". Note that
filename-modifiers are useless when <sfile> is used inside
a function.
file name of the sourced file. *E498*
When executing a function, is replaced with:
"function {function-name}[{lnum}]"
function call nesting is indicated like this:
"function {function-name1}[{lnum}]..{function-name2}[{lnum}]"
Note that filename-modifiers are useless when <sfile> is
used inside a function.
<slnum> When executing a ":source" command, is replaced with the
line number. *E842*
When executing a function it's the line number relative to
@ -816,7 +826,7 @@ These modifiers can be given, in this order:
separator is removed. Thus ":p:h" on a directory name results
on the directory name itself (without trailing slash).
When the file name is an absolute path (starts with "/" for
Unix; "x:\" for MS-DOS and WIN32), that part is not removed.
Unix; "x:\" for Windows), that part is not removed.
When there is no head (path is relative to current directory)
the result is empty.
:t Tail of the file name (last component of the name). Must
@ -841,7 +851,7 @@ These modifiers can be given, in this order:
:gs?pat?sub?
Substitute all occurrences of "pat" with "sub". Otherwise
this works like ":s".
:S Escape special characters for use with a shell command (see
:S Escape special characters for use with a shell command (see
|shellescape()|). Must be the last one. Examples: >
:!dir <cfile>:S
:call system('chmod +w -- ' . expand('%:S'))
@ -894,9 +904,8 @@ name). This is included for backwards compatibility with version 3.0, the
Note: Where a file name is expected wildcards expansion is done. On Unix the
shell is used for this, unless it can be done internally (for speed).
Backticks also work, like in >
Unless in |restricted-mode|, backticks work also, like in >
:n `echo *.c`
(backtick expansion is not possible in |restricted-mode|)
But expansion is only done if there are any wildcards before expanding the
'%', '#', etc.. This avoids expanding wildcards inside a file name. If you
want to expand the result of <cfile>, add a wildcard character to it.
@ -907,6 +916,7 @@ Examples: (alternate file name is "?readme?")
:e #.* :e {files matching "?readme?.*"}
:cd <cfile> :cd {file name under cursor}
:cd <cfile>* :cd {file name under cursor plus "*" and then expanded}
Also see |`=|.
When the expanded argument contains a "!" and it is used for a shell command
(":!cmd", ":r !cmd" or ":w !cmd"), the "!" is escaped with a backslash to
@ -915,8 +925,8 @@ option contains "sh", this is done twice, to avoid the shell trying to expand
the "!".
*filename-backslash*
For filesystems that use a backslash as directory separator (MS-DOS and
Windows), it's a bit difficult to recognize a backslash that is used
For filesystems that use a backslash as directory separator (Windows
filesystems), it's a bit difficult to recognize a backslash that is used
to escape the special meaning of the next character. The general rule is: If
the backslash is followed by a normal file name character, it does not have a
special meaning. Therefore "\file\foo" is a valid file name, you don't have
@ -933,6 +943,8 @@ for the file "$home" in the root directory. A few examples:
/\$home file "$home" in root directory
\\$home file "\\", followed by expanded $home
Also see |`=|.
==============================================================================
7. Command-line window *cmdline-window* *cmdwin*
*command-line-window*

View File

@ -1,107 +0,0 @@
*debugger.txt* For Vim version 7.4. Last change: 2005 Mar 29
VIM REFERENCE MANUAL by Gordon Prieur
Debugger Support Features *debugger-support*
1. Debugger Features |debugger-features|
==============================================================================
1. Debugger Features *debugger-features*
The following features are available for an integration with a debugger or
an Integrated Programming Environment (IPE) or Integrated Development
Environment (IDE):
Alternate Command Input |alt-input|
Debug Signs |debug-signs|
Debug Source Highlight |debug-highlight|
Message Footer |gui-footer|
Balloon Evaluation |balloon-eval|
These features were added specifically for use in the Motif version of gvim.
However, the |alt-input| and |debug-highlight| were written to be usable in
both vim and gvim. Some of the other features could be used in the non-GUI
vim with slight modifications. However, I did not do this nor did I test the
reliability of building for vim or non Motif GUI versions.
1.1 Alternate Command Input *alt-input*
For Vim to work with a debugger there must be at least an input connection
with a debugger or external tool. In many cases there will also be an output
connection but this isn't absolutely necessary.
The purpose of the input connection is to let the external debugger send
commands to Vim. The commands sent by the debugger should give the debugger
enough control to display the current debug environment and state.
The current implementation is based on the X Toolkit dispatch loop and the
XtAddInput() function call.
1.2 Debug Signs *debug-signs*
Many debuggers mark specific lines by placing a small sign or color highlight
on the line. The |:sign| command lets the debugger set this graphic mark. Some
examples where this feature would be used would be a debugger showing an arrow
representing the Program Counter (PC) of the program being debugged. Another
example would be a small stop sign for a line with a breakpoint. These visible
highlights let the user keep track of certain parts of the state of the
debugger.
This feature can be used with more than debuggers, too. An IPE can use a sign
to highlight build errors, searched text, or other things. The sign feature
can also work together with the |debug-highlight| to ensure the mark is
highly visible.
Debug signs are defined and placed using the |:sign| command.
1.3 Debug Source Highlight *debug-highlight*
This feature allows a line to have a predominant highlight. The highlight is
intended to make a specific line stand out. The highlight could be made to
work for both vim and gvim, whereas the debug sign is, in most cases, limited
to gvim. The one exception to this is Sun Microsystem's dtterm. The dtterm
from Sun has a "sign gutter" for showing signs.
1.4 Message Footer *gui-footer*
The message footer can be used to display messages from a debugger or IPE. It
can also be used to display menu and toolbar tips. The footer area is at the
bottom of the GUI window, below the line used to display colon commands.
The display of the footer is controlled by the 'guioptions' letter 'F'.
1.5 Balloon Evaluation *balloon-eval*
This feature allows a debugger, or other external tool, to display dynamic
information based on where the mouse is pointing. The purpose of this feature
was to allow Sun's Visual WorkShop debugger to display expression evaluations.
However, the feature was implemented in as general a manner as possible and
could be used for displaying other information as well.
The Balloon Evaluation has some settable parameters too. For Motif the font
list and colors can be set via X resources (XmNballoonEvalFontList,
XmNballoonEvalBackground, and XmNballoonEvalForeground).
The 'balloondelay' option sets the delay before an attempt is made to show a
balloon.
The 'ballooneval' option needs to be set to switch it on.
Balloon evaluation is only available when compiled with the |+balloon_eval|
feature.
The Balloon evaluation functions are also used to show a tooltip for the
toolbar. The 'ballooneval' option does not need to be set for this. But the
other settings apply.
Another way to use the balloon is with the 'balloonexpr' option. This is
completely user definable.
==============================================================================
vim:tw=78:sw=4:ts=8:ft=help:norl:

View File

@ -0,0 +1,48 @@
*deprecated.txt* {Nvim}
NVIM REFERENCE MANUAL
Nvim *deprecated*
The items listed below are "deprecated". This means they will be removed in
the future. They should not be used in new scripts, and old scripts should be
updated.
==============================================================================
Normal commands ~
*]f*
*[f* Same as "gf".
Commands ~
*:rv*
*:rviminfo* Deprecated alias to |:rshada| command.
*:wv*
*:wviminfo* Deprecated alias to |:wshada| command.
Events ~
*EncodingChanged* Never fired; 'encoding' is always "utf-8".
*FileEncoding* Never fired; equivalent to |EncodingChanged|.
Highlight groups ~
*hl-VisualNOS* Obsolete. |vim-differences| {Nvim}
Functions ~
*buffer_exists()* Obsolete name for |bufexists()|.
*buffer_name()* Obsolete name for |bufname()|.
*buffer_number()* Obsolete name for |bufnr()|.
*file_readable()* Obsolete name for |filereadable()|.
*highlight_exists()* Obsolete name for |hlexists()|.
*highlightID()* Obsolete name for |hlID()|.
*last_buffer_nr()* Obsolete name for bufnr("$").
Options ~
*'fe'* 'fenc'+'enc' before Vim 6.0; no longer used.
*'vi'*
*'viminfo'* Deprecated alias to 'shada' option.
vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,23 +1,19 @@
*develop.txt* For Vim version 7.4. Last change: 2014 Mar 27
*develop.txt*
VIM REFERENCE MANUAL by Bram Moolenaar
NVIM REFERENCE MANUAL
Development of Vim. *development*
This text is important for those who want to be involved in further developing
Vim.
Development of Nvim. *development*
1. Design goals |design-goals|
2. Design decisions |design-decisions|
See the file "src/nvim/README.md" for a high-level overview of the source
code.
Nvim is open source software. Everybody is encouraged to contribute.
https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md
Vim is open source software. Everybody is encouraged to contribute to help
improving Vim. For sending patches a context diff "diff -c" is preferred.
Also see http://vim.wikia.com/wiki/How_to_make_and_submit_a_patch.
See src/nvim/README.md for a high-level overview of the source code:
https://github.com/neovim/neovim/blob/master/src/nvim/README.md
==============================================================================
1. Design goals *design-goals*
@ -28,7 +24,7 @@ Note that quite a few items are contradicting. This is intentional. A
balance must be found between them.
VIM IS... IMPROVED *design-improved*
NVIM IS... IMPROVED *design-improved*
The IMproved bits of Vim should make it a better Vi, without becoming a
completely different editor. Extensions are done with a "Vi spirit".
@ -49,7 +45,7 @@ completely different editor. Extensions are done with a "Vi spirit".
implement and (3) someone actually implementing it.
VIM IS... MULTI PLATFORM *design-multi-platform*
NVIM IS... MULTI PLATFORM *design-multi-platform*
Vim tries to help as many users on as many platforms as possible.
- Support many kinds of terminals. The minimal demands are cursor positioning
@ -68,7 +64,7 @@ Vim tries to help as many users on as many platforms as possible.
contradicts the previous item, these two must be balanced.]
VIM IS... WELL DOCUMENTED *design-documented*
NVIM IS... WELL DOCUMENTED *design-documented*
- A feature that isn't documented is a useless feature. A patch for a new
feature must include the documentation.
@ -76,9 +72,14 @@ VIM IS... WELL DOCUMENTED *design-documented*
recommended.
- Don't make the text unnecessarily long. Less documentation means that an
item is easier to find.
- Do not prefix doc-tags with "nvim-". Use |vim_diff.txt| to document
differences from Vim. The {Nvim} annotation is also available
to mark a specific feature. No other distinction is necessary.
- If a feature is removed, delete its doc entry and move its tag to
|vim_diff.txt|.
VIM IS... HIGH SPEED AND SMALL IN SIZE *design-speed-size*
NVIM IS... HIGH SPEED AND SMALL IN SIZE *design-speed-size*
Using Vim must not be a big attack on system resources. Keep it small and
fast.
@ -89,13 +90,11 @@ fast.
possible. Useful commands may take longer.
- Don't forget that some people use Vim over a slow connection. Minimize the
communication overhead.
- Items that add considerably to the size and are not used by many people
should be a feature that can be disabled.
- Vim is a component among other components. Don't turn it into a massive
application, but have it work well together with other programs.
VIM IS... MAINTAINABLE *design-maintain*
NVIM IS... MAINTAINABLE *design-maintain*
- The source code should not become a mess. It should be reliable code.
- Use comments in a useful way! Quoting the function name and argument names
@ -106,7 +105,7 @@ VIM IS... MAINTAINABLE *design-maintain*
knowledge spread to other parts of the code.
VIM IS... FLEXIBLE *design-flexible*
NVIM IS... FLEXIBLE *design-flexible*
Vim should make it easy for users to work in their preferred styles rather
than coercing its users into particular patterns of work. This can be for
@ -117,28 +116,35 @@ be used to adjust Vim to the desire of the user and its environment.
NVIM IS... NOT *design-not*
Nvim is not an Operating System; instead it should be composed with other
tools, or hosted as a component. Marvim once said: "Unlike Emacs, Nvim does
not attempt to include everything but the kitchen sink, but some people use it
for plumbing."
Nvim is not an operating system; instead it should be composed with other
tools or hosted as a component. Marvim once said: "Unlike Emacs, Nvim does not
include the kitchen sink... but you can use it for plumbing."
==============================================================================
2. Design decisions *design-decisions*
Folding
JARGON *dev-jargon*
Several forms of folding should be possible for the same buffer. For example,
have one window that shows the text with function bodies folded, another
window that shows a function body.
API client ~
All external UIs and remote plugins (as opposed to regular Vim plugins) are
"clients" in general; but we call something an "API client" if its purpose is
to abstract or wrap the RPC API for the convenience of other applications
(just like a REST client or SDK such as boto3 for AWS: you can speak AWS REST
using an HTTP client like curl, but boto3 wraps that in a convenient python
interface). For example, the Nvim lua-client is an API client:
https://github.com/neovim/lua-client
Folding is a way to display the text. It should not change the text itself.
Therefore the folding has been implemented as a filter between the text stored
in a buffer (buffer lines) and the text displayed in a window (logical lines).
Host ~
A plugin "host" is both a client (of the Nvim API) and a server (of an
external platform, e.g. python). It is a remote plugin that hosts other
plugins.
Remote plugin ~
Arbitrary code registered via |:UpdateRemotePlugins|, that runs in a separate
process and communicates with Nvim via the |api|.
Naming the window
Window ~
The word "window" is commonly used for several things: A window on the screen,
the xterm window, a window inside Vim to view a buffer.
To avoid confusion, other items that are sometimes called window have been
@ -152,111 +158,79 @@ window View on a buffer. There can be several windows in Vim,
together with the command line, menubar, toolbar, etc. they
fit in the shell.
PROVIDERS *dev-provider*
Spell checking *develop-spell*
A goal of Nvim is to allow extension of the editor without special knowledge
in the core. But some Vim components are too tightly coupled; in those cases
a "provider" hook is exposed.
When spell checking was going to be added to Vim a survey was done over the
available spell checking libraries and programs. Unfortunately, the result
was that none of them provided sufficient capabilities to be used as the spell
checking engine in Vim, for various reasons:
Consider two examples of integration with external systems that are
implemented in Vim and are now decoupled from Nvim core as providers:
- Missing support for multi-byte encodings. At least UTF-8 must be supported,
so that more than one language can be used in the same file.
Doing on-the-fly conversion is not always possible (would require iconv
support).
- For the programs and libraries: Using them as-is would require installing
them separately from Vim. That's mostly not impossible, but a drawback.
- Performance: A few tests showed that it's possible to check spelling on the
fly (while redrawing), just like syntax highlighting. But the mechanisms
used by other code are much slower. Myspell uses a hashtable, for example.
The affix compression that most spell checkers use makes it slower too.
- For using an external program like aspell a communication mechanism would
have to be setup. That's complicated to do in a portable way (Unix-only
would be relatively simple, but that's not good enough). And performance
will become a problem (lots of process switching involved).
- Missing support for words with non-word characters, such as "Etten-Leur" and
"et al.", would require marking the pieces of them OK, lowering the
reliability.
- Missing support for regions or dialects. Makes it difficult to accept
all English words and highlight non-Canadian words differently.
- Missing support for rare words. Many words are correct but hardly ever used
and could be a misspelled often-used word.
- For making suggestions the speed is less important and requiring to install
another program or library would be acceptable. But the word lists probably
differ, the suggestions may be wrong words.
1. In the Vim source code, clipboard logic accounts for more than 1k lines of
C source code (ui.c), to perform two tasks that are now accomplished with
shell commands such as xclip or pbcopy/pbpaste.
2. Python scripting support: Vim has three files dedicated to embedding the
Python interpreter: if_python.c, if_python3.c and if_py_both.h. Together
these files sum about 9.5k lines of C source code. In contrast, Nvim Python
scripting is performed by an external host process implemented in ~2k lines
of Python.
Ideally we could implement Python and clipboard integration in pure vimscript
and without touching the C code. But this is infeasible without compromising
backwards compatibility with Vim; that's where providers help.
The provider framework helps call vimscript from C. It is composed of two
functions in eval.c:
- eval_call_provider(name, method, arguments): calls provider#(name)#Call
with the method and arguments.
- eval_has_provider(name): Checks if a provider is implemented. Returns true
if the provider#(name)#Call function is implemented. Called by |has()|
(vimscript) to check if features are available.
The provider#(name)#Call function implements integration with an external
system, because shell commands and |RPC| clients are easier to work with in
vimscript.
For example, the Python provider is implemented by the
autoload/provider/python.vim script; the provider#python#Call function is only
defined if a valid external Python host is found. That works well with the
`has('python')` expression (normally used by Python plugins) because if the
Python host isn't installed then the plugin will "think" it is running in
a Vim compiled without the |+python| feature.
Spelling suggestions *develop-spell-suggestions*
API *dev-api*
For making suggestions there are two basic mechanisms:
1. Try changing the bad word a little bit and check for a match with a good
word. Or go through the list of good words, change them a little bit and
check for a match with the bad word. The changes are deleting a character,
inserting a character, swapping two characters, etc.
2. Perform soundfolding on both the bad word and the good words and then find
matches, possibly with a few changes like with the first mechanism.
Use this pattern to name new API functions:
nvim_{thing}_{action}_{arbitrary-qualifiers}
The first is good for finding typing mistakes. After experimenting with
hashtables and looking at solutions from other spell checkers the conclusion
was that a trie (a kind of tree structure) is ideal for this. Both for
reducing memory use and being able to try sensible changes. For example, when
inserting a character only characters that lead to good words need to be
tried. Other mechanisms (with hashtables) need to try all possible letters at
every position in the word. Also, a hashtable has the requirement that word
boundaries are identified separately, while a trie does not require this.
That makes the mechanism a lot simpler.
If the function acts on an object then {thing} is the name of that object
(e.g. "buf" or "win"). If the function operates in a "global" context then
{thing} is usually omitted (but consider "namespacing" your global operations
with a {thing} that groups functions under a common concept).
Soundfolding is useful when someone knows how the words sounds but doesn't
know how it is spelled. For example, the word "dictionary" might be written
as "daktonerie". The number of changes that the first method would need to
try is very big, it's hard to find the good word that way. After soundfolding
the words become "tktnr" and "tkxnry", these differ by only two letters.
Use existing common {action} names if possible:
add Append to, or insert into, a collection
get Get a thing (or subset of things by some query)
set Set a thing
del Delete a thing (or group of things)
list Get all things
To find words by their soundfolded equivalent (soundalike word) we need a list
of all soundfolded words. A few experiments have been done to find out what
the best method is. Alternatives:
1. Do the sound folding on the fly when looking for suggestions. This means
walking through the trie of good words, soundfolding each word and
checking how different it is from the bad word. This is very efficient for
memory use, but takes a long time. On a fast PC it takes a couple of
seconds for English, which can be acceptable for interactive use. But for
some languages it takes more than ten seconds (e.g., German, Catalan),
which is unacceptable slow. For batch processing (automatic corrections)
it's too slow for all languages.
2. Use a trie for the soundfolded words, so that searching can be done just
like how it works without soundfolding. This requires remembering a list
of good words for each soundfolded word. This makes finding matches very
fast but requires quite a lot of memory, in the order of 1 to 10 Mbyte.
For some languages more than the original word list.
3. Like the second alternative, but reduce the amount of memory by using affix
compression and store only the soundfolded basic word. This is what Aspell
does. Disadvantage is that affixes need to be stripped from the bad word
before soundfolding it, which means that mistakes at the start and/or end
of the word will cause the mechanism to fail. Also, this becomes slow when
the bad word is quite different from the good word.
Use consistent names for {thing} in all API functions. E.g. a buffer is called
"buf" everywhere, not "buffer" in some places and "buf" in others.
The choice made is to use the second mechanism and use a separate file. This
way a user with sufficient memory can get very good suggestions while a user
who is short of memory or just wants the spell checking and no suggestions
doesn't use so much memory.
Example: `nvim_get_current_line` acts on the global editor state; the common
{action} "get" is used but {thing} is omitted.
Example: `nvim_buf_add_highlight` acts on a `Buffer` object (the first
parameter) and uses the common {action} "add".
Word frequency
Example: `nvim_list_bufs` operates in a global context (first parameter is
_not_ a Buffer). The common {action} "list" indicates that it lists all
bufs (plural) in the global context.
For sorting suggestions it helps to know which words are common. In theory we
could store a word frequency with the word in the dictionary. However, this
requires storing a count per word. That degrades word tree compression a lot.
And maintaining the word frequency for all languages will be a heavy task.
Also, it would be nice to prefer words that are already in the text. This way
the words that appear in the specific text are preferred for suggestions.
What has been implemented is to count words that have been seen during
displaying. A hashtable is used to quickly find the word count. The count is
initialized from words listed in COMMON items in the affix file, so that it
also works when starting a new file.
This isn't ideal, because the longer Vim is running the higher the counts
become. But in practice it is a noticeable improvement over not using the word
count.
vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,4 +1,4 @@
*diff.txt* For Vim version 7.4. Last change: 2015 Jan 19
*diff.txt* For Vim version 7.4. Last change: 2015 Nov 01
VIM REFERENCE MANUAL by Bram Moolenaar
@ -124,8 +124,9 @@ file for a moment and come back to the same file and be in diff mode again.
if the current window does not have 'diff' set then no options
in it are changed.
The ":diffoff" command resets the relevant options to the values they had when
using |:diffsplit|, |:diffpatch| , |:diffthis|. or starting Vim in diff mode.
The `:diffoff` command resets the relevant options to the values they had when
using `:diffsplit`, `:diffpatch` , `:diffthis`. or starting Vim in diff mode.
When using `:diffoff` twice the last saved values are restored.
Otherwise they are set to their default value:
'diff' off
@ -173,8 +174,8 @@ hidden buffers. You can use ":hide" to close a window without unloading the
buffer. If you don't want a buffer to remain used for the diff do ":set
nodiff" before hiding it.
*:diffu* *:diffupdate*
:diffu[pdate][!] Update the diff highlighting and folds.
*:dif* *:diffupdate*
:dif[fupdate][!] Update the diff highlighting and folds.
Vim attempts to keep the differences updated when you make changes to the
text. This mostly takes care of inserted and deleted lines. Changes within a
@ -306,6 +307,19 @@ name or a part of a buffer name. Examples:
Also see |'diffopt'| and the "diff" item of |'fillchars'|.
*diff-slow* *diff_translations*
For very long lines, the diff syntax highlighting might be slow, especially
since it tries to match all different kind of localisations. To disable
localisations and speed up the syntax highlighting, set the global variable
g:diff_translations to zero: >
let g:diff_translations = 0
<
After setting this variable, Reload the syntax script: >
set syntax=diff
<
FINDING THE DIFFERENCES *diff-diffexpr*

View File

@ -1,83 +0,0 @@
/* vim:set ts=4 sw=4:
* this program makes a tags file for vim_ref.txt
*
* Usage: doctags vim_ref.txt vim_win.txt ... >tags
*
* A tag in this context is an identifier between stars, e.g. *c_files*
*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#define LINELEN 200
int
main(argc, argv)
int argc;
char **argv;
{
char line[LINELEN];
char *p1, *p2;
char *p;
FILE *fd;
if (argc <= 1)
{
fprintf(stderr, "Usage: doctags docfile ... >tags\n");
exit(1);
}
printf("help-tags\ttags\t1\n");
while (--argc > 0)
{
++argv;
fd = fopen(argv[0], "r");
if (fd == NULL)
{
fprintf(stderr, "Unable to open %s for reading\n", argv[0]);
continue;
}
while (fgets(line, LINELEN, fd) != NULL)
{
p1 = strchr(line, '*'); /* find first '*' */
while (p1 != NULL)
{
p2 = strchr(p1 + 1, '*'); /* find second '*' */
if (p2 != NULL && p2 > p1 + 1) /* skip "*" and "**" */
{
for (p = p1 + 1; p < p2; ++p)
if (*p == ' ' || *p == '\t' || *p == '|')
break;
/*
* Only accept a *tag* when it consists of valid
* characters, there is white space before it and is
* followed by a white character or end-of-line.
*/
if (p == p2
&& (p1 == line || p1[-1] == ' ' || p1[-1] == '\t')
&& (strchr(" \t\n\r", p[1]) != NULL
|| p[1] == '\0'))
{
*p2 = '\0';
++p1;
printf("%s\t%s\t/*", p1, argv[0]);
while (*p1)
{
/* insert backslash before '\\' and '/' */
if (*p1 == '\\' || *p1 == '/')
putchar('\\');
putchar(*p1);
++p1;
}
printf("*\n");
p2 = strchr(p2 + 1, '*'); /* find next '*' */
}
}
p1 = p2;
}
}
fclose(fd);
}
return 0;
}

View File

@ -1,4 +1,4 @@
*editing.txt* For Vim version 7.4. Last change: 2015 Apr 18
*editing.txt* For Vim version 7.4. Last change: 2016 Mar 28
VIM REFERENCE MANUAL by Bram Moolenaar
@ -77,7 +77,8 @@ g CTRL-G Prints the current position of the cursor in five
than one position on the screen (<Tab> or special
character), both the "real" column and the screen
column are shown, separated with a dash.
See also 'ruler' option.
Also see the 'ruler' option and the |wordcount()|
function.
*v_g_CTRL-G*
{Visual}g CTRL-G Similar to "g CTRL-G", but Word, Character, Line, and
@ -130,9 +131,7 @@ You can use this file if you discover that you need the original file. See
also the 'patchmode' option. The name of the backup file is normally the same
as the original file with 'backupext' appended. The default "~" is a bit
strange to avoid accidentally overwriting existing files. If you prefer ".bak"
change the 'backupext' option. Extra dots are replaced with '_' on MS-DOS
machines, when Vim has detected that an MS-DOS-like filesystem is being used
(e.g., messydos or crossdos). The backup file can be placed in another
change the 'backupext' option. The backup file can be placed in another
directory by setting 'backupdir'.
When you started editing without giving a file name, "No File" is displayed in
@ -268,15 +267,13 @@ CTRL-^ Edit the alternate file. Mostly the alternate file is
files.
See |CTRL-^| above for further details.
[count]]f *]f* *[f*
[count][f Same as "gf". Deprecated.
*gf* *E446* *E447*
[count]gf Edit the file whose name is under or after the cursor.
Mnemonic: "goto file".
Uses the 'isfname' option to find out which characters
are supposed to be in a file name. Trailing
punctuation characters ".,:;!" are ignored.
punctuation characters ".,:;!" are ignored. Escaped
spaces "\ " are reduced to a single space.
Uses the 'path' option as a list of directory names to
look for the file. See the 'path' option for details
about relative directories and wildcards.
@ -358,7 +355,7 @@ These are the common ones:
To avoid the special meaning of the wildcards prepend a backslash. However,
on MS-Windows the backslash is a path separator and "path\[abc]" is still seen
as a wildcard when "[" is in the 'isfname' option. A simple way to avoid this
is to use "path\[[]abc]". Then the file "path[abc]" literally.
is to use "path\[[]abc]", this matches the file "path\[abc]".
*starstar-wildcard*
Expanding "**" is possible on Unix, Win32, Mac OS/X and a few other systems.
@ -368,36 +365,54 @@ Note there are some commands where this works slightly differently, see
Example: >
:n **/*.txt
Finds files:
ttt.txt
subdir/ttt.txt
a/b/c/d/ttt.txt
When non-wildcard characters are used these are only matched in the first
directory. Example: >
:n /usr/inc**/*.h
aaa.txt ~
subdir/bbb.txt ~
a/b/c/d/ccc.txt ~
When non-wildcard characters are used right before or after "**" these are
only matched in the top directory. They are not used for directories further
down in the tree. For example: >
:n /usr/inc**/types.h
Finds files:
/usr/include/types.h
/usr/include/sys/types.h
/usr/inc_old/types.h
/usr/include/types.h ~
/usr/include/sys/types.h ~
/usr/inc/old/types.h ~
Note that the path with "/sys" is included because it does not need to match
"/inc". Thus it's like matching "/usr/inc*/*/*...", not
"/usr/inc*/inc*/inc*".
*backtick-expansion* *`-expansion*
On Unix and a few other systems you can also use backticks in the file name,
for example: >
:e `find . -name ver\\*.c -print`
The backslashes before the star are required to prevent "ver*.c" to be
expanded by the shell before executing the find program.
On Unix and a few other systems you can also use backticks for the file name
argument, for example: >
:next `find . -name ver\\*.c -print`
:view `ls -t *.patch \| head -n1`
The backslashes before the star are required to prevent the shell from
expanding "ver*.c" prior to execution of the find program. The backslash
before the shell pipe symbol "|" prevents Vim from parsing it as command
termination.
This also works for most other systems, with the restriction that the
backticks must be around the whole item. It is not possible to have text
directly before the first or just after the last backtick.
*`=*
You can have the backticks expanded as a Vim expression, instead of an
external command, by using the syntax `={expr}` e.g.: >
You can have the backticks expanded as a Vim expression, instead of as an
external command, by putting an equal sign right after the first backtick,
e.g.: >
:e `=tempname()`
The expression can contain just about anything, thus this can also be used to
avoid the special meaning of '"', '|', '%' and '#'. However, 'wildignore'
does apply like to other wildcards.
Environment variables in the expression are expanded when evaluating the
expression, thus this works: >
:e `=$HOME . '/.vimrc'`
This does not work, $HOME is inside a string and used literally: >
:e `='$HOME' . '/.vimrc'`
If the expression returns a string then names are to be separated with line
breaks. When the result is a |List| then each item is used as a name. Line
breaks also separate names.
Note that such expressions are only supported in places where a filename is
expected as an argument to an Ex-command.
*++opt* *[++opt]*
The [++opt] argument can be used to force the value of 'fileformat',
@ -470,9 +485,9 @@ The 'fileformat' option sets the <EOL> style for a file:
"mac" <CR> Mac format *Mac-format*
When reading a file, the mentioned characters are interpreted as the <EOL>.
In DOS format (default for MS-DOS and Win32), <CR><NL> and <NL> are both
interpreted as the <EOL>. Note that when writing the file in DOS format,
<CR> characters will be added for each single <NL>. Also see |file-read|.
In DOS format (default for Windows), <CR><NL> and <NL> are both interpreted as
the <EOL>. Note that when writing the file in DOS format, <CR> characters will
be added for each single <NL>. Also see |file-read|.
When writing a file, the mentioned characters are used for <EOL>. For DOS
format <CR><NL> is used. Also see |DOS-format-write|.
@ -493,13 +508,13 @@ If you start editing a new file and the 'fileformats' option is not empty
(which is the default), Vim will try to detect whether the lines in the file
are separated by the specified formats. When set to "unix,dos", Vim will
check for lines with a single <NL> (as used on Unix) or by a <CR><NL> pair
(MS-DOS). Only when ALL lines end in <CR><NL>, 'fileformat' is set to "dos",
(Windows). Only when ALL lines end in <CR><NL>, 'fileformat' is set to "dos",
otherwise it is set to "unix". When 'fileformats' includes "mac", and no <NL>
characters are found in the file, 'fileformat' is set to "mac".
If the 'fileformat' option is set to "dos" on non-MS-DOS systems the message
If the 'fileformat' option is set to "dos" on non-Windows systems the message
"[dos format]" is shown to remind you that something unusual is happening. On
MS-DOS systems you get the message "[unix format]" if 'fileformat' is set to
Windows systems you get the message "[unix format]" if 'fileformat' is set to
"unix". On all systems but the Macintosh you get the message "[mac format]"
if 'fileformat' is set to "mac".
@ -583,6 +598,7 @@ list of the current window.
:0argadd x x a b c
:1argadd x a x b c
:$argadd x a b c x
And after the last one:
:+2argadd y a b c x y
There is no check for duplicates, it is possible to
add a file to the argument list twice.
@ -795,7 +811,8 @@ USING THE ARGUMENT LIST
autocommand event is disabled by adding it to
'eventignore'. This considerably speeds up editing
each file.
Also see |:windo|, |:tabdo| and |:bufdo|.
Also see |:windo|, |:tabdo|, |:bufdo|, |:cdo|, |:ldo|,
|:cfdo| and |:lfdo|.
Example: >
:args *.c
@ -932,7 +949,7 @@ the newly written file (it might be there but contain bogus data). In that
case try recovery, because the swap file is synced to disk and might still be
there. |:recover|
The directories given with the 'backupdir' option is used to put the backup
The directories given with the 'backupdir' option are used to put the backup
file in. (default: same directory as the written file).
Whether the backup is a new file, which is a copy of the original file, or the
@ -964,10 +981,10 @@ lost the original file.
*DOS-format-write*
If the 'fileformat' is "dos", <CR> <NL> is used for <EOL>. This is default
for MS-DOS and Win32. On other systems the message "[dos format]" is shown to
for Windows. On other systems the message "[dos format]" is shown to
remind you that an unusual <EOL> was used.
*Unix-format-write*
If the 'fileformat' is "unix", <NL> is used for <EOL>. On MS-DOS and Win32
If the 'fileformat' is "unix", <NL> is used for <EOL>. On Windows
the message "[unix format]" is shown.
*Mac-format-write*
If the 'fileformat' is "mac", <CR> is used for <EOL>. On non-Mac systems the
@ -997,11 +1014,11 @@ When the file name is actually a device name, Vim will not make a backup (that
would be impossible). You need to use "!", since the device already exists.
Example for Unix: >
:w! /dev/lpt0
and for MS-DOS or MS-Windows: >
and Windows: >
:w! lpt0
For Unix a device is detected when the name doesn't refer to a normal file or
a directory. A fifo or named pipe also looks like a device to Vim.
For MS-DOS and MS-Windows the device is detected by its name:
For Windows the device is detected by its name:
CON
CLOCK$
NUL
@ -1028,10 +1045,10 @@ The names can be in upper- or lowercase.
the last file in the argument list has not been
edited. See |:confirm| and 'confirm'.
:q[uit]! Quit without writing, also when currently visible
buffers have changes. Does not exit when this is the
last window and there is a changed hidden buffer.
In this case, the first changed hidden buffer becomes
:q[uit]! Quit without writing, also when the current buffer has
changes. If this is the last window and there is a
modified hidden buffer, the current buffer is
abandoned and the first changed hidden buffer becomes
the current buffer.
Use ":qall!" to exit always.
@ -1144,7 +1161,7 @@ If you want to always use ":confirm", set the 'confirm' option.
|:diffsplit|, |:diffpatch|, |:pedit|, |:redir|,
|:source|, |:update|, |:visual|, |:vsplit|,
and |:qall| if 'confirm' is set.
{only in Win32, Athena, Motif, GTK and Mac GUI}
{only in Win32 GUI}
When ":browse" is not possible you get an error
message. If the |+browse| feature is missing or the
{command} doesn't support browsing, the {command} is
@ -1172,16 +1189,13 @@ For versions of Vim where browsing is not supported, the command is executed
unmodified.
*browsefilter*
For MS Windows and GTK, you can modify the filters that are used in the browse
dialog. By setting the g:browsefilter or b:browsefilter variables, you can
change the filters globally or locally to the buffer. The variable is set to
a string in the format "{filter label}\t{pattern};{pattern}\n" where {filter
label} is the text that appears in the "Files of Type" comboBox, and {pattern}
is the pattern which filters the filenames. Several patterns can be given,
separated by ';'.
For Motif the same format is used, but only the very first pattern is actually
used (Motif only offers one pattern, but you can edit it).
For Windows you can modify the filters that are used in the browse dialog. By
setting the g:browsefilter or b:browsefilter variables, you can change the
filters globally or locally to the buffer. The variable is set to a string in
the format "{filter label}\t{pattern};{pattern}\n" where {filter label} is the
text that appears in the "Files of Type" comboBox, and {pattern} is the
pattern which filters the filenames. Several patterns can be given, separated
by ';'.
For example, to have only Vim files in the dialog, you could use the following
command: >
@ -1206,12 +1220,18 @@ use has("browsefilter"): >
==============================================================================
7. The current directory *current-directory*
You may use the |:cd| and |:lcd| commands to change to another directory, so
you will not have to type that directory name in front of the file names. It
also makes a difference for executing external commands, e.g. ":!ls".
You can use |:cd|, |:tcd| and |:lcd| to change to another directory, so you
will not have to type that directory name in front of the file names. It also
makes a difference for executing external commands, e.g. ":!ls" or ":te ls".
Changing directory fails when the current buffer is modified, the '.' flag is
present in 'cpoptions' and "!" is not used in the command.
There are three current-directory "scopes": global, tab and window. The
window-local working directory takes precedence over the tab-local
working directory, which in turn takes precedence over the global
working directory. If a local working directory (tab or window) does not
exist, the next-higher scope in the hierarchy applies.
Commands for changing the working directory can be suffixed with a bang "!"
(e.g. |:cd!|) which is ignored, for compatibility with Vim.
*:cd* *E747* *E472*
:cd[!] On non-Unix systems: Print the current directory
@ -1225,7 +1245,7 @@ present in 'cpoptions' and "!" is not used in the command.
Does not change the meaning of an already opened file,
because its full path name is remembered. Files from
the |arglist| may change though!
On MS-DOS this also changes the active drive.
On Windows this also changes the active drive.
To change to the directory of the current file: >
:cd %:h
<
@ -1236,29 +1256,50 @@ present in 'cpoptions' and "!" is not used in the command.
*:chd* *:chdir*
:chd[ir][!] [path] Same as |:cd|.
*:tc* *:tcd* *E5000* *E5001* *E5002*
:tc[d][!] {path} Like |:cd|, but set the current directory for the
current tab and window. The current directory for
other tabs and windows is not changed.
*:tcd-*
:tcd[!] - Change to the previous current directory (before the
previous ":tcd {path}" command).
*:tch* *:tchdir*
:tch[dir][!] Same as |:tcd|.
*:lc* *:lcd*
:lc[d][!] {path} Like |:cd|, but only set the current directory for the
current window. The current directory for other
windows is not changed.
windows or any tabs is not changed.
*:lch* *:lchdir*
:lch[dir][!] Same as |:lcd|.
*:lcd-*
:lcd[!] - Change to the previous current directory (before the
previous ":tcd {path}" command).
*:pw* *:pwd* *E187*
:pw[d] Print the current directory name.
Also see |getcwd()|.
So long as no |:lcd| command has been used, all windows share the same current
directory. Using a command to jump to another window doesn't change anything
for the current directory.
When a |:lcd| command has been used for a window, the specified directory
becomes the current directory for that window. Windows where the |:lcd|
command has not been used stick to the global current directory. When jumping
to another window the current directory will become the last specified local
current directory. If none was specified, the global current directory is
used.
When a |:cd| command is used, the current window will lose his local current
directory and will use the global current directory from now on.
So long as no |:tcd| or |:lcd| command has been used, all windows share the
same "current directory". Using a command to jump to another window doesn't
change anything for the current directory.
When |:lcd| has been used for a window, the specified directory becomes the
current directory for that window. Windows where the |:lcd| command has not
been used stick to the global or tab-local directory. When jumping to another
window the current directory will become the last specified local current
directory. If none was specified, the global or tab-local directory is used.
When changing tabs the same behaviour applies. If the current tab has no
local working directory the global working directory is used. When a |:cd|
command is used, the current window and tab will lose their local current
directories and will use the global current directory from now on. When
a |:tcd| command is used, only the current window will lose its local working
directory.
After using |:cd| the full path name will be used for reading and writing
files. On some networked file systems this may cause problems. The result of
@ -1295,7 +1336,7 @@ There are a few things to remember when editing binary files:
and when the file is written the <NL> will be replaced with <CR> <NL>.
- <Nul> characters are shown on the screen as ^@. You can enter them with
"CTRL-V CTRL-@" or "CTRL-V 000".
- To insert a <NL> character in the file split up a line. When writing the
- To insert a <NL> character in the file split a line. When writing the
buffer to a file a <NL> will be written for the <EOL>.
- Vim normally appends an <EOL> at the end of the file if there is none.
Setting the 'binary' option prevents this. If you want to add the final
@ -1307,9 +1348,7 @@ There are a few things to remember when editing binary files:
9. Encryption *encryption*
*:X* *E817* *E818* *E819* *E820*
Support for editing encrypted files has been removed, but may be added back in
the future. See the following discussions for more information:
Support for editing encrypted files has been removed.
https://github.com/neovim/neovim/issues/694
https://github.com/neovim/neovim/issues/701

File diff suppressed because it is too large Load Diff

View File

@ -53,60 +53,6 @@ o Toggling between Farsi ISIR-3342 standard encoding and Vim Farsi via F9
right-to-left mode, this function is also supported only in right-to-left
mode.
Farsi Fonts *farsi fonts*
-----------
The following files are found in the subdirectories of the '$VIM/farsi/fonts'
directory:
+ far-a01.pcf X Windows fonts for Unix including Linux systems
+ far-a01.bf X Windows fonts for SunOS
+ far-a01.f16 a screen fonts for Unix including Linux systems
+ far-a01.fon a monospaced fonts for Windows NT/95/98
+ far-a01.com a screen fonts for DOS
Font Installation
-----------------
o Installation of fonts for MS Window systems (NT/95/98)
From 'Control Panel' folder, start the 'Fonts' program. Then from 'file'
menu item select 'Install New Fonts ...'. Browse and select the
'far-a01.fon', then follow the installation guide.
NOTE: several people have reported that this does not work. The solution
is unknown.
o Installation of fonts for X Window systems (Unix/Linux)
Depending on your system, copy far-a01.pcf.Z or far-a01.pcf.gz into a
directory of your choice. Change to the directory containing the Farsi
fonts and execute the following commands:
> mkfontdir
> xset +fp path_name_of_farsi_fonts_directory
o Installation of fonts for X Window systems (SunOS)
Copy far-a01.bf font into a directory of your choice.
Change to the directory containing the far-a01.fb fonts and
execute the following commands:
> fldfamily
> xset +fp path_name_of_fonts_directory
o Installation of ASCII screen fonts (Unix/Linux)
For Linux system, copy the far-a01.f16 fonts into /usr/lib/kbd/consolefonts
directory and execute the setfont program as "setfont far-a01.f16". For
other systems (e.g. SCO Unix), please refer to the fonts installation
section of your system administration manuals.
o Installation of ASCII screen fonts (DOS)
After system power on, prior to the first use of Vim, upload the Farsi
fonts by executing the far-a01.com font uploading program.
Usage
-----
@ -165,7 +111,7 @@ The letter encoding used is the Vim extended ISIR-3342 standard with a built
in function to convert between Vim extended ISIR-3342 and ISIR-3342 standard.
For document portability reasons, the letter encoding is kept the same across
different platforms (i.e. UNIX's, NT/95/98, MS DOS, ...).
different platforms (i.e. Unix, Windows, ...).
o Keyboard
@ -215,7 +161,7 @@ o Keyboard
Note:
<09> stands for Farsi PSP (break without space)
<09> stands for Farsi PCN (for HAMZE attribute )
<09> stands for Farsi PCN (for HAMZE attribute)
Restrictions
------------

View File

@ -1,4 +1,4 @@
*filetype.txt* For Vim version 7.4. Last change: 2013 Dec 15
*filetype.txt* For Vim version 7.4. Last change: 2015 Dec 06
VIM REFERENCE MANUAL by Bram Moolenaar
@ -500,7 +500,7 @@ Options:
avoid that a Subject line with "Vim:" in it will cause an
error message.
'textwidth' is set to 72. This is often recommended for e-mail.
'formatoptions' is set to break text lines and to repeat the comment leader
'formatoptions' is set to break text lines and to repeat the comment leader
in new lines, so that a leading ">" for quotes is repeated.
You can also format quoted text with |gq|.
@ -510,32 +510,44 @@ Local mappings:
to the end of the file in Normal mode. This means "> " is inserted in
each line.
MAN *ft-man-plugin* *:Man*
MAN *ft-man-plugin* *:Man* *man.vim*
Displays a manual page in a nice way. Also see the user manual
|find-manpage|.
View manpages in Nvim. Supports highlighting, completion, locales, and
navigation. Also see |find-manpage|.
To start using the ":Man" command before any manual page was loaded, source
this script from your startup vimrc file: >
To use Nvim as a manpager: >
export MANPAGER="nvim -c 'set ft=man' -"
runtime ftplugin/man.vim
Options:
'iskeyword' the '.' character is added to be able to use CTRL-] on the
manual page name.
man.vim will always attempt to reuse the closest man window (above/left) but
otherwise create a split.
Commands:
Man {name} Display the manual page for {name} in a window.
Man {number} {name}
Display the manual page for {name} in a section {number}.
Man {name} Display the manpage for {name}.
Man {sect} {name} Display the manpage for {name} and section {sect}.
Man {name}({sect}) Alternate syntax which completes the section.
Man {sect} {name}({sect}) Used during completion to show the real section of
when the provided section is a prefix, e.g. 1m vs 1.
Man {path} Open the manpage specified by path. Prepend "./" if
page is in the current directory.
Man Open the manpage for the <cWORD> (man buffers)
or <cword> (non-man buffers) under the cursor.
Global mapping:
<Leader>K Displays the manual page for the word under the cursor.
|:Man| accepts command modifiers. For example, to use a vertical split: >
:vertical Man printf
Local mappings:
CTRL-] Jump to the manual page for the word under the cursor.
CTRL-T Jump back to the previous manual page.
K or CTRL-] Jump to the manpage for the <cWORD> under the
cursor. Takes a count for the section.
CTRL-T Jump back to the location that the manpage was
opened from.
q :quit if invoked as $MANPAGER, otherwise :close.
Variables:
*g:no_man_maps* Do not create mappings in manpage buffers.
*g:ft_man_folding_enable* Fold manpages with foldmethod=indent foldnestmax=1.
*b:man_default_sects* Comma-separated, ordered list of preferred sections.
For example in C one usually wants section 3 or 2: >
:let b:man_default_sections = '3,2'
PDF *ft-pdf-plugin*
@ -595,7 +607,7 @@ Format description:
ignored.
2. Each entry starts with line that has format "{type} with timestamp
{timestamp}:". {timestamp} is |strftime()|-formatted string representing
actual UNIX timestamp value. First strftime() argument is equal to
actual Unix timestamp value. First strftime() argument is equal to
`%Y-%m-%dT%H:%M:%S`. When writing this timestamp is parsed using
|msgpack#strptime()|, with caching (it remembers which timestamp produced
particular strftime() output and uses this value if you did not change

View File

@ -1,4 +1,4 @@
*fold.txt* For Vim version 7.4. Last change: 2013 Dec 04
*fold.txt* For Vim version 7.4. Last change: 2016 Jan 02
VIM REFERENCE MANUAL by Bram Moolenaar
@ -94,9 +94,9 @@ These are the conditions with which the expression is evaluated:
lowest.
"=" use fold level from the previous line
"a1", "a2", .. add one, two, .. to the fold level of the previous
line
line, use the result for the current line
"s1", "s2", .. subtract one, two, .. from the fold level of the
previous line
previous line, use the result for the next line
"<1", "<2", .. a fold with this level ends at this line
">1", ">2", .. a fold with this level starts at this line
@ -119,6 +119,18 @@ method can be very slow!
Try to avoid the "=", "a" and "s" return values, since Vim often has to search
backwards for a line for which the fold level is defined. This can be slow.
An example of using "a1" and "s1": For a multi-line C comment, a line
containing "/*" would return "a1" to start a fold, and a line containing "*/"
would return "s1" to end the fold after that line: >
if match(thisline, '/\*') >= 0
return 'a1'
elseif match(thisline, '\*/') >= 0
return 's1'
else
return '='
endif
However, this won't work for single line comments, strings, etc.
|foldlevel()| can be useful to compute a fold level relative to a previous
fold level. But note that foldlevel() may return -1 if the level is not known
yet. And it returns the level at the start of the line, while a fold might
@ -570,8 +582,9 @@ what you type!
When using an operator, a closed fold is included as a whole. Thus "dl"
deletes the whole closed fold under the cursor.
For Ex commands the range is adjusted to always start at the first line of a
closed fold and end at the last line of a closed fold. Thus this command: >
For Ex commands that work on buffer lines the range is adjusted to always
start at the first line of a closed fold and end at the last line of a closed
fold. Thus this command: >
:s/foo/bar/g
when used with the cursor on a closed fold, will replace "foo" with "bar" in
all lines of the fold.

View File

@ -208,18 +208,6 @@ takes too much time or you don't like the cursor jumping to another line,
include the 'h' flag in 'guioptions'. Then the scrolling is limited by the
text of the current cursor line.
*athena-intellimouse*
If you have an Intellimouse and an X server that supports using the wheel,
then you can use the wheel to scroll the text up and down in gvim. This works
with XFree86 4.0 and later, and with some older versions when you add patches.
See |scroll-mouse-wheel|.
For older versions of XFree86 you must patch your X server. The following
page has a bit of information about using the Intellimouse on Linux as well as
links to the patches and X server binaries (may not have the one you need
though):
http://www.inria.fr/koala/colas/mouse-wheel-scroll/
==============================================================================
3. Mouse Control *gui-mouse*
@ -407,9 +395,9 @@ You may make selections with the mouse (see |gui-mouse-select|), or by using
Vim's Visual mode (see |v|). If 'a' is present in 'guioptions', then
whenever a selection is started (Visual or Select mode), or when the selection
is changed, Vim becomes the owner of the windowing system's primary selection
(on MS-Windows the |gui-clipboard| is used).
(on MS-Windows the |clipboard| is used).
*clipboard*
*primary-selection*
There is a special register for storing this selection, it is the "*
register. Nothing is put in here unless the information about what text is
selected is about to change (e.g. with a left mouse click somewhere), or when
@ -605,10 +593,6 @@ The default menus have these priorities:
When no or zero priority is given, 500 is used.
The priority for the PopUp menu is not used.
The Help menu will be placed on the far right side of the menu bar on systems
which support this (Motif and GTK+). For GTK+ 2, this is not done anymore
because right-aligning the Help menu is now discouraged UI design.
You can use a priority higher than 9999, to make it go after the Help menu,
but that is non-standard and is discouraged. The highest possible priority is
about 32000. The lowest is 1.
@ -677,10 +661,8 @@ level. Vim interprets the items in this menu as follows:
toolbar button image. Note that the exact filename is OS-specific: For
example, under Win32 the command >
:amenu ToolBar.Hello :echo "hello"<CR>
< would find the file 'hello.bmp'. Under GTK+/X11 it is 'Hello.xpm'. With
GTK+ 2 the files 'Hello.png', 'Hello.xpm' and 'Hello.bmp' are checked for
existence, and the first one found would be used.
For MS-Windows and GTK+ 2 the bitmap is scaled to fit the button. For
< would find the file 'hello.bmp'. Under X11 it is 'Hello.xpm'.
For MS-Windows and the bitmap is scaled to fit the button. For
MS-Windows a size of 18 by 18 pixels works best.
For MS-Windows the bitmap should have 16 colors with the standard palette.
The light grey pixels will be changed to the Window frame color and the
@ -729,8 +711,8 @@ nr Name Normal action ~
30 WinMinWidth make current window use few columns
*hidden-menus* *win32-hidden-menus*
In the Win32 and GTK+ GUI, starting a menu name with ']' excludes that menu
from the main menu bar. You must then use the |:popup| command to display it.
In the Win32 GUI, starting a menu name with ']' excludes that menu from the
main menu bar. You must then use the |:popup| command to display it.
*popup-menu*
You can define the special menu "PopUp". This is the menu that is displayed
@ -843,13 +825,13 @@ the <CR> key. |<>|)
See section |42.4| in the user manual.
*:tmenu* *:tm*
*:tmenu*
:tm[enu] {menupath} {rhs} Define a tip for a menu or tool. {only in
X11 and Win32 GUI}
:tm[enu] [menupath] List menu tips. {only in X11 and Win32 GUI}
*:tunmenu* *:tu*
*:tunmenu*
:tu[nmenu] {menupath} Remove a tip for a menu or tool.
{only in X11 and Win32 GUI}
@ -883,9 +865,8 @@ a menu item - you don't need to do a :tunmenu as well.
5.9 Popup Menus
In the Win32 and GTK+ GUI, you can cause a menu to popup at the cursor.
This behaves similarly to the PopUp menus except that any menu tree can
be popped up.
In the Win32 GUI, you can cause a menu to popup at the cursor. This behaves
similarly to the PopUp menus except that any menu tree can be popped up.
This command is for backwards compatibility, using it is discouraged, because
it behaves in a strange way.
@ -894,7 +875,7 @@ it behaves in a strange way.
:popu[p] {name} Popup the menu {name}. The menu named must
have at least one subentry, but need not
appear on the menu-bar (see |hidden-menus|).
{only available for Win32 and GTK GUI}
{only available for Win32 GUI}
:popu[p]! {name} Like above, but use the position of the mouse
pointer instead of the cursor.

View File

@ -1,457 +0,0 @@
*gui_w32.txt* For Vim version 7.4. Last change: 2014 Dec 20
VIM REFERENCE MANUAL by Bram Moolenaar
Vim's Win32 Graphical User Interface *gui-w32* *win32-gui*
1. Starting the GUI |gui-w32-start|
2. Vim as default editor |vim-default-editor|
3. Using the clipboard |gui-clipboard|
4. Shell Commands |gui-shell-win32|
5. Special colors |win32-colors|
6. Windows dialogs & browsers |gui-w32-dialogs|
7. Command line arguments |gui-w32-cmdargs|
8. Various |gui-w32-various|
Other relevant documentation:
|gui.txt| For generic items of the GUI.
|os_win32.txt| For Win32 specific items.
==============================================================================
1. Starting the GUI *gui-w32-start*
The Win32 GUI version of Vim will always start the GUI, no matter how you
start it or what it's called.
The GUI will always run in the Windows subsystem. Mostly shells automatically
return with a command prompt after starting gvim. If not, you should use the
"start" command: >
start gvim [options] file ..
Note: All fonts (bold, italic) must be of the same size!!! If you don't do
this, text will disappear or mess up the display. Vim does not check the font
sizes. It's the size in screen pixels that must be the same. Note that some
fonts that have the same point size don't have the same pixel size!
Additionally, the positioning of the fonts must be the same (ascent and
descent).
The Win32 GUI has an extra menu item: "Edit/Select Font". It brings up the
standard Windows font selector.
Setting the menu height doesn't work for the Win32 GUI.
*gui-win32-maximized*
If you want Vim to start with a maximized window, add this command to your
vimrc or gvimrc file: >
au GUIEnter * simalt ~x
<
*gui-w32s*
There is a specific version of gvim.exe that runs under the Win32s subsystem
of Windows 3.1 or 3.11. See |win32s|.
==============================================================================
2. Vim as default editor *vim-default-editor*
To set Vim as the default editor for a file type:
1. Start a Windows Explorer
2. Choose View/Options -> File Types
3. Select the path to gvim for every file type that you want to use it for.
(you can also use three spaces in the file type field, for files without an
extension).
In the "open" action, use: >
gvim "%1"
< The quotes are required for using file names with embedded spaces.
You can also use this: >
gvim "%L"
< This should avoid short (8.3 character) file names in some situations. But
I'm not sure if this works everywhere.
When you open a file in Vim by double clicking it, Vim changes to that
file's directory.
If you want Vim to start full-screen, use this for the Open action: >
gvim -c "simalt ~x" "%1"
Another method, which also works when you put Vim in another directory (e.g.,
when you have got a new version):
1. select a file you want to use Vim with
2. <Shift-F10>
3. select "Open With..." menu entry
4. click "Other..."
5. browse to the (new) location of Vim and click "Open"
6. make "Always Use this program..." checked
7. <OK>
*send-to-menu* *sendto*
You can also install Vim in the "Send To" menu:
1. Start a Windows Explorer
2. Navigate to your sendto directory:
Windows 95: %windir%\sendto (e.g. "c:\windows\sendto")
Windows NT: %windir%\profiles\%user%\sendto (e.g.
"c:\winnt\profiles\mattha\sendto").
3. Right-click in the file pane and select New->Shortcut
4. Follow the shortcut wizard, using the full path to VIM/GVIM.
When you 'send a file to Vim', Vim changes to that file's directory. Note,
however, that any long directory names will appear in their short (MS-DOS)
form. This is a limitation of the Windows "Send To" mechanism.
*notepad*
You could replace notepad.exe with gvim.exe, but that has a few side effects.
Some programs rely on notepad arguments, which are not recognized by Vim. For
example "notepad -p" is used by some applications to print a file. It's
better to leave notepad where it is and use another way to start Vim.
*win32-popup-menu*
A more drastic approach is to install an "Edit with Vim" entry in the popup
menu for the right mouse button. With this you can edit any file with Vim.
This can co-exist with the file associations mentioned above. The difference
is that the file associations will make starting Vim the default action. With
the "Edit with Vim" menu entry you can keep the existing file association for
double clicking on the file, and edit the file with Vim when you want. For
example, you can associate "*.mak" with your make program. You can execute
the makefile by double clicking it and use the "Edit with Vim" entry to edit
the makefile.
You can select any files and right-click to see a menu option called "Edit
with gvim". Choosing this menu option will invoke gvim with the file you have
selected. If you select multiple files, you will find two gvim-related menu
options:
"Edit with multiple gvims" -- one gvim for each file in the selection
"Edit with single gvim" -- one gvim for all the files in the selection
And if there already is a gvim running:
"Edit with existing gvim" -- edit the file with the running gvim
The "edit with existing Vim" entries can be disabled by adding an entry in the
registry under HKLM\Software\Vim\Gvim, named DisableEditWithExisting, and with
any value.
*install-registry*
You can add the "Edit with Vim" menu entry in an easy way by using the
"install.exe" program. It will add several registry entries for you.
You can also do this by hand. This is complicated! Use the install.exe if
you can.
1. Start the registry editor with "regedit".
2. Add these keys:
key value name value ~
HKEY_CLASSES_ROOT\CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}
{default} Vim Shell Extension
HKEY_CLASSES_ROOT\CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}\InProcServer32
{default} {path}\gvimext.dll
ThreadingModel Apartment
HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\gvim
{default} {51EEE242-AD87-11d3-9C1E-0090278BBD99}
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved
{51EEE242-AD87-11d3-9C1E-0090278BBD99}
Vim Shell Extension
HKEY_LOCAL_MACHINE\Software\Vim\Gvim
path {path}\gvim.exe
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\vim 5.6
DisplayName Vim 5.6: Edit with Vim popup menu entry
UninstallString {path}\uninstal.exe
Replace {path} with the path that leads to the executable.
Don't type {default}, this is the value for the key itself.
To remove "Edit with Vim" from the popup menu, just remove the registry
entries mentioned above. The "uninstal.exe" program can do this for you. You
can also use the entry in the Windows standard "Add/Remove Programs" list.
If you notice that this entry overrules other file type associations, set
those associations again by hand (using Windows Explorer, see above). This
only seems to happen on some Windows NT versions (Windows bug?). Procedure:
1. Find the name of the file type. This can be done by starting the registry
editor, and searching for the extension in \\HKEY_CLASSES_ROOT
2. In a Windows Explorer, use View/Options/File Types. Search for the file
type in the list and click "Edit". In the actions list, you can select on
to be used as the default (normally the "open" action) and click on the
"Set Default" button.
Vim in the "Open With..." context menu *win32-open-with-menu*
If you use the Vim install program you have the choice to add Vim to the "Open
With..." menu. This means you can use Vim to edit many files. Not every file
(for unclear reasons...), thus the "Edit with Vim" menu entry is still useful.
One reason to add this is to be able to edit HTML files directly from Internet
Explorer. To enable this use the "Tools" menu, "Internet Options..." entry.
In the dialog select the "Programs" tab and select Vim in the "HTML editor"
choice. If it's not there than installing didn't work properly.
Doing this manually can be done with this script:
----------------------------------------------------------
REGEDIT4
[HKEY_CLASSES_ROOT\Applications\gvim.exe]
[HKEY_CLASSES_ROOT\Applications\gvim.exe\shell]
[HKEY_CLASSES_ROOT\Applications\gvim.exe\shell\edit]
[HKEY_CLASSES_ROOT\Applications\gvim.exe\shell\edit\command]
@="c:\\vim\\vim62\\gvim.exe \"%1\""
[HKEY_CLASSES_ROOT\.htm\OpenWithList\gvim.exe]
[HKEY_CLASSES_ROOT\*\OpenWithList\gvim.exe]
----------------------------------------------------------
Change the "c:\\vim\\vim62" bit to where gvim.exe is actually located.
To uninstall this run the Vim uninstall program or manually delete the
registry entries with "regedit".
==============================================================================
3. Using the clipboard *gui-clipboard*
Windows has a clipboard, where you can copy text to, and paste text from. Vim
supports this in several ways. For other systems see |gui-selections|.
The "* register reflects the contents of the clipboard. |quotestar|
When the "unnamed" string is included in the 'clipboard' option, the unnamed
register is the same. Thus you can yank to and paste from the clipboard
without prepending "* to commands.
The 'a' flag in 'guioptions' is not included by default. This means that text
is only put on the clipboard when an operation is performed on it. Just
Visually selecting text doesn't put it on the clipboard. When the 'a' flag is
included, the text is copied to the clipboard even when it is not operated
upon.
*mswin.vim*
To use the standard MS-Windows way of CTRL-X, CTRL-C and CTRL-V, use the
$VIMRUNTIME/mswin.vim script. You could add this line to your _vimrc file: >
source $VIMRUNTIME/mswin.vim
Since CTRL-C is used to copy the text to the clipboard, it can't be used to
cancel an operation. Use CTRL-Break for that.
CTRL-Z is used for undo. This means you can't suspend Vim with this key, use
|:suspend| instead (if it's supported at all).
*CTRL-V-alternative* *CTRL-Q*
Since CTRL-V is used to paste, you can't use it to start a blockwise Visual
selection. You can use CTRL-Q instead. You can also use CTRL-Q in Insert
mode and Command-line mode to get the old meaning of CTRL-V. But CTRL-Q
doesn't work for terminals when it's used for control flow.
NOTE: The clipboard support still has a number of bugs.
==============================================================================
4. Shell Commands *gui-shell-win32*
Vim uses another window for external commands, to make it possible to run any
command. The external command gets its own environment for running, just like
it was started from a DOS prompt.
*win32-vimrun*
Executing an external command is done indirectly by the "vimrun" command. The
"vimrun.exe" must be in the path for this to work. Or it must be in the same
directory as the Vim executable. If "vimrun" cannot be found, the command is
executed directly, but then the DOS window closes immediately after the
external command has finished.
WARNING: If you close this window with the "X" button, and confirm the
question if you really want to kill the application, Vim may be killed too!
(This does not apply to commands run asynchronously with ":!start".)
*msdos-mode*
If you get a dialog that says "This program is set to run in MS-DOS mode..."
when you run an external program, you can solve this by changing the
properties of the associated shortcut:
- Use a Windows Explorer to find the command.com that is used. It can be
c:\command.com, c:\dos\command.com, c:\windows\command.com, etc.
- With the right mouse button, select properties of this command.com.
- In the Program tab select "Advanced".
- Unselect "MS-DOS mode".
- Click "OK" twice.
*win32-!start*
Normally, Vim waits for a command to complete before continuing (this makes
sense for most shell commands which produce output for Vim to use). If you
want Vim to start a program and return immediately, you can use the following
syntax on W95 & NT: >
:!start [/min] {command}
The optional "/min" causes the window to be minimized.
On Win32s, you will have to go to another window instead. Don't forget that
you must tell Windows 3.1x to keep executing a DOS command in the background
while you switch back to Vim.
==============================================================================
5. Special colors *win32-colors*
On Win32, the normal DOS colors can be used. See |dos-colors|.
Additionally the system configured colors can also be used. These are known
by the names Sys_XXX, where XXX is the appropriate system color name, from the
following list (see the Win32 documentation for full descriptions). Case is
ignored. Note: On Win32s not all of these colors are supported.
Sys_3DDKShadow Sys_3DFace Sys_BTNFace
Sys_3DHilight Sys_3DHighlight Sys_BTNHilight
Sys_BTNHighlight Sys_3DLight Sys_3DShadow
Sys_BTNShadow Sys_ActiveBorder Sys_ActiveCaption
Sys_AppWorkspace Sys_Background Sys_Desktop
Sys_BTNText Sys_CaptionText Sys_GrayText
Sys_Highlight Sys_HighlightText Sys_InactiveBorder
Sys_InactiveCaption Sys_InactiveCaptionText Sys_InfoBK
Sys_InfoText Sys_Menu Sys_MenuText
Sys_ScrollBar Sys_Window Sys_WindowFrame
Sys_WindowText
Probably the most useful values are
Sys_Window Normal window background
Sys_WindowText Normal window text
Sys_Highlight Highlighted background
Sys_HighlightText Highlighted text
These extra colors are also available:
Gray, Grey, LightYellow, SeaGreen, Orange, Purple, SlateBlue, Violet,
*rgb.txt*
Additionally, colors defined by a "rgb.txt" file can be used. This file is
well known from X11. A few lines from it: >
255 218 185 peach puff
205 133 63 peru
255 181 197 pink
This shows the layout of the file: First the R, G and B value as a decimal
number, followed by the name of the color. The four fields are separated by
spaces.
You can get an rgb.txt file from any X11 distribution. It is located in a
directory like "/usr/X11R6/lib/X11/". For Vim it must be located in the
$VIMRUNTIME directory. Thus the file can be found with "$VIMRUNTIME/rgb.txt".
==============================================================================
*gui-w32-dialogs* *dialog*
6. Windows dialogs & browsers
The Win32 GUI can use familiar Windows components for some operations, as well
as the traditional interface shared with the console version.
6.1 Dialogs
The dialogs displayed by the "confirm" family (i.e. the 'confirm' option,
|:confirm| command and |confirm()| function) are GUI-based rather than the
console-based ones used by other versions. The 'c' flag in 'guioptions'
changes this.
6.2 File Browsers
When prepending ":browse" before file editing commands, a file requester is
used to allow you to select an existing file. See |:browse|.
==============================================================================
7. Command line arguments *gui-w32-cmdargs*
Analysis of a command line into parameters is not standardised in MS Windows.
Gvim has to provide logic to analyse a command line. This logic is likely to
be different from the default logic provided by a compilation system used to
build vim. The differences relate to unusual double quote (") usage.
The arguments "C:\My Music\freude.txt" and "+/Sch\"iller" are handled in the
same way. The argument "+/Sch""iller" may be handled different by gvim and
vim, depending what it was compiled with.
The rules are:
a) A parameter is a sequence of graphic characters.
b) Parameters are separated by white space.
c) A parameter can be enclosed in double quotes to include white space.
d) A sequence of zero or more backslashes (\) and a double quote (")
is special. The effective number of backslashes is halved, rounded
down. An even number of backslashes reverses the acceptability of
spaces and tabs, an odd number of backslashes produces a literal
double quote.
So:
" is a special double quote
\" is a literal double quote
\\" is a literal backslash and a special double quote
\\\" is a literal backslash and a literal double quote
\\\\" is 2 literal backslashes and a special double quote
\\\\\" is 2 literal backslashes and a literal double quote
etc.
Example: >
gvim "C:\My Music\freude" +"set ignorecase" +/"\"foo\\" +\"bar\\\"
opens "C:\My Music\freude" and executes the line mode commands: >
set ignorecase; /"foo\ and /bar\"
==============================================================================
8. Various *gui-w32-various*
*gui-w32-printing*
The "File/Print" menu prints the text with syntax highlighting, see
|:hardcopy|. If you just want to print the raw text and have a default
printer installed this should also work: >
:w >>prn
Vim supports a number of standard MS Windows features. Some of these are
detailed elsewhere: see |'mouse'|, |win32-hidden-menus|.
*drag-n-drop-win32*
You can drag and drop one or more files into the Vim window, where they will
be opened as normal. See |drag-n-drop|.
*:simalt* *:si*
:sim[alt] {key} simulate pressing {key} while holding Alt pressed.
{only for Win32 versions}
Normally, Vim takes control of all Alt-<Key> combinations, to increase the
number of possible mappings. This clashes with the standard use of Alt as the
key for accessing menus.
The quick way of getting standard behavior is to set the 'winaltkeys' option
to "yes". This however prevents you from mapping Alt keys at all.
Another way is to set 'winaltkeys' to "menu". Menu shortcut keys are then
handled by windows, other ALT keys can be mapped. This doesn't allow a
dependency on the current state though.
To get round this, the :simalt command allows Vim (when 'winaltkeys' is not
"yes") to fake a Windows-style Alt keypress. You can use this to map Alt key
combinations (or anything else for that matter) to produce standard Windows
actions. Here are some examples: >
:map <M-f> :simalt f<CR>
This makes Alt-F pop down the 'File' menu (with the stock Menu.vim) by
simulating the keystrokes Alt, F. >
:map <M-Space> :simalt ~<CR>
This maps Alt-Space to pop down the system menu for the Vim window. Note that
~ is used by simalt to represent the <Space> character. >
:map <C-n> :simalt ~n<CR>
Maps Control-N to produce the keys Alt-Space followed by N. This minimizes the
Vim window via the system menu.
Note that the key changes depending on the language you are using.
*intellimouse-wheel-problems*
When using the Intellimouse mouse wheel causes Vim to stop accepting input, go
to:
ControlPanel - Mouse - Wheel - UniversalScrolling - Exceptions
And add gvim to the list of applications. This problem only appears to happen
with the Intellimouse driver 2.2 and when "Universal Scrolling" is turned on.
XPM support *w32-xpm-support*
Gvim can be build on MS-Windows with support for XPM files. |+xpm_w32|
See the Make_mvc.mak file for instructions, search for XPM.
To try out if XPM support works do this: >
:help
:exe 'sign define vimxpm icon=' . $VIMRUNTIME . '\\vim16x16.xpm'
:exe 'sign place 1 line=1 name=vimxpm file=' . expand('%:p')
<
vim:tw=78:sw=4:ts=8:ft=help:norl:

View File

@ -1,4 +1,4 @@
*help.txt* For Vim version 7.4. Last change: 2012 Dec 06
*help.txt* For Vim version 7.4. Last change: 2016 Mar 31
VIM - main help file
k
@ -9,20 +9,23 @@ Close this window: Use ":q<Enter>".
Jump to a subject: Position the cursor on a tag (e.g. |bars|) and hit CTRL-].
With the mouse: Double-click the left mouse button on a tag, e.g. |bars|.
Jump back: Type CTRL-T or CTRL-O (repeat to go further back).
Jump back: Type CTRL-T or CTRL-O. Repeat to go further back.
Get specific help: It is possible to go directly to whatever you want help
on, by giving an argument to the |:help| command.
It is possible to further specify the context:
*help-context*
Prepend something to specify the context: *help-context*
WHAT PREPEND EXAMPLE ~
Normal mode command (nothing) :help x
Normal mode command :help x
Visual mode command v_ :help v_u
Insert mode command i_ :help i_<Esc>
Command-line command : :help :quit
Command-line editing c_ :help c_<Del>
Vim command argument - :help -r
Option ' :help 'textwidth'
Regular expression / :help /[
See |help-summary| for more contexts and an explanation.
Search for help: Type ":help word", then hit CTRL-D to see matching
help entries for "word".
Or use ":helpgrep word". |:helpgrep|
@ -151,6 +154,7 @@ GUI ~
Interfaces ~
|if_cscop.txt| using Cscope with Vim
|if_pyth.txt| Python interface
|if_ruby.txt| Ruby interface
|debugger.txt| Interface with a debugger
|sign.txt| debugging signs
@ -162,7 +166,6 @@ Remarks about specific systems ~
|os_win32.txt| MS-Windows
*standard-plugin-list*
Standard plugins ~
|pi_getscript.txt| Downloading latest version of Vim scripts
|pi_gzip.txt| Reading and writing compressed files
|pi_netrw.txt| Reading and writing files over a network
|pi_paren.txt| Highlight matching parens

View File

@ -1,4 +1,4 @@
*helphelp.txt* For Vim version 7.4. Last change: 2014 Sep 19
*helphelp.txt* For Vim version 7.4. Last change: 2016 Apr 01
VIM REFERENCE MANUAL by Bram Moolenaar
@ -184,16 +184,13 @@ command: >
:!xterm -e vim +help &
<
*:helpfind* *:helpf*
:helpf[ind] Like |:help|, but use a dialog to enter the argument.
Only for backwards compatibility. It now executes the
ToolBar.FindHelp menu entry instead of using a builtin
dialog. {only when compiled with |+GUI_GTK|}
*:helpt* *:helptags*
*E154* *E150* *E151* *E152* *E153* *E670*
:helpt[ags] [++t] {dir}
Generate the help tags file(s) for directory {dir}.
When {dir} is ALL then all "doc" directories in
'runtimepath' will be used.
All "*.txt" and "*.??x" files in the directory and
sub-directories are scanned for a help tag definition
in between stars. The "*.??x" files are for
@ -202,9 +199,11 @@ command: >
sorted.
When there are duplicates an error message is given.
An existing tags file is silently overwritten.
The optional "++t" argument forces adding the
"help-tags" tag. This is also done when the {dir} is
equal to $VIMRUNTIME/doc.
To rebuild the help tags in the runtime directory
(requires write permission there): >
:helptags $VIMRUNTIME/doc
@ -255,7 +254,9 @@ The second one finds the English user manual, even when 'helplang' is set to
When using command-line completion for the ":help" command, the "@en"
extension is only shown when a tag exists for multiple languages. When the
tag only exists for English "@en" is omitted.
tag only exists for English "@en" is omitted. When the first candidate has an
"@ab" extension and it matches the first language in 'helplang' "@ab" is also
omitted.
When using |CTRL-]| or ":help!" in a non-English help file Vim will try to
find the tag in the same language. If not found then 'helplang' will be used
@ -312,6 +313,10 @@ aligned on a line.
When referring to an existing help tag and to create a hot-link, place the
name between two bars (|) eg. |help-writing|.
When referring to a Vim command and to create a hot-link, place the
name between two backticks, eg. inside `:filetype`. You will see this is
highlighted as a command, like a code block (see below).
When referring to a Vim option in the help file, place the option name between
two single quotes, eg. 'statusline'

View File

@ -128,6 +128,7 @@ The available subcommands are:
6 or e: Find this egrep pattern
7 or f: Find this file
8 or i: Find files #including this file
9 or a: Find places where this symbol is assigned a value
For all types, except 4 and 6, leading white space for {name} is
removed. For 4 and 6 there is exactly one space between {querytype}
@ -254,13 +255,13 @@ started will have no effect!
{not available when compiled without the |+quickfix| feature}
'cscopequickfix' specifies whether to use quickfix window to show cscope
results. This is a list of comma-separated values. Each item consists of
|cscope-find| command (s, g, d, c, t, e, f or i) and flag (+, - or 0).
|cscope-find| command (s, g, d, c, t, e, f, i or a) and flag (+, - or 0).
'+' indicates that results must be appended to quickfix window,
'-' implies previous results clearance, '0' or command absence - don't use
quickfix. Search is performed from start until first command occurrence.
The default value is "" (don't use quickfix anyway). The following value
seems to be useful: >
:set cscopequickfix=s-,c-,d-,i-,t-,e-
:set cscopequickfix=s-,c-,d-,i-,t-,e-,a-
<
*cscopetag* *cst*
If 'cscopetag' is set, the commands ":tag" and CTRL-] as well as "vim -t"
@ -418,6 +419,7 @@ Cscope Home Page (http://cscope.sourceforge.net/): >
nmap <C-_>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-_>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-_>d :cs find d <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>a :cs find a <C-R>=expand("<cword>")<CR><CR>
" Using 'CTRL-spacebar' then a search type makes the vim window
" split horizontally, with search result displayed in
@ -431,6 +433,7 @@ Cscope Home Page (http://cscope.sourceforge.net/): >
nmap <C-Space>f :scs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-Space>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-Space>d :scs find d <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space>a :scs find a <C-R>=expand("<cword>")<CR><CR>
" Hitting CTRL-space *twice* before the search type does a vertical
" split instead of a horizontal one
@ -449,6 +452,8 @@ Cscope Home Page (http://cscope.sourceforge.net/): >
\:vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-Space><C-Space>d
\:vert scs find d <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space><C-Space>a
\:vert scs find a <C-R>=expand("<cword>")<CR><CR>
==============================================================================
7. Cscope availability and information *cscope-info*

View File

@ -16,7 +16,7 @@ The Python Interface to Vim *python* *Python*
8. pyeval(), py3eval() Vim functions |python-pyeval|
9. Python 3 |python3|
See |nvim-python| for more information. {Nvim}
See |provider-python| for more information. {Nvim}
==============================================================================
1. Commands *python-commands*

185
runtime/doc/if_ruby.txt Normal file
View File

@ -0,0 +1,185 @@
*if_ruby.txt*
VIM REFERENCE MANUAL by Shugo Maeda
The Ruby Interface to Vim *ruby* *Ruby*
1. Commands |ruby-commands|
2. The VIM module |ruby-vim|
3. VIM::Buffer objects |ruby-buffer|
4. VIM::Window objects |ruby-window|
5. Global variables |ruby-globals|
*E266* *E267* *E268* *E269* *E270* *E271* *E272* *E273*
The home page for ruby is http://www.ruby-lang.org/. You can find links for
downloading Ruby there.
==============================================================================
1. Commands *ruby-commands*
*:ruby* *:rub*
:rub[y] {cmd} Execute Ruby command {cmd}. A command to try it out: >
:ruby print "Hello"
:rub[y] << {endpattern}
{script}
{endpattern}
Execute Ruby script {script}.
{endpattern} must NOT be preceded by any white space.
If {endpattern} is omitted, it defaults to a dot '.'
like for the |:append| and |:insert| commands. This
form of the |:ruby| command is mainly useful for
including ruby code in vim scripts.
Note: This command doesn't work when the Ruby feature
wasn't compiled in. To avoid errors, see
|script-here|.
Example Vim script: >
function! RedGem()
ruby << EOF
class Garnet
def initialize(s)
@buffer = VIM::Buffer.current
vimputs(s)
end
def vimputs(s)
@buffer.append(@buffer.count,s)
end
end
gem = Garnet.new("pretty")
EOF
endfunction
<
*:rubydo* *:rubyd* *E265*
:[range]rubyd[o] {cmd} Evaluate Ruby command {cmd} for each line in the
[range], with $_ being set to the text of each line in
turn, without a trailing <EOL>. Setting $_ will change
the text, but note that it is not possible to add or
delete lines using this command.
The default for [range] is the whole file: "1,$".
*:rubyfile* *:rubyf*
:rubyf[ile] {file} Execute the Ruby script in {file}. This is the same as
":ruby load 'file'", but allows file name completion.
Executing Ruby commands is not possible in the |sandbox|.
==============================================================================
2. The VIM module *ruby-vim*
Ruby code gets all of its access to vim via the "VIM" module.
Overview >
print "Hello" # displays a message
VIM.command(cmd) # execute an Ex command
num = VIM::Window.count # gets the number of windows
w = VIM::Window[n] # gets window "n"
cw = VIM::Window.current # gets the current window
num = VIM::Buffer.count # gets the number of buffers
b = VIM::Buffer[n] # gets buffer "n"
cb = VIM::Buffer.current # gets the current buffer
w.height = lines # sets the window height
w.cursor = [row, col] # sets the window cursor position
pos = w.cursor # gets an array [row, col]
name = b.name # gets the buffer file name
line = b[n] # gets a line from the buffer
num = b.count # gets the number of lines
b[n] = str # sets a line in the buffer
b.delete(n) # deletes a line
b.append(n, str) # appends a line after n
line = VIM::Buffer.current.line # gets the current line
num = VIM::Buffer.current.line_number # gets the current line number
VIM::Buffer.current.line = "test" # sets the current line number
<
Module Functions:
*ruby-message*
VIM::message({msg})
Displays the message {msg}.
*ruby-set_option*
VIM::set_option({arg})
Sets a vim option. {arg} can be any argument that the ":set" command
accepts. Note that this means that no spaces are allowed in the
argument! See |:set|.
*ruby-command*
VIM::command({cmd})
Executes Ex command {cmd}.
*ruby-evaluate*
VIM::evaluate({expr})
Evaluates {expr} using the vim internal expression evaluator (see
|expression|). Returns the expression result as a string.
A |List| is turned into a string by joining the items and inserting
line breaks.
==============================================================================
3. VIM::Buffer objects *ruby-buffer*
VIM::Buffer objects represent vim buffers.
Class Methods:
current Returns the current buffer object.
count Returns the number of buffers.
self[{n}] Returns the buffer object for the number {n}. The first number
is 0.
Methods:
name Returns the name of the buffer.
number Returns the number of the buffer.
count Returns the number of lines.
length Returns the number of lines.
self[{n}] Returns a line from the buffer. {n} is the line number.
self[{n}] = {str}
Sets a line in the buffer. {n} is the line number.
delete({n}) Deletes a line from the buffer. {n} is the line number.
append({n}, {str})
Appends a line after the line {n}.
line Returns the current line of the buffer if the buffer is
active.
line = {str} Sets the current line of the buffer if the buffer is active.
line_number Returns the number of the current line if the buffer is
active.
==============================================================================
4. VIM::Window objects *ruby-window*
VIM::Window objects represent vim windows.
Class Methods:
current Returns the current window object.
count Returns the number of windows.
self[{n}] Returns the window object for the number {n}. The first number
is 0.
Methods:
buffer Returns the buffer displayed in the window.
height Returns the height of the window.
height = {n} Sets the window height to {n}.
width Returns the width of the window.
width = {n} Sets the window width to {n}.
cursor Returns a [row, col] array for the cursor position.
cursor = [{row}, {col}]
Sets the cursor position to {row} and {col}.
==============================================================================
5. Global variables *ruby-globals*
There are two global variables.
$curwin The current window object.
$curbuf The current buffer object.
==============================================================================
vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,4 +1,4 @@
*index.txt* For Vim version 7.4. Last change: 2015 Jan 07
*index.txt* For Vim version 7.4. Last change: 2016 Mar 12
VIM REFERENCE MANUAL by Bram Moolenaar
@ -700,12 +700,16 @@ tag char note action in Normal mode ~
|g'| g'{mark} 1 like |'| but without changing the jumplist
|g`| g`{mark} 1 like |`| but without changing the jumplist
|gstar| g* 1 like "*", but without using "\<" and "\>"
|g+| g+ go to newer text state N times
|g,| g, 1 go to N newer position in change list
|g-| g- go to older text state N times
|g0| g0 1 when 'wrap' off go to leftmost character of
the current line that is on the screen;
when 'wrap' on go to the leftmost character
of the current screen line
|g8| g8 print hex value of bytes used in UTF-8
character under the cursor
|g;| g; 1 go to N older position in change list
|g<| g< display previous command output
|g?| g? 2 Rot13 encoding operator
|g?g?| g?? 2 Rot13 encode current line
@ -734,6 +738,7 @@ tag char note action in Normal mode ~
the screen; when 'wrap' on go to the
leftmost non-white character of the current
screen line
|g_| g_ 1 cursor to the last CHAR N - 1 lines lower
|ga| ga print ascii value of character under the
cursor
|gd| gd 1 go to definition of word under the cursor
@ -1128,6 +1133,8 @@ tag command action ~
|:cc| :cc go to specific error
|:cclose| :ccl[ose] close quickfix window
|:cd| :cd change directory
|:cdo| :cdo execute command in each valid error list entry
|:cfdo| :cfdo execute command in each file in error list
|:center| :ce[nter] format lines at the center
|:cexpr| :cex[pr] read errors from expr and jump to first
|:cfile| :cf[ile] read file with error messages and jump to first
@ -1164,7 +1171,7 @@ tag command action ~
|:cpfile| :cpf[ile] go to last error in previous file
|:cquit| :cq[uit] quit Vim with an error code
|:crewind| :cr[ewind] go to the specified error, default first one
|:cscope| :cs[cope] execute cscope command
|:cscope| :cs[cope] execute cscope command
|:cstag| :cst[ag] use cscope to jump to a tag
|:cunmap| :cu[nmap] like ":unmap" but for Command-line mode
|:cunabbrev| :cuna[bbrev] like ":unabbrev" but for Command-line mode
@ -1239,7 +1246,6 @@ tag command action ~
|:hardcopy| :ha[rdcopy] send text to the printer
|:help| :h[elp] open a help window
|:helpclose| :helpc[lose] close one help window
|:helpfind| :helpf[ind] dialog to open a help window
|:helpgrep| :helpg[rep] like ":grep" but searches help files
|:helptags| :helpt[ags] generate help tags for a directory
|:highlight| :hi[ghlight] specify highlighting methods
@ -1284,7 +1290,9 @@ tag command action ~
|:lcd| :lc[d] change directory locally
|:lchdir| :lch[dir] change directory locally
|:lclose| :lcl[ose] close location window
|:lcscope| :lcs[cope] like ":cscope" but uses location list
|:lcscope| :lcs[cope] like ":cscope" but uses location list
|:ldo| :ld[o] execute command in valid location list entries
|:lfdo| :lfd[o] execute command in each file in location list
|:left| :le[ft] left align lines
|:leftabove| :lefta[bove] make split window appear left or above
|:let| :let assign a value to a variable or option
@ -1333,7 +1341,7 @@ tag command action ~
|:marks| :marks list all marks
|:match| :mat[ch] define a match to highlight
|:menu| :me[nu] enter a new menu item
|:menutranslate| :menut[ranslate] add a menu translation item
|:menutranslate| :menut[ranslate] add a menu translation item
|:messages| :mes[sages] view previously displayed messages
|:mkexrc| :mk[exrc] write current mappings and settings to a file
|:mksession| :mks[ession] write session info to a file
@ -1370,6 +1378,8 @@ tag command action ~
|:ounmap| :ou[nmap] like ":unmap" but for Operator-pending mode
|:ounmenu| :ounme[nu] remove menu for Operator-pending mode
|:ownsyntax| :ow[nsyntax] set new local syntax highlight for this window
|:packadd| :pa[ckadd] add a plugin from 'packpath'
|:packloadall| :packl[oadall] load all packages under 'packpath'
|:pclose| :pc[lose] close preview window
|:pedit| :ped[it] edit file in the preview window
|:print| :p[rint] print lines
@ -1486,7 +1496,7 @@ tag command action ~
|:stop| :st[op] suspend the editor or escape to a shell
|:stag| :sta[g] split window and jump to a tag
|:startinsert| :star[tinsert] start Insert mode
|:startgreplace| :startg[replace] start Virtual Replace mode
|:startgreplace| :startg[replace] start Virtual Replace mode
|:startreplace| :startr[eplace] start Replace mode
|:stopinsert| :stopi[nsert] stop Insert mode
|:stjump| :stj[ump] do ":tjump" and split window
@ -1507,14 +1517,14 @@ tag command action ~
|:tabdo| :tabdo execute command in each tab page
|:tabedit| :tabe[dit] edit a file in a new tab page
|:tabfind| :tabf[ind] find file in 'path', edit it in a new tab page
|:tabfirst| :tabfir[st] got to first tab page
|:tablast| :tabl[ast] got to last tab page
|:tabfirst| :tabfir[st] go to first tab page
|:tablast| :tabl[ast] go to last tab page
|:tabmove| :tabm[ove] move tab page to other position
|:tabnew| :tabnew edit a file in a new tab page
|:tabnext| :tabn[ext] go to next tab page
|:tabonly| :tabo[nly] close all tab pages except the current one
|:tabprevious| :tabp[revious] go to previous tab page
|:tabrewind| :tabr[ewind] got to first tab page
|:tabrewind| :tabr[ewind] go to first tab page
|:tabs| :tabs list the tab pages and what they contain
|:tab| :tab create new tab when opening new window
|:tag| :ta[g] jump to tag

View File

@ -1,4 +1,4 @@
*insert.txt* For Vim version 7.4. Last change: 2015 May 22
*insert.txt* For Vim version 7.4. Last change: 2016 Jan 31
VIM REFERENCE MANUAL by Bram Moolenaar
@ -78,8 +78,8 @@ CTRL-W Delete the word before the cursor (see |i_backspacing| about
|word-motions|, for the definition of a word.
*i_CTRL-U*
CTRL-U Delete all entered characters before the cursor in the current
line. If there are no newly entereed characters and
'backspace'is not empty, delete all characters before the
line. If there are no newly entered characters and
'backspace' is not empty, delete all characters before the
cursor in the current line.
See |i_backspacing| about joining lines.
*i_CTRL-I* *i_<Tab>* *i_Tab*
@ -148,7 +148,7 @@ CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R*
CTRL-R a results in "ac".
CTRL-R CTRL-R a results in "ab^Hc".
< Options 'textwidth', 'formatoptions', etc. still apply. If
you also want to avoid these, use "<C-R><C-O>r", see below.
you also want to avoid these, use CTRL-R CTRL-O, see below.
The '.' register (last inserted text) is still inserted as
typed.
@ -1436,7 +1436,7 @@ original HTML files completion of tags (and only tags) isn't context aware.
RUBY *ft-ruby-omni* {Nvim}
NOTE: Completion for ruby code is not currently provided by Nvim.
NOTE: |compl-omni| for Ruby code requires |provider-ruby| to be installed.
Ruby completion will parse your buffer on demand in order to provide a list of
completions. These completions will be drawn from modules loaded by 'require'
@ -1941,9 +1941,9 @@ If the 'fileformats' option is not empty Vim tries to recognize the type of
changed, the detected format is only used while reading the file.
A similar thing happens with 'fileencodings'.
On non-MS-DOS and Win32 systems the message "[dos format]" is shown if
On non-Windows systems the message "[dos format]" is shown if
a file is read in DOS format, to remind you that something unusual is done.
On Macintosh, MS-DOS, and Win32 the message "[unix format]" is shown if
On Macintosh and Windows the message "[unix format]" is shown if
a file is read in Unix format.
On non-Macintosh systems, the message "[Mac format]" is shown if a file is
read in Mac format.

View File

@ -1,4 +1,4 @@
*intro.txt* For Vim version 7.4. Last change: 2014 May 24
*intro.txt* For Vim version 7.4. Last change: 2015 Jan 20
VIM REFERENCE MANUAL by Bram Moolenaar
@ -131,7 +131,7 @@ http://www.vim.org/maillist.php
Bug reports: *bugs* *bug-reports* *bugreport.vim*
Send bug reports to: Vim Developers <vim_dev@vim.org>
Send bug reports to: Vim Developers <vim-dev@vim.org>
This is a maillist, you need to become a member first and many people will see
the message. If you don't want that, e.g. because it is a security issue,
send it to <bugs@vim.org>, this only goes to the Vim maintainer (that's Bram).
@ -251,7 +251,7 @@ Vim would never have become what it is now, without the help of these people!
lots of patches
Ingo Wilken Tcl interface
Mike Williams PostScript printing
Juergen Weigert Lattice version, AUX improvements, UNIX and
Juergen Weigert Lattice version, AUX improvements, Unix and
MS-DOS ports, autoconf
Stefan 'Sec' Zehl Maintainer of vim.org
@ -452,7 +452,7 @@ notation meaning equivalent decimal value(s) ~
<C-...> control-key *control* *ctrl* *<C-*
<M-...> alt-key or meta-key *meta* *alt* *<M-*
<A-...> same as <M-...> *<A-*
<D-...> command-key (Macintosh only) *<D-*
<D-...> command-key or "super" key *<D-*
<t_xx> key with "xx" entry in termcap
-----------------------------------------------------------------------

View File

@ -40,7 +40,7 @@ for details.
Job control is achieved by calling a combination of the |jobstart()|,
|jobsend()| and |jobstop()| functions. Here's an example:
>
function s:JobHandler(job_id, data, event)
function! s:JobHandler(job_id, data, event)
if a:event == 'stdout'
let str = self.shell.' stdout: '.join(a:data)
elseif a:event == 'stderr'
@ -84,6 +84,19 @@ Here's what is happening:
program.
2: The event type, which is "stdout", "stderr" or "exit".
Note: Buffered stdout/stderr data which has not been flushed by the sender
will not trigger the "stdout" callback (but if the process ends, the
"exit" callback will be triggered).
For example, "ruby -e" buffers output, so small strings will be
buffered unless "auto-flushing" ($stdout.sync=true) is enabled. >
function! Receive(job_id, data, event)
echom printf('%s: %s',a:event,string(a:data))
endfunction
call jobstart(['ruby', '-e',
\ '$stdout.sync = true; 5.times do sleep 1 and puts "Hello Ruby!" end'],
\ {'on_stdout': 'Receive'})
< https://github.com/neovim/neovim/issues/1592
The options dictionary is passed as the "self" variable to the callback
function. Here's a more object-oriented version of the above:
>

View File

@ -1,4 +1,4 @@
*map.txt* For Vim version 7.4. Last change: 2014 Oct 03
*map.txt* For Vim version 7.4. Last change: 2016 Jan 10
VIM REFERENCE MANUAL by Bram Moolenaar
@ -55,6 +55,7 @@ modes.
:im[ap] {lhs} {rhs} |mapmode-i| *:im* *:imap*
:lm[ap] {lhs} {rhs} |mapmode-l| *:lm* *:lmap*
:cm[ap] {lhs} {rhs} |mapmode-c| *:cm* *:cmap*
:tm[ap] {lhs} {rhs} |mapmode-t| *:tm* *:tmap*
Map the key sequence {lhs} to {rhs} for the modes
where the map command applies. The result, including
{rhs}, is then further scanned for mappings. This
@ -71,6 +72,7 @@ modes.
:ino[remap] {lhs} {rhs} |mapmode-i| *:ino* *:inoremap*
:ln[oremap] {lhs} {rhs} |mapmode-l| *:ln* *:lnoremap*
:cno[remap] {lhs} {rhs} |mapmode-c| *:cno* *:cnoremap*
:tno[remap] {lhs} {rhs} |mapmode-t| *:tno* *:tnoremap*
Map the key sequence {lhs} to {rhs} for the modes
where the map command applies. Disallow mapping of
{rhs}, to avoid nested and recursive mappings. Often
@ -87,6 +89,7 @@ modes.
:iu[nmap] {lhs} |mapmode-i| *:iu* *:iunmap*
:lu[nmap] {lhs} |mapmode-l| *:lu* *:lunmap*
:cu[nmap] {lhs} |mapmode-c| *:cu* *:cunmap*
:tu[nmap] {lhs} |mapmode-t| *:tu* *:tunmap*
Remove the mapping of {lhs} for the modes where the
map command applies. The mapping may remain defined
for other modes where it applies.
@ -105,6 +108,7 @@ modes.
:imapc[lear] |mapmode-i| *:imapc* *:imapclear*
:lmapc[lear] |mapmode-l| *:lmapc* *:lmapclear*
:cmapc[lear] |mapmode-c| *:cmapc* *:cmapclear*
:tmapc[lear] |mapmode-t| *:tmapc* *:tmapclear*
Remove ALL mappings for the modes where the map
command applies.
Use the <buffer> argument to remove buffer-local
@ -121,6 +125,7 @@ modes.
:im[ap] |mapmode-i|
:lm[ap] |mapmode-l|
:cm[ap] |mapmode-c|
:tm[ap] |mapmode-t|
List all key mappings for the modes where the map
command applies. Note that ":map" and ":map!" are
used most often, because they include the other modes.
@ -135,6 +140,7 @@ modes.
:im[ap] {lhs} |mapmode-i| *:imap_l*
:lm[ap] {lhs} |mapmode-l| *:lmap_l*
:cm[ap] {lhs} |mapmode-c| *:cmap_l*
:tm[ap] {lhs} |mapmode-t| *:tmap_l*
List the key mappings for the key sequences starting
with {lhs} in the modes where the map command applies.
@ -288,9 +294,9 @@ as a special key.
1.3 MAPPING AND MODES *:map-modes*
*mapmode-nvo* *mapmode-n* *mapmode-v* *mapmode-o*
*mapmode-nvo* *mapmode-n* *mapmode-v* *mapmode-o* *mapmode-t*
There are six sets of mappings
There are seven sets of mappings
- For Normal mode: When typing commands.
- For Visual mode: When typing commands while the Visual area is highlighted.
- For Select mode: like Visual mode but typing text replaces the selection.
@ -298,6 +304,7 @@ There are six sets of mappings
etc.). See below: |omap-info|.
- For Insert mode. These are also used in Replace mode.
- For Command-line mode: When entering a ":" or "/" command.
- For Terminal mode: When typing in a |:terminal| buffer.
Special case: While typing a count for a command in Normal mode, mapping zero
is disabled. This makes it possible to map zero without making it impossible
@ -316,6 +323,7 @@ Overview of which map command works in which mode. More details below.
:imap :inoremap :iunmap Insert
:lmap :lnoremap :lunmap Insert, Command-line, Lang-Arg
:cmap :cnoremap :cunmap Command-line
:tmap :tnoremap :tunmap Terminal
COMMANDS MODES ~
@ -481,7 +489,7 @@ internal code is written to the script file.
1.6 SPECIAL CHARACTERS *:map-special-chars*
*map_backslash*
*map_backslash* *map-backslash*
Note that only CTRL-V is mentioned here as a special character for mappings
and abbreviations. When 'cpoptions' does not contain 'B', a backslash can
also be used like CTRL-V. The <> notation can be fully used then |<>|. But
@ -492,21 +500,21 @@ To map a backslash, or use a backslash literally in the {rhs}, the special
sequence "<Bslash>" can be used. This avoids the need to double backslashes
when using nested mappings.
*map_CTRL-C*
*map_CTRL-C* *map-CTRL-C*
Using CTRL-C in the {lhs} is possible, but it will only work when Vim is
waiting for a key, not when Vim is busy with something. When Vim is busy
CTRL-C interrupts/breaks the command.
When using the GUI version on MS-Windows CTRL-C can be mapped to allow a Copy
command to the clipboard. Use CTRL-Break to interrupt Vim.
*map_space_in_lhs*
*map_space_in_lhs* *map-space_in_lhs*
To include a space in {lhs} precede it with a CTRL-V (type two CTRL-Vs for
each space).
*map_space_in_rhs*
*map_space_in_rhs* *map-space_in_rhs*
If you want a {rhs} that starts with a space, use "<Space>". To be fully Vi
compatible (but unreadable) don't use the |<>| notation, precede {rhs} with a
single CTRL-V (you have to type CTRL-V two times).
*map_empty_rhs*
*map_empty_rhs* *map-empty-rhs*
You can create an empty {rhs} by typing nothing after a single CTRL-V (you
have to type CTRL-V two times). Unfortunately, you cannot do this in a vimrc
file.
@ -581,7 +589,7 @@ Upper and lowercase differences are ignored.
It is not possible to put a comment after these commands, because the '"'
character is considered to be part of the {lhs} or {rhs}.
*map_bar*
*map_bar* *map-bar*
Since the '|' character is used to separate a map command from the next
command, you will have to do something special to include a '|' in {rhs}.
There are three methods:
@ -599,7 +607,7 @@ When 'b' is present in 'cpoptions', "\|" will be recognized as a mapping
ending in a '\' and then another command. This is Vi compatible, but
illogical when compared to other commands.
*map_return*
*map_return* *map-return*
When you have a mapping that contains an Ex command, you need to put a line
terminator after it to have it executed. The use of <CR> is recommended for
this (see |<>|). Example: >
@ -1398,6 +1406,27 @@ The valid escape sequences are
<bang> (See the '-bang' attribute) Expands to a ! if the
command was executed with a ! modifier, otherwise
expands to nothing.
*<mods>*
<mods> The command modifiers, if specified. Otherwise, expands to
nothing. Supported modifiers are |aboveleft|, |belowright|,
|botright|, |browse|, |confirm|, |hide|, |keepalt|,
|keepjumps|, |keepmarks|, |keeppatterns|, |lockmarks|,
|noswapfile|, |silent|, |tab|, |topleft|, |verbose|, and
|vertical|.
Examples: >
command! -nargs=+ -complete=file MyEdit
\ for f in expand(<q-args>, 0, 1) |
\ exe '<mods> split ' . f |
\ endfor
function! SpecialEdit(files, mods)
for f in expand(a:files, 0, 1)
exe a:mods . ' split ' . f
endfor
endfunction
command! -nargs=+ -complete=file Sedit
\ call SpecialEdit(<q-args>, <q-mods>)
<
*<reg>* *<register>*
<reg> (See the '-register' attribute) The optional register,
if specified. Otherwise, expands to nothing. <register>

View File

@ -43,16 +43,6 @@ features. Unfortunately, every system has its own way to deal with multibyte
languages and it is quite complicated.
COMPILING
If you already have a compiled Vim program, check if the |+multi_byte| feature
is included. The |:version| command can be used for this.
If +multi_byte is not included, you should compile Vim with "normal", "big" or
"huge" features. You can further tune what features are included. See the
INSTALL files in the source directory.
LOCALE
First of all, you must make sure your current locale is set correctly. If
@ -107,14 +97,6 @@ is the difficult part. It depends on the system you are using, the locale and
a few other things. See the chapters on fonts: |mbyte-fonts-X11| for
X-Windows and |mbyte-fonts-MSwin| for MS-Windows.
For GTK+ 2, you can skip most of this section. The option 'guifontset' does
no longer exist. You only need to set 'guifont' and everything should "just
work". If your system comes with Xft2 and fontconfig and the current font
does not contain a certain glyph, a different font will be used automatically
if available. The 'guifontwide' option is still supported but usually you do
not need to set it. It is only necessary if the automatic font selection does
not suit your needs.
For X11 you can set the 'guifontset' option to a list of fonts that together
cover the characters that are used. Example for Korean: >
@ -494,11 +476,6 @@ For Vim you may need to set 'encoding' to "utf-8".
Unfortunately, using fonts in X11 is complicated. The name of a single-byte
font is a long string. For multi-byte fonts we need several of these...
Note: Most of this is no longer relevant for GTK+ 2. Selecting a font via
its XLFD is not supported; see 'guifont' for an example of how to
set the font. Do yourself a favor and ignore the |XLFD| and |xfontset|
sections below.
First of all, Vim only accepts fixed-width fonts for displaying text. You
cannot use proportionally spaced fonts. This excludes many of the available
(and nicer looking) fonts. However, for menus and tooltips any font can be
@ -629,52 +606,6 @@ If you use a wrong "font" argument you will get an error message.
Also make sure that you set 'guifontset' before setting fonts for highlight
groups.
USING RESOURCE FILES
Instead of specifying 'guifontset', you can set X11 resources and Vim will
pick them up. This is only for people who know how X resource files work.
For Motif and Athena insert these three lines in your $HOME/.Xdefaults file:
Vim.font: |base_font_name_list|
Vim*fontSet: |base_font_name_list|
Vim*fontList: your_language_font
Note: Vim.font is for text area.
Vim*fontSet is for menu.
Vim*fontList is for menu (for Motif GUI)
For example, when you are using Japanese and a 14 dots font, >
Vim.font: -misc-fixed-medium-r-normal--14-*
Vim*fontSet: -misc-fixed-medium-r-normal--14-*
Vim*fontList: -misc-fixed-medium-r-normal--14-*
<
or: >
Vim*font: k14,r14
Vim*fontSet: k14,r14
Vim*fontList: k14,r14
<
To have them take effect immediately you will have to do >
xrdb -merge ~/.Xdefaults
Otherwise you will have to stop and restart the X server before the changes
take effect.
The GTK+ version of GUI Vim does not use .Xdefaults, use ~/.gtkrc instead.
The default mostly works OK. But for the menus you might have to change
it. Example: >
style "default"
{
fontset="-*-*-medium-r-normal--14-*-*-*-c-*-*-*"
}
widget_class "*" style "default"
==============================================================================
6. Fonts on MS-Windows *mbyte-fonts-MSwin*
@ -847,20 +778,6 @@ For example, when you are using kinput2 as |IM-server| and sh, >
export XMODIFIERS="@im=kinput2"
<
FULLY CONTROLLED XIM
You can fully control XIM, like with IME of MS-Windows (see |multibyte-ime|).
This is currently only available for the GTK GUI.
Before using fully controlled XIM, one setting is required. Set the
'imactivatekey' option to the key that is used for the activation of the input
method. For example, when you are using kinput2 + canna as IM Server, the
activation key is probably Shift+Space: >
:set imactivatekey=S-space
See 'imactivatekey' for the format.
==============================================================================
8. Input on MS-Windows *mbyte-IME*
@ -893,14 +810,11 @@ WHAT IS IME
URL.
WHAT IS GLOBAL IME *global-ime*
Global IME makes capability to input Chinese, Japanese, and Korean text
into Vim buffer on any language version of Windows 98, Windows 95, and
Windows NT 4.0.
On Windows 2000 and XP it should work as well (without downloading). On
Windows 2000 Professional, Global IME is built in, and the Input Locales
can be added through Control Panel/Regional Options/Input Locales.
Please see below URL for detail of Global IME. You can also find various
language version of Global IME at same place.
Global IME enables input of Chinese, Japanese, and Korean text into Vim
buffer on any language version of Windows. Global IME is built in, and
the Input Locales can be added through Control Panel/Regional
Options/Input Locales. Please see below URL for detail of Global IME.
You can also find various language version of Global IME at same place.
- Global IME detailed information.
http://search.microsoft.com/results.aspx?q=global+ime
@ -1201,14 +1115,12 @@ internally.
Vim has comprehensive UTF-8 support. It works well in:
- xterm with utf-8 support enabled
- Athena, Motif and GTK GUI
- MS-Windows GUI
- several other platforms
Double-width characters are supported. This works best with 'guifontwide' or
'guifontset'. When using only 'guifont' the wide characters are drawn in the
normal width and a space to fill the gap. Note that the 'guifontset' option
is no longer relevant in the GTK+ 2 GUI.
normal width and a space to fill the gap.
*bom-bytes*
When reading a file a BOM (Byte Order Mark) can be used to recognize the
@ -1278,8 +1190,6 @@ doesn't always work. See the system specific remarks below, and 'langmenu'.
USING UTF-8 IN X-Windows *utf-8-in-xwindows*
Note: This section does not apply to the GTK+ 2 GUI.
You need to specify a font to be used. For double-wide characters another
font is required, which is exactly twice as wide. There are three ways to do
this:

View File

@ -1,4 +1,4 @@
*message.txt* For Vim version 7.4. Last change: 2013 Feb 23
*message.txt* For Vim version 7.4. Last change: 2016 Jul 14
VIM REFERENCE MANUAL by Bram Moolenaar
@ -401,12 +401,6 @@ You have used an ":unabbreviate" command with an argument which is not an
existing abbreviation. All variations of this command give the same message:
":cunabbrev", ":iunabbrev", etc. Check for trailing white space.
>
/dev/dsp: No such file or directory
Only given for GTK GUI with Gnome support. Gnome tries to use the audio
device and it isn't present. You can ignore this error.
*E31* >
No such mapping
@ -662,6 +656,12 @@ You must be using an awful lot of buffers. It's now possible that two buffers
have the same number, which causes various problems. You might want to exit
Vim and restart it.
*E931* >
Buffer cannot be registered
Out of memory or a duplicate buffer number. May habben after W14. Looking up
a buffer will not always work, better restart Vim.
*E296* *E297* >
Seek error in swap file write
Write error in swap file

View File

@ -1,4 +1,4 @@
*mlang.txt* For Vim version 7.4. Last change: 2012 Jan 15
*mlang.txt* For Vim version 7.4. Last change: 2016 Jan 16
VIM REFERENCE MANUAL by Bram Moolenaar
@ -94,13 +94,15 @@ If you used the self-installing .exe file, message translations should work
already. Otherwise get the libintl.dll file if you don't have it yet:
http://sourceforge.net/projects/gettext
Or:
https://mlocati.github.io/gettext-iconv-windows/
This also contains tools xgettext, msgformat and others.
libintl.dll should be placed in same directory with (g)vim.exe, or some
place where PATH environment value describe. Message files (vim.mo)
have to be placed in "$VIMRUNTIME/lang/xx/LC_MESSAGES", where "xx" is the
abbreviation of the language (mostly two letters).
place where PATH environment value describe. Vim also finds libintl-8.dll.
Message files (vim.mo) have to be placed in "$VIMRUNTIME/lang/xx/LC_MESSAGES",
where "xx" is the abbreviation of the language (mostly two letters).
If you write your own translations you need to generate the .po file and
convert it to a .mo file. You need to get the source distribution and read

View File

@ -1,4 +1,4 @@
*motion.txt* For Vim version 7.4. Last change: 2015 Jun 06
*motion.txt* For Vim version 7.4. Last change: 2016 Jul 12
VIM REFERENCE MANUAL by Bram Moolenaar
@ -569,7 +569,7 @@ i[ "inner [] block", select [count] '[' ']' blocks. This
When used in Visual mode it is made characterwise.
a) *v_a)* *a)* *a(*
a( *v_ab* *v_a(* *ab*
a( *vab* *v_ab* *v_a(* *ab*
ab "a block", select [count] blocks, from "[count] [(" to
the matching ')', including the '(' and ')' (see
|[(|). Does not include white space outside of the
@ -577,7 +577,7 @@ ab "a block", select [count] blocks, from "[count] [(" to
When used in Visual mode it is made characterwise.
i) *v_i)* *i)* *i(*
i( *v_ib* *v_i(* *ib*
i( *vib* *v_ib* *v_i(* *ib*
ib "inner block", select [count] blocks, from "[count] [("
to the matching ')', excluding the '(' and ')' (see
|[(|).

View File

@ -1,97 +1,93 @@
*msgpack_rpc.txt* For Nvim. {Nvim}
*msgpack_rpc.txt* {Nvim}
NVIM REFERENCE MANUAL by Thiago de Arruda
The Msgpack-RPC Interface to Nvim *msgpack-rpc*
RPC API for Nvim *RPC* *rpc* *msgpack-rpc*
1. Introduction |msgpack-rpc-intro|
2. API |msgpack-rpc-api|
3. Connecting |msgpack-rpc-connecting|
4. Clients |msgpack-rpc-clients|
5. Types |msgpack-rpc-types|
6. Wrapping methods |msgpack-rpc-wrap-methods|
7. Vimscript functions |msgpack-rpc-vim-functions|
1. Introduction |rpc-intro|
2. API mapping |rpc-api|
3. Connecting |rpc-connecting|
4. Clients |rpc-api-client|
5. Types |rpc-types|
6. Remote UIs |rpc-remote-ui|
==============================================================================
1. Introduction *msgpack-rpc-intro*
1. Introduction *rpc-intro*
The primary way to control a running Nvim instance is through
MessagePack-RPC, a messaging protocol that uses the MessagePack serialization
format: https://github.com/msgpack/msgpack/blob/7498cf3/spec.md.
From now on, we refer to the protocol as msgpack-rpc.
The primary way to control Nvim programmatically is the RPC API, which speaks
MessagePack-RPC ("msgpack-rpc"), a messaging protocol that uses the
MessagePack serialization format:
https://github.com/msgpack/msgpack/blob/0b8f5ac/spec.md
At this point, only plugins use msgpack-rpc, but eventually even user
interaction will happen through it, since user interfaces will be separate
programs that control a headless Nvim instance.
All kinds of Nvim "clients" use the RPC API: user interfaces (GUIs), remote
plugins, scripts like "nvr" (https://github.com/mhinz/neovim-remote), and even
`nvim` itself can control other `nvim` instances. By connecting to the RPC API
programs can:
By connecting to the msgpack-rpc interface, programs can:
- Call any API function
- Listen for events
- Receive remote calls from Nvim
- Call any Nvim API function
- Listen for Nvim events
- Receive remote calls from Nvim
Nvim's msgpack-rpc interface is like a more powerful version of Vim's
`clientserver` feature.
The RPC API is like a more powerful version of Vim's `clientserver` feature.
==============================================================================
2. API *msgpack-rpc-api*
2. API mapping *rpc-api*
The Nvim C API is automatically exposed to the msgpack-rpc interface by the
build system, which parses headers at src/nvim/api from the project root. A
dispatch function is generated, which matches msgpack-rpc method names with
non-static API functions, converting/validating arguments and return values
back to msgpack.
The Nvim C |API| is automatically exposed to the RPC API by the build system,
which parses headers at src/nvim/api/*. A dispatch function is generated which
matches RPC API method names with public API functions, converting/validating
arguments and return values back to msgpack.
Client libraries will normally provide wrappers that hide msgpack-rpc details
from programmers. The wrappers can be automatically generated by reading
bundled API metadata from a compiled Nvim instance.
Client libraries (|api-client|s) normally provide wrappers that hide
msgpack-rpc details from application developers. The wrappers can be
automatically generated by reading bundled API metadata from a compiled Nvim
instance.
There are two ways to obtain API metadata:
There are three ways to obtain API metadata:
1. By connecting to a running Nvim instance and calling `vim_get_api_info`
via msgpack-rpc. This is best for clients written in dynamically-typed
languages, which can define functions at runtime.
1. Connect to a running Nvim instance and call `nvim_get_api_info` via
msgpack-rpc. This is best for clients written in dynamic languages which
can define functions at runtime.
2. By starting Nvim with the `--api-info` command-line option, which makes Nvim
dump a blob of msgpack metadata to standard output and exit. This is best
for clients written in statically-typed languages, which require a separate
compilation step.
2. Start Nvim with the |--api-info| option. Useful for clients written in
statically-compiled languages.
Here's a simple way to get human-readable description of the API (requires
Python and the `pyyaml`/`msgpack-python` pip packages):
>
nvim --api-info | python -c 'import msgpack, sys, yaml; print yaml.dump(msgpack.unpackb(sys.stdin.read()))' > api.yaml
3. Use the |api_info()| vimscript function.
==============================================================================
3. Connecting *msgpack-rpc-connecting*
There are four ways to open msgpack-rpc streams to Nvim:
1. Through Nvim's stdin/stdout when it's started with the `--embed` option.
This is how other programs can embed Nvim.
2. Through the stdin/stdout of a program spawned by the |rpcstart()| function.
*$NVIM_LISTEN_ADDRESS*
3. Through the socket automatically created with each instance. To get the
socket location for a running Nvim instance (which is random by default),
see the |$NVIM_LISTEN_ADDRESS| environment variable:
>
:echo $NVIM_LISTEN_ADDRESS
To get a human-readable list of API functions: >
:new|put =map(api_info().functions, 'v:val.name')
<
See also |v:servername|.
To get a formatted dump of the API using python (requires the `pyyaml` and
`msgpack-python` packages): >
nvim --api-info | python -c 'import msgpack, sys, yaml; print yaml.dump(msgpack.unpackb(sys.stdin.read()))'
<
==============================================================================
3. Connecting *rpc-connecting*
4. Through a TCP/IP socket. To make Nvim listen on a TCP/IP socket, set the
|$NVIM_LISTEN_ADDRESS| environment variable in a shell before starting Nvim:
>
There are several ways to open a msgpack-rpc channel to an Nvim instance:
1. Through stdin/stdout when `nvim` is started with `--embed`. This is how
applications can embed Nvim.
2. Through stdin/stdout of some other process spawned by |jobstart()|.
Set the "rpc" key to |v:true| in the options dict to use the job's stdin
and stdout as a single msgpack channel that is processed directly by
Nvim. Then it is not possible to process raw data to or from the
process's stdin and stdout. stderr can still be used, though.
3. Through the socket automatically created with each instance. The socket
location is stored in |v:servername|.
4. Through a TCP/IP socket. To make Nvim listen on a TCP/IP socket, set the
|$NVIM_LISTEN_ADDRESS| environment variable before starting Nvim: >
NVIM_LISTEN_ADDRESS=127.0.0.1:6666 nvim
<
Connecting to the socket is the easiest way a programmer can test the API, which
can be done through any msgpack-rpc client library or fully-featured Nvim client
(which we'll see in the next section). Here's a Ruby script that prints 'hello
world!' in the current Nvim instance:
Connecting to the socket is the easiest way a programmer can test the API,
which can be done through any msgpack-rpc client library or full-featured
|api-client|. Here's a Ruby script that prints 'hello world!' in the current
Nvim instance:
>
#!/usr/bin/env ruby
# Requires msgpack-rpc: gem install msgpack-rpc
@ -109,7 +105,7 @@ world!' in the current Nvim instance:
require 'msgpack/rpc/transport/unix'
nvim = MessagePack::RPC::Client.new(MessagePack::RPC::UNIXTransport.new, ENV['NVIM_LISTEN_ADDRESS'])
result = nvim.call(:vim_command, 'echo "hello world!"')
result = nvim.call(:nvim_command, 'echo "hello world!"')
<
A better way is to use the Python REPL with the `neovim` package, where API
functions can be called interactively:
@ -118,72 +114,110 @@ functions can be called interactively:
>>> nvim = attach('socket', path='[address]')
>>> nvim.command('echo "hello world!"')
<
One can also spawn and connect to an embedded Nvim instance via |rpcstart()|
You can also embed an Nvim instance via |jobstart()|, and communicate using
|rpcrequest()| and |rpcnotify()|:
>
let vim = rpcstart('nvim', ['--embed'])
echo rpcrequest(vim, 'vim_eval', '"Hello " . "world!"')
call rpcstop(vim)
let nvim = jobstart(['nvim', '--embed'], {'rpc': v:true})
echo rpcrequest(nvim, 'nvim_eval', '"Hello " . "world!"')
call jobstop(nvim)
<
==============================================================================
4. Implementing new clients *msgpack-rpc-clients*
4. Implementing API clients *rpc-api-client* *api-client*
Nvim is still in alpha, so there's no in-depth documentation explaining how to
properly implement a client library yet. The Python client (the pip package
"neovim") will always be up-to-date with the latest API changes, so its source
code is the best documentation currently available. There are some guidelines
however:
"API clients" wrap the Nvim API to provide idiomatic "SDKs" for their
respective platforms (see |dev-jargon|). You can build a new API client for
your favorite platform or programming language.
- Separate the transport layer from the rest of the library. See
|msgpack-rpc-connecting| for details on how clients can connect to Nvim.
- Use a MessagePack library that implements at least version 5 of the
MessagePack spec, which supports the `bin` and `ext` types used by Nvim.
- Read API metadata in order to create client-side wrappers for all
msgpack-rpc methods.
- Use a single-threaded event loop library/pattern.
- Use a fiber/coroutine library for the language being used for implementing a
client. These greatly simplify concurrency and allow the library to expose a
blocking API on top of a non-blocking event loop without the complexity that
comes with preemptive multitasking.
- Don't assume anything about the order that responses to msgpack-rpc requests
will arrive.
- Clients should expect msgpack-rpc requests, which need to be handled
immediately because Nvim is blocked while waiting for the client response.
- Clients should expect to receive msgpack-rpc notifications, but these don't
need to be handled immediately because they won't block Nvim (although they
should probably be handled immediately anyway).
Existing API clients are listed here:
https://github.com/neovim/neovim/wiki/Related-projects#api-clients
Most of the complexity could be handled by a msgpack-rpc library that supports
server to client requests and notifications, but it's not clear if this is part
of the msgpack-rpc spec. At least the Ruby msgpack-rpc library does not seem
to support it:
The Python client is the reference implementation for API clients. It is
always up-to-date with the Nvim API, so its source code and test suite are
authoritative references.
https://github.com/neovim/python-client
API client implementation guidelines ~
- Separate the transport layer from the rest of the library. See
|rpc-connecting| for details on how clients can connect to Nvim.
- Use a MessagePack library that implements at least version 5 of the
MessagePack spec, which supports the `bin` and `ext` types used by Nvim.
- Read API metadata in order to create client-side wrappers for all
msgpack-rpc methods.
- Use a single-threaded event loop library/pattern.
- Use a fiber/coroutine library for the language being used for implementing
a client. These greatly simplify concurrency and allow the library to
expose a blocking API on top of a non-blocking event loop without the
complexity that comes with preemptive multitasking.
- Don't assume anything about the order that responses to msgpack-rpc
requests will arrive.
- Clients should expect msgpack-rpc requests, which need to be handled
immediately because Nvim is blocked while waiting for the client response.
- Clients should expect to receive msgpack-rpc notifications, but these
don't need to be handled immediately because they won't block Nvim
(although they should probably be handled immediately anyway).
Note: Most of the complexity could be handled by a msgpack-rpc library that
supports server to client requests and notifications, but it's not clear if
this is part of the msgpack-rpc spec. At least the Ruby msgpack-rpc library
does not seem to support it:
https://github.com/msgpack-rpc/msgpack-rpc-ruby/blob/master/lib/msgpack/rpc/transport/tcp.rb#L150-L158
API metadata object ~
API clients exist to hide msgpack-rpc details. The API metadata object
contains information that makes this task easier (see also |rpc-types|):
- The "version" key contains the Nvim version, API level, and API
backwards-compatibility level.
- The "functions" key contains a list of metadata objects for individual
functions.
- Each function metadata object has |rpc-types| information about the return
value and parameters. These can be used for generating strongly-typed APIs
in static languages.
- Container types may be decorated with type/size constraints, e.g.
ArrayOf(Buffer) or ArrayOf(Integer, 2). This can be useful to generate
even more strongly-typed APIs.
- Functions that are considered to be methods that operate on instances of
Nvim special types (msgpack EXT) will have the `"method"` attribute set to
`true`. The reciever type is the type of the first argument. The method
names are prefixed with `nvim_` plus a shortened type name, e.g.
`nvim_buf_get_lines` represents the `get_lines` method of a Buffer instance.
- Global functions have `"method"` set to `false` and are prefixed with just
`nvim_`, e.g. `nvim_get_buffers`.
So for an object-oriented language, an API client contains the classes
representing Nvim special types, and the methods of each class could be
defined by stripping the prefix for the type as defined in the `types` metadata
(this will always be the first two "_"-separated parts of the function name).
There could also be a singleton Vim class with methods where the `nvim_`
prefix is stripped off.
==============================================================================
5. Types *msgpack-rpc-types*
5. Types *rpc-types*
Nvim's C API uses custom types for all functions (some are just typedefs
around C99 standard types). The types can be split into two groups:
The Nvim C API uses custom types for all functions. |api-types|
For the purpose of mapping to msgpack, the types can be split into two groups:
- Basic types that map natively to msgpack (and probably have a default
representation in msgpack-supported programming languages)
- Special Nvim types that map to msgpack EXT with custom type codes.
- Basic types that map natively to msgpack (and probably have a default
representation in msgpack-supported programming languages)
- Special Nvim types that map to msgpack EXT with custom type codes.
Basic type mapping:
Basic types ~
Nil -> msgpack nil
Boolean -> msgpack boolean
Integer (signed 64-bit integer) -> msgpack integer
Float (IEEE 754 double precision) -> msgpack float
String -> msgpack string
Array -> msgpack array
Dictionary -> msgpack map
Nil -> msgpack nil
Boolean -> msgpack boolean
Integer (signed 64-bit integer) -> msgpack integer
Float (IEEE 754 double precision) -> msgpack float
String -> msgpack string
Array -> msgpack array
Dictionary -> msgpack map
Special Nvim types that use msgpack EXT:
Special types (msgpack EXT) ~
Buffer -> enum value kObjectTypeBuffer
Window -> enum value kObjectTypeWindow
Tabpage -> enum value kObjectTypeTabpage
Buffer -> enum value kObjectTypeBuffer
Window -> enum value kObjectTypeWindow
Tabpage -> enum value kObjectTypeTabpage
An API method expecting one of these types may be passed an integer instead,
although they are not interchangeable. For example, a Buffer may be passed as
@ -191,70 +225,192 @@ an integer, but not a Window or Tabpage.
The most reliable way of determining the type codes for the special Nvim types
is to inspect the `types` key of metadata dictionary returned by the
`vim_get_api_info` method at runtime. Here's an example JSON representation of
`nvim_get_api_info` method at runtime. Here's a sample JSON representation of
the `types` object:
>
"types": {
"Buffer": {
"id": 0
"id": 0,
"prefix": "nvim_buf_"
},
"Window": {
"id": 1
"id": 1,
"prefix": "nvim_win_"
},
"Tabpage": {
"id": 2
"id": 2,
"prefix": "nvim_tabpage_"
}
}
<
Even for statically compiled clients, it's a good practice to avoid hardcoding
the type codes, because a client may be built against one Nvim version but connect
to another with different type codes.
Even for statically compiled clients it is good practice to avoid hardcoding
the type codes, because a client may be built against one Nvim version but
connect to another with different type codes.
==============================================================================
6. Wrapping methods *msgpack-rpc-wrap-methods*
6. Remote UIs *rpc-remote-ui*
As mentioned before, clients should provide an API that hides msgpack-rpc
details from programmers, and the API metadata object contains information
that makes this task easier:
Nvim allows Graphical user interfaces to be implemented by separate processes
communicating with Nvim over the RPC API. Currently the ui model conists of a
terminal-like grid with one single, monospace font size, with a few elements
that could be drawn separately from the grid (for the momemnt only the popup
menu)
- The "functions" key contains a list of metadata objects for individual
functions.
- Each function metadata object has type information about the return value
and parameters. These can be used for generating strongly-typed APIs in
static languages.
- Container types may be decorated with type/size constraints, e.g.
ArrayOf(Buffer) or ArrayOf(Integer, 2). This can be useful to generate even
more strongly-typed APIs.
- Methods that operate instances of Nvim's types are prefixed with the type
name in lower case, e.g. `buffer_get_line` represents the `get_line` method
of a Buffer instance.
- Global methods are prefixed with `vim`, e.g. `vim_get_buffers`.
After connecting to a nvim instance (typically a spawned, embedded instance)
use the |nvim_ui_attach|(width, height, options) API method to tell nvim that your
program wants to draw the nvim screen on a grid with "width" times
"height" cells. "options" should be a dictionary with the following (all
optional) keys:
`rgb`: Controls what color format to use.
Set to true (default) to use 24-bit rgb
colors.
Set to false to use terminal color codes (at
most 256 different colors).
`popupmenu_external`: Instead of drawing the completion popupmenu on
the grid, Nvim will send higher-level events to
the ui and let it draw the popupmenu.
Defaults to false.
So, for an object-oriented language, a client library would have the classes
that represent Nvim's types, and the methods of each class could be defined
by inspecting the method name prefix. There could also be a singleton Vim
class with methods mapped to functions prefixed with `vim_`
Nvim will then send msgpack-rpc notifications, with the method name "redraw"
and a single argument, an array of screen updates (described below).
These should be processed in order. Preferably the user should only be able to
see the screen state after all updates are processed (not any intermediate
state after processing only a part of the array).
==============================================================================
7. Vimscript functions *msgpack-rpc-vim-functions*
Screen updates are arrays. The first element a string describing the kind
of update.
Four msgpack-rpc functions are available in Vimscript:
["resize", width, height]
The grid is resized to `width` and `height` cells.
1. |rpcstart()|: Similarly to |jobstart()|, this will spawn a co-process with
its standard handles connected to Nvim. The difference is that it's not
possible to process raw data to or from the process's stdin, stdout, or
stderr. This is because the job's stdin and stdout are used as a single
msgpack channel that is processed directly by Nvim.
["clear"]
Clear the screen.
2. |rpcstop()|: Same as |jobstop()|, but operates on handles returned by
|rpcstart()|.
["eol_clear"]
Clear from the cursor position to the end of the current line.
3. |rpcrequest()|: Sends a msgpack-rpc request to the process.
["cursor_goto", row, col]
Move the cursor to position (row, col). Currently, the same cursor is
used to define the position for text insertion and the visible cursor.
However, only the last cursor position, after processing the entire
array in the "redraw" event, is intended to be a visible cursor
position.
4. |rpcnotify()|: Sends a msgpack-rpc notification to the process.
["update_fg", color]
["update_bg", color]
["update_sp", color]
Set the default foreground, background and special colors
respectively.
The last two functions may also be used with channels created from
connections to |$NVIM_LISTEN_ADDRESS|.
["highlight_set", attrs]
Set the attributes that the next text put on the screen will have.
`attrs` is a dict with the keys below. Any absent key is reset
to its default value. Color defaults are set by the `update_fg` etc
updates. All boolean keys default to false.
`foreground`: foreground color.
`background`: backround color.
`special`: color to use for underline and undercurl, when present.
`reverse`: reverse video. Foreground and background colors are
switched.
`italic`: italic text.
`bold`: bold text.
`underline`: underlined text. The line has `special` color.
`undercurl`: undercurled text. The curl has `special` color.
["put", text]
The (utf-8 encoded) string `text` is put at the cursor position
(and the cursor is advanced), with the highlights as set by the
last `highlight_set` update.
["set_scroll_region", top, bot, left, right]
Define the scroll region used by `scroll` below.
["scroll", count]
Scroll the text in the scroll region. The diagrams below illustrate
what will happen, depending on the scroll direction. "=" is used to
represent the SR(scroll region) boundaries and "-" the moved rectangles.
Note that dst and src share a common region.
If count is bigger than 0, move a rectangle in the SR up, this can
happen while scrolling down.
>
+-------------------------+
| (clipped above SR) | ^
|=========================| dst_top |
| dst (still in SR) | |
+-------------------------+ src_top |
| src (moved up) and dst | |
|-------------------------| dst_bot |
| src (cleared) | |
+=========================+ src_bot
<
If count is less than zero, move a rectangle in the SR down, this can
happen while scrolling up.
>
+=========================+ src_top
| src (cleared) | |
|------------------------ | dst_top |
| src (moved down) and dst| |
+-------------------------+ src_bot |
| dst (still in SR) | |
|=========================| dst_bot |
| (clipped below SR) | v
+-------------------------+
<
["set_title", title]
["set_icon", icon]
Set the window title, and icon (minimized) window title, respectively.
In windowing systems not distinguishing between the two, "set_icon"
can be ignored.
["mouse_on"]
["mouse_off"]
Tells the client whether mouse support, as determined by |'mouse'|
option, is considered to be active in the current mode. This is mostly
useful for a terminal frontend, or other situations where nvim mouse
would conflict with other usages of the mouse. It is safe for a client
to ignore this and always send mouse events.
["busy_on"]
["busy_off"]
Nvim started or stopped being busy, and possibly not responsible to user
input. This could be indicated to the user by hiding the cursor.
["suspend"]
|:suspend| command or |Ctrl-Z| mapping is used. A terminal client (or other
client where it makes sense) could suspend itself. Other clients can
safely ignore it.
["bell"]
["visual_bell"]
Notify the user with an audible or visual bell, respectively.
["update_menu"]
The menu mappings changed.
["mode_change", mode]
The mode changed. Currently sent when "insert", "replace" and "normal"
modes are entered. A client could for instance change the cursor shape.
["popupmenu_show", items, selected, row, col]
When `popupmenu_external` is set to true, nvim will not draw the
popupmenu on the grid, instead when the popupmenu is to be displayed
this update is sent. `items` is an array of the items to show, the
items are themselves arrays of the form [word, kind, menu, info]
as defined at |complete-items|, except that `word` is replaced by
`abbr` if present. `selected` is the initially selected item, either a
zero-based index into the array of items, or -1 if no item is
selected. `row` and `col` is the anchor position, where the first
character of the completed word will be.
["popupmenu_select", selected]
An item in the currently displayed popupmenu is selected. `selected`
is either a zero-based index into the array of items from the last
`popupmenu_show` event, or -1 if no item is selected.
["popupmenu_hide"]
The popupmenu is hidden.
==============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -1,24 +1,59 @@
*nvim.txt* For Nvim. {Nvim}
*nvim.txt* {Nvim}
NVIM REFERENCE MANUAL *nvim*
NVIM REFERENCE MANUAL
Introduction to Nvim *nvim-intro*
Nvim *nvim* *nvim-intro*
This is an introduction for Vim users who are just getting started with Nvim.
It is not meant for Vim beginners. For a basic introduction to Vim,
see |help.txt|.
If you are new to Vim (and Nvim) see |help.txt| or type ":Tutor".
If you already use Vim (but not Nvim) see |nvim-from-vim| for a quickstart.
1. Transitioning from Vim |nvim-from-vim|
2. Differences from Vim |vim-differences|
3. Msgpack-RPC |msgpack-rpc|
4. Job control |job-control|
5. Python plugins |nvim-python|
6. Clipboard integration |nvim-clipboard|
7. Remote plugins |remote-plugin|
8. Provider infrastructure |nvim-provider|
9. Integrated terminal emulator |nvim-terminal-emulator|
Nvim is emphatically a fork of Vim, not a clone: compatibility with Vim is
maintained where possible. See |vim_diff.txt| for the complete reference of
differences from Vim.
==============================================================================
Transitioning from Vim *nvim-from-vim*
To start the transition, link your previous configuration so Nvim can use it:
>
mkdir ~/.config
ln -s ~/.vim ~/.config/nvim
ln -s ~/.vimrc ~/.config/nvim/init.vim
<
Note: If your system sets `$XDG_CONFIG_HOME`, use that instead of `~/.config`
in the code above. Nvim follows the XDG |base-directories| convention.
See |provider-python| and |provider-clipboard| for additional software you
might need to use some features.
Your Vim configuration might not be entirely compatible with Nvim. For a
full list of differences between Vim and Nvim see |vim-differences|.
The |'ttymouse'| option, for example, was removed from Nvim (mouse support
should work without it). If you use the same |vimrc| for Vim and Nvim,
consider guarding |'ttymouse'| in your configuration like so:
>
if !has('nvim')
set ttymouse=xterm2
endif
<
Conversely, if you have Nvim specific configuration items, you could do
this:
>
if has('nvim')
tnoremap <Esc> <C-\><C-n>
endif
<
For a more granular approach use |exists()|:
>
if exists(':tnoremap')
tnoremap <Esc> <C-\><C-n>
endif
<
Now you should be able to explore Nvim more comfortably. Check |nvim-features|
for more information.
==============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -1,59 +0,0 @@
*nvim_clipboard.txt* For Nvim. {Nvim}
NVIM REFERENCE MANUAL by Thiago de Arruda
Clipboard integration for Nvim *nvim-clipboard*
1. Intro |nvim-clipboard-intro|
2. X11 selection mechanism |nvim-clipboard-x11|
==============================================================================
1. Intro *nvim-clipboard-intro*
Nvim has no direct connection to the system clipboard. Instead, it is
accessible through the |nvim-provider| infrastructure, which transparently
uses shell commands for communicating with the clipboard.
Clipboard access is implicitly enabled if any of the following clipboard tools
is found in your `$PATH`.
- xclip
- xsel (newer alternative to xclip)
- pbcopy/pbpaste (only for Mac OS X)
The presence of a suitable clipboard tool implicitly enables the '+' and '*'
registers.
If you want to ALWAYS use the clipboard for ALL operations (as opposed
to interacting with the '+' and/or '*' registers explicitly), set the
following option:
>
set clipboard+=unnamedplus
<
See 'clipboard' for details and more options.
==============================================================================
2. X11 selection mechanism *nvim-clipboard-x11* *x11-selection*
The clipboard providers for X11 store text in what is known as "selections".
Selections are "owned" by an application, so when the application is closed,
the selection text is lost.
The contents of selections are held by the originating application (e.g., upon
a copy), and only passed on to another application when that other application
asks for them (e.g., upon a paste).
*quoteplus* *quote+*
There are three documented X11 selections: `PRIMARY`, `SECONDARY`, and `CLIPBOARD`.
`CLIPBOARD` is typically used in X11 applications for copy/paste operations
(`Ctrl-c`/`v`), while `PRIMARY` is used for the last selected text, which is
generally inserted with the middle mouse button.
Nvim's X11 clipboard providers only utilize the `PRIMARY` and `CLIPBOARD`
selections, used for the '*' and '+' registers, respectively.
==============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -1,50 +0,0 @@
*nvim_from_vim.txt* For Nvim. {Nvim}
NVIM REFERENCE MANUAL
Transitioning from Vim *nvim-from-vim*
Nvim is emphatically a fork of Vim, so compatibility to Vim should be pretty
good.
To start the transition, link your previous configuration so Nvim can use
it:
>
mkdir -p ${XDG_CONFIG_HOME:=$HOME/.config}
ln -s ~/.vim $XDG_CONFIG_HOME/nvim
ln -s ~/.vimrc $XDG_CONFIG_HOME/nvim/init.vim
<
See |nvim-intro|, especially |nvim-python| and |nvim-clipboard|, for
additional software you might need to install to use all of Nvim's features.
Your Vim configuration might not be entirely compatible with Nvim. For a
full list of differences between Vim and Nvim, see |vim-differences|.
The |'ttymouse'| option, for example, was removed from Nvim (mouse support
should work without it). If you use the same |vimrc| for Vim and Nvim,
consider guarding |'ttymouse'| in your configuration like so:
>
if !has('nvim')
set ttymouse=xterm2
endif
<
Conversely, if you have Nvim specific configuration items, you could do
this:
>
if has('nvim')
tnoremap <Esc> <C-\><C-n>
endif
<
For a more granular approach, use |exists()|:
>
if exists(':tnoremap')
tnoremap <Esc> <C-\><C-n>
endif
<
Now you should be able to explore Nvim more comfortably. Check |nvim| for more
information.
==============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -1,76 +0,0 @@
*nvim_provider.txt* For Nvim. {Nvim}
NVIM REFERENCE MANUAL by Thiago de Arruda
Nvim provider infrastructure *nvim-provider*
First of all, this document is meant to be read by developers interested in
contributing to the refactoring effort. If you are a normal user or plugin
developer looking to learn about Nvim |msgpack-rpc| infrastructure for
implementing plugins in other programming languages, see |remote-plugin|.
For instructions on how to enable Python plugins, see |nvim-python|. For
clipboard, see |nvim-clipboard|.
Instead of doing everything by itself, Nvim aims to simplify its own
maintenance by delegating as much work as possible to external systems. But
some Vim components are too tightly coupled and in some cases the refactoring
work necessary to swap in-house implementations by code that integrates to
other systems is too great. Nvim provider infrastructure is a facility that
aims to make this task simpler.
To understand why the provider infrastructure is useful, let us consider two
examples of integration with external systems that are implemented in Vim and
are now decoupled from Nvim core as providers:
The first example is clipboard integration: in the original Vim source code,
clipboard functions account for more than 1k lines of C source code (and that
is just on ui.c), all to peform two tasks that are now accomplished with
simple shell commands such as xclip or pbcopy/pbpaste.
The other example is Python scripting support: Vim has three files dedicated to
embedding the Python interpreter: if_python.c, if_python3.c and if_py_both.h.
Together these files sum about 9.5k lines of C source code. On Nvim, Python
scripting is performed by an external host process that is running 2k sloc
Python program.
In a perfect world, we would implement Python and clipboard integration in
pure vimscript and without touching the C code. Unfortunately we can't achieve
these goals without severely compromising backwards compatibility with Vim.
That's where providers come to the rescue.
In essence, this infrastructure is a simple framework that simplifies the task
of calling vimscript from C code, making it simpler to rewrite C functions that
interact with external systems in pure vimscript. It is composed of two
functions in eval.c:
- eval_call_provider(name, method, arguments): Call a provider(name) method
with arguments
- eval_has_provider(name): Checks if a provider is implemented
What these functions do is simple:
- eval_call_provider will call the provider#(name)#Call function passing in
the method and arguments.
- eval_has_provider will return true if the provider#(name)#Call function is
implemented, and is called by the "has" vimscript function to check if
features are available.
The basic idea is that the provider#(name)#Call function should implement
integration with an external system, because calling shell commands and
|msgpack-rpc| clients (Nvim only) is easier to do in vimscript.
Now, back to the Python example. Instead of modifying vimscript to allow for
the definition of lowercase functions and commands (for the |:python|,
|:pyfile|, and |:pydo| commands, and the |pyeval()| function), which would
break backwards compatibility with Vim, we implemented the
autoload/provider/python.vim script and the provider#python#Call function
that is only defined if an external Python host is started successfully.
That works well with the `has('python')` expression (normally used by Python
plugins) because if the Python host isn't installed then the plugin will
"think" it is running in a Vim compiled without |+python| feature.
==============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -1,92 +0,0 @@
*nvim_python.txt* For Nvim. {Nvim}
NVIM REFERENCE MANUAL by Thiago de Arruda
Python plugins and scripting in Nvim *nvim-python*
1. Introduction |nvim-python-intro|
2. Quickstart |nvim-python-quickstart|
==============================================================================
1. Introduction *nvim-python-intro*
Through external Python 2/3 interpreters connected via |msgpack-rpc|, Nvim
offers some support for the legacy |python-vim| and |python3| interfaces.
Note: For now only the old Vim 7.3 API is supported.
==============================================================================
2. Quickstart *nvim-python-quickstart*
If you used a package manager to install Nvim, there's a good chance that
it also provides the `neovim` Python package. If it doesn't, follow these
steps to install the package with Python's package manager, `pip`.
Note: Depending on your system, `pip` might refer to Python 2 or Python 3,
which is why the following instructions mention `pip2` or `pip3`
explicitly. If one of these is not available for you, maybe `pip`
is what you want.
To use Vim Python 2/3 plugins with Nvim, do the following:
- For Python 2 plugins, make sure an interpreter for Python 2.6 or 2.7 is
available in your `$PATH`, then install the `neovim` Python package systemwide:
>
$ sudo pip2 install neovim
<
or for the current user:
>
$ pip2 install --user neovim
<
- For Python 3 plugins, make sure an interpreter for Python 3.3 or above is
available in your `$PATH`, then install the `neovim` Python package systemwide:
>
$ sudo pip3 install neovim
<
or for the current user:
>
$ pip3 install --user neovim
<
==============================================================================
*g:python_host_prog*
To point Nvim to a specific Python 2 interpreter, set |g:python_host_prog|:
>
let g:python_host_prog = '/path/to/python'
<
*g:python3_host_prog*
To point Nvim to a specific Python 3 interpreter, set |g:python3_host_prog|:
>
let g:python3_host_prog = '/path/to/python3'
<
*g:loaded_python_provider*
To disable Python 2 interface, set `g:loaded_python_provider` to 1:
>
let g:loaded_python_provider = 1
<
*g:loaded_python3_provider*
To disable Python 3 interface, set `g:loaded_python3_provider` to 1:
>
let g:loaded_python3_provider = 1
<
*g:python_host_skip_check*
To disable Python 2 interpreter check, set `g:python_host_skip_check` to 1:
Note: If you disable Python 2 check, you must install neovim module properly.
>
let g:python_host_skip_check = 1
<
*g:python3_host_skip_check*
To disable Python 3 interpreter check, set `g:python3_host_skip_check` to 1:
Note: If you disable Python 3 check, you must install neovim module properly.
>
let g:python3_host_skip_check = 1
<
==============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:

Some files were not shown because too many files have changed in this diff Show More