Compare commits

...

1435 Commits

Author SHA1 Message Date
0542baac28 NVIM v0.1.7
FEATURES:
0213e99aaf PR #5561 'inccommand'

FIXES:
c685879eea PR #5632 SECURITY FIX
d28d108648 CheckHealth: Fix version comparison.
7be113d795 PR #5670 shell_write_cb: Schedule error message.
1d4563771b jobs: ensure calling jobclose() on a pty job sends SIGHUP.
36c0ec6dd4 tui/suspend_event(): set STDIN to "blocking"
7a4d069bcc, cf52b881d9 man.vim: avoid errors in unusual circumstances
ed198737fd PR #5546 ex_global: Catch CTRL-C even if it is mapped.

CHANGES:
9147331e21 PR #2905 encoding: only allow encoding=utf-8
5f0260808c PR #5636 build: Upgrade jemalloc
f1fed42ca7 PR #5567 l10n: Update Ukrainian translation
2016-11-27 20:03:30 +01:00
7be113d795 shell_write_cb: Schedule error message. (#5670)
Closes #5558
2016-11-26 13:08:42 +01:00
ecd7beb6e4 Merge pull request #5666 from bfredl/modechangetest
ui: add tests for ui_mode_change
2016-11-25 17:39:46 +01:00
0de6f450e4 vim-patch:7.4.2086
Problem:    Using the system default encoding makes tests unpredictable.
Solution:   Always use utf-8 or latin1 in the new style tests.  Remove setting
            encoding and scriptencoding where it is not needed.

ac105ed3c4
2016-11-25 15:46:58 +01:00
4b95bb582d ui: add tests for ui_mode_change
Also fix snapshot_util() to work even if default_attr_ids is not a
proper lua array.
2016-11-25 11:37:23 +01:00
42736d6a2a Merge pull request #5595 from jamessan/tsan-pie
tsan: Compile with -fPIE and updated clang
2016-11-24 09:55:12 -05:00
cbf2a86c1d Merge pull request #5654 from brcolow/vim-7.4.1923
vim-patch:7.4.1923
2016-11-23 21:27:20 -05:00
2c154216a4 Merge pull request #5644 from Shougo/vim-7.4.1691
vim-patch:7.4.1691
2016-11-23 21:03:26 -05:00
e00bc61325 Merge pull request #5642 from Shougo/vim-7.4.1660
vim-patch:7.4.1660
2016-11-23 20:49:24 -05:00
b1854cefea Merge pull request #5641 from Shougo/vim-7.4.1696
vim-patch:7.4.1696
2016-11-23 20:37:37 -05:00
ca292c9768 Avoid serializing NULL string through msgpack
Attempting to serialize a NULL string through msgpack results in
msgpack_sbuffer_write attempting to memcpy from a NULL pointer, which is
undefined behavior.
2016-11-23 20:30:00 -05:00
38ee85d000 Move utf8len_tab definition to globals.h
The existing code would cause utf8len_tab to be declared as non-extern
when main.cpp included globals.h as well as in mbyte.c.  This causes the
following warning

    Linking C executable ../../bin/nvim
    /usr/bin/ld: Warning: size of symbol `utf8len_tab' changed from 256 in CMakeFiles/nvim.dir/main.c.o to 320 in CMakeFiles/nvim.dir/mbyte.c.o

Moving the definition to globals.h and using INIT() ensures the array is
only defined in main.cpp and other places globals.h is included see an
extern declaration.
2016-11-23 20:29:59 -05:00
6d727657c8 ci: Make ubsan print out a stacktrace when it finds a problem 2016-11-23 20:29:59 -05:00
b6a090b4fd tsan: Compile with -fPIE and force clang-3.8
This fixes failures with TSAN builds like

    FATAL: ThreadSanitizer can not mmap the shadow memory (something is mapped at 0x55deea465000 < 0x7cf000000000)
    FATAL: Make sure to compile with -fPIE and to link with -pie.
2016-11-23 20:29:51 -05:00
4f8964cc00 vim-patch:7.4.1923
Problem:    Command line editing is not tested much.
Solution:   Add tests for expanding the file name and 'wildmenu'.

ae3150ec8d

The test_cmdline.vim tests were ported in 23f591dba0 and thus
should have marked 1923 as applied. The test_cmdline.vim invocation
has been moved from test_alot.vim to src/nvim/testdir/Makefile to
better accord with the upstream code.
2016-11-23 15:56:35 -07:00
5c06f350ce vim-patch:7.4.1691
Problem:    When switching to a new buffer and an autocommand applies syntax
            highlighting an ml_get error may occur.
Solution:   Check "syn_buf" against the buffer in the window. (Alexander von
            Buddenbrock, closes vim/vim#676)

b681be175b
2016-11-24 07:07:22 +09:00
81591b146a vim-patch:7.4.1696
Problem:    When using :stopinsert in a silent mapping the "INSERT" message
            isn't cleared. (Coacher)
Solution:   Always clear the message. (Christian Brabandt, closes vim/vim#718)

fd773e9e88
2016-11-24 07:04:39 +09:00
a46fc0d754 vim-patch:7.4.1928 (#5653)
Problem:    Overwriting pointer argument.
Solution:   Assign to what it points to. (Dominique Pelle)

76ae22fef3

The typos corrected in the original vim patch are no long present
in the neovim code base and the pointer assignment was done correctly
in the porting of patch 1913 (where the changes were introduced).
2016-11-23 22:00:11 +01:00
d152e2f3fd vim-patch:7.4.1660
Problem:    has('patch-7.4.1') doesn't work.
Solution:   Fix off-by-one error. (Thinca)

819821c5a9
2016-11-22 07:27:13 +09:00
5f0260808c build: Upgrade jemalloc from 4.2.1 to 4.3.1. (#5636)
Closes #5415
2016-11-21 13:36:55 +01:00
6b1c8bbc18 Merge pull request #5632 from jamessan/vim-8.0.0056
vim-patch:8.0.0056,8.0.0057
2016-11-20 23:03:24 -05:00
c685879eea vim-patch:8.0.0057
Problem:    Tests fail without the 'keymap' features.
Solution:   Check for feature in test.

9376f5f482
2016-11-20 14:07:46 -05:00
4fad66fbe6 vim-patch:8.0.0056
Problem:    When setting 'filetype' there is no check for a valid name.
Solution:   Only allow valid characters in 'filetype', 'syntax' and 'keymap'.

d0b5138ba4
2016-11-20 14:07:46 -05:00
42033bc5bd Merge #5630 from nhooyr/man-ftplugin
man.vim: bug fixes
2016-11-19 22:50:10 +01:00
7a4d069bcc man.vim: do not assume ftplugin is sourced before syntax
Fixes #5574
2016-11-19 13:41:04 -05:00
cf52b881d9 man.vim: no guarantee that the first line contains anything useful
Fixes #5628
2016-11-18 14:06:42 -05:00
acbce46782 Merge pull request #5624 from bfredl/jobcloseterm
jobs: ensure calling jobclose() on a pty job sends SIGHUP
2016-11-17 18:40:59 +01:00
c3a7a94a12 l10n: Remove some non-UTF8 .po files. (#5622)
Some .po files do not have UTF8 versions, leave those alone for now.

Also remove sjiscorr.c utility.
2016-11-17 17:27:13 +01:00
1d4563771b jobs: ensure calling jobclose() on a pty job sends SIGHUP. Closes #5619 2016-11-17 15:13:45 +01:00
927e3e32d7 Merge pull request #5623 from justinmk/luacheck
build: Target luacheck HEAD.
2016-11-16 21:17:21 -05:00
44e6ee930f build: Target luacheck HEAD.
https://github.com/mpeterv/luacheck/pull/81#issuecomment-261099606

> If you really want to use bleeding-edge version you should get the
> rockspec from master branch, not a fixed commit ...
> The correct way to install from a specific commit is cloning that
> commit and running "luarocks make" from project directory. The reason
> is that running "install" or "build" on an scm rockspec fetches
> sources from master but uses build description from the rockspec
> itself, which may be outdated.
2016-11-17 00:55:39 +01:00
5e241b5f50 build: cmake: Use portable delimiters. (#5620)
Fixes build on Windows (msys2 mingw64).
Closes #5342
2016-11-16 22:26:51 +01:00
f1fed42ca7 l10n: Update Ukrainian translation (#5567)
* Fix translation of the term 'tag'

Prefer native word instead of transliteration

* Update uk.po automatically

Run make update-po-uk in src/nvim/po

* Update fuzzy translations in uk.po

* Translate missing msgstr

* Fix layout of the front page

* Apply cleanup.vim

Additionally, remove irrelevant and confusing comments

* Copy uk.po into uk.cp1251.po
2016-11-16 18:58:07 +01:00
108d54bbd4 Merge pull request #5600 from jamessan/vim-7.4.1640
vim-patch:7.4.1640,7.4.1647,7.4.1650,7.4.1664
2016-11-16 06:52:19 -05:00
c66ca17ca1 Merge pull request #5614 from Shougo/vim-7.4.2251
vim-patch:7.4.2251
2016-11-15 23:45:20 -05:00
34317846d6 lint 2016-11-15 23:16:09 -05:00
4e66bc99e4 Mark 7.4.1697 as applied
The patch was merged in 9e1c6596 but version.c didn't get updated
accordingly.
2016-11-15 23:16:09 -05:00
2e5736e2cd vim-patch:7.4.1664
Problem:    Crash in :cgetexpr.
Solution:   Check for NULL pointer. (Dominique) Add a test.

89c64d557d
2016-11-15 23:16:09 -05:00
830bf8665b vim-patch:7.4.1650
Problem:    Quickfix test fails.
Solution:   Accept any number of matches.

f68f1d7079
2016-11-15 23:16:09 -05:00
caa33aaaf8 vim-patch:7.4.1647
Problem:    Using freed memory after setqflist() and ":caddbuffer".  (Dominique)
Solution:   Set qf_ptr when adding the first item to the quickfix list.

8b20179c65
2016-11-15 23:16:08 -05:00
c0fd830be4 Bump all nvim-specific error codes above E5000
In order to not conflict with new error codes that Vim adds, all Neovim
error codes should be above 5000.  The three existing sub-5000 error
codes (E926, E951, and E952) are now E50003, E5004, and E5005
respectively.

E953 was removed in 6167ce6df2, so just
remove it from the help.
2016-11-15 23:16:08 -05:00
7231438f12 vim-patch:7.4.1640
Problem:    Crash when an autocommand changes a quickfix list. (Dominique)
Solution:   Check wether an entry is still valid. (Yegappan Lakshmanan,
            Hirohito Higashi)

ffec3c5349
2016-11-15 23:16:08 -05:00
aba853a156 Merge pull request #5615 from jamessan/vim-7.4.1892
vim-patch:7.4.1892,7.4.1894
2016-11-15 22:49:34 -05:00
49f73e5275 vim-patch:7.4.1894
Problem:    Cannot get the window ID for a mouse click.
Solution:   Add v:mouse_winid.

511972d810
2016-11-15 22:00:25 -05:00
defa86b08a vim-patch:7.4.1892
Problem:    balloon eval only gets the window number, not the ID.
Solution:   Add v:beval_winid.

c9721bdc63
2016-11-15 21:48:08 -05:00
458b1fc0e7 vim-patch:7.4.2251
Problem:    In rare cases diffing 4 buffers is not enough.
Solution:   Raise the limit to 8. (closes vim/vim#1000)

015efc32c1
2016-11-16 08:55:17 +09:00
c91e9c1c7a Merge pull request #5611 from jamessan/vim-7.4.2174
vim-patch:7.4.2174
2016-11-15 14:57:57 -05:00
c69cfd7d1c vim-patch:8.0.0035 (#5609)
Problem:    Order of matches for 'omnifunc' is messed up. (Danny Su)
Solution:   Do not set compl_curr_match when called from complete_check().
            (closes vim/vim#1168)

472e85970e
2016-11-15 17:59:55 +01:00
12ed735719 lint 2016-11-15 11:50:54 -05:00
9d9d93aee3 vim-patch:7.4.2174
Problem:    Adding duplicate flags to 'whichwrap' leaves commas behind.
Solution:   Also remove the commas. (Naruhiko Nishino)

c8ce615299
2016-11-15 11:48:37 -05:00
10c72cd365 vim-patch.sh: Remove "set -o pipefail"
grep 2.26 changed its behavior when redirecting its output to /dev/null
such that it exits as soon as one match is found.  This causes sed to
get a SIGPIPE which, due to "set -o pipefail", falsely implies that the
patch is not applied.

Removing "set -o pipefail" preserves the good exit status from grep.
2016-11-15 07:53:01 -05:00
d28d108648 CheckHealth: Fix version comparison.
Compare numbers instead of strings.
2016-11-15 13:15:40 +01:00
01ef6fc3d2 Merge #5607 from justinmk/icm
'inccommand': auto-disable if too slow; fix other behaviors
2016-11-15 09:12:47 +01:00
35231312d7 'inccommand': Add tests. 2016-11-15 05:01:25 +01:00
3f7a2d785d 'inccommand': Introduce CMDPREVIEW state.
Command "live preview" is fundamentally a non-recursive concept
("preview of a preview" is not useful). Maintaining this as a
global is less awkward and closer to what we actually want to
express, vs adorning exarg_T, CommandLineState, etc.
2016-11-15 04:22:24 +01:00
708617ebb6 inccommand=nosplit: Jump to first match.
Call update_topline() to adjust the current viewport.

Closes #5597
2016-11-15 04:22:24 +01:00
91507c271e 'inccommand': Detect "non-interactive", "too slow".
command_line_changed:
  - Check (current_SID == 0) instead of KeyTyped
    - We want to update during mappings (KeyTyped is false then).
  - Check vpeekc_any()
    - Avoids unnecessary work.
    - Avoids triggering live preview during macros.
    - Caveat: This makes the redraw "stutter" if user spams (holds a key)
      in the replace pattern. But that scenario is not important.
  - Update screen if the command is changed to a non-live command.
    (`s->live` goes from true => false) => clears the preview
command_line_execute:
  - Let CTRL-C cancel live preview
do_sub:
  - Enforce a time limit ('redrawtime').
  - Unset 'inccommand' if time limit is reached.

Closes #5602
Closes #5585
2016-11-15 04:22:24 +01:00
0c799a8f10 Merge pull request #5606 from jamessan/vim-7.4.1658
vim-patch:7.4.1658
2016-11-14 16:16:18 -05:00
0b686e9b61 lint 2016-11-14 14:16:40 -05:00
9d2985ecba vim-patch:7.4.1658
Problem:    A plugin does not know when VimEnter autocommands were already
            triggered.
Solution:   Add the v:vim_did_enter variable.

1473551a44
2016-11-14 14:16:40 -05:00
4539d867d4 Merge pull request #5603 from jamessan/remove-flaky-term-resize-test
test: window_spec: Remove flaky terminal resize test
2016-11-13 19:54:14 -05:00
5e1dc26f74 test: window_spec: Remove flaky terminal resize test 2016-11-13 18:47:03 -05:00
598f5af58b Merge #5582 from justinmk/icm
'inccommand': Support :smagic/:snomagic. Less jumping around.
2016-11-12 13:32:48 +01:00
84eed76b55 CheckHealth: Include v:throwpoint in error message (#5575)
* health.vim: Include v:throwpoint in error message

* health/provider.vim: Check for ruby executable

* health/provider.vim: Combine subprocess stdout and stderr

* test: Updated CheckHealth test
2016-11-12 11:59:15 +01:00
7e48c23a50 vim-patch:7.4.1634 (#5594)
Problem:    Vertical movement after CTRL-A ends up in the wrong column.
            (Urtica Dioica)
Solution:   Set curswant when appropriate. (Hirohito Higashi)

8e08125d3a
2016-11-12 11:32:23 +01:00
c5bc0ea04c vim-patch:7.4.1614 (#5593)
Problem:    Still quickfix test in old style.
Solution:   Turn test 10 into a new style test.

7eba3d2cbf
2016-11-12 11:30:18 +01:00
05d1211424 Merge pull request #5592 from jamessan/vim-7.4.1591
vim-patch:7.4.1591
2016-11-11 16:01:13 -05:00
7baa96b717 vim-patch:7.4.1591
Problem:    The quickfix title is truncated.
Solution:   Save the command before it is truncated. (Anton Lindqvist)

5584df65a0
2016-11-11 11:37:42 -05:00
ae9a3d3b99 'inccommand': Simplify cursor placement logic.
Remove the inner for-loop; just use the column of the first in-line
match.
2016-11-11 05:45:06 +01:00
795f2bb9b9 'inccommand': Restore cursor/view if cancelled.
Restore cursor position and window "view", if command is cancelled.
This is how 'incsearch' works.
2016-11-10 18:09:48 +01:00
2e1217da46 'inccommand': buftype=nofile, restore cursor/view
- Use a standard scratch buffer instead of a new 'buftype', functions
  like curbufIsChanged() already have special handling for scratch bufs.
- Cleanup some stuff from the previous merge.
- Add support for :smagic, :snomagic. Closes #5578
2016-11-10 15:48:00 +01:00
0213e99aaf Merge #5561 'inccommand'
Initial work by:
  Robin Elrharbi-Fleury (Robinhola)
  Audrey Rayé (Adrey06)
  Philémon Hullot (DesbyP)
  Aymeric Collange (aym7)
  Clément Guyomard (Clement0)

Major revisions by:
  KillTheMule
  Björn Linse <bjorn.linse@gmail.com>
  Justin M. Keyes <justinkz@gmail.com>
2016-11-09 03:19:22 +01:00
aa0e09d251 'inccommand': Preserve curbuf->b_u_newhead.
Add tests for undotree().

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

When "curhead" points to a valid head, the value of "newhead" is
meaningless (and really should be set to null). The undo state for
a buffer is _logically_ the enum:

  enum UndoState {
    CurrentHead(head),
    NewHead(head),
    EmptyTree
  }

nvim _represents_ this as: whenever `curbuf->b_u_curhead` is nonnull it
should be used as the current head, and `curbuf->b_u_newhead` is
ignored. If the there is a current head, then this will be redoed on the
next redo, and its parent will be undone on next undo. Only if
`b_u_curhead` is NULL, `b_u_newhead` will be used as the head to undo
(and it is not possible to redo). Also both can be NULL, to indicate an
empty undotree. (To be fair, this only strictly true when calling undo.c
from the outside, in some places _within_ a function in undo.c both
values might be meaningful)

Apparently `undotree()` breaks this non-abstraction, this _cosmetic_
issue can easily be fixed by `ex_substitute` also saving and restoring
`b_u_newhead`, but is doesn't reflect any error really how
`u_undo_and_forget` manipulates the _actual_ state of the undo tree.
2016-11-09 01:03:47 +01:00
21dfbfbb9a perf: do_sub(): avoid work, avoid screen updates
- Don't fill matched_lines if not showing a preview (!eap->is_live).
- Encapsulate: Move cursor placement logic to show_sub().
2016-11-08 21:22:24 +01:00
f3e8ca3bf5 'inccommand': preserve 'modified'
During the live preview, the buffer-local 'modified' flag
should not be changed.
2016-11-08 21:22:24 +01:00
ff6ec703d5 'inccommand': Do not trigger during scripts, feedkeys(). 2016-11-08 21:22:24 +01:00
527ba2b12a 'inccommand': test: scripts/feedkeys() should not trigger preview 2016-11-08 21:22:24 +01:00
6a3f8d48d0 'inccommand': rename 'incsubstitute'
'inccommand' allows us to expand the feature to other commands, such as:
    :cdo
    :cfdo
    :global

Also rename "IncSubstitute" highlight group to "Substitute".
2016-11-08 21:22:13 +01:00
1e0e301062 'inccommand': format line numbers as "|123| "
This matches what Quickfix traditionally does.
2016-11-08 21:21:46 +01:00
3ccf69c1de 'inccommand': set buffer name to [Preview]
[inc_sub] is less obvious for users. Also, in the future we may want to
generalize the idea of a "preview buffer", or "incremental commands"
besides :substitute.
2016-11-08 21:21:46 +01:00
d0689eb0b2 'inccommand': disable 'cursorline', 'spell' in preview 2016-11-08 21:21:43 +01:00
e31f9007e4 'inccommand': preserve b:changedtick 2016-11-08 21:21:00 +01:00
e4e7b2d239 lint 2016-11-08 21:21:00 +01:00
c04ffe866d 'inccommand': rework
- Eliminate/isolate static/global variables
- Remove special-case parameter from buflist_new()
- Remove special-case ECMD_RESERVED_BUFNR
- To determine when u_undo_and_forget() should be done, check
  b_changedtick instead of a heuristic.
- use mb_string2cells() instead of strlen() to measure the :sub patterns
- call ml_close() before buf_clear_file(). Avoids leaks caught by ASan.

Original patch by:
  Robin Elrharbi-Fleury (Robinhola)
  Audrey Rayé (Adrey06)
  Philémon Hullot (DesbyP)
  Aymeric Collange (aym7)
  Clément Guyomard (Clement0)
2016-11-08 21:20:08 +01:00
bd33f1165b CheckHealth: ignore non-existing markdownCodeBlock group (#5570)
People using [1] would experience an error, because their markdown syntax
doesn't define the markdownCodeBlock group.

[1]: https://github.com/plasticboy/vim-markdown

Closes #5569
2016-11-08 19:01:15 +01:00
3089c86f4e CheckHealth: timeout system() calls (#5565) 2016-11-08 14:34:03 +01:00
9147331e21 Merge pull request #2905 from bfredl/utf8
Only allow encoding=utf-8 and simplify multibyte code
2016-11-05 18:12:14 +01:00
4ab3fe8eaa encoding: update documentation 2016-11-05 14:49:24 +01:00
b3ece5c81c encoding: update tests
Change shada reencoding tests to check for
correct handling of UTF-8 and binary strings.

Delete enc=latin1 json tests.
2016-11-05 14:49:24 +01:00
18f56c8e90 encoding: delete non-UTF-8 implementations of multibyte functions
Deleted documentation was duplicated at specific utf_ implementation
2016-11-05 14:49:24 +01:00
5072ab9e5b encoding: cleanup mbyte.c given fixed encoding=utf-8
Eliminate mb_init():
Set "enc_utf" and "has_mbyte" early. Eliminate "enc_unicode" and "enc_latin1like".
init_chartab() and screenalloc() are already invoked elsewhere
in the initialization process.
The EncodingChanged autocmd cannot be triggered.
At initialization, there is no spellfiles to reload
2016-11-05 14:49:24 +01:00
4804001aff encoding: only allow encoding=utf-8 2016-11-05 14:49:23 +01:00
32d9c19e29 Health: introduce help links (#5557)
We can now use help links like in normal help pages. The bars around them will
be concealed as well.

* Health: link string "SUCCESS" to ModeMsg

So far we linked "SUCCESS" to the Function highlight group.

The newly introduced healthHelp group links to Idenfifier as it does for links
in normal help pages.

Now the problem is that the Function group links again to Identifier as well, so
both, "SUCCESS" and help links, would use the same colors.

* Health: don't use Markdown code blocks

Every line indented by more than 4 spaces would lose its highlighting otherwise.

* Health: add helper health#help_to_link()
2016-11-04 11:03:05 +01:00
01f1028496 Merge pull request #5524 from brcolow/vim-7.4.1967
vim-patch:7.4.1967
2016-11-02 20:06:23 -04:00
b8bb1f6729 vim-patch:7.4.1967
Problem: Falling back from NFA to old regexp engine does not work properly.
(fritzophrenic)
Solution: Do not restore nfa_match. (Christian Brabandt, closes vim/vim#867)

6747fabc73

Helped-by: jamessan
2016-11-02 20:05:45 -04:00
9ef4be9aab Merge pull request #5550 from jamessan/big-endian-fixes
Making nvim big-endian friendly
2016-11-02 20:04:10 -04:00
654e92186b lint 2016-11-02 10:06:27 -04:00
9b545dd3db nvim_win_get_number: Use int as rv to fix BE issues
rv is int64_t but its address is being passed into win_get_tabwin as if
it were an int.  This breaks on big-endian systems, since win_get_tabwin
will store the data to the "wrong" half of the int64_t, thus returning
invalid data out of nvim_win_get_number.
2016-11-02 10:06:27 -04:00
37e64d79cc object_to_vim: Fix buffer/window/tabpage conversion on BE systems
Since data.integer is a different (larger) integer type than
data.{buffer,window,tabpage}, we cannot abuse the union by using
data.integer to access the value for all 4 types.  Instead, remove the
{buffer,window,tabpage} members and always use the integer member.

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

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

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

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

Closes #5459
2016-11-02 01:20:16 +01:00
d37c2e5dc2 doc: Remove features from vim_diff which have been merged upstream (#5554)
- TabNew/TabClosed: Introduced in 7.4.2075 and 7.4.2077
- hl-EndOfBuffer: Introduced in 7.4.2213
2016-10-31 17:26:32 +01:00
859e9fa65f Merge pull request #5527 from brcolow/vim-7.4.1730
vim-patch:7.4.[1730,1734,1741,1742,1779,1782]
2016-10-31 10:13:41 -04:00
ed198737fd Merge #5546 from justinmk/global-ctrlc
ex_global: Catch CTRL-C even if it is mapped.
2016-10-30 14:20:40 +01:00
49cf0b6ac4 lint 2016-10-30 13:10:29 +01:00
7cd204dbfa ex_global: Catch CTRL-C even if it is mapped.
Problem: If CTRL-C is mapped, it does not interrupt :global output.
Solution: clear `mapped_ctrl_c` during :global.
2016-10-30 13:10:29 +01:00
e8c0f90962 Linted 2016-10-30 10:52:05 +01:00
561c1e39e0 Tests for incsubstitution feature 2016-10-30 10:52:05 +01:00
13841a56b4 Incsubsitution feature
Originally implemented by

* Clement0
* DesbyP
* aym7
* Adrey06
* Robinhola

in #4811. Major reworkings and bug
fixes by

* bfredl

Most tests suggested by ZyX-l, suggestions for improvements by oni-link.
2016-10-30 10:21:18 +01:00
6143cfdeec Merge pull request #5543 from jamessan/fix-shada-marks-test
test: Fix shada/marks_spec.lua failure
2016-10-29 12:49:50 -04:00
3d49fc1f50 CheckHealth: fix check for tmux escape-time (#5545) 2016-10-29 14:48:19 +02:00
93f3896300 test: Fix shada/marks_spec.lua failure
The 'dump and read back mark " from a closed tab' test needs to actually
create a second tab.  Since it wasn't doing so, the 'q!' command caused
nvim to exit and the subsequent 'qall' command fails.
2016-10-28 22:32:14 -04:00
242c3d5f0b version bump 2016-10-28 15:16:59 +02:00
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
f6f77272b3 vim-patch:7.4.1782
Problem:    strcharpart() does not work properly with some multi-byte
            characters.
Solution:   Use mb_cptr2len() instead of mb_char2len(). (Hirohito Higashi)

fca6600305
2016-10-24 12:49:17 -07:00
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
6bc0d9b8c7 vim-patch:7.4.1779
Problem:    Using negative index in strcharpart(). (Yegappan Lakshmanan)
Solution:   Assume single byte when using a negative iindex.

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

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

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

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

58de0e2dcc
2016-10-23 18:04:28 -07:00
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
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
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
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
b16b27a1be Fix guessing incorrect color index in terminal
This should fix issue #2323
2016-03-01 13:55:39 +01:00
de7165d351 eval: Update documentation.
Extracted from vim-patch:da440d21a6b94d7f525fa7be9b1417c78dd9aa4c
2016-02-28 10:38:45 +01:00
2af36df86d eval: Fix linter error. 2016-02-27 19:05:30 +01:00
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
1e7c6380fe tests: Migrate legacy test breakindent. 2016-02-25 17:15:09 +01:00
2ced866925 tests: Migrate legacy test 68. 2016-02-24 22:21:25 +01: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
c9067dbe8a build: fix '-fno-sanitize-recover' warning in Clang 3.7 2015-11-03 14:19:04 +08:00
825 changed files with 90813 additions and 106565 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
[ "$USE_GCOV" = on ] && { 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

@ -19,20 +19,16 @@ if [[ -n "${LLVM_SYMBOLIZER}" ]] && [[ ! $(type -P "${LLVM_SYMBOLIZER}") ]]; the
echo "\$LLVM_SYMBOLIZER: '${LLVM_SYMBOLIZER}' is not executable."
exit 1
fi
if [ "${BUILD_32BIT}" = ON ] && [ "${BUILD_MINGW}" = ON ]; then
>&2 echo "32-bit MinGW builds not supported."
exit 1
fi
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
# Adds user to a dummy group.
# 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
fi
# Compile dependencies.
build_deps
fi
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

@ -2,9 +2,6 @@ build_deps() {
if [[ "${BUILD_32BIT}" == ON ]]; then
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
fi
if [[ "${BUILD_MINGW}" == ON ]]; then
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_MINGW}"
fi
if [[ "${FUNCTIONALTEST}" == "functionaltest-lua" ]]; then
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
fi
@ -14,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
@ -26,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,9 +44,6 @@ build_nvim() {
if [[ "${BUILD_32BIT}" == ON ]]; then
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

@ -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,24 +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 "https://github.com/neovim/deps/raw/master/opt/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

@ -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

20
.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,27 +43,12 @@ 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`

View File

@ -8,10 +8,8 @@ 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"
# LLVM symbolizer path.
- LLVM_SYMBOLIZER="$(which llvm-symbolizer-3.6)"
# Update PATH for pip.
- PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:/usr/lib/llvm-symbolizer-3.8/bin:$PATH"
# Build directory for Neovim.
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
# Build directory for third-party dependencies.
@ -34,14 +32,10 @@ env:
- 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"
- TSAN_OPTIONS="log_path=$LOG_DIR/tsan"
- UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan"
# Environment variables for Valgrind.
- VALGRIND_LOG="$LOG_DIR/valgrind-%p.log"
# Cache marker for third-party dependencies cache.
@ -62,6 +56,7 @@ matrix:
env: CI_TARGET=lint
- os: linux
compiler: gcc-5
env: GCOV=gcov-5 CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
- os: linux
compiler: gcc-5
env: FUNCTIONALTEST=functionaltest-lua
@ -72,24 +67,18 @@ matrix:
compiler: gcc-5 -m32
env: BUILD_32BIT=ON
- os: linux
compiler: clang-3.6
env: GCOV=llvm-cov-3.6 CLANG_SANITIZER=ASAN_UBSAN CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
compiler: clang-3.8
env: CLANG_SANITIZER=ASAN_UBSAN
- os: linux
compiler: clang-3.6
env: CLANG_SANITIZER=MSAN
- os: linux
compiler: clang-3.6
compiler: clang-3.8
env: CLANG_SANITIZER=TSAN
- os: osx
compiler: clang
osx_image: xcode7.3 # macOS 10.11
- os: osx
compiler: gcc-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: CLANG_SANITIZER=MSAN
before_install: .ci/before_install.sh
install: .ci/install.sh
@ -103,13 +92,13 @@ addons:
sources:
# TODO: Remove PPA when Travis gets Python >=3.3.
- deadsnakes
- llvm-toolchain-precise-3.6
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- autoconf
- automake
- build-essential
- clang-3.6
- clang-3.8
- cmake
- g++-5-multilib
- g++-multilib
@ -118,7 +107,7 @@ addons:
- gdb
- libc6-dev-i386
- libtool
- llvm-3.6-dev
- llvm-3.8-dev
- pkg-config
- python3.3-dev
- unzip

View File

@ -8,6 +8,9 @@ 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")
if(CMAKE_CROSSCOMPILING AND NOT UNIX)
@ -56,12 +59,17 @@ 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 it is combined with the result of `git describe`.
# 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 3)
set(NVIM_VERSION_PATCH 7)
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)
@ -253,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)
@ -291,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 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()
if(FEAT_TUI)
find_package(Unibilium REQUIRED)
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
find_package(LibTermkey REQUIRED)
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
endif()
find_package(LibVterm REQUIRED)
include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS})
@ -326,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()
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)
@ -367,9 +386,9 @@ 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)
@ -393,14 +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)
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
@ -451,12 +476,24 @@ if(BUSTED_PRG)
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)
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.
@ -469,6 +506,8 @@ if(BUSTED_PRG)
add_custom_target(benchmark-prereqs
DEPENDS ${BENCHMARK_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}
@ -478,46 +517,61 @@ if(BUSTED_PRG)
-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})
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})
DEPENDS ${FUNCTIONALTEST_PREREQS}
${TEST_TARGET_ARGS})
endif()
if(LUACHECK_PRG)
@ -525,6 +579,7 @@ 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()

View File

@ -1,162 +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 runtime issues, 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. 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
@ -165,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
@ -178,16 +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]: 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

View File

@ -1,6 +1,5 @@
- Neovim version:
- [ ] Vim behaves differently?
- Vim version:
- `nvim --version`:
- Vim (version: ) behaves differently?
- Operating system/version:
- Terminal name/version:
- `$TERM`:
@ -9,7 +8,9 @@
### Expected behaviour
### Steps to reproduce using `nvim -u NONE`
### Steps to reproduce using `nvim -u NORC`
1. `nvim -u NONE`
2.
```
nvim -u NORC
```

View File

@ -85,16 +85,19 @@ 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
functionaltest-lua: | nvim
+$(BUILD_CMD) -C build functionaltest-lua
testlint: | nvim
testlint: | build/.ran-cmake deps
$(BUILD_CMD) -C build testlint
unittest: | nvim
@ -115,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

@ -42,7 +42,12 @@ if(MSGPACK_USE_STATIC)
"${CMAKE_STATIC_LIBRARY_PREFIX}msgpack${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()
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

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,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

@ -27,12 +27,15 @@ if(NOT HAVE_SYS_WAIT_H AND UNIX)
endif()
check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_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(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)
@ -67,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 "}")
@ -74,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
@ -131,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

@ -30,6 +30,7 @@
#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
@ -48,8 +49,15 @@
#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
@ -57,5 +65,6 @@
#cmakedefine HAVE_BE64TOH
#cmakedefine ORDER_BIG_ENDIAN
#define ENDIAN_INCLUDE_FILE <@ENDIAN_INCLUDE_FILE@>
#endif // AUTO_CONFIG_H

View File

@ -7,6 +7,10 @@
#define NVIM_VERSION_PRERELEASE "@NVIM_VERSION_PRERELEASE@"
#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

@ -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.
@ -391,9 +391,6 @@ See
in the
.Xr tmux 1
manual page for more information.
.It Ev NVIM_TUI_ENABLE_TRUE_COLOR
If defined, assume the host terminal supports 24 bit colors.
Has no effect in GUIs.
.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,22 +70,25 @@ foreach(DF ${DOCFILES})
list(APPEND BUILDDOCFILES ${GENERATED_RUNTIME_DIR}/doc/${F})
endforeach()
add_custom_command(OUTPUT copy_docfiles
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 -e --headless -c "helptags ++t doc" -c quit
DEPENDS
nvim
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}"
)
add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
-u NONE
-i NONE
-e
--headless
-c "helptags ++t ."
-c quit
DEPENDS
copy_docfiles
nvim
helptags
)
add_custom_target(doc_html
COMMAND make html
DEPENDS
${GENERATED_HELP_TAGS}
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}/doc"
)
@ -50,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
@ -78,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)

View File

@ -1,9 +1,13 @@
" Vim completion script
" Language: CSS 2.1
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2007 May 5
" Language: CSS
" Based on MDN CSS Reference at 2016 Jan <https://developer.mozilla.org/en-US/docs/Web/CSS/Reference>
" plus CSS Speech Module <http://www.w3.org/TR/css3-speech/>
" Maintainer: Kao, Wei-Ko(othree) ( othree AT gmail DOT com )
" Original Author: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2016 Jan 11
let s:values = split("all additive-symbols align-content align-items align-self animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function backface-visibility background background-attachment background-blend-mode background-clip background-color background-image background-origin background-position background-repeat background-size block-size border border-block-end border-block-end-color border-block-end-style border-block-end-width border-block-start border-block-start-color border-block-start-style border-block-start-width border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-inline-end border-inline-end-color border-inline-end-style border-inline-end-width border-inline-start border-inline-start-color border-inline-start-style border-inline-start-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-decoration-break box-shadow box-sizing break-after break-before break-inside caption-side clear clip clip-path color columns column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width content counter-increment counter-reset cue cue-before cue-after cursor direction display empty-cells fallback filter flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float font font-family font-feature-settings font-kerning font-language-override font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-weight grid grid-area grid-auto-columns grid-auto-flow grid-auto-position grid-auto-rows grid-column grid-column-start grid-column-end grid-row grid-row-start grid-row-end grid-template grid-template-areas grid-template-rows grid-template-columns height hyphens image-rendering image-resolution image-orientation ime-mode inline-size isolation justify-content left letter-spacing line-break line-height list-style list-style-image list-style-position list-style-type margin margin-block-end margin-block-start margin-bottom margin-inline-end margin-inline-start margin-left margin-right margin-top marks mask mask-type max-block-size max-height max-inline-size max-width max-zoom min-block-size min-height min-inline-size min-width min-zoom mix-blend-mode negative object-fit object-position offset-block-end offset-block-start offset-inline-end offset-inline-start opacity order orientation orphans outline outline-color outline-offset outline-style outline-width overflow overflow-wrap overflow-x overflow-y pad padding padding-block-end padding-block-start padding-bottom padding-inline-end padding-inline-start padding-left padding-right padding-top page-break-after page-break-before page-break-inside pause-before pause-after pause perspective perspective-origin pointer-events position prefix quotes range resize rest rest-before rest-after right ruby-align ruby-merge ruby-position scroll-behavior scroll-snap-coordinate scroll-snap-destination scroll-snap-points-x scroll-snap-points-y scroll-snap-type scroll-snap-type-x scroll-snap-type-y shape-image-threshold shape-margin shape-outside speak speak-as suffix symbols system table-layout tab-size text-align text-align-last text-combine-upright text-decoration text-decoration-color text-decoration-line text-emphasis text-emphasis-color text-emphasis-position text-emphasis-style text-indent text-orientation text-overflow text-rendering text-shadow text-transform text-underline-position top touch-action transform transform-box transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi unicode-range user-zoom vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-rate voice-range voice-stress voice-volume white-space widows width will-change word-break word-spacing word-wrap writing-mode z-index zoom")
let s:values = split("azimuth background background-attachment background-color background-image background-position background-repeat border bottom border-collapse border-color border-spacing border-style border-top border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width border-bottom-width border-left-width border-width caption-side clear clip color content counter-increment counter-reset cue cue-after cue-before cursor display direction elevation empty-cells float font font-family font-size font-style font-variant font-weight height left letter-spacing line-height list-style list-style-image list-style-position list-style-type margin margin-right margin-left margin-top margin-bottom max-height max-width min-height min-width orphans outline outline-color outline-style outline-width overflow padding padding-top padding-right padding-bottom padding-left page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position quotes right richness speak speak-header speak-numeral speak-punctuation speech-rate stress table-layout text-align text-decoration text-indent text-transform top unicode-bidi vertical-align visibility voice-family volume white-space width widows word-spacing z-index")
function! csscomplete#CompleteCSS(findstart, base)
@ -15,6 +19,7 @@ if a:findstart
while start >= 0 && line[start - 1] =~ '\%(\k\|-\)'
let start -= 1
endwhile
let b:after = line[compl_begin :]
let b:compl_context = line[0:compl_begin]
return start
endif
@ -33,6 +38,7 @@ endif
" 6. if ! complete important
if exists("b:compl_context")
let line = b:compl_context
let after = b:after
unlet! b:compl_context
else
let line = a:base
@ -103,12 +109,45 @@ elseif borders[max(keys(borders))] == 'colon'
" Get name of property
let prop = tolower(matchstr(line, '\zs[a-zA-Z-]*\ze\s*:[^:]\{-}$'))
if prop == 'azimuth'
let values = ["left-side", "far-left", "left", "center-left", "center", "center-right", "right", "far-right", "right-side", "behind", "leftwards", "rightwards"]
let wide_keywords = ["initial", "inherit", "unset"]
let color_values = ["transparent", "rgb(", "rgba(", "hsl(", "hsla(", "#"]
let border_style_values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
let border_width_values = ["thin", "thick", "medium"]
let list_style_type_values = ["decimal", "decimal-leading-zero", "arabic-indic", "armenian", "upper-armenian", "lower-armenian", "bengali", "cambodian", "khmer", "cjk-decimal", "devanagari", "georgian", "gujarati", "gurmukhi", "hebrew", "kannada", "lao", "malayalam", "mongolian", "myanmar", "oriya", "persian", "lower-roman", "upper-roman", "tamil", "telugu", "thai", "tibetan", "lower-alpha", "lower-latin", "upper-alpha", "upper-latin", "cjk-earthly-branch", "cjk-heavenly-stem", "lower-greek", "hiragana", "hiragana-iroha", "katakana", "katakana-iroha", "disc", "circle", "square", "disclosure-open", "disclosure-closed"]
let timing_functions = ["cubic-bezier(", "steps(", "linear", "ease", "ease-in", "ease-in-out", "ease-out", "step-start", "step-end"]
if prop == 'all'
let values = []
elseif prop == 'additive-symbols'
let values = []
elseif prop == 'align-content'
let values = ["flex-start", "flex-end", "center", "space-between", "space-around", "stretch"]
elseif prop == 'align-items'
let values = ["flex-start", "flex-end", "center", "baseline", "stretch"]
elseif prop == 'align-self'
let values = ["auto", "flex-start", "flex-end", "center", "baseline", "stretch"]
elseif prop == 'animation'
let values = timing_functions + ["normal", "reverse", "alternate", "alternate-reverse"] + ["none", "forwards", "backwards", "both"] + ["running", "paused"]
elseif prop == 'animation-delay'
let values = []
elseif prop == 'animation-direction'
let values = ["normal", "reverse", "alternate", "alternate-reverse"]
elseif prop == 'animation-duration'
let values = []
elseif prop == 'animation-fill-mode'
let values = ["none", "forwards", "backwards", "both"]
elseif prop == 'animation-iteration-count'
let values = []
elseif prop == 'animation-name'
let values = []
elseif prop == 'animation-play-state'
let values = ["running", "paused"]
elseif prop == 'animation-timing-function'
let values = timing_functions
elseif prop == 'background-attachment'
let values = ["scroll", "fixed"]
elseif prop == 'background-color'
let values = ["transparent", "rgb(", "#"]
let values = color_values
elseif prop == 'background-image'
let values = ["url(", "none"]
elseif prop == 'background-position'
@ -122,92 +161,172 @@ elseif borders[max(keys(borders))] == 'colon'
endif
elseif prop == 'background-repeat'
let values = ["repeat", "repeat-x", "repeat-y", "no-repeat"]
elseif prop == 'background-size'
let values = ["auto", "contain", "cover"]
elseif prop == 'background'
let values = ["url(", "scroll", "fixed", "transparent", "rgb(", "#", "none", "top", "center", "bottom" , "left", "right", "repeat", "repeat-x", "repeat-y", "no-repeat"]
elseif prop == 'border-collapse'
let values = ["collapse", "separate"]
let values = ["scroll", "fixed"] + color_values + ["url(", "none"] + ["top", "center", "bottom", "left", "right"] + ["repeat", "repeat-x", "repeat-y", "no-repeat"] + ["auto", "contain", "cover"]
elseif prop =~ 'border\%(-top\|-right\|-bottom\|-left\|-block-start\|-block-end\)\?$'
let vals = matchstr(line, '.*:\s*\zs.*')
if vals =~ '^\%([a-zA-Z0-9.]\+\)\?$'
let values = border_width_values
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\%([a-zA-Z]\+\)\?$'
let values = border_style_values
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$'
let values = color_values
else
return []
endif
elseif prop =~ 'border-\%(top\|right\|bottom\|left\|block-start\|block-end\)-color'
let values = color_values
elseif prop =~ 'border-\%(top\|right\|bottom\|left\|block-start\|block-end\)-style'
let values = border_style_values
elseif prop =~ 'border-\%(top\|right\|bottom\|left\|block-start\|block-end\)-width'
let values = border_width_values
elseif prop == 'border-color'
let values = ["rgb(", "#", "transparent"]
elseif prop == 'border-spacing'
return []
let values = color_values
elseif prop == 'border-style'
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
elseif prop =~ 'border-\%(top\|right\|bottom\|left\)$'
let vals = matchstr(line, '.*:\s*\zs.*')
if vals =~ '^\%([a-zA-Z0-9.]\+\)\?$'
let values = ["thin", "thick", "medium"]
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\%([a-zA-Z]\+\)\?$'
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$'
let values = ["rgb(", "#", "transparent"]
else
return []
endif
elseif prop =~ 'border-\%(top\|right\|bottom\|left\)-color'
let values = ["rgb(", "#", "transparent"]
elseif prop =~ 'border-\%(top\|right\|bottom\|left\)-style'
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
elseif prop =~ 'border-\%(top\|right\|bottom\|left\)-width'
let values = ["thin", "thick", "medium"]
let values = border_style_values
elseif prop == 'border-width'
let values = ["thin", "thick", "medium"]
elseif prop == 'border'
let vals = matchstr(line, '.*:\s*\zs.*')
if vals =~ '^\%([a-zA-Z0-9.]\+\)\?$'
let values = ["thin", "thick", "medium"]
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\%([a-zA-Z]\+\)\?$'
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$'
let values = ["rgb(", "#", "transparent"]
else
return []
endif
let values = border_width_values
elseif prop == 'bottom'
let values = ["auto"]
elseif prop == 'box-decoration-break'
let values = ["slice", "clone"]
elseif prop == 'box-shadow'
let values = ["inset"]
elseif prop == 'box-sizing'
let values = ["border-box", "content-box"]
elseif prop =~ 'break-\%(before\|after\)'
let values = ["auto", "always", "avoid", "left", "right", "page", "column", "region", "recto", "verso", "avoid-page", "avoid-column", "avoid-region"]
elseif prop == 'break-inside'
let values = ["auto", "avoid", "avoid-page", "avoid-column", "avoid-region"]
elseif prop == 'caption-side'
let values = ["top", "bottom"]
elseif prop == 'clear'
let values = ["none", "left", "right", "both"]
elseif prop == 'clip'
let values = ["auto", "rect("]
elseif prop == 'clip-path'
let values = ["fill-box", "stroke-box", "view-box", "none"]
elseif prop == 'color'
let values = ["rgb(", "#"]
let values = color_values
elseif prop == 'columns'
let values = []
elseif prop == 'column-count'
let values = ['auto']
elseif prop == 'column-fill'
let values = ['auto', 'balance']
elseif prop == 'column-rule-color'
let values = color_values
elseif prop == 'column-rule-style'
let values = border_style_values
elseif prop == 'column-rule-width'
let values = border_width_values
elseif prop == 'column-rule'
let vals = matchstr(line, '.*:\s*\zs.*')
if vals =~ '^\%([a-zA-Z0-9.]\+\)\?$'
let values = border_width_values
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\%([a-zA-Z]\+\)\?$'
let values = border_style_values
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$'
let values = color_values
else
return []
endif
elseif prop == 'column-span'
let values = ["none", "all"]
elseif prop == 'column-width'
let values = ["auto"]
elseif prop == 'content'
let values = ["normal", "attr(", "open-quote", "close-quote", "no-open-quote", "no-close-quote"]
elseif prop =~ 'counter-\%(increment\|reset\)$'
let values = ["none"]
elseif prop =~ '^\%(cue-after\|cue-before\|cue\)$'
let values = ["url(", "none"]
elseif prop =~ 'cue\%(-after\|-before\)\=$'
let values = ["url("]
elseif prop == 'cursor'
let values = ["url(", "auto", "crosshair", "default", "pointer", "move", "e-resize", "ne-resize", "nw-resize", "n-resize", "se-resize", "sw-resize", "s-resize", "w-resize", "text", "wait", "help", "progress"]
elseif prop == 'direction'
let values = ["ltr", "rtl"]
elseif prop == 'display'
let values = ["inline", "block", "list-item", "run-in", "inline-block", "table", "inline-table", "table-row-group", "table-header-group", "table-footer-group", "table-row", "table-column-group", "table-column", "table-cell", "table-caption", "none"]
let values = ["inline", "block", "list-item", "inline-list-item", "run-in", "inline-block", "table", "inline-table", "table-row-group", "table-header-group", "table-footer-group", "table-row", "table-column-group", "table-column", "table-cell", "table-caption", "none", "flex", "inline-flex", "grid", "inline-grid", "ruby", "ruby-base", "ruby-text", "ruby-base-container", "ruby-text-container", "contents"]
elseif prop == 'elevation'
let values = ["below", "level", "above", "higher", "lower"]
elseif prop == 'empty-cells'
let values = ["show", "hide"]
elseif prop == 'fallback'
let values = list_style_type_values
elseif prop == 'filter'
let values = ["blur(", "brightness(", "contrast(", "drop-shadow(", "grayscale(", "hue-rotate(", "invert(", "opacity(", "sepia(", "saturate("]
elseif prop == 'flex-basis'
let values = ["auto", "content"]
elseif prop == 'flex-flow'
let values = ["row", "row-reverse", "column", "column-reverse", "nowrap", "wrap", "wrap-reverse"]
elseif prop == 'flex-grow'
let values = []
elseif prop == 'flex-shrink'
let values = []
elseif prop == 'flex-wrap'
let values = ["nowrap", "wrap", "wrap-reverse"]
elseif prop == 'flex'
let values = ["nowrap", "wrap", "wrap-reverse"] + ["row", "row-reverse", "column", "column-reverse", "nowrap", "wrap", "wrap-reverse"] + ["auto", "content"]
elseif prop == 'float'
let values = ["left", "right", "none"]
elseif prop == 'font-family'
let values = ["sans-serif", "serif", "monospace", "cursive", "fantasy"]
elseif prop == 'font-feature-settings'
let values = ["normal", '"aalt"', '"abvf"', '"abvm"', '"abvs"', '"afrc"', '"akhn"', '"blwf"', '"blwm"', '"blws"', '"calt"', '"case"', '"ccmp"', '"cfar"', '"cjct"', '"clig"', '"cpct"', '"cpsp"', '"cswh"', '"curs"', '"cv', '"c2pc"', '"c2sc"', '"dist"', '"dlig"', '"dnom"', '"dtls"', '"expt"', '"falt"', '"fin2"', '"fin3"', '"fina"', '"flac"', '"frac"', '"fwid"', '"half"', '"haln"', '"halt"', '"hist"', '"hkna"', '"hlig"', '"hngl"', '"hojo"', '"hwid"', '"init"', '"isol"', '"ital"', '"jalt"', '"jp78"', '"jp83"', '"jp90"', '"jp04"', '"kern"', '"lfbd"', '"liga"', '"ljmo"', '"lnum"', '"locl"', '"ltra"', '"ltrm"', '"mark"', '"med2"', '"medi"', '"mgrk"', '"mkmk"', '"mset"', '"nalt"', '"nlck"', '"nukt"', '"numr"', '"onum"', '"opbd"', '"ordn"', '"ornm"', '"palt"', '"pcap"', '"pkna"', '"pnum"', '"pref"', '"pres"', '"pstf"', '"psts"', '"pwid"', '"qwid"', '"rand"', '"rclt"', '"rkrf"', '"rlig"', '"rphf"', '"rtbd"', '"rtla"', '"rtlm"', '"ruby"', '"salt"', '"sinf"', '"size"', '"smcp"', '"smpl"', '"ss01"', '"ss02"', '"ss03"', '"ss04"', '"ss05"', '"ss06"', '"ss07"', '"ss08"', '"ss09"', '"ss10"', '"ss11"', '"ss12"', '"ss13"', '"ss14"', '"ss15"', '"ss16"', '"ss17"', '"ss18"', '"ss19"', '"ss20"', '"ssty"', '"stch"', '"subs"', '"sups"', '"swsh"', '"titl"', '"tjmo"', '"tnam"', '"tnum"', '"trad"', '"twid"', '"unic"', '"valt"', '"vatu"', '"vert"', '"vhal"', '"vjmo"', '"vkna"', '"vkrn"', '"vpal"', '"vrt2"', '"zero"']
elseif prop == 'font-kerning'
let values = ["auto", "normal", "none"]
elseif prop == 'font-language-override'
let values = ["normal"]
elseif prop == 'font-size'
let values = ["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller"]
elseif prop == 'font-size-adjust'
let values = []
elseif prop == 'font-stretch'
let values = ["normal", "ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded"]
elseif prop == 'font-style'
let values = ["normal", "italic", "oblique"]
elseif prop == 'font-synthesis'
let values = ["none", "weight", "style"]
elseif prop == 'font-variant-alternates'
let values = ["normal", "historical-forms", "stylistic(", "styleset(", "character-variant(", "swash(", "ornaments(", "annotation("]
elseif prop == 'font-variant-caps'
let values = ["normal", "small-caps", "all-small-caps", "petite-caps", "all-petite-caps", "unicase", "titling-caps"]
elseif prop == 'font-variant-asian'
let values = ["normal", "ruby", "jis78", "jis83", "jis90", "jis04", "simplified", "traditional"]
elseif prop == 'font-variant-ligatures'
let values = ["normal", "none", "common-ligatures", "no-common-ligatures", "discretionary-ligatures", "no-discretionary-ligatures", "historical-ligatures", "no-historical-ligatures", "contextual", "no-contextual"]
elseif prop == 'font-variant-numeric'
let values = ["normal", "ordinal", "slashed-zero", "lining-nums", "oldstyle-nums", "proportional-nums", "tabular-nums", "diagonal-fractions", "stacked-fractions"]
elseif prop == 'font-variant-position'
let values = ["normal", "sub", "super"]
elseif prop == 'font-variant'
let values = ["normal", "small-caps"]
let values = ["normal", "historical-forms", "stylistic(", "styleset(", "character-variant(", "swash(", "ornaments(", "annotation("] + ["small-caps", "all-small-caps", "petite-caps", "all-petite-caps", "unicase", "titling-caps"] + ["ruby", "jis78", "jis83", "jis90", "jis04", "simplified", "traditional"] + ["none", "common-ligatures", "no-common-ligatures", "discretionary-ligatures", "no-discretionary-ligatures", "historical-ligatures", "no-historical-ligatures", "contextual", "no-contextual"] + ["ordinal", "slashed-zero", "lining-nums", "oldstyle-nums", "proportional-nums", "tabular-nums", "diagonal-fractions", "stacked-fractions"] + ["sub", "super"]
elseif prop == 'font-weight'
let values = ["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"]
elseif prop == 'font'
let values = ["normal", "italic", "oblique", "small-caps", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900", "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller", "sans-serif", "serif", "monospace", "cursive", "fantasy", "caption", "icon", "menu", "message-box", "small-caption", "status-bar"]
elseif prop =~ '^\%(height\|width\)$'
let values = ["auto"]
let values = ["auto", "border-box", "content-box", "max-content", "min-content", "available", "fit-content"]
elseif prop =~ '^\%(left\|rigth\)$'
let values = ["auto"]
elseif prop == 'image-rendering'
let values = ["auto", "crisp-edges", "pixelated"]
elseif prop == 'image-orientation'
let values = ["from-image", "flip"]
elseif prop == 'ime-mode'
let values = ["auto", "normal", "active", "inactive", "disabled"]
elseif prop == 'inline-size'
let values = ["auto", "border-box", "content-box", "max-content", "min-content", "available", "fit-content"]
elseif prop == 'isolation'
let values = ["auto", "isolate"]
elseif prop == 'justify-content'
let values = ["flex-start", "flex-end", "center", "space-between", "space-around"]
elseif prop == 'letter-spacing'
let values = ["normal"]
elseif prop == 'line-break'
let values = ["auto", "loose", "normal", "strict"]
elseif prop == 'line-height'
let values = ["normal"]
elseif prop == 'list-style-image'
@ -215,25 +334,37 @@ elseif borders[max(keys(borders))] == 'colon'
elseif prop == 'list-style-position'
let values = ["inside", "outside"]
elseif prop == 'list-style-type'
let values = ["disc", "circle", "square", "decimal", "decimal-leading-zero", "lower-roman", "upper-roman", "lower-latin", "upper-latin", "none"]
let values = list_style_type_values
elseif prop == 'list-style'
return []
let values = list_style_type_values + ["inside", "outside"] + ["url(", "none"]
elseif prop == 'margin'
let values = ["auto"]
elseif prop =~ 'margin-\%(right\|left\|top\|bottom\)$'
elseif prop =~ 'margin-\%(right\|left\|top\|bottom\|block-start\|block-end\|inline-start\|inline-end\)$'
let values = ["auto"]
elseif prop == 'max-height'
elseif prop == 'marks'
let values = ["crop", "cross", "none"]
elseif prop == 'mask'
let values = ["url("]
elseif prop == 'mask-type'
let values = ["luminance", "alpha"]
elseif prop == '\%(max\|min\)-\%(block\|inline\)-size'
let values = ["auto", "border-box", "content-box", "max-content", "min-content", "available", "fit-content"]
elseif prop == '\%(max\|min\)-\%(height\|width\)'
let values = ["auto", "border-box", "content-box", "max-content", "min-content", "available", "fit-content"]
elseif prop == '\%(max\|min\)-zoom'
let values = ["auto"]
elseif prop == 'max-width'
let values = ["none"]
elseif prop == 'min-height'
let values = ["none"]
elseif prop == 'min-width'
let values = ["none"]
elseif prop == 'mix-blend-mode'
let values = ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"]
elseif prop == 'opacity'
let values = []
elseif prop == 'orientation'
let values = ["auto", "portrait", "landscape"]
elseif prop == 'orphans'
return []
let values = []
elseif prop == 'outline-offset'
let values = []
elseif prop == 'outline-color'
let values = ["rgb(", "#"]
let values = color_values
elseif prop == 'outline-style'
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
elseif prop == 'outline-width'
@ -241,7 +372,7 @@ elseif borders[max(keys(borders))] == 'colon'
elseif prop == 'outline'
let vals = matchstr(line, '.*:\s*\zs.*')
if vals =~ '^\%([a-zA-Z0-9,()#]\+\)\?$'
let values = ["rgb(", "#"]
let values = color_values
elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+\%([a-zA-Z]\+\)\?$'
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$'
@ -249,85 +380,197 @@ elseif borders[max(keys(borders))] == 'colon'
else
return []
endif
elseif prop == 'overflow'
elseif prop == 'overflow-wrap'
let values = ["normal", "break-word"]
elseif prop =~ 'overflow\%(-x\|-y\)\='
let values = ["visible", "hidden", "scroll", "auto"]
elseif prop == 'pad'
let values = []
elseif prop == 'padding'
return []
elseif prop =~ 'padding-\%(top\|right\|bottom\|left\)$'
return []
let values = []
elseif prop =~ 'padding-\%(top\|right\|bottom\|left\|inline-start\|inline-end\|block-start\|block-end\)$'
let values = []
elseif prop =~ 'page-break-\%(after\|before\)$'
let values = ["auto", "always", "avoid", "left", "right"]
let values = ["auto", "always", "avoid", "left", "right", "recto", "verso"]
elseif prop == 'page-break-inside'
let values = ["auto", "avoid"]
elseif prop =~ 'pause-\%(after\|before\)$'
return []
elseif prop == 'pause'
return []
elseif prop == 'pitch-range'
return []
elseif prop == 'pitch'
let values = ["x-low", "low", "medium", "high", "x-high"]
elseif prop == 'play-during'
let values = ["url(", "mix", "repeat", "auto", "none"]
elseif prop =~ 'pause\%(-after\|-before\)\=$'
let values = ["none", "x-weak", "weak", "medium", "strong", "x-strong"]
elseif prop == 'perspective'
let values = ["none"]
elseif prop == 'perspective-origin'
let values = ["top", "bottom", "left", "center", " right"]
elseif prop == 'pointer-events'
let values = ["auto", "none", "visiblePainted", "visibleFill", "visibleStroke", "visible", "painted", "fill", "stroke", "all"]
elseif prop == 'position'
let values = ["static", "relative", "absolute", "fixed"]
let values = ["static", "relative", "absolute", "fixed", "sticky"]
elseif prop == 'prefix'
let values = []
elseif prop == 'quotes'
let values = ["none"]
elseif prop == 'richness'
elseif prop == 'range'
let values = ["auto", "infinite"]
elseif prop == 'resize'
let values = ["none", "both", "horizontal", "vertical"]
elseif prop =~ 'rest\%(-after\|-before\)\=$'
let values = ["none", "x-weak", "weak", "medium", "strong", "x-strong"]
elseif prop == 'ruby-align'
let values = ["start", "center", "space-between", "space-around"]
elseif prop == 'ruby-merge'
let values = ["separate", "collapse", "auto"]
elseif prop == 'ruby-position'
let values = ["over", "under", "inter-character"]
elseif prop == 'scroll-behavior'
let values = ["auto", "smooth"]
elseif prop == 'scroll-snap-coordinate'
let values = ["none"]
elseif prop == 'scroll-snap-destination'
return []
elseif prop == 'speak-header'
let values = ["once", "always"]
elseif prop == 'speak-numeral'
let values = ["digits", "continuous"]
elseif prop == 'speak-punctuation'
let values = ["code", "none"]
elseif prop == 'scroll-snap-points-\%(x\|y\)$'
let values = ["none", "repeat("]
elseif prop == 'scroll-snap-type\%(-x\|-y\)\=$'
let values = ["none", "mandatory", "proximity"]
elseif prop == 'shape-image-threshold'
let values = []
elseif prop == 'shape-margin'
let values = []
elseif prop == 'shape-outside'
let values = ["margin-box", "border-box", "padding-box", "content-box", 'inset(', 'circle(', 'ellipse(', 'polygon(', 'url(']
elseif prop == 'speak'
let values = ["normal", "none", "spell-out"]
elseif prop == 'speech-rate'
let values = ["x-slow", "slow", "medium", "fast", "x-fast", "faster", "slower"]
elseif prop == 'stress'
return []
let values = ["auto", "none", "normal"]
elseif prop == 'speak-as'
let values = ["auto", "normal", "spell-out", "digits"]
elseif prop == 'src'
let values = ["url("]
elseif prop == 'suffix'
let values = []
elseif prop == 'symbols'
let values = []
elseif prop == 'system'
let vals = matchstr(line, '.*:\s*\zs.*')
if vals =~ '^extends'
let values = list_style_type_values
else
let values = ["cyclic", "numeric", "alphabetic", "symbolic", "additive", "fixed", "extends"]
endif
elseif prop == 'table-layout'
let values = ["auto", "fixed"]
elseif prop == 'tab-size'
let values = []
elseif prop == 'text-align'
let values = ["left", "right", "center", "justify"]
elseif prop == 'text-decoration'
let values = ["start", "end", "left", "right", "center", "justify", "match-parent"]
elseif prop == 'text-align-last'
let values = ["auto", "start", "end", "left", "right", "center", "justify"]
elseif prop == 'text-combine-upright'
let values = ["none", "all", "digits"]
elseif prop == 'text-decoration-line'
let values = ["none", "underline", "overline", "line-through", "blink"]
elseif prop == 'text-decoration-color'
let values = color_values
elseif prop == 'text-decoration-style'
let values = ["solid", "double", "dotted", "dashed", "wavy"]
elseif prop == 'text-decoration'
let values = ["none", "underline", "overline", "line-through", "blink"] + ["solid", "double", "dotted", "dashed", "wavy"] + color_values
elseif prop == 'text-emphasis-color'
let values = color_values
elseif prop == 'text-emphasis-position'
let values = ["over", "under", "left", "right"]
elseif prop == 'text-emphasis-style'
let values = ["none", "filled", "open", "dot", "circle", "double-circle", "triangle", "sesame"]
elseif prop == 'text-emphasis'
let values = color_values + ["over", "under", "left", "right"] + ["none", "filled", "open", "dot", "circle", "double-circle", "triangle", "sesame"]
elseif prop == 'text-indent'
return []
let values = ["hanging", "each-line"]
elseif prop == 'text-orientation'
let values = ["mixed", "upright", "sideways", "sideways-right", "use-glyph-orientation"]
elseif prop == 'text-overflow'
let values = ["clip", "ellipsis"]
elseif prop == 'text-rendering'
let values = ["auto", "optimizeSpeed", "optimizeLegibility", "geometricPrecision"]
elseif prop == 'text-shadow'
let values = color_values
elseif prop == 'text-transform'
let values = ["capitalize", "uppercase", "lowercase", "none"]
let values = ["capitalize", "uppercase", "lowercase", "full-width", "none"]
elseif prop == 'text-underline-position'
let values = ["auto", "under", "left", "right"]
elseif prop == 'touch-action'
let values = ["auto", "none", "pan-x", "pan-y", "manipulation", "pan-left", "pan-right", "pan-top", "pan-down"]
elseif prop == 'transform'
let values = ["matrix(", "translate(", "translateX(", "translateY(", "scale(", "scaleX(", "scaleY(", "rotate(", "skew(", "skewX(", "skewY(", "matrix3d(", "translate3d(", "translateZ(", "scale3d(", "scaleZ(", "rotate3d(", "rotateX(", "rotateY(", "rotateZ(", "perspective("]
elseif prop == 'transform-box'
let values = ["border-box", "fill-box", "view-box"]
elseif prop == 'transform-origin'
let values = ["left", "center", "right", "top", "bottom"]
elseif prop == 'transform-style'
let values = ["flat", "preserve-3d"]
elseif prop == 'top'
let values = ["auto"]
elseif prop == 'transition-property'
let values = ["all", "none"] + s:values
elseif prop == 'transition-duration'
let values = []
elseif prop == 'transition-delay'
let values = []
elseif prop == 'transition-timing-function'
let values = timing_functions
elseif prop == 'transition'
let values = ["all", "none"] + s:values + timing_functions
elseif prop == 'unicode-bidi'
let values = ["normal", "embed", "bidi-override"]
let values = ["normal", "embed", "isolate", "bidi-override", "isolate-override", "plaintext"]
elseif prop == 'unicode-range'
let values = ["U+"]
elseif prop == 'user-zoom'
let values = ["zoom", "fixed"]
elseif prop == 'vertical-align'
let values = ["baseline", "sub", "super", "top", "text-top", "middle", "bottom", "text-bottom"]
elseif prop == 'visibility'
let values = ["visible", "hidden", "collapse"]
elseif prop == 'voice-family'
return []
elseif prop == 'volume'
elseif prop == 'voice-volume'
let values = ["silent", "x-soft", "soft", "medium", "loud", "x-loud"]
elseif prop == 'voice-balance'
let values = ["left", "center", "right", "leftwards", "rightwards"]
elseif prop == 'voice-family'
let values = []
elseif prop == 'voice-rate'
let values = ["normal", "x-slow", "slow", "medium", "fast", "x-fast"]
elseif prop == 'voice-pitch'
let values = ["absolute", "x-low", "low", "medium", "high", "x-high"]
elseif prop == 'voice-range'
let values = ["absolute", "x-low", "low", "medium", "high", "x-high"]
elseif prop == 'voice-stress'
let values = ["normal", "strong", "moderate", "none", "reduced "]
elseif prop == 'voice-duration'
let values = ["auto"]
elseif prop == 'white-space'
let values = ["normal", "pre", "nowrap", "pre-wrap", "pre-line"]
elseif prop == 'widows'
return []
let values = []
elseif prop == 'will-change'
let values = ["auto", "scroll-position", "contents"] + s:values
elseif prop == 'word-break'
let values = ["normal", "break-all", "keep-all"]
elseif prop == 'word-spacing'
let values = ["normal"]
elseif prop == 'word-wrap'
let values = ["normal", "break-word"]
elseif prop == 'writing-mode'
let values = ["horizontal-tb", "vertical-rl", "vertical-lr", "sideways-rl", "sideways-lr"]
elseif prop == 'z-index'
let values = ["auto"]
elseif prop == 'zoom'
let values = ["auto"]
else
" If no property match it is possible we are outside of {} and
" trying to complete pseudo-(class|element)
let element = tolower(matchstr(line, '\zs[a-zA-Z1-6]*\ze:[^:[:space:]]\{-}$'))
if stridx(',a,abbr,acronym,address,area,b,base,bdo,big,blockquote,body,br,button,caption,cite,code,col,colgroup,dd,del,dfn,div,dl,dt,em,fieldset,form,head,h1,h2,h3,h4,h5,h6,hr,html,i,img,input,ins,kbd,label,legend,li,link,map,meta,noscript,object,ol,optgroup,option,p,param,pre,q,samp,script,select,small,span,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead,title,tr,tt,ul,var,', ','.element.',') > -1
let values = ["first-child", "link", "visited", "hover", "active", "focus", "lang", "first-line", "first-letter", "before", "after"]
if stridx('a,abbr,address,area,article,aside,audio,b,base,bdi,bdo,bgsound,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,command,content,data,datalist,dd,del,details,dfn,dialog,div,dl,dt,element,em,embed,fieldset,figcaption,figure,font,footer,form,frame,frameset,head,header,hgroup,hr,html,i,iframe,image,img,input,ins,isindex,kbd,keygen,label,legend,li,link,main,map,mark,menu,menuitem,meta,meter,nav,nobr,noframes,noscript,object,ol,optgroup,option,output,p,param,picture,pre,progress,q,rp,rt,rtc,ruby,s,samp,script,section,select,shadow,small,source,span,strong,style,sub,summary,sup,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,u,ul,var,video,wbr', ','.element.',') > -1
let values = ["active", "any", "checked", "default", "dir(", "disabled", "empty", "enabled", "first", "first-child", "first-of-type", "fullscreen", "focus", "hover", "indeterminate", "in-range", "invalid", "lang(", "last-child", "last-of-type", "left", "link", "not(", "nth-child(", "nth-last-child(", "nth-last-of-type(", "nth-of-type(", "only-child", "only-of-type", "optional", "out-of-range", "read-only", "read-write", "required", "right", "root", "scope", "target", "valid", "visited", "first-line", "first-letter", "before", "after", "selection", "backdrop"]
else
return []
endif
endif
let values = wide_keywords + values
" Complete values
let entered_value = matchstr(line, '.\{-}\zs[a-zA-Z0-9#,.(_-]*$')
@ -369,10 +612,69 @@ elseif borders[max(keys(borders))] == 'atrule'
let atrulename = matchstr(line, '.*@\zs[a-zA-Z-]\+\ze')
if atrulename == 'media'
let values = ["screen", "tty", "tv", "projection", "handheld", "print", "braille", "aural", "all"]
let entered_atruleafter = matchstr(line, '.*@media\s\+\zs.*$')
if entered_atruleafter =~ "([^)]*$"
let entered_atruleafter = matchstr(entered_atruleafter, '(\s*\zs[^)]*$')
let values = ["max-width", "min-width", "width", "max-height", "min-height", "height", "max-aspect-ration", "min-aspect-ration", "aspect-ratio", "orientation", "max-resolution", "min-resolution", "resolution", "scan", "grid", "update-frequency", "overflow-block", "overflow-inline", "max-color", "min-color", "color", "max-color-index", "min-color-index", "color-index", "monochrome", "inverted-colors", "pointer", "hover", "any-pointer", "any-hover", "light-level", "scripting"]
else
let values = ["screen", "print", "speech", "all", "not", "and", "("]
endif
elseif atrulename == 'supports'
let entered_atruleafter = matchstr(line, '.*@supports\s\+\zs.*$')
if entered_atruleafter =~ "([^)]*$"
let entered_atruleafter = matchstr(entered_atruleafter, '(\s*\zs.*$')
let values = s:values
else
let values = ["("]
endif
elseif atrulename == 'charset'
let entered_atruleafter = matchstr(line, '.*@charset\s\+\zs.*$')
let values = [
\ '"UTF-8";', '"ANSI_X3.4-1968";', '"ISO_8859-1:1987";', '"ISO_8859-2:1987";', '"ISO_8859-3:1988";', '"ISO_8859-4:1988";', '"ISO_8859-5:1988";',
\ '"ISO_8859-6:1987";', '"ISO_8859-7:1987";', '"ISO_8859-8:1988";', '"ISO_8859-9:1989";', '"ISO-8859-10";', '"ISO_6937-2-add";', '"JIS_X0201";',
\ '"JIS_Encoding";', '"Shift_JIS";', '"Extended_UNIX_Code_Packed_Format_for_Japanese";', '"Extended_UNIX_Code_Fixed_Width_for_Japanese";',
\ '"BS_4730";', '"SEN_850200_C";', '"IT";', '"ES";', '"DIN_66003";', '"NS_4551-1";', '"NF_Z_62-010";', '"ISO-10646-UTF-1";', '"ISO_646.basic:1983";',
\ '"INVARIANT";', '"ISO_646.irv:1983";', '"NATS-SEFI";', '"NATS-SEFI-ADD";', '"NATS-DANO";', '"NATS-DANO-ADD";', '"SEN_850200_B";', '"KS_C_5601-1987";',
\ '"ISO-2022-KR";', '"EUC-KR";', '"ISO-2022-JP";', '"ISO-2022-JP-2";', '"JIS_C6220-1969-jp";', '"JIS_C6220-1969-ro";', '"PT";', '"greek7-old";',
\ '"latin-greek";', '"NF_Z_62-010_(1973)";', '"Latin-greek-1";', '"ISO_5427";', '"JIS_C6226-1978";', '"BS_viewdata";', '"INIS";', '"INIS-8";',
\ '"INIS-cyrillic";', '"ISO_5427:1981";', '"ISO_5428:1980";', '"GB_1988-80";', '"GB_2312-80";', '"NS_4551-2";', '"videotex-suppl";', '"PT2";',
\ '"ES2";', '"MSZ_7795.3";', '"JIS_C6226-1983";', '"greek7";', '"ASMO_449";', '"iso-ir-90";', '"JIS_C6229-1984-a";', '"JIS_C6229-1984-b";',
\ '"JIS_C6229-1984-b-add";', '"JIS_C6229-1984-hand";', '"JIS_C6229-1984-hand-add";', '"JIS_C6229-1984-kana";', '"ISO_2033-1983";',
\ '"ANSI_X3.110-1983";', '"T.61-7bit";', '"T.61-8bit";', '"ECMA-cyrillic";', '"CSA_Z243.4-1985-1";', '"CSA_Z243.4-1985-2";', '"CSA_Z243.4-1985-gr";',
\ '"ISO_8859-6-E";', '"ISO_8859-6-I";', '"T.101-G2";', '"ISO_8859-8-E";', '"ISO_8859-8-I";', '"CSN_369103";', '"JUS_I.B1.002";', '"IEC_P27-1";',
\ '"JUS_I.B1.003-serb";', '"JUS_I.B1.003-mac";', '"greek-ccitt";', '"NC_NC00-10:81";', '"ISO_6937-2-25";', '"GOST_19768-74";', '"ISO_8859-supp";',
\ '"ISO_10367-box";', '"latin-lap";', '"JIS_X0212-1990";', '"DS_2089";', '"us-dk";', '"dk-us";', '"KSC5636";', '"UNICODE-1-1-UTF-7";', '"ISO-2022-CN";',
\ '"ISO-2022-CN-EXT";', '"ISO-8859-13";', '"ISO-8859-14";', '"ISO-8859-15";', '"ISO-8859-16";', '"GBK";', '"GB18030";', '"OSD_EBCDIC_DF04_15";',
\ '"OSD_EBCDIC_DF03_IRV";', '"OSD_EBCDIC_DF04_1";', '"ISO-11548-1";', '"KZ-1048";', '"ISO-10646-UCS-2";', '"ISO-10646-UCS-4";', '"ISO-10646-UCS-Basic";',
\ '"ISO-10646-Unicode-Latin1";', '"ISO-10646-J-1";', '"ISO-Unicode-IBM-1261";', '"ISO-Unicode-IBM-1268";', '"ISO-Unicode-IBM-1276";',
\ '"ISO-Unicode-IBM-1264";', '"ISO-Unicode-IBM-1265";', '"UNICODE-1-1";', '"SCSU";', '"UTF-7";', '"UTF-16BE";', '"UTF-16LE";', '"UTF-16";', '"CESU-8";',
\ '"UTF-32";', '"UTF-32BE";', '"UTF-32LE";', '"BOCU-1";', '"ISO-8859-1-Windows-3.0-Latin-1";', '"ISO-8859-1-Windows-3.1-Latin-1";',
\ '"ISO-8859-2-Windows-Latin-2";', '"ISO-8859-9-Windows-Latin-5";', '"hp-roman8";', '"Adobe-Standard-Encoding";', '"Ventura-US";',
\ '"Ventura-International";', '"DEC-MCS";', '"IBM850";', '"PC8-Danish-Norwegian";', '"IBM862";', '"PC8-Turkish";', '"IBM-Symbols";', '"IBM-Thai";',
\ '"HP-Legal";', '"HP-Pi-font";', '"HP-Math8";', '"Adobe-Symbol-Encoding";', '"HP-DeskTop";', '"Ventura-Math";', '"Microsoft-Publishing";',
\ '"Windows-31J";', '"GB2312";', '"Big5";', '"macintosh";', '"IBM037";', '"IBM038";', '"IBM273";', '"IBM274";', '"IBM275";', '"IBM277";', '"IBM278";',
\ '"IBM280";', '"IBM281";', '"IBM284";', '"IBM285";', '"IBM290";', '"IBM297";', '"IBM420";', '"IBM423";', '"IBM424";', '"IBM437";', '"IBM500";', '"IBM851";',
\ '"IBM852";', '"IBM855";', '"IBM857";', '"IBM860";', '"IBM861";', '"IBM863";', '"IBM864";', '"IBM865";', '"IBM868";', '"IBM869";', '"IBM870";', '"IBM871";',
\ '"IBM880";', '"IBM891";', '"IBM903";', '"IBM904";', '"IBM905";', '"IBM918";', '"IBM1026";', '"EBCDIC-AT-DE";', '"EBCDIC-AT-DE-A";', '"EBCDIC-CA-FR";',
\ '"EBCDIC-DK-NO";', '"EBCDIC-DK-NO-A";', '"EBCDIC-FI-SE";', '"EBCDIC-FI-SE-A";', '"EBCDIC-FR";', '"EBCDIC-IT";', '"EBCDIC-PT";', '"EBCDIC-ES";',
\ '"EBCDIC-ES-A";', '"EBCDIC-ES-S";', '"EBCDIC-UK";', '"EBCDIC-US";', '"UNKNOWN-8BIT";', '"MNEMONIC";', '"MNEM";', '"VISCII";', '"VIQR";', '"KOI8-R";',
\ '"HZ-GB-2312";', '"IBM866";', '"IBM775";', '"KOI8-U";', '"IBM00858";', '"IBM00924";', '"IBM01140";', '"IBM01141";', '"IBM01142";', '"IBM01143";',
\ '"IBM01144";', '"IBM01145";', '"IBM01146";', '"IBM01147";', '"IBM01148";', '"IBM01149";', '"Big5-HKSCS";', '"IBM1047";', '"PTCP154";', '"Amiga-1251";',
\ '"KOI7-switched";', '"BRF";', '"TSCII";', '"windows-1250";', '"windows-1251";', '"windows-1252";', '"windows-1253";', '"windows-1254";', '"windows-1255";',
\ '"windows-1256";', '"windows-1257";', '"windows-1258";', '"TIS-620";']
elseif atrulename == 'namespace'
let entered_atruleafter = matchstr(line, '.*@namespace\s\+\zs.*$')
let values = ["url("]
elseif atrulename == 'document'
let entered_atruleafter = matchstr(line, '.*@document\s\+\zs.*$')
let values = ["url(", "url-prefix(", "domain(", "regexp("]
elseif atrulename == 'import'
let entered_atruleafter = matchstr(line, '.*@import\s\+\zs.*$')
@ -398,8 +700,17 @@ elseif borders[max(keys(borders))] == 'atrule'
for m in values
if m =~? '^'.entered_atruleafter
if entered_atruleafter =~? '^"' && m =~? '^"'
let m = m[1:]
endif
if b:after =~? '"' && stridx(m, '"') > -1
let m = m[0:stridx(m, '"')-1]
endif
call add(res, m)
elseif m =~? entered_atruleafter
if m =~? '^"'
let m = m[1:]
endif
call add(res2, m)
endif
endfor
@ -408,7 +719,7 @@ elseif borders[max(keys(borders))] == 'atrule'
endif
let values = ["charset", "page", "media", "import", "font-face"]
let values = ["charset", "page", "media", "import", "font-face", "namespace", "supports", "keyframes", "viewport", "document"]
let entered_atrule = matchstr(line, '.*@\zs[a-zA-Z-]*$')

171
runtime/autoload/health.vim Normal file
View File

@ -0,0 +1,171 @@
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 ModeMsg
syntax keyword healthSuggestion SUGGESTIONS
highlight link healthSuggestion String
syntax match healthHelp "|.\{-}|" contains=healthBar
syntax match healthBar "|" contained conceal
highlight link healthHelp Identifier
" We do not care about markdown syntax errors in :CheckHealth output.
highlight! link markdownError Normal
" We don't need code blocks.
silent! syntax clear markdownCodeBlock
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
setlocal conceallevel=2 concealcursor=nc
setlocal keywordprg=:help
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:throwpoint."\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
" Changes ':help clipboard' to '|clipoard|'. Also removes surrounding quotes.
function! s:help_to_link(s) abort
return substitute(a:s, '\v[''"]?:h%[elp] ([^''"]+)[''"]?', '|\1|', 'g')
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 s:help_to_link(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 > 300
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,451 @@
let s:shell_error = 0
function! s:is_bad_response(s) abort
return a:s =~? '\v(^unable)|(^error)|(^outdated)'
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, '\.', 0)
let b = split(a:b, '\.', 0)
for i in range(len(a))
if str2nr(a[i]) > str2nr(b[i])
return 1
elseif str2nr(a[i]) < str2nr(b[i])
return -1
endif
endfor
return 0
endfunction
" Handler for s:system() function.
function! s:system_handler(jobid, data, event) abort
if a:event == 'stdout' || a:event == 'stderr'
let self.output .= join(a:data, '')
elseif a:event == 'exit'
let s:shell_error = a:data
endif
endfunction
" Run a system command and timeout after 30 seconds.
function! s:system(cmd, ...) abort
let stdin = a:0 ? a:1 : ''
let opts = {
\ 'output': '',
\ 'on_stdout': function('s:system_handler'),
\ 'on_stderr': function('s:system_handler'),
\ 'on_exit': function('s:system_handler'),
\ }
let jobid = jobstart(a:cmd, opts)
if jobid < 1
call health#report_error(printf('Command error %d: %s', jobid,
\ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd)))
let s:shell_error = 1
return opts.output
endif
if !empty(stdin)
call jobsend(jobid, stdin)
endif
let res = jobwait([jobid], 30000)
if res[0] == -1
call health#report_error(printf('Command timed out: %s',
\ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd))
call jobstop(jobid)
elseif s:shell_error != 0
call health#report_error(printf("Command error (%d) %s: %s", jobid,
\ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd,
\ opts.output))
endif
return opts.output
endfunction
function! s:systemlist(cmd, ...) abort
let stdout = split(s:system(a:cmd, a:0 ? a:1 : ''), "\n")
if a:0 > 1 && !empty(a:2)
return filter(stdout, '!empty(v:val)')
endif
return stdout
endfunction
" Fetch the contents of a URL.
function! s:download(url) abort
if executable('curl')
let rv = s:system(['curl', '-sL', a:url])
return s:shell_error ? 'curl error: '.s: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 = s:system(['python', '-c', script])
return empty(rv) && s:shell_error
\ ? 'python urllib.request error: '.s:shell_error
\ : rv
endif
return 'missing `curl` and `python`, cannot make pypi request'
endfunction
" Check for clipboard tools.
function! s:check_clipboard() abort
call health#report_start('Clipboard')
let clipboard_tool = provider#clipboard#Executable()
if empty(clipboard_tool)
call health#report_warn(
\ "No clipboard tool found. Using the system clipboard won't work.",
\ ['See |clipboard|.'])
else
call health#report_ok('Clipboard tool found: '. clipboard_tool)
endif
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(s: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(s:system([
\ a:python,
\ '-c',
\ 'import neovim; print(neovim.__file__)']))
let nvim_path = s: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(s: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(s: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(printf('Latest %s-neovim is NOT installed: %s',
\ python_bin_name, latest))
elseif !s:is_bad_response(latest)
call health#report_ok(printf('Latest %s-neovim is installed: %s',
\ python_bin_name, latest))
endif
endif
endfunction
function! s:check_ruby() abort
call health#report_start('Ruby provider')
let ruby_version = 'not found'
if executable('ruby')
let ruby_version = s:systemlist('ruby -v')[0]
endif
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(s: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 = s:systemlist(ruby_prog . ' --version')[0]
if s: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_clipboard()
call s:check_python(2)
call s:check_python(3)
call s:check_ruby()
endfunction

View File

@ -1,137 +1,280 @@
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
" Load man page {page} from {section}
" call man#get_page([{section}, ]{page})
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'
elseif a:0 == 0
let ref = &filetype ==# 'man' ? expand('<cWORD>') : expand('<cword>')
if empty(ref)
call s:error('no identifier under cursor')
return
endif
let sect = get(a:000, 0)
let page = get(a:000, 1, sect)
let [page, sect] = s:parse_page_and_section(sect, page)
if !empty(sect) && s:find_page(sect, page) == 0
let sect = ''
elseif a:0 ==# 1
let ref = a:1
else
" 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 s:find_page(sect, page) == 0
echo 'No manual entry for '.page
try
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
call s:error(v:exception)
return
endtry
call s:push_tag()
let bufname = 'man://'.name.(empty(sect)?'':'('.sect.')')
if a:mods !~# 'tab' && s:find_man()
noautocmd execute 'silent edit' fnameescape(bufname)
else
noautocmd execute 'silent' a:mods 'split' fnameescape(bufname)
endif
let b:man_sect = sect
call s:read_page(path)
endfunction
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
exec thiswin . 'wincmd 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.')')
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
silent keepjumps norm! 1G"_dG
if empty($MANWIDTH)
let $MANWIDTH = winwidth(0)
endif
silent exec 'r!/usr/bin/man '.s:cmd(sect, page).' | col -b'
" Remove blank lines from top and bottom.
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 backspaced characters.
execute 'silent keeppatterns keepjumps %substitute,.\b,,e'.(&gdefault?'':'g')
while getline(1) =~# '^\s*$'
silent keepjumps 1delete _
endwhile
while getline('$') =~# '^\s*$'
silent keepjumps $delete _
endwhile
setlocal nomodified
setlocal filetype=man
endfunction
if invoked_from_man || editcmd ==# 'tabnew'
call s:set_window_local_options()
" 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)
execute 'silent' tag['buf'].'buffer'
call cursor(tag['lnum'], tag['col'])
endif
endfunction
function s:set_window_local_options() abort
setlocal colorcolumn=0 foldcolumn=0 nonumber
setlocal nolist norelativenumber nofoldenable
" 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 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
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
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
" Expects a string like 'access' or 'access(2)'.
function s:parse_page_and_section(sect, str) abort
function! man#init_pager() abort
" Remove all backspaced characters.
execute 'silent keeppatterns keepjumps %substitute,.\b,,e'.(&gdefault?'':'g')
if getline(1) =~# '^\s*$'
silent keepjumps 1delete _
else
keepjumps 1
endif
" This is not perfect. See `man glDrawArraysInstanced`. Since the title is
" all caps it is impossible to tell what the original capitilization was.
let ref = tolower(matchstr(getline(1), '^\S\+'))
try
let [page, sect] = matchlist(a:str, '\v\C([-.[:alnum:]_]+)%(\(([-.[:alnum:]_]+)\))?')[1:2]
if empty(sect)
let sect = a:sect
endif
let b:man_sect = man#extract_sect_and_name_ref(ref)[0]
catch
echoerr 'man.vim: failed to parse: "'.a:str.'"'
let b:man_sect = ''
endtry
return [page, sect]
endfunction
function s:cmd(sect, page) abort
if !empty(a:sect)
return s:man_sect_arg.' '.a:sect.' '.a:page
endif
return a:page
endfunction
function s:find_page(sect, page) abort
let where = system('/usr/bin/man '.s:man_find_arg.' '.s:cmd(a:sect, a:page))
return (where =~# '^ */')
execute 'silent file man://'.fnameescape(ref)
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
""

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: 2015 Apr 02
" Last Change: 2015 Jul 13
"
" OPTIONS:
"
@ -318,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
@ -646,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
@ -981,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
@ -1379,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
@ -1659,7 +1659,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
" function declaration line
if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*('
let function_lines = join(reverse(lines), " ")
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)')
@ -1700,10 +1700,12 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
" try to find the next non-comment or string ";" char
let start_col = match(line, '^\s*'.object.'\C\s*=\zs&\?\s\+\(clone\)\?\s*'.variable_name_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
@ -1711,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
@ -1719,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
@ -1739,13 +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
@ -1753,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
@ -1761,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
@ -1864,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 = '\'
@ -1876,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\|interface\|trait\)\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
@ -2048,9 +2062,18 @@ 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 class_closing_bracket_line = line('.')
@ -2108,8 +2131,11 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
\ })
let all_extends = used_traits
if extends_class != ''
call add(all_extends, extends_class)
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
@ -2119,11 +2145,16 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
endif
let classlocation = phpcomplete#GetClassLocation(class, namespace)
if classlocation == "VIMPHP_BUILTINOBJECT"
let result += [phpcomplete#GenerateBuiltinClassStub(g:php_builtin_classes[tolower(class)])]
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)
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
@ -2144,19 +2175,26 @@ function! phpcomplete#GetClassContents(classlocation, class_name) " {{{
endfunction
" }}}
function! phpcomplete#GenerateBuiltinClassStub(class_info) " {{{
let re = 'class '.a:class_info['name']." {"
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
@ -2169,6 +2207,8 @@ function! phpcomplete#GenerateBuiltinClassStub(class_info) " {{{
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
@ -2178,9 +2218,10 @@ function! phpcomplete#GenerateBuiltinClassStub(class_info) " {{{
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': {},
@ -2204,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
@ -2227,6 +2271,7 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{
endif
let l -= 1
endwhile
" no docblock comment start found
if comment_start == -1
return ''
@ -2388,7 +2433,15 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
break
endif
let block_end_pos = searchpairpos('{', '', '}\|\%$', 'W', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
silent! exec block_start_pos[0].','.block_end_pos[0].'d'
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
@ -2407,8 +2460,8 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
while i < file_length
let line = file_lines[i]
if line =~? '^\s*namespace\s*'.namespace_name_pattern
let current_namespace = matchstr(line, '\c^\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
@ -2571,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

@ -31,35 +31,61 @@ function! s:try_cmd(cmd, ...)
endfunction
let s:cache_enabled = 1
let s:err = ''
function! provider#clipboard#Error() abort
return s:err
endfunction
function! provider#clipboard#Executable() abort
if executable('pbcopy')
let s:copy['+'] = 'pbcopy'
let s:paste['+'] = 'pbpaste'
let s:copy['*'] = s:copy['+']
let s:paste['*'] = s:paste['+']
let s:cache_enabled = 0
return 'pbcopy'
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'
return 'xsel'
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'
else
echom 'clipboard: No clipboard tool available. See :help nvim-clipboard'
return 'xclip'
elseif executable('lemonade')
let s:copy['+'] = 'lemonade copy'
let s:paste['+'] = 'lemonade paste'
let s:copy['*'] = 'lemonade copy'
let s:paste['*'] = 'lemonade paste'
return 'lemonade'
elseif executable('doitclient')
let s:copy['+'] = 'doitclient wclip'
let s:paste['+'] = 'doitclient wclip -r'
let s:copy['*'] = s:copy['+']
let s:paste['*'] = s:paste['+']
return 'doitclient'
endif
let s:err = 'clipboard: No clipboard tool available. See :help clipboard'
return ''
endfunction
if empty(provider#clipboard#Executable())
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)
@ -84,6 +110,7 @@ function! s:clipboard.set(lines, regtype, reg)
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

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

View File

@ -5,11 +5,24 @@ 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 args = ['-c', 'import sys; sys.path.remove(""); import neovim; neovim.start_host()']
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)
@ -18,14 +31,16 @@ function! provider#pythonx#Require(host) abort
endfor
try
let channel_id = rpcstart((ver == '2' ?
\ provider#python#Prog() : provider#python3#Prog()), args)
if rpcrequest(channel_id, 'poll') == 'ok'
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')
@ -70,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
@ -83,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(""); ' .
@ -93,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 . '.']
@ -103,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. '
\ . '(' . v:shell_error . ', output: ' . prog_ver . ')'
\ . ' 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".']
endif
return [1, '']

View File

@ -1,13 +1,30 @@
" The Ruby provider helper
if exists('s:loaded_ruby_provider')
if exists('g:loaded_ruby_provider')
finish
endif
let g:loaded_ruby_provider = 1
let s: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
" Collect registered Ruby plugins into args
let args = []
let args = [provider#ruby#Prog()]
let ruby_plugins = remote#host#PluginsForHost(a:host.name)
for plugin in ruby_plugins
@ -15,20 +32,47 @@ function! provider#ruby#Require(host) abort
endfor
try
let channel_id = rpcstart(provider#ruby#Prog(), args)
if rpcrequest(channel_id, 'poll') == 'ok'
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')
throw remote#host#LoadErrorForHost(a:host.orig_name, '$NVIM_RUBY_LOG_FILE')
endfunction
function! provider#ruby#Prog() abort
return 'neovim-ruby-host'
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

@ -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

@ -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)
@ -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,7 +1,5 @@
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 = {}
@ -120,9 +118,59 @@ function! remote#host#RegisterPlugin(host, path, specs) abort
endfunction
" 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
if filereadable(s:remote_plugins_manifest)
exe 'source '.s:remote_plugins_manifest
let manifest = s:GetManifest()
if filereadable(manifest)
execute 'source' fnameescape(manifest)
endif
endfunction
@ -130,7 +178,9 @@ endfunction
function! remote#host#LoadRemotePluginsEvent(event, pattern) abort
autocmd! nvim-rplugin
call remote#host#LoadRemotePlugins()
execute 'silent doautocmd' a:event a:pattern
if exists('#'.a:event.'#'.a:pattern) " Avoid 'No matching autocommands'.
execute 'silent doautocmd <nomodeline>' a:event a:pattern
endif
endfunction
@ -140,6 +190,8 @@ function! s:RegistrationCommands(host) abort
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
@ -193,9 +245,9 @@ function! remote#host#UpdateRemotePlugins() abort
endtry
endif
endfor
call writefile(commands, s:remote_plugins_manifest)
echomsg printf('remote/host: generated the manifest file in "%s"',
\ s:remote_plugins_manifest)
call writefile(commands, s:GetManifest())
echomsg printf('remote/host: generated rplugin manifest: %s',
\ s:GetManifest())
endfunction
@ -209,12 +261,9 @@ endfunction
function! remote#host#LoadErrorForHost(host, log) abort
return 'Failed to load '. a:host . ' host. '.
\ 'You can try to see what happened '.
\ 'by starting Neovim with the environment variable '.
\ a:log . ' 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.'
\ '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

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")
" Now it should show up in the list.
let [dirlist, dirchoices] = spellfile#GetDirChoices()
endif
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'
@ -90,7 +89,7 @@ function! spellfile#LoadFile(lang)
endif
if newbufnr == winbufnr(0)
" We are back the old buffer, remove any (half-finished) download.
g/^/d
g/^/d_
else
let newbufnr = winbufnr(0)
endif
@ -99,21 +98,25 @@ function! spellfile#LoadFile(lang)
echo 'Could not find it, trying ' . fname . '...'
call spellfile#Nread(fname)
if getline(2) !~ 'VIMspell'
echo 'Sorry, downloading failed'
echo 'Download failed'
exe newbufnr . "bwipe!"
return
endif
endif
" Delete the empty first line and mark the file unmodified.
1d
1d_
set nomod
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])
@ -123,21 +126,17 @@ function! spellfile#LoadFile(lang)
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
" 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
1d_
exe "write " . dirname . '/' . fname
set nomod
else
echo 'Sorry, downloading failed'
echo 'Download failed'
" Go back to our own buffer/window, Nread() may have taken us to
" another window.
if newbufnr != winbufnr(0)
@ -151,7 +150,6 @@ function! spellfile#LoadFile(lang)
endif
endif
endif
endif
" Wipe out the buffer we used.
exe newbufnr . "bwipe"

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

@ -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

View File

@ -1,31 +1,32 @@
*api.txt* For Nvim. {Nvim}
*api.txt* {Nvim}
NVIM REFERENCE MANUAL by Thiago de Arruda
The C API of Nvim *nvim-api*
1. Introduction |nvim-api-intro|
2. API Types |nvim-api-types|
3. API metadata |nvim-api-metadata|
4. Buffer highlighting |nvim-api-highlights|
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 *nvim-api-intro*
1. Introduction *api-intro*
Nvim defines a C API as the primary way for external code to interact with
the NVim core. In the present version of Nvim the API is primarily used by
external processes to interact with Nvim using the msgpack-rpc protocol, see
|msgpack-rpc|. The API will also be used from vimscript to access new Nvim core
features, but this is not implemented yet. 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.
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 *nvim-api-types*
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.
around C99 standard types, and some are Nvim-defined data structures.
Boolean -> bool
Integer (signed 64-bit integer) -> int64_t
@ -46,19 +47,20 @@ Window -> enum value kObjectTypeWindow
Tabpage -> enum value kObjectTypeTabpage
==============================================================================
3. API metadata *nvim-api-metadata*
3. API metadata *api-metadata*
Nvim exposes metadata about the API as a Dictionary with the following keys:
functions calling signature of the API functions
types The custom handle types defined by Nvim
error_types The possible kinds of errors an API function can exit with.
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 over
msgpack-api, see |msgpack-rpc-api|.
This metadata is mostly useful for external programs accessing the API via
RPC, see |rpc-api|.
==============================================================================
4. Buffer highlighting *nvim-api-highlights*
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
@ -72,10 +74,10 @@ 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 |buffer_add_highlight| function, see the
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 |buffer_add_highlight| as an asynchronous notification, after first
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:
>
@ -90,10 +92,19 @@ functions in the python client:
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). |buffer_clear_highlight| can be used
to clear highligts from a specific source, in a specific line range or the
entire buffer by passing in the line range 0, -1 (the later is the default
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: 2015 Mar 21
*autocmd.txt* For Vim version 7.4. Last change: 2016 Mar 26
VIM REFERENCE MANUAL by Bram Moolenaar
@ -256,7 +256,6 @@ 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
@ -557,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 ']
@ -618,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|
@ -770,13 +763,15 @@ OptionSet After setting an option. The pattern is
it's global or local scoped and |<amatch>|
indicates what option has been set.
Note: It's a bad idea, to reset an option
during this autocommand, since this will
probably break plugins. You can always use
|:noa| to prevent triggering this autocommand.
Could be used, to check for existence of the
'backupdir' and 'undodir' options and create
directories, if they don't exist yet.
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|,
@ -910,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|
@ -946,7 +940,15 @@ VimEnter After doing all the startup stuff, including
loading vimrc files, executing the "-c cmd"
arguments, creating all windows and loading
the buffers in them.
*VimLeave*
Just before this event is triggered the
|v:vim_did_enter| variable is set, so that you
can do: >
if v:vim_did_enter
call s:init()
else
au VimEnter * call s:init()
endif
< *VimLeave*
VimLeave Before exiting Vim, just after writing the
.shada file. Executed only once, like
VimLeavePre.
@ -1100,7 +1102,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: >
@ -1159,6 +1161,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: 2015 Jun 25
*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
@ -396,6 +398,11 @@ CTRL-X Subtract [count] from the number or alphabetic
{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
@ -423,7 +430,7 @@ This depends on the 'nrformats' option:
index.
For decimals a leading negative sign is considered for incrementing or
decrementing, for binary and octal and hex values, it won't be considered. To
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),
@ -622,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
@ -833,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
@ -936,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}.
@ -1102,7 +1139,7 @@ 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 "-
@ -1215,7 +1252,7 @@ register.
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|.
9. Black hole register "_ *quote_*
When writing to this register, nothing happens. This can be used to delete
@ -1646,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][b] [/{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.
@ -1654,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.
@ -1669,10 +1714,10 @@ found here: |sort()|, |uniq()|.
With [b] sorting is done on the first binary 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 [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*
@ -565,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
@ -714,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.
@ -755,6 +761,7 @@ it, no matter how many backslashes.
# alternate.file
\# #
\\# \#
Also see |`=|.
*:<cword>* *:<cWORD>* *:<cfile>* *<cfile>*
*:<sfile>* *<sfile>* *:<afile>* *<afile>*
@ -777,12 +784,12 @@ Note: these are typed literally, they are not special keys!
(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.
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
@ -897,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.
@ -910,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
@ -936,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

@ -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,12 +1,12 @@
*diff.txt* For Vim version 7.4. Last change: 2015 Feb 03
*diff.txt* For Vim version 7.4. Last change: 2016 Aug 24
VIM REFERENCE MANUAL by Bram Moolenaar
*diff* *diff-mode*
This file describes |diff-mode|, which shows the differences between two,
three, or four versions of the same file.
This file describes the |+diff| feature: Showing differences between two to
eight versions of the same file.
The basics are explained in section |08.7| of the user manual.
@ -109,7 +109,7 @@ To make these commands use a vertical split, prepend |:vertical|. Examples: >
If you always prefer a vertical split include "vertical" in 'diffopt'.
*E96*
There can be up to four buffers with 'diff' set.
There can be up to eight buffers with 'diff' set.
Since the option values are remembered with the buffer, you can edit another
file for a moment and come back to the same file and be in diff mode again.
@ -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

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
@ -266,9 +267,6 @@ 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".
@ -357,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.
@ -367,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',
@ -582,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.
@ -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
@ -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.
@ -1203,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
@ -1233,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
@ -1292,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
@ -1304,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

@ -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
@ -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*

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

@ -395,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
@ -825,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}

View File

@ -1,437 +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
<
==============================================================================
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 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".)
*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.
==============================================================================
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.
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: 2015 Apr 15
*help.txt* For Vim version 7.4. Last change: 2016 Mar 31
VIM - main help file
k
@ -9,14 +9,14 @@ 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
@ -24,6 +24,8 @@ Get specific help: It is possible to go directly to whatever you want help
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|
@ -152,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

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
@ -188,6 +188,9 @@ command: >
*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
@ -196,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
@ -249,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
@ -306,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 Feb 12
*index.txt* For Vim version 7.4. Last change: 2016 Mar 12
VIM REFERENCE MANUAL by Bram Moolenaar
@ -1378,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
@ -1515,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 Jun 20
*insert.txt* For Vim version 7.4. Last change: 2016 Jan 31
VIM REFERENCE MANUAL by Bram Moolenaar
@ -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'

View File

@ -450,7 +450,7 @@ notation meaning equivalent decimal value(s) ~
<k0> - <k9> keypad 0 to 9 *keypad-0* *keypad-9*
<S-...> shift-key *shift* *<S-*
<C-...> control-key *control* *ctrl* *<C-*
<M-...> alt-key or meta-key *meta* *alt* *<M-*
<M-...> alt-key or meta-key *META* *meta* *alt* *<M-*
<A-...> same as <M-...> *<A-*
<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 Dec 08
*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

@ -70,29 +70,24 @@ See |mbyte-locale| for details.
ENCODING
If your locale works properly, Vim will try to set the 'encoding' option
accordingly. If this doesn't work you can overrule its value: >
Nvim always uses UTF-8 internally. Thus 'encoding' option is always set
to "utf-8" and cannot be changed.
:set encoding=utf-8
All the text that is used inside Vim will be in UTF-8. Not only the text in
the buffers, but also in registers, variables, etc.
See |encoding-values| for a list of acceptable values.
The result is that all the text that is used inside Vim will be in this
encoding. Not only the text in the buffers, but also in registers, variables,
etc. 'encoding' is read-only after startup because changing it would make the
existing text invalid.
You can edit files in another encoding than what 'encoding' is set to. Vim
You can edit files in different encodings than UTF-8. Nvim
will convert the file when you read it and convert it back when you write it.
See 'fileencoding', 'fileencodings' and |++enc|.
DISPLAY AND FONTS
If you are working in a terminal (emulator) you must make sure it accepts the
same encoding as which Vim is working with.
If you are working in a terminal (emulator) you must make sure it accepts
UTF-8, the encoding which Vim is working with. Otherwise only ASCII can
be displayed and edited correctly.
For the GUI you must select fonts that work with the current 'encoding'. This
For the GUI you must select fonts that work with UTF-8. This
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.
@ -216,10 +211,9 @@ You could make a small shell script for this.
==============================================================================
3. Encoding *mbyte-encoding*
Vim uses the 'encoding' option to specify how characters are identified and
encoded when they are used inside Vim. This applies to all the places where
text is used, including buffers (files loaded into memory), registers and
variables.
In Nvim UTF-8 is always used internally to encode characters.
This applies to all the places where text is used, including buffers (files
loaded into memory), registers and variables.
*charset* *codeset*
Charset is another name for encoding. There are subtle differences, but these
@ -240,7 +234,7 @@ matter what language is used. Thus you might see the right text even when the
encoding was set wrong.
*encoding-names*
Vim can use many different character encodings. There are three major groups:
Vim can edit files in different character encodings. There are three major groups:
1 8bit Single-byte encodings, 256 different characters. Mostly used
in USA and Europe. Example: ISO-8859-1 (Latin1). All
@ -255,11 +249,10 @@ u Unicode Universal encoding, can replace all others. ISO 10646.
Millions of different characters. Example: UTF-8. The
relation between bytes and screen cells is complex.
Other encodings cannot be used by Vim internally. But files in other
Only UTF-8 is used by Vim internally. But files in other
encodings can be edited by using conversion, see 'fileencoding'.
Note that all encodings must use ASCII for the characters up to 128.
Supported 'encoding' values are: *encoding-values*
Recognized 'fileencoding' values include: *encoding-values*
1 latin1 8-bit characters (ISO 8859-1, also used for cp1252)
1 iso-8859-n ISO_8859 variant (n = 2 to 15)
1 koi8-r Russian
@ -311,11 +304,11 @@ u ucs-4 32 bit UCS-4 encoded Unicode (ISO/IEC 10646-1)
u ucs-4le like ucs-4, little endian
The {name} can be any encoding name that your system supports. It is passed
to iconv() to convert between the encoding of the file and the current locale.
to iconv() to convert between UTF-8 and the encoding of the file.
For MS-Windows "cp{number}" means using codepage {number}.
Examples: >
:set encoding=8bit-cp1252
:set encoding=2byte-cp932
:set fileencoding=8bit-cp1252
:set fileencoding=2byte-cp932
The MS-Windows codepage 1252 is very similar to latin1. For practical reasons
the same encoding is used and it's called latin1. 'isprint' can be used to
@ -337,8 +330,7 @@ u ucs-2be same as ucs-2 (big endian)
u ucs-4be same as ucs-4 (big endian)
u utf-32 same as ucs-4
u utf-32le same as ucs-4le
default stands for the default value of 'encoding', depends on the
environment
default the encoding of the current locale.
For the UCS codes the byte order matters. This is tricky, use UTF-8 whenever
you can. The default is to use big-endian (most significant byte comes
@ -363,13 +355,12 @@ or when conversion is not possible:
CONVERSION *charset-conversion*
Vim will automatically convert from one to another encoding in several places:
- When reading a file and 'fileencoding' is different from 'encoding'
- When writing a file and 'fileencoding' is different from 'encoding'
- When reading a file and 'fileencoding' is different from "utf-8"
- When writing a file and 'fileencoding' is different from "utf-8"
- When displaying messages and the encoding used for LC_MESSAGES differs from
'encoding' (requires a gettext version that supports this).
"utf-8" (requires a gettext version that supports this).
- When reading a Vim script where |:scriptencoding| is different from
'encoding'.
- When reading or writing a |shada| file.
"utf-8".
Most of these require the |+iconv| feature. Conversion for reading and
writing files may also be specified with the 'charconvert' option.
@ -408,11 +399,11 @@ Useful utilities for converting the charset:
*mbyte-conversion*
When reading and writing files in an encoding different from 'encoding',
When reading and writing files in an encoding different from "utf-8",
conversion needs to be done. These conversions are supported:
- All conversions between Latin-1 (ISO-8859-1), UTF-8, UCS-2 and UCS-4 are
handled internally.
- For MS-Windows, when 'encoding' is a Unicode encoding, conversion from and
- For MS-Windows, conversion from and
to any codepage should work.
- Conversion specified with 'charconvert'
- Conversion with the iconv library, if it is available.
@ -468,8 +459,6 @@ and you will have a working UTF-8 terminal emulator. Try both >
with the demo text that comes with ucs-fonts.tar.gz in order to see
whether there are any problems with UTF-8 in your xterm.
For Vim you may need to set 'encoding' to "utf-8".
==============================================================================
5. Fonts on X11 *mbyte-fonts-X11*
@ -864,11 +853,11 @@ between two keyboard settings.
The value of the 'keymap' option specifies a keymap file to use. The name of
this file is one of these two:
keymap/{keymap}_{encoding}.vim
keymap/{keymap}_utf-8.vim
keymap/{keymap}.vim
Here {keymap} is the value of the 'keymap' option and {encoding} of the
'encoding' option. The file name with the {encoding} included is tried first.
Here {keymap} is the value of the 'keymap' option.
The file name with "utf-8" included is tried first.
'runtimepath' is used to find these files. To see an overview of all
available keymap files, use this: >
@ -950,7 +939,7 @@ this is unusual. But you can use various ways to specify the character: >
A <char-0141> octal value
x <Space> special key name
The characters are assumed to be encoded for the current value of 'encoding'.
The characters are assumed to be encoded in UTF-8.
It's possible to use ":scriptencoding" when all characters are given
literally. That doesn't work when using the <char-> construct, because the
conversion is done on the keymap file, not on the resulting character.
@ -1170,21 +1159,13 @@ Useful commands:
message is truncated, use ":messages").
- "g8" shows the bytes used in a UTF-8 character, also the composing
characters, as hex numbers.
- ":set encoding=utf-8 fileencodings=" forces using UTF-8 for all files. The
default is to use the current locale for 'encoding' and set 'fileencodings'
to automatically detect the encoding of a file.
- ":set fileencodings=" forces using UTF-8 for all files. The
default is to automatically detect the encoding of a file.
STARTING VIM
If your current locale is in an utf-8 encoding, Vim will automatically start
in utf-8 mode.
If you are using another locale: >
set encoding=utf-8
You might also want to select the font used for the menus. Unfortunately this
You might want to select the font used for the menus. Unfortunately this
doesn't always work. See the system specific remarks below, and 'langmenu'.
@ -1245,10 +1226,9 @@ not everybody is able to type a composing character.
These options are relevant for editing multi-byte files. Check the help in
options.txt for detailed information.
'encoding' Encoding used for the keyboard and display. It is also the
default encoding for files.
'encoding' Internal text encoding, always "utf-8".
'fileencoding' Encoding of a file. When it's different from 'encoding'
'fileencoding' Encoding of a file. When it's different from "utf-8"
conversion is done when reading or writing the file.
'fileencodings' List of possible encodings of a file. When opening a file

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
@ -656,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 mapping |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 Nvim API function
- Listen for Nvim events
- Call any API function
- Listen for 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 mapping *msgpack-rpc-api*
2. API mapping *rpc-api*
The Nvim C API, see |nvim-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.
To get a human-readable list of API functions: >
:new|put =map(api_info().functions, 'v:val.name')
<
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 *msgpack-rpc-connecting*
3. Connecting *rpc-connecting*
There are four ways to open msgpack-rpc streams to Nvim:
There are several ways to open a msgpack-rpc channel to an Nvim instance:
1. Through Nvim's stdin/stdout when it's started with the `--embed` option.
This is how other programs can embed Nvim.
1. Through stdin/stdout when `nvim` is started with `--embed`. This is how
applications can embed Nvim.
2. Through the stdin/stdout of a program spawned by the |rpcstart()| function.
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.
*$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
<
See also |v:servername|.
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 in a shell before starting Nvim:
>
|$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,58 +114,96 @@ 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.
Existing API clients are listed here:
https://github.com/neovim/neovim/wiki/Related-projects#api-clients
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
|msgpack-rpc-connecting| for details on how clients can connect to Nvim.
|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.
- 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).
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:
- 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
==============================================================================
5. Types *msgpack-rpc-types*
API metadata object ~
Nvim's C API uses custom types for all functions, se |nvim-api-types|.
For the purpose of mapping to msgpack, he types can be split into two groups:
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 *rpc-types*
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 type mapping:
Basic types ~
Nil -> msgpack nil
Boolean -> msgpack boolean
@ -179,7 +213,7 @@ 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
@ -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 perform 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,95 +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
<
Note: If you previously installed the package, get the latest version by
appending the `--upgrade` flag to the commands above.
==============================================================================
*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:

View File

@ -1,34 +1,31 @@
*nvim_terminal_emulator.txt* For Nvim. {Nvim}
*terminal_emulator.txt* {Nvim}
NVIM REFERENCE MANUAL by Thiago de Arruda
Nvim integrated terminal emulator *nvim-terminal-emulator*
Embedded terminal emulator *terminal-emulator*
1. Introduction |nvim-terminal-emulator-introduction|
2. Spawning |nvim-terminal-emulator-spawning|
3. Input |nvim-terminal-emulator-input|
4. Configuration |nvim-terminal-emulator-configuration|
1. Introduction |terminal-emulator-intro|
2. Spawning |terminal-emulator-spawning|
3. Input |terminal-emulator-input|
4. Configuration |terminal-emulator-configuration|
5. Status Variables |terminal-emulator-status|
==============================================================================
1. Introduction *nvim-terminal-emulator-introduction*
1. Introduction *terminal-emulator-intro*
One feature that distinguishes Nvim from Vim is that it implements a mostly
complete VT220/xterm-like terminal emulator. The terminal is presented to the
user as a special buffer type, one that is asynchronously updated to mirror
the virtual terminal display as data is received from the program connected
to it. For most purposes, terminal buffers behave a lot like normal buffers
with 'nomodifiable' set.
Nvim offers a mostly complete VT220/xterm terminal emulator. The terminal is
presented as a special buffer type, asynchronously updated to mirror the
virtual terminal display as data is received from the program connected to it.
For most purposes, terminal buffers behave a lot like normal buffers with
'nomodifiable' set.
The implementation is powered by libvterm[1], a powerful abstract terminal
emulation library.
[1]: http://www.leonerd.org.uk/code/libvterm/
The implementation is powered by libvterm, a powerful abstract terminal
emulation library. http://www.leonerd.org.uk/code/libvterm/
==============================================================================
2. Spawning *nvim-terminal-emulator-spawning*
2. Spawning *terminal-emulator-spawning*
There are 3 ways to create a terminal buffer:
@ -37,16 +34,22 @@ There are 3 ways to create a terminal buffer:
- By editing a file with a name matching `term://(.{-}//(\d+:)?)?\zs.*`.
For example:
>
:e term://bash
:vsp term://top
:edit term://bash
:vsplit term://top
<
Note: The "term://" pattern is handled by a BufReadCmd handler, so the
|autocmd-nested| modifier is required to use it in an autocmd. >
autocmd VimEnter * nested split term://sh
< This is only mentioned for reference; you should use the |:terminal|
command instead.
When the terminal spawns the program, the buffer will start to mirror the
terminal display and change its name to `term://$CWD//$PID:$COMMAND`.
Note that |:mksession| will "save" the terminal buffers by restarting all
programs when the session is restored.
==============================================================================
3. Input *nvim-terminal-emulator-input*
3. Input *terminal-emulator-input*
Sending input is possible by entering terminal mode, which is achieved by
pressing any key that would enter insert mode in a normal buffer (|i| or |a|
@ -90,7 +93,7 @@ Mouse input is also fully supported, and has the following behavior:
the terminal wont lose focus and the hovered window will be scrolled.
==============================================================================
4. Configuration *nvim-terminal-emulator-configuration*
4. Configuration *terminal-emulator-configuration*
Terminal buffers can be customized through the following global/buffer-local
variables (set via the |TermOpen| autocmd):
@ -110,5 +113,26 @@ There is also a corresponding |TermClose| event.
The terminal cursor can be highlighted via |hl-TermCursor| and
|hl-TermCursorNC|.
==============================================================================
5. Status Variables *terminal-emulator-status*
Terminal buffers maintain some information about the terminal in buffer-local
variables:
- *b:term_title* The settable title of the terminal, typically displayed in
the window title or tab title of a graphical terminal emulator. Programs
running in the terminal can set this title via an escape sequence.
- *b:terminal_job_id* The nvim job ID of the job running in the terminal. See
|job-control| for more information.
- *b:terminal_job_pid* The PID of the top-level process running in the
terminal.
These variables will have a value by the time the TermOpen autocmd runs, and
will continue to have a value for the lifetime of the terminal buffer, making
them suitable for use in 'statusline'. For example, to show the terminal title
as the status line:
>
:autocmd TermOpen * setlocal statusline=%{b:term_title}
<
==============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 7.4. Last change: 2015 Oct 15
*options.txt* For Vim version 7.4. Last change: 2016 Jul 12
VIM REFERENCE MANUAL by Bram Moolenaar
@ -49,9 +49,11 @@ achieve special effects. These options come in three forms:
:se[t] {option}&vi Reset option to its Vi default value.
:se[t] {option}&vim Reset option to its Vim default value.
:se[t] all& Set all options, except terminal options, to their
default value. The values of 'lines' and 'columns'
are not changed.
:se[t] all& Set all options to their default value. The values of
these options are not changed:
'columns'
'lines'
Warning: This may have a lot of side effects.
*:set-args* *E487* *E521*
:se[t] {option}={value} or
@ -494,6 +496,7 @@ For example, to use a modeline only for Vim 7.0:
To use a modeline for Vim after version 7.2:
/* vim>702: set cole=2: */ ~
There can be no blanks between "vim" and the ":".
The modeline is ignored if {vers} does not fit in an integer. {Nvim}
The number of lines that are checked can be set with the 'modelines' option.
@ -611,7 +614,6 @@ A jump table for the options with a short description can be found at |Q_op|.
global
{only available when compiled with the |+multi_byte|
feature}
Only effective when 'encoding' is "utf-8" or another Unicode encoding.
Tells Vim what to do with characters with East Asian Width Class
Ambiguous (such as Euro, Registered Sign, Copyright Sign, Greek
letters, Cyrillic letters).
@ -664,7 +666,6 @@ A jump table for the options with a short description can be found at |Q_op|.
- Set the 'keymap' option to "arabic"; in Insert mode CTRL-^ toggles
between typing English and Arabic key mapping.
- Set the 'delcombine' option
Note that 'encoding' must be "utf-8" for working with Arabic text.
Resetting this option will:
- Reset the 'rightleft' option.
@ -704,7 +705,8 @@ A jump table for the options with a short description can be found at |Q_op|.
line.
When 'smartindent' or 'cindent' is on the indent is changed in
a different way.
The 'autoindent' option is reset when the 'paste' option is set.
The 'autoindent' option is reset when the 'paste' option is set and
restored when 'paste' is reset.
{small difference from Vi: After the indent is deleted when typing
<Esc> or <CR>, the cursor position when moving up or down is after the
deleted indent; Vi puts the cursor somewhere in the deleted indent}.
@ -1073,8 +1075,7 @@ A jump table for the options with a short description can be found at |Q_op|.
{not available when compiled without the |+linebreak|
feature}
This option lets you choose which characters might cause a line
break if 'linebreak' is on. Only works for ASCII and also for 8-bit
characters when 'encoding' is an 8-bit encoding.
break if 'linebreak' is on. Only works for ASCII characters.
*'breakindent'* *'bri'*
'breakindent' 'bri' boolean (default off)
@ -1154,22 +1155,14 @@ A jump table for the options with a short description can be found at |Q_op|.
*'buftype'* *'bt'* *E382*
'buftype' 'bt' string (default: "")
local to buffer
{not available when compiled without the |+quickfix|
feature}
The value of this option specifies the type of a buffer:
<empty> normal buffer
nofile buffer which is not related to a file and will not be
written
nowrite buffer which will not be written
acwrite buffer which will always be written with BufWriteCmd
autocommands.
quickfix quickfix buffer, contains list of errors |:cwindow|
or list of locations |:lwindow|
help help buffer (you are not supposed to set this
manually)
terminal terminal buffer, this is set automatically when a
terminal is created. See |nvim-terminal-emulator| for
more information.
acwrite buffer will always be written with |BufWriteCmd|s
help help buffer (do not set this manually)
nofile buffer is not related to a file, will not be written
nowrite buffer will not be written
quickfix list of errors |:cwindow| or locations |:lwindow|
terminal |terminal-emulator| buffer
This option is used together with 'bufhidden' and 'swapfile' to
specify special kinds of buffers. See |special-buffers|.
@ -1210,11 +1203,9 @@ A jump table for the options with a short description can be found at |Q_op|.
Specifies details about changing the case of letters. It may contain
these words, separated by a comma:
internal Use internal case mapping functions, the current
locale does not change the case mapping. This only
matters when 'encoding' is a Unicode encoding,
"latin1" or "iso-8859-15". When "internal" is
omitted, the towupper() and towlower() system library
functions are used when available.
locale does not change the case mapping. When
"internal" is omitted, the towupper() and towlower()
system library functions are used when available.
keepascii For the ASCII characters (0x00 to 0x7f) use the US
case mapping, the current locale is not effective.
This probably only matters for Turkish.
@ -1267,13 +1258,12 @@ A jump table for the options with a short description can be found at |Q_op|.
file to convert from. You will have to save the text in a file first.
The expression must return zero or an empty string for success,
non-zero for failure.
The possible encoding names encountered are in 'encoding'.
See |encoding-names| for possible encoding names.
Additionally, names given in 'fileencodings' and 'fileencoding' are
used.
Conversion between "latin1", "unicode", "ucs-2", "ucs-4" and "utf-8"
is done internally by Vim, 'charconvert' is not used for this.
'charconvert' is also used to convert the shada file, if 'encoding' is
not "utf-8". Also used for Unicode conversion.
Also used for Unicode conversion.
Example: >
set charconvert=CharConvert()
fun CharConvert()
@ -1288,8 +1278,6 @@ A jump table for the options with a short description can be found at |Q_op|.
v:fname_in name of the input file
v:fname_out name of the output file
Note that v:fname_in and v:fname_out will never be the same.
Note that v:charconvert_from and v:charconvert_to may be different
from 'encoding'. Vim internally uses UTF-8 instead of UCS-2 or UCS-4.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
@ -1349,7 +1337,7 @@ A jump table for the options with a short description can be found at |Q_op|.
used regardless of whether "unnamed" is in 'clipboard'
or not. The clipboard register can always be
explicitly accessed using the "* notation. Also see
|gui-clipboard|.
|clipboard|.
*clipboard-unnamedplus*
unnamedplus A variant of the "unnamed" flag which uses the
@ -1359,7 +1347,7 @@ A jump table for the options with a short description can be found at |Q_op|.
register. When "unnamed" is also included to the
option, yank and delete operations (but not put)
will additionally copy the text into register
'*'. See |nvim-clipboard|.
'*'. See |clipboard|.
*clipboard-autoselect*
autoselect Works like the 'a' flag in 'guioptions': If present,
@ -1446,9 +1434,6 @@ A jump table for the options with a short description can be found at |Q_op|.
comment text. Currently only used to add markers for folding, see
|fold-marker|.
*'compatible'* *'cp'* *'nocompatible'* *'nocp'*
'compatible' 'cp' Removed. |vim-differences| {Nvim}
*'complete'* *'cpt'* *E535*
'complete' 'cpt' string (default: ".,w,b,u,t")
local to buffer
@ -1598,7 +1583,7 @@ A jump table for the options with a short description can be found at |Q_op|.
line, the remaining space is filled in the normal manner.
See 'preserveindent'.
*'cpoptions'* *'cpo'*
*'cpoptions'* *'cpo'* *cpo*
'cpoptions' 'cpo' string (Vim default: "aABceFs",
Vi default: all flags)
global
@ -1845,9 +1830,6 @@ A jump table for the options with a short description can be found at |Q_op|.
the cursor would skip over it and jump to the
following occurrence.
*'cryptmethod'* *'cm'*
'cryptmethod' Removed. |vim-differences| {Nvim}
*'cscopepathcomp'* *'cspc'*
'cscopepathcomp' 'cspc' number (default 0)
global
@ -2113,11 +2095,17 @@ A jump table for the options with a short description can be found at |Q_op|.
Change the way text is displayed. This is comma separated list of
flags:
lastline When included, as much as possible of the last line
in a window will be displayed. When not included, a
last line that doesn't fit is replaced with "@" lines.
in a window will be displayed. "@@@" is put in the
last columns of the last screen line to indicate the
rest of the line is not displayed.
truncate Like "lastline", but "@@@" is displayed in the first
column of the last screen line. Overrules "lastline".
uhex Show unprintable characters hexadecimal as <xx>
instead of using ^C and ~C.
When neither "lastline" or "truncate" is included, a last line that
doesn't fit is replaced with "@" lines.
*'eadirection'* *'ead'*
'eadirection' 'ead' string (default "both")
global
@ -2126,48 +2114,24 @@ A jump table for the options with a short description can be found at |Q_op|.
hor horizontally, height of windows is not affected
both width and height of windows is affected
*'ed'* *'edcompatible'* *'noed'* *'noedcompatible'*
'edcompatible' 'ed' Removed. |vim-differences| {Nvim}
*'encoding'* *'enc'* *E543*
'encoding' 'enc' string (default: "utf-8")
*'emoji'* *'emo'*
'emoji' 'emo' boolean (default: on)
global
{not in Vi}
{only available when compiled with the |+multi_byte|
feature}
Sets the character encoding used inside Vim. It applies to text in
the buffers, registers, Strings in expressions, text stored in the
shada file, etc. It sets the kind of characters which Vim can work
with. See |encoding-names| for the possible values.
When on all Unicode emoji characters are considered to be full width.
'encoding' cannot be changed after startup, because (1) it causes
non-ASCII text inside Vim to become invalid, and (2) it complicates
runtime logic. The recommended 'encoding' is "utf-8". Remote plugins
and GUIs only support utf-8. See |multibyte|.
The character encoding of files can be different from 'encoding'.
*'encoding'* *'enc'* *E543*
'encoding' 'enc' Removed. |vim-differences| {Nvim}
Nvim always uses UTF-8 internally. RPC communication
(remote plugins/GUIs) must use UTF-8 strings.
The character encoding of files can be different than UTF-8.
This is specified with 'fileencoding'. The conversion is done with
iconv() or as specified with 'charconvert'.
If you need to know whether 'encoding' is a multi-byte encoding, you
can use: >
if has("multi_byte_encoding")
<
When you set this option, it fires the |EncodingChanged| autocommand
event so that you can set up fonts if necessary.
When the option is set, the value is converted to lowercase. Thus
you can set it with uppercase values too. Underscores are translated
to '-' signs.
When the encoding is recognized, it is changed to the standard name.
For example "Latin-1" becomes "latin1", "ISO_88592" becomes
"iso-8859-2" and "utf8" becomes "utf-8".
When "unicode", "ucs-2" or "ucs-4" is used, Vim internally uses utf-8.
You don't notice this while editing, but it does matter for the
|shada-file|. And Vim expects the terminal to use utf-8 too. Thus
setting 'encoding' to one of these values instead of utf-8 only has
effect for encoding used for files when 'fileencoding' is empty.
*'endofline'* *'eol'* *'noendofline'* *'noeol'*
'endofline' 'eol' boolean (default on)
local to buffer
@ -2273,6 +2237,8 @@ A jump table for the options with a short description can be found at |Q_op|.
<Tab>. Spaces are used in indents with the '>' and '<' commands and
when 'autoindent' is on. To insert a real tab when 'expandtab' is
on, use CTRL-V<Tab>. See also |:retab| and |ins-expandtab|.
This option is reset when the 'paste' option is set and restored when
the 'paste' option is reset.
*'exrc'* *'ex'* *'noexrc'* *'noex'*
'exrc' 'ex' boolean (default off)
@ -2292,20 +2258,14 @@ A jump table for the options with a short description can be found at |Q_op|.
feature}
Sets the character encoding for the file of this buffer.
When 'fileencoding' is different from 'encoding', conversion will be
When 'fileencoding' is different from "utf-8", conversion will be
done when writing the file. For reading see below.
When 'fileencoding' is empty, the same value as 'encoding' will be
used (no conversion when reading or writing a file).
Conversion will also be done when 'encoding' and 'fileencoding' are
both a Unicode encoding and 'fileencoding' is not utf-8. That's
because internally Unicode is always stored as utf-8.
WARNING: Conversion can cause loss of information! When
'encoding' is "utf-8" or another Unicode encoding, conversion
is most likely done in a way that the reverse conversion
results in the same text. When 'encoding' is not "utf-8" some
characters may be lost!
When 'fileencoding' is empty, the file will be saved with utf-8
encoding. (no conversion when reading or writing a file).
WARNING: Conversion to a non-Unicode encoding can cause loss of
information!
See 'encoding' for the possible values. Additionally, values may be
See |encoding-names| for the possible values. Additionally, values may be
specified that can be handled by the converter, see
|mbyte-conversion|.
@ -2318,8 +2278,8 @@ A jump table for the options with a short description can be found at |Q_op|.
Prepending "8bit-" and "2byte-" has no meaning here, they are ignored.
When the option is set, the value is converted to lowercase. Thus
you can set it with uppercase values too. '_' characters are
replaced with '-'. If a name is recognized from the list for
'encoding', it is replaced by the standard name. For example
replaced with '-'. If a name is recognized from the list at
|encoding-names|, it is replaced by the standard name. For example
"ISO8859-2" becomes "iso-8859-2".
When this option is set, after starting to edit a file, the 'modified'
@ -2332,11 +2292,6 @@ A jump table for the options with a short description can be found at |Q_op|.
This option can not be changed when 'modifiable' is off.
*'fe'*
NOTE: Before version 6.0 this option specified the encoding for the
whole of Vim, this was a mistake. Now use 'encoding' instead. The
old short name was 'fe', which is no longer used.
*'fileencodings'* *'fencs'*
'fileencodings' 'fencs' string (default: "ucs-bom,utf-8,default,latin1")
global
@ -2347,12 +2302,8 @@ A jump table for the options with a short description can be found at |Q_op|.
mentioned character encoding. If an error is detected, the next one
in the list is tried. When an encoding is found that works,
'fileencoding' is set to it. If all fail, 'fileencoding' is set to
an empty string, which means the value of 'encoding' is used.
WARNING: Conversion can cause loss of information! When
'encoding' is "utf-8" (or one of the other Unicode variants)
conversion is most likely done in a way that the reverse
conversion results in the same text. When 'encoding' is not
"utf-8" some non-ASCII characters may be lost! You can use
an empty string, which means that UTF-8 is used.
WARNING: Conversion can cause loss of information! You can use
the |++bad| argument to specify what is done with characters
that can't be converted.
For an empty file or a file with only ASCII characters most encodings
@ -2378,11 +2329,11 @@ A jump table for the options with a short description can be found at |Q_op|.
because Vim cannot detect an error, thus the encoding is always
accepted.
The special value "default" can be used for the encoding from the
environment. It is useful when 'encoding' is set to "utf-8" and
your environment uses a non-latin1 encoding, such as Russian.
When 'encoding' is "utf-8" and a file contains an illegal byte
sequence it won't be recognized as UTF-8. You can use the |8g8|
command to find the illegal byte sequence.
environment. It is useful when your environment uses a non-latin1
encoding, such as Russian.
When a file contains an illegal UTF-8 byte sequence it won't be
recognized as "utf-8". You can use the |8g8| command to find the
illegal byte sequence.
WRONG VALUES: WHAT'S WRONG:
latin1,utf-8 "latin1" will always be used
utf-8,ucs-bom,latin1 BOM won't be recognized in an utf-8
@ -2453,8 +2404,8 @@ A jump table for the options with a short description can be found at |Q_op|.
file only, the option is not changed.
When 'binary' is set, the value of 'fileformats' is not used.
Note that when Vim starts up with an empty buffer this option is not
used. Set 'fileformat' in your vimrc instead.
When Vim starts up with an empty buffer the first item is used. You
can overrule this by setting 'fileformat' in your .vimrc.
For systems with a Dos-like <EOL> (<CR><NL>), when reading files that
are ":source"ed and for vimrc files, automatic <EOL> detection may be
@ -2509,17 +2460,17 @@ A jump table for the options with a short description can be found at |Q_op|.
item default Used for ~
stl:c ' ' or '^' statusline of the current window
stlnc:c ' ' or '-' statusline of the non-current windows
stlnc:c ' ' or '=' statusline of the non-current windows
vert:c '|' vertical separators |:vsplit|
fold:c '-' filling 'foldtext'
diff:c '-' deleted lines of the 'diff' option
Any one that is omitted will fall back to the default. For "stl" and
"stlnc" the space will be used when there is highlighting, '^' or '-'
"stlnc" the space will be used when there is highlighting, '^' or '='
otherwise.
Example: >
:set fillchars=stl:^,stlnc:-,vert:\|,fold:-,diff:-
:set fillchars=stl:^,stlnc:=,vert:\|,fold:-,diff:-
< This is similar to the default, except that these characters will also
be used when there is highlighting.
@ -3041,8 +2992,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Note: The size of these fonts must be exactly twice as wide as the one
specified with 'guifont' and the same height.
'guifontwide' is only used when 'encoding' is set to "utf-8" and
'guifontset' is empty or invalid.
'guifontwide' is only used when 'guifontset' is empty or invalid.
When 'guifont' is set and a valid font is found in it and
'guifontwide' is empty Vim will attempt to find a matching
double-width font and set 'guifontwide' to it.
@ -3159,9 +3109,6 @@ A jump table for the options with a short description can be found at |Q_op|.
removing it after the GUI has started has no effect.
*'guipty'* *'noguipty'*
'guipty' Removed. |vim-differences| {Nvim}
*'guitablabel'* *'gtl'*
'guitablabel' 'gtl' string (default empty)
global
@ -3322,8 +3269,6 @@ A jump table for the options with a short description can be found at |Q_op|.
- no highlighting
: use a highlight group
The default is used for occasions that are not included.
If you want to change what the display modes do, see |dos-colors|
for an example.
When using the ':' display mode, this must be followed by the name of
a highlight group. A highlight group can be used to define any type
of highlighting, including using color. See |:highlight| on how to
@ -3404,16 +3349,10 @@ A jump table for the options with a short description can be found at |Q_op|.
global
Ignore case in search patterns. Also used when searching in the tags
file.
Also see 'smartcase'.
Also see 'smartcase' and 'tagcase'.
Can be overruled by using "\c" or "\C" in the pattern, see
|/ignorecase|.
*'imactivatefunc'* *'imaf'*
'imactivatefunc' 'imaf' Removed. |vim-differences| {Nvim}
*'imactivatekey'* *'imak'*
'imactivatekey' 'imak' Removed. |vim-differences| {Nvim}
*'imcmdline'* *'imc'* *'noimcmdline'* *'noimc'*
'imcmdline' 'imc' boolean (default off)
global
@ -3470,8 +3409,17 @@ A jump table for the options with a short description can be found at |Q_op|.
The value is set to 1 when it is not -1 and setting the 'keymap'
option to a valid keymap name.
*'imstatusfunc'* *'imsf'*
'imstatusfunc' 'imsf' Removed. |vim-differences| {Nvim}
*'inccommand'* *'icm'*
'inccommand' 'icm' string (default "")
global
"nosplit": Shows the effects of a command incrementally, as you type.
"split" : Also shows partial off-screen results in a preview window.
Works for |:substitute|, |:smagic|, |:snomagic|. |hl-Substitute|
If the preview is too slow (exceeds 'redrawtime') then 'inccommand' is
automatically disabled until |Command-line-mode| is done.
*'include'* *'inc'*
'include' 'inc' string (default "^\s*#\s*include")
@ -3690,6 +3638,8 @@ A jump table for the options with a short description can be found at |Q_op|.
'*', '"' and '|' (so that CTRL-] on a command finds the help for that
command).
When the 'lisp' option is on the '-' character is always included.
This option also influences syntax highlighting, unless the syntax
uses |:syn-iskeyword|.
*'isprint'* *'isp'*
'isprint' 'isp' string (default: "@,161-255")
@ -3707,7 +3657,7 @@ A jump table for the options with a short description can be found at |Q_op|.
128 - 159 "~@" - "~_"
160 - 254 "| " - "|~"
255 "~?"
When 'encoding' is a Unicode one, illegal bytes from 128 to 255 are
Illegal bytes from 128 to 255 (invalid UTF-8) are
displayed as <xx>, with the hexadecimal value of the byte.
When 'display' contains "uhex" all unprintable characters are
displayed as <xx>.
@ -3727,9 +3677,6 @@ A jump table for the options with a short description can be found at |Q_op|.
Insert two spaces after a '.', '?' and '!' with a join command.
Otherwise only one space is inserted.
*'key'*
'key' Removed. |vim-differences| {Nvim}
*'keymap'* *'kmp'* *E544*
'keymap' 'kmp' string (default "")
local to buffer
@ -3779,7 +3726,7 @@ A jump table for the options with a short description can be found at |Q_op|.
feature}
This option allows switching your keyboard into a special language
mode. When you are typing text in Insert mode the characters are
inserted directly. When in command mode the 'langmap' option takes
inserted directly. When in Normal mode the 'langmap' option takes
care of translating these special characters to the original meaning
of the key. This means you don't have to change the keyboard mode to
be able to execute Normal mode commands.
@ -3954,6 +3901,7 @@ A jump table for the options with a short description can be found at |Q_op|.
global
Strings to use in 'list' mode and for the |:list| command. It is a
comma separated list of string settings.
*lcs-eol*
eol:c Character to show at the end of each line. When
omitted, there is no extra character at the end of the
@ -3988,8 +3936,7 @@ A jump table for the options with a short description can be found at |Q_op|.
omitted.
The characters ':' and ',' should not be used. UTF-8 characters can
be used when 'encoding' is "utf-8", otherwise only printable
characters are allowed. All characters must be single width.
be used. All characters must be single width.
Examples: >
:set lcs=tab:>-,trail:-
@ -4008,9 +3955,6 @@ A jump table for the options with a short description can be found at |Q_op|.
Note that using the "-u NONE" and "--noplugin" command line arguments
reset this option. |-u| |--noplugin|
*'macatsui'* *'nomacatsui'*
'macatsui' Removed. |vim-differences| {Nvim}
*'magic'* *'nomagic'*
'magic' boolean (default on)
global
@ -4089,7 +4033,6 @@ A jump table for the options with a short description can be found at |Q_op|.
{only available when compiled with the |+multi_byte|
feature}
The maximum number of combining characters supported for displaying.
Only used when 'encoding' is "utf-8".
The default is OK for most languages. Hebrew may require 4.
Maximum value is 6.
Even when this option is set to 2 you can still edit text with more
@ -4146,8 +4089,11 @@ A jump table for the options with a short description can be found at |Q_op|.
global
Maximum amount of memory in Kbyte to use for all buffers together.
The maximum usable value is about 2000000 (2 Gbyte). Use this to work
without a limit. On 64 bit machines higher values might work. But
hey, do you really need more than 2 Gbyte for text editing?
without a limit.
On 64 bit machines higher values might work. But hey, do you really
need more than 2 Gbyte for text editing? Keep in mind that text is
stored in the swap file, one can edit files > 2 Gbyte anyway. We do
need the memory to store undo info.
Also see 'maxmem'.
*'menuitems'* *'mis'*
@ -4230,6 +4176,7 @@ A jump table for the options with a short description can be found at |Q_op|.
written. A ":set nomodified" command also resets the original
values to the current values and the 'modified' option will be
reset.
Similarly for 'eol' and 'bomb'.
This option is not set when a change is made to the buffer as the
result of a BufNewFile, BufRead/BufReadPost, BufWritePost,
FileAppendPost or VimLeave autocommand event. See |gzip-example| for
@ -4390,9 +4337,8 @@ A jump table for the options with a short description can be found at |Q_op|.
*'mousetime'* *'mouset'*
'mousetime' 'mouset' number (default 500)
global
Only for GUI, Windows and Unix with xterm. Defines the maximum
time in msec between two mouse clicks for the second click to be
recognized as a multi click.
Defines the maximum time in msec between two mouse clicks for the
second click to be recognized as a multi click.
*'nrformats'* *'nf'*
'nrformats' 'nf' string (default "bin,hex")
@ -4491,6 +4437,12 @@ A jump table for the options with a short description can be found at |Q_op|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*'packpath'* *'pp'*
'packpath' 'pp' string (default: see 'runtimepath')
{not in Vi}
Directories used to find packages. See |packages|.
*'paragraphs'* *'para'*
'paragraphs' 'para' string (default "IPLPPPQPP TPHPLIPpLpItpplpipbp")
global
@ -4517,19 +4469,21 @@ A jump table for the options with a short description can be found at |Q_op|.
When the 'paste' option is switched on (also when it was already on):
- mapping in Insert mode and Command-line mode is disabled
- abbreviations are disabled
- 'textwidth' is set to 0
- 'wrapmargin' is set to 0
- 'autoindent' is reset
- 'smartindent' is reset
- 'softtabstop' is set to 0
- 'expandtab' is reset
- 'formatoptions' is used like it is empty
- 'revins' is reset
- 'ruler' is reset
- 'showmatch' is reset
- 'formatoptions' is used like it is empty
- 'smartindent' is reset
- 'smarttab' is reset
- 'softtabstop' is set to 0
- 'textwidth' is set to 0
- 'wrapmargin' is set to 0
These options keep their value, but their effect is disabled:
- 'lisp'
- 'indentexpr'
- 'cindent'
- 'indentexpr'
- 'lisp'
NOTE: When you start editing another file while the 'paste' option is
on, settings from the modelines or autocommands may change the
settings again, causing trouble when pasting text. You might want to
@ -4782,8 +4736,8 @@ A jump table for the options with a short description can be found at |Q_op|.
global
{only available when compiled with the |+reltime|
feature}
The time in milliseconds for redrawing the display. This applies to
searching for patterns for 'hlsearch' and |:match| highlighting.
Time in milliseconds for redrawing the display. Applies to
'hlsearch', 'inccommand' and |:match| highlighting.
When redrawing takes more than this many milliseconds no further
matches will be highlighted. This is used to avoid that Vim hangs
when using a very complicated pattern.
@ -4843,16 +4797,14 @@ A jump table for the options with a short description can be found at |Q_op|.
For the ":substitute" command the number of substitutions is used
instead of the number of lines.
*'restorescreen'* *'rs'* *'norestorescreen'* *'nors'*
'restorescreen' 'rs' Removed. |vim-differences| {Nvim}
*'revins'* *'ri'* *'norevins'* *'nori'*
'revins' 'ri' boolean (default off)
global
Inserting characters in Insert mode will work backwards. See "typing
backwards" |ins-reverse|. This option can be toggled with the CTRL-_
command in Insert mode, when 'allowrevins' is set.
NOTE: This option is reset when 'paste' is set.
This option is reset when 'paste' is set and restored when 'paste' is
reset.
*'rightleft'* *'rl'* *'norightleft'* *'norl'*
'rightleft' 'rl' boolean (default off)
@ -4901,7 +4853,8 @@ A jump table for the options with a short description can be found at |Q_op|.
separated with a dash.
For an empty line "0-1" is shown.
For an empty buffer the line number will also be zero: "0,0-1".
This option is reset when the 'paste' option is set.
This option is reset when 'paste' is set and restored when 'paste' is
reset.
If you don't want to see the ruler all the time but want to know where
you are, use "g CTRL-G" |g_CTRL-G|.
@ -4924,7 +4877,7 @@ A jump table for the options with a short description can be found at |Q_op|.
$XDG_CONFIG_DIRS[1]/nvim,
$XDG_CONFIG_DIRS[2]/nvim,
$XDG_DATA_HOME/nvim,
$XDG_DATA_HOME/nvim/site,
$XDG_DATA_DIRS[1]/nvim/site,
$XDG_DATA_DIRS[2]/nvim/site,
@ -4932,7 +4885,7 @@ A jump table for the options with a short description can be found at |Q_op|.
$XDG_DATA_DIRS[2]/nvim/site/after,
$XDG_DATA_DIRS[1]/nvim/site/after,
$XDG_DATA_HOME/nvim/after,
$XDG_DATA_HOME/nvim/site/after,
$XDG_CONFIG_DIRS[2]/nvim/after,
$XDG_CONFIG_DIRS[1]/nvim/after,
@ -4951,6 +4904,7 @@ A jump table for the options with a short description can be found at |Q_op|.
keymap/ key mapping files |mbyte-keymap|
lang/ menu translations |:menutrans|
menu.vim GUI menus |menu.vim|
pack/ packages |:packadd|
plugin/ plugin scripts |write-plugin|
print/ files for printing |postscript-print-encoding|
spell/ spell checking files |spell|
@ -4977,6 +4931,8 @@ A jump table for the options with a short description can be found at |Q_op|.
ordering. This is for preferences to overrule or add to the
distributed defaults or system-wide settings (rarely needed).
More entries are added when using |packages|.
Note that, unlike 'path', no wildcards like "**" are allowed. Normal
wildcards are allowed, but can significantly slow down searching for
runtime files. For speed, use as few items as possible and avoid
@ -5453,6 +5409,8 @@ A jump table for the options with a short description can be found at |Q_op|.
The |FilterReadPre|, |FilterReadPost| and |FilterWritePre|,
|FilterWritePost| autocommands event are not triggered when
'shelltemp' is off.
The `system()` function does not respect this option and always uses
temp files.
*'shellxescape'* *'sxe'*
'shellxescape' 'sxe' string (default: "";
@ -5551,9 +5509,6 @@ A jump table for the options with a short description can be found at |Q_op|.
shm=a Abbreviation, but no loss of information.
shm=at Abbreviation, and truncate message when necessary.
*'shortname'* *'sn'* *'noshortname'* *'nosn'*
'shortname' 'sn' Removed. |vim-differences| {Nvim}
*'showbreak'* *'sbr'* *E595*
'showbreak' 'sbr' string (default "")
global
@ -5609,7 +5564,9 @@ A jump table for the options with a short description can be found at |Q_op|.
jump is only done if the match can be seen on the screen. The time to
show the match can be set with 'matchtime'.
A Beep is given if there is no match (no matter if the match can be
seen or not). This option is reset when the 'paste' option is set.
seen or not).
This option is reset when 'paste' is set and restored when 'paste' is
reset.
When the 'm' flag is not included in 'cpoptions', typing a character
will immediately move the cursor back to where it belongs.
See the "sm" field in 'guicursor' for setting the cursor shape and
@ -5708,7 +5665,8 @@ A jump table for the options with a short description can be found at |Q_op|.
mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H.
When using the ">>" command, lines starting with '#' are not shifted
right.
NOTE: When 'paste' is set smart indenting is disabled.
This option is reset when 'paste' is set and restored when 'paste' is
reset.
*'smarttab'* *'sta'* *'nosmarttab'* *'nosta'*
'smarttab' 'sta' boolean (default on)
@ -5723,6 +5681,8 @@ A jump table for the options with a short description can be found at |Q_op|.
What gets inserted (a <Tab> or spaces) depends on the 'expandtab'
option. Also see |ins-expandtab|. When 'expandtab' is not set, the
number of spaces is minimized by using <Tab>s.
This option is reset when 'paste' is set and restored when 'paste' is
reset.
*'softtabstop'* *'sts'*
'softtabstop' 'sts' number (default 0)
@ -5735,7 +5695,8 @@ A jump table for the options with a short description can be found at |Q_op|.
commands like "x" still work on the actual characters.
When 'sts' is zero, this feature is off.
When 'sts' is negative, the value of 'shiftwidth' is used.
'softtabstop' is set to 0 when the 'paste' option is set.
'softtabstop' is set to 0 when the 'paste' option is set and restored
when 'paste' is reset.
See also |ins-expandtab|. When 'expandtab' is not set, the number of
spaces is minimized by using <Tab>s.
The 'L' flag in 'cpoptions' changes how tabs are used when 'list' is
@ -5807,7 +5768,8 @@ A jump table for the options with a short description can be found at |Q_op|.
the two-letter, lower case region name. You can use more than one
region by listing them: "en_us,en_ca" supports both US and Canadian
English, but not words specific for Australia, New Zealand or Great
Britain.
Britain. (Note: currently en_au and en_nz dictionaries are older than
en_ca, en_gb and en_us).
If the name "cjk" is included East Asian characters are excluded from
spell checking. This is useful when editing text that also has Asian
words.
@ -5817,9 +5779,6 @@ A jump table for the options with a short description can be found at |Q_op|.
(_xx is an underscore, two letters and followed by a non-letter).
This is mainly for testing purposes. You must make sure the correct
encoding is used, Vim doesn't check it.
When 'encoding' is set the word lists are reloaded. Thus it's a good
idea to set 'spelllang' after setting 'encoding' to avoid loading the
files twice.
How the related spell files are found is explained here: |spell-load|.
If the |spellfile.vim| plugin is active and you use a language name
@ -5935,7 +5894,7 @@ A jump table for the options with a short description can be found at |Q_op|.
The option consists of printf style '%' items interspersed with
normal text. Each status line item is of the form:
%-0{minwid}.{maxwid}{item}
All fields except the {item} is optional. A single percent sign can
All fields except the {item} are optional. A single percent sign can
be given as "%%". Up to 80 items can be specified. *E541*
When the option starts with "%!" then it is used as an expression,
@ -6048,7 +6007,8 @@ A jump table for the options with a short description can be found at |Q_op|.
feature use `has('tablineat')`.
< - Where to truncate line if too long. Default is at the start.
No width fields allowed.
= - Separation point between left and right aligned items.
= - Separation point between alignment sections. Each section will
be separated by an equal number of spaces.
No width fields allowed.
# - Set highlight group. The name must follow and then a # again.
Thus use %#HLname# for highlight group HLname. The same
@ -6069,7 +6029,7 @@ A jump table for the options with a short description can be found at |Q_op|.
become empty. This will make a group like the following disappear
completely from the statusline when none of the flags are set. >
:set statusline=...%(\ [%M%R%H]%)...
<
< *g:actual_curbuf*
Beware that an expression is evaluated each and every time the status
line is displayed. The current buffer and current window will be set
temporarily to that of the window (and buffer) whose statusline is
@ -6159,9 +6119,6 @@ A jump table for the options with a short description can be found at |Q_op|.
This option is used together with 'bufhidden' and 'buftype' to
specify special kinds of buffers. See |special-buffers|.
*'swapsync'* *'sws'*
'swapsync' 'sws' Removed. |vim-differences| {Nvim}
*'switchbuf'* *'swb'*
'switchbuf' 'swb' string (default "")
global
@ -6305,19 +6262,22 @@ A jump table for the options with a short description can be found at |Q_op|.
< [The whitespace before and after the '0' must be a single <Tab>]
When a binary search was done and no match was found in any of the
files listed in 'tags', and 'ignorecase' is set or a pattern is used
files listed in 'tags', and case is ignored or a pattern is used
instead of a normal tag name, a retry is done with a linear search.
Tags in unsorted tags files, and matches with different case will only
be found in the retry.
If a tag file indicates that it is case-fold sorted, the second,
linear search can be avoided for the 'ignorecase' case. Use a value
of '2' in the "!_TAG_FILE_SORTED" line for this. A tag file can be
case-fold sorted with the -f switch to "sort" in most unices, as in
the command: "sort -f -o tags tags". For "Exuberant ctags" version
5.x or higher (at least 5.5) the --sort=foldcase switch can be used
for this as well. Note that case must be folded to uppercase for this
to work.
linear search can be avoided when case is ignored. Use a value of '2'
in the "!_TAG_FILE_SORTED" line for this. A tag file can be case-fold
sorted with the -f switch to "sort" in most unices, as in the command:
"sort -f -o tags tags". For "Exuberant ctags" version 5.x or higher
(at least 5.5) the --sort=foldcase switch can be used for this as
well. Note that case must be folded to uppercase for this to work.
By default, tag searches are case-sensitive. Case is ignored when
'ignorecase' is set and 'tagcase' is "followic", or when 'tagcase' is
"ignore".
When 'tagbsearch' is off, tags searching is slower when a full match
exists, but faster when no full match exists. Tags in unsorted tags
@ -6328,6 +6288,16 @@ A jump table for the options with a short description can be found at |Q_op|.
This option doesn't affect commands that find all matching tags (e.g.,
command-line completion and ":help").
*'tagcase'* *'tc'*
'tagcase' 'tc' string (default "followic")
global or local to buffer |global-local|
{not in Vi}
This option specifies how case is handled when searching the tags
file:
followic Follow the 'ignorecase' option
ignore Ignore case
match Match case
*'taglength'* *'tl'*
'taglength' 'tl' number (default 0)
global
@ -6372,9 +6342,6 @@ A jump table for the options with a short description can be found at |Q_op|.
Resetting this option is useful when using a ":tag" command in a
mapping which should not change the tagstack.
*'term'* *E529* *E530* *E531*
'term' Removed. |vim-differences| {Nvim}
*'termbidi'* *'tbidi'*
*'notermbidi'* *'notbidi'*
'termbidi' 'tbidi' boolean (default off)
@ -6388,8 +6355,13 @@ A jump table for the options with a short description can be found at |Q_op|.
'arabicshape' is ignored, but 'rightleft' isn't changed automatically.
For further details see |arabic.txt|.
*'termencoding'* *'tenc'*
'termencoding' 'tenc' Removed. |vim-differences| {Nvim}
*'termguicolors'* *'tgc'*
'termguicolors' 'tgc' boolean (default off)
global
When on, uses |highlight-guifg| and |highlight-guibg| attributes in
the terminal (thus using 24-bit color). Requires a ISO-8613-3
compatible terminal.
Must be set at startup (in your |init.vim| or |--cmd|).
*'terse'* *'noterse'*
'terse' boolean (default off)
@ -6404,8 +6376,10 @@ A jump table for the options with a short description can be found at |Q_op|.
local to buffer
Maximum width of text that is being inserted. A longer line will be
broken after white space to get this width. A zero value disables
this. 'textwidth' is set to 0 when the 'paste' option is set. When
'textwidth' is zero, 'wrapmargin' may be used. See also
this.
'textwidth' is set to 0 when the 'paste' option is set and restored
when 'paste' is reset.
When 'textwidth' is zero, 'wrapmargin' may be used. See also
'formatoptions' and |ins-textwidth|.
When 'formatexpr' is set it will be used to break the line.
@ -6418,6 +6392,7 @@ A jump table for the options with a short description can be found at |Q_op|.
non-keyword characters (white space is preferred). Maximum line
length is 510 bytes.
To obtain a file to be used here, check out this ftp site:
[Sorry this link doesn't work anymore, do you know the right one?]
ftp://ftp.ox.ac.uk/pub/wordlists/ First get the README file.
To include a comma in a file name precede it with a backslash. Spaces
after a comma are ignored, otherwise spaces are included in the file
@ -6534,28 +6509,10 @@ A jump table for the options with a short description can be found at |Q_op|.
to be garbled (e.g., when it contains a CR or NL character).
{not available when compiled without the |+statusline| feature}
*'toolbar'* *'tb'*
'toolbar' 'tb' Removed. |vim-differences| {Nvim}
*'toolbariconsize'* *'tbis'*
'toolbariconsize' 'tbis' Removed. |vim-differences| {Nvim}
*'ttybuiltin'* *'tbi'* *'nottybuiltin'* *'notbi'*
'ttybuiltin' 'tbi' Removed. |vim-differences| {Nvim}
*'ttyfast'* *'tf'* *'nottyfast'* *'notf'*
'ttyfast' 'tf' Removed. |vim-differences| {Nvim}
*'ttymouse'* *'ttym'*
'ttymouse' 'ttym' Removed. |vim-differences| {Nvim}
*'ttyscroll'* *'tsl'*
'ttyscroll' 'tsl' Removed. |vim-differences| {Nvim}
*'ttytype'* *'tty'*
'ttytype' 'tty' Alias for 'term'. Removed. |vim-differences| {Nvim}
*'undodir'* *'udir'* *E926*
*'undodir'* *'udir'* *E5003*
'undodir' 'udir' string (default "$XDG_DATA_HOME/nvim/undo")
global
{only when compiled with the |+persistent_undo| feature}
@ -6709,12 +6666,6 @@ A jump table for the options with a short description can be found at |Q_op|.
with Unix. The Unix version of Vim cannot source dos format scripts,
but the Windows version of Vim can source unix format scripts.
*'viminfo'* *'vi'*
'viminfo' 'vi' string
global
Deprecated alias for 'shada' option. Is kept for compatibility
reasons.
*'virtualedit'* *'ve'*
'virtualedit' 've' string (default "")
global
@ -6760,9 +6711,6 @@ A jump table for the options with a short description can be found at |Q_op|.
Give a warning message when a shell command is used while the buffer
has been changed.
*'weirdinvert'* *'wiv'* *'noweirdinvert'* *'nowiv'*
'weirdinvert' 'wiv' Removed. |vim-differences| {Nvim}
*'whichwrap'* *'ww'*
'whichwrap' 'ww' string (Vim default: "b,s", Vi default: "")
global

View File

@ -1,4 +1,4 @@
*os_win32.txt* For Vim version 7.4. Last change: 2014 Sep 25
*os_win32.txt* For Vim version 7.4. Last change: 2016 Mar 05
VIM REFERENCE MANUAL by George Reilly
@ -75,6 +75,31 @@ The directory of the Vim executable is appended to $PATH. This is mostly to
make "!xxd" work, as it is in the Tools menu. And it also means that when
executable() returns 1 the executable can actually be executed.
Quotes in file names *win32-quotes*
Quotes inside a file name (or any other command line argument) can be escaped
with a backslash. E.g. >
vim -c "echo 'foo\"bar'"
Alternatively use three quotes to get one: >
vim -c "echo 'foo"""bar'"
The quotation rules are:
1. A `"` starts quotation.
2. Another `"` or `""` ends quotation. If the quotation ends with `""`, a `"`
is produced at the end of the quoted string.
Examples, with [] around an argument:
"foo" -> [foo]
"foo"" -> [foo"]
"foo"bar -> [foobar]
"foo" bar -> [foo], [bar]
"foo""bar -> [foo"bar]
"foo"" bar -> [foo"], [bar]
"foo"""bar" -> [foo"bar]
==============================================================================
3. Using the mouse *win32-mouse*

View File

@ -1,4 +1,4 @@
*pattern.txt* For Vim version 7.4. Last change: 2015 Mar 16
*pattern.txt* For Vim version 7.4. Last change: 2016 Apr 26
VIM REFERENCE MANUAL by Bram Moolenaar
@ -392,8 +392,8 @@ Use of "\M" makes the pattern after it be interpreted as if 'nomagic' is used.
Use of "\v" means that in the pattern after it all ASCII characters except
'0'-'9', 'a'-'z', 'A'-'Z' and '_' have a special meaning. "very magic"
Use of "\V" means that in the pattern after it only the backslash has a
special meaning. "very nomagic"
Use of "\V" means that in the pattern after it only the backslash and the
terminating character (/ or ?) has a special meaning. "very nomagic"
Examples:
after: \v \m \M \V matches ~
@ -401,6 +401,7 @@ after: \v \m \M \V matches ~
$ $ $ \$ matches end-of-line
. . \. \. matches any character
* * \* \* any number of the previous atom
~ ~ \~ \~ latest substitute string
() \(\) \(\) \(\) grouping into an atom
| \| \| \| separating alternatives
\a \a \a \a alphabetic character
@ -477,6 +478,7 @@ More explanation and examples below, follow the links.
|/\%v| \%23v \%23v in virtual column 23 |/zero-width|
Character classes: */character-classes*
magic nomagic matches ~
|/\i| \i \i identifier character (see 'isident' option)
|/\I| \I \I like "\i", but excluding digits
|/\k| \k \k keyword character (see 'iskeyword' option)
@ -507,6 +509,7 @@ Character classes: */character-classes*
class with end-of-line included
(end of character classes)
magic nomagic matches ~
|/\e| \e \e <Esc>
|/\t| \t \t <Tab>
|/\r| \r \r <CR>
@ -532,6 +535,7 @@ Character classes: */character-classes*
|/\Z| \Z \Z ignore differences in Unicode "combining characters".
Useful when searching voweled Hebrew or Arabic text.
magic nomagic matches ~
|/\m| \m \m 'magic' on for the following chars in the pattern
|/\M| \M \M 'magic' off for the following chars in the pattern
|/\v| \v \v the following chars in the pattern are "very magic"
@ -1067,8 +1071,8 @@ x A single character, with no special meaning, matches itself
belonging to that character class. The following character classes
are supported:
Name Contents ~
*[:alnum:]* [:alnum:] letters and digits
*[:alpha:]* [:alpha:] letters
*[:alnum:]* [:alnum:] ASCII letters and digits
*[:alpha:]* [:alpha:] ASCII letters
*[:blank:]* [:blank:] space and tab characters
*[:cntrl:]* [:cntrl:] control characters
*[:digit:]* [:digit:] decimal digits
@ -1076,7 +1080,7 @@ x A single character, with no special meaning, matches itself
*[:lower:]* [:lower:] lowercase letters (all letters when
'ignorecase' is used)
*[:print:]* [:print:] printable characters including space
*[:punct:]* [:punct:] punctuation characters
*[:punct:]* [:punct:] ASCII punctuation characters
*[:space:]* [:space:] whitespace characters
*[:upper:]* [:upper:] uppercase letters (all letters when
'ignorecase' is used)
@ -1090,7 +1094,11 @@ x A single character, with no special meaning, matches itself
plausible pattern for a Unix filename: "[-./[:alnum:]_~]\+" That is,
a list of at least one character, each of which is either '-', '.',
'/', alphabetic, numeric, '_' or '~'.
These items only work for 8-bit characters.
These items only work for 8-bit characters, except [:lower:] and
[:upper:] also work for multi-byte characters when using the new
regexp engine. See |two-engines|. In the future these items may
work for multi-byte characters. For now, to get all "alpha"
characters you can use: [[:lower:][:upper:]].
*/[[=* *[==]*
- An equivalence class. This means that characters are matched that
have almost the same meaning, e.g., when ignoring accents. This

127
runtime/doc/pi_health.txt Normal file
View File

@ -0,0 +1,127 @@
*pi_health.txt* Healthcheck framework
Author: TJ DeVries <devries.timothyj@gmail.com>
==============================================================================
1. Introduction |health.vim-intro|
2. Commands and functions |health.vim-manual|
3. Create a healthcheck |health.vim-dev|
==============================================================================
Introduction *healthcheck* *health.vim-intro*
Troubleshooting user configuration problems is a time-consuming task that
developers want to minimize. health.vim provides a simple framework for plugin
authors to hook into, and for users to invoke, to check and report the user's
configuration and environment. Type this command to try it: >
:CheckHealth
<
For example, some users have broken or unusual Python setups, which breaks the
|:python| command. |:CheckHealth| detects several common Python configuration
problems and reports them. If the Neovim Python module is not installed, it
shows a warning: >
You have not installed the Neovim Python module
You might want to try `pip install Neovim`
<
Plugin authors are encouraged to add healthchecks, see |health.vim-dev|.
==============================================================================
Commands and functions *health.vim-manual*
Commands
------------------------------------------------------------------------------
*:CheckHealth*
:CheckHealth Run all healthchecks and show the output in a new
tabpage. These healthchecks are included by default:
- python2
- python3
- ruby
- remote plugin
:CheckHealth {plugins}
Run healthchecks for one or more plugins. E.g. to run
only the standard Nvim healthcheck: >
:CheckHealth nvim
< To run the healthchecks for the "foo" and "bar" plugins
(assuming these plugins are on your 'runtimepath' and
they have implemented health#foo#check() and
health#bar#check(), respectively): >
:CheckHealth foo bar
<
Functions
------------------------------------------------------------------------------
health.vim functions are for creating new healthchecks. They mostly just do
some layout and formatting, to give users a consistent presentation.
health#report_start({name}) *health#report_start*
Starts a new report. Most plugins should call this only once, but if
you want different sections to appear in your report, call this once
per section.
health#report_info({msg}) *health#report_info*
Displays an informational message.
health#report_ok({msg}) *health#report_ok*
Displays a "success" message.
health#report_warn({msg}, [{suggestions}]) *health#report_warn*
Displays a warning. {suggestions} is an optional List of suggestions.
health#report_error({msg}, [{suggestions}]) *health#report_error*
Displays an error. {suggestions} is an optional List of suggestions.
health#{plugin}#check() *health.user_checker*
This is the form of a healthcheck definition. Call the above functions
from this function, then |:CheckHealth| does the rest. Example: >
function! health#my_plug#check() abort
silent call s:check_environment_vars()
silent call s:check_python_configuration()
endfunction
<
The function will be found and called automatically when the user
invokes |:CheckHealth|.
All output will be captured from the healthcheck. Use the
health#report_* functions so that your healthcheck has a format
consistent with the standard healthchecks.
==============================================================================
Create a healthcheck *health.vim-dev*
Healthchecks are functions that check the health of the system. Neovim has
built-in checkers, found in $VIMRUNTIME/autoload/health/.
To add a new checker for your own plugin, simply define a
health#{plugin}#check() function in autoload/health/{plugin}.vim.
|:CheckHealth| automatically finds and invokes such functions.
If your plugin is named "jslint", then its healthcheck function must be >
health#jslint#check()
<
defined in this file on 'runtimepath': >
autoload/health/jslint.vim
<
Here's a sample to get started: >
function! health#jslint#check() abort
call health#report_start('sanity checks')
" perform arbitrary checks
" ...
if looks_good
call health#report_ok('found required dependencies')
else
call health#report_error('cannot find jslint',
\ ['npm install --save jslint'])
endif
endfunction
<
==============================================================================
vim:tw=78:ts=8:ft=help:fdm=marker

View File

@ -1,4 +1,4 @@
*pi_netrw.txt* For Vim version 7.4. Last change: 2015 Jan 05
*pi_netrw.txt* For Vim version 7.4. Last change: 2016 Feb 16
------------------------------------------------
NETRW REFERENCE MANUAL by Charles E. Campbell
@ -6,7 +6,7 @@
Author: Charles E. Campbell <NdrOchip@ScampbellPfamily.AbizM>
(remove NOSPAM from Campbell's email first)
Copyright: Copyright (C) 1999-2015 Charles E Campbell *netrw-copyright*
Copyright: Copyright (C) 2016 Charles E Campbell *netrw-copyright*
The VIM LICENSE applies to the files in this package, including
netrw.vim, pi_netrw.txt, netrwFileHandlers.vim, netrwSettings.vim, and
syntax/netrw.vim. Like anything else that's free, netrw.vim and its
@ -48,9 +48,10 @@ Copyright: Copyright (C) 1999-2015 Charles E Campbell *netrw-copyright*
Introduction To Browsing............................|netrw-intro-browse|
Quick Reference: Maps...............................|netrw-browse-maps|
Quick Reference: Commands...........................|netrw-browse-cmds|
Banner Display......................................|netrw-I|
Bookmarking A Directory.............................|netrw-mb|
Browsing............................................|netrw-cr|
Squeezing the Current Tree-Listing Directory......|:netrw-s-cr|
Squeezing the Current Tree-Listing Directory........|netrw-s-cr|
Browsing With A Horizontally Split Window...........|netrw-o|
Browsing With A New Tab.............................|netrw-t|
Browsing With A Vertically Split Window.............|netrw-v|
@ -75,11 +76,13 @@ Copyright: Copyright (C) 1999-2015 Charles E Campbell *netrw-copyright*
Making The Browsing Directory The Current Directory.|netrw-c|
Marking Files.......................................|netrw-mf|
Unmarking Files.....................................|netrw-mF|
Marking Files By Location List......................|netrw-qL|
Marking Files By QuickFix List......................|netrw-qF|
Marking Files By Regular Expression.................|netrw-mr|
Marked Files: Arbitrary Shell Command...............|netrw-mx|
Marked Files: Arbitrary Shell Command, En Bloc......|netrw-mX|
Marked Files: Arbitrary Vim Command.................|netrw-mv|
Marked Files: Argument List.........................|netrw-ma| |netrw-mA|
Marked Files: Compression And Decompression.........|netrw-mz|
Marked Files: Copying...............................|netrw-mc|
Marked Files: Diff..................................|netrw-md|
@ -365,7 +368,12 @@ settings are described below, in |netrw-browser-options|, and in
fun! MyFuncRef()
endfun
let g:Netrw_funcref= function("MyFuncRef")
<
*g:Netrw_UserMaps* specifies a function or |List| of functions which can
be used to set up user-specified maps and functionality.
See |netrw-usermaps|
*g:netrw_ftp* if it doesn't exist, use default ftp
=0 use default ftp (uid password)
=1 use alternate ftp method (user uid password)
@ -1065,6 +1073,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
<c-h> Edit file hiding list |netrw-ctrl-h|
<c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
<c-r> Browse using a gvim server |netrw-ctrl-r|
<c-tab> Shrink/expand a netrw/explore window |netrw-c-tab|
- Makes Netrw go up one directory |netrw--|
a Toggles between normal display, |netrw-a|
hiding (suppress display of files matching g:netrw_list_hide)
@ -1077,6 +1086,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
gd Force treatment as directory |netrw-gd|
gf Force treatment as file |netrw-gf|
gh Quick hide/unhide of dot-files |netrw-gh|
gn Make top of tree the directory below the cursor |netrw-gn|
i Cycle between thin, long, wide, and tree listings |netrw-i|
mb Bookmark current directory |netrw-mb|
mc Copy marked files to marked-file target directory |netrw-mc|
@ -1104,8 +1114,9 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
qb List bookmarked directories and history |netrw-qb|
qf Display information on file |netrw-qf|
qF Mark files using a quickfix list |netrw-qF|
qL Mark files using a |location-list| |netrw-qL|
r Reverse sorting order |netrw-r|
R Rename the designed file(s)/directory(ies) |netrw-R|
R Rename the designated file(s)/directory(ies) |netrw-R|
s Select sorting style: by name, time, or file size |netrw-s|
S Specify suffix priority for name-sorting |netrw-S|
t Enter the file/directory under the cursor in a new tab|netrw-t|
@ -1153,6 +1164,14 @@ QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2
:Texplore[!] [dir] Tab & Explore..........................|netrw-explore|
:Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
BANNER DISPLAY *netrw-I*
One may toggle the banner display on and off by pressing "I".
Also See: |g:netrw_banner|
BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2
One may easily "bookmark" the currently browsed directory by using >
@ -1177,7 +1196,7 @@ Addtionally, one may use :NetrwMB to bookmark files or directories. >
if there are marked files : bookmark marked files
otherwise : bookmark file/directory under cursor
No argument and not in netrw buffer: bookmarks current open file
Has arguments: globs them individually and bookmarks them
Has arguments : |glob()|s each arg and bookmarks them
With bang: deletes files/directories from Netrw's bookmark system
@ -1194,7 +1213,7 @@ Related Topics:
|g:netrw_home| controls where .netrwbook is kept
BROWSING *netrw-cr* {{{2
BROWSING *netrw-enter* *netrw-cr* {{{2
Browsing is simple: move the cursor onto a file or directory of interest.
Hitting the <cr> (the return key) will select the file or directory.
@ -1235,12 +1254,22 @@ The price for such re-use is that when changes are made (such as new files
are introduced into a directory), the listing may become out-of-date. One may
always refresh directory listing buffers by pressing ctrl-L (see
|netrw-ctrl-l|).
*:netrw-s-cr*
*netrw-s-cr*
Squeezing the Current Tree-Listing Directory~
When the tree listing style is enabled (see |netrw-i|) and one is using
gvim, then the <s-cr> mapping may be used to squeeze (close) the
directory currently containing the cursor.
Otherwise, one may remap a key combination of one's own choice to get
this effect: >
nmap <buffer> <silent> <nowait> YOURKEYCOMBO <Plug>NetrwTreeSqueeze
<
Put this line in $HOME/ftplugin/netrw/netrw.vim; it needs to be generated
for netrw buffers only.
Related topics:
|netrw-ctrl-r| |netrw-o| |netrw-p|
|netrw-P| |netrw-t| |netrw-v|
@ -1394,8 +1423,8 @@ list (unless |g:netrw_dirhistmax| is zero; by default, it's ten). With the
the opposite, see |netrw-U|.
The "u" map also accepts counts to go back in the history several slots.
For your convenience, |netrw-qb| lists the history number which can be
re-used in that count.
For your convenience, qb (see |netrw-qb|) lists the history number which may
be used in that count.
*.netrwhist*
See |g:netrw_dirhistmax| for how to control the quantity of history stack
@ -1412,7 +1441,7 @@ CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2
With the "U" map, one can change to a later directory (successor).
This map is the opposite of the "u" map. (see |netrw-u|) Use the
q map to list both the bookmarks and history. (see |netrw-qb|)
qb map to list both the bookmarks and history. (see |netrw-qb|)
The "U" map also accepts counts to go forward in the history several slots.
@ -1420,7 +1449,7 @@ See |g:netrw_dirhistmax| for how to control the quantity of history stack
slots.
CHANGING TREE TOP *netrw-ntree* *:Ntree* {{{2
CHANGING TREE TOP *netrw-ntree* *:Ntree* *netrw-gn* {{{2
One may specify a new tree top for tree listings using >
@ -1430,14 +1459,18 @@ Without a "dirname", the current line is used (and any leading depth
information is elided).
With a "dirname", the specified directory name is used.
The "gn" map will take the word below the cursor and use that for
changing the top of the tree listing.
NETRW CLEAN *netrw-clean* *:NetrwClean* {{{2
With :NetrwClean one may easily remove netrw from one's home directory;
With NetrwClean one may easily remove netrw from one's home directory;
more precisely, from the first directory on your |'runtimepath'|.
With :NetrwClean!, netrw will remove netrw from all directories on your
|'runtimepath'|.
With NetrwClean!, netrw will attempt to remove netrw from all directories on
your |'runtimepath'|. Of course, you have to have write/delete permissions
correct to do this.
With either form of the command, netrw will first ask for confirmation
that the removal is in fact what you want to do. If netrw doesn't have
@ -1454,6 +1487,7 @@ operating system). Netrw allows one to invoke such special handlers by: >
* when Exploring, hit the "x" key
* when editing, hit gx with the cursor atop the special filename
< (latter not available if the |g:netrw_nogx| variable exists)
Netrw determines which special handler by the following method:
* if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
@ -1483,7 +1517,8 @@ One may also use visual mode (see |visual-start|) to select the text that the
special handler will use. Normally gx uses expand("<cfile>") to pick up the
text under the cursor; one may change what |expand()| uses via the
|g:netrw_gx| variable. Alternatively, one may select the text to be used by
gx via first making a visual selection (see |visual-block|).
gx via first making a visual selection (see |visual-block|) or by changing
the |'isfname'| option (which is global, so netrw doesn't modify it).
Associated setting variables:
|g:netrw_gx| control how gx picks up the text under the cursor
@ -1629,19 +1664,23 @@ DIRECTORY EXPLORATION COMMANDS {{{2
of the current tab. It will open a netrw window on the current
directory if [dir] is omitted; a :Lexplore [dir] will show the
specified directory in the left-hand side browser display no matter
from which window the command is issued. By default, :Lexplore will
change an uninitialized |g:netrw_chgwin| to 2; edits will thus
preferentially be made in window#2.
from which window the command is issued.
By default, :Lexplore will change an uninitialized |g:netrw_chgwin|
to 2; edits will thus preferentially be made in window#2.
The [N] specifies a |g:netrw_winsize| just for the new :Lexplore
window.
Those who like this method often also like tree style displays;
Those who like this method often also often like tree style displays;
see |g:netrw_liststyle|.
Also see: |netrw-C| |g:netrw_chgwin| |g:netrw_winsize|
|netrw-p| |netrw-P| |g:netrw_browse_split|
Also see: |netrw-C| |g:netrw_browse_split| |g:netrw_wiw|
|netrw-p| |netrw-P| |g:netrw_chgwin|
|netrw-c-tab| |g:netrw_winsize|
:[N]Lexplore! is like :Lexplore, except that the full-height Explorer window
will open on the right hand side, and an uninitialized |g:netrw_chgwin|
will open on the right hand side and an uninitialized |g:netrw_chgwin|
will be set to 1.
*netrw-:Sexplore*
@ -1697,8 +1736,9 @@ Also see: |g:netrw_alto| |g:netrw_altv| |g:netrw_winsize|
EXPLORING WITH STARS AND PATTERNS {{{2
When Explore, Sexplore, Hexplore, or Vexplore are used with one of the
following four patterns Explore generates a list of files which satisfy
the request. >
following four patterns Explore generates a list of files which satisfy the
request for the local file system. These exploration patterns will not work
with remote file browsing.
*/filepat files in current directory which satisfy filepat
**/filepat files in current directory or below which satisfy the
@ -2063,15 +2103,22 @@ Netrw provides several ways to mark files:
:MF *.c
<
* Note that :MF uses |<f-args>| to break the line
at spaces.
(Note that :MF uses |<f-args>| to break the line
at spaces)
* Mark files using the |argument-list| (|netrw-mA|)
* Mark files based upon a |location-list| (|netrw-qL|)
* Mark files based upon the quickfix list (|netrw-qF|)
(|quickfix-error-lists|)
The following netrw maps make use of marked files:
|netrw-a| Hide marked files/directories
|netrw-D| Delete marked files/directories
|netrw-ma| Move marked files' names to |arglist|
|netrw-mA| Move |arglist| filenames to marked file list
|netrw-mb| Append marked files to bookmarks
|netrw-mB| Delete marked files from bookmarks
|netrw-mc| Copy marked files to target
@ -2125,19 +2172,24 @@ is unlikely to be fixed.
UNMARKING FILES *netrw-mF* {{{2
(also see |netrw-mf|, |netrw-mu|)
The "mF" command will unmark all files in the current buffer. One may also use
mf (|netrw-mf|) on a specific, already marked, file to unmark just that file.
MARKING FILES BY LOCATION LIST *netrw-qL* {{{2
(also see |netrw-mf|)
This command will unmark all files in the current buffer. One may also use
mf (|netrw-mf|) on a specific file to unmark just that file.
One may convert |location-list|s into a marked file list using "qL".
You may then proceed with commands such as me (|netrw-me|) to edit them.
MARKING FILES BY QUICKFIX LIST *netrw-qF* {{{2
(also see |netrw-mf|)
One may convert the |quickfix-error-lists| into a marked file list using
"qF". You may then proceed with commands such as me (|netrw-me|) to
edit them. Quickfix error lists are generated, for example, by calls
to |:vimgrep|.
One may convert |quickfix-error-lists| into a marked file list using "qF".
You may then proceed with commands such as me (|netrw-me|) to edit them.
Quickfix error lists are generated, for example, by calls to |:vimgrep|.
MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2
@ -2155,14 +2207,17 @@ MARKED FILES, ARBITRARY VIM COMMAND *netrw-mv* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the local marked-file list)
The "mv" map causes netrw execute an arbitrary vim command on each file
on the local marked file list, individually:
The "mv" map causes netrw to execute an arbitrary vim command on each file on
the local marked file list, individually:
* 1split
* sil! keepalt e file
* run vim command
* sil! keepalt wq!
A prompt, "Enter vim command: ", will be issued to elicit the vim command
you wish used.
MARKED FILES, ARBITRARY SHELL COMMAND *netrw-mx* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
@ -2194,17 +2249,27 @@ command to be applied to all marked files on the global marked file list. The
command files
It is useful, for example, to select files and make a tarball:
This approach is useful, for example, to select files and make a tarball: >
(mark files)
mX
Enter command: tar cf mynewtarball.tar
The command that will be run in this example:
<
The command that will be run with this example:
tar cf mynewtarball.tar 'file1' 'file2' ...
MARKED FILES: ARGUMENT LIST *netrw-ma* *netrw-mA*
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the global marked-file list)
Using ma, one moves filenames from the marked file list to the argument list.
Using mA, one moves filenames from the argument list to the marked file list.
See Also: |netrw-qF| |argument-list| |:args|
MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the local marked file list)
@ -2214,7 +2279,7 @@ If any marked files are decompressed, then "mz" will compress them
using the command specified by |g:netrw_compress|; by default,
that's "gzip".
For decompression, netrw provides a |Dictionary| of suffices and their
For decompression, netrw uses a |Dictionary| of suffices and their
associated decompressing utilities; see |g:netrw_decompress|.
Remember that one can mark multiple files by regular expression
@ -2253,7 +2318,7 @@ MARKED FILES: EDITING *netrw-me* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the global marked file list)
This command will place the marked files on the |arglist| and commence
The "me" command will place the marked files on the |arglist| and commence
editing them. One may return the to explorer window with |:Rexplore|.
(use |:n| and |:p| to edit next and previous files in the arglist)
@ -2261,26 +2326,33 @@ MARKED FILES: GREP *netrw-mg* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the global marked file list)
This command will apply |:vimgrep| to the marked files.
The "mg" command will apply |:vimgrep| to the marked files.
The command will ask for the requested pattern; one may then enter: >
/pattern/[g][j]
! /pattern/[g][j]
pattern
<
In the cases of "j" option usage as shown above, "mg" will winnow the current
marked file list to just those possessing the specified pattern.
Thus, one may use >
mr ...file-pattern
mg ..contents-pattern
to have a marked file list satisfying the file-pattern but containing the
desired contents-pattern.
With /pattern/, editing will start with the first item on the |quickfix| list
that vimgrep sets up (see |:copen|, |:cnext|, |:cprevious|, |:cclose|). The |:vimgrep|
command is in use, so without 'g' each line is added to quickfix list only
once; with 'g' every match is included.
With /pattern/j, "mg" will winnow the current marked file list to just those
marked files also possessing the specified pattern. Thus, one may use >
mr ...file-pattern...
mg /pattern/j
<
to have a marked file list satisfying the file-pattern but also restricted to
files containing some desired pattern.
MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the local marked file list)
This command extracts the suffices of the marked files and toggles their
The "mh" command extracts the suffices of the marked files and toggles their
presence on the hiding list. Please note that marking the same suffix
this way multiple times will result in the suffix's presence being toggled
for each file (so an even quantity of marked files having the same suffix
@ -2309,16 +2381,16 @@ MARKED FILES: PRINTING *netrw-mp* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the local marked file list)
Netrw will apply the |:hardcopy| command to marked files. What it does
is open each file in a one-line window, execute hardcopy, then close the
one-line window.
When "mp" is used, netrw will apply the |:hardcopy| command to marked files.
What netrw does is open each file in a one-line window, execute hardcopy, then
close the one-line window.
MARKED FILES: SOURCING *netrw-ms* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the local marked file list)
Netrw will source the marked files (using vim's |:source| command)
With "ms", netrw will source the marked files (using vim's |:source| command)
MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2
@ -2341,6 +2413,9 @@ Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|):
This command uses |<q-args>|, so spaces in the directory name are
permitted without escaping.
* With mouse-enabled vim or with gvim, one may select a target by using
<c-leftmouse>
There is only one copy/move-to target at a time in a vim session; ie. the
target is a script variable (see |s:var|) and is shared between all netrw
windows (in an instance of vim).
@ -2417,9 +2492,13 @@ Related topics:
MARKED FILES: UNMARKING *netrw-mu* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(See |netrw-mf|, |netrw-mF|)
The "mu" mapping will unmark all currently marked files. This command differs
from "mF" as the latter only unmarks files in the current directory whereas
"mu" will unmark global and all buffer-local marked files.
(see |netrw-mF|)
The "mu" mapping will unmark all currently marked files.
*netrw-browser-settings*
NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2
@ -2724,6 +2803,21 @@ your browsing preferences. (see also: |netrw-settings|)
evaluation will be suppressed
(see |'ballooneval'|)
*g:netrw_sizestyle* not defined: actual bytes (default)
="b" : actual bytes (default)
="h" : human-readable (ex. 5k, 4m, 3g)
uses 1000 base
="H" : human-readable (ex. 5K, 4M, 3G)
uses 1024 base
The long listing (|netrw-i|) and query-file
maps (|netrw-qf|) will display file size
using the specified style.
*g:netrw_usetab* if this variable exists and is non-zero, then
the <tab> map supporting shrinking/expanding a
Lexplore or netrw window will be enabled.
(see |netrw-c-tab|)
*g:netrw_remote_mkdir* command for making a remote directory
via ftp (also see |g:netrw_mkdir_cmd|)
default: "mkdir"
@ -2760,7 +2854,8 @@ your browsing preferences. (see also: |netrw-settings|)
|netrw-ctrl-r| to use for its server.
default: "NETRWSERVER"
*g:netrw_sort_by* sort by "name", "time", or "size"
*g:netrw_sort_by* sort by "name", "time", "size", or
"exten".
default: "name"
*g:netrw_sort_direction* sorting direction: "normal" or "reverse"
@ -2872,6 +2967,10 @@ your browsing preferences. (see also: |netrw-settings|)
take effect, for example).
default: 50 (for 50%)
*g:netrw_wiw* =1 specifies the minimum window width to use
when shrinking a netrw/Lexplore window
(see |netrw-c-tab|).
*g:netrw_xstrlen* Controls how netrw computes string lengths,
including multi-byte characters' string
length. (thanks to N Weibull, T Mechelynck)
@ -2917,7 +3016,7 @@ help on what each of the variables do.
==============================================================================
OBTAINING A FILE *netrw-O* {{{2
OBTAINING A FILE *netrw-obtain* *netrw-O* {{{2
If there are no marked files:
@ -2947,7 +3046,7 @@ Related topics:
* To automatically make the currently browsed directory the current
directory, see |g:netrw_keepdir|.
*netrw-createfile*
*netrw-newfile* *netrw-createfile*
OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%* {{{2
To open a new file in netrw's current directory, press "%". This map
@ -2979,14 +3078,17 @@ These will:
will use only 30% of the columns available; the rest of the window
is used for the preview window.
Also see: |g:netrw_chgwin| |netrw-P|
Related: if you like this idea, you may also find :Lexplore
(|netrw-:Lexplore|) or |g:netrw_chgwin| of interest
Also see: |g:netrw_chgwin| |netrw-P| |'previewwindow'| |CTRL-W_z| |:pclose|
PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2
To edit a file or directory in the previously used (last accessed) window (see
:he |CTRL-W_p|), press a "P". If there's only one window, then the one window
will be horizontally split (by default).
To edit a file or directory under the cursor in the previously used (last
accessed) window (see :he |CTRL-W_p|), press a "P". If there's only one
window, then the one window will be horizontally split (by default).
If there's more than one window, the previous window will be re-used on
the selected file/directory. If the previous window's associated buffer
@ -3004,7 +3106,7 @@ Associated setting variables:
Also see: |g:netrw_chgwin| |netrw-p|
REFRESHING THE LISTING *netrw-ctrl-l* *netrw-ctrl_l* {{{2
REFRESHING THE LISTING *netrw-refresh* *netrw-ctrl-l* *netrw-ctrl_l* {{{2
To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or
hit the <cr> when atop the ./ directory entry in the listing. One may also
@ -3024,11 +3126,12 @@ RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2
If there are no marked files: (see |netrw-mf|)
Renaming/moving files and directories involves moving the cursor to the
Renaming files and directories involves moving the cursor to the
file/directory to be moved (renamed) and pressing "R". You will then be
queried for where you want the file/directory to be moved. You may select
queried for what you want the file/directory to be renamed to You may select
a range of lines with the "V" command (visual selection), and then
pressing "R".
press "R"; you will be queried for each file as to what you want it
renamed to.
If there are marked files: (see |netrw-mf|)
@ -3046,6 +3149,14 @@ If there are marked files: (see |netrw-mf|)
This example will mark all *.c files and then rename them to *.cpp
files.
The ctrl-X character has special meaning for renaming files: >
<c-x> : a single ctrl-x tells netrw to ignore the portion of the response
lying between the last '/' and the ctrl-x.
<c-x><c-x> : a pair of contiguous ctrl-x's tells netrw to ignore any
portion of the string preceding the double ctrl-x's.
<
WARNING:~
Note that moving files is a dangerous operation; copies are safer. That's
@ -3053,13 +3164,13 @@ If there are marked files: (see |netrw-mf|)
the copy fails and the delete does not, you may lose the file.
Use at your own risk.
The g:netrw_rename_cmd variable is used to implement renaming. By default its
value is:
The g:netrw_rename_cmd variable is used to implement remote renaming. By
default its value is:
ssh HOSTNAME mv
One may rename a block of files and directories by selecting them with
the V (|linewise-visual|).
V (|linewise-visual|) when using thin style
SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2
@ -3072,18 +3183,19 @@ Related topics: |netrw-r| |netrw-S|
Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
SETTING EDITING WINDOW *netrw-C* *netrw-:NetrwC* {{{2
SETTING EDITING WINDOW *netrw-editwindow* *netrw-C* *netrw-:NetrwC* {{{2
One may select a netrw window for editing with the "C" mapping, using the
:NetrwC [win#] command, or by setting g:netrw_chgwin to the selected window
:NetrwC [win#] command, or by setting |g:netrw_chgwin| to the selected window
number. Subsequent selection of a file to edit (|netrw-cr|) will use that
window.
* C by itself, will select the current window for editing via
|netrw-cr|
* C : by itself, will select the current window holding a netrw buffer
for editing via |netrw-cr|. The C mapping is only available while in
netrw buffers.
* [count]C the count will be used as the window number to be used
for editing via |netrw-cr|.
* [count]C : the count will be used as the window number to be used
for subsequent editing via |netrw-cr|.
* :NetrwC will set |g:netrw_chgwin| to the current window
@ -3092,12 +3204,91 @@ window.
Using >
let g:netrw_chgwin= -1
will restore the default editing behavior (ie. use the current window).
will restore the default editing behavior
(ie. editing will use the current window).
Related topics: |netrw-cr| |g:netrw_browse_split|
Associated setting variables: |g:netrw_chgwin|
SHRINKING OR EXPANDING A NETRW OR LEXPLORE WINDOW *netrw-c-tab* {{{2
The <c-tab> key will toggle a netrw or |:Lexplore| window's width,
but only if |g:netrw_usetab| exists and is non-zero (and, of course,
only if your terminal supports differentiating <c-tab> from a plain
<tab>).
* If the current window is a netrw window, toggle its width
(between |g:netrw_wiw| and its original width)
* Else if there is a |:Lexplore| window in the current tab, toggle
its width
* Else bring up a |:Lexplore| window
If |g:netrw_usetab| exists or is zero, or if there is a pre-existing mapping
for <c-tab>, then the <c-tab> will not be mapped. One may map something other
than a <c-tab>, too: (but you'll still need to have had g:netrw_usetab set) >
nmap <unique> (whatever) <Plug>NetrwShrink
<
Related topics: |:Lexplore|
Associated setting variable: |g:netrw_usetab|
USER SPECIFIED MAPS *netrw-usermaps* {{{1
One may make customized user maps. Specify a variable, |g:Netrw_UserMaps|,
to hold a |List| of lists of keymap strings and function names: >
[["keymap-sequence","ExampleUserMapFunc"],...]
<
When netrw is setting up maps for a netrw buffer, if |g:Netrw_UserMaps|
exists, then the internal function netrw#UserMaps(islocal) is called.
This function goes through all the entries in the |g:Netrw_UserMaps| list:
* sets up maps: >
nno <buffer> <silent> KEYMAP-SEQUENCE
:call s:UserMaps(islocal,"ExampleUserMapFunc")
< * refreshes if result from that function call is the string
"refresh"
* if the result string is not "", then that string will be
executed (:exe result)
* if the result is a List, then the above two actions on results
will be taken for every string in the result List
The user function is passed one argument; it resembles >
fun! ExampleUserMapFunc(islocal)
<
where a:islocal is 1 if its a local-directory system call or 0 when
remote-directory system call.
Use netrw#Expose("varname") to access netrw-internal (script-local)
variables.
Use netrw#Modify("varname",newvalue) to change netrw-internal variables.
Use netrw#Call("funcname"[,args]) to call a netrw-internal function with
specified arguments.
Example: Get a copy of netrw's marked file list: >
let netrwmarkfilelist= netrw#Expose("netrwmarkfilelist")
<
Example: Modify the value of netrw's marked file list: >
call netrw#Modify("netrwmarkfilelist",[])
<
Example: Clear netrw's marked file list via a mapping on gu >
" ExampleUserMap: {{{2
fun! ExampleUserMap(islocal)
call netrw#Modify("netrwmarkfilelist",[])
call netrw#Modify('netrwmarkfilemtch_{bufnr("%")}',"")
let retval= ["refresh"]
return retval
endfun
let g:Netrw_UserMaps= [["gu","ExampleUserMap"]]
<
10. Problems and Fixes *netrw-problems* {{{1
(This section is likely to grow as I get feedback)
@ -3272,6 +3463,7 @@ Associated setting variables: |g:netrw_chgwin|
The first one (|g:netrw_ssh_cmd|) is the most important; most
of the others will use the string in g:netrw_ssh_cmd by
default.
*netrw-p9* *netrw-ml_get*
P9. I'm browsing, changing directory, and bang! ml_get errors
appear and I have to kill vim. Any way around this?
@ -3298,6 +3490,14 @@ Associated setting variables: |g:netrw_chgwin|
P11. I want to have two windows; a thin one on the left and my editing
window on the right. How may I accomplish this?
You probably want netrw running as in a side window. If so, you
will likely find that ":[N]Lexplore" does what you want. The
optional "[N]" allows you to select the quantity of columns you
wish the |:Lexplore|r window to start with (see |g:netrw_winsize|
for how this parameter works).
Previous solution:
* Put the following line in your <.vimrc>:
let g:netrw_altv = 1
* Edit the current directory: :e .
@ -3311,6 +3511,7 @@ Associated setting variables: |g:netrw_chgwin|
<leftmouse> in the browser window and then press the
<middlemouse> to select the file.
*netrw-p12*
P12. My directory isn't sorting correctly, or unwanted letters are
appearing in the listed filenames, or things aren't lining
@ -3388,7 +3589,7 @@ Associated setting variables: |g:netrw_chgwin|
to open a swap file.
(romainl) It looks like you are starting Vim from a protected
directory. Start if from your $HOME or another writable
directory. Start netrw from your $HOME or other writable
directory.
*netrw-p17*
@ -3412,6 +3613,58 @@ Associated setting variables: |g:netrw_chgwin|
"Using Vim to Remotely Edit A File on ServerB Only
Accessible From ServerA"
*netrw-P19*
P19. How do I get numbering on in directory listings?
With |g:netrw_bufsettings|, you can control netrw's buffer
settings; try putting >
let g:netrw_bufsettings="noma nomod nu nobl nowrap ro nornu"
< in your .vimrc. If you'd like to have relative numbering
instead, try >
let g:netrw_bufsettings="noma nomod nonu nobl nowrap ro rnu"
<
*netrw-P20*
P20. How may I have gvim start up showing a directory listing?
Try putting the following code snippet into your .vimrc: >
augroup VimStartup
au!
au VimEnter * if expand("%") == "" && argc() == 0 &&
\ (v:servername =~ 'GVIM\d*' || v:servername == "")
\ | e . | endif
augroup END
< You may use Lexplore instead of "e" if you're so inclined.
This snippet assumes that you have client-server enabled
(ie. a "huge" vim version).
*netrw-P21*
P21. I've made a directory (or file) with an accented character, but
netrw isn't letting me enter that directory/read that file:
Its likely that the shell or o/s is using a different encoding
than you have vim (netrw) using. A patch to vim supporting
"systemencoding" may address this issue in the future; for
now, just have netrw use the proper encoding. For example: >
au FileType netrw set enc=latin1
<
*netrw-P22*
P22. I get an error message when I try to copy or move a file:
**error** (netrw) tried using g:netrw_localcopycmd<cp>; it doesn't work!
What's wrong?
Netrw uses several system level commands to do things (see
|g:netrw_localcopycmd|, |g:netrw_localmovecmd|,
|g:netrw_localrmdir|, |g:netrw_mkdir_cmd|).
You may need to adjust the default commands for one or more of
these commands by setting them properly in your .vimrc. Another
source of difficulty is that these commands use vim's local
directory, which may not be the same as the browsing directory
shown by netrw (see |g:netrw_keepdir|).
==============================================================================
11. Debugging Netrw Itself *netrw-debug* {{{1
@ -3441,13 +3694,13 @@ called netrw.vimrc with the following contents: >
<
Then run netrw as follows: >
vim -u netrw.vimrc --noplugins [some path here]
vim -u netrw.vimrc --noplugins -i NONE [some path here]
<
Perform whatever netrw commands you need to, and check that the problem is
still present. This procedure sidesteps any issues due to personal .vimrc
settings and other plugins. If the problem does not appear, then you need
to determine what setting in your .vimrc is causing the conflict with netrw
or which plugin.
settings, .viminfo file, and other plugins. If the problem does not appear,
then you need to determine which setting in your .vimrc is causing the
conflict with netrw or which plugin(s) is/are involved.
Step 3: If the problem still is present, then get a debugging trace from
netrw:
@ -3502,6 +3755,77 @@ netrw:
==============================================================================
12. History *netrw-history* {{{1
v155: Oct 29, 2015 * (Timur Fayzrakhmanov) reported that netrw's
mapping of ctrl-l was not allowing refresh of
other windows when it was done in a netrw
window.
Nov 05, 2015 * Improved s:TreeSqueezeDir() to use search()
instead of a loop
* NetrwBrowse() will return line to
w:netrw_bannercnt if cursor ended up in
banner
Nov 16, 2015 * Added a <Plug>NetrwTreeSqueeze (|netrw-s-cr|)
Nov 17, 2015 * Commented out imaps -- perhaps someone can
tell me how they're useful and should be
retained?
Nov 20, 2015 * Added |netrw-ma| and |netrw-mA| support
Nov 20, 2015 * gx (|netrw-gx|) on an url downloaded the
file in addition to simply bringing up the
url in a browser. Fixed.
Nov 23, 2015 * Added |g:netrw_sizestyle| support
Nov 27, 2015 * Inserted a lot of <c-u>s into various netrw
maps.
Jan 05, 2016 * |netrw-qL| implemented to mark files based
upon |location-list|s; similar to |netrw-qF|.
Jan 19, 2016 * using - call delete(directoryname,"d") -
instead of using g:netrw_localrmdir if
v7.4 + patch#1107 is available
Jan 28, 2016 * changed to using |winsaveview()| and
|winrestview()|
Jan 28, 2016 * s:NetrwTreePath() now does a save and
restore of view
Feb 08, 2016 * Fixed a tree-listing problem with remote
directories
v154: Feb 26, 2015 * (Yuri Kanivetsky) reported a situation where
a file was not treated properly as a file
due to g:netrw_keepdir == 1
Mar 25, 2015 * (requested by Ben Friz) one may now sort by
extension
Mar 28, 2015 * (requested by Matt Brooks) netrw has a lot
of buffer-local mappings; however, some
plugins (such as vim-surround) set up
conflicting mappings that cause vim to wait.
The "<nowait>" modifier has been included
with most of netrw's mappings to avoid that
delay.
Jun 26, 2015 * |netrw-gn| mapping implemted
* :Ntree NotADir resulted in having
the tree listing expand in the error messages
window. Fixed.
Jun 29, 2015 * Attempting to delete a file remotely caused
an error with "keepsol" mentioned; fixed.
Jul 08, 2015 * Several changes to keep the |:jumps| table
correct when working with
|g:netrw_fastbrowse| set to 2
* wide listing with accented characters fixed
(using %-S instead of %-s with a |printf()|
Jul 13, 2015 * (Daniel Hahler) CheckIfKde() could be true
but kfmclient not installed. Changed order
in netrw#BrowseX(): checks if kde and
kfmclient, then will use xdg-open on a unix
system (if xdg-open is executable)
Aug 11, 2015 * (McDonnell) tree listing mode wouldn't
select a file in a open subdirectory.
* (McDonnell) when multiple subdirectories
were concurrently open in tree listing
mode, a ctrl-L wouldn't refresh properly.
* The netrw:target menu showed duplicate
entries
Oct 13, 2015 * (mattn) provided an exception to handle
windows with shellslash set but no shell
Oct 23, 2015 * if g:netrw_usetab and <c-tab> now used
to control whether NetrwShrink is used
(see |netrw-c-tab|)
v153: May 13, 2014 * added another |g:netrw_ffkeep| usage {{{2
May 14, 2014 * changed s:PerformListing() so that it
always sets ft=netrw for netrw buffers
@ -3622,7 +3946,7 @@ netrw:
handling.
* |:Lexplore| path: will be used to update
a left-side netrw browsing directory.
Mar 12, 2014 * |:netrw-s-cr|: use <s-cr> to close
Mar 12, 2014 * |netrw-s-cr|: use <s-cr> to close
tree directory implemented
Mar 13, 2014 * (Tony Mechylynck) reported that using
the browser with ftp on a directory,

145
runtime/doc/provider.txt Normal file
View File

@ -0,0 +1,145 @@
*provider.txt* {Nvim}
NVIM REFERENCE MANUAL by Thiago de Arruda
Providers *provider*
Nvim delegates some features to dynamic "providers".
==============================================================================
Python integration *provider-python*
Nvim supports the Vim legacy |python-vim| and |python3| interfaces via
external Python interpreters connected via |RPC|.
Note: Only the Vim 7.3 API is supported; bindeval (Vim 7.4) is not.
PYTHON QUICKSTART ~
If you used a package manager to install Nvim, you might already have the
required `neovim` Python package. Run |:CheckHealth| to see if your system is
up-to-date.
Following are steps to install the package with Python's `pip` tool.
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, try `pip`.
To use Vim Python 2/3 plugins with Nvim:
- 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 --upgrade neovim
<
or for the current user: >
$ pip2 install --user --upgrade 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 --upgrade neovim
<
or for the current user: >
$ pip3 install --user --upgrade neovim
<
Note: The `--upgrade` flag ensures you have the latest version even if
a previous version was already installed.
PYTHON PROVIDER CONFIGURATION ~
*g:python_host_prog*
Set `g:python_host_prog` to point Nvim to a specific Python 2 interpreter: >
let g:python_host_prog = '/path/to/python'
<
*g:python3_host_prog*
Set `g:python3_host_prog` to point Nvim to a specific Python 3 interpreter: >
let g:python3_host_prog = '/path/to/python3'
<
*g:loaded_python_provider*
To disable Python 2 support: >
let g:loaded_python_provider = 1
<
*g:loaded_python3_provider*
To disable Python 3 support: >
let g:loaded_python3_provider = 1
<
*g:python_host_skip_check*
Set `g:python_host_skip_check` to disable the Python 2 interpreter check.
Note: This requires you to install the python-neovim module properly. >
let g:python_host_skip_check = 1
<
*g:python3_host_skip_check*
Set `g:python3_host_skip_check` to disable the Python 3 interpreter check.
Note: This requires you to install the python3-neovim module properly. >
let g:python3_host_skip_check = 1
==============================================================================
Ruby integration *provider-ruby*
Nvim supports the Vim legacy |ruby-vim| interface via external Ruby
interpreters connected via |RPC|.
Run |:CheckHealth| to see if your system is up-to-date.
RUBY QUICKSTART ~
To use Vim Ruby plugins with Nvim, just install the latest `neovim` RubyGem: >
$ gem install neovim
RUBY PROVIDER CONFIGURATION ~
*g:loaded_ruby_provider*
To disable Ruby support: >
let g:loaded_ruby_provider = 1
==============================================================================
Clipboard integration *provider-clipboard* *clipboard*
Nvim has no direct connection to the system clipboard. Instead it is
accessible through a |provider| which transparently uses shell commands for
communicating with the clipboard.
Clipboard access is implicitly enabled if any of the following clipboard tools
are found in your `$PATH`.
- xclip
- xsel (newer alternative to xclip)
- pbcopy/pbpaste (Mac OS X)
- lemonade (for SSH) https://github.com/pocke/lemonade
- doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/
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.
==============================================================================
X11 selection mechanism *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,4 +1,4 @@
*quickfix.txt* For Vim version 7.4. Last change: 2014 Mar 27
*quickfix.txt* For Vim version 7.4. Last change: 2016 Jul 01
VIM REFERENCE MANUAL by Bram Moolenaar
@ -49,6 +49,14 @@ The following quickfix commands can be used. The location list commands are
similar to the quickfix commands, replacing the 'c' prefix in the quickfix
command with 'l'.
*E924*
If the current window was closed by an |autocommand| while processing a
location list command, it will be aborted.
*E925* *E926*
If the current quickfix or location list was changed by an |autocommand| while
processing a quickfix or location list command, it will be aborted.
*:cc*
:cc[!] [nr] Display error [nr]. If [nr] is omitted, the same
error is displayed again. Without [!] this doesn't
@ -255,9 +263,23 @@ command with 'l'.
The 'switchbuf' settings are respected when jumping
to a buffer.
:cl[ist] +{count} List the current and next {count} valid errors. This
is similar to ":clist from from+count", where "from"
is the current error position.
:cl[ist]! [from] [, [to]]
List all errors.
:cl[ist]! +{count} List the current and next {count} error lines. This
is useful to see unrecognized lines after the current
one. For example, if ":clist" shows:
8384 testje.java:252: error: cannot find symbol ~
Then using ":cl! +3" shows the reason:
8384 testje.java:252: error: cannot find symbol ~
8385: ZexitCode = Fmainx(); ~
8386: ^ ~
8387: symbol: method Fmainx() ~
*:lli* *:llist*
:lli[st] [from] [, [to]]
Same as ":clist", except the location list for the
@ -302,16 +324,22 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST:
etc.
< When the current file can't be |abandon|ed and the [!]
is not present, the command fails.
When an error is detected on one buffer, further
buffers will not be visited.
When an error is detected execution stops.
The last buffer (or where an error occurred) becomes
the current buffer.
{cmd} can contain '|' to concatenate several commands.
Only valid entries in the quickfix list are used.
A range can be used to select entries, e.g.: >
:10,$cdo cmd
< To skip entries 1 to 9.
Note: While this command is executing, the Syntax
autocommand event is disabled by adding it to
'eventignore'. This considerably speeds up editing
each buffer.
{not in Vi} {not available when compiled without the
|+listcmds| feature}
Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
|:ldo|, |:cfdo| and |:lfdo|.
@ -323,20 +351,9 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST:
:cnfile
:{cmd}
etc.
< When the current file can't be |abandon|ed and the [!]
is not present, the command fails.
When an error is detected on one buffer, further
buffers will not be visited.
The last buffer (or where an error occurred) becomes
the current buffer.
{cmd} can contain '|' to concatenate several commands.
Only valid entries in the quickfix list are used.
Note: While this command is executing, the Syntax
autocommand event is disabled by adding it to
'eventignore'. This considerably speeds up editing
each buffer.
Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
|:cdo|, |:ldo| and |:lfdo|.
< Otherwise it works the same as `:cdo`.
{not in Vi} {not available when compiled without the
|+listcmds| feature}
*:ldo*
:ld[o][!] {cmd} Execute {cmd} in each valid entry in the location list
@ -347,20 +364,10 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST:
:lnext
:{cmd}
etc.
< When the current file can't be |abandon|ed and the [!]
is not present, the command fails.
When an error is detected on one buffer, further
buffers will not be visited.
The last buffer (or where an error occurred) becomes
the current buffer.
{cmd} can contain '|' to concatenate several commands.
Only valid entries in the location list are used.
Note: While this command is executing, the Syntax
autocommand event is disabled by adding it to
'eventignore'. This considerably speeds up editing
each buffer.
Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
|:cdo|, |:cfdo| and |:lfdo|.
< Only valid entries in the location list are used.
Otherwise it works the same as `:cdo`.
{not in Vi} {not available when compiled without the
|+listcmds| feature}
*:lfdo*
:lfdo[!] {cmd} Execute {cmd} in each file in the location list for
@ -371,20 +378,9 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST:
:lnfile
:{cmd}
etc.
< When the current file can't be |abandon|ed and the [!]
is not present, the command fails.
When an error is detected on one buffer, further
buffers will not be visited.
The last buffer (or where an error occurred) becomes
the current buffer.
{cmd} can contain '|' to concatenate several commands.
Only valid entries in the location list are used.
Note: While this command is executing, the Syntax
autocommand event is disabled by adding it to
'eventignore'. This considerably speeds up editing
each buffer.
Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
|:cdo|, |:ldo| and |:cfdo|.
< Otherwise it works the same as `:ldo`.
{not in Vi} {not available when compiled without the
|+listcmds| feature}
=============================================================================
2. The error window *quickfix-window*
@ -1515,12 +1511,6 @@ However, to properly parse such a complex file, an external filter should
be used. See the description further above how to make such a filter known
by Vim.
*errorformat-Perl*
In $VIMRUNTIME/tools you can find the efm_perl.pl script, which filters Perl
error messages into a format that quickfix mode will understand. See the
start of the file about how to use it. (This script is deprecated, see
|compiler-perl|.)
vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,4 +1,4 @@
*quickref.txt* For Vim version 7.4. Last change: 2014 Nov 19
*quickref.txt* For Vim version 7.4. Last change: 2016 Mar 30
VIM REFERENCE MANUAL by Bram Moolenaar
@ -617,6 +617,7 @@ Short explanation of each option: *option-list*
'balloondelay' 'bdlay' delay in mS before a balloon may pop up
'ballooneval' 'beval' switch on balloon evaluation
'balloonexpr' 'bexpr' expression to show in balloon
'belloff' 'bo' do not ring the bell for these reasons
'binary' 'bin' read/write/edit file in binary mode
'bomb' prepend a Byte Order Mark to the file
'breakat' 'brk' characters that may cause a line break
@ -688,6 +689,7 @@ Short explanation of each option: *option-list*
'fileignorecase' 'fic' ignore case when using file names
'filetype' 'ft' type of file, used for autocommands
'fillchars' 'fcs' characters to use for displaying special items
'fixendofline' 'fixeol' make sure last line in file has <EOL>
'fkmap' 'fk' Farsi keyboard mapping
'foldclose' 'fcl' close a fold when the cursor leaves it
'foldcolumn' 'fdc' width of the column used to indicate folds
@ -702,10 +704,10 @@ Short explanation of each option: *option-list*
'foldnestmax' 'fdn' maximum fold depth
'foldopen' 'fdo' for which commands a fold will be opened
'foldtext' 'fdt' expression used to display for a closed fold
'formatexpr' 'fex' expression used with "gq" command
'formatlistpat' 'flp' pattern used to recognize a list header
'formatoptions' 'fo' how automatic formatting is to be done
'formatprg' 'fp' name of external program used with "gq" command
'formatexpr' 'fex' expression used with "gq" command
'fsync' 'fs' whether to invoke fsync() after file write
'gdefault' 'gd' the ":substitute" flag 'g' is default on
'grepformat' 'gfm' format of 'grepprg' output
@ -792,12 +794,14 @@ Short explanation of each option: *option-list*
'omnifunc' 'ofu' function for filetype-specific completion
'opendevice' 'odev' allow reading/writing devices on MS-Windows
'operatorfunc' 'opfunc' function to be called for |g@| operator
'packpath' 'pp' list of directories used for packages
'paragraphs' 'para' nroff macros that separate paragraphs
'paste' allow pasting text
'pastetoggle' 'pt' key code that causes 'paste' to toggle
'patchexpr' 'pex' expression used to patch a file
'patchmode' 'pm' keep the oldest version of a file
'path' 'pa' list of directories searched with "gf" et.al.
'perldll' name of the Perl dynamic library
'preserveindent' 'pi' preserve the indent structure when reindenting
'previewheight' 'pvh' height of the preview window
'previewwindow' 'pvw' identifies the preview window
@ -810,6 +814,8 @@ Short explanation of each option: *option-list*
'printmbfont' 'pmbfn' font names to be used for CJK output of :hardcopy
'printoptions' 'popt' controls the format of :hardcopy output
'pumheight' 'ph' maximum height of the popup menu
'pythondll' name of the Python 2 dynamic library
'pythonthreedll' name of the Python 3 dynamic library
'quoteescape' 'qe' escape characters used in a string
'readonly' 'ro' disallow writing the buffer
'redrawtime' 'rdt' timeout for 'hlsearch' and |:match| highlighting
@ -820,6 +826,7 @@ Short explanation of each option: *option-list*
'revins' 'ri' inserting characters will work backwards
'rightleft' 'rl' window is right-to-left oriented
'rightleftcmd' 'rlc' commands for which editing works right-to-left
'rubydll' name of the Ruby dynamic library
'ruler' 'ru' show cursor line and column in the status line
'rulerformat' 'ruf' custom format for the ruler
'runtimepath' 'rtp' list of directories used for runtime files
@ -873,10 +880,11 @@ Short explanation of each option: *option-list*
'switchbuf' 'swb' sets behavior when switching to another buffer
'synmaxcol' 'smc' maximum column to find syntax items
'syntax' 'syn' syntax to be loaded for current buffer
'tabstop' 'ts' number of spaces that <Tab> in file uses
'tabline' 'tal' custom format for the console tab pages line
'tabpagemax' 'tpm' maximum number of tab pages for |-p| and "tab all"
'tabstop' 'ts' number of spaces that <Tab> in file uses
'tagbsearch' 'tbs' use binary searching in tags files
'tagcase' 'tc' how to handle case when searching in tags files
'taglength' 'tl' number of significant characters for a tag
'tagrelative' 'tr' file names in tag file are relative
'tags' 'tag' list of file names used by the tag command

View File

@ -1,275 +0,0 @@
*quotes.txt* For Vim version 7.4. Last change: 2010 Nov 03
VIM REFERENCE MANUAL by Bram Moolenaar
*quotes*
Here are some nice quotes about Vim that I collected from news and mail.
vim (vim) noun - Ebullient vitality and energy. [Latin, accusative of vis,
strength] (Dictionary)
Vim is so much better than vi that a great many of my old vi :map's became
immediately obsolete! (Tony Nugent, Australia)
Coming with a very GUI mindset from Windows, I always thought of people using
Vi as some kind of outer space alien in human clothes. Once I tried I really
got addicted by its power and now I found myself typing Vim keypresses in the
oddest places! That's why I would like to see Vim embedded in every
application which deals with text editing. (Jos<6F> Fonseca)
I was a 12-year emacs user who switched to Vim about a year ago after finally
giving up on the multiple incompatible versions, flaky contributed packages,
disorganized keystrokes, etc. And it was one of the best moves I ever made.
(Joel Burton)
Although all of the programs were used during the preparation of the new and
revised material, most of the editing was done with Vim versions 4.5 and 5.0
under GNU-Linux (Redhat 4.2). (Arnold Robbins, Israel, author of "Learning
the Vi editor")
Out of all the open software i've ever seen and used, and i've seen a lot, Vim
is the best, most useful and highest quality to work with, second only to the
linux kernel itself. (Peter Jay Salzman)
It's well worth noting that the _entirety_ of SourceForge was written using
Vim and its nifty PHP syntax highlighting. I think the entire SF.net tech
staff uses Vim and we're all excited to have you aboard! (Tim Perdue)
Vim is one of a select bunch of tools for which I have no substitute. It is
a brilliant piece of work! (Biju Chacko)
A previous girlfriend of mine switched to emacs. Needless to say, the
relationship went nowhere. (Geoffrey Mann)
I rarely think about Vim, in the same way that I guess a fish rarely thinks
about water. It's the environment in which everything else happens. I'm a
fairly busy system administrator working on a lot of different platforms. Vim
is the only thing that's consistent across all my systems, and it's just about
the only thing that doesn't break from time to time. When a new system comes
in the door without Vim, I install it right away. Great to have a tool that's
the same everywhere, that's completely reliable, so I can ignore it and think
about other things. (Pete Schaeffer)
Having recently succeeded in running Vim via telnet through a Nokia
Communicator, I can now report that it works nicely on a Palm Pilot too.
(Allan Kelly, Scotland)
You've done a tremendous job with 'VIM', Bram! The more I use it, the more
impressed I get (I am an old 'vi' die hard who once started out with early
versions of 'emacs' in the late 1970's and was relieved by finding 'vi' in the
first UNIX I came across in 1983). In my opinion, it's about time 'VIM'
replace 'emacs' as the standard for top editors. (Bo Thide', Sweden)
I love and use VIM heavily too. (Larry Wall)
Vi is like a Ferrari, if you're a beginner, it handles like a bitch, but once
you get the hang of it, it's small, powerful and FAST! (Unknown)
VIM is like a new model Ferrari, and sounds like one too - "VIIIIIIMMM!"
(Stephen Riehm, Germany)
Schon bei Nutzung eines Bruchteils der VIM-Funktionen wird der Benutzer recht
schnell die Vorzuege dieses Editors kennen- und schaetzenlernen.
Translated: Even when only using a fraction of VIM-functions, the user will
quickly get used to and appreciate the advantages of this editor. (Garry
Glendown, conclusion of an article on VIM in iX magazine 9/1998)
I've recently acquired the O'Reilly book on VI (it also discusses VIM
in-depth), and I'm amazed at just how powerful this application is. (Jeffrey
Rankin)
This guide was written using the Windows 9.x distribution of GVIM, which is
quite possibly the greatest thing to come along since God created the naked
girl. (Michael DiBernardo)
Boy, I thought I knew almost everything about VIM, but every time I browse the
online documentation, I hit upon a minor but cool aspect of a VIM feature that
I didn't know before! I must say the documentation is one the finest I've
ever seen in a product -- even better than most commercial products.
(Gautam Mudunuri)
VIM 4.5 is really a fantastic editor. It has sooooo many features and more
importantly, the defaults are so well thought out that you really don't have
to change anything!! Words cannot express my amazement and gratitude to the
creators of VIM. Keep it up. (Vikas, USA)
I wonder how long it will be before people will refer to other Vi editors as
VIM clones? (Darren Hiebert)
I read about [auto-positioning-in-file-based-on-the-errors-from-make] in one
of those "Perfect Programmer's Editor" threads and was delighted to discover
that VIM already supports it. (Brendan Macmillan, Australia)
I just discovered VIM (5.0) and I'm telling everyone I know about it!
I tell them VIM stands for VI for the new (M)illenium. Thanks so much!
(Matt F. Valentine)
I think from now on "vi" should be called "Vim Imitation", not the other way
around. (Rungun Ramanathan)
The Law of VIM:
For each member b of the possible behaviour space B of program P, there exists
a finite time t before which at least one user u in the total user space U of
program P will request b becomes a member of the allowed behaviour space B'
(B' <= B).
In other words: Sooner or later everyone wants everything as an option.
(Negri)
Whenever I move to a new computing platform, the first thing I do is to port
VIM. Lately, I am simply stunned by its ease of compilation using the
configure facility. (A.M. Sabuncu, Turkey)
The options are really excellent and very powerful. (Anish Maharaj)
The Spring user-interface designs are in, and word from the boutiques is that
80x24 text-only mode is back with a *vengeance! Vi editor clone VIM burst onto
March desk-tops with a dazzling show of pastel syntax highlights for its 5.0
look. Strident and customizable, VIM raises eyebrows with its interpretation
of the classic Vi single-key macro collection.
http://www.ntk.net/index.cgi?back=archive98/now0327.txt&line=179#l
I just wanted to take this opportunity to let you know that VIM 5 ROCKS!
Syntax highlighting: how did I survive without it?! Thank you for creating
mankind's best editor! (Mun Johl, USA)
Thanks again for VIM. I use it every day on Linux. (Eric Foster-Johnson,
author of the book "UNIX Programming Tools")
The BEST EDITOR EVER (Stuart Woolford)
I have used most of VIM's fancy features at least once, many frequently, and I
can honestly say that I couldn't live with anything less anymore. My
productivity has easily doubled compared to what it was when I used vi.
(Sitaram Chamarty)
I luv VIM. It is incredible. I'm naming my first-born Vimberly. (Jose
Unpingco, USA)
Hint: "VIM" is "vi improved" - much better! (Sven Guckes, Germany)
I use VIM every day. I spend more time in VIM than in any other program...
It's the best vi clone there is. I think it's great. (Craig Sanders,
Australia)
I strongly advise using VIM--its infinite undo/redo saved me much grief.
(Terry Brown)
Thanks very much for writing what in my opinion is the finest text editor on
the planet. If I were to get another cat, I would name it "Vim".
(Bob Sheehan, USA)
I typed :set all and the screen FILLED up with options. A whole screen of
things to be set and unset. I saw some of my old friends like wrapmargin,
modelines and showmode, but the screen was FILLED with new friends! I love
them all! I love VIM! I'm so happy that I've found this editor! I feel
like how I once felt when I started using vi after a couple of years of using
ed. I never thought I'd forsake my beloved ed, but vi ... oh god, vi was
great. And now, VIM. (Peter Jay Salzman, USA)
I am really happy with such a wonderful software package. Much better than
almost any expensive, off the shelf program. (Jeff Walker)
Whenever I reread the VIM documentation I'm overcome with excitement at the
power of the editor. (William Edward Webber, Australia)
Hurrah for VIM!! It is "at your fingertips" like vi, and has the extensions
that vi sorely needs: highlighting for executing commands on blocks, an easily
navigable and digestible help screen, and more. (Paul Pax)
The reason WHY I don't have this amazingly useful macro anymore, is that I
now use VIM - and this is built in!! (Stephen Riehm, Germany)
I am a user of VIM and I love it. I use it to do all my programming, C,
C++, HTML what ever. (Tim Allwine)
I discovered VIM after years of struggling with the original vi, and I just
can't live without it anymore. (Emmanuel Mogenet, USA)
Emacs has not a bit of chance to survive so long as VIM is around. Besides,
it also has the most detailed software documentation I have ever seen---much
better than most commercial software! (Leiming Qian)
This version of VIM will just blow people apart when they discover just how
fantastic it is! (Tony Nugent, Australia)
I took your advice & finally got VIM & I'm really impressed. Instant convert.
(Patrick Killelea, USA)
VIM is by far my favorite piece of shareware and I have been particularly
pleased with version 3.0. This is really a solid piece of work. (Robert
Colon, USA)
VIM is a joy to use, it is so well thought and practical that I wonder why
anybody would use visual development tools. VIM is powerful and elegant, it
looks deceptively simple but is almost as complex as a 747 (especially when I
look at my growing vimrc), keep up that wonderful job, VIM is a centerpiece
of the free software world. (Louis-David Mitterand, USA)
I cannot believe how great it is to use VIM. I think the guys at work are
getting tired of hearing me bragging about it. Others eyes are lighting up.
(Rick Croote)
Emacs takes way too much time to start up and run, it is too big and bulky for
effective use and the interface is more confusing than it is of any help. VIM
however is short, it is fast, it is powerful, it has a good interface and it
is all purpose. (Paal Ditlefsen Ekran)
From the first time I got VIM3.0, I was very enthusiastic. It has almost no
problems. The swapfile handling and the backup possibilities are robust, also
the protection against editing one file twice. It is very compatible to the
real VI (and that is a MUST, because my brain is trained over years in using
it). (Gert van Antwerpen, Holland)
Visual mode in VIM is a very powerful thing! (Tony Nugent, Australia)
I have to say that VIM is =THE= single greatest piece of source code to ever
come across the net (Jim Battle, USA).
In fact, if you do want to get a new vi I'd suggest VIM-3.0. This is, by
far, the best version of vi I've ever seen (Albert W. Schueller).
I should mention that VIM is a very good editor and can compete with anything
(Ilya Beloozerov).
To tell the truth sometimes I used elvis, vile, xvi, calvin, etc. And this is
the reason that I can state that VIM is the best! (Ferenc Deak, Hungary)
VIM is by far the best editor that I have used in a long time, and I have
looked at just about every thing that is available for every platform that I
use. VIM is the best on all of them. (Guy L. Oliver)
VIM is the greatest editor since the stone chisel. (Jose Unpingco, USA)
I would like to say that with VIM I am finally making the 'emacs to vi'
transition - as an Editor it is so much better in many ways: keyboard layout,
memory usage, text alteration to name 3. (Mark Adam)
In fact, now if I want to know what a particular setting does in vi, I fire up
VIM and check out its help! (Nikhil Patel, USA)
As a vi user, VIM has made working with text a far more pleasant task than
before I encountered this program. (Steinar Knutsen, Norway)
I use VIM since version 3.0. Since that time, it is the ONLY editor I use,
with Solaris, Linux and OS/2 Warp. I suggest all my friends to use VIM, they
try, and they continue using it. VIM is really the best software I have ever
downloaded from the Internet, and the best editor I know of. (Marco
Eccettuato, Italy)
In summary:
__ ___ _ _ _ ___ _____ `
\ \ / (_)_ __ ___ (_)___ | | | |/ _ \_ _| `
\ \ / /| | '_ ` _ \ | / __| | |_| | | | || | `
\ V / | | | | | | | | \__ \ | _ | |_| || | `
\_/ |_|_| |_| |_| |_|___/ |_| |_|\___/ |_| `
____ _____ _ _ _____ _____ _ _ `
/ ___|_ _| | | | ___| ___| | | `
\___ \ | | | | | | |_ | |_ | | | `
___) || | | |_| | _| | _| |_|_| `
|____/ |_| \___/|_| |_| (_|_) (Tony Nugent, Australia) `
vim:tw=78:ts=8:ft=help:norl:

View File

@ -16,8 +16,8 @@ Nvim support for remote plugins *remote-plugin*
Extensibility is a primary goal of Nvim. Any programming language may be used
to extend Nvim without changes to Nvim itself. This is achieved with remote
plugins, coprocesses that have a direct communication channel (via
|msgpack-rpc|) with the Nvim process.
plugins, coprocesses that have a direct communication channel (via |RPC|) with
the Nvim process.
Even though these plugins run in separate processes they can call, be called,
and receive events just as if the plugin's code were executed in the main
@ -33,9 +33,9 @@ check whether a plugin host is available for their chosen programming language.
Plugin hosts are programs that provide a high-level environment for plugins,
taking care of most boilerplate involved in defining commands, autocmds, and
functions that are implemented over |msgpack-rpc| connections. Hosts are
loaded only when one of their registered plugins require it, keeping Nvim's
startup as fast as possible, even if many plugins/hosts are installed.
functions that are implemented over |RPC| connections. Hosts are loaded only
when one of their registered plugins require it, keeping Nvim's startup as
fast as possible, even if many plugins/hosts are installed.
==============================================================================
3. Example *remote-plugin-example*
@ -95,20 +95,20 @@ handler function are ignored.
To test the above plugin, it must be saved in "rplugin/python" in a
'runtimepath' directory (~/.config/nvim/rplugin/python/limit.py for example).
Then, the remote plugin manifest must be generated with
`:UpdateRemotePlugins`.
|:UpdateRemotePlugins|.
==============================================================================
4. Remote plugin manifest *remote-plugin-manifest*
*:UpdateRemotePlugins*
Just installing remote plugins to "rplugin/{host}" isn't enough for them to be
automatically loaded when required. You must execute `:UpdateRemotePlugins`
automatically loaded when required. You must execute |:UpdateRemotePlugins|
every time a remote plugin is installed, updated, or deleted.
`:UpdateRemotePlugins` generates the remote plugin manifest, a special
|:UpdateRemotePlugins| generates the remote plugin manifest, a special
Vimscript file containing declarations for all Vimscript entities
(commands/autocommands/functions) defined by all remote plugins, with each
entity associated with the host and plugin path. The manifest is a generated
extension to the user's vimrc (it even has the vimrc filename prepended).
entity associated with the host and plugin path.
Manifest declarations are just calls to the `remote#host#RegisterPlugin`
function, which takes care of bootstrapping the host as soon as the declared
@ -125,10 +125,20 @@ the example, say the Java plugin is a semantic completion engine for Java code.
If it defines the autocommand "BufEnter *.java", then the Java host is spawned
only when Nvim loads a buffer matching "*.java".
If the explicit call to `:UpdateRemotePlugins` seems incovenient, try to see it
If the explicit call to |:UpdateRemotePlugins| seems incovenient, try to see it
like this: It's a way to provide IDE capabilities in Nvim while still keeping
it fast and lightweight for general use. It's also analogous to the |:helptags|
command.
*$NVIM_RPLUGIN_MANIFEST*
Unless $NVIM_RPLUGIN_MANIFEST is set the manifest will be written to a file
named `rplugin.vim` at:
Unix ~
$XDG_DATA_HOME/nvim/ or ~/.local/share/nvim/
Windows ~
$LOCALAPPDATA/nvim/ or ~/AppData/Local/nvim/
==============================================================================
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