Compare commits

...

7814 Commits

Author SHA1 Message Date
8a6bb66e80 NVIM v0.3.6
FIXES:
4553fc5e6c #10082 vim-patch:8.1.1365: :source should check sandbox

OTHER:
877d539904 #10027 genappimage.sh: migrate to linuxdeploy
2019-05-29 00:34:46 +02:00
4553fc5e6c vim-patch:8.1.1365: :source should check sandbox #10082
Problem:    Source command doesn't check for the sandbox. (Armin Razmjou)
Solution:   Check for the sandbox when sourcing a file.
5357552140
2019-05-29 00:33:22 +02:00
877d539904 genappimage.sh: migrate to linuxdeploy #10027
generate_type2_appimage is unmaintained, and lacks a way to rename the appimage file.

fix #9893
2019-05-18 21:34:37 +02:00
60c3c92db1 release.sh 2019-04-28 22:19:18 +02:00
d7cf93ce34 version bump 2019-04-28 22:12:54 +02:00
1060bfd033 NVIM v0.3.5
Maintenance release to fix issues found in v0.3.4.

FIXES:

f891131c6b #9894 options: properly reset directories on 'autochdir'
9a5488c2a6 Remove MSVC optimization workaround for SHM_ALL
1793ba8176 Make SHM_ALL to a variable instead of a compound literal #define
947069ba14 doc: mention "pynvim" module rename
46c7e12f27 #9629 screen: don't crash when drawing popupmenu with 'rightleft' option
f1843c0035 vim-patch:8.1.0677: look-behind match may use the wrong line number
1204421888 #8325 :terminal : set topline based on window height
aaa8c3d711 #9504 :recover : Fix crash on non-existent *.swp
2019-04-28 22:10:12 +02:00
f891131c6b options: properly reset directories on 'autochdir' (#9894)
Fixes https://github.com/neovim/neovim/issues/9892
2019-04-15 21:04:16 +02:00
9a5488c2a6 Remove MSVC optimization workaround for SHM_ALL 2019-04-12 02:44:35 +02:00
1793ba8176 Make SHM_ALL to a variable instead of a compound literal #define
gcc-9 has [improved compliance] with the C spec for lifetime of compound
literals, tying their lifetime to block scope instead of function scope.
This makes the behavior comparable to all other automatic variables.

Using the SHM_ALL #define instantiated a compound literal local to an if
clause and assigned the address to a "char_u *".  Since the pointer was
then being used outside of the if clause, it was using an invalid
address.

[improved compliance]: https://gcc.gnu.org/gcc-9/porting_to.html#complit

Closes #9855
2019-04-12 02:43:59 +02:00
947069ba14 doc: mention "pynvim" module rename
closes #9764
2019-03-26 23:07:04 +01:00
46c7e12f27 Merge pull request #9629 from bfredl/pumfix
screen: don't crash when drawing popupmenu with 'rightleft' option
2019-02-19 19:30:35 +01:00
b98be54148 screen: don't crash when drawing popupmenu with 'rightleft' option 2019-02-19 17:46:21 +01:00
f1843c0035 vim-patch:8.1.0677: look-behind match may use the wrong line number
crash reported in #9584

Problem:    Look-behind match may use the wrong line number. (Dominique Pelle)
Solution:   Use the line number in regsave instead of the one in behind_pos,
            we may be looking at the previous line. (closes vim/vim#3749)
866f355814
2019-02-07 22:43:38 +01:00
1204421888 :terminal : set topline based on window height #8325 2019-02-06 04:12:14 +01:00
aaa8c3d711 :recover : Fix crash on non-existent *.swp #9504
Reverts d2944e6a29. mf_open() _can_ fail if the file does not exist.

closes #9503
closes #9504
2019-01-15 00:49:11 +01:00
7b7266430c version bump 2019-01-13 14:29:45 +01:00
ab2bbbf6c4 NVIM v0.3.4
This maintenance release fixes some issues found in v0.3.3.

FIXES:

8a7b6200fb #9487 provider: improve error message if provider is missing
44ea903ca5 #9468 checkhealth: detect broken pip
b4028056fa Windows: nvim-qt v0.2.12 (fix potential "blank screen" at startup)
2019-01-13 14:25:08 +01:00
7523eb3ce4 Merge #9495 from justinmk/release-0.3
release candidate 0.3.4
2019-01-13 02:33:47 +01:00
8a7b6200fb provider: improve error message if provider is missing (#9487)
Move `has_eval_provider()` check to `eval_call_provider()` to make sure that
every code path calls it first.

Previously we would, when pynvim was missing, get a nice error message for
`:python3 1`, but not for `:py3file blah`.

Fixes https://github.com/neovim/neovim/issues/9485
2019-01-13 01:49:07 +01:00
44ea903ca5 checkhealth: detect broken pip #9468 2019-01-13 01:48:32 +01:00
b4028056fa win/dist: nvim-qt v0.2.12 2019-01-13 01:27:36 +01:00
daad3a5a79 version bump 2019-01-04 20:09:26 +01:00
2ccc716c4a NVIM v0.3.3
This maintenance release fixes some issues found in v0.3.2 .

FIXES:

a597ab8d1b #9442 Merge pull request from jamessan/revert-pynvim
    d7b3ac029c health/provider: Check for available pynvim when neovim module missing
    edeb19d5e9 python#CheckForModule: Use the given module string instead of hard-coding pynvim
    0dd89cda9c {health,provider}/python: Import the neovim, rather than pynvim, module
fc6e8a4db8 #9423 TUI: Konsole DECSCUSR fixup
2019-01-04 20:05:23 +01:00
4e23f3e180 release.sh: Format issue-numbers in descriptions [ci skip] 2019-01-04 20:05:08 +01:00
8b3113ce7a release.sh: fix exclusion pattern [ci skip]
grep support of "\s" pattern is unreliable.
2019-01-04 20:05:08 +01:00
a597ab8d1b Merge pull request #9442 from jamessan/revert-pynvim
Rework Python provider/health check to use neovim module again
2019-01-02 12:14:29 -05:00
d7b3ac029c health/provider: Check for available pynvim when neovim module missing
Adapt the checks so we can still report when the pynvim module is
present but the neovim module is missing.
2019-01-01 20:38:28 -05:00
60e3cf6247 Merge pull request #9439 from jamessan/more-fragile-tests
Mark a few more functionaltests as fragile
2019-01-01 16:07:10 -05:00
edeb19d5e9 python#CheckForModule: Use the given module string instead of hard-coding pynvim 2019-01-01 16:06:37 -05:00
0dd89cda9c {health,provider}/python: Import the neovim, rather than pynvim, module
The neovim module is available for backwards compatibility.  We should
not yet force the use of the pynvim module, since there's no other major
reason to bump the minimum supported Python client module.

Closes #9426
2019-01-01 14:15:31 -05:00
fc6e8a4db8 Merge pull request #9435 from jamessan/tui-konsole
TUI: Konsole DECSCUSR fixup (#9423)
2019-01-01 13:28:05 -05:00
2fbe28bc05 Mark "shell command :! throttles shell-command output greater than ~10KB" fragile 2019-01-01 11:27:52 -05:00
b5de158fdf Mark "feeding large chunks of input with <Paste>" fragile 2019-01-01 11:27:23 -05:00
e53e56d5e5 Mark ":substitute with inccommand during :terminal activity" fragile 2019-01-01 11:26:56 -05:00
f3260129ad TUI: Konsole DECSCUSR fixup (#9423)
Apparently Konsole's terminfo is still broken.

ref #9364
closes #9420
2019-01-01 11:18:46 -05:00
340d853585 Merge pull request #9433 from jamessan/only-lint-master
travis: Only run lint job for master branch/PRs
2019-01-01 09:23:37 -05:00
57e0a578f0 travis: Only run lint job for master branch/PRs 2019-01-01 09:15:51 -05:00
83fca0ab13 travis: Run ci for release-* branches 2019-01-01 08:14:54 -05:00
fb815bd7b7 version bump 2019-01-01 08:10:13 -05:00
4dd3fc4ca9 NVIM v0.3.2
Besides the "visible" improvements, this release features numerous
internal improvements to the UI/screen code and test infrastructure.

Numerous patches were merged from Vim, which are not mentioned below.

FEATURES:

07ad5d71ab clipboard: Support custom VimL functions #9304
725da1feeb #9401 win/TUI: Improve terminal/console support
7a8dadbedb #9077 startup: Use $XDG_CONFIG_DIRS/nvim/sysinit.vim if it exists
feec926633 #9299 support <cmd> mapping in more places
0653ed63a5 #9028 diff/highlight: Show underline for low-priority CursorLine
bddcbbb571 signs: Add "numhl" argument #9113
05f9c7c2f7 clipboard: support Wayland (#9230)
14ae394532 #9052 TUI: add support for undercurl and underline color
4fa3492a6f #9023 man.vim: soft (dynamic) wrap #9023

API:

8b39e4ec79 #6920 API: implement object namespaces
b1aaa0a881 API: Implement nvim_win_set_buf() #9100
8de87c7b1c #8180 API: virtual text annotations (nvim_buf_set_virtual_text)
2b9fc9a13f #8660 API: add nvim_buf_is_loaded()
    API: buf_get_lines, buf_line_count handle unloaded buffers
88f77c28e5 API: nvim_buf_get_offset_for_line
94841e5eae API/UI: #8221 ext_newgrid, ext_hlstate
    (use line-based rather than char-based updates)

UI

b5cfac0894 #8806 TUI: use BCE again more often, (smoother resizes/scrolling)
77b5e9ae25 #9315 screen: add missing status redraw when redraw_later(CLEAR) was used
5f15788dc3 TUI: clip invalid regions on resize (#8779), fixes #8774
c936ae0f36 #9193 TUI: improvements for scrolling and clearing
f20427451e #9143 UI: disable clearing almost everywhere
f4b2b66661 #9079 TUI: always use safe cursor movement after resize
d36afafc8d #9211 ui_options: also send when starting or from OptionSet
67f80d485c TUI: Avoid reset_cursor_color in old VTE #9191
e55ebae373 #9021 don't erase screen on `:hi Normal` during startup
c5790d9189 #8915 TUI: Hint wrapped lines to terminals.

FIXES:

231de72539 RPC: turn errors from async calls into notifications
907ad921bc TUI: Restore terminal title via "title stacking" (#9407)
cb76a8a95f genappimage: Unset $ARGV0 at invocation #9376
b48efd9ba7 #9347 TUI: FreeBSD: Improve support for BSD vt console
c16529afa5 TUI: Konsole 18.07.70 supports DECSCUSR (#9364)
aec096fc5b os/lang: use the correct LC_NUMERIC also for OS X
5fee0be915 provider: improve error message (#9344)
3c42d7a10a TUI: alacritty supports set_cursor_color #9353
7bff9a5de8 TUI: Alacritty supports DECSCUSR (#9048)
57acfceabe macOS: infer primary language if $LANG is empty #9345
bc132ae123 runtime/syntax: Fix highlighting of augroup contents (#9328)
715fdfee1e #9297 VimL/confirm(): Show dialog even if :silent
799d9c3215 clipboard: Prefer xclip (#9302)
6dae7776ed provider/nodejs: fix npm,yarn detection
16bc1e9c17 #9218 channel: avoid buffering output when only terminal and no callbacks are active
72fecad1ff #8804 Fix crash in lang_init() on macOS if lang_region = NULL
d581398779 ruby: detect rbenv shims for other versions (#8733)
e568ac7a68 #9123 third-party/unibilium: Fix parsing of extended capability entries
c4c74c3883 jobstart(): Fix hang on non-executable cwd #9204
1cf50cbfd9 provider/nodejs: Simultaneously query npm and yarn #9054
6c496db4b7 undo: Fix infinite loop if undo_read_byte returns EOF #2880
f8f83579ff #9034 'swapfile: always show dialog'

CHANGES:

c236e80cf3 #9024 --embed: wait for UI unless --headless
180b50dddc #9248 python: 'neovim' module was renamed to 'pynvim'
2000b6a64a #8589 VimL: Remove legacy aliases "v:errmsg", "v:shell_error", "v:this_session"
deb18a050e defaults: background=dark #2894 (#9205)
c1187d4af0 defaults: win: 'shellpipe' for cmd.exe (#8827)
2018-12-31 01:06:17 +01:00
f8eae37a36 version.c: update [ci skip] (#9417) 2018-12-31 00:32:32 +01:00
82a92308c5 version.c: update [ci skip] (#9275)
vim-patch:8.0.0428: git and hg see new files after running tests
vim-patch:8.0.0429: options test does not always test everything
vim-patch:8.0.0430: options test fails or hangs on MS-Windows
vim-patch:8.0.0436: running the options test sometimes resizes the terminal
vim-patch:8.0.0488: running tests leaves an "xxx" file behind
vim-patch:8.0.0585: test_options fails when run in the GUI

vim-patch:8.1.0558: some MS-Windows instructions are outdated
vim-patch:8.1.0565: asan complains about reading before allocated block
vim-patch:8.1.0566: SGR not enabled for mintty because $TERM is "xterm"
vim-patch:8.1.0567: error for NUL byte in ScreenLines goes unnoticed
vim-patch:8.1.0568: error message for NUL byte in ScreenLines breaks Travis CI
vim-patch:8.1.0577: tabpage right-click menu never shows "Close tab"
vim-patch:8.1.0578: cannot disable arabic, rightleft and farsi in configure
vim-patch:8.1.0587: GvimExt: realloc() failing is not handled properly
vim-patch:8.1.0589: compilation error in gvimext.cpp
vim-patch:8.1.0592: the libvterm tests are not run as part of Vim tests
vim-patch:8.1.0593: illegal memory access in libvterm test
vim-patch:8.1.0594: libvterm tests fail to run on Mac
vim-patch:8.1.0595: libvterm tests are not run with coverage
vim-patch:8.1.0597: cannot run test_libvterm from the top directory
vim-patch:8.1.0598: indent tests may use the wrong Vim binary
vim-patch:8.1.0605: running make in the top directory echoes a comment 
vim-patch:8.1.0606: 'cryptmethod' defaults to a very old method
vim-patch:8.1.0607: proto files are not in sync with the source code
vim-patch:8.1.0608: coverals is not updating
vim-patch:8.1.0609: MS-Windows: unused variable, depending on the Ruby version
vim-patch:8.1.0610: MS-Windows ctags file list differs from Unix
vim-patch:8.1.0616: NSIS installer is outdated
vim-patch:8.1.0617: NSIS installer gets two files from the wrong directory
vim-patch:8.1.0620: overuling CONF_ARGS from the environment no longer works
vim-patch:8.1.0624: overuling CONF_ARGS from the environment still does not work
vim-patch:8.1.0628: Compiler warning on MS-Windows.
vim-patch:8.1.0635: Coverity complains about null pointer use
vim-patch:8.1.0637: nsis file no longer used
vim-patch:8.1.0646: cannot build with Ruby 2.6.0
2018-12-31 00:20:28 +01:00
725da1feeb Merge #9401 from justinmk/pr-win-erw7 2018-12-30 23:54:23 +01:00
92806827a9 appimage: Include metadata #9320
closes #9320
closes #9128
2018-12-30 23:02:40 +01:00
1e8d2bdc48 Merge #9335 from justinmk/doc 2018-12-30 21:17:18 +01:00
a10fdc70aa syntax/vim.vim: highlight <cmd> key 2018-12-30 21:09:39 +01:00
e83c0a267d help: Do not highlight "Nvim."
This was added in 549311db7d for some reason, it usually just looks
weird.
2018-12-30 21:09:39 +01:00
e834660b2b doc: Remove {Nvim} tag
The purpose of the {Nvim} hint was not well-defined, and its usage
inconsistent.  It's also unnecessary.

Nvim-Vim differences are centralized at:
    :help vim-differences
Removed things are centralized at:
    :help deprecated
Developer guidelines for documentation are listed at:
    :help dev-doc
2018-12-30 21:09:39 +01:00
4ba8266ab1 doc
- CMake features
2018-12-30 21:09:39 +01:00
5749ecaf22 win/TUI: ConEmu: get back_color_erase from terminfo
We already set back_color_erase in our builtin terminfo
(terminfo_defs.h:conemu_terminfo), so we don't need to set it explicitly
in patch_terminfo_bugs().
2018-12-30 20:21:37 +01:00
9ca836f893 cleanup: Remove os_term_is_nice() 2018-12-30 19:57:50 +01:00
31a508cf6c refactor: Extract os_tty_guess_term()
- Also remove feature-detection of uv_set_vterm_state(): instead, on
  Windows we always require libuv to have that function.
2018-12-30 19:57:50 +01:00
fa5182489a Merge pull request #9411 from jamessan/vim-8.1.0662
vim-patch:8.1.0662: needlessly searching for tilde in string
2018-12-30 10:05:12 -05:00
1e06c235b8 vim-patch:8.1.0662: needlessly searching for tilde in string
Problem:    Needlessly searching for tilde in string.
Solution:   Only check the first character. (James McCoy, closes vim/vim#3734)
ef0a1d5ed3
2018-12-30 09:02:35 -05:00
d442345729 Merge pull request #9409 from jamessan/vim-8.0.1469
[RFC] vim-patch:8.0.1469,8.0.1734,8.1.0353,8.1.0354
2018-12-29 20:18:36 -05:00
bebbf08c8c vim-patch:8.1.0354: packadd test fails on MS-Windows
Problem:    Packadd test fails on MS-Windows.
Solution:   Ignore difference between forward and backward slashes.
53c8a478cc
2018-12-29 16:53:09 -05:00
ce4199e8b0 vim-patch:8.1.0353: an "after" directory of a package is appended to 'rtp'
Problem:    An "after" directory of a package is appended to 'rtp', which
            will be after the user's "after" directory. ()
Solution:   Insert the package "after" directory before any other "after"
            directory in 'rtp'. (closes vim/vim#3409)
99396d4cbf
2018-12-29 16:52:25 -05:00
91f40ff284 vim-patch:8.0.1734: package directory not added to 'rtp' if prefix matches
Problem:    Package directory not added to 'rtp' if prefix matches.
Solution:   Check the match is a full match. (Ozaki Kiichi, closes vim/vim#2817)
            Also handle different ways of spelling a path.
f98a39ca57
2018-12-29 12:57:16 -05:00
e09fb6ee53 vim-patch:8.0.1469: when package path is a symlink 'runtimepath' is wrong
Problem:    When package path is a symlink adding it to 'runtimepath' happens
            at the end.
Solution:   Do not resolve symlinks before locating the position in
            'runtimepath'. (Ozaki Kiichi, closes vim/vim#2604)
2374faae11
2018-12-29 11:46:21 -05:00
907ad921bc TUI: enter/exit alternate screen with "title stacking" (#9407)
Works in iTerm2 and xterm.

- patch_terminfo_bugs(): Add title-stacking sequences (\e[22t and
  \e[23t) to the overrides for iTerm2 and xterm.
- Note: the builtins (terminfo_defs.h) for `iterm_256colour_terminfo`
  and `xterm_256colour_terminfo` already include the sequences.

Test case (title should be "foo" after the final :q):

   TERM=iterm2 nvim -u NONE +'set title titleold=foo'
   :q
   TERM=iterm2 nvim -u NONE +'set title titlestring=zub'
   :q

closes #4063
2018-12-29 03:30:51 +01:00
dba69a1d3b update_terminfo.sh: NOLINT data arrays 2018-12-28 23:52:03 +01:00
959df5d8a5 update_terminfo.sh: Use printf instead of echo 2018-12-28 23:52:03 +01:00
4a7f6dafe9 Merge #9383 from jamessan/stdpath-rplugin
Use stdpath() to determine rplugin manifest path
2018-12-28 15:01:41 +01:00
135991712a rplugin.vim: Add migration support for Windows, nvim/ -> nvim-data/ 2018-12-27 21:07:28 -05:00
e85b911f02 test: win/TUI builtin terminfos 2018-12-28 01:46:25 +01:00
c1015121ec Merge 'upstream/master' into pr-win-erw7 2018-12-27 22:49:44 +01:00
4f030ec24e win/TUI: Fix scroll on Windows legacy console 2018-12-27 22:45:47 +01:00
fad7a26bc5 win/TUI: ConEmu: set immediate_wrap_after_last_column #9094 2018-12-27 22:42:55 +01:00
6c62f7b715 win/TUI: builtin terminfos for cygwin, conemu, et al. 2018-12-27 22:39:54 +01:00
6060301558 win/TUI: SetConsoleMode() to override libuv #9094
Use uv_set_vterm_state() to override libuv's guess.
See https://github.com/libuv/libuv/pull/1873/ for discussion.

This commit uses a terminal-detection approach based on
GetProcessImageFileNameW(...), which will be reverted in the following
commit. The approach was intended to handle the case of running in
winpty (:terminal), but we will add $NVIM env var for that.

Also add some support for ConEmu, cygwin.
2018-12-27 22:35:59 +01:00
e1876c7ad1 Merge pull request #9398 from janlazo/mac-brew-addon 2018-12-27 19:27:36 +01:00
a9b1937e5a ci: install neovim gem on macOS
High Sierra has ruby 2.3 preinstalled so neovim gem should work.
2018-12-27 09:44:54 -05:00
c926ba1dc4 ci: use homebrew addon to simplify shell scripts 2018-12-26 11:55:29 -05:00
9ac1e2db79 Merge pull request #9394 from bfredl/highsign
make vim_snprintf handle %d correctly again, fix ":sign place" output
2018-12-24 10:59:24 +01:00
357e59982d strings: make vim_snprintf handle %d correctly again
This was broken in #9369 (4680ca2)
2018-12-24 10:58:48 +01:00
e9685d9f70 vim-patch:8.1.0627: Python cannot handle function name of script-local function (#9392)
Problem:    Python cannot handle function name of script-local function.
Solution:   Use <SNR> instead of the special byte code. (Ozaki Kiichi, closes
            vim/vim#3681)
9123c0b31a
2018-12-23 13:12:59 +01:00
d2352b7b51 vim-patch:8.1.0615: get_tv function names are not consistent (#9386)
Problem:    Get_tv function names are not consistent.
Solution:   Rename to tv_get.
d155d7a851

Only a change in comments appears to be necessary.
2018-12-22 13:23:01 +01:00
05d8a46ec4 Merge pull request #9384 from bfredl/ui_option_check
test/api: verify that UI options from stable metadata are preserved
2018-12-21 14:23:35 +01:00
ac53536de1 CI/Travis: skip all refs except "master" [skip ci] 2018-12-21 11:48:32 +01:00
cf9a0799c9 CI/Travis: skip "stable" tag [skip ci] 2018-12-21 11:19:34 +01:00
8b41f429bb test/api: verify that UI options from stable metadata are preserved 2018-12-21 10:52:25 +01:00
04c382b2ac win/dist: nvim-qt v0.2.11 #9382 2018-12-21 09:38:52 +01:00
15cc17521e Use stdpath() to determine rplugin manifest path 2018-12-20 21:40:05 -05:00
87b40f7445 Merge #9280 'Lua 5.2+ compatbility' 2018-12-20 18:32:54 +01:00
127b8569e6 lint 2018-12-20 11:57:30 +01:00
221f6fffad runtime/lua/vim/compat.lua
ref #9280
Introduce the `vim.compat` module, to help environments with system Lua
5.2+ run the build/tests. Include the module implicitly in all tests.

ref #8677
legacy `vim` module:
    beep
    buffer
    command
    dict
    eval
    firstline
    lastline
    line
    list
    open
    type
    window
2018-12-20 11:57:30 +01:00
e6d0dea42b test: Lua 5.2/5.3 compat #9280
Make the code run both on Lua 5.1 (which is the default for Neovim, and
is what LuaJIT provides) and Lua 5.2+.
2018-12-20 11:57:30 +01:00
ccb005b9e0 Merge #9369 'vim-patch:8.1.0596' 2018-12-19 06:42:42 +01:00
cb76a8a95f genappimage: Unset $ARGV0 at invocation #9376
AppImage sets $ARGV0 which breaks zsh.
Hack around this in our appimage.

fixes #9341
ref https://github.com/AppImage/AppImageKit/issues/852

[ci skip]
2018-12-19 06:30:58 +01:00
1ff7b83d3c l10n: Update Ukrainian translation #9377 2018-12-19 06:02:31 +01:00
4680ca29f1 strings: use (u)int16_t for %h printf format 2018-12-16 14:52:14 -05:00
ae6848cd12 vim-patch:8.1.0596: not all parts of printf() are tested
Problem:    Not all parts of printf() are tested.
Solution:   Add a few more test cases. (Dominique Pelle, closes vim/vim#3691)
21e551cce2
2018-12-16 14:48:30 -05:00
7a8dadbedb Merge pull request #9077 from jamessan/xdg-sysinit
startup: Use $XDG_CONFIG_DIRS/nvim/sysinit.vim if it exists
2018-12-16 13:20:54 -05:00
314f6ea367 startup: Use $XDG_CONFIG_DIRS/nvim/sysinit.vim if it exists
Closes #8994
2018-12-16 12:05:47 -05:00
b48efd9ba7 Merge #9347 from justinmk/tui-bsd
TUI: detect BSD vt console
2018-12-16 14:28:17 +01:00
cffe2d4642 CI/AppVeyor: install "pynvim" python package #9371 2018-12-16 10:47:59 +01:00
3f55010cda TUI: TERM=nsterm
Treat TERM=nsterm the same way in augment_terminfo() and
patch_terminfo_bugs().

ref #9244 463d28cc80
2018-12-16 07:07:24 +01:00
ab7da4c531 TUI: detect BSD vt console
FreeBSD console sets TERM=xterm, but it does not support xterm features
like cursor-shaping. GUI terminals typically set TERM=xterm-256color, so
on FreeBSD we can guess that TERM=xterm is the degraded vt.

OpenBSD console sets TERM=vt220
https://github.com/openbsd/src/blob/master/etc/etc.amd64/ttys

NetBSD console sets TERM=vt100
https://github.com/NetBSD/src/blob/trunk/etc/etc.amd64/ttys

closes #8644
2018-12-16 07:04:02 +01:00
5e8f2048b5 Merge #9367 'vim-patch:8.1.{585,588}' 2018-12-15 14:24:17 +01:00
2aba5569a1 Merge pull request #9368 from bfredl/doublewrap
TUI: handle wrap of doublewidth chars correctly
2018-12-15 12:54:06 +01:00
8fb1fce694 TUI: handle wrap of doublewidth chars correctly 2018-12-15 09:54:25 +01:00
845973c9fe vim-patch:8.1.0588: cannot define a sign with space in the text
Problem:    Cannot define a sign with space in the text.
Solution:   Allow for escaping characters. (Ben Jackson, closes vim/vim#2967)
06b056e110
2018-12-14 22:51:12 -05:00
bcc9b9335c vim-patch:8.1.0585: undo test may fail on MS-Windows
Problem:    Undo test may fail on MS-Windows.
Solution:   Also handle lower case drive letters.
56242f2b08
2018-12-14 22:41:59 -05:00
c16529afa5 TUI: Konsole 18.07.70 supports DECSCUSR (#9364)
ref b0d3d83eca

KONSOLE_VERSION is exported as a numeric string (after removing the dots
from the version string).

ref #8300
closes #6778
closes #6798
2018-12-14 22:54:39 +01:00
aec096fc5b Merge pull request #9362 from bfredl/macnumlocale
os/lang: use the correct LC_NUMERIC also for OS X
2018-12-13 18:23:23 +01:00
7ba52c0b2b os/lang: use the correct LC_NUMERIC also for OS X 2018-12-13 17:07:12 +01:00
1cca5da05f Merge #9348 from janlazo/vim-8.0.1748
vim-patch:8.0.1748
2018-12-13 02:46:12 +01:00
af368981a7 Merge #9355 from mhinz/ruby-provider-path
provider: make :ruby provider check use same code path as :python
2018-12-13 02:40:54 +01:00
4157f4c72d ex_docmd: '/' is not a path for Cmdline* events
Code from https://github.com/neovim/neovim/pull/9348#issuecomment-446416118

autocmd_fname_full was removed in 82cd0be2ea
but Vim uses this hack for <afile> on CmdlineEnter and related events
in vim-patch:8.0.1748.
Port the hack by not treating "/" as a path for <afile> on these events.
2018-12-12 19:15:05 -05:00
0930435fc3 vim-patch:8.0.1748: CmdlineEnter command uses backslash instead of slash
Problem:    CmdlineEnter command uses backslash instead of slash.
Solution:   Don't treat the character as a file name. (closes vim/vim#2837)
a4baf5b325
2018-12-12 19:14:16 -05:00
315769ae6d test: :ruby reports E319 if provider is missing 2018-12-12 22:11:00 +01:00
5062d8e0dd provider: make :ruby provider check use same code path as :python
Prior to this change, the provider check for ruby was special-cased and now it
returns E319, like :python etc.

References #9354
2018-12-12 21:59:02 +01:00
2f3a18695e Merge pull request #7946 from bfredl/vim-8.0.1445
implement CmdlineChanged: vim-patch:8.0.1445 + nvim specific v:event stuff
2018-12-12 21:40:10 +01:00
5f82889be7 cmdline: support v:event in CmdlineChanged 2018-12-12 15:31:52 +01:00
6c602be33a vim-patch:8.0.1445: cannot act on edits in the command line
Problem:    Cannot act on edits in the command line.
Solution:   Add the CmdlineChanged autocommand event. (xtal8, closes vim/vim#2603,
            closes vim/vim#2524)

153b704e20
2018-12-12 10:25:36 +01:00
b9a441eb78 Merge #9354 from justinmk/provider-E319
provider: repurpose E319
2018-12-12 02:38:08 +01:00
61d0dfee32 provider: repurpose E319
In Vim (and some vestigial parts of Nvim) E319 was a placeholder for
ex_ni commands, i.e. commands that are only available in certain builds
of Vim.  That is obviously counter to Nvim's goals: all Nvim commands
are available on all platforms and build types (the remaining ex_ni
commands are actually just missing providers).

We need an error id for "missing provider", so it makes sense to use
E319 for that purpose.

ref #9344
ref #3577
2018-12-12 01:26:21 +01:00
2b01c3a8a8 ex_cmds: Remove various "not implemented" commands
Commands related to Netbeans, Sun Workshop, and GUI shims, were
intentionally removed and will not be implemented.
2018-12-11 23:53:27 +01:00
5fee0be915 provider: improve error message (#9344)
Executing `:python`, and similar commands that rely on `eval_call_provider()`,
while the accompanying provider it not available, leads to this error message:

    E117: Unknown function: provider#python#Call

This doesn't say much to a user. Since we introduced `:checkhealth` for this
very reason, we now point to it for further diagnosis.

Fixes #3577
2018-12-11 23:43:35 +01:00
3c42d7a10a TUI: alacritty supports set_cursor_color #9353
Feature was added in:
https://github.com/jwilm/alacritty/pull/757

closes #9353
2018-12-11 22:49:16 +01:00
57acfceabe macOS: infer primary language if $LANG is empty #9345
The macOS preferences have a section called `Language & Region`. There is always
at least one language defined, the primary language.

CFLocaleCopyPreferredLanguages() returns the languages defined in that section,
the first element being the primary language.

Use the primary language in case CFLocaleCopyCurrent() returns NULL.

In the case that the above fallback does not work either, which is very
unlikely, log the error and continue with an empty $LANG.

References #9134
2018-12-11 21:58:35 +01:00
5a90761e8a Merge pull request #9351 from bfredl/clear_attr
TUI: don't use BCE with attributes affecting background
2018-12-11 18:58:07 +01:00
ca1de71a3e TUI: don't use BCE with attributes affecting background 2018-12-11 17:20:19 +01:00
55c5185884 vim-patch:8.1.0574: 'commentstring', fold marker in C (#9339)
Problem:    'commentstring' not used when adding fold marker in C.
Solution:   Require white space before middle comment part. (mostly by
            Hirohito Higashi)
4af7259b2b
2018-12-10 03:11:56 +01:00
20620bae76 Merge #9306 'vim-patch: integrate xdiff library'
closes #1466
closes #1007
closes #1391
2018-12-09 23:07:28 +01:00
4e29810817 vim-patch:8.1.0562: parsing of 'diffopt' is slightly wrong
Problem:    Parsing of 'diffopt' is slightly wrong.
Solution:   Fix the parsing and add a test. (Jason Franklin, Christian
            Brabandt)

b6fc72851c
2018-12-09 22:19:41 +02:00
f273e43cb8 vim-patch:8.1.0513: no error for set diffopt+=algorithm:
Problem:    No error for set diffopt+=algorithm:.
Solution:   Check for missing argument. (Hirohito Higashi, closes #3598)

d0721058f4
2018-12-09 22:19:41 +02:00
89eba72792 vim-patch:8.1.0502: internal diff fails when diffing a context diff
Problem:    Internal diff fails when diffing a context diff. (Hirohito Higashi)
Solution:   Only use callback calls with one line. (closes #3581)

f080d70a82
2018-12-09 22:19:41 +02:00
8f20c22e10 vim-patch:8.1.0497: :%diffput changes order of lines
Problem:    :%diffput changes order of lines. (Markus Braun)
Solution:   Do adjust marks when using internal diff.

5f57bdcab7
2018-12-09 20:05:53 +02:00
e104228b1c vim-patch:8.1.0458: ml_get error and crash when using "do"
Problem:    Ml_get error and crash when using "do".
Solution:   Adjust cursor position also when diffupdate is not needed.
            (Hirohito Higashi)

df77cef92e
2018-12-09 19:55:08 +02:00
fe0114ec41 vim-patch:8.1.0402: the DiffUpdate event isn't triggered for :diffput
Problem:    The DiffUpdate event isn't triggered for :diffput.
Solution:   Also trigger DiffUpdate for :diffget and :diffput.

198fa066b2
2018-12-09 19:45:56 +02:00
271249a48a vim-patch:8.1.0400: using freed memory with :diffget
Problem:    Using freed memory with :diffget.
Solution:   Skip ex_diffupdate() while updating diffs. (closes #3442)

d2b58c0a2c
2018-12-09 19:45:56 +02:00
2c92a4d0c8 vim-patch:8.1.0397: no event triggered after updating diffs
Problem:    No event triggered after updating diffs.
Solution:   Add the DiffUpdated event.

e8fa05b5bc
2018-12-09 19:45:56 +02:00
b7f2c7dd1d vim-patch:8.1.0395: compiler warning on 64-bit MS-Windows
Problem:    Compiler warning on 64-bit MS-Windows.
Solution:   Add type cast. (Mike Williams)

6e272acc82
2018-12-09 19:45:56 +02:00
7b6c92eac1 vim-patch:8.1.0394: diffs are not always updated correctly
Problem:    Diffs are not always updated correctly.
Solution:   When using internal diff update for any changes properly.

e3521d9cbb
2018-12-09 19:45:56 +02:00
972ad11195 vim-patch:8.1.0393: not all white space difference options available
Problem:    Not all white space difference options available.
Solution:   Add "iblank", "iwhiteall" and "iwhiteeol" to 'diffopt'.

785fc6567f
2018-12-09 19:45:56 +02:00
72c5a9db70 vim-patch:8.1.0375: cannot use diff mode with Cygwin diff.exe
Problem:    Cannot use diff mode with Cygwin diff.exe. (Igor Forca)
Solution:   Skip over unrecognized lines in the diff output.

3b8defd0a5
2018-12-09 19:45:56 +02:00
cf1ffa9166 vim-patch:8.1.0360: using an external diff program is slow and inflexible
Problem:    Using an external diff program is slow and inflexible.
Solution:   Include the xdiff library. (Christian Brabandt)
            Use it by default.

e828b7621c

vim-patch:8.1.0360
vim-patch:8.1.0364
vim-patch:8.1.0366
vim-patch:8.1.0370
vim-patch:8.1.0377
vim-patch:8.1.0378
vim-patch:8.1.0381
vim-patch:8.1.0396
vim-patch:8.1.0432
2018-12-09 19:45:56 +02:00
67c5bc1ac0 Calm down the clinter 2018-12-09 08:07:59 +02:00
857a7312d0 doc (#9288)
- misc
- doc: `:help config`. closes #9329
- cleanup test/README.md
2018-12-09 01:31:34 +01:00
f1eb25f0c4 vim-patch:8.1.0570: 'commentstring' not used when adding fold marker (#9331)
Problem:    'commentstring' not used when adding fold marker. (Maxim Kim)
Solution:   Only use empty 'comments' middle when leader is empty. (Christian
            Brabandt, closes vim/vim#3670)
539328197c
2018-12-08 14:21:49 +01:00
bd97577954 Merge #9322 from janlazo/vim-8.1.0563
vim-patch:8.1.{563,564}
2018-12-08 01:20:21 +01:00
bc132ae123 runtime/syntax: Fix highlighting of augroup contents (#9328)
Comparing `vimCommand` from Vim's runtime/syntax/vim.vim, one can see
that "augroup" and similar commands are conspicuously missing. They are
handled specially (`vimAugroupKey`, `vimAutoCmd`).

Excluding them from the generated `vimCommand` keyword list, fixes their
highlighting.

closes #9327
2018-12-08 01:16:58 +01:00
8b9f6103bd CI/Travis: install gperf using package manager (#9325)
Install gperf using package manager instead of building it from source.
When building/installing gperf from source, its install step requires
`texi2pdf` which randomly goes missing on Travis:

    cd doc; /usr/bin/make install
    make[1]: Entering directory '/home/travis/nvim-deps/build/src/gperf/doc'
    cd . && rm -f gperf.aux gperf.toc gperf.cp gperf.fn gperf.ky gperf.pg gperf.tp gperf.vr gperf.log gperf.cps
    cd . && texi2pdf gperf.texi
    /bin/sh: 1: texi2pdf: not found

It's nice to test the "bundled" deps on Travis, but that gets enough
exercise on Windows and macOS, which are the platforms that actually
need "bundled" gperf.
2018-12-07 20:09:44 +01:00
b93670174e Merge pull request #9324 from bfredl/virtfix
api: make nvim_set_virtual_text use correct namespace counter
2018-12-07 18:49:00 +01:00
b4a04fd80c api: make nvim_buf_set_virtual_text use correct namespace counter 2018-12-07 17:31:05 +01:00
f177005447 vim-patch:8.1.0564: setting v:errors to wrong type still possible
Problem:    Setting v:errors to wrong type still possible.
Solution:   Return after giving an error message. (Christian Brabandt)
88b53fd052
2018-12-06 23:24:09 -05:00
4c4997e988 vim-patch:8.1.0563: setting v:errors to a string give confusing error
Problem:    Setting v:errors to a string give confusing error. (Christian
            Brabandt)
Solution:   Change internal error into normal error message.
74ea88c170
2018-12-06 23:21:49 -05:00
7697628345 vim-patch:8.0.1425: execute() does not work in completion of user command (#9317)
Problem:    execute() does not work in completion of user command. (thinca)
Solution:   Switch off redir_off and restore it. (Ozaki Kiichi, closes vim/vim#2492)
2095148277
2018-12-06 01:14:19 +01:00
77b5e9ae25 Merge pull request #9315 from bfredl/clear_status
screen: add missing status redraw when <c-l> was used
2018-12-05 11:54:46 +01:00
f1ce9b3be2 screen: add missing status redraw when redraw_later(CLEAR) was used 2018-12-05 10:57:43 +01:00
e509576e53 provider/lang: expand() g:foo_host_prog (#9312)
Before this commit, if user does this:
    let g:node_host_prog = '~/.nvm/versions/node/v11.3.0/bin/neovim-node-host'
the "~/" is not expanded to user's home directory.

`:help g:ruby_host_prog` suggests a path with "~/" so technically we
already claimed to support this.

closes https://github.com/neovim/node-client/issues/102
2018-12-05 00:11:28 +01:00
c07e48a900 vim-patch:8.1.0559: command line completion not sufficiently tested (#9310)
Problem:    Command line completion not sufficiently tested.
Solution:   Add more tests. (Dominique Pelle, closes vim/vim#3622)
b513d3079b
2018-12-04 21:39:18 +01:00
d207440f1e clipboard: Revert unused check #9309
PR #9304 added support for functions in clipboard providers. As part of
the PR I meant to move two checks in the provider code out of an if
statement into separate statements and adding additional checks for
g:clipboard attributes - as it turns out the code is wrong and it does
not implement additional checks while it adds two conditions that make
very little sense

    type(g:clipboard['copy']) #isnot# v:t_func

what would make sense would be something along the lines of

    type(g:clipboard['copy']['+']) #isnot# v:t_func

but might not be what we want either, so I'm reverting this.
2018-12-04 21:38:20 +01:00
abd32c1bb8 vim-patch:8.1.0559: command line completion not sufficiently tested
Problem:    Command line completion not sufficiently tested.
Solution:   Add more tests. (Dominique Pelle, closes vim/vim#3622)
b513d3079b
2018-12-03 22:48:27 -05:00
7e97587dae Merge pull request #9307 from jamessan/codecov-threshold
codecov: Tolerate a 1% drop in coverage for a PR
2018-12-03 11:22:48 -05:00
231de72539 Merge pull request #9300 from bfredl/asyncerr
rpc: fix invalid responses, turn errors from async calls into notifications
2018-12-03 13:00:41 +01:00
8b42249cdd RPC: turn errors from async calls into notifications
Previously, nvim sent a response with invalid request id (UINT64_MAX).
In functionaltests, catch unexpected error notifications in after_each().
2018-12-03 10:42:00 +01:00
131897c16b codecov: Tolerate a 1% drop in coverage for a PR 2018-12-02 23:10:58 -05:00
07ad5d71ab clipboard: Support custom VimL functions #9304
Up to now g:clipboard["copy"] only supported string values invoked as
system commands.

This commit enables the use of VimL functions instead. The function
signatures are the same as in provider/clipboard.vim. A clipboard
provider is expected to store and return a list of lines (i.e. the text)
and a register type (as seen in setreg()).

cache_enabled is ignored if "copy" is provided by a VimL function.
2018-12-03 00:07:08 +01:00
b19403e73e Merge #9291 'vim-patch:8.1.{550,551}' 2018-12-02 23:10:26 +01:00
109a792e25 Merge pull request #9303 from jamessan/cmp-0075
Unset CMAKE_REQUIRED_* after they're done being used
2018-12-01 19:39:23 -05:00
b14b2883e9 cmake: Update comment on why CMP0059 is still set to OLD 2018-12-01 17:56:03 -05:00
bb94895d52 Unset CMAKE_REQUIRED_* after they're done being used
As of CMake 3.12, check_include_files() also link the check executable
against the libraries listed in CMAKE_REQUIRED_LIBRARIES.  Therefore we
should unset the CMAKE_REQUIRED_* variables after each respective use to
avoid them unnecessarily bleeding into other checks.
2018-12-01 15:28:33 -05:00
799d9c3215 clipboard: Prefer xclip (#9302)
The order was swapped in #4150 to prefer `xsel` but there wasn't a clear
explanation.  Meanwhile, `xsel` has been neglected upstream.

Let's trying preferring `xclip` again, we've had a few reports of
problems with `xsel`.

closes #7237
ref #5853
ref #7449
2018-12-01 18:50:26 +01:00
715fdfee1e Merge #9297 from justinmk/confirm-dialog 2018-12-01 17:02:49 +01:00
30940f809b doc: deprecate inputdialog()
input() is functionally equivalent. GUI support for dialogs is implicit
and does not depend on choosing inputdialog() vs input().
2018-12-01 16:06:01 +01:00
0f00f31cbd VimL/confirm(): Show dialog even if :silent
closes #8788
related #9034
2018-12-01 16:06:01 +01:00
feec926633 Merge pull request #9299 from bfredl/ctrlx_cmd
insert: make <cmd> mapping work in completion (CTRL-X) mode
2018-12-01 14:02:08 +01:00
2271b10a8e insert: make <cmd> mapping work in completion (CTRL-X) mode 2018-12-01 10:37:46 +01:00
471129792c fixup: 30 col resize to scroll debug 2018-12-01 01:56:22 -05:00
5c3488c937 fixup: 35 col resize to scroll screen 2018-12-01 00:15:11 -05:00
2479004c13 functionaltests: vim-patch:8.1.{550,551} fix 2018-11-30 23:35:36 -05:00
f59ba0fad0 vim-patch:8.1.0551: expression evaluation may repeat an error message
Problem:    Expression evaluation may repeat an error message. (Jason
            Franklin)
Solution:   Check for the value of did_emsg when giving an error
            for the :execute command.
8ff5af9544
2018-11-30 23:35:36 -05:00
5de5507ea6 vim-patch:8.1.0550: expression evaluation may repeat an error message
Problem:    Expression evaluation may repeat an error message. (Jason
            Franklin)
Solution:   Increment did_emsg and check for the value when giving an error
            for the echo command.
76a6345433
2018-11-30 23:35:36 -05:00
a9e368a705 vim-patch:8.1.0553: it is not easy to edit a script that was sourced (#9298)
Problem:    It is not easy to edit a script that was sourced.
Solution:   Add a count to ":scriptnames", so that ":script 40" edits the
            script with script ID 40.
07dc18ffa4
2018-12-01 04:43:08 +01:00
0ce880083d test/macOS: adjust time-sensitive tests
From test_timers.vim:
    Found errors in Test_paused():
    First run:
    function RunTheTest[35]..Test_paused line 20: Expected range 0 - 100, but got 123
    Second run:
    function RunTheTest[35]..Test_paused line 20: Expected range 0 - 100, but got 106

previously: #9220

- Timer tests are less reliable on Travis CI macOS 10.12/10.13.
  ref #6829
  ref e39dade80b
  ref de13113dc1
  ref https://github.com/neovim/neovim/pull/9095#issuecomment-429603452
  > We don't guarantee that a X ms timer is triggered during Y ms sleep
  > for any X<Y, though I would expect the load to be really bad for this
  > to happen with X=10ms, Y=40ms.
2018-11-30 22:22:05 +01:00
32a30d90b4 highlight: Fix missing .rgb_sp_color in initializers (#9287)
terminal_get_line_attributes() had this bug for a long time, though it
likely had no effect visible to users.

ref #9028
ref 60f845ca55
2018-11-30 21:13:01 +01:00
b0ebf61d37 test: adjust time-sensitive tests
From test_alot.vim:
    Found errors in Test_lambda_with_timer():
    First run:
    function RunTheTest[35]..Test_lambda_with_timer line 19: Expected True but got 0
    Second run:
    function RunTheTest[35]..Test_lambda_with_timer line 19: Expected True but got 0

previously: #9220

- Timer tests are less reliable on Travis CI macOS 10.12/10.13.
  ref #6829
  ref e39dade80b
  ref de13113dc1
  ref https://github.com/neovim/neovim/pull/9095#issuecomment-429603452
  > We don't guarantee that a X ms timer is triggered during Y ms sleep
  > for any X<Y, though I would expect the load to be really bad for this
  > to happen with X=10ms, Y=40ms.
- Call test_garbagecollect_now(), as Vim does.
2018-11-30 05:25:20 +01:00
bd32d8cf95 Merge pull request #9289 from bfredl/nsclear
API: rename nvim_buf_clear_highlight to nvim_buf_clear_namespace
2018-11-29 17:47:48 +01:00
32405de7df API: rename nvim_buf_clear_highlight to nvim_buf_clear_namespace
We want a single function to clear all namespaced buffer objects. This
will later include extmarks.
2018-11-29 15:15:04 +01:00
5a752c97d5 vim-patch:8.1.0098: segfault when pattern with \z() is very slow (#9283)
Problem:    Segfault when pattern with \z() is very slow.
Solution:   Check for NULL regprog.  Add "nfa_fail" to test_override() to be
            able to test this.  Fix that 'searchhl' resets called_emsg.
bcf9442307

closes #8788
2018-11-29 01:51:26 +01:00
98eaf60a98 TUI: set_underline_color: only support colon form #9279
Fixes https://github.com/neovim/neovim/issues/9270

---
Background info per egmontkob:
https://github.com/neovim/neovim/issues/9270#issuecomment-441979176

For undercurl, the newly invented escape sequence is `4:3` strictly with
a colon, as with a semicolon it means single underlined and italic.

For colored underline, the newly invented escape sequence `58:...` is
meant to follow the pattern of `38` and `48`. [ITU
T.416](https://www.itu.int/rec/T-REC-T.416-199303-I/en) § 13.1.8 clearly
specifies the colon only as the separator (and the well-known ECMA-48
§ 8.3.117 just points to this standard).

Using semicolon instead was/is a frequent misinterpretation of this
standard, and is commonly used in the wild – for 38 and 48. More and
more emulators are catching up and beginning to support colon, in
addition to semicolon. Semicolon is pretty fragile; in case an emulator
doesn't recognize a sequence (let's say doesn't recognize the new
extension of `58`), subsequent numbers are interpreted as other
attributes. E.g. if 256-color mode is chosen then the next numeric
parameter is `5` which turns on blinking.

So, luckily, the standard is the technically better solution, the
frequent practice of using semicolons is technically the worse.
Therefore the direction we should be going is clear.

I believe it's a fair requirement for anyone adopting colored underline
to support colons too, and it's a reasonable move from applications to
slightly push the world forward, force developers to catch up with the
recent changes, that is: 1) recognize and at least ignore
colon-delimited parameters even if they aren't supported, 2) recognize
and support colon wherever they support the nonstandard semicolon
instead.

Should you come across any terminal emulator that supports 58 with
semicolons but not with colons, I think the cleanest you can do is
report a bug against them and ignore the problem; they should fix it.

It's yet another common misunderstanding that the truecolor syntax is
`38`/`48`/`58` followed by `:2:rrr:ggg:bbb`. The wording of T.416 is
terrible, but if you read carefully, there's another parameter of
color-space-id preceding the three color channels. Assuming you don't
care about color-space-id, the syntax is `38`/`48`/`58` followed by
`:2::rrr:ggg:bbb` and of course the trailing `m`.

This is only for true-color, the 256-color format doesn't have such
a parameter, it's `38`/`48`/`58` followed by `:5:index` and the final
`m`.
2018-11-29 00:35:29 +01:00
0d1e5ec1b8 Merge #9221 from justinmk/doc 2018-11-28 03:49:17 +01:00
452cadb85a scripts/gen_help_html.py
Adapted from https://github.com/c4rlo/vimhelp/
License: MIT
2018-11-28 03:48:06 +01:00
67305ffb5d lint: src/.clang-format
Move to top level so that

    clang-format -style=file

can find it regardless of current directory.
2018-11-28 03:48:06 +01:00
519224f6bd matchit.vim: s:MultiMatch(): return Dict 2018-11-28 03:48:06 +01:00
30857030e8 doc
- develop.txt is for design/guidelines; architecture/concepts should
  live elsewhere (currently src/nvim/README.md)
- move dev-jargon to intro.txt
- replace https://neovim.io/community (deprecated) with
  https://neovim.io/#chat
- <Cmd> avoids CmdlineEnter/Leave
  https://github.com/vim/vim/issues/2889
2018-11-28 03:48:06 +01:00
cf631aaed0 diff/highlight: Fix GUI highlight for low-priority CursorLine (#9281)
ref #9028
ref 0653ed63a5
2018-11-28 03:23:10 +01:00
3348eea429 Merge pull request #9278 from liushapku/master
fix wrong winnr in getwininfo (issue: #9277)
2018-11-26 22:59:03 -05:00
3ec5351fd1 fix wrong winnr in getwininfo 2018-11-27 10:30:41 +08:00
0653ed63a5 Merge #9028 'diff/highlight: low-priority CursorLine' 2018-11-27 02:26:24 +01:00
7fdb45e0f8 preserve_exit: Ignore SIGHUP
closes #9274
ref #9028

If stdin closed then read_error_exit calls preserve_exit. Handling
SIGHUP during preserve_exit would cause a premature teardown, and
conflicts with e.g. ui_bridge_stop which waits for TUI to teardown.

Vim ignores SIGHUP in its prepare_to_exit and getout_preserve_modified
routines:

    /* Ignore SIGHUP, because a dropped connection causes a read error, which
     * makes Vim exit and then handling SIGHUP causes various reentrance
     * problems. */
    signal(SIGHUP, SIG_IGN);
2018-11-27 01:14:55 +01:00
60f845ca55 diff/highlight: Show underline for low-priority CursorLine 2018-11-27 01:14:55 +01:00
3283db4ecb diff/highlight: do not overlay low-priority CursorLine
ref #6380
2018-11-27 01:14:55 +01:00
a2d03d9b1a refactor: Rename get_term_attr_entry
Rename get_term_attr_entry to hl_get_term_attr, similar to
hl_get_syn_attr, hl_get_ui_attr.
2018-11-27 01:14:55 +01:00
271c5df416 version.c: update [ci skip] (#9171)
vim-patch:8.0.0350: not enough test coverage for Perl
vim-patch:8.0.1135: W_WINCOL() is always the same
vim-patch:8.0.1280: Python None cannot be converted to a Vim type 
vim-patch:8.0.1308: the "Reading from stdin" message may be undesired
vim-patch:8.0.1338: USE_IM_CONTROL is confusing and incomplete 
vim-patch:8.0.1343: MS-Windows: does not show colored emojis
vim-patch:8.0.1350: cannot build with +eval and -multi_byte 
vim-patch:8.0.1829: MS-Windows: script for vimdiff can't handle ! chars
vim-patch:8.0.1849: compiler warning for unused arguments, missing prototype

vim-patch:8.1.0001: the netrw plugin does not work
vim-patch:8.1.0006: syn_id2cterm_bg() may be undefined
vim-patch:8.1.0012: misplaced #endif
vim-patch:8.1.0021: clang warns for undefined behavior
vim-patch:8.1.0041: attribute "width" missing from python window attribute list
vim-patch:8.1.0051: MS-Windows: missing #endif
vim-patch:8.1.0063: Mac: NSStringPboardType is deprecated
vim-patch:8.1.0075: no Vim logo in README file
vim-patch:8.1.0077: header of README file is not nice
vim-patch:8.1.0079: superfluous space in messages
vim-patch:8.1.0102: cannot build without syntax highlighting
vim-patch:8.1.0104: can't build without the +eval feature
vim-patch:8.1.0109: new po makefile missing from distribution
vim-patch:8.1.0117: URL in install program still points to SourceForge
vim-patch:8.1.0122: translators don't always understand the maintainer message
vim-patch:8.1.0123: MS-Windows: colors are wrong after setting 'notgc'
vim-patch:8.1.0124: has('vcon') returns true even for non-win32 terminal
vim-patch:8.1.0127: build failure when disabling the session feature
vim-patch:8.1.0128: building with MinGW does not work out-of-the-box
vim-patch:8.1.0129: still some xterm-like terminals get a stray "p"
vim-patch:8.1.0137: CI does not run with TCL
vim-patch:8.1.0142: xterm and vt320 builtin termcap missing keypad keys
vim-patch:8.1.0147: compiler warning when building with Python 3.7
vim-patch:8.1.0148: memory leak when using :tcl expr command
vim-patch:8.1.0150: insufficient test coverage for Tcl
vim-patch:8.1.0152: cannot easily run individual tests on MS-Windows
vim-patch:8.1.0153: build with SHADOWDIR fails
vim-patch:8.1.0155: evim.man missing from the distribution
vim-patch:8.1.0157: old iTerm2 is not recognized, resulting in stray output
vim-patch:8.1.0160: no Danish manual translations
vim-patch:8.1.0162: Danish and German man pages are not installed
vim-patch:8.1.0163: insufficient testing for Tcl
vim-patch:8.1.0173: compiler warning on MS-Windows
vim-patch:8.1.0176: overlapping string argument for strcpy()
vim-patch:8.1.0178: warning for passing pointer to non-pointer argument
vim-patch:8.1.0179: redundant condition for boundary check
vim-patch:8.1.0180: static analysis errors in Lua interface
vim-patch:8.1.0183: Lua API changed, breaking the build
vim-patch:8.1.0185: running tests writes lua.vim even though it is not used
vim-patch:8.1.0190: Perl refcounts are wrong
vim-patch:8.1.0191: Perl test fails in 24 line terminal
vim-patch:8.1.0197: Windows GUI: title for search/replace is wrong
vim-patch:8.1.0201: newer Python uses "importlib" instead of "imp"
vim-patch:8.1.0202: :version always shows +packages
vim-patch:8.1.0203: building with Perl 5.28 fails on Windows
vim-patch:8.1.0207: need many menu translation files to cover regions
vim-patch:8.1.0209: stderr output from Ruby messes up display
vim-patch:8.1.0215: no error if configure --with-x cannot configure X
vim-patch:8.1.0217: compiler warning for variable set but not used
vim-patch:8.1.0222: errors are reported for "make install"
vim-patch:8.1.0232: Ruby error does not include backtrace
vim-patch:8.1.0234: incorrect reference counting in Perl interface
vim-patch:8.1.0236: Ruby build fails when ruby_intern is missing
vim-patch:8.1.0237: Ruby on Cygwin doesn't always work
vim-patch:8.1.0239: now Ruby build fails on other systems
vim-patch:8.1.0246: build failure without the +eval feature
vim-patch:8.1.0247: Python: error message for failing import is incorrect
vim-patch:8.1.0249: GTK: when screen DPI changes Vim does not handle it
vim-patch:8.1.0250: MS-Windows using VTP: windows size change incorrect
vim-patch:8.1.0254: cannot build on MS-Windows; unused macro HAVE_HANDLE_DROP
vim-patch:8.1.0260: no LGTM logo in README file
vim-patch:8.1.0287: MAX is not defined everywhere
vim-patch:8.1.0292: MS-Windows: the text "self-installing" confuses some users
vim-patch:8.1.0301: GTK: input method popup displayed on wrong screen.
vim-patch:8.1.0305: missing support for Lua 5.4 32 bits on Unix
vim-patch:8.1.0319: bzero() function prototype doesn't work for Android
vim-patch:8.1.0332: get Gdk-Critical error on first balloon show
vim-patch:8.1.0346: building with Aap is outdated and unused
vim-patch:8.1.0348: on Travis the slowest build is run last
vim-patch:8.1.0357: instructions for tests are outdated
vim-patch:8.1.0368: GTK code has too many #ifdefs and GTK 2.10 building fails
vim-patch:8.1.0379: build dependencies are incomplete
vim-patch:8.1.0380: "make proto" doesn't work well
vim-patch:8.1.0383: missing source file rename
vim-patch:8.1.0385: Coveralls badge doesn't update
vim-patch:8.1.0386: cannot test with non-default option value
vim-patch:8.1.0388: Coverity complains about possible NULL pointer use
vim-patch:8.1.0390: scrollbars are not tested
vim-patch:8.1.0391: building in a shadow directory fails
vim-patch:8.1.0403: header file missing from distribution
vim-patch:8.1.0405: too many #ifdefs for GTK
vim-patch:8.1.0408: MSVC: cannot use the "x64" native compiler option
vim-patch:8.1.0411: renamed file missing from distribution
vim-patch:8.1.0412: cannot build with GTK 2.4
vim-patch:8.1.0413: test output is duplicated or missing
vim-patch:8.1.0415: not actually using 16 colors with vtp
vim-patch:8.1.0418: MS-Windows: cannot separate Lua include and library dirs
vim-patch:8.1.0419: Cygwin: running cproto fails with -O2
vim-patch:8.1.0420: generating vim.lib when using ActivePerl 5.20.3 or later
vim-patch:8.1.0421: MS-Windows: Ruby path is wrong for Ruby 1.9 and later
vim-patch:8.1.0422: cannot create map file with MinGW
vim-patch:8.1.0427: MS-Windows GUI: using invalid encoded file name
vim-patch:8.1.0441: build failure without command line history
vim-patch:8.1.0467: cannot build with Mac OS X 10.5
vim-patch:8.1.0472: dosinst command has a few flaws
vim-patch:8.1.0474: directory where if_perl.c is written is inconsistent
vim-patch:8.1.0477: tiny build fails
vim-patch:8.1.0478: cannot build with perl using MinGW
vim-patch:8.1.0480: MinGW build file uses different -I flags than MVC
vim-patch:8.1.0482: MinGW "make clean" deletes all .exe files
vim-patch:8.1.0483: MinGW does not build tee.exe
vim-patch:8.1.0490: MS-Windows: doesn't handle missing glibwinpthread-1.dll
vim-patch:8.1.0492: "Edit with existing Vim" list can get long
vim-patch:8.1.0500: cleaning up in src/tee may not always work
vim-patch:8.1.0521: cannot build with +eval but without +quickfix
vim-patch:8.1.0534: MS-Windows installer uses different $HOME than Vim
vim-patch:8.1.0541: help message in dosinst.c is outdated

vim-patch:8.1.0485: term_start() does not check if directory is accessible  #9204
2018-11-26 00:29:21 +01:00
b1aaa0a881 API: Implement nvim_win_set_buf() #9100
closes #9100
2018-11-25 16:27:10 +01:00
bac9f36d42 CI/travis: Remove vestigial sudo:true
Travis now defaults to sudo:true, and sudo:false is deprecated.
ref #9258 3a9fd4327a
2018-11-25 13:28:50 +01:00
3a9fd4327a Merge #9258 'CI/travis: switch to Ubuntu 16.04' 2018-11-25 13:04:52 +01:00
2cbac719c3 Downgrade to clang-4.0 to avoid false-positive warnings from clang
* -Wtautological-compare

    error: self-comparison always evaluates to true [-Werror,-Wtautological-compare]
    for (win_T *wp = ((curtab) == curtab) ? firstwin : (curtab)->tp_firstwin; wp != ((void*)0); wp = wp->w_next) {

* -Wconversion

    error: implicit conversion loses floating-point precision: 'const float_T' (aka 'const double') to 'float' [-Werror,-Wconversion]
          do { const float_T flt_ = (tv->vval.v_float); switch ((sizeof (flt_) == sizeof (float) ? __fpclassifyf (flt_) : sizeof (flt_) == sizeof (double) ? __fpclassify (flt_) : __fpclassifyl (flt_))) { case 0: { ga_concat(gap, (char_u *)(char_u *) "str2float('nan')"); break; } case 1: { if (flt_ < 0) { ga_append(gap, '-'); } ga_concat(gap, (char_u *)(char_u *) "str2float('inf')"); break; } default: { char numbuf[NUMBUFLEN]; vim_snprintf(numbuf, ((sizeof(numbuf)/sizeof((numbuf)[0])) / ((size_t)(!(sizeof(numbuf) % sizeof((numbuf)[0]))))), "%g", flt_); ga_concat(gap, (char_u *)(char_u *) numbuf); } } } while (0);
                                                                                                   ~~~~~~~~~~~~~  ^~~~
2018-11-24 22:56:25 +01:00
02d68fbcae Remove extraneous parens to silence -Wparentheses-equality
In file included from ../src/nvim/eval/encode.c:974:
    ../src/nvim/eval/typval_encode.c.h:390:40: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
              do { if ((tv->vval.v_special == kSpecialVarTrue)) { msgpack_pack_true(packer); } else { msgpack_pack_false(packer); } } while (0);
                        ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
2018-11-24 22:56:25 +01:00
fc0aeb5f88 xenial: fix clang error messages
* Remove FUNC_ATTR_NONNULL_ALL from function without pointer arguments.

  Otherwise the ASAN build would complain:

  error: 'nonnull' attribute applied to function with no pointer arguments [-Werror,-Wignored-attributes]
  static void do_autocmd_focusgained(_Bool gained) __attribute__((nonnull));
2018-11-24 22:56:25 +01:00
2f6364ea4b travis: switch from Ubuntu 14.04 to 16.04
Travis is phasing out its support for containers, so we remove the `sudo:
false`, which will be a no-op soon.

Reference: https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration

Changes for Linux:

  - Xenial comes with libtool installed already. It only provides "libtoolize",
    though. For "libtool" we need to install libtool-bin.
2018-11-24 22:56:24 +01:00
8b39e4ec79 Merge pull request #6920 from bfredl/namespace
make namespaces explicit (intitially for bufhl and virttext)
2018-11-24 19:36:04 +01:00
01dbf0951b api: implement object namespaces
Namespaces is a lightweight concept that should be used to group
objects for purposes of bulk operations and introspection. This is
initially used for highlights and virtual text in buffers, and is
planned to also be used for extended marks. There is no plan use them
for privileges or isolation, neither to introduce nanespace-level
options.
2018-11-24 11:01:37 +01:00
108566e7b6 clipboard.vim: check for win32yank.exe #9263
Win32 allows omitting the `.exe` extension, but WSL does not.
2018-11-21 12:24:40 +01:00
684c7d9228 Merge #9261 'vim-patch:8.0.1731,8.1.0038' 2018-11-21 03:51:33 +01:00
5d22d100f2 vim-patch:8.1.0038: popup test causes Vim to exit
Problem:    Popup test causes Vim to exit.
Solution:   Disable the broken part of the test for now.
680c99b2ef
2018-11-20 21:14:50 -05:00
bebd1f9f76 vim-patch:8.0.1731: characters deleted on completion
Problem:    Characters deleted on completion. (Adrià Farrés)
Solution:   Also check the last item for the ORIGINAL_TEXT flag. (Christian
            Brabandt, closes vim/vim#1645)
e87edf3b85
2018-11-20 21:14:50 -05:00
85761dd426 CI/Travis/macOS: Fix "brew reinstall" invocation (#9259)
"-s" is "--build-from-source", an option to `brew install`.  This was
never a documented option per `brew help reinstall`.  It's not clear why
we were using this option, but it now fails the CI build.

ref https://github.com/Homebrew/brew/pull/5274
ref https://github.com/Homebrew/brew/issues/1656
2018-11-20 20:20:11 +01:00
016ebb4185 Merge #9257 'health/python: warn if pynvim upgrade failed'
Reference: https://github.com/neovim/neovim/wiki/Following-HEAD#20181118
2018-11-20 13:15:04 +01:00
f1a787d292 health/python: warn if pynvim upgrade failed
Reference: https://github.com/neovim/neovim/wiki/Following-HEAD#20181118
2018-11-20 11:33:08 +01:00
3e87f5ccf8 Merge #9256 'vim-patch:8.0.{737,1163,1165,1171,1249,1427}' 2018-11-20 11:09:44 +01:00
deb18a050e defaults: background=dark #2894 (#9205)
By historical accident, Nvim defaults to background=light. So on a dark
background, `:colorscheme default` looks completely wrong.

The "smart" logic that Vim uses is confusing for anyone who uses Vim on
multiple platforms, so rather than mimic that, pick the (hopefully) most
common default.

- Since Neovim is dark-powered, we assume most users have dark backgrounds.
- Most of the GUIs tend to have a dark background by default.

ref #6289
2018-11-20 10:52:49 +01:00
57fef7c74d health/python: slightly improve output 2018-11-20 09:59:18 +01:00
443cd04d5b provider/python: refactoring 2018-11-20 09:59:18 +01:00
54a586736b vim-patch:8.0.1171: popup test is still a bit flaky
Problem:    Popup test is still a bit flaky.
Solution:   Change term_wait() calls. (Ozaki Kiichi)
712549e04e
2018-11-19 23:46:38 -05:00
3c228e8935 vim-patch:8.0.1165: popup test is still flaky
Problem:    Popup test is still flaky.
Solution:   Add a term_wait() call. (Ozaki Kiichi)
f52c383156
2018-11-19 23:46:17 -05:00
f1d2297c5e vim-patch:8.0.1163: popup test is flaky
Problem:    Popup test is flaky.
Solution:   Add a WaitFor() and fix another.
c79977a437
2018-11-19 23:45:44 -05:00
fdc2707b41 vim-patch:8.0.1249: no error when WaitFor() gets an invalid wrong expression
Problem:    No error when WaitFor() gets an invalid wrong expression.
Solution:   Do not ignore errors in evaluationg the expression.  Fix places
            where the expression was wrong.
c20e0d5207
2018-11-19 22:32:23 -05:00
e71f43f8e7 vim-patch:8.0.0737: crash when X11 selection is very big
Problem:    Crash when X11 selection is very big.
Solution:   Use static items instead of allocating them.  Add callbacks.
            (Ozaki Kiichi)
cdb7e1b7f9
2018-11-19 21:53:39 -05:00
a5637597a6 vim-patch:8.0.1427: the :leftabove modifier doesn't work for :copen
Problem:    The :leftabove modifier doesn't work for :copen.
Solution:   Respect the split modifier. (Yegappan Lakshmanan, closes vim/vim#2496)
de04654ddc
2018-11-19 21:16:26 -05:00
e53ae88e7e vim-patch:8.1.0398: no test for -o and -O command line arguments (#9253)
Problem:    No test for -o and -O command line arguments.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3438)
8f4499b816
2018-11-19 01:38:51 +01:00
463d28cc80 TUI: support TERM=nsterm (#9244)
`:help $TERM` recommends TERM=nsterm for Terminal.app but we did not
actually support it.

NB: We don't include a builtin term for Terminal.app, presumably because
nsterm is commonly available on most systems (`infocmp nsterm`).
2018-11-18 19:58:41 +01:00
344dd2757a vim-patch:8.1.0536: file time test fails when using NFS (#9251)
Problem:    File time test fails when using NFS.
Solution:   Use three file times instead of localtim(). (James McCoy,
            closes vim/vim#3618)
addc156c38
2018-11-18 18:05:43 +01:00
180b50dddc Merge #9248 from mhinz/checkhealth/python
Rename Python package "neovim" to "pynvim"
2018-11-18 14:29:15 +01:00
00e3ba22fe Merge #9247 'vim-patch:8.1.{258,298,299,318,376}' 2018-11-18 12:35:21 +01:00
f4b4b7c132 lint 2018-11-18 00:30:16 -05:00
65a3d53cb9 vim-patch:8.1.0376: compiler warning for uninitialized variable
Problem:    Compiler warning for uninitialized variable. (Tony Mechelynck)
Solution:   Initialize the variable.
c787539747
2018-11-18 00:18:52 -05:00
eab181a74e vim-patch:8.1.0318: the getftype() test may fail for char devices
Problem:    The getftype() test may fail for char devices if the file
            disappeared in between the listing and the getftype() call.
Solution:   Ignore empty result. (Ozaki Kiichi, closes vim/vim#3360)
3b3a506f57
2018-11-17 22:38:22 -05:00
2b7e58cb2c vim-patch:8.1.0299: misplaced comment
Problem:    misplaced comment
Solution:   Remove comment
142ae736d9
2018-11-17 22:23:30 -05:00
a9ae5bf36b vim-patch:8.1.0298: window resize test sometimes fails on Mac
Problem:    Window resize test sometimes fails on Mac.
Solution:   Add Test_popup_and_window_resize() to flaky tests.
46fad2ef0b
2018-11-17 22:21:25 -05:00
0c2ca48e5f doc/python: 'neovim' module was renamed to 'pynvim' 2018-11-17 17:56:34 +01:00
3ea14d5366 health/python: 'neovim' module was renamed to 'pynvim' 2018-11-17 17:56:34 +01:00
9fe472c91b vim-patch:8.1.0258: not enough testing for the CompleteDone event
Problem:    Not enough testing for the CompleteDone event.
Solution:   Add a test. (closes vim/vim#3297)
af559d2c9f
2018-11-17 08:20:22 -05:00
25356f2802 Merge pull request #9240 from jamessan/mbyte_spec-failure
unit/mbyte_spec: Run utf_char2bytes test in batches of 0xFFF characters
2018-11-15 16:25:29 -05:00
c344f4b6ae unit/mbyte_spec: Run utf_char2bytes test in batches of 0xFFF characters
Running the full 0xFFFF set of tests in one process fails on slower
architectures/when there's CPU contention.
2018-11-15 07:06:37 -05:00
d81b9d5ec5 vim-patch:8.1.0146: when $LANG is set the compiler test may fail (#9238)
Problem:    When $LANG is set the compiler test may fail.
Solution:   Unset $LANG.
f0447e89a5
2018-11-15 11:42:18 +01:00
3295083d5a vim-patch:8.1.0108: no Danish translations (#9235)
Problem:    No Danish translations.
Solution:   Add Danish message translations. (closes vim/vim#3073)  Move list of
            languages to a common makefile.
a4a2934e59
2018-11-15 03:20:07 +01:00
f6ed446817 vim-patch:8.1.0527: using 'shiftwidth' from wrong buffer for folding (#9234)
Problem:    Using 'shiftwidth' from wrong buffer for folding.
Solution:   Use "buf" instead of "curbuf". (Christian Brabandt)
0c27cbcacf
2018-11-15 02:10:05 +01:00
e14fa8569c Merge #9231 'vim-patch:8.1.{115,143,311,352}' 2018-11-14 11:27:17 +01:00
f6c6567cb1 vim-patch:8.1.0352: browsing compressed tar files does not always work
Problem:    Browsing compressed tar files does not always work.
Solution:   Use the "file" command to get the compression type.
d4a1aabe37
2018-11-13 22:33:27 -05:00
9e59fdf5f6 vim-patch:8.1.0311: filtering entries in a quickfix list is not easy
Problem:    Filtering entries in a quickfix list is not easy.
Solution:   Add the cfilter plugin. (Yegappan Lakshmanan)
8c5e0093c9
2018-11-13 21:32:00 -05:00
091ae1e63f vim-patch:8.1.0143: matchit and matchparen don't handle E363
Problem:    Matchit and matchparen don't handle E363.
Solution:   Catch the E363 error. (Christian Brabandt)
3d1d6475f9
2018-11-13 21:15:29 -05:00
24ce4c6233 vim-patch:8.1.0115: the matchparen plugin may throw an error
Problem:    The matchparen plugin may throw an error.
Solution:   Change the skip argument from zero to "0".
b7a5ab112a
2018-11-13 21:13:19 -05:00
05f9c7c2f7 clipboard: support Wayland (#9230)
Fixes #9213
2018-11-13 19:01:37 +01:00
4cc28673ee Merge #9049 from janlazo/vim-8.0.1352 2018-11-12 23:17:03 +01:00
59ded3ef29 vim-patch: add matchit doc
matchit doc is named 'pi_matchit.txt'.
2018-11-12 12:36:40 -05:00
dec38601c5 vim-patch: rename path to check_colors.vim 2018-11-12 12:36:40 -05:00
89621464fc vim-patch: move test_urls.vim out of runtime/
Rename it to check_urls.vim, similar to check-includes.py.
2018-11-12 12:36:40 -05:00
abd5b0c6c3 vim-patch:8.0.1352: dead URLs in the help go unnoticed
Problem:    Dead URLs in the help go unnoticed.
Solution:   Add a script to check URLs in the help files. (Christian Brabandt)
f38c86eb6b
2018-11-12 12:36:40 -05:00
6d8ad78237 Merge #8952 'vim-patch:8.0.1620,8.1.{96,340}' 2018-11-12 18:32:28 +01:00
21824df3c6 lint 2018-11-12 11:12:44 -05:00
8fa7b6c8af vim-patch:8.1.0096: inconsistent use of the word autocommands
Problem:    Inconsistent use of the word autocommands.
Solution:   Don't use auto-commands or "auto commands".
8c55533c6f
2018-11-12 11:11:31 -05:00
42419e5a73 vim-patch:8.0.1620: reading spell file has no good EOF detection
Problem:    Reading spell file has no good EOF detection.
Solution:   Check for EOF at every character read for a length field.
e26e0d2b83
2018-11-12 08:45:03 -05:00
e5046822c9 oldtests: skip Test_spellinfo()
nvim supports only `set encoding=utf8`.
2018-11-12 08:45:03 -05:00
208cdb84a6 vim-patch:8.1.0340: no test for :spellinfo
Problem:    No test for :spellinfo.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3394)
9049b68612
2018-11-12 08:45:03 -05:00
9f3fb66111 vim-patch:8.1.0516: :move command sets 'modified' #9224
Problem:    :move command marks buffer modified when nothing changed.
Solution:   Do not set 'modified'.  Add a test. (Jason Franklin)
ddd1f9183b
2018-11-11 19:13:14 +01:00
c936ae0f36 Merge pull request #9193 from bfredl/scrollstuff
UI/TUI: improvements and cleanups for scrolling and clearing
2018-11-11 10:53:23 +01:00
eb3b73d472 TUI: attrs -> attr_id refactor 2018-11-11 09:54:03 +01:00
520ec3dbfd UI/TUI: improvements and cleanups for scrolling and clearing
- TUI: _never_ rely on BCE for implicit clearing, only explicit commands.
- TUI: use unibi_erase_chars when possible.
- TUI: use end-exclusive ranges for invalid and cleared areas
- screen: scrolling leaves scrolled in aree undefined. This is a
  conservative change, a client assuming the old semantics will still
  behave correctly.
- screen: factor out vsep handling from line drawing. This is needed
  anyway for the multigrid refactor.
- screen: simplifications of win_do_lines
2018-11-11 09:54:03 +01:00
f8639dc99c test: adjust time-sensitive tests (#9220)
- window_split_tab_spec.lua: Put cursor at bottom of :terminal buffer so
  that it follows output.
- inccommand_spec.lua: Increase timeout to allow 2nd retry.
- Timer tests are less reliable on Travis CI macOS 10.12/10.13.
  ref #6829
  ref e39dade80b
  ref de13113dc1
  ref https://github.com/neovim/neovim/pull/9095#issuecomment-429603452
  > We don't guarantee that a X ms timer is triggered during Y ms sleep
  > for any X<Y, though I would expect the load to be really bad for this
  > to happen with X=10ms, Y=40ms.
2018-11-10 11:12:04 +01:00
18435a2534 vim-patch:8.1.0337: :file fails in quickfix command (#9215)
Problem:    :file fails in quickfix command.
Solution:   Allow :file without argument when curbuf_lock is set. (Jason
            Franklin)
379fb76b08
2018-11-09 09:33:28 +01:00
16bc1e9c17 Merge pull request #9218 from bfredl/termbuf
channel: avoid buffering output when only terminal and no callbacks are active
2018-11-08 23:48:34 +01:00
312afd8e2e channel: avoid buffering output when only terminal and no callbacks are active 2018-11-08 19:06:55 +01:00
d36afafc8d Merge pull request #9211 from bfredl/init_options
ui_options: also send when starting in --embed mode
2018-11-08 15:15:36 +01:00
348adbcc7a ui_options: also send when starting or from OptionSet
needed after #9024 to receive options from init.vim
2018-11-08 14:12:54 +01:00
c4c74c3883 jobstart(): Fix hang on non-executable cwd #9204
* os/fs.c: add os_isdir_executable()
* eval.c: fix hang on job start caused by non-executable cwd option
* channel.c: assert cwd is an executable directory
* test: jobstart() produces error when using non-executable cwd
2018-11-07 10:31:25 +01:00
769d164c70 Merge pull request #9206 from janlazo/vim-8.1.0510
vim-patch:8.1.{510,512}
2018-11-06 13:58:22 +01:00
f08869cff2 vim-patch:8.1.0511: ml_get error when calling a function with a range (#9207)
Problem:    ml_get error when calling a function with a range.
Solution:   Don't position the cursor after the last line.
9e353b5265
2018-11-06 13:49:20 +01:00
e0d6894a54 vim-patch:8.1.0512: 'helplang' default is inconsistent for C and C.UTF-8
Problem:    'helplang' default is inconsistent for C and C.UTF-8.
Solution:   Don't accept a value unless it starts with two letters.
389ab7122b
2018-11-05 21:08:23 -05:00
bd6866f90b vim-patch:8.1.0510: filter test fails when $LANG is C.UTF-8
Problem:    Filter test fails when $LANG is C.UTF-8.
Solution:   Set 'helplang' to "en" for any C language. (Christian Brabandt,
            closes vim/vim#3577)
dcd71cbaed
2018-11-05 20:08:47 -05:00
5320eb57df build: relax find_package() version spec
We need a way to say "Lua 5.1.x" is required.
"5.1 EXACT" does not match 5.1.5, so it's useless.

https://github.com/neovim/neovim/pull/9197#discussion_r230962070
2018-11-06 01:48:49 +01:00
1347f36494 Merge #9112 'doc' 2018-11-05 23:10:50 +01:00
b96730bc3b doc: API 2018-11-05 22:45:49 +01:00
72b1ce7f30 doc: fix/remove broken tag references 2018-11-05 22:45:48 +01:00
1bbbd5f0ff build: make helphtml 2018-11-05 22:45:48 +01:00
2ee4ce0639 doc: merge sponsor.txt into intro.txt
Also mention how to donate to Nvim.

closes #8603
2018-11-05 22:45:48 +01:00
f679abef3e runtime: delete rrhelper.vim 2018-11-05 22:45:48 +01:00
4de70f5b95 doc
- update standard-plugin-list. closes #8388
2018-11-05 22:45:48 +01:00
6729774143 doc: manpage
roff/mdoc reference:
http://man7.org/linux/man-pages/man7/groff_mdoc.7.html
2018-11-05 22:45:48 +01:00
6fe740c7ab test/win: window_split_tab_spec: fix retry() 2018-11-05 07:59:14 +01:00
10ef903648 test/win: window_split_tab_spec: increase retry() time
The default timeout of 10s only allows 1 retry.
2018-11-05 03:25:36 +01:00
8086db6302 Merge #9197 2018-11-05 01:15:20 +01:00
2c085257fd CI/AppVeyor: Avoid "warning" which causes non-zero retcode
ErrorActionPreference=stop will fail the script if this warning occurs.

see https://github.com/open62541/open62541/issues/2068
2018-11-05 00:35:54 +01:00
de13113dc1 test/timer_spec: relax lower-bound
Test is unreliable on macOS 10.13.  The lower-bound isn't central to the
purpose of the test, so just relax it.

ref https://github.com/neovim/neovim/pull/9095#issuecomment-429603452

> We don't guarantee that a X ms timer is triggered during Y ms sleep
> for any X<Y, though I would expect the load to be really bad for this
> to happen with X=10ms, Y=40ms.

related: #6829
2018-11-05 00:35:54 +01:00
697176fc3e test/win: retry unreliable SIGWINCH test 2018-11-04 14:24:05 +01:00
377694681c build: dependencies: specify minimum versions 2018-11-04 12:11:37 +01:00
47473b39cb vim-patch:8.1.0508: suspend test fails when run by root (#9196)
Problem:    Suspend test fails when run by root.
Solution:   Accept both '$' and '#' for the prompt. (James McCoy, closes vim/vim#3590)
0f62cf5b33
2018-11-04 11:58:22 +01:00
21fb9b2b08 vim-patch:8.1.0507: .raml files not properly detected (#9195)
Problem:    .raml files not properly detected.
Solution:   Recognize .raml as raml instead of yaml. (closes vim/vim#3594)
da1c11c641
2018-11-04 11:56:34 +01:00
67f80d485c TUI: Avoid reset_cursor_color in old VTE #9191
closes #9089
2018-11-03 21:39:48 +01:00
a6661178aa vim-patch:8.1.0504: when CTRL-C is mapped it triggers InsertLeave (#9192)
Problem:    When CTRL-C is mapped it triggers InsertLeave.
Solution:   Make CTRL-C behave the same way when typed or used in a mapping.
4dbc262764
2018-11-03 12:04:33 +01:00
87d67814e5 Merge #9184 from janlazo/vim-8.0.1758 2018-11-02 09:09:40 +01:00
48398d61e4 Merge pull request #9183 from bfredl/offset2
api: make nvim_buf_get_offset independent on platform option
2018-11-02 08:36:38 +01:00
a9b7debbbc vim-patch:8.0.1766: expanding abbreviation doesn't work
Problem:    Expanding abbreviation doesn't work. (Tooth Pik)
Solution:   Return OK instead of FALSE and FAIL instead of TRUE. (Christian
            Brabandt)
c3c3e69896
2018-11-01 23:20:06 -04:00
44c111e49f vim-patch:8.0.1758: open_line() returns TRUE/FALSE for success/failure
Problem:    open_line() returns TRUE/FALSE for success/failure.
Solution:   Return OK or FAIL.
24a2d7264f
2018-11-01 23:19:25 -04:00
c40f992e10 api: simplify nvim_buf_get_offset function 2018-11-01 22:00:40 +01:00
c45a859171 Merge #7506 'deps: update libuv' 2018-11-01 20:42:20 +01:00
f1b67c3453 test/old: Test_BufReadCmdHelp: generate helptags
Generate helptags before :help.

This only failed in the TSAN build because other builds run the Lua
tests first, which generate the helptags.

closes #8824
2018-11-01 19:17:29 +01:00
88f77c28e5 Merge pull request #9180 from bfredl/offset
api: implement nvim_buf_get_offset_for_line
2018-11-01 17:36:58 +01:00
f5671c8614 win: test: SIGWINCH is noisy #7506 2018-11-01 17:17:07 +01:00
281da0dd59 api: implement nvim_buf_get_offset_for_line
Like line2byte, but works for any buffer, and uses zero-based
indexing (API conventions).
2018-11-01 15:05:05 +01:00
11b438eb66 Merge #8378 from janlazo/win_functional_tests 2018-11-01 10:00:35 +01:00
f9fe903579 vim-patch:8.1.0501: cppcheck warns for using array index before bounds check (#9178)
Problem:    Cppcheck warns for using array index before bounds check.
Solution:   Swap the conditions. (Dominique Pelle)
a9a8e04eab
2018-11-01 09:53:46 +01:00
8480b74010 build/win: LibuvCMakeLists.txt: adapt to moved headers
Headers were moved in v1.21.0
99ae3edf28
2018-11-01 04:35:36 +01:00
8ce3d0174e ci: win: enable powershell's strict mode
Give variables a default value to pass strict mode.
$ErrorActionPreference defines the default behavior
if a powershell command fails.
If it's set to 'stop', then it aborts the script
on the first unresolved error.
This behavior extends to native programs like cmake
but do not depend on it.

https://github.com/PowerShell/PowerShell/issues/3996
2018-10-31 22:57:26 -04:00
9929af47fe ci: win: use Ninja for CMake Generator 2018-10-31 22:56:19 -04:00
7ab0e8c8dd functionaltest: enable job channel test 2018-10-31 22:55:07 -04:00
4abed17496 functionaltest: win: enable shada FileWriteCmd 2018-10-31 22:55:07 -04:00
8e44396794 functionaltest: enable buffered output tests 2018-10-31 22:55:07 -04:00
fe2e7cfdee functionaltest: enable FilterReadPre,FilterReadPost test 2018-10-31 22:55:07 -04:00
bc5fb82c6d functionaltest: win: enable diffput,diffget test 2018-10-31 22:55:07 -04:00
88974c8e66 functionaltests: win: enable gzip test
Close gzip file handles.
2018-10-31 22:54:18 -04:00
fc5dea02b6 deps: update to libuv v1.23.2
Remove libuv-overlapped.patch since UV_OVERLAPPED_PIPE was included in
libuv v1.21.0:
62a0f763a7

Notable changes since v1.12:
- 1.16.0
  - uv_os_getppid(): get parent PID
  - "win,tty: improve SIGWINCH support" (v1.15.0)
- 1.18.0
  - uv_os_getpid()
- 1.19.0
  - Windows: uv_kill() pid 0 now means "current process group", like unix.
    890eedaf59
- 1.20.0
  - unix,spawn: respect user stdio flags for new pipe
    c409b3fcff
2018-11-01 00:10:50 +01:00
b24209dcf5 provider/nodejs: handle missing stdout
ref https://github.com/neovim/neovim/issues/9001#issuecomment-434802234
2018-10-31 20:42:41 +01:00
7d61cdc334 doc: README.md (#9176) 2018-10-31 20:19:58 +01:00
61fccda197 test/old: force "-i viminfo" in $RUN_VIMTEST #9175 (#9175)
Before this change, some tests fail if the user has a local
shada/viminfo in the default $HOME location. For example:

    TEST_FILE=test_marks.res make oldtest

Ostensibly this change should not be necessary, because of this
statement in runtest.vim:

    set viminfo+=nviminfo
2018-10-31 10:23:58 +01:00
0838b00253 test/old: test_startup: fix "-u NONE" arg
Lack of whitespace caused a file named "NONE-u" to be created (because
GetVimCommand() returns a command ending with "-i NONE").
2018-10-30 20:44:30 +01:00
3159cd4503 vim-patch:8.0.1553: find digraph to insert a character #8190
Problem:    Cannot see what digraph is used to insert a character.
Solution:   Show the digraph with the "ga" command. (Christian Brabandt)
5f73ef8d20

close #8190
2018-10-30 19:47:59 +01:00
500345aea2 Merge #9172 from justinmk/vim-d473c8c10126 2018-10-30 01:01:29 +01:00
18ce6c9063 vim-patch:2c64ca1802b2
Update runtime files
2c64ca1802
2018-10-30 00:05:25 +01:00
17c26d0dcf vim-patch:95bafa296ae9
Update runtime files.
95bafa296a
2018-10-30 00:02:22 +01:00
7d2fbb9012 vim-patch:93a1df2c205c
Update runtime files.
93a1df2c20
2018-10-29 23:57:24 +01:00
11bcd48fda vim-patch:20aac6c11269
Update runtime files.
20aac6c112
2018-10-29 23:55:45 +01:00
2c7ed420d9 vim-patch:fc65cabb15d0
Update runtime files.
fc65cabb15

---

vim-patch:8.0.1279: initializing menus can be slow
Problem:    Initializing menus can be slow, especially when there are many
            keymaps, color schemes, etc.
Solution:   Do the globbing for runtime files lazlily. (Ken Takata)
2018-10-29 23:54:15 +01:00
f5406dfe77 Merge #9164 from justinmk/vim-a2a80162deb1
vim-patch: runtime updates
2018-10-29 17:47:27 +01:00
6d1827aebc runtime/optwin.vim: feature-check 'pw' option
Option not implemented yet.
2018-10-29 10:24:01 +01:00
228bc4c416 vim-patch:d473c8c10126
Update runtime files.
d473c8c101
2018-10-29 10:01:44 +01:00
4f67f5ba6e vim-patch:d2855f5454c5
Update runtime files.
d2855f5454
2018-10-29 09:57:24 +01:00
07fdbba9d0 vim-patch:91f84f6e11cd
Update runtime files.
91f84f6e11
2018-10-29 09:55:07 +01:00
877d5c8be7 vim-patch:a9604e614517
Update runtime files.
a9604e6145
2018-10-29 09:50:08 +01:00
d252be36e2 vim-patch:b477af2260d9
Update runtime files.
b477af2260
2018-10-29 09:46:34 +01:00
de682a4f9e vim-patch:fd35811ca528
Update runtime files, add Danish translations.
fd35811ca5
2018-10-29 09:43:50 +01:00
5a022c71e4 vim-patch:6dc819b1299e
Updated runtime and language files.
6dc819b129
2018-10-29 09:39:48 +01:00
884ac81135 vim-patch:675e8d6adb88
Update runtime files.
675e8d6adb

---

NA:
vim-patch:ffd112edc6a8
Fix missing patch number.
ffd112edc6
2018-10-29 09:37:13 +01:00
93a85bdd8a vim-patch:d2f3a8b87873
Update runtime files.
d2f3a8b878
2018-10-29 09:32:29 +01:00
9da951ad47 vim-patch:0b0f0992d46e
Update runtime files.
0b0f0992d4
2018-10-29 09:29:17 +01:00
633ae523f5 vim-patch:2f01889055f1
Runtime file and translation updates.
2f01889055
2018-10-29 09:26:43 +01:00
835161490d vim-patch:7c63fbc46e21
Updated runtime files.
7c63fbc46e
2018-10-29 09:23:30 +01:00
460a52dbbf vim-patch:eb3dc87f0139
Updated runtime files
eb3dc87f01
2018-10-29 09:22:31 +01:00
bee8a0ae8c vim-patch:7db25fed5de1
Update runtime files.
7db25fed5d
2018-10-29 09:21:00 +01:00
c05b0d8ec7 vim-patch:85eee130f44a
Update runtime files.
85eee130f4
2018-10-29 09:17:43 +01:00
875a1bcf0a vim-patch:15142e27aaaf
Update runtime files and translations
15142e27aa
2018-10-29 09:17:35 +01:00
9ef01272b2 vim-patch:7dda86f2ff35
Update runtime files.
7dda86f2ff
2018-10-29 08:30:39 +01:00
a1e822fbc6 vim-patch:51ad4eaa22e1
Update runtime files
51ad4eaa22

---

NA:
vim-patch:6176697203b0
2018-10-29 08:26:47 +01:00
e2fb230c3a vim-patch:ab943431d8fc
Update runtime files
ab943431d8
2018-10-29 06:50:47 +01:00
5c4a421735 vim-patch:98ef233e14fa
Update runtime files. Convert a couple of help files to utf-8.
98ef233e14
2018-10-29 06:44:02 +01:00
c7513368f0 vim-patch:b5b7562475ad
Update runtime files.
b5b7562475

---

NA patch (Nvim does not ship with spell files):
vim-patch:3ad8772ef02e
Include Serbian spell input files
3ad8772ef0
2018-10-29 06:38:10 +01:00
fb8f822d9c Merge #9015 2018-10-29 06:17:29 +01:00
17a5dde8d3 vim-patch:22f1d0e35eb0
Updated runtime files.

Add Serbian translations and spell checking.
22f1d0e35e
2018-10-28 14:18:21 +01:00
733b4ce033 vim-patch:7254067ee970
Update runtime files.
7254067ee9
2018-10-28 14:07:58 +01:00
1a51524ad5 vim-patch:40962ec9c0e7
Update runtime files.
40962ec9c0
2018-10-28 14:05:14 +01:00
8d743d02f2 vim-patch:df980db69b83
update a few runtime files
df980db69b

Note: omit hl-Terminal, Nvim has its own way of highlighting :terminal.
2018-10-28 14:01:46 +01:00
dae1213e57 vim-patch:f0b03c4e98f8
Update runtime files
f0b03c4e98

Note: haskell changes were included in 942f3587c3
2018-10-28 13:57:08 +01:00
b9a6df58cc vim-patch:4697399e8c80
move netrw back to the previous version
4697399e8c
2018-10-28 13:50:36 +01:00
f29c2fc4a8 vim-patch:461fe50fea24
patch 8.0.1367: terminal test hangs, executing abcde

Problem:    terminal test hangs, executing abcde. (Stucki)
Solution:   Rename abcde to abxde.
461fe50fea
2018-10-28 13:48:54 +01:00
542513fd8a vim-patch:a2a80162deb1
Update runtime files.
a2a80162de
2018-10-28 13:48:02 +01:00
cf93b5e9f9 version.c: update [ci skip] (#9162) 2018-10-28 13:09:10 +01:00
b659841570 version.c: update [ci skip] #8474
close #8474

vim-patch:8.0.0264: memory error reported by ubsan
vim-patch:8.0.0340: not checking return valud of dict_add()
vim-patch:8.0.0346: Vim relies on limits.h to be included indirectly
vim-patch:8.0.0361: GUI initialisation is not sufficiently tested
vim-patch:8.0.0365: might free a dict item that wasn't allocated
vim-patch:8.0.0367: types in include files may be inconsistent
vim-patch:8.0.0369: a few options are not defined, depending on features
vim-patch:8.0.0372: more options are not always defined
vim-patch:8.0.0386: tiny build has a problem with generating the options test
vim-patch:8.0.0392: GUI test fails with Athena and Motif
vim-patch:8.0.0395: testing the + register fails with Motif
vim-patch:8.0.0422: Python test fails with Python 3.6
vim-patch:8.0.0425: build errors when building without folding
vim-patch:8.0.0432: "make shadow" creates an invalid link
vim-patch:8.0.0476: missing change to main.c
vim-patch:8.0.0526: Coverity complains about possible negative value
vim-patch:8.0.0540: building unit tests fails
vim-patch:8.0.0556: getting window position fails if GUI and term possible
vim-patch:8.0.0563: crash when getting the window position in tmux
vim-patch:8.0.0567: call for requesting color and ambiwidth is too early
vim-patch:8.0.0569: bracketed paste is still enabled in a shell command
vim-patch:8.0.0587: configure check for return value of tgetent skipped
vim-patch:8.0.0588: job_stop() often assumes the channel will be closed
vim-patch:8.0.0610: the screen is redrawn when default 'background' is detected
vim-patch:8.0.0611: the screen is not redrawn after sending t_u7
vim-patch:8.0.0620: checking for HAVE_GTK_MULTIHEAD is not needed
vim-patch:8.0.0626: in the GUI the cursor may flicker
vim-patch:8.0.0628: cursor disappears after silent mapping
vim-patch:8.0.0631: can't build with Perl 5.26
vim-patch:8.0.0637: crash when using some version of GTK 3
vim-patch:8.0.0639: the cursor position is set when editing a new commit message
vim-patch:8.0.0649: when opening a help file the filetype is set several times
vim-patch:8.0.0653: the default highlight for QuickFixLine is not good
vim-patch:8.0.0690: compiler warning on non-Unix system
vim-patch:8.0.0691: compiler warning without the linebreak feature
vim-patch:8.0.0696: .inc files missing in git
vim-patch:8.0.0719: build failure without +terminal feature
vim-patch:8.0.0729: the help for the terminal configure option is wrong
vim-patch:8.0.0731: cannot build the terminal feature on MS-Windows
vim-patch:8.0.0741: cannot build with HPUX
vim-patch:8.0.0750: OpenPTY missing in non-GUI build
vim-patch:8.0.0751: OpenPTY missing with some combination of features
vim-patch:8.0.0752: build fails on MS-Windows
vim-patch:8.0.0763: libvterm can be improved
vim-patch:8.0.0770: compiler warning for missing field initializer
vim-patch:8.0.0772: other stdbool.h dependencies in libvterm
vim-patch:8.0.0773: mixing 32 and 64 bit libvterm builds fails
vim-patch:8.0.0774: build failure without the multi-byte feature
vim-patch:8.0.0790: MSVC compiler warning for strncpy in libvterm
vim-patch:8.0.0795: terminal feature does not build with older MSVC
vim-patch:8.0.0808: cannot build with terminal feature and DEBUG defined
vim-patch:8.0.0809: MS-Windows: tests hang
vim-patch:8.0.0811: MS-Windows: test_expand_dllpath fails
vim-patch:8.0.0822: Test_with_partial_callback is a tiny bit flaky
vim-patch:8.0.0834: can't build without the client-server feature
vim-patch:8.0.0865: cannot build with channel but without terminal feature
vim-patch:8.0.0866: Solaris also doesn't have MIN and MAX
vim-patch:8.0.0875: crash with weird command sequence
vim-patch:8.0.0880: Travis uses an old Ubuntu version
vim-patch:8.0.0901: asan suppress file missing from distribution
vim-patch:8.0.0919: cursor color isn't set on startup
vim-patch:8.0.0921: terminal window cursor shape not supported in the GUI
vim-patch:8.0.0946: using PATH_MAX does not work well on some systems
vim-patch:8.0.0954: /proc/self/exe might be a relative path
vim-patch:8.0.0966: build failure without terminal feature
vim-patch:8.0.0967: using a terminal may cause the cursor to blink
vim-patch:8.0.0972: compiler warnings for unused variables
vim-patch:8.0.0980: Coverity warning for failing to open /dev/null
vim-patch:8.0.0986: terminal feature always requires multi-byte feature
vim-patch:8.0.0988: warning from Covscan about using NULL pointer
vim-patch:8.0.0993: sometimes an xterm sends an extra CTRL-X
vim-patch:8.0.0996: Mac: t_RS is echoed on the screne in Terminal.app
vim-patch:8.0.0997: Libvterm and Terminal.app not regognized from termresponse.
vim-patch:8.0.1008: slow updating of terminal window in Motif
vim-patch:8.0.1010: build failure without termresponse feature
vim-patch:8.0.1014: old compiler doesn't know uint32_t
vim-patch:8.0.1016: gnome terminal echoes t_RC
vim-patch:8.0.1021: older Gnome terminal still echoes t_RC
vim-patch:8.0.1026: GTK on-the-spot input has problems
vim-patch:8.0.1027: more terminals can't handle requesting cursor mode
vim-patch:8.0.1030: MS-Windows: wrong size computation in is_cygpty()
vim-patch:8.0.1033: detecting background color does not work in screen
vim-patch:8.0.1042: without the syntax feature highlighting doesn't work
vim-patch:8.0.1047: buffer overflow in Ruby
vim-patch:8.0.1059: older Gnome terminal returns smaller version number
vim-patch:8.0.1062: Coverity warnings in libvterm
vim-patch:8.0.1065: not all macro examples are included
vim-patch:8.0.1066: some terminals can't handle requesting cursor mode
vim-patch:8.0.1068: vandyke SecureCRT terminal can't handle cursor mode request
vim-patch:8.0.1069: still get CTRL-X sometimes
vim-patch:8.0.1071: putty-color and cygwin-color are not recognized
vim-patch:8.0.1094: using ssh from Terminal.app runs into xterm incompatibility
vim-patch:8.0.1110: FORTIFY_SOURCE from Perl causes problems
vim-patch:8.0.1111: syntax error in configure when using Perl
vim-patch:8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs
vim-patch:8.0.1136: W_WIDTH() is always the same
vim-patch:8.0.1152: encoding of error message wrong in Cygwin terminal
vim-patch:8.0.1155: Ruby command triggers a warning
vim-patch:8.0.1157: compiler warning on MS-Windows
vim-patch:8.0.1159: typo in #ifdef
vim-patch:8.0.1166: :terminal doesn't work on Mac High Sierra
vim-patch:8.0.1175: build failure without +termresponse
vim-patch:8.0.1192: MS-Windows: terminal feature not enabled by default
vim-patch:8.0.1195: can't build on MS-Windows
vim-patch:8.0.1198: older compilers don't know uint8_t
vim-patch:8.0.1211: cannot reorder tab pages with drag & drop
vim-patch:8.0.1247: not easy to find Debian build info
vim-patch:8.0.1248: stray + in README file
vim-patch:8.0.1255: duplicate badge README file
vim-patch:8.0.1256: typo in configure variable vim_cv_tgent
vim-patch:8.0.1258: 'ttymouse' is set to "sgr" even though it's not supported
vim-patch:8.0.1269: effect of autocommands on marks is not tested
vim-patch:8.0.1272: warnings for unused variables in tiny build
vim-patch:8.0.1273: old test file remaining
vim-patch:8.0.1303: 'ttymouse' is not set to "sgr" for Terminal.app and Iterm2
vim-patch:8.0.1306: ASAN error stack trace is not useful
vim-patch:8.0.1310: cproto generates errors because of missing type
vim-patch:8.0.1322: textformat test isn't run
vim-patch:8.0.1324: some xterm sends different mouse move codes
vim-patch:8.0.1325: more tests are not run
vim-patch:8.0.1327: new proto file missing from distribution
vim-patch:8.0.1337: typo in #ifdef
vim-patch:8.0.1369: MS-Windows: drawing underline slow, mFallbackDC not updated
vim-patch:8.0.1380: using "vim -r swapfile" the hit-enter prompt is misplaced.
vim-patch:8.0.1394: cannot intercept a yank command
vim-patch:8.0.1415: warning for unused function without timers feature
vim-patch:8.0.1424: the timer_pause test is flaky on Travis
vim-patch:8.0.1437: pkg-config doesn't work with cross compiling
vim-patch:8.0.1456: timer test on travis Mac is still flaky
vim-patch:8.0.1467: libvterm doesn't handle illegal byte sequence correctly
vim-patch:8.0.1478: unnecessary condition
vim-patch:8.0.1504: Win32: the screen may be cleared on startup
vim-patch:8.0.1506: new version of HP NonStop (Tandem) doesn't like a header
vim-patch:8.0.1532: compiler warnings without termguicolors feature
vim-patch:8.0.1556: may not parse the t_RS response correctly
vim-patch:8.0.1564: too many #ifdefs
vim-patch:8.0.1565: can't build Mac version without GUI
vim-patch:8.0.1566: too many #ifdefs
vim-patch:8.0.1567: cannot build Win32 GUI without IME
vim-patch:8.0.1571: can't build without GUI
vim-patch:8.0.1573: getwinpos(1) may cause response to be handled as command
vim-patch:8.0.1580: FEAT_CURSORBIND and FEAT_SCROLLBIND are unused
vim-patch:8.0.1581: cannot build Win32 GUI without +eval
vim-patch:8.0.1583: using C99 comment
vim-patch:8.0.1584: using C99 in Mac file gives compiler warning messages
vim-patch:8.0.1585: enabling beval_term feature in Win32 GUI
vim-patch:8.0.1586: imactivatefunc does not work on non-GUI Mac
vim-patch:8.0.1597: autocommand events are not sorted
vim-patch:8.0.1603: cannot build with +terminal but without +menu
vim-patch:8.0.1606: singular/plural variants not translated
vim-patch:8.0.1608: Win32: directx not enabled by default
vim-patch:8.0.1610: cannot build without GUI
vim-patch:8.0.1613: warning for unused variable in tiny build
vim-patch:8.0.1614: "make tags" doesn't include libvterm
vim-patch:8.0.1618: color Grey50 is missing in the compiled-in table
vim-patch:8.0.1625: test_quotestar is flaky when run in GTK GUI
vim-patch:8.0.1627: compiler warning for visibility attribute not supported
vim-patch:8.0.1635: undefining _POSIX_THREADS causes problems with Python 3
vim-patch:8.0.1639: libvterm code lags behind master
vim-patch:8.0.1646: MS-Windows: executable contains unreferenced functions
vim-patch:8.0.1650: too many #ifdefs
vim-patch:8.0.1659: scroll events not recognized for some xterm emulators
vim-patch:8.0.1663: cannot build without multi-byte feature
vim-patch:8.0.1674: libvterm can't handle an OSC string split
vim-patch:8.0.1675: unused macro argument in libvterm
vim-patch:8.0.1679: compiler warning for printf format
vim-patch:8.0.1683: Python upgrade breaks Vim when defining PYTHON_HOME
vim-patch:8.0.1686: Python does not work when configuring with specific dir
vim-patch:8.0.1692: Python may not work when using statically linked library
vim-patch:8.0.1696: coverage statistics don't work
vim-patch:8.0.1698: coverage statistics don't work on coveralls
vim-patch:8.0.1699: leftover stuff for Python 1.4
vim-patch:8.0.1700: coverage statistics still don't work on coveralls
vim-patch:8.0.1701: can disable COLOR_EMOJI with MSVC but not MinGW
vim-patch:8.0.1710: building with Ruby fails
vim-patch:8.0.1717: C89 check causes too much trouble
vim-patch:8.0.1719: cannot specify which Python executable configure should use
vim-patch:8.0.1730: no configure check for the used C99 features
vim-patch:8.0.1736: check for C99 features is incomplete
vim-patch:8.0.1737: fchown() used when it is not supported
vim-patch:8.0.1739: MS-Windows with msys2 cannot build Ruby statically
vim-patch:8.0.1741: MS-Windows with msys2 cannot build Ruby statically
vim-patch:8.0.1749: VMS: 100% CPU use, redefining mch_open() fails
vim-patch:8.0.1751: #ifdef causes bad highlighting
vim-patch:8.0.1755: MS-Windows: high unicode char received as two utf-16 words
vim-patch:8.0.1757: unnecessary changes in libvterm
vim-patch:8.0.1760: wrong number of arguments to vms_read()
vim-patch:8.0.1764: lgtm considers tutor.es to be EcmaScript
vim-patch:8.0.1785: missing symbol in Win32 small build
vim-patch:8.0.1788: tool to check a color scheme is not installed
vim-patch:8.0.1791: using uint8_t does not work everywhere
vim-patch:8.0.1813: Windows installer doesn't install terminal debugger
vim-patch:8.0.1825: might use NULL pointer when out of memory
vim-patch:8.0.1840: getwinpos() is not tested

vim-patch:8.0.0216: decoding js style json may fail
vim-patch:8.0.1391: encoding empty string to JSON sometimes gives "null"
vim-patch:8.0.1602: crash in parsing JSON
vim-patch:8.1.0343: #9041
2018-10-28 12:56:15 +01:00
e101cdb3d7 vim-patch:8.1.0498: /etc/gitconfig not recognized at a gitconfig file
Problem:    /etc/gitconfig not recognized at a gitconfig file.
Solution:   Add pattern to filetype detection. (closes vim/vim#3568)
d474686a09
2018-10-27 19:54:52 -04:00
b920412306 vim-patch:8.1.0484: some file types are not recognized
Problem:    Some file types are not recognized.
Solution:   Update the file type detection.
38654503b0
2018-10-27 19:53:17 -04:00
f1f036740a vim-patch:8.0.1465: python2 and python3 detection not tested
Problem:    Python2 and python3 detection not tested. (Matej Cepl)
Solution:   Add test for detecting python2 and python3.  Also detect a script
            using "js" as javascript.
4bc0bed536
2018-10-27 19:53:17 -04:00
5ec671d541 vim-patch:8.0.1458: filetype detection test does not check all scripts
Problem:    Filetype detection test does not check all scripts.
Solution:   Add most scripts to the test
ddb349369d
2018-10-27 19:53:17 -04:00
a71a180df9 vim-patch:8.0.1457: clojure now supports a shebang line
Problem:    Clojure now supports a shebang line.
Solution:   Detect clojure script from the shebang line. (David Burgin,
            closes vim/vim#2570)
8fd2ffc530
2018-10-27 19:53:17 -04:00
43c88bb58c vim-patch:8.0.1438: filetype detection test not updated for change
Problem:    Filetype detection test not updated for change.
Solution:   Update the test.
0479e910c4
2018-10-27 19:53:17 -04:00
112a5b76e6 man.vim: lowercase title when invoked as $MANPAGER
man#init_pager() guesses the ref by the heading, which is usually
uppercase, so we don't know the correct casing. But lowercase is more
common, so use that for the buffer name instead of uppercase.

ref #9156
2018-10-26 02:50:21 +02:00
4d7c7f96dd Merge pull request #9149 from bfredl/virt_cul
screen: show virt_text when 'cursorline' is set
2018-10-25 21:24:06 +02:00
d214e33e78 doc/:Man: "!" is special in some shells
ref https://github.com/neovim/neovim/issues/9156#issuecomment-433156463
2018-10-25 20:51:59 +02:00
edbe020bcb Merge pull request #9155 from bfredl/tabredraw
UI: add missing redraw after enter_tabpage
2018-10-25 19:03:40 +02:00
6994cc4d1a UI: add missing redraw after enter_tabpage
redraw_all_later() isn't guaranteed to update must_redraw after
switching tab, we must do it ourselves.

fixes #9152
2018-10-25 17:46:58 +02:00
c48c9828c3 screen.c: remove redundant wp->w_hl_attr_normal 2018-10-25 09:30:48 +02:00
662abd8451 screen: fix glitches with nvim_buf_set_virtual_text
- virtual text disappeared when 'cursorline' was set
- virtual text was shifted when emtpy line was visually selected.
2018-10-25 09:30:48 +02:00
c03a0f5fc8 man.vim: avoid duplicate buffers, E95
Before this commit, man#init_pager() always tries to scrape the manpage
name and set the buffer name. That's much less important than avoiding
duplicate buffers and E95. And it doesn't seem to be necessary, usually.

Steps to reproduce:

    $ export MANPAGER="nvim -c 'set ft=man' -"
    $ man sleep
    :Man sleep

    Error detected while processing function man#init_pager:
    line   15:
    E95: Buffer with this name already exists

    :ls!
    1  h-  "man://SLEEP(1)"               line 4
    2 %a-  "man://sleep(1)"               line 1
2018-10-25 04:09:53 +02:00
5fbc2eeac5 CI/Travis/macOS: use default Travis-provided python/pip
Despite #9095, `brew upgrade python` broke again, somehow.

We should not bother attempting to force a python version. Instead use
whatever python Travis provides on the macOS image.
2018-10-23 02:01:12 +02:00
6dae7776ed Merge #9145 'CI, nodejs fixes' 2018-10-22 21:52:51 +02:00
f20427451e Merge pull request #9143 from bfredl/nuclear
disable clearing almost everywhere, cleanup screen.c dead code
2018-10-22 14:53:45 +02:00
e598811e76 ui: disable clearing almost everywhere
Avoid clearing the screen in most situations. NOT_VALID should be
equivalent to CLEAR unless some external force messed up the terminal,
for these situations <c-l> and :mode will still clear the screen.

Also eliminate some obsolete code in screen.c, that dealt with that in
vim drawing window 1 can mess up window 2, but this never happens in
nvim.

But what about slow terminals? There is two common meanings in which
a terminal is said to be "slow":

Most commonly (and in the sense of vim:s nottyfast) it means low
bandwidth for sending bytes from nvim to the terminal. If the screen is
very similar before and after the update_screen(CLEAR) this change
should reduce bandwidth. If the screen is quite different, but there is
no new regions of contiguous whitespace, clearing doesn't reduce
bandwidth significantly. If the new screen contains a lot of whitespace,
it will depend of if vsplits are used or not: as long as there is no
vsplits, ce is used to cheaply clear the rest of the line, so
full-screen clear is not needed to reduce bandwith. However a left
vsplit currently needs to be padded with whitespace all the way to the
separator. It is possible ec (clear N chars) can be used to reduce
bandwidth here if this is a problem. (All of this assumes that one
doesn't set Normal guibg=... on a non-BCE terminal, if you do you are
doomed regardless of this change).

Slow can also mean that drawing pixels on the screen is slow. E-ink
screens is a recent example. Avoiding clearing and redrawing the
unchanged part of the screen will always improve performance in these
cases.
2018-10-22 11:59:02 +02:00
afd1d412fa auevents.lua: keep events in alphabetical order 2018-10-22 01:30:29 +02:00
b23759b4d7 provider/nodejs: fix npm,yarn detection
For each package manager,
1. Check if they are executable before starting a job.
2. Check if the job opts are set before checking the job status
   TODO: Validate the job id.

Prioritize npm because it's faster than yarn.
Reindent the code to 2-space indent.
2018-10-22 01:30:28 +02:00
db6521a560 test: fix/speedup scrollback_spec
- fix: Use "set PROMPT=$" trick to satisfy screen:expect{any='%$'}
- speedup: Use cmd.exe instead of powershell.
2018-10-22 01:30:28 +02:00
a7b17d4b3e CI/AppVeyor: invalidate .deps if build.ps1 changes 2018-10-22 01:28:02 +02:00
57ff96be8e CI/AppVeyor: fix MSBuild hack for functional tests
PR #9087 changed the error string by removing 'Running', breaking the
MSBuild hack detecting failure for functional tests. If stdout or stderr
has a line with 'functional tests failed with error', fail the build.
2018-10-22 01:28:02 +02:00
565bbd1485 Merge #9146 from justinmk/fix-warnings 2018-10-21 23:48:43 +02:00
11ae6f418d fix warning: null arg passed to 'nonnull' param
Found by clang scan-build 5.0
2018-10-21 23:25:02 +02:00
902ca26856 fix warning: null arg passed to 'nonnull' param
Found by clang scan-build 5.0
2018-10-21 23:24:59 +02:00
f97496a21c fix warning: "Assigned value is garbage"
clang scan-build noticed that find_command() may bitmask `eap->flags`.
cmd_can_preview() only uses `ea.cmdidx`, but let's fix the warning...

Found by clang scan-build 5.0
2018-10-21 23:24:54 +02:00
2afebc4e5f fix warning: "Dead assignment"
`tv` is passed to the TYPVAL_ENCODE_CONV_FUNC_BEFORE_* macros, which
don't appear to actually use that parameter.

Found by clang scan-build 5.0
2018-10-21 23:24:50 +02:00
a8422818a7 fix warning: null pointer dereference
Found by clang scan-build 5.0
2018-10-21 23:24:46 +02:00
e0f6f46c1b fix warning: garbage/uninitialized value
According to clang scan-build, `fromcol` could be uninitialized at line
2645.

Found by clang scan-build 5.0
2018-10-21 23:24:40 +02:00
863dbbb3d4 fix warning: "Uninitialized argument"
clang scan-build thinks os_system() could set `do_profiling` flag.

Found by clang scan-build 5.0
2018-10-21 23:24:21 +02:00
25bc656988 Merge pull request #9144 from bfredl/ui_event_compat
api/ui: verify compatibility of UI events
2018-10-21 22:01:50 +02:00
bcab880bb6 api/ui: verify compatibility of UI events 2018-10-21 20:36:52 +02:00
f895b47d3f man.vim: :Man! operates on buffer contents (#9139)
mandoc may not handle quoted MANPAGER arguments correctly. E.g. with
    export MANPAGER='nvim -u NORC -c "set ft=man"'
mandoc treats `"set` and `ft=man"'` as separate tokens.

To workaround that, provide :Man! so that MANPAGER can avoid quoting.

closes #9120
2018-10-21 17:38:25 +02:00
b227a3c8d3 Merge #9141 from justinmk/pvs 2018-10-21 17:01:14 +02:00
bbd8f4e9a4 tui.c: Fix ext.set_underline_color for !has_colon_rgb
PVS/V523: The 'then' statement is equivalent to the 'else' statement.
2018-10-20 23:09:49 +02:00
92f98b5bdf screen.c: Fix PVS/V560: condition is always false 2018-10-20 23:09:49 +02:00
1cf50cbfd9 provider/nodejs: Simultaneously query npm and yarn #9054
ref #9001

Instead of serially querying npm and yarn for neovim, start both as a
job and then wait for a successful result from either.
2018-10-18 20:32:44 +02:00
edcf640f59 Merge #9130 'build: Fix for macOS 10.14/mojave'
fix #9050

Q: (from From #7891)
  > It turns out there's a difference between executing
  > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
  > and /usr/bin/clang. CMake was picking up the former and with that it left off
  > a key include path. Why?

A: /usr/bin/clang is a shim that uses libxcselect/libxcrun under the hood.
   $ otool -L /usr/bin/clang
   /usr/bin/clang:
    /usr/lib/libxcselect.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)

From https://macops.ca/developer-binaries-on-os-x-xcode-select-and-xcrun/ :
  > this shim binary loads functions in libxcselect.dylib that can locate the
  > path to the real binary, depending on how the system has been configured. One
  > part of this process is to check whether this path contains
  > usr/lib/libxcrun.dylib, and the xcrun tool, in which case it will invoke
  > xcrun to run the binary.
  > ...
  > (If all of this isn’t yet enough indirection for you, /usr/bin/xcrun itself
  > is a shim, and so libxcselect.dylib contains code to detect whether the
  > executed xcrun is a shim. Look for the __xcrun_shim segment in the __DATA
  > section output by the command: pagestuff /usr/bin/xcrun -a.)
2018-10-18 01:28:17 +02:00
3059516e8a Merge #9086 'vim-patch:8.1.0448' 2018-10-18 00:47:30 +02:00
31f63c8d55 build/macOS: provide SDK path to deps compiler
otherwise, system headers cannot be found on Mojave
they were moved from /usr/include to SDK path
2018-10-17 16:26:28 +03:00
913588466d build/macOS: fix luajit install step
prevent luajit to assigning default value to MACOSX_DEPLOYMENT_TARGET
ref #9050
2018-10-17 16:26:19 +03:00
aff64b3a52 Merge #9124 'vim-patch:8.0.1672' 2018-10-17 09:51:09 +02:00
9642903dea test: Improve 008_autocommands_spec reliability (#9129)
Sometimes 008_autocommands_spec fails like this:

    [ RUN      ] autocommands that delete and unload buffers: BufUnload, VimLeave: -- Output to stderr:
    CMake Error at /home/travis/build/neovim/neovim/cmake/RunTests.cmake:53 (message):
      functional tests failed with error: 1

The final :quit + wait() is a race. Use command() instead, which is
synchronous.  Use command('silent! ...') everywhere else too, because
it's clearer instead of feeding input and clearing the expected errors
with CTRL-L.
2018-10-17 09:24:45 +02:00
2d531d296f Merge #9131 from janlazo/vim-8.0.0670 2018-10-17 08:13:09 +02:00
e311b019a1 Merge pull request #6930 from bfredl/expectfix
tests: detect and fix fragile sceen tests, and mark intentional unchanged expect():s
2018-10-16 23:34:11 +02:00
090008f311 vim-patch:8.0.1067: try/catch in timer does not prevent it from being stopped
Problem:    Using try/catch in timer does not prevent it from being stopped.
Solution:   Reset the exception context and use did_emsg instead of
            called_emsg.
e723c42836
2018-10-16 00:03:13 -04:00
7d7691e85f vim-patch:8.0.0670: can't use input() in a timer callback
Problem:    Can't use input() in a timer callback. (Cosmin Popescu)
Solution:   Reset vgetc_busy and set timer_busy. (Ozaki Kiichi, closes vim/vim#1790,
            closes vim/vim#1129)
1e8e14552e
2018-10-15 21:22:43 -04:00
6476d081be test/old: stub CanRunVimInTerminal() 2018-10-16 00:26:01 +02:00
ee94eecbd4 vim-patch:8.1.0448: cursorline not removed when using 'cursorbind'
Problem:    Cursorline not removed when using 'cursorbind'. (Justin Keyes)
Solution:   Store the last cursor line per window. (closes vim/vim#3488)
4a5abbd613
2018-10-16 00:15:09 +02:00
c8810a51a3 tests: improve robustness of immediate successes in screen tests 2018-10-15 20:13:11 +02:00
8fd092f3ff vim-patch:8.1.0476: memory leaks in test_escaped_glob (#9127)
Problem:    Memory leaks in test_escaped_glob.
Solution:   Avoid failure when running the shell, use the sandbox.
a2aad02830
2018-10-14 16:23:46 -07:00
9c2d5f1a33 functionaltest: map error does not cancel prompt 2018-10-14 09:08:56 -04:00
e568ac7a68 Merge pull request #9123 from jamessan/unibilium-parsing-fix
third-party/unibilium: Fix parsing of extended capability entries
2018-10-13 22:11:58 -04:00
e7ba325298 vim-patch:8.0.1672: error during completion causes command to be cancelled
Problem:    Error during completion causes command to be cancelled.
Solution:   Reset did_emsg before waiting for another character. (Tom M.)
72532d354e
2018-10-13 21:47:41 -04:00
399864157b third-party/unibilium: Fix parsing of extended capability entries
In the 20180331 release, the format was slightly changed:

> 20180331
>         + improve terminfo write/read by modifying the fourth item of the
>           extended header to denote the number of valid strings in the extended
>           string table (prompted by a comment in unibilium's sources).

Since the number of valid string capabilities is not necessarily the
same as extstrslen, it's not possible to sanity check the total number
of items up front anymore.
2018-10-13 20:24:02 -04:00
c9baaa9200 Merge #9095 'CI/travis/macOS: fix missing pip3' 2018-10-13 15:59:49 -07:00
aa87dd2b89 Merge #9122 from janlazo/vim-8.1.0473 2018-10-13 14:40:16 -07:00
78418e17e9 CI/travis/macOS: silence non-error messages from homebrew
Reduces the log size by 11% (1100/9670 lines).
2018-10-13 23:34:49 +02:00
3d2493a3fd CI/travis/macOS: use "sudo rm" to remove cores
After bumping Travis macOS to 10.13, it now hangs at:

    + check_core_dumps --delete quiet
    + local del=
    + test --delete = --delete
    + del=1
    + shift
    + local app=quiet
    + test osx = osx
    ++ find /cores/ -type f -print
    + local 'cores=/cores//core.554
    /cores//core.641
    /cores//core.801'
    + test -z '/cores//core.554
    /cores//core.641
    /cores//core.801'
    + local core
    + for core in '$cores'
    + test 1 = 1
    + print_core quiet /cores//core.554
    + local app=quiet
    + local core=/cores//core.554
    + test quiet = quiet
    + echo 'Found core /cores//core.554'
    Found core /cores//core.554
    + return 0
    + rm /cores//core.554
    override r--------  root/admin for /cores//core.554?

The cores are always present on the Travis macOS 10.13 image! Hilarious.
2018-10-13 23:34:49 +02:00
e39dade80b test: adjust timer tests
Timer tests are less reliable on Travis CI macOS 10.12 (most egregious).
Also somewhat on 10.13.
2018-10-13 23:34:49 +02:00
12376cc01c memline: process_still_running is bool 2018-10-13 17:16:42 -04:00
726baefdf7 vim-patch:8.1.0473: user doesn't notice file does not exist when swap file does
Problem:    User doesn't notice file does not exist when swap file does.
Solution:   Add a note that the file cannot be found.  Make the "still
            running" notice stand out.
d6105cb408
2018-10-13 17:13:47 -04:00
0995f460fb CI/travis/macOS: fix missing pip3
homebrew or Travis changed something, now `pip3` isn't in $PATH.
`ls /usr/local/opt/python/libexec/bin` confirmed this, no matter what
brew reinstall/relink/upgrade are used.

Bumping the macOS image to 10.12 or 10.13 makes the problem go away.

    ==> Processing gcc49 formula rename to gcc@4.9
    ==> Unlinking gcc49
    ==> Moving gcc49 versions to /usr/local/Cellar/gcc@4.9
    ==> Relinking gcc@4.9
    Warning: gcc@4.9 is outdated!
    To avoid broken installations, as soon as possible please run:
      brew upgrade
    Or, if you're OK with a less reliable fix:
      brew upgrade gcc@4.9
    python info:
      Python 2.7.12
      Python 2.7.12
      ci/before_install.sh: line 18: python3: command not found
      pip 8.1.2 from /usr/local/lib/python2.7/site-packages (python 2.7)
      pip 8.1.2 from /usr/local/lib/python2.7/site-packages (python 2.7)
      ci/before_install.sh: line 21: pip3: command not found
      pyenv versions:
      * system (set by /Users/travis/.pyenv/version)
    Upgrade Python 3.
    To restore the stashed changes to /usr/local/Homebrew run:
      'cd /usr/local/Homebrew && git stash pop'
    ==> Caveats
    Python has been installed as
      /usr/local/bin/python3
    Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
    `python3`, `python3-config`, `pip3` etc., respectively, have been installed into
      /usr/local/opt/python/libexec/bin
    If you need Homebrew's Python 2.7 run
      brew install python@2
    Pip, setuptools, and wheel have been installed. To update them run
      pip3 install --upgrade pip setuptools wheel
    You can install Python packages with
      pip3 install <package>
    They will install into the site-package directory
      /usr/local/lib/python3.7/site-packages
    See: https://docs.brew.sh/Homebrew-and-Python
    ==> Summary
    º  /usr/local/Cellar/python/3.7.0: 8,864 files, 153.8MB, built in 6 minutes 32 seconds
    ...
    Upgrade Python 3 pip.
    ci/before_install.sh: line 30: pip3: command not found
    travis_time🔚0d23f522:start=1538818824750644000,finish=1538819451424021000,duration=626673377000
    The command "ci/before_install.sh" failed and exited with 127 during .
    Your build has been stopped.
    /Users/travis/.travis/job_stages: line 373: shell_session_update: command not found

    ==> Processing gcc49 formula rename to gcc@4.9
    ==> Unlinking gcc49
    ==> Moving gcc49 versions to /usr/local/Cellar/gcc@4.9
    ==> Relinking gcc@4.9
    Warning: gcc@4.9 is outdated!
    To avoid broken installations, as soon as possible please run:
      brew upgrade
    Or, if you're OK with a less reliable fix:
      brew upgrade gcc@4.9
    python info:
      Python 2.7.12
      Python 2.7.12
      ci/before_install.sh: line 18: python3: command not found
      pip 8.1.2 from /usr/local/lib/python2.7/site-packages (python 2.7)
      pip 8.1.2 from /usr/local/lib/python2.7/site-packages (python 2.7)
      ci/before_install.sh: line 21: pip3: command not found
      pyenv versions:
      * system (set by /Users/travis/.pyenv/version)
    Upgrade Python 3.
    To restore the stashed changes to /usr/local/Homebrew run:
      'cd /usr/local/Homebrew && git stash pop'
    ==> Caveats
    Python has been installed as
      /usr/local/bin/python3
    Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
    `python3`, `python3-config`, `pip3` etc., respectively, have been installed into
      /usr/local/opt/python/libexec/bin
    If you need Homebrew's Python 2.7 run
      brew install python@2
    Pip, setuptools, and wheel have been installed. To update them run
      pip3 install --upgrade pip setuptools wheel
    You can install Python packages with
      pip3 install <package>
    They will install into the site-package directory
      /usr/local/lib/python3.7/site-packages
    See: https://docs.brew.sh/Homebrew-and-Python
    ==> Summary
    º  /usr/local/Cellar/python/3.7.0: 8,864 files, 153.8MB, built in 6 minutes 32 seconds
    ...
    Upgrade Python 3 pip.
    ci/before_install.sh: line 30: pip3: command not found
    travis_time🔚0d23f522:start=1538818824750644000,finish=1538819451424021000,duration=626673377000
    The command "ci/before_install.sh" failed and exited with 127 during .
    Your build has been stopped.
    /Users/travis/.travis/job_stages: line 373: shell_session_update: command not found
2018-10-13 22:33:01 +02:00
d14283c7a0 Merge #9118 2018-10-13 21:07:54 +02:00
717e2db274 Revert "vim-patch:8.0.0971: 'winptydll' missing from :options"
Revert f4e2df4527.
We don't support 'winptydll' and probably don't have any reason to.
2018-10-13 21:06:26 +02:00
79a11ecfd3 Merge pull request #9121 from bfredl/virt_invalid
API: make nvim_buf_set_virtual_text handle invalid chars
2018-10-13 20:15:28 +02:00
824f36a980 vim-patch:8.0.1590: padding in list type wastes memory (#9119)
Problem:    Padding in list type wastes memory.
Solution:   Reorder struct members to optimize padding. (Dominique Pelle,
            closes vim/vim#2704)
1a84024037
2018-10-13 10:56:20 -07:00
bddcbbb571 signs: Add "numhl" argument #9113
close #9113
ref #9040
2018-10-13 19:39:56 +02:00
3d84cf6ff4 api: make nvim_buf_set_virtual_text handle invalid chars
Clients are supposed to supply only valid text, but if it is
invalid, translate it rather than messing up the screen
2018-10-13 16:37:17 +02:00
8bbb28b973 Merge pull request #8968 from ckelsel/vim-8.0.0685
[RFC] vim-patch:8.0.0685
2018-10-12 22:04:39 -04:00
64b44018fa vim-patch:8.0.1843: entry for 'wrap' in options window is wrong
Problem:    Entry for 'wrap' in options window is wrong. (John Little)
Solution:   Make the change apply locally.
8776889b5b
2018-10-12 21:55:53 -04:00
3736f14896 vim-patch:8.0.1547: undo in the options window makes it empty
Problem:    Undo in the options window makes it empty.
Solution:   Set 'undolevels' while filling the buffer. (Yasuhiro Matthew,
            closes vim/vim#2645)
9c474b2773
2018-10-12 21:52:33 -04:00
f4e2df4527 vim-patch:8.0.0971: 'winptydll' missing from :options
Problem:    'winptydll' missing from :options.
Solution:   Add the entry.
0aed9a2e2e
2018-10-12 21:49:22 -04:00
aeda13cfdf vim-patch:8.0.0685: when conversion fails written file may be truncated
Problem:    When making backups is disabled and conversion with iconv fails
            the written file is truncated. (Luo Chen)
Solution:   First try converting the file and write the file only when it did
            not fail. (partly by Christian Brabandt)
e6bf655bc4
2018-10-12 19:49:14 -04:00
4c780d663f Merge pull request #9114 from nono/vim-2f0584910c0e
vim-patch:2f0584910c0e
2018-10-12 15:39:36 -04:00
b26411bacd Merge pull request #9117 from nono/vim-25a6e8a769aa
vim-patch:25a6e8a769aa
2018-10-12 15:39:07 -04:00
b5e3fec621 vim-patch:2f0584910c0e
Update runtime files
2f0584910c
2018-10-12 21:33:13 +02:00
942f3587c3 vim-patch:25a6e8a769aa
Small runtime update
25a6e8a769
2018-10-12 21:28:32 +02:00
167b72a647 vim-patch:8.0.1489: there is no easy way to get the global directory (#9109)
Problem:    There is no easy way to get the global directory, esp. if some
            windows have a local directory.
Solution:   Make getcwd(-1) return the global directory. (Andy Massimino,
            closes vim/vim#2606)
5459129af2
2018-10-12 21:25:00 +02:00
15a71338e3 Merge #8902 'doc' 2018-10-12 17:44:44 +02:00
fb043f8ea3 Merge pull request #9096 from nono/vim-7f2e9d7c9cdf
vim-patch:7f2e9d7c9cdf
2018-10-11 22:24:52 -04:00
e52293757a doc: manpage: formatting, update --headless 2018-10-11 19:32:44 +02:00
ea12efa66b doc: mouse: cleanup, fixup
- Much of the mouse chatter in gui.txt and term.txt is redundant; other
  parts are outdated or irreleveant to Nvim.
- Fix default value of 'mousemodel' for Windows
2018-10-11 19:32:44 +02:00
ab69944978 doc/develop.txt: brevity
design-flexible and design-multi-platform sections are "obvious" by now
(and covered in much of our other resources) and I've never seen it
referenced in any discussion.
2018-10-11 19:32:44 +02:00
b12c20e466 doc: emphasize that "python" means "python 2" 2018-10-11 19:32:44 +02:00
b11f5aa119 doc: xdg, MAINTAIN.md, channel-id, job control
- tutor: emphasize K
2018-10-11 19:32:31 +02:00
384770556b Merge #9106 from janlazo/vim-8.0.1837
vim-patch:8.0.1837
2018-10-11 08:58:43 +02:00
2bf1aa5628 vim-patch:8.0.1777: cannot cleanup before loading another colorscheme (#9104)
Problem:    Cannot cleanup before loading another colorscheme.
Solution:   Add the ColorSchemePre autocommand event.
60a68362aa
2018-10-11 08:27:37 +02:00
0cd786b905 lint 2018-10-10 23:26:26 -04:00
25baeb39e3 vim-patch:8.0.1837: one character cmdline abbreviation not triggered after '<,'>
Problem:    One character cmdline abbreviation not triggered after '<,'>.
Solution:   Skip over the special range. (Christian Brabandt, closes vim/vim#2320)
5e3423d192
2018-10-10 23:24:38 -04:00
e17e21e4cf vim-patch:8.1.0468: MS-Windows: filter command with pipe character fails (#9101)
Problem:    MS-Windows: Filter command with pipe character fails. (Johannes
            Riecken)
Solution:   Find the pipe character outside of quotes. (Yasuhiro Matsumoto,
            closes vim/vim#1743, closes vim/vim#3523)
0664089ecc
2018-10-10 11:32:21 +02:00
8c7c8f5962 Merge #8954 from janlazo/vim-8.0.1423 2018-10-10 11:20:43 +02:00
0394cb23e9 lint 2018-10-09 21:55:35 -04:00
c2e7f39528 vim-patch:8.0.1423: error in return not caught by try/catch
Problem:    Error in return not caught by try/catch.
Solution:   Call update_force_abort(). (Yasuhiro Matsomoto, closes vim/vim#2483)
fabaf753e2
2018-10-09 21:38:33 -04:00
f4b2b66661 Merge pull request #9079 from bfredl/tui_cursor
TUI cursor fixes: avoid memory errors after resize with invalid cursor position
2018-10-09 12:21:17 +02:00
2c680a5854 vim-patch:8.0.1779: deleting in a block selection causes problems (#9099)
Problem:    Deleting in a block selection causes problems.
Solution:   Check the length of the line before adding bd.textcol and
            bd.textlen. (Christian Brabandt, closes vim/vim#2825)
35e802e713
2018-10-09 09:04:51 +02:00
85e8fd96f4 Merge #9098 'vim-patch:8.1.{459,463,466}' 2018-10-09 09:02:26 +02:00
f181efdeaf vim-patch:8.1.0466: autocmd test fails
Problem:    Autocmd test fails.
Solution:   Do call inchar() when flushing typeahead.
6a2633b00b
2018-10-08 21:14:07 -04:00
573567aef6 vim-patch:8.1.0463: "simalt ~x" in .vimrc blocks swap file prompt
Problem:    "simalt ~x" in .vimrc blocks swap file prompt.
Solution:   Flush buffers before prompting. (Yasuhiro Matsumoto,
            closes vim/vim#3518, closes vim/vim#2192)
798184cc67
2018-10-08 17:58:35 -04:00
c64d6702e5 vim-patch:8.1.0459: Test_executable fails when there is a dog in the system
Problem:    Test_executable fails when there is a dog in the system.
Solution:   Rename the dog. (Hirohito Higashi)
a05a0d325c
2018-10-08 16:35:46 -04:00
05cbe0da30 Merge #9092 from janlazo/vim-8.0.1807 2018-10-08 21:04:46 +02:00
1892d28c60 oldtests: win: fix executable() assertions
Windows has "Read and execute" permission via ACL
but nvim and libuv do not support ACL.
Windows does not support the executable bit in chmod-style permissions
but it is safe to assume that if the file exists and is readable,
then it is most likely executable.
This means that win.ini and shell32.dll are "executable"
because they exist, are readable, and are in PATH.

PATHEXT does not affect the executable permission of a file;
it exists to run files on the shell while omitting the file extension.
Assume that PATHEXT is intended for cmd.exe only
because powershell can execute powershell files (ie. *.ps1)
without changing PATHEXT or related cmd.exe environment variable.

In the future, nvim should check the outputs of 'assoc' and 'ftype',
cmd.exe internal commands, or check the registry.
Powershell can be used for ACL if C++/C# API is too difficult to use.
2018-10-08 12:34:24 -04:00
512e0caae2 Merge #9036 'func_attr_printf' 2018-10-07 19:36:01 +02:00
6a29a7bfb0 vim-patch:7f2e9d7c9cdf
Update runtime files.
7f2e9d7c9c
2018-10-07 17:35:24 +02:00
f25f42bf03 vim-patch:8.1.0453: MS-Windows: executable() is not reliable
Problem:    MS-Windows: executable() is not reliable.
Solution:   Use $PATHEXT properly. (Yasuhiro Matsumoto, closes vim/vim#3412)
8295666dc2
2018-10-07 10:30:29 -04:00
2c84421de2 src/nvim/eval.c
src/nvim/eval/typval.c
src/nvim/fileio.c
src/nvim/main.c
src/nvim/regexp_nfa.c
src/nvim/spellfile.c

changed some EMSG[..] Macros to emsgf
2018-10-07 12:24:29 +02:00
f95e0ae926 build: adjust some messages (#9087) 2018-10-06 18:45:34 +02:00
ab3a4a4896 vim-patch:8.1.0454: resolve() was not tested with a symlink cycle
Problem:    resolve() was not tested with a symlink cycle.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3513)
2610990709
2018-10-06 11:42:15 -04:00
22804c66a5 vim-patch:8.0.1807: function to set terminal name is too long
Problem:    Function to set terminal name is too long.
Solution:   Refactor the function.  Fix typo in test.
69e056915c
2018-10-06 11:36:12 -04:00
6fe9a12268 Merge #9090 'clint.py: --stdin-filename' 2018-10-06 15:17:52 +02:00
075dc42fb2 test: replace wait() with pre-assertion in assert_term_colors 2018-10-06 11:36:09 +02:00
1bf83ea8e1 TUI: delete "first-row" workaround after resize
This was caused by cursor position being invalid right
after tui_grid_resize, which is now fixed
2018-10-06 11:36:08 +02:00
cc305213d7 TUI: always use safe cursor movement after resize
The old code could lead to a memory error in the following situation:

0. The previous cursor position was row 50 since before, on a grid
larger than 50 rows.
1. grid_resize changes the grid height to 40, and invalidly assumes the
resize moved the physical cursor to row 0
2. Some event used a operation that could move the cursor (such as clear), and
then reset the cursor to the "true" position row 50 (pointless after #8221, but
I forgot to remove it)
3. raw_line/cheap_to_print is invoked, and tries to inspect the grid at
row 50 (memory error)
4. grid_cursor_goto would have been called at this point, and set a
valid cursor position 0-39.
2018-10-06 11:29:51 +02:00
1e7eb20c91 clint: add support for --stdin-filename 2018-10-05 23:14:14 +02:00
2351b931dd clint: use fileinput for stdin
Fixes handing of "-" on Python 3:

    Traceback (most recent call last):
      File "…/Vcs/neovim/src/clint.py", line 3625, in <module>
        main()
      File "…/Vcs/neovim/src/clint.py", line 3618, in main
        ProcessFile(filename, _cpplint_state.verbose_level)
      File "…/Vcs/neovim/src/clint.py", line 3464, in ProcessFile
        'replace').read().split('\n')
      File "/usr/lib/python3.7/codecs.py", line 701, in read
        return self.reader.read(size)
      File "/usr/lib/python3.7/codecs.py", line 500, in read
        data = self.bytebuffer + newdata
    TypeError: can't concat str to bytes
2018-10-05 23:13:44 +02:00
39ad99b594 TUI: check libvte version for undercurl support #9088
Support was added in https://github.com/GNOME/vte/commit/efaf8f3c.

Fixes #9083
2018-10-05 14:54:04 +02:00
c05982cf35 vim-patch.sh: Skip Vim screen-dump files 2018-10-05 09:51:38 +02:00
c1c5c4f8e4 vim-patch:8.1.0440: remove() with a range not sufficiently tested (#9076)
Problem:    remove() with a range not sufficiently tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3497)
2bfddfc508
2018-10-04 18:40:59 +02:00
79b358facd Merge #9078 from janlazo/vim-8.0.1832 2018-10-04 11:43:56 +02:00
94e585944d Merge pull request #9081 from jamessan/embed-crash
Fix crash if --embed is used more than once
2018-10-03 10:04:54 -04:00
eb7b2c7912 Fix crash if --embed is used more than once 2018-10-03 07:29:08 -04:00
c0d835764f vim-patch:8.1.0047: no completion for :unlet $VAR
Problem:    No completion for :unlet $VAR.
Solution:   Add completion. (Jason Franklin)
1983401088
2018-10-02 22:47:47 -04:00
07fbdf4acc vim-patch:8.0.1832: cannot use :unlet for an environment variable
Problem:    Cannot use :unlet for an environment variable.
Solution:   Make it work.  Use unsetenv() if available.
            (Yasuhiro Matsumoto, closes vim/vim#2855)
137374fd65
2018-10-02 20:44:48 -04:00
65206714bc TUI: fix support for undercurl/underline color #9080 2018-10-03 00:35:25 +02:00
14ae394532 Merge pull request #9052 from blueyed/undercurl
tui: add support for undercurl and colored underline
2018-10-02 15:10:47 +02:00
171c80e227 Merge pull request #9064 from bfredl/uidoc
UI: rename ext_newgrid to ext_linegrid and add --embed UI startup recommendations
2018-10-02 10:55:47 +02:00
bab3b0ad45 ui: reserve the right to split a screen redraw into multiple batches. 2018-10-02 10:52:37 +02:00
43823acae2 ui: rename ext_newgrid to ext_linegrid 2018-10-01 21:24:15 +02:00
b98af01260 ui: update docs for safe startup procedure 2018-10-01 21:24:15 +02:00
c4006a621e tui: add support for undercurl and underline color
Fixes https://github.com/neovim/neovim/issues/7479.
2018-10-01 16:22:26 +02:00
8ac44984c4 Revert "TUI: terminfo_start: use unibi_from_term directly"
If $TERM is not defined then unibi_from_term() would crash.

Reverts 3bdc34d065.
ref #9072
2018-10-01 00:42:19 +02:00
e2647366c9 Merge pull request #9073 from blueyed/vim-patch-ff
vim-patch.sh: use --ff with git-pull
2018-09-30 18:36:19 -04:00
c2f337ce97 vim-patch.sh: use --ff with git-pull
I have `merge.ff = no` in my Git config to not use fast-forward merges
by default, but when updating the Vim sources it should not cause a
merge commit.

[ci skip]
2018-09-30 21:05:26 +02:00
3bdc34d065 TUI: terminfo_start: use unibi_from_term directly (#9072)
Avoids redundant call to `getenv("TERM")`.

Ref: e3b16d6219/uniutil.c (L203-L211)
2018-09-30 20:39:45 +02:00
3999aa755e man.vim: set $MANWIDTH=999
On some systems, mandoc disallows $MANWIDTH greater than 1000.
E.g. FreeBSD:
b7d613ae8a/contrib/mandoc/manpath.c (L312)

closes #9065
2018-09-30 18:35:19 +02:00
6c496db4b7 undo: Fix infinite loop if undo_read_byte returns EOF #2880
Problem:  Corrupt(?) persistent undofile leads to an infinite loop.
Solution: Break out of loop if undo_read_byte returns EOF (cf.
          u_read_undo() which does this too).

backtrace from lldb (@ a743297be2):

    Process 70700 stopped
    * thread 1: tid = 0x147d2d1, 0x00007fff8c8facd7 libsystem_pthread.dylib`__mtx_droplock + 209, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
        frame 0: 0x00007fff8c8facd7 libsystem_pthread.dylib`__mtx_droplock + 209
    libsystem_pthread.dylib`__mtx_droplock + 209:
    -> 0x7fff8c8facd7:  movq   %rcx, -0x50(%rbp)
       0x7fff8c8facdb:  movq   %r8, -0x58(%rbp)
       0x7fff8c8facdf:  movq   %rdx, -0x68(%rbp)
       0x7fff8c8face3:  movq   %r14, -0x60(%rbp)
    (lldb) bt
    * thread 1: tid = 0x147d2d1, 0x00007fff8c8facd7 libsystem_pthread.dylib`__mtx_droplock + 209, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
      * frame 0: 0x00007fff8c8facd7 libsystem_pthread.dylib`__mtx_droplock + 209
        frame 1: 0x00007fff8c8fab4e libsystem_pthread.dylib`pthread_mutex_unlock + 63
        frame 2: 0x00007fff915da2a4 libsystem_c.dylib`getc + 63
        frame 3: 0x000000010e6194b9 nvim`undo_read_byte(bi=0x00007fff5181a838) + 25 at undo.c:1553
        frame 4: 0x000000010e619685 nvim`unserialize_uhp(bi=0x00007fff5181a838, file_name=0x000000000f2e8060) + 421 at undo.c:840
        frame 5: 0x000000010e618abb nvim`u_read_undo(name=0x0000000000000000, hash=0x00007fff5181af80, orig_name=0x000000000f370dd0) + 1579 at undo.c:1363
        frame 6: 0x000000010e4a8db9 nvim`readfile(fname=0x000000000f370dd0, sfname=0x000000000f370dd0, from=0, lines_to_skip=0, lines_to_read=2147483647, eap=0x00007fff5181b6a0, flags=1) + 21017 at fileio.c:
    1961
        frame 7: 0x000000010e3ecc8b nvim`open_buffer(read_stdin=0, eap=0x00007fff5181b6a0, flags=0) + 603 at buffer.c:153
    ...

closes #2879
closes #2880
2018-09-30 17:54:24 +02:00
84fcba9b01 editorconfig: Fix charset name #9070
According to
https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties
the possible values of the charset property are "latin1", "utf-8",
"utf-16be", "utf-16le", or "utf-8-bom" (case insensitive), not "utf_8"

It breaks https://github.com/sgur/vim-editorconfig/ for example.
2018-09-30 17:02:19 +02:00
4c57169745 dialog_changed: Remove mistaken assert #9069
It fails with `nvim -u NONE -c 'set modified' -c 'confirm q'`.

Introduced in 3dffc842f (vim-patch:8.0.0983), but the Vim patch [1] does not
have this assertion.

NULL gets handled in `dialog_msg` [2].

1: 3f9a1ff141
2: c6d36b97ba/src/nvim/ex_docmd.c (L9704-L9705)
2018-09-30 15:47:02 +02:00
c6d36b97ba Merge #9067 from janlazo/vim-8.0.1485 2018-09-30 14:48:29 +02:00
9dcd5bd9c5 vim-patch:8.1.0067: syntax highlighting not working when re-entering a buffer
Problem:    Syntax highlighting not working when re-entering a buffer.
Solution:   Do force executing autocommands when not called recursively.
a5616b0136
2018-09-30 02:58:34 -04:00
6a680548ec vim-patch:8.1.0066: nasty autocommand causes using freed memory
Problem:    Nasty autocommand causes using freed memory. (Dominique Pelle)
Solution:   Do not force executing autocommands if the value of 'syntax' or
            'filetype' did not change.
c3ffc9b8d3
2018-09-30 02:51:04 -04:00
33ef959814 vim-patch:8.1.0068: nasty autocommands can still cause using freed memory
Problem:    Nasty autocommands can still cause using freed memory.
Solution:   Disallow using setloclist() and setqflist() recursively.
2f82ca7d79
2018-09-30 02:06:43 -04:00
cf7e351c24 lint 2018-09-29 22:11:50 -04:00
458a6f58b6 globals: arg_had_last is bool 2018-09-29 16:53:55 -04:00
63b1a7d0cf vim-patch:8.0.1485: weird autocmd may cause arglist to be changed recursively
Problem:    Weird autocmd may cause arglist to be changed recursively.
Solution:   Prevent recursively changing the argument list. (Christian
            Brabandt, closes vim/vim#2472)
9e33efd152
2018-09-29 16:45:51 -04:00
6e146d4132 test: check_cores(): Fix tmp dir exclusion (#9061)
tmpdir_get() may be an absolute path, but we invoke glob() with
a relative `initial_path`.

That can lead to this error:

    [  ERROR   ] test/functional/helpers.lua @ 752: after_each
    test/helpers.lua:95: cannot open ./Xtest-tmpdir/nvim8jKCjR: No such file or directory
    stack traceback:
            test/helpers.lua:95: in function 'glob'
            test/helpers.lua:273: in function 'check_cores'
            test/functional/helpers.lua:757: in function <test/functional/helpers.lua:752>
2018-09-28 08:58:22 +02:00
b09f173d93 vim-patch:8.1.0416: sort doesn't report deleted lines (#9062)
Problem:    Sort doesn't report deleted lines.
Solution:   Call msgmore(). (Christian Brabandt, closes vim/vim#3454)
b0e982bf05
2018-09-28 08:56:54 +02:00
64a8a8fd22 Merge pull request #9056 from bfredl/tui_repr
TUI code simplification and dead code elimination
2018-09-27 12:59:31 +02:00
33887206b9 Merge #9060 from janlazo/vim-8.1.0120 2018-09-27 10:47:37 +02:00
ba17bcfefc vim-patch:8.1.0435: cursorline highlight not removed in some situation (#9059)
Problem:    Cursorline highlight not removed in some situation. (Vitaly
            Yashin)
Solution:   Reset last_cursorline when resetting 'cursorline'. (Christian
            Brabandt, closes vim/vim#3481)
8c63e0ec31
2018-09-27 10:33:39 +02:00
a1976c7390 man.vim: Start at the top #9023
fixes #9057
2018-09-27 10:08:31 +02:00
96a34daab7 lint 2018-09-27 03:17:36 -04:00
edb26f2c65 tui: eliminate scrolling region data structure
The scrolling region is always local to a single grid_scroll event, use
local variables and parameters instead.

The invocation of reset_scroll_region in grid_resize is cargo-culted to use
margin reset under exactly the same circumstances, not sure if it is necessary
though.
2018-09-27 08:50:48 +02:00
25e6d37705 vim-patch:8.1.0120: buffer 'modified' set even when :sort has no changes
Problem:    Buffer 'modified' set even when :sort has no changes.
Solution:   Only set 'modified' when lines are moved. (Jason Franklin)
dc9e955fb0
2018-09-26 21:32:45 -04:00
1b8939d233 tui: eliminate grid->attrs, use indexed cell->attr
remove dead ugrid_put
2018-09-26 19:30:21 +02:00
fc18fad74f Merge #9053 from janlazo/vim-8.1.0433 2018-09-26 08:13:21 +02:00
c6350e4150 vim-patch:8.1.0436: can get the text of inputsecret() with getcmdline()
Problem:    Can get the text of inputsecret() with getcmdline(). (Tommy Allen)
Solution:   Don't return the text.
ee91c33570
2018-09-25 23:13:29 -04:00
28ac4a99f2 vim-patch:8.1.0433: mapping can obtain text from inputsecret()
Problem:    Mapping can obtain text from inputsecret(). (Tommy Allen)
Solution:   Disallow CTRL-R = and CTRL-\ e when using inputsecret().
31cbadf74b
2018-09-25 23:09:51 -04:00
8240b8b596 terminal: Redraw statusline on title change #8973
The statusline may incorporate b:term_title, so redraw it when that
title changes.

Introduce a new function status_redraw_buf to redraw windows associated
with the current buffer.
2018-09-25 08:47:48 +02:00
7862c3ae3e Merge #9047 from jamessan/log-crash 2018-09-25 08:07:51 +02:00
7bff9a5de8 TUI: Alacritty supports DECSCUSR (#9048)
Alacritty may set TERM to"alacritty" or "alacritty-direct" if it finds its terminfo.
2018-09-25 07:54:25 +02:00
d59bf058ab log: Assert that we haven't started freeing memory before logging
This is to catch situations like the previous commit, which somehow
avoided detection by any of the CI builds.
2018-09-24 22:56:24 -04:00
1bd916df35 os_unix: Log exit code before freeing all memory
When building with -DEXITFREE, the ILOG call would result in a crash
trying to access VV_PROGPATH, which had already been released:

    (gdb) bt
    #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
    #1  0x00007f8f761082f1 in __GI_abort () at abort.c:79
    #2  0x00007f8f760ffa8a in __assert_fail_base (fmt=0x7f8f76253ec8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
        assertion=assertion@entry=0x1c74280 <.str.8> " ,\t\n", file=file@entry=0x1c73fe2 "256]'", line=line@entry=610,
        function=function@entry=0x1c742e0 <.str.9+32> "") at assert.c:92
    #3  0x00007f8f760ffb02 in __GI___assert_fail (assertion=0x1c74280 <.str.8> " ,\t\n", file=0x1c73fe2 "256]'", line=610,
        function=0x1c742e0 <.str.9+32> "") at assert.c:101
    #4  0x00000000012d87c1 in vim_getenv (name=0x2f5a460 <get_special_key_name.string+64> "NVIM_LOG_FILE") at ../src/nvim/os/env.c:608
    #5  0x00000000012d6538 in expand_env_esc (srcp=0x1c2f4e0 <.str.10+32> "",
        dst=0x2f5a460 <get_special_key_name.string+64> "NVIM_LOG_FILE", dstlen=4095, esc=false, one=false, prefix=0x0)
        at ../src/nvim/os/env.c:351
    #6  0x00000000012d85af in expand_env_esc (srcp=0x625000000100 "\004", dst=0x7ffeed88cf40 "", dstlen=32766, esc=237, one=136,
        prefix=0x60200401c8b4 <error: Cannot access memory at address 0x60200401c8b4>) at ../src/nvim/os/env.c:472
    #7  0x0000000000eb4274 in do_log_to_file (log_file=0x0, log_level=0, context=0x0, func_name=0x0, line_num=0, eol=false, fmt=0x0)
        at ../src/nvim/log.c:254
    #8  0x0000000000eb305b in open_log_file () at ../src/nvim/log.c:164
    #9  0x0000000000eb2cc6 in logmsg (log_level=<error reading variable: Cannot access memory at address 0x268>,
        context=<error reading variable: Cannot access memory at address 0x260>,
        func_name=<error reading variable: Cannot access memory at address 0x258>,
        line_num=<error reading variable: Cannot access memory at address 0x254>,
        eol=<error reading variable: Cannot access memory at address 0x253>,
        fmt=<error reading variable: Cannot access memory at address 0x248>) at ../src/nvim/log.c:109
    #10 0x00000000013022c7 in mch_free_acl (aclent=0x4f59100) at ../src/nvim/os_unix.c:132
    #11 0x0000000000efddac in getout (exitval=0) at ../src/nvim/main.c:681
    #12 0x0000000000c1bb3e in ex_quit (eap=0x7ffeed88cd00) at ../src/nvim/ex_docmd.c:6067
    #13 0x0000000000bab781 in do_one_cmd (cmdlinep=0x7ffeed88f180, flags=10, cstack=0x7ffeed88f1a0, fgetline=0x0, cookie=0x0)
        at ../src/nvim/ex_docmd.c:2228
    #14 0x0000000000b8de6d in do_cmdline (cmdline=0x7ffeed891ae2 "quit", fgetline=0x0, cookie=0x0, flags=10)
        at ../src/nvim/ex_docmd.c:592
    #15 0x0000000000b94036 in do_cmdline_cmd (cmd=0x7ffeed891ae2 "quit") at ../src/nvim/ex_docmd.c:268
    #16 0x0000000000efb900 in exe_commands (parmp=0x7ffeed890900) at ../src/nvim/main.c:1699
    #17 0x0000000000ee96b2 in main (argc=11, argv=0x7ffeed890fa8) at ../src/nvim/main.c:524
2018-09-24 22:56:19 -04:00
59b2e6d35d deps: revert to jemalloc 4.5.0 (#9035)
- Since the jemalloc upgrade to 5.1.0, I'm seeing weird behavior such as
  infinite loops inside jemalloc routines.
- VimR maintainer reported major performance regression correlated with
  jemalloc 5.1.0.

ref https://github.com/neovim/neovim/pull/7808

reverts 765515010f
2018-09-25 00:06:52 +02:00
200c8b9cca build: Unify USE_BUNDLED, USE_BUNDLED_DEPS (#9046)
It's confusing that the Makefile uses a different name than CMake.
2018-09-24 23:18:48 +02:00
8cb04c2230 fixed lint errors 2018-09-24 22:05:01 +02:00
50c22325df src/nvim/eval.c: printf error 2018-09-24 21:31:57 +02:00
affef0aab8 add func_attr_printf in :
log.c
message.c
strings.c

fixed some printf warnings in:

src/nvim/undo.c
src/nvim/eval.c
src/nvim/eval/encode.c
src/nvim/eval/typval.c
src/nvim/ex_getln.c
src/nvim/fileio.c
src/nvim/lua/executor.c
src/nvim/main.c
src/nvim/regexp_nfa.c
src/nvim/shada.c
src/nvim/spellfile.c
src/nvim/tui/terminfo.c
src/nvim/garray.h
2018-09-24 21:28:04 +02:00
044cd242e7 vim-patch:8.1.0428: the :suspend command is not tested (#9043)
Problem:    The :suspend command is not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3472)
3b30168f04
2018-09-24 01:59:42 +02:00
248478f5a0 vim-patch:8.1.0429: no test for :lcd with 'shellslash' (#9041)
Problem:    No test for :lcd with 'shellslash'.
Solution:   Add a test. (Daniel Hahler, closes vim/vim#3475)
c75878c923

Related NA patch:
vim-patch:8.1.0343
2018-09-23 21:46:21 +02:00
1a1164339a Merge pull request #9039 from blueyed/undercurl
tui: code consistency in update_attrs
2018-09-23 20:30:56 +02:00
535ef67ef0 minor: tui: update_attrs: code consistency 2018-09-23 19:34:39 +02:00
f8f83579ff Merge #9034 'swapfile: always show dialog' 2018-09-23 18:51:39 +02:00
d3c90cbbb4 vim-patch:8.0.1557: printf() does not work with only one argument (#9038)
Problem:    printf() does not work with only one argument. (Daniel Hahler)
Solution:   Allow using just the format. (Ken Takata, closes vim/vim#2687)
c71807db9c
2018-09-23 17:15:17 +02:00
990c147de3 test: Do not load entire log-file into memory
With DEBUG-level logging, after `make test`, log file could be 1+ GB.
2018-09-23 15:58:02 +02:00
22c83a4de9 swapfile: Always show swap dialog (E325)
If swapfile dialog prompts for input, it must be displayed to the user.

fix #8840
fix #9027
2018-09-23 15:58:01 +02:00
c3d24368a1 shortmess+=F: Hide :bnext, :bprev fileinfo messages 2018-09-23 15:58:01 +02:00
9183e2c67e vim-patch:8.1.0389: :behave command is not tested (#9030)
Problem:    :behave command is not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3429)
da1f71d75f
2018-09-23 10:55:06 +02:00
eee93f36d8 Merge #9031 from janlazo/vim-8.1.0414 2018-09-23 10:53:57 +02:00
197d907e09 func_attr.h: FUNC_ATTR_PRINTF 2018-09-23 10:49:20 +02:00
bcc174e6df vim-patch:8.0.0370: invalid memory access when setting wildchar empty
Problem:    Invalid memory access when setting wildchar empty.
Solution:   Avoid going over the end of the option value. (Dominique Pelle,
            closes vim/vim#1509)  Make option test check all number options with
            empty value.
a12e40351d
2018-09-23 00:59:11 -04:00
fe191d95a2 vim-patch:8.0.0368: not all options are tested with a range of values
Problem:    Not all options are tested with a range of values.
Solution:   Generate a test script from the source code.
2f5463df01
2018-09-22 17:12:07 -04:00
a52c38d790 vim-patch:8.1.0414: v:option_old is cleared when using :set in OptionSet autocmd
Problem:    v:option_old and v:option_new are cleared when using :set in
            OptionSet autocmd. (Gary Johnson)
Solution:   Don't trigger OptionSet recursively.
3f3fb0b147
2018-09-22 17:10:16 -04:00
2b06c32a23 Merge #8898 from justinmk/vim-8.1.0310
vim-patch:8.1.0310: file info msg with 'F' in 'shortmess'
2018-09-22 18:53:16 +02:00
c236e80cf3 Merge pull request #9024 from bfredl/embed_ui2
always wait for UI with --embed, unless --headless is supplied
2018-09-22 10:20:23 +02:00
4da5cb38d3 startup: always wait for UI with --embed, unless --headless also is supplied 2018-09-22 10:18:28 +02:00
7f990741f7 TUI: Reset cursor color when applicable #8572
Resets the TUI cursor color if:
- current 'guicursor' mode does not specify a highlight group
- cursor highlight group has "inverse" or "reverse" flag
- on Nvim exit

We interpret,  "inverse" to mean "default cursor".

Example:

    hi Cursor guifg=bg guibg=fg
    set termguicolors
    set guicursor=n-v-c-sm:block,i-ci-ve:ver25-Cursor,r-cr-o:hor20

    * When the cursor shape is block, its color will be "inverse"
    * When the cursor shape is I-beam, its color will be `hi Cursor`.

This is useful e.g. to prevent `set listchars=eol:¬` causing your cursor
color to a low contrast color in insert mode because you cursor are
often at EOL in insert mode.

close #8572
2018-09-22 03:07:21 +02:00
28b5a637b5 test/old: test_options: Accommodate Nvim default 2018-09-21 22:35:20 +02:00
efbc33cbbc vim-patch:8.1.0310: file info msg with 'F' in 'shortmess'
Problem:    File info message not always suppressed with 'F' in 'shortmess'.
            (Asheq Imran)
Solution:   Save and restore msg_silent. (Christian Brabandt, closes vim/vim#3221)
2f0f871159

ref #8840
ref #9027
2018-09-21 22:35:09 +02:00
4fa3492a6f Merge #9023 2018-09-21 21:59:54 +02:00
ac4d5d9935 vim-patch:8.0.0682: no test for synIDtrans() (#8966)
Problem:    No test for synIDtrans().
Solution:   Add a test. (Dominique Pelle, closes vim/vim#1796)
0b2eef24bc
2018-09-21 10:27:50 +02:00
dc256e376d man.vim: Fix very long justified lines #9023
When nroff justifies a line, it fills the line with whitespace to meet
$MANWIDTH.  With $MANWIDTH=9999, that of course results in nonsense (and
behaves poorly with 'cursorline' option).

To work around that, instead of trying to hard-justify the lines, just
replace the mega-whitespace with a fixed size of 10 spaces.

Perhaps N/Vim needs a "soft justify" feature?
2018-09-21 10:17:37 +02:00
9081cad514 man.vim: Ignore $MANWIDTH, use soft wrap #9023
fix #9017
close #9023
2018-09-21 10:17:37 +02:00
ecdd2df88a shell/logging: Fix E730 with verbose system({List}) #9009
ref https://github.com/neovim/neovim/issues/9001#issuecomment-421843790

Steps to reproduce:
    :set verbose=9
    :call system(['echo'])
    E730: using List as a String
2018-09-21 09:20:04 +02:00
ad6bbe4468 Merge #9022 from janlazo/vim-8.0.1215 2018-09-21 08:20:20 +02:00
01b2fa53f4 lint 2018-09-21 00:05:06 -04:00
300a7a4cf4 replace fallthrough comment with macro
Follow-up of vim-patch:8.0.1215
2018-09-21 00:05:06 -04:00
e55ebae373 Merge pull request #9021 from bfredl/embed_fix
startup: don't erase screen on `:hi Normal` during startup (for non-newgrid UIs)
2018-09-20 15:20:40 +02:00
6a329b0548 vim-patch:8.0.1215: newer gcc warns for implicit fallthrough
Problem:    Newer gcc warns for implicit fallthrough.
Solution:   Consistently use a FALLTHROUGH comment. (Christian Brabandt)
2f40d129bf
2018-09-20 06:59:04 -04:00
5487624730 startup: don't erase screen on :hi Normal during startup
NB: existing `color default` test was actually enough to trigger the bug,
when ext_newgrid=false is used. I created the `:hi Normal` test as
I thought the builtin colors wouldn't set Normal (unless 'bg' is changed)
But as the root cause actually comes from `:hi Normal`, it makes sense
to still add the separate test (if `color default` here gets optimized to
become a no-op, or something).
2018-09-20 12:25:31 +02:00
47d74bf32f doc: test/README.md (#9020)
- testdir location
- no old style tests are left in the fixed list in the Makefile

[ci skip]
2018-09-20 09:37:53 +02:00
8b60253ce7 cleanup/TUI: remove old unused code #9013
- Checks for ECHOE, ICANON were left over from Vim code. We already
  reference the symbols elsewhere without checking.
- newline_on_exit, intr_char: Both are vestigial remnants of Vim 4.x,
  not implemented in Nvim. intr_char is a termios/stty feature, it's
  probably not useful because users have other ways to configure their
  terminals.
2018-09-19 07:59:09 +02:00
d0401e827b Merge #9014 from justinmk/log-more 2018-09-19 07:55:46 +02:00
7c00b9efca log: RPC, input, other events 2018-09-19 01:11:09 +02:00
b9bcfa9bc8 log: rename do_log to logmsg 2018-09-19 00:58:25 +02:00
a316258d2c test: system_spec: remove redundant clear() 2018-09-19 00:49:18 +02:00
809fff94e6 Merge pull request #8754 from bfredl/embed_ui
startup: make --embed wait for first request so embedding UI can display startup messages
2018-09-18 20:52:13 +02:00
bd8d43c6fe startup: wait for embedder before executing startup commands and files
Give embeders a chance to set up nvim, by processing a request before
startup. This allows an external UI to show messages and prompts from
--cmd and buffer loading (e.g. swap files)
2018-09-18 19:22:16 +02:00
32ad52ae04 TUI: Skip redundant "stop" event (macOS kernel panic) (#9007)
When the TUI suspends (:suspend, CTRL-z) it calls tui_terminal_stop (but
does NOT set `ui->data=NULL`, so `tui_is_stopped` returns false). If the
host terminal dies, it sends SIGCONT, SIGHUP (usually in that order):

    ERROR 2018-09-16T19:30:17.065 25821 suspend_event:1153: SIGCONT
    ERROR 2018-09-16T19:30:17.065 25821 on_signal:162: SIGHUP
    ERROR 2018-09-16T19:30:17.155 25821 on_signal:162: SIGHUP

Race: if SIGHUP is handled before SIGCONT, it calls ui_builtin_stop()
which schedules tui_stop before the TUI was resumed?

libuv uv_close() aborts if the handle is already closed/closing.
Somehow that causes macOS to panic. #8075

    Assertion failed: (!uv__is_closing(handle)), function uv_close, file src/unix/core.c, line 117.

    Thread 0:: Dispatch queue: com.apple.main-thread
    0   libsystem_kernel.dylib        	0x00007fff67d69ec2 kevent + 10
    1   libuv.1.dylib                 	0x000000010609304d uv__io_poll + 892
    2   libuv.1.dylib                 	0x0000000106083904 uv_run + 339
    3   nvim                          	0x0000000105e76f7b loop_poll_events + 74
    4   nvim                          	0x0000000105fa5f51 ui_bridge_stop + 206
    5   nvim                          	0x0000000105fa4c00 ui_builtin_stop + 50
    6   nvim                          	0x0000000105f26ee9 mch_exit + 29
    7   nvim                          	0x0000000105eda84a getout + 518
    8   nvim                          	0x0000000105e778b3 multiqueue_process_events + 77
    9   nvim                          	0x0000000105f24c5a os_breakcheck + 49
    10  nvim                          	0x0000000105eb7ea3 auto_next_pat + 463
    11  nvim                          	0x0000000105eb7603 apply_autocmds_group + 1289
    12  nvim                          	0x0000000105eb0e8d apply_autocmds + 36
    13  nvim                          	0x0000000105f5a412 screenalloc + 1892
    14  nvim                          	0x0000000105f5b223 screen_resize + 190
    15  nvim                          	0x0000000105fa52e3 ui_refresh + 257
    16  nvim                          	0x0000000105e8c3d9 do_cmdline + 6614
    17  nvim                          	0x0000000105f03a72 normal_execute + 3996
    18  nvim                          	0x0000000105f89925 state_enter + 164
    19  nvim                          	0x0000000105efe08d normal_enter + 125
    20  nvim                          	0x0000000105ed9ffd main + 6858
    21  libdyld.dylib                 	0x00007fff67c19115 start + 1

    Thread 1 Crashed:
    0   libsystem_kernel.dylib        	0x00007fff67d68e3e __pthread_kill + 10
    1   libsystem_pthread.dylib       	0x00007fff67ea7150 pthread_kill + 333
    2   libsystem_c.dylib             	0x00007fff67cc5312 abort + 127
    3   libsystem_c.dylib             	0x00007fff67c8d368 __assert_rtn + 320
    4   libuv.1.dylib                 	0x00000001060835bf uv_close + 247
    5   nvim                          	0x0000000105fa0ebb tui_terminal_stop + 221
    6   nvim                          	0x0000000105f9ff3d tui_stop + 14
    7   nvim                          	0x0000000105e778b3 multiqueue_process_events + 77
    8   nvim                          	0x0000000105fa0c89 tui_main + 302
    9   libsystem_pthread.dylib       	0x00007fff67ea46c1 _pthread_body + 340
    10  libsystem_pthread.dylib       	0x00007fff67ea456d _pthread_start + 377
    11  libsystem_pthread.dylib       	0x00007fff67ea3c5d thread_start + 13

TODO:
- Set `ui->data = NULL` to flag UI as "stopped"? But loop_poll_events
  drains *all* fast_events, so could skip some events...
2018-09-18 08:16:38 +02:00
0a4d7ce669 Merge pull request #9011 from janlazo/vim-8.0.1428
vim-patch:8.0.{1428,1443}
2018-09-18 07:21:24 +02:00
58559a2249 vim-patch:8.0.1443: compiler complains about uninitialized variable
Problem:    Compiler complains about uninitialized variable. (Tony Mechelynck)
Solution:   Assign a value to the variable.
059fd01021
2018-09-17 22:40:29 -04:00
a00247e147 vim-patch:8.0.1428: compiler warning on 64 bit MS-Windows system
Problem:    Compiler warning on 64 bit MS-Windows system.
Solution:   Change type from "int" to "size_t". (Mike Williams)
200ea8ffaa
2018-09-17 22:38:10 -04:00
8de87c7b1c Merge pull request #8180 from bfredl/eol_text
support "virtual text" annotations (currently after EOL only)
2018-09-17 15:36:10 +02:00
45f53b370b buffer: add support for virtual text annotations 2018-09-17 10:41:29 +02:00
398b9fde85 Merge #9008 from janlazo/vim-8.0.1416 2018-09-17 10:40:48 +02:00
a0ada7dac4 lint 2018-09-16 20:55:59 -04:00
0b60372792 vim-patch:8.0.1417: test doesn't search for a sentence
Problem:    Test doesn't search for a sentence. Still fails when searching for
            start of sentence. (Dominique Pelle)
Solution:   Add paren. Check for MAXCOL in dec().
1bd999f982
2018-09-16 20:55:46 -04:00
91352b36b7 vim-patch:8.0.1416: crash when searching for a sentence
Problem:    Crash when searching for a sentence.
Solution:   Return NUL when getting character at MAXCOL. (closes vim/vim#2468)
8ada6aa929
2018-09-16 20:46:06 -04:00
9f1401e25c Merge #9004 from janlazo/vim-8.0.1374 2018-09-17 00:12:31 +02:00
17ab6dc12b Merge #9005 from janlazo/vim-8.0.1395 2018-09-16 23:44:29 +02:00
6beb5cf439 oldtests: set nrformats to Vim default 2018-09-16 17:39:50 -04:00
567c0e6cd7 runtime/colors: move check_colors.vim to runtime/tools 2018-09-16 17:08:23 -04:00
9c98e4845a vim-patch:8.0.1400: color scheme check script shows up as color scheme
Problem:    Color scheme check script shows up as color scheme.
Solution:   Move it to the "tools" subdirectory. (closes vim/vim#2457)
8ee2d36e21
2018-09-16 10:56:53 -04:00
7f762a2e09 vim-patch:8.0.1395: it is not easy to see if a colorscheme is well written
Problem:    It is not easy to see if a colorscheme is well written.
Solution:   Add a script that checks for common mistakes. (Christian Brabandt)
200d0e36bc
2018-09-16 10:54:44 -04:00
3c3c733c3c vim-patch:8.0.1374: CTRL-A does not work with an empty line
Problem:    CTRL-A does not work with an empty line. (Alex)
Solution:   Decrement the end only once. (Hirohito Higashi, closes vim/vim#2387)
5fe6bdf858
2018-09-16 10:24:59 -04:00
b2d7b70f4d loop_close: Drain thread_events (#8990)
loop_schedule_deferred may leak its allocated Event if the Event does
not get processed (when Nvim exits).

It only happens on exit, so we tried to ignore it in .asan-blacklist,
but for that isn't working for unknown reasons.

    = ==22007==ERROR: LeakSanitizer: detected memory leaks
    = Direct leak of 88 byte(s) in 1 object(s) allocated from:
    =      0 0x4ef7a3 in malloc /local/mnt/workspace/tmp/ubuntu_rel/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:67:3
    =      1 0xfcafc1 in try_malloc /home/travis/build/neovim/neovim/build/../src/nvim/memory.c:88:15
    =      2 0xfcb1e9 in xmalloc /home/travis/build/neovim/neovim/build/../src/nvim/memory.c:122:15
    =      3 0xa6e75f in loop_schedule_deferred /home/travis/build/neovim/neovim/build/../src/nvim/event/loop.c:91:19
    =      4 0x18ab048 in tui_main /home/travis/build/neovim/neovim/build/../src/nvim/tui/tui.c:377:5
    =      5 0x18fe120 in ui_thread_run /home/travis/build/neovim/neovim/build/../src/nvim/ui_bridge.c:102:3
    =      6 0x7f09e5e58183 in start_thread /build/eglibc-ripdx6/eglibc-2.19/nptl/pthread_create.c:312
    = SUMMARY: AddressSanitizer: 88 byte(s) leaked in 1 allocation(s).
2018-09-16 11:22:32 +02:00
9ed46a77e6 vim-patch:8.1.0355 Incorrect adjusting the popup menu (#8996)
Problem:    Incorrect adjusting the popup menu for the preview window.
Solution:   Compute position and height properl. (Ronan Pigott)  Also show at
            least ten items. (closes vim/vim#3414)
2018-09-16 11:15:46 +02:00
3bce5207cf vim-patch:8.0.1363: recover swap file ending with .stz #9002
Problem:    Recovering does not work when swap file ends in .stz.
Solution:   Check for all possible swap file names. (Elfling, closes vim/vim#2395,
            closes vim/vim#2396)
af903e5d49
2018-09-16 11:12:20 +02:00
dadcfe22ca Merge #8998 from janlazo/vim-8.0.1275 2018-09-14 19:21:09 +02:00
c03e8307d2 vim-patch:8.0.1201: "yL" is affected by 'scrolloff' (#8997)
Problem:    "yL" is affected by 'scrolloff'. (Eli the Bearded)
Solution:   Don't use 'scrolloff' when an operator is pending.
44cc4cf72f
2018-09-14 19:16:30 +02:00
1bc44a805a Merge #8993 from janlazo/vim-8.0.1184 2018-09-14 19:12:18 +02:00
a6d4a2fb8d lint 2018-09-14 01:02:34 -04:00
db90c0c9bf globals: KeyTyped is bool 2018-09-14 01:01:00 -04:00
20354dbd75 vim-patch:8.0.1275: CmdlineLeave autocmd prevents fold from opening
Problem:    CmdlineLeave autocmd prevents fold from opening. (Waivek)
Solution:   Save and restore KeyTyped. (closes vim/vim#2305)
c9e9c71409
2018-09-13 23:08:16 -04:00
315a8d2217 vim-patch:8.1.0175: marks test fails in very wide window
Problem:    Marks test fails in very wide window. (Vladimir Lomov)
Solution:   Extend the text to match 'columns'. (closes vim/vim#3180, closes vim/vim#3181)
bde14d8e24
2018-09-13 20:13:02 -04:00
64e74dc784 vim-patch:8.1.0168: output of :marks is too short with multi-byte chars
Problem:    Output of :marks is too short with multi-byte chars. (Tony
            Mechelynck)
Solution:   Get more bytes from the text line.
9d5185bf9d
2018-09-13 20:13:02 -04:00
a78d465927 vim-patch:8.0.1184: the :marks command is not tested
Problem:    The :marks command is not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#2197)
9b69f22e66
2018-09-13 20:13:02 -04:00
ae8515a544 Merge pull request #8995 from wsdjeg/patch-1
Make neovim timer ID start from 1
2018-09-13 21:17:42 +02:00
f6d5426fc8 Update eval.c 2018-09-13 21:55:20 +08:00
949bcd7810 Merge pull request #8992 from bfredl/cmd-snr
getchar: allow <SID> in <Cmd> mapping
2018-09-13 14:45:43 +02:00
5056d40b16 getchar: allow <SID> in <Cmd> mapping 2018-09-13 11:02:24 +02:00
d0c8dfc578 vim-patch:8.0.1089: range count in user command
Problem:    Cannot get range count in user command.
Solution:   Add <range> argument.
c168bd4bd3

close #8946
2018-09-13 10:20:34 +02:00
ea5337d9b5 vim-patch:8.0.1172: when E734 is given option is still set (#8988)
Problem:    When E734 is given option is still set.
Solution:   Assign NULL to "s". (Christian Brabandt)
2a6a6c3014
2018-09-13 07:52:31 +02:00
d5702a4534 Merge #8987 from justinmk/vim-8.1.0373 2018-09-13 01:51:17 +02:00
021f67df12 style: indent, then lint 2018-09-13 01:18:12 +02:00
ba27284f07 vim-patch:8.1.0374: moving the cursor is slow when 'relativenumber' is set
Problem:    Moving the cursor is slow when 'relativenumber' is set.
Solution:   Only redraw the number column, not all lines.
bd9a53c06c
2018-09-13 01:08:12 +02:00
e7a9c76ab0 vim-patch:8.1.0373: screen updating still slow when 'cursorline' is set
Problem:    Screen updating still slow when 'cursorline' is set.
Solution:   Fix setting last_cursorline.
1b7fefcbce
2018-09-13 00:32:14 +02:00
656648d855 Merge #8913 'popupmenu placement'
close #8913
2018-09-13 00:29:00 +02:00
59c5c4f006 test: popupmenu placement 2018-09-13 00:27:42 +02:00
a5fe6d34a9 vim-patch:8.0.1161 2018-09-13 00:27:32 +02:00
26b2c1fe15 popupmnu.c: Fix popup placement when preview window is below 2018-09-13 00:27:31 +02:00
7a26b9b62b vim-patch:8.1.0372: screen updating slow when 'cursorline' is set (#8986)
Problem:    Screen updating slow when 'cursorline' is set.
Solution:   Only redraw the old and new cursor line, not all lines.
90a997987d
2018-09-12 23:06:26 +02:00
9124bb755c Merge pull request #8985 from justinmk/ui-no-clearall
UI/cleanup: Remove most redraw_later_clear() calls
2018-09-12 21:37:55 +02:00
90b7d25882 do_shell, do_filter: Remove "clear screen", "wait for return" calls
The output from shell commands is already handled by the messages.c/UI
layer.
2018-09-12 08:30:26 +02:00
31c3d54668 UI/cleanup: Remove most redraw_later_clear() calls
Vim :! may "mess up the screen" because of e.g. switching between cooked
mode, but Nvim just uses pipes. So maybe we can avoid these
redraw_later_clear() CYA calls.
2018-09-12 08:30:26 +02:00
931e15471c Merge #8984 from janlazo/vim-8.1.0034 2018-09-12 07:36:28 +02:00
e15c34fbc2 lint 2018-09-11 23:04:54 -04:00
38c52c63ac vim-patch:8.0.1809: various typos
Problem:    Various typos.
Solution:   Correct the mistakes, change "cursur" to "cursor". (closes vim/vim#2887)
b946482190
2018-09-11 23:02:22 -04:00
8a845ab3ef vim-patch:8.1.0219: expanding ## fails to escape backtick
Problem:    Expanding ## fails to escape backtick.
Solution:   Escape a backtick in a file name. (closes vim/vim#3257)
2c8c681bfc
2018-09-11 22:42:17 -04:00
a021b30ede vim-patch:8.1.0034: cursor not restored with ":edit #"
Problem:    Cursor not restored with ":edit #".
Solution:   Don't assume autocommands moved the cursor when it was moved to
            the first non-blank.
adb8fbec4f
2018-09-11 19:23:04 -04:00
61df24b998 vim-patch:8.0.1154: 'indentkeys' does not work properly (#8980)
Problem:    'indentkeys' does not work properly. (Gary Johnson)
Solution:   Get the cursor line again. (Christian Brabandt, closes vim/vim#2151)
1b38344e00
2018-09-11 19:55:46 +02:00
d6b3c09129 Merge pull request #8945 from ZviRackover/fix-7401-step5
mbyte: remove mb_char2bytes
2018-09-11 09:03:09 +02:00
036051b218 Merge pull request #8974 from janlazo/vim-8.0.1377 2018-09-11 08:33:21 +02:00
77628d90a4 Merge pull request #8979 from janlazo/vim-8.1.0174 2018-09-11 08:26:24 +02:00
566f573378 move: dir in onepage() is Direction
Move vim.h in move.h to implicitly include buffer_defs.h and pos.h.
2018-09-10 23:16:16 -04:00
1a43aef9ec move: drop has_mbyte check
has_mbyte is always true in nvim.
2018-09-10 23:01:45 -04:00
e1fa242a6c vim-patch:8.1.0174: after paging up and down fold line is wrong
Problem:    After paging up and down fold line is wrong.
Solution:   Correct the computation of w_topline and w_botline. (Hirohito
            Higashi)
907dad72ef
2018-09-10 20:34:34 -04:00
d4e6a75a06 Merge pull request #8971 from bfredl/flush_on_exit
ui: flush UI state on exit
2018-09-10 18:58:06 +02:00
207cfce3de vim-patch:8.1.0011: maparg() and mapcheck() confuse empty and non-existing (#8976)
Problem:    maparg() and mapcheck() confuse empty and non-existing.
Solution:   Return <Nop> for an existing non-empty mapping. (closes vim/vim#2940)
f88a5bc102
2018-09-10 09:27:04 +02:00
d9fcd43638 Merge #8967 'vim-patch:8.0.1781' 2018-09-10 09:24:16 +02:00
0c80fead86 vim-patch:8.0.1781: file names in quickfix window are not shortened
Problem:    File names in quickfix window are not always shortened.
Solution:   Shorten the file name when opening the quickfix window. (Yegappan
            Lakshmanan, closes vim/vim#2851, closes vim/vim#2846)
a796d46f29
2018-09-10 06:45:13 +02:00
39ab7cc6fb vim-patch:8.0.1378: autoload script sources itself when defining function
Problem:    Autoload script sources itself when defining function.
Solution:   Pass TFN_NO_AUTOLOAD to trans_function_name(). (Yasuhiro
            Matsumoto, closes vim/vim#2423)
3388d33457
2018-09-09 20:30:32 -04:00
3fd9ffd368 vim-patch:8.0.1377: cannot call a dict function in autoloaded dict
Problem:    Cannot call a dict function in autoloaded dict.
Solution:   Call get_lval() passing the read-only flag.
6e65d594aa
2018-09-09 18:12:25 -04:00
bbbed9fc66 Merge #8063 from blueyed/vim-8.0.0708 2018-09-09 19:54:27 +02:00
dd0dd4d78d vim-patch:8.0.1115: crash when using foldtextresult() recursively (#8972)
Problem:    Crash when using foldtextresult() recursively.
Solution:   Avoid recursive calls. (Yasuhiro Matsumoto, closes vim/vim#2098)
495b7dd213
2018-09-09 19:22:10 +02:00
d47af7f10e CI/Codecov: disable changes status
It fails PRs which otherwise would succeed (e.g. #8971), and the Codecov
status page doesn't load, so we can't see what it's complaining about.

Reverts 5c7237640f
ref #8910
2018-09-09 19:12:32 +02:00
088ae23e4e ui: flush UI state on exit 2018-09-09 16:42:53 +02:00
c5790d9189 Merge pull request #8915 from rickyz/line_wrapping
Fix terminal line wrapping detection in the TUI.
2018-09-09 12:44:03 +02:00
e50ff1b2e9 Merge #8970 from janlazo/vim-8.0.0749 2018-09-09 12:37:28 +02:00
a8bd4de28a Merge #8969 from janlazo/vim-8.0.1006 2018-09-09 11:29:18 +02:00
329cfc3303 lint: clean-up after parent commits 2018-09-09 10:45:50 +03:00
ac13e65ae0 Remove has_mbytes local to lines changed in parent commit 2018-09-09 10:45:50 +03:00
cbdbc4f63d Refactor: Remove occurences of mb_char2bytes 2018-09-09 10:45:50 +03:00
49647ae973 digraph: delete code that checks enc_utf8
enc_utf8 is always true in nvim.
2018-09-08 23:42:14 -04:00
03bcfb54db digraph: refactor code that checks has_mbyte
has_mbyte is always true in nvim.
2018-09-08 23:42:14 -04:00
95608136d5 tests: update expected output of :digraph command 2018-09-08 22:28:35 -04:00
5f1a5d264a vim-patch:8.0.0749: some unicode digraphs are hard to remember
Problem:    Some unicode digraphs are hard to remember.
Solution:   Add alternatives with a backtick. (Chris Harding, closes vim/vim#1861)
816e7660e1
2018-09-08 21:29:47 -04:00
40e894f595 oldtests: win: fix buffer pathsep 2018-09-08 12:25:19 -04:00
3794e83d98 vim-patch:8.0.1040: cannot use another error format in getqflist()
Problem:    Cannot use another error format in getqflist().
Solution:   Add the "efm" argument to getqflist(). (Yegappan Lakshmanan)
3653822546
2018-09-08 11:52:59 -04:00
a8b996160d lint 2018-09-08 11:31:55 -04:00
213a66441f vim-patch:8.0.1031: "text" argument for getqflist() is confusing
Problem:    "text" argument for getqflist() is confusing. (Lcd47)
Solution:   Use "lines" instead. (Yegappan Lakshmanan)
2c809b7c7d
2018-09-08 11:31:24 -04:00
1790f81f56 vim-patch:8.0.1029: return value of getqflist() is inconsistent
Problem:    Return value of getqflist() is inconsistent.  (Lcd47)
Solution:   Always return an "items" entry.
da73253a0b
2018-09-08 10:43:30 -04:00
fe81b926d3 test_largefile.vim: adjust comment to run it 2018-09-08 16:43:27 +02:00
53eb835e8f vim-patch:8.0.1326: largefile test fails on CI, glob test on MS-Windows
Problem:    Largefile test fails on CI, glob test on MS-Windows.
Solution:   Remove largefile test from list of all tests. Don't run
            Test_glob() on non-unix systems.  More cleanup. (Yegappan
            Lakshmanan, closes vim/vim#2354)
6e77df2d85
2018-09-08 16:43:27 +02:00
2c64f01674 vim-patch:8.0.0708: some tests are old style
Problem:    Some tests are old style.
Solution:   Change a few tests from old style to new style. (pschuh,
            closes vim/vim#1813)

292eff0c5a
2018-09-08 16:43:27 +02:00
9bf2741ba4 vim-patch:8.0.1023: it is not easy to identify a quickfix list
Problem:    It is not easy to identify a quickfix list.
Solution:   Add the "id" field. (Yegappan Lakshmanan)
a539f4f1ae
2018-09-08 08:13:48 -04:00
b4acf609ac vim-patch:8.0.1006: quickfix list changes when parsing text with 'erroformat'
Problem:    Cannot parse text with 'erroformat' without changing a quickfix
            list.
Solution:   Add the "text" argument to getqflist(). (Yegappan Lakshmanan)
7adf06f4e2
2018-09-07 22:59:12 -04:00
50eadfe2e9 Merge #8962 from janlazo/vim-8.0.0733 2018-09-07 09:51:59 +02:00
a9d83e8112 ASAN/LeakSanitizer: fix typo in blacklist 2018-09-07 08:34:34 +02:00
d99a268914 vim-patch:8.0.0922: quickfix list always added after current one
Problem:    Quickfix list always added after current one.
Solution:   Make it possible to add a quickfix list after the last one.
            (Yegappan Lakshmanan)
55b6926450
2018-09-07 00:00:22 -04:00
4eb923bfe0 vim-patch:8.0.0904: cannot set a location list from text
Problem:    Cannot set a location list from text.
Solution:   Add the "text" argument to setqflist(). (Yegappan Lakshmanan)
ae33833850
2018-09-06 22:36:49 -04:00
2be853d486 lint 2018-09-06 20:26:30 -04:00
c0d26ba4f9 main: advance in edit_buffers() is bool 2018-09-06 20:25:45 -04:00
cfb2828897 window: refactor boolean variables in win_close()
free_buf (param) and help_window (variable) are bool.
2018-09-06 20:24:29 -04:00
27d755cfd1 Merge pull request #8964 from bfredl/generated-sources
cmake: add "generated-sources" target
2018-09-06 21:34:18 +02:00
9e8f9dd5d4 cmake: add "generated-sources" target
This is intended to be used with source introspection tools like
clangd, where it would useful to regenerate headers and source files,
which introspection results depend on, without making a full
rebuild which takes much longer time than just generating headers.
2018-09-06 20:54:53 +02:00
dc15dcffad vim-patch:8.0.0782: using freed memory in quickfix code
Problem:    Using freed memory in quickfix code. (Dominique Pelle)
Solution:   Handle a help window differently. (Yegappan Lakshmanan)
d28cc3f55d
2018-09-06 06:15:35 -04:00
bb519fb261 vim-patch:8.0.0733: can only add entries to one list in the quickfix stack
Problem:    Can only add entries to one list in the quickfix stack.
Solution:   Move state variables from qf_list_T to qf_list_T. (Yegappan
            Lakshmanan)
a7df8c70c8
2018-09-05 23:02:14 -04:00
5de6f97408 Merge #8961 from ZyX-I/fix-8956 2018-09-06 01:30:53 +02:00
ZyX
a9fa66b5b8 functests: Add tests 2018-09-06 02:12:36 +03:00
ZyX
b728aad212 runtime/msgpack: Fix inf/nan regexp
Not making minus sign optional as inf/nan without optional minus should’ve
already been handled by the very first case.
2018-09-06 02:12:36 +03:00
51d42917f0 test/win: job_spec: increase jobwait() timeout
powershell is slow, and this timeout is "worst case" so it doesn't make
the tests more costly, only avoids a false-positive.

close #8958
2018-09-05 22:05:05 +02:00
55a721512b Merge #8953 from janlazo/vim-8.0.1190 2018-09-05 09:45:14 +02:00
bfe82d4650 Merge #8888 from janlazo/vim-8.0.1020 2018-09-05 09:38:34 +02:00
73849ceeb9 Merge #8948 from janlazo/vim-8.1.0331 2018-09-05 09:24:36 +02:00
30b70de39e Merge #8920 from janlazo/vim-8.0.0998 2018-09-05 09:19:06 +02:00
8b76034f3b Merge #8931 from justinmk/api-error-overrun 2018-09-05 08:37:46 +02:00
608ff261ad test: API validation: assert exact string
expect_err() matches against a pattern. Terminate the pattern with "$"
to check against buffer overrun.

ref #8931
2018-09-05 08:04:15 +02:00
db17d2c0fa API: Avoid overrun when formatting error-message
msgpack_rpc_to_object (called by handle_request .. msgpack_rpc_to_array)
always NUL-terminates API Strings.
But handle_request .. msgpack_rpc_get_handler_for operates on a raw
msgpack_object, before preparation.
2018-09-05 08:04:15 +02:00
9584674569 vim-patch:8.0.1595: no autocommand triggered before exiting
Problem:    No autocommand triggered before exiting.
Solution:   Add the ExitPre autocommand event.
12a96de430
2018-09-04 22:40:48 -04:00
b6e83ba284 vim-patch:8.1.0334: 'autowrite' takes effect when buffer is not to be written
Problem:    'autowrite' takes effect when buffer is not to be written.
Solution:   Don't write buffers that are not supposed to be written. (Even Q
            Jones, closes vim/vim#3391)  Add tests for 'autowrite'.
8c9e7b00f6
2018-09-04 22:40:48 -04:00
4d6ba4d06a vim-patch:8.0.1190: unusable after opening new window in BufWritePre event
Problem:    Vim becomes unusable after opening new window in BufWritePre
            event.
Solution:   Call not_exiting(). (Martin Tournoij, closes vim/vim#2205)
            Also for "2q" when a help window is open.  Add a test.
2c33d7bb69
2018-09-04 22:40:48 -04:00
f3c895569d lint 2018-09-04 21:33:39 -04:00
d29b71a1de ex_cmds: const variables in find_help_tags()
keep_lang (param) is bool.
2018-09-04 21:32:08 -04:00
9d7dc49db1 vim-patch:8.1.0235: more help tags that jump to the wrong location
Problem:    More help tags that jump to the wrong location.
Solution:   Add more exceptions and a table for "expr-" tags. (Hirohito
            Higashi)
3bf5e6a4c8
2018-09-04 21:16:34 -04:00
106b308ed4 vim-patch:8.0.1792: MS-Windows users expect -? to work like --help
Problem:    MS-Windows users expect -? to work like --help.
Solution:   Add -?. (Christian Brabandt, closes vim/vim#2867)
c3e81694fc

Include runtime/ changes from 85eee130f4 to pass 8.1.0231 tests.
2018-09-04 21:16:34 -04:00
24b16ed35e vim-patch:8.1.0231: :help -? goes to help for -+
Problem:    :help -? goes to help for -+.
Solution:   Add -? to list of special cases. (Hirohito Higashi)
a5bc38b8c1
2018-09-04 21:16:34 -04:00
5c90bbae2a vim-patch:8.0.1383: local additions in help skips some files
Problem:    Local additions in help skips some files. (joshklod)
Solution:   Check the base file name length equals.
35c5e8155d
2018-09-04 21:16:34 -04:00
d4cc4e0871 vim-patch:8.0.0998: strange error when using K while only spaces are selected
Problem:    Strange error when using K while only spaces are selected.
            (Christian J. Robinson)
Solution:   Check for blank argument.
a4f99f5a8b
2018-09-04 21:16:34 -04:00
9fe8e3cb2f CI/AppVeyor: Disable gcov build for PRs
Currently the "gcov" build always fails on AppVeyor. It makes the builds
very slow, so disable it for PRs until the problem is fixed.

closes #8911
closes #8912
2018-09-04 21:19:30 +02:00
65e4c9afe2 Merge #8955 'deps: update jemalloc, libvterm' 2018-09-04 21:05:20 +02:00
f8e042f732 tests: call getchar(1) in timer callback
Test changes from 8.0.1020 and 8.0.1048.
2018-09-04 10:00:17 -04:00
96b3dbcea5 lint 2018-09-04 10:00:17 -04:00
3b744f1ea2 vim-patch:8.1.0052: when mapping to <Nop> times out the next mapping is skipped
Problem:    When a mapping to <Nop> times out the next mapping is skipped.
Solution:   Reset "timedout" when waiting for a character. (Christian
            Brabandt, closes vim/vim#2921)
83f4cbd973
2018-09-04 10:00:17 -04:00
efa132da82 vim-patch:8.0.1048: no test for what 8.0.1020 fixes
Problem:    No test for what 8.0.1020 fixes.
Solution:   Add test_feedinput().  Add a test. (Ozaki Kiichi, closes vim/vim#2046)
5e80de3f3e
2018-09-04 10:00:17 -04:00
c87510b0e8 vim-patch:8.0.1020: when a timer calls getchar(1) input is overwritten
Problem:    When a timer calls getchar(1) input is overwritten.
Solution:   Increment tb_change_cnt in inchar(). (closes vim/vim#1940)
0f0f230012
2018-09-04 10:00:17 -04:00
90519107f2 Merge #8921 'highlight: Fix after-EOL matches at cursor' 2018-09-04 07:05:20 +02:00
3b156664b5 build/MSVC: remove libvterm-Fix-escape-sequences-for-MSVC.patch
Not needed after libvterm commit:
487f21dbf6
2018-09-04 06:41:55 +02:00
9de949ea3e deps: update libvterm
Changes: a9c7c6fd20...3f62ac6b7b

- "better handling of double-width unicode characters"
  cfde7f2095
  https://github.com/neovim/neovim/issues/4976#issuecomment-418170022
- "Fix implementation of query on bracketed paste mode"
  005845cd58
- compiler-warning fixes
- FocusIn/FocusOut reporting
  1343c8c0f9

Fixes #4976 (cursor "off-by-one" behavior after  (Wide unicode glyphs)
in :terminal)
2018-09-04 10:41:51 +02:00
765515010f deps: update to jemalloc 5.1.0
ref https://github.com/neovim/neovim/pull/7808
2018-09-04 10:41:51 +02:00
8fd3725cc8 tui: Hint wrapped lines to terminals.
Previously, when neovim would wrap a line across multiple lines,
terminal emulators could not detect that the lines represent a single
wrapped line as opposed to several separate lines. As a result, many
terminals' selection/copying functionality would treat a wrapped line as
several newline-delimited lines.

Fix this by reenabling a "special trick" from Vim. When a line is
wrapped, write the last character of that line followed by the first
character of the next line to the terminal. This hints to the terminal
that the next line is a continuation of the current line.

Extends the raw_line event with a "wrap" parameter which controls when
to do wrap hinting.
2018-09-03 03:25:02 -07:00
7ff63fcdc0 Merge pull request #8942 from bfredl/attr_state
screen.lua: extend snapshot_util() to work with extension state
2018-09-03 12:16:49 +02:00
2694fa759f Add tests for highlighting after the end of a line. 2018-09-03 03:13:03 -07:00
6c3b0fb831 vim-patch:8.1.0344: 'hlsearch' highlighting has a gap after /$
Problem:    'hlsearch' highlighting has a gap after /$.
Solution:   Remove suspicious code. (Ricky Zhou, closes vim/vim#3400)

7ee3f15b21
2018-09-03 03:13:03 -07:00
74937589d0 screen.lua: extend snapshot_util() to work with extension state
Simplify handling of attributes: collect new attributes in the same pass
as screen lines are rendered, instead of using two passes.
2018-09-03 10:36:55 +02:00
3e1daa84e9 oldtests: win: fix pathsep in :mkview test 2018-09-03 00:10:13 -04:00
6deddb26de vim-patch:8.1.0336: mkview test still fails on CI
Problem:    mkview test still fails on CI.
Solution:   Ignore curswant, don't see another solution.
dd5d18eadf
2018-09-02 23:35:02 -04:00
d7432145ff vim-patch:8.1.0335: mkview test fails on CI
Problem:    mkview test fails on CI.
Solution:   Attempt to force recomputing curswant after folding.
2bf4fe07b6
2018-09-02 23:33:56 -04:00
bd7371f460 vim-patch:8.1.0333: :mkview does not restore cursor properly after "$"
Problem:    :mkview does not restore cursor properly after "$". (Dominique
            Pelle)
Solution:   Position the cursor with "normal! $".
92c1b69641
2018-09-02 23:30:42 -04:00
5c9cd009e1 vim-patch:8.1.0331: insufficient test coverage for :mkview and :loadview
Problem:    Insufficient test coverage for :mkview and :loadview.
Solution:   Add tests. (Dominique Pelle, closes vim/vim#3385)
627cb6a6b3
2018-09-02 21:12:09 -04:00
f62d4865d8 Merge #8934 'Remove mb_ptr2len_len, mb_ptr2cells, mb_ptr2cells_len' 2018-09-01 19:46:46 +02:00
064495a53a doc/defaults: document ttimeoutlen default (#8943) 2018-09-01 18:17:49 +02:00
71bb4fd481 man.vim: guard against reload (#8940)
Some plugins attempt to reload autoloaded scripts.
Use a guard to prevent this.

fix #8939
2018-09-01 11:42:43 +02:00
a3549286b2 lint: clean-up after parent commits 2018-08-31 22:47:50 +03:00
1015aa6ff3 Remove has_mbytes from lines local to parent commit 2018-08-31 22:47:49 +03:00
1c03a06487 Refactor: remove mb_ptr2len_len, mb_ptr2cells and mb_ptr2cells_len
Remove occurences of these macros.
2018-08-31 22:45:10 +03:00
e30ccd56d9 shell.c: fix scan-build NPE warning #8932 2018-08-29 22:00:38 +02:00
93ee31bf65 spellfile.c: Remove dead assignment #8933
Looks like a harmless accident of ebe5051977 (which was a followup to its parent  fa7ace446e).
2018-08-29 21:56:06 +02:00
c5c3b0b8f9 Fix dead assignment. 2018-08-29 16:54:21 +05:30
17ce06d1c9 Merge #8930 'vim-patch:8.1.0022' 2018-08-29 08:11:16 +02:00
81c2cbe099 getchar: fix {read,copy,start}_redo() params
Update function signature as follows:
- read_redo(bool, bool)
- copy_redo(bool)
- start_redo(long, bool)
2018-08-29 00:27:07 -04:00
9fab77c7fb globals: cmd_silent is bool 2018-08-29 00:17:30 -04:00
7c38f60b3b vim-patch:8.1.0022: repeating put from expression register fails
Problem:    Repeating put from expression register fails.
Solution:   Re-evaluate the expression register. (Andy Massimino,
            closes vim/vim#2945)
833093bfb0
2018-08-29 00:08:15 -04:00
461d46d8ac Merge #8863 'refactor: Remove mb_head_off()' 2018-08-28 23:43:04 +02:00
a2403a0ed9 Merge #8863 'refactor: Remove mb_head_off() ' 2018-08-28 23:37:30 +02:00
885ca3b7a6 Merge #8929 from janlazo/vim-8.0.0983 2018-08-28 22:39:02 +02:00
acdede50ce test: Dump $NVIM_LOG_FILE contents (#8926)
Do this at the test-framework level instead of CI (Travis) scripts.
Then it works for QuickBuild and AppVeyor.

ref eb6dd3e42d
2018-08-28 22:13:34 +02:00
2996179482 lint 2018-08-28 16:09:26 -04:00
60f1acd0ef ex_cmds2: checkall in dialog_changed() is bool 2018-08-28 16:01:16 -04:00
5a1c93584f vim-patch:8.1.0214 fixup: remove feature-guard
FEAT_AUTOCHDIR is not defined for Nvim.

ref #8927
2018-08-28 21:49:41 +02:00
87904ae3c4 vim-patch:8.1.0214 (#8927)
Problem:    +autochdir feature not reported by has() or :version.
Solution:   Add the feature in the list.
Author:     Bram Moolenaar <Bram@vim.org>

83ec2a7f5f
2018-08-28 21:41:30 +02:00
3dffc842fe vim-patch:8.0.0983: unnecessary check for NULL pointer
Problem:    Unnecessary check for NULL pointer.
Solution:   Remove the NULL check in dialog_changed(), it already happens in
            dialog_msg(). (Ken Takata)
3f9a1ff141
2018-08-28 15:41:15 -04:00
0a77dc7e05 options: do not use gettext for +printheader (#8928)
It is not translatable as of vim-patch:8.0.1001.
2018-08-28 21:33:32 +02:00
643ef257b3 API: nvim_unsubscribe(): Handle unknown events #8745
close #8745
2018-08-28 10:20:19 +02:00
10e885bdfc vim-patch:8.0.1001: setting 'encoding' makes 'printheader' invalid (#8925)
Problem:    Setting 'encoding' makes 'printheader' invalid.
Solution:   Do not translate the default value of 'printheader'. (Yasuhiro
            Matsumoto, closes vim/vim#2026)
0903d56f5c
2018-08-28 08:51:22 +02:00
dee0d7f4e9 Merge pull request #8891 from bfredl/keyexpect
use keyword args for screen:expect{...} + hl fixup for ext_cmdline
2018-08-27 16:02:22 +02:00
3d88287e30 tests: introduce screen:expect{...} form 2018-08-27 15:15:49 +02:00
03978a0f29 ext_cmdline: use new highlight representation for cmdline_block
Make sure cmdline updates will receive highlight specifications the same
way as screen cells. This is controlled by the ext_newgrid option so
nothing is changed by default (as screen cells are also not changed by
default).  This was already done for the cmdline itself in #8221, this
extends it to cmdline_block. Which currently doesn't store highlights,
but the placeholder should be one that makes sense for future use.
2018-08-27 11:51:52 +02:00
a8b4d76a0a health.vim: Detect missing init.vim
closes #4877
2018-08-27 01:35:58 +02:00
cbc8c0c625 vim-patch:8.1.0322: Test_copy_winopt() does not restore 'hidden' (#8918)
Problem:    Test_copy_winopt() does not restore 'hidden'.
Solution:   Restore the option, fix indent. (Ozaki Kiichi, closes vim/vim#3367)
7cb33a14c9
2018-08-27 01:14:33 +02:00
cd1d9d8a7c Merge #8916 from janlazo/vim-8.1.0144 2018-08-26 21:20:22 +02:00
246fa3e81d oldtests: comment out test for 'set cpo+=.'
nvim does not support POSIX cpoptions.
2018-08-26 14:41:50 -04:00
ff8e239493 vim-patch:8.1.0144: the :cd command does not have good test coverage
Problem:    The :cd command does not have good test coverage.
Solution:   Add more tests. (Dominique Pelle, closes vim/vim#2972)
b2e0c94a4d
2018-08-26 09:56:34 -04:00
fa285bde45 win/dist: nvim-qt v0.2.10 (#8901)
ref https://github.com/equalsraf/neovim-qt/issues/417
2018-08-26 15:29:00 +02:00
eb663d5367 Merge #8903 from janlazo/vim-8.0.0883 2018-08-26 15:20:59 +02:00
8f058dca89 Merge #8904 from janlazo/vim-8.0.0900 2018-08-26 15:17:54 +02:00
7898de5211 vim-patch:8.1.0327: the "g CTRL-G" command isn't tested much (#8914)
Problem:    The "g CTRL-G" command isn't tested much.
Solution:   Add more tests. (Dominique Pelle, closes vim/vim#3369)
0529583ff1
2018-08-26 15:05:55 +02:00
8a677f8a4b src/nvim/testdir/Makefile: define NEW_TESTS automatically (#8909)
This avoids having to maintain this manually.

Tried to bring this upstream to Vim, but it does not work with non-GNU
make apparently in an easy way (https://github.com/vim/vim/pull/3376).

For Neovim GNU make can be used for this apparently.

diff (generated via):

    $(shell printf '%s\n' $(NEW_TESTS) > 1)
    $(shell printf '%s\n' $(NEW_TESTS2) > 2)
    $(error $(shell echo $(NEW_TESTS) | wc -c) $(shell echo $(NEW_TESTS2) | wc -c))

Changes:

 - Removed, already included in test_alot:
   - test_changedtick.res
   - test_filter_map.res
   - test_findfile.res
   - test_ga.res
   - test_lambda.res
   - test_put.res
   - test_recover.res
   - test_tabpage.res

 - Added (apparently forgotten to be added to NEW_TESTS):
   - test_breakindent.res: added in 49b671f8f
   - test_display.res: added in a0c7e35ee
   - test_help.res, added in 41bffeacf
   - test_lispwords.res, added in 54b9510e0
   - test_textformat.res, added in ef39f854d
2018-08-26 14:45:25 +02:00
5c7237640f CI/Codecov: enable changes status (#8910)
This helps to identify unexpected changes.
2018-08-26 14:24:22 +02:00
c581517f8a Merge #8908 'build/doc: generate vimindex.html' 2018-08-26 14:08:45 +02:00
e85bed0830 vim-patch:8.0.1214: accessing freed memory when EXITFREE is set
Problem:    Accessing freed memory when EXITFREE is set and there is more than
            one tab and window. (Dominique Pelle)
Solution:   Free options later.  Skip redraw when exiting.
4f1982800f
2018-08-25 10:52:36 -04:00
add2a62398 runtime/doc: fix broken links found by make html 2018-08-25 16:38:24 +02:00
2e5c299f11 warn about tests without libintl 2018-08-25 23:13:34 +09:00
ff18d3b827 build/doc: generate vimindex.html
This note in runtime/doc/Makefile explains the special-case:

    index.html is the starting point for HTML, but for the help files it
    is help.txt.  Therefore use vimindex.html for index.txt.

fix #8907
2018-08-25 15:25:49 +02:00
16b55d2e9d vim-patch:8.0.1468: illegal memory access in del_bytes()
Problem:    Illegal memory access in del_bytes().
Solution:   Check for negative byte count. (Christian Brabandt, closes vim/vim#2466)
191f18bad0
2018-08-24 23:02:51 -04:00
13f028e416 vim-patch:8.0.0900: :tab options doesn't open a new tab page
Problem:    :tab options doesn't open a new tab page. (Aviany)
Solution:   Support the :tab modifier. (closes vim/vim#1960)
ab6c8587ba
2018-08-24 22:15:42 -04:00
bdffa01b52 vim-patch:8.0.1404: invalid memory access on exit
Problem:    Invalid memory access on exit when autocommands wipe out a buffer.
            (gy741, Dominique Pelle)
Solution:   Check if the buffer is still valid. (closes vim/vim#2449)
606d45ccd8
2018-08-24 21:19:13 -04:00
59b53e7bc7 vim-patch:8.0.1228: invalid memory access in GUI test
Problem:    Invalid memory access in GUI test.
Solution:   Check that the row is not outside of the screen.
0e19fc07e7
2018-08-24 20:41:52 -04:00
cba3025c43 vim-patch:8.0.0883: invalid memory access with nonsensical script
Problem:    Invalid memory access with nonsensical script.
Solution:   Check "dstlen" being positive. (Dominique Pelle)
1c864093f9
2018-08-24 20:03:29 -04:00
c0157e8fe0 remote/host.vim: specify {nosuf} for globpath() (#8882) 2018-08-24 10:17:59 +02:00
e7d020e08f Merge #8894 from janlazo/editorconfig-makefile 2018-08-24 09:12:08 +02:00
2ab80b944b Merge #8896 from janlazo/vim-8.1.0083 2018-08-24 09:09:46 +02:00
748cd91c20 search: fix types of findsent() variables
dir (param) is of type Direction (enum).
cpo_J, found_dot, noskip (local var) are bool. cpo_J is const.
startlnum (local var) is const int. Declare it in same scope as cpo_J.
2018-08-23 19:07:19 -04:00
42428b3f85 vim-patch:8.1.0083: "is" and "as" have trouble with quoted punctuation
Problem:    "is" and "as" have trouble with quoted punctuation.
Solution:   Check for punctuation before a quote. (Jason Franklin)
8516071124
2018-08-23 18:50:29 -04:00
925c153f86 doc: remove mention of "drop" register (#8893)
close #8881
2018-08-23 19:49:23 +02:00
c5b5eaabad oldtests: reindent Makefile to 8-width tab 2018-08-23 13:48:47 -04:00
13673ea78d editorconfig: Makefile uses 8-width tab indent 2018-08-23 13:47:15 -04:00
e89df8a54d vim-patch:8.0.1682: auto indenting breaks inserting a block (#8892)
Problem:    Auto indenting breaks inserting a block.
Solution:   Do not check for cursor movement if indent was changed. (Christian
            Brabandt, closes vim/vim#2778)
8c87a2b1fe
2018-08-23 19:13:05 +02:00
a5d00527a1 Merge pull request #8887 from janlazo/vim-8.0.1242
[RDY] vim-patch:8.0.1242
2018-08-23 10:48:06 -04:00
dfbb75fdab Merge pull request #8889 from janlazo/vim-8.0.0999
[RDY] vim-patch:8.0.{999,1041,1043,1044}
2018-08-23 10:45:58 -04:00
6c8851be4e lint 2018-08-23 10:00:53 -04:00
27fbffeb4f vim-patch:8.0.1044: warning for uninitialized variable
Problem:    Warning for uninitialized variable. (John Marriott)
Solution:   Initialize ind_pre.
2254a8ad0c
2018-08-23 10:00:53 -04:00
fb68c97ce8 vim-patch:8.0.1043: warning for uninitialized variable
Problem:    Warning for uninitialized variable. (John Marriott)
Solution:   Move code to check indent inside "if".
4ec86ddd77
2018-08-23 10:00:53 -04:00
d677ae5f64 vim-patch:8.0.1041: bogus characters when indenting during visual-block append
Problem:    Bogus characters appear when indenting kicks in while doing a
            visual-block append.
Solution:   Recompute when indenting is done. (Christian Brabandt)
e2e69e4813
2018-08-23 10:00:53 -04:00
fe57a8a4e4 vim-patch:8.0.0999: indenting raw C++ strings is wrong
Problem:    Indenting raw C++ strings is wrong.
Solution:   Add special handling of raw strings. (Christian Brabandt)
dde81312b0
2018-08-23 04:09:24 -04:00
012cd35bfb vim-patch:8.0.1151: "vim -c startinsert!" doesn't append (#8886)
Problem:    "vim -c startinsert!" doesn't append.
Solution:   Correct line number on startup. (Christian Brabandt, closes vim/vim#2117)
09ca932f8e
2018-08-22 19:33:06 +02:00
eaf8e57cf9 vim-patch:8.0.1242: function argument with only dash is seen as number zero
Problem:    Function argument with only dash is seen as number zero. (Wang
            Shidong)
Solution:   See a dash as a string. (Christian Brabandt)
ffd99f729b
2018-08-22 13:06:04 -04:00
a466bd2927 Merge #8880 from janlazo/vim-8.0.1331 2018-08-22 08:40:56 +02:00
54e6ef73f0 vim-patch:8.0.1790: 'winfixwidth' is not always respected by :close
Problem:    'winfixwidth' is not always respected by :close.
Solution:   Prefer a frame without 'winfixwidth' or 'winfixheight'. (Jason
            Franklin)
c136af29c0
2018-08-21 22:36:31 -04:00
b5fc21dbf0 vim-patch:8.0.1707: when 'wfh' is set ":bel 10new" scrolls window
Problem:    When 'wfh' is set ":bel 10new" scrolls window. (Andrew Pyatkov)
Solution:   Set the fraction before changing the window height. (closes vim/vim#2798)
98da6ecab9
2018-08-21 12:44:06 -04:00
39777ad4b8 vim-patch:8.0.1426: "gf" and <cfile> don't accept ? and & in URL
Problem:    "gf" and <cfile> don't accept ? and & in URL. (Dmitrii Tcyganok)
Solution:   Check for a URL and allow for extra characters. (closes vim/vim#2493)
9e3dfc6501
2018-08-21 12:17:17 -04:00
387c3be82a vim-patch:8.0.1331: possible crash when window can be zero lines high
Problem:    Possible crash when window can be zero lines high. (Joseph
            Dornisch)
Solution:   Only set w_fraction if the window is at least two lines high.
3679c17917
2018-08-21 11:57:04 -04:00
19aa8ccf85 Merge pull request #8879 from janlazo/vim-8.1.0303
[RDY] vim-patch:8.1.0303
2018-08-21 11:29:24 -04:00
822ae1a81c vim-patch:8.1.0303: line2byte() is wrong for last line with 'noeol'
Problem:    line2byte() is wrong for last line with 'noeol' and 'nofixeol'.
Solution:   Fix off-by-one error. (Shane Harper, closes vim/vim#3351)
c26f7c6053
2018-08-21 10:20:17 -04:00
3807520001 Merge #8877 from janlazo/vim-8.0.1441 2018-08-21 09:33:09 +02:00
0c9888cdbe vim-patch:8.1.0110: file name not displayed with ":file" (#8878)
Problem:    File name not displayed with ":file" when 'F' is in 'shortmess'.
Solution:   Always display the file name when there is no argument (Christian
            Brabandt, closes vim/vim#3070)
fc0896093c

closes #8817
closes #8873
2018-08-21 09:25:48 +02:00
8872fce120 vim-patch.sh: Also check for .git/ directory
In the case of nested repos, such as when "neovim/" repo contains
"neovim/.vim-src/" repo,
    git rev-parse --show-toplevel
returns the fullpath to the "neovim/" repo, which failed the condition.

ref #8875
ref c05d7153d3
2018-08-21 08:37:49 +02:00
150b1b7b40 Merge #8861 from janlazo/vim-8.0.1364 2018-08-21 08:20:40 +02:00
ee51061b8c lint 2018-08-20 23:49:34 -04:00
612f3fd57a undo: undo_undoes is bool 2018-08-20 23:49:34 -04:00
0ff4854800 undo: did_undo,absolute in u_undo_end() are bool 2018-08-20 23:49:34 -04:00
6f55aa3502 undo: update undo_time() function signature
sec,file,absolute (params) are bool.
Fix callers and local variables of undo_time().
2018-08-20 23:49:34 -04:00
19717ca1e8 undo: above,did_undo in undo_time() are bool 2018-08-20 23:49:34 -04:00
66ed6297b0 vim-patch:8.0.1441: using ":undo 0" leaves undo in wrong state
Problem:    Using ":undo 0" leaves undo in wrong state.
Solution:   Instead of searching for state 1 and go above, just use the start.
            (Ozaki Kiichi, closes vim/vim#2595)
ce46d934af
2018-08-20 21:48:08 -04:00
0839c44257 Merge #8866 from janlazo/vim-8.0.0878 2018-08-20 23:09:10 +02:00
751c35d41b Merge #8872 from janlazo/vim-8.0.0762 2018-08-20 22:41:24 +02:00
768bc68d7e Merge #8860 from lucc/nvim_get_proc 2018-08-20 18:12:19 +02:00
c05d7153d3 vim-patch.sh: Use git-rev-parse to check repo (#8875)
Explicitly checking for the .git/ directory doesn't work in various
situations (e.g., git-worktree).

[ci skip]
2018-08-20 17:41:00 +02:00
96035a8343 search: "include" in current_tagblock() is bool 2018-08-20 10:44:34 -04:00
7763c19a70 vim-patch:8.1.0290: "cit" on an empty HTML tag changes the whole tag
Problem:    "cit" on an empty HTML tag changes the whole tag.
Solution:   Only adjust the area in Visual mode. (Andy Massimino,
            closes vim/vim#3332)
b476cb7d8d
2018-08-20 10:15:06 -04:00
953c3fcfee lint 2018-08-20 00:09:52 -04:00
f528aeff6e vim-patch:8.0.1487: test 14 fails
Problem:    Test 14 fails.
Solution:   Fix of-by-one error.
8846ac5aed
2018-08-20 00:09:52 -04:00
1d2b702008 vim-patch:8.0.1486: accessing invalid memory with "it"
Problem:    Accessing invalid memory with "it". (Dominique Pelle)
Solution:   Avoid going over the end of the line. (Christian Brabandt,
            closes vim/vim#2532)
82846a00ac
2018-08-20 00:05:12 -04:00
2c0998e104 vim-patch:8.0.1291: C indent wrong when * immediately follows comment
Problem:    C indent wrong when * immediately follows comment. (John Bowler)
Solution:   Do not see "/*" after "*" as a comment start. (closes vim/vim#2321)
f8c53d3d26
2018-08-20 00:05:12 -04:00
c553109932 vim-patch:8.1.0018: using "gn" may select wrong text when wrapping
Problem:    Using "gn" may select wrong text when wrapping.
Solution:   Avoid wrapping when searching forward. (Christian Brabandt)
bdb657924d
2018-08-19 15:53:34 -04:00
ff1d111120 vim-patch:8.0.1148: gN doesn't work on last match with 'wrapscan' off
Problem:    "gN" doesn't work on last match with 'wrapscan' off. (fcpg)
Solution:   Adjust for searching backward. (Christian Brabandt)
22ab547dc2
2018-08-19 09:01:19 -04:00
098e1f9dfd vim-patch:8.0.0762: ml_get error with :psearch in buffer without a name
Problem:    ml_get error with :psearch in buffer without a name. (Dominique
            Pelle)
Solution:   Use the buffer number instead of the file name.  Check the cursor
            position.
c31f9ae4f1
2018-08-18 21:55:54 -04:00
89fec12e9f vim-patch:8.0.1418: no test for expanding backticks
Problem:    No test for expanding backticks.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#2479)
ae6f865125
2018-08-18 11:26:00 -04:00
98632f1cce doc: Remove irrelevant line about "only the first" vimrc is used
Vim supports multiple locations for the user's vimrc, so it will use the
first one that is found, ignoring the rest.  Nvim follows the XDG spec,
so there is only one place to look for the user's vimrc, thus making the
statement unnecessary and confusing for nvim users.

Ref #8871
2018-08-18 10:35:51 -04:00
4d10024a56 API: Remove path prefix from command name in nvim_get_proc()
On macOS the output from `ps -o comm` might contain the full path of the
executable.  The `ucomm` would be the basename only but is less portable
(see previous commit).
2018-08-18 14:37:33 +02:00
0223c81457 lint 2018-08-17 22:07:55 -04:00
7482aef113 normal: don't check has_mbyte
has_mbyte is always true for nvim.
2018-08-17 22:07:55 -04:00
f46728c241 vim-patch:8.0.1091: test for <cexpr> fails without +balloon_eval feature
Problem:    Test for <cexpr> fails without +balloon_eval feature.
Solution:   Remove #ifdefs.
95c83c64be
2018-08-17 22:07:55 -04:00
3d71366af1 vim-patch:8.0.1090: cannot get the text under the cursor like v:beval_text
Problem:    cannot get the text under the cursor like v:beval_text
Solution:   Add <cexpr>.
65f084749b
2018-08-17 17:36:40 -04:00
f53c95e7a8 vim-patch:8.1.0159: completion for user names does not work for a prefix.
Problem:    Completion for user names does not work if a prefix is also a full
            matching name. (Nazri Ramliy)
Solution:   Accept both full and partial matches. (Dominique Pelle)
6c5d104302
2018-08-17 17:36:40 -04:00
f5b7fd5fa3 ex_docmd: forceit,usefilter are bool 2018-08-17 09:07:15 -04:00
c7db42faab Merge pull request #8859 from bfredl/cmdline_norm
cmdline: always use save_cmdline before command_line_enter
2018-08-17 13:33:47 +02:00
4a46ab8de9 cmdline: always use save_cmdline before command_line_enter
":normal :" might be invoked in various ways, so its safest to always
allow recursive invocation of cmdline mode
2018-08-17 10:48:48 +02:00
58ad7fc578 ops: refactor get_spec_reg()
Return value is bool.
errmsg (param) is bool in here and in getaltfname().
allocated (param) is bool.
2018-08-16 23:05:33 -04:00
015df9c66e vim-patch:8.0.1787: cannot insert the whole cursor line
Problem:    Cannot insert the whole cursor line.
Solution:   Make CTRL-R CTRL-L work. (Andy Massimino, closes vim/vim#2857)
e2c8d83926
2018-08-16 21:33:30 -04:00
68cd18eb04 vim-patch:8.1.0101: no test for getcmdwintype()
Problem:    No test for getcmdwintype().
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3068)
81612b7a7d
2018-08-16 12:56:51 -04:00
14b148f0ad vim-patch:8.0.1816: no test for setcmdpos()
Problem:    No test for setcmdpos().
Solution:   Add a test. (Dominique Pelle, closes vim/vim#2901)
ff3be4fe1e
2018-08-16 12:30:15 -04:00
1dcdac013e vim-patch:8.0.1649: no completion for argument list commands
Problem:    No completion for argument list commands.
Solution:   Add arglist completion. (Yegappan Lakshmanan, closes vim/vim#2706)
cd43effeca
2018-08-16 11:47:56 -04:00
be552c8340 vim-patch:8.0.1231: expanding file name drops dash
Problem:    Expanding file name drops dash. (stucki)
Solution:   Use the right position. (Christian Brabandt, closes vim/vim#2184)
c312b8b87a
2018-08-16 11:08:00 -04:00
6531b175ad vim-patch:8.0.0878: no completion for :mapclear
Problem:    No completion for :mapclear.
Solution:   Add completion (Nobuhiro Takasaki et al. closes vim/vim#1943)
cae92dc3d5
2018-08-16 10:42:13 -04:00
c03fc7ef3e vim-patch:8.0.1509: test for failing drag-n-drop command no longer fails
Problem:    Test for failing drag-n-drop command no longer fails.
Solution:   Check for the "dnd" feature.
294959528e
2018-08-16 03:22:48 -04:00
0f9622ca25 vim-patch:8.0.1508: the :drop command is not always available
Problem:    The :drop command is not always available.
Solution:   Include :drop in all builds. (Yasuhiro Matsumoto, closes vim/vim#2639)
5a656864a0
2018-08-16 03:16:14 -04:00
d110c6d790 lint: cleanup after parent commits 2018-08-16 07:39:48 +03:00
30392b6356 Remove has_mbyte from lines near changes in parent commit 2018-08-16 06:03:49 +03:00
b10d822a77 vim-patch:8.1.0186: test for getwininfo() fails in GUI
Problem:    Test for getwininfo() fails in GUI.
Solution:   Account for missing tabline.
44a693a1bd
2018-08-15 21:17:33 -04:00
2036d04284 vim-patch:8.1.0184: not easy to figure out the window layout
Problem:    Not easy to figure out the window layout.
Solution:   Add "wincol" and "winrow" to what getwininfo() returns.
b6959a8e06
2018-08-15 20:37:53 -04:00
2bddc4ca54 Remove occurences of mb_head_off 2018-08-15 22:02:33 +03:00
b89c08901c vim-patch:8.0.1364: there is no easy way to get the window position
Problem:    There is no easy way to get the window position.
Solution:   Add win_screenpos().
22044dc317
2018-08-15 12:20:46 -04:00
b5cfac0894 Merge pull request #8806 from bfredl/bce
tui: fix resize and use BCE more often
2018-08-15 13:02:20 +02:00
794e7b4359 API: Use ps -o comm in nvim_get_proc()
- The POSIX version of ps(1) only specifies "comm" for the "-o" option
  but not "ucomm".  See
  http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ps.html
- On Linux (with the procps-ng package) "ucomm" is an alias for "comm".
  See https://gitlab.com/procps-ng/procps
- OpenBSD also has "ucomm" as an alias for "comm" (with the extra note
  "Name to be used for accounting."). See https://man.openbsd.org/ps
- FreeBSD describes "ucomm" as "Name to be used for accounting." but
  does not say that it should be an alias for "comm". See
  https://www.freebsd.org/cgi/man.cgi?query=ps
2018-08-15 12:39:10 +02:00
ac2d661450 Merge #8829 from ZviRackover/fix-7401-step2 2018-08-15 10:28:53 +02:00
bdcd3c31c6 Merge #8852 from janlazo/vim-8.1.0161 2018-08-15 10:26:21 +02:00
26506f14bc Merge #8856 from janlazo/vim-8.0.1209 2018-08-15 10:18:22 +02:00
be1525d3c9 lint 2018-08-15 02:13:13 -04:00
a0938e068f vim-patch:8.0.1633: a TextChanged autocmd triggers when it is defined
Problem:    A TextChanged autocmd triggers when it is defined after creating a
            buffer.
Solution:   Set b_last_changedtick when opening a buffer. (Hirohito Highlight,
            closes vim/vim#2742)
8c64a36e40
2018-08-15 01:27:30 -04:00
ee37a0c79a vim-patch:8.0.1413: accessing freed memory in :cbuffer
Problem:    Accessing freed memory in :cbuffer.
Solution:   Get quickfix list after executing autocmds. (closes vim/vim#2470)
aaf6e43b7a
2018-08-15 01:27:30 -04:00
0bdd4e8393 oldtests: finish port of 8.0.1224 2018-08-15 01:27:30 -04:00
8e2a892e70 vim-patch:8.0.1409: buffer overflow in :tags command
Problem:    Buffer overflow in :tags command.
Solution:   Use vim_snprintf(). (Dominique Pelle, closes vim/vim#2471, closes vim/vim#2475)
            Add a test.
132f75255e
2018-08-15 01:27:30 -04:00
1daf2cb0ea vim-patch:8.0.1488: emacs tags no longer work
Problem:    Emacs tags no longer work. (zdohnal)
Solution:   Do not skip over end of line.
0d20737732
2018-08-15 01:27:30 -04:00
5e38ff105c vim-patch:8.0.1218: writing to freed memory in autocmd
Problem:    Writing to freed memory in autocmd.
Solution:   Make a copy of the tag line. (Dominique Pelle, closes vim/vim#2245)
8d84ff1a3c
2018-08-15 01:27:30 -04:00
84569693e1 vim-patch:8.0.1209: still too many old style tests
Problem:    Still too many old style tests.
Solution:   Convert a few more tests to new style. (Yegappan Lakshmanan,
            closes vim/vim#2230)
53f0c96239
2018-08-15 01:27:30 -04:00
5a0d0286ff TUI: use BCE again more often, as it provides smoother resizes and scrolling
add exceptions for terminals we know doesn't support BCE
2018-08-14 12:34:35 +02:00
5fad02c081 tui: reenable cursor movement optimizations (leftover from #8221) 2018-08-14 12:34:35 +02:00
e5bcf83380 tui: hack for invalid first line with non-bce resize 2018-08-14 12:34:35 +02:00
6c5f9219ef tui: use bce properly 2018-08-14 12:34:35 +02:00
f767cee100 Merge pull request #8790 from bfredl/hlattr
pass highlight attrs per value and thread-safely to TUI thread
2018-08-14 12:33:12 +02:00
999d33faf4 lint: clean up after parent commit 2018-08-14 08:38:38 +03:00
538ace9aae oldtests: win: a directory is not executable
Tests in 'test/functional/core/job_spec.lua' depend on this behavior.
2018-08-13 22:07:25 -04:00
bec5e4cb61 Merge #8832 from eraserhd/vim-insert-setline-undo-fixes 2018-08-14 02:17:05 +02:00
a1a5e35e9a vim-patch:8.1.0262: not enough testing for getftype()
Problem:    Not enough testing for getftype().
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3300)
1598f9937a
2018-08-13 16:06:29 -04:00
163680a58e vim-patch:8.0.1630: trimming white space is not that easy
Problem:    Trimming white space is not that easy.
Solution:   Add the trim() function. (Bukn, closes vim/vim#1280)
295ac5ab5e
2018-08-13 12:04:36 -04:00
e346c01c31 vim-patch:8.1.0161: buffer not updated with 'autoread' set if file was deleted
Problem:    Buffer not updated with 'autoread' set if file was deleted.
            (Michael Naumann)
Solution:   Don't set the timestamp to zero. (closes vim/vim#3165)
386bc82a3f

Sleep 2 seconds for autoread (https://github.com/neovim/neovim/pull/7592).
2018-08-13 11:33:04 -04:00
7676fc7562 Remove occurrences of 'has_mbyte' near lines changes by parent commit 2018-08-13 18:07:40 +03:00
7046258a38 Remove all occurrences of mb_off2cells 2018-08-13 18:07:40 +03:00
fa4c260100 cursor_shape: use attribute ids instead of syntax ids
As attribute ids is the convention in the UI protocol
Also remove non-threadsafe calls in tui.c to syntax module.
2018-08-13 13:35:35 +02:00
fab555e59c highlight: HlAttrs is a value type; treat it like such 2018-08-13 13:35:35 +02:00
ee5cc88a73 Merge #8851 from janlazo/vim-8.0.1227 2018-08-13 00:47:51 +02:00
a4c957bab7 lint 2018-08-12 18:21:58 -04:00
cfb2383c26 vim-patch:8.0.1397: pattern with \& following nothing gives an error
Problem:    Pattern with \& following nothing gives an error.
Solution:   Emit an empty node when needed.
890dd05492
2018-08-12 18:09:43 -04:00
3fd2efdb26 vim-patch:8.0.1257: no test for fix of undefined behavior
Problem:    No test for fix of undefined behavior.
Solution:   Add a test. (closes vim/vim#2255)
2973daafe1
2018-08-12 18:03:30 -04:00
0b38011328 vim-patch:8.0.1243: no test for what 8.0.1227 fixes
Problem:    No test for what 8.0.1227 fixes.
Solution:   Add a test that triggers the problem. (Christian Brabandt)
f45938cc20
2018-08-12 17:57:04 -04:00
7faf682525 vim-patch:8.0.1227: undefined left shift in readfile()
Problem:    Undefined left shift in readfile(). (Brian 'geeknik' Carpenter)
Solution:   Add cast to unsigned. (Dominique Pelle, closes vim/vim#2253)
dc1c981294
2018-08-12 17:56:23 -04:00
97331cab67 Merge #8843 from janlazo/vim-8.0.0828 2018-08-12 19:35:20 +02:00
ff19f08477 deps: get gperf-3.1.tar.gz from our mirror 2018-08-12 16:21:21 +02:00
addd181369 Merge #8837 from janlazo/vim-8.0.1290 2018-08-12 14:54:18 +02:00
1211fa09cf Merge #8833 from janlazo/vim-8.0.1004 2018-08-12 14:11:47 +02:00
ae24c9b270 Merge #8847 from janlazo/vim-8.0.1037 2018-08-12 13:05:59 +02:00
47f9ab4635 CI/travis: fix restore from cache
a369385009 fixed this for "~/.cache/nvim-deps/", but strangely not for
"~/.cache/nvim-deps-downloads/".

ref a369385009
ref #8316
ref #8281

Seen in https://travis-ci.org/neovim/neovim/jobs/414982972 :

    Using third-party dependencies from Travis cache (last update: Aug 11 23:00:15 2018).
    cp: /Users/travis/build/neovim/neovim/deps-downloads/nvim-deps-downloads/…/nvim-deps-downloads/libvterm/a9c7c6fd20fa35e0ad3e0e98901ca12dfca9c25c.tar.gz:
    name too long (not copied)
2018-08-12 12:38:38 +02:00
8ad46a25cb eval: match in find_some_match() is bool 2018-08-11 19:30:08 -04:00
3d77ca39c7 lint 2018-08-11 18:57:54 -04:00
d6a25f89b8 regexp: drop has_mbyte check in regmatch()
has_mbyte is always true in nvim.
2018-08-11 17:45:18 -04:00
594536a1e7 vim-patch:8.0.1361: some users don't want to diff with hidden buffers
Problem:    Some users don't want to diff with hidden buffers.
Solution:   Add the "hiddenoff" item to 'diffopt'. (Alisue, closes vim/vim#2394)
97ce419201
2018-08-11 15:06:07 -04:00
90128843f6 diff: drop enc_utf8 check in diff_equal_char()
enc_utf8 is always true for nvim.
2018-08-11 14:54:48 -04:00
fd334ec2a8 vim-patch:8.0.1046: code duplication in diff mode
Problem:    Code duplication in diff mode.
Solution:   Use diff_equal_char() also in diff_cmp(). (Rick Howe)
ae96b8d058
2018-08-11 14:54:39 -04:00
4f93d05d39 vim-patch:8.0.1037: "icase" of 'diffopt' is not used for highlighting
Problem:    "icase" of 'diffopt' is not used for highlighting differences.
Solution:   Also use "icase". (Rick Howe)
da22b8cc8b
2018-08-11 14:54:39 -04:00
d624aea454 lint 2018-08-11 14:37:17 -04:00
5f4a231e3f vim-patch:8.1.0099: exclamation mark in error message not needed
Problem:    Exclamation mark in error message not needed.
Solution:   Remove the exclamation mark.
3c867daaf0
2018-08-11 14:32:59 -04:00
9c4f6307b7 vim-patch:8.1.0097: superfluous space before exclamation mark
Problem:    Superfluous space before exclamation mark.
Solution:   Remove the space.  Don't translate debug message.
5efa0102de
2018-08-11 14:32:59 -04:00
96dc8c0d28 vim-patch:8.1.0090: "..." used inconsistently in a message
Problem:    "..." used inconsistently in a message.
Solution:   Define the message with " ..." once. (hint by Ken Takata)
9b0c5c23bd
2018-08-11 14:32:59 -04:00
b3ad509905 vim-patch:8.1.0078: "..." used inconsistently in messages
Problem:    "..." used inconsistently in messages.
Solution:   Drop the space before " ...".
c166927a32
2018-08-11 14:32:59 -04:00
cb708d203b vim-patch:8.0.1517: invalid memory acces with pattern using look-behind match
Problem:    Invalid memory acces with pattern using look-behind match.
            (Dominique Pelle)
Solution:   Get a pointer to the right line.
bc197195b0
2018-08-11 14:32:59 -04:00
5ed303c22b vim-patch:8.0.1470: integer overflow when using regexp pattern
Problem:    Integer overflow when using regexp pattern. (geeknik)
Solution:   Use a long instead of int. (Christian Brabandt, closes vim/vim#2251)
2c7b906afb
2018-08-11 14:32:59 -04:00
f7f65f5a82 vim-patch:8.0.1254: undefined left shift in gethexchrs()
Problem:    Undefined left shift in gethexchrs(). (geeknik)
Solution:   Use unsigned long. (idea by Christian Brabandt, closes vim/vim#2255)
4c22a91d20
2018-08-11 14:32:59 -04:00
dd6c1a0a8f vim-patch:8.0.0828: Coverity: may dereference NULL pointer
Problem:    Coverity: may dereference NULL pointer.
Solution:   Bail out if calloc_state() returns NULL.
983b3a5bc4
2018-08-11 14:32:59 -04:00
22311457ab refactor: Replace vim_strrchr() with strrchar() (#8718)
ref #1474
2018-08-11 16:14:10 +02:00
6aefae8c4e terminfo: add header guard, stdint.h for int8_t (#8848)
Lint fixes for single-include test.
2018-08-11 16:06:57 +02:00
c30812be7b Merge #8845 from janlazo/vim-8.0.1490 2018-08-10 20:08:18 +02:00
a5e3f4da34 tutor: don't set statusline (#8844)
also, remove unused function tutor#InfoText()

fixes #8842
2018-08-10 19:01:17 +02:00
5ee9161f81 lint 2018-08-10 12:54:18 -04:00
efbf70600c vim-patch:8.0.1490: number of spell regions is spread out through the code
Problem:    Number of spell regions is spread out through the code.
Solution:   Define MAXREGIONS.
2993ac5fce
2018-08-10 12:35:38 -04:00
2841e89cf1 Merge pull request #7981 from mhinz/update-terminfo-rxvt
[RDY] terminfo: update built-in terminfo entries by script
2018-08-10 10:35:39 -04:00
092f1a3e2c terminfo: update built-in terminfo entries
The arrays are put in their own file: terminfo_defs.h. This makes it simple to
update all terminfo entries in one go using scripts/update_terminfo.sh.

The entries were compiled with tic 6.1 and some use the extended number format.
2018-08-10 14:58:23 +02:00
ceeca24205 terminfo: add scripts/update_terminfo.sh
This script updates the built-in terminfo entries.

[skip ci]
2018-08-10 14:58:23 +02:00
fcd58c59eb Merge pull request #8838 from jamessan/vim-patch-issue-regex
vim-patch.sh: Fix replacement which converts #1234 to vim/vim#1234
2018-08-09 20:11:44 -04:00
68411dc189 vim-patch.sh: Fix replacement which converts #1234 to vim/vim#1234
Noticed in cb7bdf5f, where the script incorrectly converted `#ifdef` to
`vim/vim#ifdef`.

[skip ci]
2018-08-09 20:10:41 -04:00
09c2184660 oldtests: Test_undofile() passes
Set undodir to Vim's default value.
Fix pathsep of expected undofile path for Windows.
Comment out invalid test case for Neovim.
2018-08-09 19:53:05 -04:00
c6dd84e00b Fix lint 2018-08-09 16:46:50 -07:00
3c41df2691 vim-patch:8.1.0256: using setline() in TextChangedI splits undo
Problem:    Using setline() in TextChangedI splits undo.
Solution:   Use another solution for undo not working properly.
9fa9506853

This deviates from Vim in the handling of the CursorHoldI event.  In
Vim, any buffer changes are merged into the insert.  In Neovim,
CursorHoldI is handled via the multiqueue, and the point at which
the cursor hold is implemented (in input.c) doesn't know enough about it.
Making all queued events merge into the insert seems more wronger since
changes by other asynchronous events really should be separately
undoable.
2018-08-09 16:46:50 -07:00
d45efa5793 vim-patch:8.1.0245: calling setline() in TextChangedI autocmd breaks undo
Problem:    Calling setline() in TextChangedI autocmd breaks undo. (Jason
            Felice)
Solution:   Don't save lines for undo when already saved. (closes vim/vim#3291)
91d2e783b4
2018-08-09 16:46:11 -07:00
0a8be9f8ef vim-patch:8.1.0057: popup menu displayed wrong when using autocmd
Problem:    Popup menu displayed wrong when using autocmd.
Solution:   Use aucmd_prepbuf().  Force updating status line if the popup menu
            is going to be redrawn anyway. (Christian Brabandt, closes vim/vim#3009)
6ba3ec1bac
2018-08-09 16:46:01 -07:00
cf9dd7a3f4 Merge #8835 from janlazo/vim-8.0.1819 2018-08-10 00:01:32 +02:00
1c1722105c vim-patch:8.1.0025: no test for the undofile() function
Problem:    No test for the undofile() function.
Solution:   Add test. (Dominique Pelle, closes vim/vim#2958)
e5fa11186f
2018-08-09 16:06:00 -04:00
6853690c78 vim-patch:8.0.1433: illegal memory access after undo
Problem:    Illegal memory access after undo. (Dominique Pelle)
Solution:   Avoid the column becomes negative. (Christian Brabandt,
            closes vim/vim#2533)
95dbcbea6d
2018-08-09 15:32:13 -04:00
fc8965787b memline: fnamecmp_ino() returns bool 2018-08-09 14:19:26 -04:00
e36fce75fb vim-patch:8.0.1819: swap file warning for file with non-existing directory
Problem:    Swap file warning for a file in a non-existing directory, if there
            is another with the same file name. (Juergen Weigert)
Solution:   When expanding the file name fails compare the file names.
8c3169c58e
2018-08-09 14:12:57 -04:00
4e963f2462 vim-patch:8.0.1290: seq_cur of undotree() wrong after undo
Problem:    seq_cur of undotree() wrong after undo.
Solution:   Get the actual sequence number instead of decrementing the current
            one. (Ozaki Kiichi, closes vim/vim#2319)
80eaddd3a0
2018-08-09 13:30:42 -04:00
cb7bdf5f92 vim-patch:8.1.0024: test % command (#8834)
Problem:    % command not testded on vim/vim#ifdef and comment.
Solution:   Add tests. (Dominique Pelle, closes vim/vim#2956)
6b69e5c646
2018-08-09 18:41:36 +02:00
6ad8294d5c vim-patch:8.1.0257: no test for pathshorten()
Problem:    No test for pathshorten().
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3295)
bfde0b482d
2018-08-09 09:49:07 -04:00
218fccaba4 vim-patch:8.1.0204: inputlist() is not tested
Problem:    inputlist() is not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3240)
947b39e761
2018-08-09 09:25:26 -04:00
047dfcd294 vim-patch:8.1.0008: no test for strwidth()
Problem:    No test for strwidth().
Solution:   Add a test. (Dominique Pelle, closes vim/vim#2931)
42ab17b8e3
2018-08-09 08:09:37 -04:00
4420dc3067 vim-patch:8.0.1421: accessing invalid memory with overlong byte sequence
Problem:    Accessing invalid memory with overlong byte sequence.
Solution:   Check for NUL character. (test by Dominique Pelle, closes vim/vim#2485)
e6640ad44e
2018-08-09 00:55:20 -04:00
a445887985 vim-patch:8.0.1410: hang when using count() with an empty string
Problem:    Hang when using count() with an empty string.
Solution:   Return zero for an empty string. (Dominique Pelle, closes vim/vim#2465)
338e47fdfd
2018-08-09 00:44:06 -04:00
fe6cf2812b vim-patch:8.0.1105: match() and matchend() are not tested
Problem:    match() and matchend() are not tested.
Solution:   Add tests. (Ozaki Kiichi, closes vim/vim#2088)
1190cf68e2
2018-08-08 22:38:23 -04:00
3c6eb9871a vim-patch:8.0.1004: matchstrpos() without a match returns too many items
Problem:    Matchstrpos() without a match returns too many items.
Solution:   Also remove the second item when the position is beyond the end of
            the string. (Hirohito Higashi)  Use an enum for the type.
8d9f0ef5c6
2018-08-08 21:59:24 -04:00
0b3555b5dd Merge #8831 from janlazo/vim-8.1.0009 2018-08-09 02:30:19 +02:00
72fecad1ff Merge #8804 from battlmonstr/lang_region_crash
Fix crash in lang_init() on macOS if lang_region = NULL
2018-08-09 02:02:36 +02:00
0478fb3b58 Merge #8797 from janlazo/vim-8.0.0687 2018-08-09 02:00:28 +02:00
c7efc6047d vim-patch.sh: Pass directory name to find (#8830)
BSD/Mac find requires directory names before arguments.
2018-08-09 01:56:55 +02:00
f7f79c60bb vim-patch:8.1.0241: effect of ":tabmove N" is not clear
Problem:    Effect of ":tabmove N" is not clear.
Solution:   Add a test that shows the behavior. (Christian Brabandt,
            closes vim/vim#3288)
7cc596547a
2018-08-08 19:36:07 -04:00
345789f9ef vim-patch:8.1.0009: tabpages insufficiently tested
Problem:    Tabpages insufficiently tested.
Solution:   Add more test coverage. (Dominique Pelle, closes vim/vim#2934)
dbe8869c41
2018-08-08 19:35:35 -04:00
d581398779 ruby: detect rbenv shims for other versions (#8733)
When rbenv is used for managing Ruby installations, just checking for an
executable called "neovim-ruby-host" is not enough. It has to be run as well.

If it does not return 0, then neovim-ruby-host is merely a shim for another Ruby
installation.

  $ rbenv versions
    2.5.0
  * 2.5.1 (set by /Users/mhi/.rbenv/version)

  $ rbenv whence neovim-ruby-host
  2.5.0

  $ which neovim-ruby-host
  /Users/mhi/.rbenv/shims/neovim-ruby-host

  $ neovim-ruby-host
  rbenv: neovim-ruby-host: command not found

  The `neovim-ruby-host' command exists in these Ruby versions:
    2.5.0

  $ echo $?
  127

Additionally, the detection logic was moved from provider#ruby#Detect() to
s:detect(), because the former is run in the sandbox which forbids calling
system().
2018-08-09 00:47:35 +02:00
c1187d4af0 defaults: win: 'shellpipe' for cmd.exe (#8827)
">%s 2>&1" redirects stderr to a file, same as 'shellredir' on Windows.
2018-08-08 23:37:14 +02:00
8213109304 Merge #8821 from janlazo/vim-8.1.0003 2018-08-08 10:49:09 +02:00
d6af425322 oldtests: win: set shellpipe for cmd.exe
Redirect errors from :make to error file.
Fix execption error in test_compiler.vim on Windows.
2018-08-07 23:04:04 -04:00
b7a417c5e6 Merge #8744 from janlazo/vim-8.0.0890 2018-08-08 02:22:34 +02:00
c06613d2f6 Merge #8665 'Remove mb_ptr2char macro' 2018-08-08 01:24:18 +02:00
d5e8b3f451 misc: fixpos in del_char() is bool 2018-08-07 19:07:54 -04:00
0e4a54a17b edit: end_insert in check_auto_format() is bool 2018-08-07 13:20:46 -04:00
a2eff8f15c edit: did_add_space is bool 2018-08-07 13:16:38 -04:00
672449e448 memline: copy in ml_replace() is bool 2018-08-07 13:11:51 -04:00
80df0a8fd2 ops: is_del in block_prep() is bool 2018-08-07 12:13:41 -04:00
2b229b816b window: no_display in restore_win() is bool 2018-08-07 11:40:54 -04:00
1468946154 ops: add const to shift_block() variables 2018-08-07 11:35:07 -04:00
5493139c9f tests: win: fix pathsep of :compiler paths 2018-08-06 23:51:10 -04:00
daca22f5b2 vim-patch:8.1.0005: test for :compiler command fails on MS-Windows
Problem:    Test for :compiler command fails on MS-Windows.
Solution:   Ignore difference in path.
d19b234154
2018-08-06 22:55:04 -04:00
196cc13130 vim-patch:8.1.0004: test for :compiler command sometimes fails
Problem:    Test for :compiler command sometimes fails.
Solution:   Be less strict about the error message. (Dominique Pelle)
54651f7494
2018-08-06 22:54:16 -04:00
f9f37193d1 vim-patch:8.1.0003: the :compiler command is not tested
Problem:    The :compiler command is not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#2930)
10561fe0a3
2018-08-06 22:53:53 -04:00
c233277737 eval: add const to f_gettabvar() variables 2018-08-06 21:56:39 -04:00
e6127a49db edit: temp in ins_del() is const int 2018-08-06 21:56:39 -04:00
f807a7de04 vim-patch:8.1.0007: no test for "o" and "O" in Visual block mode
Problem:    No test for "o" and "O" in Visual block mode.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#2932)
2e94976abd
2018-08-06 21:56:39 -04:00
343c226abf vim-patch:8.0.1811: no test for winrestcmd()
Problem:    No test for winrestcmd().
Solution:   Add a test. (Dominique Pelle, closes vim/vim#2894)
72cf47a279
2018-08-06 21:56:39 -04:00
1b3cbb39a1 vim-patch:8.0.1705: when making a vertical split the mode message isn't updated
Problem:    When making a vertical split the mode message isn't always
            updated, "VISUAL" remains. (Alexei Averchenko)
Solution:   Only reset clear_cmdline when filling all columns of the last
            screen line. (Tom M. closes vim/vim#2611)
5bab555c2f
2018-08-06 21:56:39 -04:00
a8ff55d50e vim-patch:8.0.1446: acessing freed memory after window command in auto command
Problem:    Acessing freed memory after window command in auto command.
            (gy741)
Solution:   Adjust the pointer in the parent frame. (Christian Brabandt,
            closes vim/vim#2467)
6f361c9912
2018-08-06 21:56:39 -04:00
ce5d755048 vim-patch:8.0.1579: virtual replace test fails in GUI
Problem:    Virtual replace test fails in GUI.
Solution:   Don't save key options if they were not set.
df0d24b627
2018-08-06 21:56:39 -04:00
62424fe6ee vim-patch:8.0.1577: virtual replace test fails on MS-Windows
Problem:    Virtual replace test fails on MS-Windows.
Solution:   Make adding a termcap entry work for a builtin terminal.
            Restore terminal keys in a better way.
e780848150
2018-08-06 21:56:39 -04:00
f53c2578e7 vim-patch:8.0.1575: crash when using virtual replace
Problem:    Crash when using virtual replace.
Solution:   Adjust orig_line_count.  Add more tests. (Christian Brabandt)
63e82db6fc
2018-08-06 21:56:39 -04:00
7f2e352700 vim-patch:8.0.0879: crash when shifting with huge number
Problem:    Crash when shifting with huge number.
Solution:   Check for overflow. (Dominique Pelle, closes vim/vim#1945)
bae5a17a73
2018-08-06 21:56:39 -04:00
0e57c753d6 vim-patch:8.0.1601: highlight test fails on Win32
Problem:    Highlight test fails on Win32.
Solution:   Check for vtp and vcon support.
ff1e879577
2018-08-06 21:56:39 -04:00
e105e1242a vim-patch:8.0.1600: crash when setting t_Co to zero when 'termguicolors' is set
Problem:    Crash when setting t_Co to zero when 'termguicolors' is set.
Solution:   Use IS_CTERM instead of checking the number of colors.
            (closes vim/vim#2710)
f708ac592f
2018-08-06 21:56:39 -04:00
11bd0b8870 vim-patch:8.0.1169: highlignting one char too many with 'list' and 'cul'
Problem:    Highlignting one char too many with 'list' and 'cul'.
Solution:   Check for 'list' being active. (Ozaki Kiichi, closes vim/vim#2177)
5ece3e359c
2018-08-06 21:56:39 -04:00
a920ae89e9 vim-patch:8.0.1168: wrong highlighting with combination of match and 'cursorline'
Problem:    wrong highlighting with combination of match and 'cursorline'.
Solution:   Use "line_attr" when appropriate. (Ozaki Kiichi, closes vim/vim#2111)
            But don't highlight more than one character.
0aa398f55a
2018-08-06 21:56:38 -04:00
593c0bd77f vim-patch:8.0.1216: tabline is not always updated for :file command
Problem:    Tabline is not always updated for :file command. (Norio Takagi)
Solution:   Set redraw_tabline. (Hirohito Higashi)
6ce6504808
2018-08-06 21:56:38 -04:00
059986e038 vim-patch:8.0.1160: getting tab-local variable fails after closing window
Problem:    Getting tab-local variable fails after closing window.
Solution:   set tp_firstwin and tp_lastwin. (Jason Franklin, closes vim/vim#2170)
816968defc
2018-08-06 21:56:38 -04:00
d671168574 vim-patch:8.0.0890: still many old style tests
Problem:    Still many old style tests.
Solution:   Convert several tests to new style. (Yegappan Lakshmanan)
75373f3808
2018-08-06 21:56:38 -04:00
5cecd7a93a style: fixing minor issues noted in code review. 2018-08-06 22:27:10 +03:00
071aab5148 Remove some occrrences of enc_utf8 and has_mbyte
Removing uses and related dead code in the locallity of changes of
the two parent commits.
2018-08-06 20:48:07 +03:00
cd3b2e4b6b lint: clean-up after parent commit 2018-08-06 20:48:07 +03:00
10b6afd652 Remove all occurences of the mb_ptr2char macro
First step towards implemening issue #7401.

The same can be done for all deprecated mb_ functions in follow-up
patches.
2018-08-06 20:48:07 +03:00
1593ee7cf2 Merge #8820 from janlazo/vim-8.0.0671 2018-08-06 19:16:42 +02:00
41dbb69a85 lint 2018-08-06 11:49:59 -04:00
47d52e1578 globals: did_ai is bool 2018-08-06 11:49:59 -04:00
b9ab363636 globals: did_si is bool 2018-08-06 11:49:59 -04:00
7692dfeecb globals: can_si is bool 2018-08-06 11:49:59 -04:00
5309ad29d4 globals: can_si_back is bool 2018-08-06 11:49:59 -04:00
6bff0f7b60 edit: haveto_redraw (local variable) is bool 2018-08-06 11:49:59 -04:00
96f165e744 edit: can_cindent is bool 2018-08-06 11:49:59 -04:00
8f75debd86 edit: fix variables in ins_mousescroll()
Declare and initialize them on same line.
Add const if possible.
Refactor 'did_scroll' local variable from int to bool.
2018-08-06 11:49:59 -04:00
4df0ea98dc globals: typebuf_was_filled is bool 2018-08-06 11:49:59 -04:00
3aca372ac8 vim-patch:8.1.0240: g:actual_curbuf set in wrong scope (#8818)
Problem:    g:actual_curbuf set in wrong scope. (Daniel Hahler)
Solution:   Prepend the "g:" name space. (closes vim/vim#3279)
3cb4448b8a
2018-08-06 03:37:15 +02:00
4ca2cf4b47 vim-patch:8.0.1507: timer test is a bit flaky
Problem:    Timer test is a bit flaky.
Solution:   Add it to the list of flaky tests.
bfbea567d8
2018-08-05 17:55:49 -04:00
e7e2115de5 vim-patch:8.0.0948: crash if timer closes window while dragging status line
Problem:    Crash if timer closes window while dragging status line.
Solution:   Check if the window still exists. (Yasuhiro Matsumoto, closes
            vim/vim#1979)
989a70c590
2018-08-05 17:42:49 -04:00
fe6e4b3244 vim-patch:8.0.0722: screen is messed by timer up at inputlist() prompt
Problem:    Screen is messed by timer up at inputlist() prompt.
Solution:   Set state to ASKMORE. (closes vim/vim#1843)
c9041079a1
2018-08-05 17:20:09 -04:00
2b8792e303 vim-patch:8.0.0671: hang when typing CTRL-C in confirm() in timer
Problem:    When a function invoked from a timer calls confirm() and the user
            types CTRL-C then Vim hangs.
Solution:   Reset typebuf_was_filled. (Ozaki Kiichi, closes vim/vim#1791)
4eb6531b03
2018-08-05 17:18:57 -04:00
b42c80e561 eval, ex_getln: Fix incompatible pointer types (#8792)
Fixes #8786

gcc (GCC) 8.1.1 20180531 warning:

[76/182] Building C object src/nvim/CMakeFiles/nvim.dir/ex_getln.c.o
../src/nvim/ex_getln.c: In function ‘ExpandUserDefined’:
../src/nvim/ex_getln.c:5071:34: warning: cast between incompatible function types from ‘char * (*)(const char * const,  const int,  const char_u * const* const,  const _Bool)’ {aka ‘char * (*)(const char * const,  const int,  const unsigned char * const* const,  const _Bool)’} to ‘void * (*)(char_u *, int,  char_u **, int)’ {aka ‘void * (*)(unsigned char *, int,  unsigned char **, int)’} [-Wcast-function-type]
   retstr = call_user_expand_func((user_expand_func_T)call_func_retstr, xp,
2018-08-05 02:37:00 +02:00
5d8a47b6e0 syntax.h: fix include #8742 2018-08-05 01:50:25 +02:00
7a4d167a92 Merge #8742 vim-patch:8.0.0791,0831,1072,1078,1088 2018-08-04 20:12:48 +02:00
e861da247e Merge #8749 from janlazo/clint-tristate 2018-08-04 19:37:58 +02:00
a4c9447623 Merge #8799 from janlazo/nvim-8.0.1541 2018-08-04 19:09:46 +02:00
c51c2f5a65 misc: refactor plines_win{,_nofill}()
Add const to params and variables (declare and init on same line).
winheight (param) is bool so replace TRUE/FALSE macros with true/false.
2018-08-02 23:11:27 -04:00
766683622a fold: add const to foldSplit() variables 2018-08-02 18:29:16 -04:00
6710522751 fold: add const to foldUpdateIEMSRecurse() vars 2018-08-02 17:51:38 -04:00
21acc7c0fa fold: add const to foldUpdateIEMS() variables 2018-08-02 17:29:21 -04:00
1ec5485db4 fold: add const to checkSmall() variables 2018-08-02 17:15:53 -04:00
20eeb61fb2 fold: declare and init vars in deleteFoldEntry()
Use sizeof() on pointer value, not explicit type, for memmove.
2018-08-02 13:10:25 -04:00
a515401cf0 fold: add const to foldMoveTo() variables
Declare and initialize variables on same line if possible.
2018-08-02 12:50:50 -04:00
407ac8b42d fold: add const to deleteFold() variables
Declare and initialize variables on same line if possible.
2018-08-02 11:58:50 -04:00
3de785e7b5 fold: add const to hasFoldingWin() variables
cache is bool so update callers to pass true/false, not TRUE/FALSE.
2018-08-02 08:44:42 -04:00
2b9fc9a13f Merge pull request #8660 from phodge/7688-nvim-buf-lines-should-return-empty-list-for-unloaded-buffer
handle unloaded buffers in nvim_buf_*() functions
2018-08-02 13:28:36 +02:00
d2c1d9c466 ex_cmds: add const to helptags_one() variables 2018-08-01 23:21:17 -04:00
144e85b7b9 ex_cmds: add const to fix_help_buffer() variables 2018-08-01 23:02:52 -04:00
d29c02710e hardcopy: refactor mch_print_start_line()
Refactor the following affected functions:
- prt_line_number()
- prt_header()

These use prt_set_font(), refactored in 872a76f3dac14fdcb7dc7b34cecd3acb4370d56f for TriState.
2018-08-01 15:28:50 -04:00
d536fb018f hardcopy: bold,italic,underline are TriState 2018-08-01 15:28:50 -04:00
c0dbd8df95 fold: use_level,maybe_small are bool
use_levelp, maybe_smallp in check_closed() are bool ptrs.
2018-08-01 15:28:50 -04:00
44cb491f6e globals: virtual_op is TriState 2018-08-01 15:28:49 -04:00
faa9869a9e fold: recursive in deleteFoldEntry() is bool 2018-08-01 15:28:49 -04:00
14cffc3d1d fold: fold_changed is bool 2018-08-01 15:28:49 -04:00
667b8cd108 fold: finish in foldUpdateIEMSRecurse() is bool 2018-08-01 15:28:49 -04:00
3f8ba68895 screen: screen_cleared is TriState 2018-08-01 15:28:49 -04:00
971e9370ad fold: lineFolded() is bool 2018-08-01 15:28:49 -04:00
6dfaf8e914 fold: check_closed() returns bool
Update affected variables (ie. had_folded).
Add const to params to restrict usage.

TODO: refactor win_T.w_lines[idx].wl_folded from char to bool
2018-08-01 15:28:49 -04:00
4fb9b42869 search: refactor variables in findmatchlimit()
Combine declaration and initialization.
Refactor int variables, that use TRUE/FALSE macros (not MAYBE), to bool.
2018-08-01 15:28:49 -04:00
ba6417091c search: start_in_quotes in findmatchlimit is TriState 2018-08-01 15:28:49 -04:00
0e55d88639 edit: dont_sync_undo is TriState 2018-08-01 15:28:49 -04:00
deae2e8434 ex_cmds: refactor utf8 variables to TriState
- utf8 in helptags_one()
- this_utf in fix_help_buffer()
2018-08-01 15:28:49 -04:00
f35df8d697 menu: enable in ex_menu() is TriState 2018-08-01 15:28:49 -04:00
f193b5241f fold: fold_T.fd_small is TriState 2018-08-01 15:28:49 -04:00
9e20398908 diff: refactor diff_a_works to use TriState 2018-08-01 15:28:44 -04:00
a095a48987 clint: detect MAYBE and recommend TriState
Vim uses MAYBE for 3-value boolean with FALSE/TRUE/MAYBE.
Use TriState type instead to restrict to 3 values, kFalse/kTrue/kNone.
2018-08-01 15:23:01 -04:00
e92f1bb271 Fix crash in lang_init() on macOS if lang_region = NULL
This is a regression after PR #7704:
mac: Set $LANG based on the system locale

CFStringGetCStringPtr sometimes returns "lang_region" = NULL,
in this case CFStringGetCString is used instead,
which places output to "buf", but "buf" was not used
by the code.
2018-08-01 12:00:13 +02:00
c83ecee885 syntax: syn_pattern.sp_syncing is bool 2018-07-30 18:09:34 -04:00
1c5eee3c91 syntax: add const to get_syntax_attr() params 2018-07-30 16:19:38 -04:00
8f647cf03c syntax: add const to syn_finish_line() params,vars 2018-07-30 15:29:22 -04:00
eafcfb2fb5 syntax: did_header is bool
Refactor all affected functions:
- add const
- declare and initialize on same line
- update boolean declarations from int with bool
2018-07-29 20:28:44 -04:00
d3f609db05 syntax: disptick_T is uint16_t 2018-07-29 18:03:16 -04:00
3feabcacb0 syntax: scl_id is int 2018-07-29 08:20:00 -04:00
3e6d3bf3bd vim-patch:8.0.1088: occasional memory use after free
Problem:    Occasional memory use after free.
Solution:   Use the highlight table directly, don't keep a pointer.
414168d97f
2018-07-29 07:52:45 -04:00
f0ca2283b0 vim-patch:8.0.1078: using freed memory with ":hi Normal"
Problem:    Using freed memory with ":hi Normal".
Solution:   Get "item" again after updating the table.
b4ea1914b8
2018-07-29 07:52:45 -04:00
6b7b56dabe vim-patch:8.0.1072: :highlight command causes a redraw even when nothing changed
Problem:    The :highlight command causes a redraw even when nothing changed.
Solution:   Only set "need_highlight_changed" when an attribute changed.
99433291b1
2018-07-29 07:52:45 -04:00
0c0318f8a7 vim-patch:8.0.0831: with 8 colors the bold attribute is not set properly
Problem:    With 8 colors the bold attribute is not set properly.
Solution:   Move setting HL_TABLE() out of lookup_color. (closes vim/vim#1901)
12d853fae1

Use TriState on lookup_color() to avoid 'NOLINT' comments.
2018-07-29 07:52:45 -04:00
5af90e2ee7 vim-patch:8.0.0791: terminal colors depend on the system
Problem:    Terminal colors depend on the system.
Solution:   Use the highlight color lookup tables.
b41bf8e6b4
2018-07-29 07:52:45 -04:00
51f939e912 syntax: refactor get_id_list()
Add const to parameters and variables.
Declare and init variables on same line.
Use `sizeof(*ptr)` to calculate size for malloc().
2018-07-29 07:51:51 -04:00
c18a1b9034 syntax: refactor syn_combine_list()
Add const on parameters and variables.
Update declarations to avoid typecasts.
Use `sizeof(*ptr)` for malloc() to reduce effect of type changes.
ie. short to int16_t

Update syn_compare_stub() variable declarations for consistency.
2018-07-29 07:51:51 -04:00
6646502bbb syntax: syn_cluster_T.scl_list is int16_t* 2018-07-29 07:51:51 -04:00
8888a6ce80 syntax: refactor syn_current_attr()
Declare and initialize variables on same line if possible.
Add const to parameters and variables.
Use bool for any parameter,variable using TRUE/FALSE macros.
Replace 'short' type with 'int16_t'.
2018-07-29 07:51:51 -04:00
db4bddb770 syntax: use const on check_keyword_id() variables
Declare and initialize variables as close as possible.
Use const pointers without changing semantics if possible.
2018-07-29 07:51:51 -04:00
2a7047b77c syntax: syn_state.sst_next_list is int16_t* 2018-07-29 07:51:51 -04:00
eb7aa76b13 syntax: current_next_list is int16_t* 2018-07-29 07:51:51 -04:00
095ddcb548 syntax: update types of stateitem_T members
Replace 'short' with 'int16_t' to match lint changes from 8.0.1541.
Update ID_LIST_ALL to match type of stateitem_T.si_cont_list.
2018-07-29 07:51:51 -04:00
6f5eadcdac syntax: use const on syn_list_keywords() variables 2018-07-29 07:51:50 -04:00
9b34b867dd syntax: update types for keyentry_T,sp_syn
Replace 'short' with 'int16_t'
2018-07-29 07:51:50 -04:00
e6993f2491 syntax: use const on copy_id_list() params,vars 2018-07-29 07:51:50 -04:00
ef3cbd91cb syntax: use const on add_keyword() params,vars 2018-07-29 07:51:50 -04:00
a34066963e syntax: update types of syn_opt_arg_T members
Use bool, not int, for booleans.
Use int16_t, not short, to match lint changes from patch 8.0.1541.
2018-07-29 07:51:50 -04:00
9229f7a05d syntax: use const on put_id_list() variables 2018-07-29 07:51:50 -04:00
b647ba6afb vim-patch:8.0.1541: synpat_T is taking too much memory
Problem:    synpat_T is taking too much memory.
Solution:   Reorder members to reduce padding. (Dominique Pelle, closes vim/vim#2671)
36f923014a
2018-07-29 07:51:50 -04:00
eaa2cd9f7c vim-patch:8.0.0735: no indication that the quickfix window/buffer changed
Problem:    There is no way to notice that the quickfix window contents has
            changed.
Solution:   Increment b:changedtick when updating the quickfix window.
            (Yegappan Lakshmanan)
a8788f4d0b
2018-07-28 23:58:34 -04:00
91b8210779 vim-patch:8.0.0687: minor issues related to quickfix
Problem:    Minor issues related to quickfix.
Solution:   Set the proper return status for all cases in setqflist() and at
            test cases for this.  Move the "adding" flag outside of
            FEAT_WINDOWS. Minor update to the setqflist() help text. (Yegappan
            Lakshmanan)
86f100dc09
2018-07-28 23:58:34 -04:00
a2253744c9 system(): handle profiling and 'verbose' #8730
closes #8362

Vim's code calls `call_shell` directly from `get_system_output_as_rettv`
whereas in Nvim this function has been rewritten to not call `call_shell` but to call
`os_system` via `do_os_system`, losing the support for profiling and verbose.

Changing the code to call `call_shell` from `get_system_output_as_rettv`
seems to be too complicated to be worth it on the current version of the
code. So this commit duplicates the relevant code.
2018-07-29 03:49:11 +02:00
befc7de26f Merge pull request #8770 from janlazo/vim-8.0.0726 2018-07-29 02:00:48 +02:00
a4494b7cbc checkhealth: always report stderr with errors (#8783)
This also reports the exit code (e.g. 127 for when pyenv-which fails).
2018-07-29 01:46:59 +02:00
ade88fe4cc checkhealth: do not use exepath with host_prog (#8784)
This would need to get `expand`ed to not become empty, and is being
handled by s:check_bin already.

`s:check_bin` will also complain about e.g.
"~/.pyenv/versions/3.6.6/bin/python" not being executable, but that
reflects that the host will fail to start with it.

Fixes #8778
2018-07-29 01:44:46 +02:00
bb33fc4f55 log.c: Fix possible truncation in buffer (#8791) 2018-07-29 01:38:17 +02:00
8951304c10 Merge #8793 from janlazo/vim-8.0.0837 2018-07-29 01:32:39 +02:00
e09e9ca810 lint 2018-07-27 18:43:53 -04:00
882782f0fb screen: add const and reindent update_debug_signs() 2018-07-27 18:43:53 -04:00
243d16688a vim-patch:8.0.0837: signs can be drawn on top of console messages
Problem:    Signs can be drawn on top of console messages.
Solution:   don't redraw at a prompt or when scrolled up. (Christian Brabandt,
            closes vim/vim#1907)
0792048842
2018-07-27 18:40:31 -04:00
9abe0bdb54 Merge pull request #8789 from bfredl/updatehl
screen.c: add update_window_hl to special redrawing entrypoints, fixes a crash
2018-07-27 23:20:58 +02:00
9a584773b5 screen.c: add update_window_hl to special redrawing entrypoints
The following (run as a script) used to cause a crash due to :sign using a
special redraw (not updating nvim's specific highlight data structures)
without proper redraw first, as split just flags for redraw later.

set cursorline
sign define piet text=>> texthl=Search
split
sign place 3 line=2 name=piet buffer=1
2018-07-27 17:11:01 +02:00
85a7170f19 Merge pull request #8767 from janlazo/vim-8.0.0493
[RDY] vim-patch:8.0.0493
2018-07-27 10:50:57 -04:00
594859fdd6 Merge pull request #8485 from janlazo/vim-8.0.1012
[RDY] vim-patch:8.0.{805,806,810,1012,1017}
2018-07-27 10:44:29 -04:00
e42688fcf3 Merge pull request #8769 from janlazo/vim-8.0.1502
[RDY] vim-patch:8.0.{1502,1512,1622}
2018-07-27 10:06:46 -04:00
5f15788dc3 tui: clip invalid regions on resize (#8779), fixes #8774 2018-07-26 19:55:26 +02:00
9c0c5e8bc6 Merge #8729 'log: milliseconds, format' 2018-07-25 16:29:23 +02:00
27dc42160f log.c: format: padding
- milliseconds: leading zeroes
- PID: whitespace padding
2018-07-25 15:29:57 +02:00
ea2e8f4f10 DOC: regenerate api docs 2018-07-25 15:07:13 +10:00
7ab27eeb53 DOC: add support for intro sections in api docs 2018-07-25 15:07:13 +10:00
b53b621ef6 functests: tests related to operations on unloaded buffers #7688 2018-07-25 15:07:13 +10:00
10bb11e8d1 API: update docs WRT behaviours/methods for unloaded buffers #7688 2018-07-25 15:07:13 +10:00
8ff0872cf7 API: add nvim_buf_is_loaded() #7688 2018-07-25 15:07:13 +10:00
40e2d6b59b API: buf_get_lines, buf_line_count handle unloaded buffers #7688 2018-07-25 15:07:13 +10:00
ae52170a52 cmake: bump API version 2018-07-25 14:09:04 +10:00
30bba7a10c vim-patch:8.0.1017: test for MS-Windows $HOME always passes
Problem:    Test for MS-Windows $HOME always passes.
Solution:   Rename the test function.  Make the test pass.
dde6034111

Assume $HOME contains the literal absolute path.
Nested environment variable expansion is unsupported.
2018-07-24 23:17:36 -04:00
5ed0975ea2 vim-patch:8.0.1012: MS-Windows: problem with $HOME when is was set internally
Problem:    MS-Windows: Problem with $HOME when is was set internally.
Solution:   Only use the $HOME default internally. (Yasuhiro Matsumoto, closes
            vim/vim#2013)
48340b62e8

Restore vim_getenv() behaviour for $HOME on Windows.
2018-07-24 23:17:28 -04:00
b0ab46056f vim-patch:8.0.0810: MS-Windows: tests still hang
Problem:    MS-Windows: tests still hang.
Solution:   Only create the XfakeHOME directory if it does not exist yet.
d0b6c6c54e
2018-07-24 22:31:26 -04:00
290a9632d6 vim-patch:8.0.0806: tests may try to create XfakeHOME twice
Problem:    Tests may try to create XfakeHOME twice.
Solution:   Avoid loading setup.vim twice.
f98246d484
2018-07-24 22:31:26 -04:00
28c3679b64 vim-patch:8.0.0805: GUI test fails with gnome2
Problem:    GUI test fails with gnome2.
Solution:   Set $HOME to an existing directory.
d1ee0043c0
2018-07-24 22:31:26 -04:00
ef86aad878 log.c: ISO 8601 date/time
After:
    INFO  2018-07-17T22:05:46.175 656 main:560: starting main loop
2018-07-24 19:36:38 +02:00
3258c6a2f4 log.c: include milliseconds
closes #8727

Before:
    INFO  180711.233956 11124 main:560: starting main loop
After:
    INFO  180711.233956.807 11124 main:560: starting main loop

Note:
  - Can't use uv_hrtime() nor uv_now(), they are not "since the epoch".
    Also, log.c can't assume a loop exists.
2018-07-24 19:36:38 +02:00
4d6a1e5566 log.c: message format
- Log-level name (INFO/ERROR/…) should be in the first column, so that
  filtering by log-level is maximally trivial.
- Use 2-digit year. 4-digit year is useless, logs don't survive for
  decades without context.

Before:
    2018/07/05 17:49:41 INFO  27596 on_process_exit:393: foo
After:
    INFO  180705.174941 27596 on_process_exit:393: foo
2018-07-24 19:25:51 +02:00
ddea519542 rename: os_get_localtime => os_localtime 2018-07-24 19:25:50 +02:00
72ddbb675f Merge pull request #8771 from bfredl/glitches
Fix redraw glitches with newgrid refactor

Fixes #8768 #8775
2018-07-24 17:45:42 +02:00
dcac926ced ui: fix glitches where scrolling region affects clearing of screen
the first implemented UI protocol clients (python-gui and builitin TUI)
allowed the cleared region to be restricted by setting the scroll region.
This was never used by nvim though, and not documented and implemented by
newer clients, to check we remain compatible with both kind of clients,
ensure the scroll region is in a reset state.
2018-07-24 16:38:51 +02:00
d545413492 screen.c: fix redrawing tabline when messages overflow screen 2018-07-24 16:38:24 +02:00
11861bc9c8 tests: add test for switching tabpage right after scroll 2018-07-24 16:37:48 +02:00
d183103b45 test: assert scroll region state for clear
some clients assume this, so tests should check it
2018-07-24 16:37:04 +02:00
ed5ac84ab0 tests: test for redrawing tabline when msgsep marker goes outside screen 2018-07-24 16:36:20 +02:00
f0a702d116 file_search: free stackp if vim_findfile() failed
ff_free_stack_element() accepts NULL ptr and returns early.
This removes the need to check if stackp is not NULL.
2018-07-24 01:15:24 -04:00
7c7701af12 vim-patch:8.1.0111: .po files do not use recommended names
Problem:    .po files do not use recommended names.
Solution:   Give a warning if the recommended name is not used.  Accept the
            recommended name for conversion. (Christian Brabandt, Ken Takata)
d1d037e901
2018-07-23 19:35:11 -04:00
57c095d5fc vim-patch:8.0.1839: script to check .po file doesn't check for plural header
Problem:    Script to check .po file doesn't check for plural header.
Solution:   Add a check that the plural header is present when needed.
9cfc7d885c
2018-07-23 12:42:46 -04:00
7cf36fc67e vim-patch:8.0.1778: script to check translations does not always work
Problem:    Script to check translations does not always work.
Solution:   Go to first line before searching for MIME.
b07bbb0d29
2018-07-23 12:41:29 -04:00
b63f5c170d vim-patch:8.0.0835: translations check with msgfmt does not work
Problem:    Translations check with msgfmt does not work.
Solution:   Add a space before the file name.
65cedb2074
2018-07-23 12:34:21 -04:00
45a2c6543c vim-patch:8.0.0830: translating messages is not ideal
Problem:    Translating messages is not ideal.
Solution:   Add a remark about obsolete messages.  Use msgfmt in the check
            script. (Christian Brabandt)
aaef1bae3c
2018-07-23 12:33:39 -04:00
1ed5abfe88 vim-patch:8.0.0794: checking translations fails with multiple NL
Problem:    The script to check translations fails if there is more than one
            NL in one line.
Solution:   Count the number of NL characters.  Make count() accept a string.
9966b21a57
2018-07-23 11:50:37 -04:00
d551a49958 vim-patch:8.0.0734: the script to check translations can be improved
Problem:    The script to check translations can be improved.
Solution:   Restore the view when no errors are found.  Check for matching
            line break at the end of the message. (Christian Brabandt)
7f93703149
2018-07-23 10:31:37 -04:00
ddc243f32a vim-patch:8.0.0726: translations cleanup script is too conservative
Problem:    Translations cleanup script is too conservative.
Solution:   Also delete untranslated messages.
4d2ba822fd
2018-07-23 10:29:41 -04:00
6285b518d4 vim-patch:8.0.1622: possible NULL pointer dereference
Problem:    Possible NULL pointer dereferencey. (Coverity)
Solution:   Reverse the check for a NULL pointer.
6ed86ad170
2018-07-23 08:34:26 -04:00
84b8612987 vim-patch:8.0.1512: warning for possibly using NULL pointer
Problem:    Warning for possibly using NULL pointer. (Coverity)
Solution:   Skip using the pointer if it's NULL.
e4db7aedab
2018-07-23 08:34:25 -04:00
9fbbec76aa vim-patch:8.0.1502: in out-of-memory situation character is not restored
Problem:    In out-of-memory situation character is not restored. (Coverity)
Solution:   Restore the character in all situations.
71a43c0137
2018-07-23 00:01:07 -04:00
c8e7a447c5 build: Enable LTO (Link Time Optimization) #8654 2018-07-23 03:22:14 +02:00
2000b6a64a Merge #8589 'VimL: Remove legacy v:xx aliases' 2018-07-23 03:18:10 +02:00
cdbfdcfcc4 doc: README: "Transitioning from Vim" note (#8763) 2018-07-23 03:06:27 +02:00
765711e272 vim-patch:8.0.1765: CTRL-G j in Insert mode is incorrect when 'virtualedit' set (#8757)
Problem:    CTRL-G j in Insert mode is incorrect when 'virtualedit' is set.
Solution:   Take coladd into account. (Christian Brabandt, closes vim/vim#2743)
db0eedec16
2018-07-23 02:11:13 +02:00
48c0e916a1 Merge #8753 from janlazo/vim-8.0.0724 2018-07-23 02:10:06 +02:00
c9f2faf3bf vim-patch:8.0.1398: :packadd does not load packages from the "start" directory (#8762)
Problem:    :packadd does not load packages from the "start" directory.
            (Alejandro Hernandez)
Solution:   Make :packadd look in the "start" directory if those packages were
            not loaded on startup.
9e1d399e63
2018-07-23 02:04:49 +02:00
03bd5a4b91 Make "v:errmsg", "v:shell_error" and "v:this_session" distinct 2018-07-23 08:47:51 +09:00
563957e3cb vim-patch:8.0.0493: crash with cd command with very long argument
Problem:    Crash with cd command with very long argument.
Solution:   Check for running out of space. (Dominique Pellé, closes vim/vim#1576)
15618fa643
2018-07-22 19:34:58 -04:00
13d29cb9ed man.vim: improve manSentence regex (#8764)
ref https://github.com/neovim/neovim/pull/8709#issuecomment-406319186
2018-07-22 18:30:38 +02:00
94841e5eae Merge pull request #8221 from bfredl/hlstate
UI grid protocol revision: line based updates and semantic highlights
2018-07-21 14:41:49 +02:00
6b8cd827a9 ui: add tests for hlstate extension 2018-07-21 13:21:59 +02:00
0bdf8979a2 ui: docs for ext_newgrid and ext_hlstate 2018-07-21 13:21:59 +02:00
1adb01c120 ui: use line-based rather than char-based updates in screen.c
Add ext_newgrid and ext_hlstate extensions. These use predefined
highlights and line-segment based updates, for efficiency and
simplicity.. The ext_hlstate extension in addition allows semantic
identification of builtin and syntax highlights.

Reimplement the old char-based updates in the remote UI layer, for
compatibility. For the moment, this is still the default. The bulitin
TUI uses the new line-based protocol.

cmdline uses curwin cursor position when ext_cmdline is active.
2018-07-21 13:21:58 +02:00
2134396074 ui: add TODO for non-working terminal linewrap
Note: this has not been working since the TUI reimplementation
2018-07-21 13:20:38 +02:00
989b585e10 highlight: refactor to use stateful representation
This allows us to keep track of the source higlight groups,
and not only the final combined highlights.
2018-07-21 13:20:37 +02:00
696e24f311 highlight: extract low-level highlight logic from syntax, ui 2018-07-21 10:37:44 +02:00
5ff90a100a Merge #8761 from janlazo/vim-8.0.1503 2018-07-20 03:56:13 +02:00
f5d7123f6c version bump 2018-07-19 21:53:21 +02:00
588e86bda6 hardcopy: refactor mch_print_text_out()
Combine variable declaration and initialization to add const.
2018-07-19 12:33:05 -04:00
8441af37d8 vim-patch:8.1.0056: crash when using :hardcopy with illegal byte
Problem:    Crash when using :hardcopy with illegal byte.
Solution:   Check for string_convert() returning NULL. (Dominique Pelle)
43dee181f5
2018-07-19 12:21:14 -04:00
2ea619c10b vim-patch:8.0.1503: access memory beyond end of string
Problem:    Access memory beyond end of string. (Coverity)
Solution:   Keep allocated memory in separate pointer.  Avoid outputting the
            NUL character.
cdd09aa51a
2018-07-18 21:20:11 -04:00
489d32f2b8 startup: fix ":if 0|syntax on|endif" bug (#8731)
Problem: ":if 0|syntax {on,off}|endif" skips the default of "syntax on"
because the executor was setting the `did_syntax_onoff` flag even though
"syntax {on,off}" is not actually executed.

closes #8728
2018-07-18 14:30:11 +02:00
cd94dd6bb2 NVIM v0.3.1
FEATURES:
07499a842b #8709 man.vim: C highlighting for EXAMPLES section
07f82ad1be #8699 TUI: urxvt: also send xterm focus-reporting seqs
40911e435e #8616 API: emit nvim_buf_lines_event from :terminal
c46997aa87 #8546 fillchars: Add "eob" flag

FIXES:
74d19f685f #8576 startup: avoid blank stdin buffer if other files were opened
4874214139 #8737 Only waitpid() for processes that we care about
cd6e7e8cf3 #8743 Check all child processes for exit in SIGCHLD handler
c230ef24a2 #8746 channel.c: Prevent channel_destroy_early() from freeing uninitialized rpc stuff
0ed8b12a07 #8681 transstr_buf: fix length comparison
d241f278d3 #8708 TUI: Fix standout mode
9afed40ea6 #8698 man.vim: fix for mandoc
e889640048 #8682 provider/node: npm --loglevel silent
1cbc830189 #8613 API: nvim_win_set_cursor: set curswant
bf6048e81d #8628 checkhealth: Python: fix VIRTUAL_ENV check
3cc3506965 #8528 checkhealth: node.js: also search yarn

CHANGES:
b7514493a0 #8619 defaults: shortmess+=F
12481781a0 #8578 highlight: high-priority CursorLine if fg is set.
01570f1ff3 #8726 terminal: handle &confirm and :confirm on unloading
56065bbdc6 #8721 screen: truncate showmode messages
bf2460e2f9 #7551 buffer: fix copying :setlocal options
c1c14faad9 #8520 Ex mode: always "improved" (gQ)
050f3975f6 #7992 options: remove 'maxcombine` option (always 6)

INTERNAL:
463da84806 #7992 screen: use UTF-8 representation
2018-07-18 13:44:59 +02:00
44b4f8c6e9 Merge #8679 from justinmk/doc 2018-07-18 13:42:07 +02:00
0615450688 gen_api_vimdoc.py: add whitespace before "~" 2018-07-18 13:38:06 +02:00
1999919c31 doc 2018-07-18 13:38:06 +02:00
031d21221e vim-patch:8.0.1799: no test for :registers command
Problem:    No test for :registers command.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#2880)
7ce551f317
2018-07-17 09:49:39 -04:00
b99bbc680e vim-patch:8.0.0727: message about what register to yank into is not translated
Problem:    Message about what register to yank into is not translated.
            (LemonBoy)
Solution:   Add _().
60d0e97497
2018-07-17 09:02:37 -04:00
eab17e5093 vim-patch:8.0.0724: the message for yanking doesn't indicate the register
Problem:    The message for yanking doesn't indicate the register.
Solution:   Show the register name in the "N lines yanked" message. (Lemonboy,
            closes vim/vim#1803, closes vim/vim#1809)
e45deb7997
2018-07-17 09:01:18 -04:00
cd6e7e8cf3 Merge pull request #8743 from dimbleby/multiple-children
Check all child processes for exit in SIGCHLD handler
2018-07-16 10:26:24 -04:00
dfe79b67a5 Merge pull request #8651 from MichaHoffmann/feature_refactor_channel
channel.c: refactor spaghetti code
2018-07-15 19:55:53 +02:00
c230ef24a2 Merge pull request #8746 from oni-link/fix.rpcstart2
Fix crash in channel_job_start() in combination with rpc and unknown command
2018-07-15 19:48:40 +02:00
099718ae6d dispatch.c: changed api_set_error_call 2018-07-15 12:12:03 +02:00
c180741189 channel.c: Prevent channel_destroy_early() from freeing uninitialized rpc stuff
Without this patch the following commands would crash:
    :call rpcstart('unknown_command')

    :set sh=unknown_command
    :call jobstart('ls',{'rpc':1})
2018-07-15 09:30:47 +02:00
dee2bf7b52 Check all child processes for exit in SIGCHLD handler
If a second and third child exit while we are already in the handler, we
will only see a single additional SIGCHLD.  Therefore the handler must
not stop after processing a single child but should check all children.

Fixes #8740
2018-07-14 14:18:34 +01:00
ed02278e42 channel.c: refactor spaghetti code
channel.c: WIP remove redundant method check and added FUNC_ATTR_NONNULL_ALL macro

channel.c channel_defs.h helpers.c: added Error field to RequestEvent, added no_op handler func

channel.c: use const char* instead of string and cleanup

channel.c; channel_defs.h; helpers.c: removed error from event again; send errors directly to the channel without using handlers and events

channel.c: fixed memory leak and lint errors

api/private/dispatch.c; api/vim.c; msgpack_rpc/channel.c msgpack_rpc/helpers.c added Error* field to msgpack_get_handler_for; further refactored channel.c

channel.c:323 changed order of evaluation in if statement

channel.c: removed superflous whitespace

dispatch.c: review comment
2018-07-14 11:47:18 +02:00
4874214139 Merge pull request #8737 from dimbleby/overly-general-waitpid
Only waitpid() for processes that we care about
2018-07-13 19:59:09 -04:00
fe913d7838 Only waitpid() for processes that we care about
It seems as though in an AppImage there's an extra child process that
dies at some early point, before we have set up a SIGCHLD handler.  So
when we later get a SIGCHLD from a child that we do care about,
waitpid(-1, ...) tells us about the extra child - and we don't notice
that the interesting child has exited.

Or something like that!

See also:

* https://patchwork.kernel.org/patch/9949491/ in which perf hit
something similar
* discussion at the AppImage repository:
https://github.com/AppImage/AppImageKit/issues/812#issuecomment-404662110.

Fix is to be explicit about which process we are waitpid()'ing for, so
we never need be distracted by children that we don't know about.

Fixes #8104
2018-07-13 20:56:04 +01:00
392817c2da vim-patch:8.0.0630: it is not easy to work on lines without a match (#8734)
Problem:    The :global command does not work recursively, which makes it
            difficult to execute a command on a line where one pattern matches
            and another does not match. (Miles Cranmer)
Solution:   Allow for recursion if it is for only one line. (closes vim/vim#1760)
f84b122a99
2018-07-13 21:14:46 +02:00
fc45c97829 Merge #8736 'vim-patch:8.0.0697: stable keymap.h' 2018-07-13 20:54:52 +02:00
eaf54132f9 keymap: add commented events to match 8.0.0697
KE_MOUSEMOVE, KE_CANCEL are added in later patches.
2018-07-13 11:43:05 -04:00
175297a23a tests: <SNR> is represented as 'R' (ASCII) 2018-07-12 20:26:54 -04:00
01570f1ff3 terminal: handle &confirm and :confirm on unloading (#8726)
Show a proper confirmation dialog when trying to unload a terminal buffer while
the confirm option is set or when :confirm is used.

Fixes https://github.com/neovim/neovim/issues/4651
2018-07-12 14:57:20 +02:00
56065bbdc6 Merge pull request #8721 from bfredl/quickresize
Fix redrawing issues with narrow screen and remove extra wait in resize tests
2018-07-12 12:21:11 +02:00
e51bffefa5 screen: truncate showmode messages
Before this, bottom of screen got messed up when modemsg (+ one extra
space to not force terminal scroll) didn't fit on one line.
2018-07-12 10:27:23 +02:00
798f05876c vim-patch:8.0.0{474,475,492,633,1251} (#8725)
* vim-patch:8.0.0474: the client-server feature is not tested

Problem:    The client-server feature is not tested.
Solution:   Add a test.
15bf76d40b

* vim-patch:8.0.0475: not enough testing for the client-server feature

Problem:    Not enough testing for the client-server feature.
Solution:   Add more tests.  Add the remote_startserver() function.  Fix that
            a locally evaluated expression uses function-local variables.
7416f3e73a

* vim-patch:8.0.0492: a failing client-server request can make Vim hang

Problem:    A failing client-server request can make Vim hang.
Solution:   Add a timeout argument to functions that wait.
81b9d0bd5c

Include src/nvim/testdir/test_clientserver.vim changes from
patches 8.0.0477, 8.0.0479.

* vim-patch:8.0.0633: the client-server test is still a bit flaky

Problem:    The client-server test is still a bit flaky.
Solution:   Wait a bit for the GUI to start.  Check that the version number
            can be obtained.
60964f6874

Include src/nvim/testdir/test_clientserver.vim changes
from patches 8.0.0507, 8.0.0511.

* vim-patch:8.0.1251: invalid expressin passed to WaitFor()

Problem:    Invalid expressin passed to WaitFor().
Solution:   Check if the variable exists.
d97fbf171e
2018-07-12 06:22:55 +02:00
671b244e6c Merge #8701 from janlazo/vim-8.0.1140 2018-07-12 05:24:21 +02:00
07499a842b man.vim: C highlighting for EXAMPLES section #8709 2018-07-12 01:13:52 +02:00
9adb6ed74a Merge pull request #8719 from jamessan/libuv-errno
test: Rename includes/pre/uv-errno.h to includes/pre/uv.h
2018-07-11 08:27:46 -04:00
38f0ac07b5 tests/screen.lua: treat "resize" like any other event
Saves ~10 seconds in UI tests
2018-07-11 12:57:01 +02:00
9f8bd77d7b test/includes: Use ${gen_cdefs} when pre-processing headers
Now that uv.h is directly being included, pre-processing of
test/includes/pre/uv.h fails on Linux with

    In file included from «SRCDIR»/neovim/test/includes/pre/uv.h:1:
    In file included from /usr/include/uv.h:62:
    /usr/include/uv/unix.h:72:11: fatal error: 'uv/pthread-barrier.h' file not found
    # include "uv/pthread-barrier.h"
              ^~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

This happens because we're missing -D_GNU_SOURCE (part of ${gen_cdefs}),
which makes the pthread_barrier_* functionality visible.
2018-07-11 00:26:28 -04:00
ba7704ab4e test: Rename includes/pre/uv-errno.h to includes/pre/uv.h
libuv users are only supposed to directly include uv.h.  In v1.21.0, all
the uv-*.h headers were renamed to uv/*.h, which caused the unit tests
to fail with

    [123/125] Generating post/uv-errno.h
    FAILED: test/includes/post/uv-errno.h
    cd «SRCDIR»/src/neovim/build/test/includes && /usr/bin/clang -std=c99 -E -P «SRCDIR»/src/neovim/test/includes/pre/uv-errno.h -I/usr/include -I/usr/include -o «SRCDIR»/neovim/build/test/includes/post/uv-errno.h
    «SRCDIR»/src/neovim/test/includes/pre/uv-errno.h:1:10: error: 'uv-errno.h' file not found with <angled> include; use "quotes" instead
    #include <uv-errno.h>
             ^~~~~~~~~~~~
             "uv-errno.h"

The intention of the file is to extend libuv's error constants with more
values used by the unit tests.  This can just as easily be achieved
without poking into pseudo-private header files.
2018-07-11 00:26:07 -04:00
0fb695df8a vim-patch:8.0.0697: recorded key sequences may become invalid
Problem:    Recorded key sequences may become invalid.
Solution:   Add back KE_SNIFF removed in 7.4.1433. Use fixed numbers for the
            key_extra enum.
8858498516
2018-07-10 21:52:11 -04:00
ec6e78e77c Merge pull request #8716 from mhinz/vim-patch/wrapped-lines
[RFC] vim-patch.sh: handle wrapped commit messages
2018-07-10 20:12:14 -04:00
35b269f51f vim-patch.sh: Unwrap commit messages when reviewing PRs
Longer summary lines for commits may be wrapped when downloading the
commit from GitHub.  Unwrapping the lines ensures they can be compared
with the raw Vim commits.

The difference before and after this patch using:

  ./scripts/vim-patch.sh -r 8684

Before:

  ✘ Wrong commit message.
    Expected:
  vim-patch:8.0.1464: completing directory after :find does not add slash

  Problem:    Completing directory after :find does not add slash.
  Solution:   Adjust the flags for globpath(). (Genki Sky)
  vim/vim@8a37b03
    Actual:
  vim-patch:8.0.1464: completing directory after :find does not
   add slash

  Problem:    Completing directory after :find does not add slash.
  Solution:   Adjust the flags for globpath(). (Genki Sky)

After:

  ✔ Found expected commit message.

[ci skip]
2018-07-10 19:54:44 -04:00
a315026dc2 vim-patch:8.0.0522: Win32: clipboard=unnamed in :global (#8717)
Problem:    MS-Windows: when 'clipboard' is "unnamed" yyp does not work in a
            :global command.
Solution:   When setting the clipboard was postponed, do not clear the
            register.
3fcfa35f82
2018-07-11 00:15:09 +02:00
0ed8b12a07 transstr_buf: fix length comparison #8681
closes #8466
closes #8664
Regression by 0d7daaad98.

- Fix length comparison.
- Fix loop(s) which iterated over all fields of array `pcc` even if it
  was not filled up (try unicode 0x9f as statusline character).

Note about the tests:
- To input unicode with more than two hex digits you can use <C-v>U...:
  a + U+fe20: a︠
  a + U+fe20 + U+fe21: a︠︡
2018-07-10 21:57:26 +02:00
627cc1b3d8 test: build_stl_str_hl (#8703)
Improve coverage of `build_stl_str_hl`.
Minor removal of dead code in the tested function.
2018-07-10 20:46:40 +02:00
2574f299e5 vim-patch:8.0.1464: add slash when completing directory #8684
Problem:    Completing directory after :find does not add slash.
Solution:   Adjust the flags for globpath(). (Genki Sky)
8a37b03289
2018-07-10 19:33:18 +02:00
d241f278d3 Merge pull request #8708 from blueyed/fix-standout
Fix standout mode
2018-07-10 11:32:27 -04:00
13bdc21faf Merge pull request #8712 from jamessan/unicode-11
Update unicode files
2018-07-10 06:53:48 -04:00
7b2f6a7e5f Update unicode files 2018-07-10 06:53:11 -04:00
44a284d71c vim-patch.sh: review_commit: Fix regex for vim version
067bb1e9f changed the commit format to include a brief description in
the summary line of the commit.
2018-07-09 13:55:21 -04:00
56af2f8c5f vim-patch.sh: Use single quotes to avoid doubling backslashes 2018-07-09 13:51:13 -04:00
9afed40ea6 man.vim: fix for mandoc (#8698)
When giving a section, the first candidate selection was not performed.

followup/fixup #8341
2018-07-08 17:31:10 +02:00
07f82ad1be TUI: urxvt: also send xterm focus-reporting seqs #8699
urxvt supports the xterm sequence for focus reporting in master / CVS
since 2016 [1].

This has not been released yet, but is expected to be in 9.23.

In 3d0ee17 a special case for rxvt was added, which requires a custom
urxvt extension, see #7578.

Since urxvt 9.23 is not released still, and extensions for handling this
manually appear to be in use, this sends both escape sequences for rxvt.

Fixes https://github.com/neovim/neovim/issues/8695.

1: 75264fa544 (diff-2c8f5590ce4fa7495edcf7572c89c77b)
2018-07-08 17:27:09 +02:00
813563365c [WIP/RFC] Fix standout mode
It was not working for me in different terminals.

This patch makes it work in the same way like reverse.

Test:

    :hi jediUsage cterm=standout | hi jediUsage
2018-07-08 17:26:17 +02:00
21879247e7 vim-patch:8.0.1387: wordcount test is old style
Problem:    Wordcount test is old style.
Solution:   Change into a new style test. (Yegappan Lakshmanan, closes vim/vim#2434)
a703aaee4d
2018-07-07 23:36:03 -04:00
9836283c49 vim-patch:8.0.1022: test 80 is old style
Problem:    Test 80 is old style.
Solution:   Turn it into a new style test. (Yegappan Lakshmanan)
1a333bc44a
2018-07-07 22:59:30 -04:00
57fafcea23 Merge #8702 from janlazo/nvim-8.0.0654 2018-07-08 00:08:21 +02:00
378d5f0fa3 clint: use stdout for normal/expected output (#8700) 2018-07-08 00:02:27 +02:00
a5ed460241 tests: endfunc allows uncommented bar 2018-07-07 13:31:55 -04:00
0ac67853b9 vim-patch: finish port of 8.0.0{654,663,667}
Fix ex_function so that :endfunction passes the test.
Remove variables, added in 60c0252672.
2018-07-07 10:17:13 -04:00
b5c0031d4e oldtests: fix func Test_echo_and_string() 2018-07-07 07:14:06 -04:00
37757b4f09 vim-patch:8.0.1253: still too many old style tests
Problem:    Still too many old style tests.
Solution:   Convert a few more tests to new style. (Yegappan Lakshmanan,
            closes vim/vim#2272)
430dc5d360

Skip Test_tag_file_encoding.
083_tag_search_with_file_encoding_spec.lua handles the same test case.
2018-07-06 23:51:46 -04:00
41ccdb1ef2 vim-patch:8.0.1140: still old style tests
Problem:    Still old style tests.
Solution:   Convert two tests to new style. (Yegappan Lakshmanan)
bb3e6416f1
2018-07-06 22:32:45 -04:00
336ce02a6e vim-patch:8.0.0663: unexpected error with 'verbose' (#8692)
Problem:    Giving an error message only when 'verbose' set is unexpected.
Solution:   Give a warning message instead.
f8be461d02
2018-07-06 20:50:08 +02:00
2bfabd5bf8 Merge #8680 from janlazo/vim-8.0.0640 2018-07-04 19:23:56 +02:00
e889640048 provider/node: npm --loglevel silent (#8682)
closes #8674
npm log level may cause unexpected output.
2018-07-04 12:13:36 +02:00
297dc3f997 vim-patch:8.0.0686: extra redraw when using CTRL-L in second window
Problem:    When typing CTRL-L in a window that's not the first one, another
            redraw will happen later. (Christian Brabandt)
Solution:   Reset must_redraw after calling screenclear().
9f5f7bf4d5
2018-07-03 21:14:00 -04:00
a8071354e1 vim-patch:8.0.0640: mismatch between help and actual message
Problem:    Mismatch between help and actual message for ":syn conceal".
Solution:   Change the message to match the help. (Ken Takata)
83064068ea
2018-07-03 20:59:12 -04:00
bd51a0cd04 Merge #8672 'test: nvim_buf_attach after delay' 2018-07-02 23:32:28 +02:00
4a83b64777 coverity/166184: Null pointer dereference (FP)
False positive: should never happen, because unibi_from_env() would return
NULL if $TERM is undefined.
2018-07-02 20:56:37 +02:00
f65a751d82 test: nvim_buf_attach: reduce delay
This test is mostly a demo/reference for:
https://github.com/neovim/neovim/issues/8634#issuecomment-400940467
so let's not pay a 1s penalty.
2018-07-02 20:47:28 +02:00
b4fcf02316 test: nvim_buf_attach response after initial delay
ref #8634
2018-07-01 17:31:58 +02:00
60ef7889a2 test: buffer_updates: 10s timeout 2018-07-01 17:31:00 +02:00
ef9ef75a7b Merge #8635 from janlazo/vim-8.0.0252 2018-07-01 15:29:20 +02:00
22d95e462e coverity/108274: tty-test.c: Insecure data handling (#8666) 2018-07-01 14:48:30 +02:00
3e4a058b01 test: port kword_test to Lua for utf_char2bytes()
Use LuaJIT FFI to create char pointer.
Validate output with utf_ptr2char(), vim_iswordc() and vim_iswordp().
Use const for LuaJIT string-to-char conversion.
2018-07-01 08:45:19 -04:00
6ff892165a vim-patch:8.0.0252: not properly recognizing word characters between 128 and 255
Problem:    Characters below 256 that are not one byte are not always
            recognized as word characters.
Solution:   Make vim_iswordc() and vim_iswordp() work the same way. Add a test
            for this. (Ozaki Kiichi)
4019cf90b8
2018-07-01 08:45:13 -04:00
40911e435e API: emit nvim_buf_lines_event from :terminal #8616
closes #8575
2018-07-01 14:42:56 +02:00
70626e6a1e vim-patch:8.0.0593: DRY: setting list/dict return value (#8639)
Problem:    Duplication of code for adding a list or dict return value.
Solution:   Add rettv_dict_set() and rettv_list_set(). (Yegappan Lakshmanan)
45cf6e910c
2018-06-30 14:16:10 +02:00
d088331ea3 Merge pull request #8661 from jamessan/gen_api_vimdoc
gen_api_vimdoc: Make executable and change #! to python3
2018-06-29 21:08:16 -04:00
85d5bf81b9 gen_api_vimdoc: Make executable and change #! to python3 2018-06-29 18:46:05 -04:00
a98a1d10e3 Merge pull request #8656 from bfredl/wd_ls
ui: don't crash when 'writedelay' is set and redrawing inside an event handler
2018-06-29 15:27:25 +02:00
5efab06198 ui: don't crash when 'writedelay' is set and redrawing inside an event handler 2018-06-28 23:38:06 +02:00
12481781a0 highlight: high-priority CursorLine if fg is set. #8578
closes #7383
closes #7715

This implements the compromise described in #7383:
* low-priority CursorLine if foreground is not set
* high-priority ("same as Vim" priority) CursorLine if foreground is set

ref d1874ab282
ref 56eda2aa17
2018-06-28 01:49:40 +02:00
166aaf178c doc (#8652) 2018-06-28 00:48:17 +02:00
b40f87cdf5 Merge pull request #8650 from jamessan/skip-pydo-tests
oldtest: Disable tests that :py(3)do stop executing when buffer changes
2018-06-27 12:51:36 -04:00
363a232cb4 Merge #8645 from janlazo/vim-8.0.0677 2018-06-27 18:28:32 +02:00
9946a5ebd9 oldtest: Disable tests that :py(3)do stop executing when buffer changes
The current nvim <-> client handling of do_range needs to be adapted to
handle these sorts of checks.

See https://github.com/neovim/neovim/issues/8554
2018-06-27 08:03:46 -04:00
33eb5833b2 vim-patch:8.0.0688: cannot resize the window in a FileType autocommand
Problem:    Cannot resize the window in a FileType autocommand. (Ingo Karkat)
Solution:   Add the CMDWIN flag to :resize. (test by Ingo Karkat,
            closes vim/vim#1804)
9c4fefffb6
2018-06-26 10:21:39 -04:00
bfe029a11d vim-patch:8.0.0677: setting 'filetype' may switch buffers
Problem:    Setting 'filetype' internally may cause the current buffer and
            window to change unexpectedly.
Solution:   Set curbuf_lock. (closes vim/vim#1734)
1814183b86
2018-06-26 10:21:39 -04:00
da6874a7b2 API: nvim_win_set_cursor: set w_set_curswant #8640
This one behaves correctly eg in the presence of unicode.

ref #8613
2018-06-26 08:54:14 +02:00
cafb92487b Merge #8642 from janlazo/vim-8.0.0704 2018-06-26 08:14:09 +02:00
b79523681d vim-patch:8.0.0707: freeing wrong memory with certain autocommands
Problem:    Freeing wrong memory when manipulating buffers in autocommands.
            (James McCoy)
Solution:   Also set the w_s pointer if w_buffer was NULL.
f1d13478e3
2018-06-25 11:41:45 -04:00
fee4e39ca3 vim-patch:8.0.0706: crash when cancelling the cmdline window in Ex mode
Problem:    Crash when cancelling the cmdline window in Ex mode. (James McCoy)
Solution:   Do not set cmdbuff to NULL, make it empty.
5a15b6aa0a
2018-06-25 11:39:40 -04:00
b00211a551 vim-patch:8.0.0704: problems with autocommands when opening help
Problem:    Problems with autocommands when opening help.
Solution:   Avoid using invalid "varp" value.  Allow using :wincmd if buffer
            is locked. (closes vim/vim#1806, closes vim/vim#1804)
163095f088
2018-06-25 11:34:10 -04:00
cc0d50a2c2 Improved version of #8613
This one behaves correctly eg in the presence of unicode
2018-06-25 13:44:02 +01:00
1cbc830189 API: nvim_win_set_cursor: set curswant #8613
Fixes #8591
2018-06-25 02:14:55 +02:00
e475476d10 Merge #8621 from janlazo/vim-8.0.0642 2018-06-25 02:08:21 +02:00
7892192751 vim-patch:8.1.0107: getting buffer option clears message (#8637)
defe6424ae

Author: Bram Moolenaar <Bram@vim.org>
Date:   Sun Jun 24 15:14:07 2018 +0200

    patch 8.1.0107: Python: getting buffer option clears message

    Problem:    Python: getting buffer option clears message. (Jacob Niehus)
    Solution:   Don't use aucmd_prepbuf(). (closes #3079)
2018-06-24 22:27:32 +02:00
14b3741ec5 test: update writefile test for invalid list items
It validates list items with tv_check_str_on_nr()
to catch invalid types (ex. E745, E805).
If there is an invalid item, it does not write to the file.
2018-06-24 16:22:16 -04:00
47b26e8716 l10n: Update Ukrainian translation (#8622) 2018-06-24 22:19:21 +02:00
39e284772d vim-patch:8.0.0642: writefile() continues after detecting an error
Problem:    writefile() continues after detecting an error.
Solution:   Bail out as soon as an error is detected. (suggestions by Nikolai
            Pavlov, closes vim/vim#1476)
8cf91286ca
2018-06-24 16:19:21 -04:00
38fb835854 vim-patch:8.0.0548: saving the redo buffer only works one time (#8629)
Problem:    Saving the redo buffer only works one time, resulting in the "."
            command not working well for a function call inside another
            function call. (Ingo Karkat)
Solution:   Save the redo buffer at every user function call. (closes vim/vim#1619)
d4863aa99e
2018-06-24 22:16:57 +02:00
83be7cec98 vim-patch:8.0.0535: leak when exiting user function (#8574)
Problem:    Memory leak when exiting from within a user function.
Solution:   Clear the function call stack on exit.
6914c64ee5
2018-06-24 20:35:25 +02:00
89cb304ea0 vim-patch:8.0.0{538,539} (#8615)
* vim-patch:8.0.0538: no test for falling back to default term value

Problem:    No test for falling back to default term value.
Solution:   Add a test.
85045a73db

* vim-patch:8.0.0539: startup test fails on Mac

Problem:    Startup test fails on Mac.
Solution:   Use another term name, "unknown" is known. Avoid a 2 second delay.
08f88b139d

* oldtest: nvim does not support ':set term'
2018-06-24 20:23:33 +02:00
15bd936b96 win/deps: Fix copy to subdir (#8636)
The `external_blobs` target was not copying dependency files into
the correct subdirectories. This caused a bug where nvim-qt wouldn't
start because `qwindows.dll` was not located in the `platforms`
subdirectory.

closes https://github.com/equalsraf/neovim-qt/issues/422
2018-06-24 20:21:52 +02:00
3d688cc25d vim-patch:8.0.0627: "gn" selects only one character with 'nowrapscan' (#8632)
Problem:    When 'wrapscan' is off "gn" does not select the whole pattern when
            it's the last one in the text. (KeyboardFire)
Solution:   Check if the search fails. (Christian Brabandt, closes vim/vim#1683)
add8dce38d
2018-06-24 10:37:59 +02:00
bf6048e81d checkhealth: Python: fix VIRTUAL_ENV check (#8628)
Compare `$VIRTUAL_ENV` to `python_bin`.
This is necessary when `g:python_host_prog` is set to an absolute path,
and looking up `pyname` in `$PATH` yields another result.
2018-06-24 10:28:21 +02:00
ddde747644 vim-patch:8.0.0544: cppcheck warnings (#8627)
Problem:    Cppcheck warnings.
Solution:   Use temp variable. Change NUL to NULL. Swap conditions. (Dominique
            Pelle)
866c688610
2018-06-23 12:45:10 +02:00
7f7802e643 main: fix FALLTHROUGH hints (#8623)
GCC (Clang also?) does not recognize FALLTHROUGH comments when the
case is wrapped in braces.
2018-06-22 10:49:54 +02:00
bf2460e2f9 Merge pull request #7551 from bfredl/setl_bufwin
fix copying setl options for buffer currently displayed in another window
2018-06-22 09:53:46 +02:00
e1c6109e62 Merge #8618 'Replace b_changedtick with always-inline functions' 2018-06-22 08:35:28 +02:00
b7514493a0 defaults: shortmess+=F (#8619)
Because we default to laststatus=2 (statusline is always visible), the
:edit message is not useful.

ref #6289
2018-06-22 08:18:02 +02:00
ZyX
eaf2a25f12 *: Replace b_changedtick with new always-inline functions
Ref #8474
2018-06-22 00:44:31 +03:00
cf659a1926 Merge #8612 from janlazo/vim-8.0.0621 2018-06-21 22:54:08 +02:00
8917e0c301 buffer: fix copying setl options for buffer currently displayed in another window
vim-patch:8.0.1836: buffer-local window options may not be recent
Problem:    Buffer-local window options may not be recent if the buffer is
            still open in another window.
Solution:   Copy the options from the window instead of the outdated window
            options. (Bjorn Linse, closes vim/vim#2336)
25782a7ff4
2018-06-21 22:41:15 +02:00
10083ec4cc vim-patch:8.0.0648: possible use of NULL pointer
Problem:    Possible use of NULL pointer if buflist_new() returns NULL.
            (Coverity)
Solution:   Check for NULL pointer in set_bufref().
fadacf01d0
2018-06-21 12:50:31 -04:00
bf61885cb4 vim-patch:8.0.0621: :stag does not respect 'switchbuf'
Problem:    The ":stag" command does not respect 'switchbuf'.
Solution:   Check 'switchbuf' for tag commands that may open a new window.
            (Ingo Karkat, closes vim/vim#1681)  Define macros for the return values
            of getfile().
8ad80dea08
2018-06-21 12:50:30 -04:00
7ae7da8fb9 vim-patch:8.0.0468: g< after aborting an Ex command (#7941)
Problem:    After aborting an Ex command g< does not work. (Marcin
            Szamotulski)
Solution:   Postpone clearing scrollback messages to until the command line
            has been entered.  Also fix that the screen isn't redrawn if after
            g< the command line is cancelled.
f2405ed232
2018-06-21 11:36:26 +02:00
b92d6f490d vim-patch:8.0.{0632,1536} (#8609)
vim-patch:8.0.0632: the quotestar test is still a bit flaky
Problem:    The quotestar test is still a bit flaky.
Solution:   Kill any existing server to make the retry work.  Wait for the
            register to be filled.
1c13c0fe3e

vim-patch:8.0.1536: quotestar test is flaky when using the GUI
Problem:    Quotestar test is flaky when using the GUI.
Solution:   Add check that the star register arrived at the server.  Increase
            timeouts.
791010e648
2018-06-21 11:27:24 +02:00
52ebe34eeb vim-patch:8.0.0616: not always setting 'background' correctly after :hi Normal (#8606)
Problem:    When setting the cterm background with ":hi Normal" the value of
            'background' may be set wrongly.
Solution:   Check that the color is less than 16.  Don't set 'background' when
            it was set explicitly. (Lemonboy, closes vim/vim#1710)
1615b36b91

Restore reset_option_was_set(), removed in 419da839e0

ref #8595
ref #8597
2018-06-21 11:15:11 +02:00
8794a551bd vim-patch:8.0.0{469,581,583} (#8601)
vim-patch:8.0.0469: compiler warnings on MS-Windows
Problem:    Compiler warnings on MS-Windows.
Solution:   Add type casts. (Christian Brabandt)
0c0d4eca4d

vim-patch:8.0.0581: moving folded text is sometimes not correct
Problem:    Moving folded text is sometimes not correct.
Solution:   Bail out when "move_end" is zero. (Matthew Malcomson)
94be619e30

vim-patch:8.0.0583: fold test hangs on MS-Windows
Problem:    Fold test hangs on MS-Windows.
Solution:   Avoid overflow in compare.
b11c826ddc
2018-06-20 10:29:09 +02:00
b454d24e04 vim-patch:8.0.0669: CTRL-N at start of the buffer does not work correctly (#8600)
Problem:    In Insert mode, CTRL-N at start of the buffer does not work
            correctly. (zuloloxi)
Solution:   Wrap around the start of the buffer. (Christian Brabandt)
24a9e348aa
2018-06-20 08:17:00 +02:00
6e55c5997e vim-patch:8.0.0636: when reading the undo file fails may use uninitialized data (#8599)
Problem:    When reading the undo file fails may use uninitialized data.
Solution:   Always clear the buffer on failure.
56f2db562d
2018-06-20 02:29:51 +02:00
6294a807d3 Merge #8579 win: cmake: Improvements for building with IDEs 2018-06-20 02:19:42 +02:00
18710e7720 Merge #8596 from janlazo/vim-8.0.0615 2018-06-20 00:58:33 +02:00
b36aba9840 vim-patch:8.0.0551: the typeahead buffer is reallocated too often (#8598)
Problem:    The typeahead buffer is reallocated too often.
Solution:   Re-use the existing buffer if possible.
d34f9b1155
2018-06-20 00:56:55 +02:00
f389fea8fa Merge #8503 from janlazo/vim-8.0.0549 2018-06-20 00:54:25 +02:00
141df73930 vim-patch:8.0.0568: 1gd may hang
Problem:    "1gd" may hang.
Solution:   Don't get stuck in one position. (Christian Brabandt, closes vim/vim#1643)
60402d68da
2018-06-19 16:57:29 -04:00
14e70878c5 lint 2018-06-19 16:12:55 -04:00
3cc7462a0c vim-patch:8.0.0546: swap file exists briefly when opening the command window (#8588)
Problem:    Swap file exists briefly when opening the command window.
Solution:   Set the noswapfile command modifier before splitting the window.
            (James McCoy, closes vim/vim#1620)
3bab93998d
2018-06-19 21:22:34 +02:00
c1d7a28093 vim-patch:8.0.0549: no test for the 8g8 command
Problem:    No test for the 8g8 command.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#1615)
395b6bab33
2018-06-19 15:16:44 -04:00
b479f89979 vim-patch:8.0.0617: hardcopy test hangs on MS-Windows
Problem:    Hardcopy test hangs on MS-Windows.
Solution:   Check the postscript feature is supported.
763209c57b
2018-06-19 15:10:17 -04:00
6d4d271694 vim-patch:8.0.0615: using % with :hardcopy wrongly escapes spaces
Problem:    Using % with :hardcopy wrongly escapes spaces. (Alexey Muranov)
Solution:   Expand % differently. (Christian Brabandt, closes vim/vim#1682)
bf15b8d78b
2018-06-19 15:08:43 -04:00
74d19f685f Merge #8576 from justinmk/startup-empty-stdin 2018-06-19 21:04:08 +02:00
a10938ae31 vim-patch:8.0.0537: illegal memory access with :z and large count (#8592)
Problem:    Illegal memory access with :z and large count.
Solution:   Check for number overflow, using long instead of int. (Dominique
            Pelle, closes vim/vim#1612)
fa0ad0bb0b
2018-06-19 20:35:37 +02:00
943e607442 Merge pull request #8593 from jamessan/vim-patch-printf-fix
vim-patch: Replace shell variables in printf with formatted args
2018-06-19 11:05:28 -04:00
c8af12d0fa vim-patch: Replace shell variables in printf with formatted args
This ensures that special characters in the variables are not
interpreted as escapes/format characters in the printf string, as was
seen with upstream patch 8.0.0615.

    $ ./scripts/vim-patch.sh -p 8.0.0615
    Updating Vim sources: /$HOME/src/neovim/.vim-src
    ✔ Updated Vim sources.
    ✔ Found Vim revision 'bf15b8d78b22661db8b19d662b62bb9a061cdd37'.
    Creating patch...
    Pre-processing patch...
    ✔ Saved patch to '/$HOME/src/neovim/vim-8.0.0615.patch'.

    Fetching 'origin/master'.
    ✔ From https://github.com/neovim/neovim
     * branch                master     -> FETCH_HEAD

    Creating new branch 'vim-8.0.0615' based on 'origin/master'.
    ✔ Switched to a new branch 'vim-8.0.0615'
    Branch 'vim-8.0.0615' set up to track remote branch 'master' from 'origin'.

    Creating empty commit with correct commit message.
    ./scripts/vim-patch.sh: line 40: printf: `w': invalid format character
    ✔ [vim-8.0.0615 db7fbb016] vim-patch:8.0.0615: using ./scripts/vim-patch.sh: line 44: printf: `w': invalid format character
    ✘ [vim-8.0.0615 db7fbb016] vim-patch:8.0.0615: using

[ci-skip]
2018-06-19 10:20:48 -04:00
63b5f05d47 vim-patch:8.0.0455: the mode test may hang (#8577)
Problem:    The mode test may hang in Test_mode(). (Michael Soyka)
Solution:   Set 'complete' to only search the current buffer (as suggested by
            Michael)
ffea8c99d9
2018-06-19 10:51:51 +02:00
3c24a6c317 vim-patch:8.0.0542: getpos() can return a negative line number (#8580)
Problem:    getpos() can return a negative line number. (haya14busa)
Solution:   Handle a zero topline and botline. (closes vim/vim#1613)
a1d5fa65bc
2018-06-19 10:50:52 +02:00
b148213366 vim-patch:8.0.0598: building with gcc 7.1 yields new warnings (#8585)
Problem:    Building with gcc 7.1 yields new warnings.
Solution:   Initialize result. (John Marriott)
9e0f6ec076
2018-06-19 10:48:25 +02:00
9500448220 Merge #8584 from janlazo/vim-8.0.0467 2018-06-19 10:46:47 +02:00
9625e9da75 startup: delete empty stdin buffer if other files were opened
DWIM: avoid empty buffer 1 when stdin was empty. If other files were
specified at startup, we assume that stdin is only accidentally
not-a-TTY: user did not intend to send text from it.

ref #8560
ref #8561
2018-06-18 21:51:42 +02:00
37675c6a87 Merge #8558 from jamessan/gnucxx-compiler-for-gnu-source
cmake: Check for GNU compiler, not Linux, to set -D_GNU_SOURCE
2018-06-18 20:37:39 +02:00
09cd4d0a43 use wchar_t instead of WCHAR #6998
wchar_t has better cross-platform support and seems to fix an issue
on MinGW when building with `-std=c99`.
2018-06-18 19:24:34 +02:00
d44ed79ccc startup: go to buffer 2 if stdin is empty
If stdin is not a TTY we read it into buffer 1, as text. But if the
stdin pipe is empty, Nvim was most likely invoked for some other reason.
DWIM: select buffer 2 (if it exists). Example:

    echo file1 | xargs nvim

closes #8560
closes #8561
ref https://github.com/equalsraf/neovim-qt/issues/417
2018-06-18 17:51:38 +02:00
84970bafd4 vim-patch:8.0.0547: extra line break in verbosefile
Problem:    Extra line break in verbosefile when using ":echomsg". (Ingo
            Karkat)
Solution:   Don't call msg_start(). (closes vim/vim#1618)
52604f2454
2018-06-18 08:38:29 -04:00
5d8594f636 vim-patch:8.0.0467: using g< after :for does not show the right output
Problem:    Using g< after :for does not show the right output. (Marcin
            Szamotulski)
Solution:   Call msg_sb_eol() in :echomsg.
57002ad70c
2018-06-18 08:37:05 -04:00
a26fd8a888 cmake: Prefer add_definitions() for setting preprocessor defines 2018-06-18 08:01:16 -04:00
863a87d5f3 cmake: Comply with new CMP0054 policy 2018-06-18 08:01:16 -04:00
23c9e3ec1e Raise minimum CMake version to 2.8.12 and remove compat code
2.8.12 is supported by our main CI targets and [repology] confirms that
this is broadly supported.

[repology]: https://repology.org/metapackage/cmake/information
2018-06-18 08:00:30 -04:00
25435a4bad cmake: Consolidate enabling of "undefined symbol" errors 2018-06-18 07:58:18 -04:00
33952c48bc cmake: Explicitly declare C as the project language
There's a mix of CXX and C related variables being set/referenced in our
CMake files.  Since we only use C, use an explicit language list of "C"
instead of the implicit "C CXX" and replace all uses of CXX variables
with their C counterparts
2018-06-18 07:58:18 -04:00
4938ee08e8 cmake: Check for GNU compiler, not Linux, to set -D_GNU_SOURCE
The Debian hurd-i386 [build] failed (partly) due to -D_GNU_SOURCE not be
defined:

    [215/286] /usr/bin/cc -DINCLUDE_GENERATED_DECLARATIONS -Iconfig -I../src -Isrc/nvim/auto -Iinclude -I/usr/include/luajit-2.1 -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=2 -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -O2 -g  -DMIN_LOG_LEVEL=3 -Og -g   -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -Wno-array-bounds -MD -MT src/nvim/CMakeFiles/nvim.dir/os/pty_process_unix.c.o -MF src/nvim/CMakeFiles/nvim.dir/os/pty_process_unix.c.o.d -o src/nvim/CMakeFiles/nvim.dir/os/pty_process_unix.c.o   -c ../src/nvim/os/pty_process_unix.c
    ../src/nvim/os/pty_process_unix.c: In function 'pty_process_tty_name':
    ../src/nvim/os/pty_process_unix.c:121:10: warning: implicit declaration of function 'ptsname'; did you mean 'ttyname'? [-Wimplicit-function-declaration]
       return ptsname(ptyproc->tty_fd);

Hurd is obviously not Linux, but it is using a GNU compiler and glibc so
it needs -D_GNU_SOURCE for the ptsname() definition to be visible.

[build]: https://buildd.debian.org/status/fetch.php?pkg=neovim&arch=hurd-i386&ver=0.3.0-2&stamp=1528981349&raw=0
2018-06-18 07:58:18 -04:00
66a39fce6c Merge #8502 from janlazo/vim-8.0.0481 2018-06-17 23:52:55 +02:00
c1c14faad9 Merge #8520 'Ex mode: always "improved" (gQ)' 2018-06-17 23:19:59 +02:00
7097aba6be cmake: Organize targets into folders
Enabling CMake's USE_FOLDERS option and adding the FOLDER property to
targets allows some IDEs to list the targets in an organized
hierarchy of folders.
2018-06-17 07:54:39 -05:00
487cf98c0b startup: fix -E/-Es without -u NONE
Before this change, -E/-Es without `-u NONE` reads stdin as Ex commands.
It should always read stdin as text (into buffer 1), like this:

    echo foo | nvim -Es +'%p'
    foo
    echo foo | nvim -Es -u NORC +'%p'
    foo
2018-06-17 14:50:53 +02:00
9c2099d585 Ex mode: use getexline() instead of getexmodeline()
This changes Ex mode (Q, -e) to work like Vim's "improved Ex mode"
(gQ, -E).  That brings some small behavior differences, but should not
impact most Ex scripts (unless, for example, they depend on mappings
being disabled--but that can be solved for -e by skipping user config).

Before this change:
* the screen test hangs.

After this change:
* Q acts like gQ.
* -e/-es differs from -E/-Es only in its treatment of stdin.

This moves towards potentially removing getexmodeline().
(HINT: That does NOT mean "removing Ex mode", it means removing the
Vi-compatible Ex mode, which differs from Vim's "improved Ex mode" only
in some minor details (e.g. mappings are disabled).)

ref #1089 :-)~
2018-06-17 14:50:53 +02:00
3cc3506965 checkhealth: node.js: also search yarn #8528
- "neovim" package may be installed with yarn. Check yarn if npm fails.
- Use filereadable() instead of glob(). closes #8552
2018-06-17 13:05:55 +02:00
8192267dea vim-patch:8.0.0609: some people still don't know how to quit (#8571)
Problem:    For some people the hint about quitting is not sufficient.
Solution:   Put <Enter> separately.  Also use ":qa!" to get out even when
            there are changes.
28a8193e31
2018-06-17 12:51:03 +02:00
367343ae6e vim-patch:8.0.0625: shellescape() always escapes a newline (#8573)
Problem:    shellescape() always escapes a newline, which does not work with
            some shells. (Harm te Hennepe)
Solution:   Only escape a newline when the "special" argument is non-zero.
            (Christian Brabandt, closes vim/vim#1590)
206155280d
2018-06-17 12:20:42 +02:00
b006771cba Merge #8570 'gen_events.lua: define NUM_EVENTS as enum' 2018-06-16 19:57:28 +02:00
a503349e20 Merge #8569 from janlazo/vim-8.0.0602 2018-06-16 18:24:54 +02:00
26dc628ab3 Merge #8567 from ckelsel/vim-8.0.0530 2018-06-16 18:21:14 +02:00
de022d2570 vim-patch:8.0.0604: gF test fails still on MS-Windows
Problem:    gF test fails still on MS-Windows.
Solution:   Use : before the line number and remove it from 'isfname'.
712598f210
2018-06-16 11:37:13 -04:00
0d3557ad72 vim-patch:8.0.0603: gF test fails on MS-Windows
Problem:    gF test fails on MS-Windows.
Solution:   Use @ instead of : before the line number
d7aca7a71c
2018-06-16 11:37:13 -04:00
440c33343d vim-patch:8.0.0602: when gF fails to edit the file the cursor still moves
Problem:    When gF fails to edit the file the cursor still moves to the found
            line number.
Solution:   Check the return value of do_ecmd(). (Michael Hwang)
2a79ed293c
2018-06-16 11:37:12 -04:00
dd2e1e9445 syntax: refactor syn_finish_line to return bool 2018-06-16 10:22:20 -04:00
2add88eedc vim-patch:8.0.0481: unnecessary if statement
Problem:    Unnecessary if statement.
Solution:   Remove the statement.  Fix "it's" vs "its" mistakes. (Dominique
            Pelle, closes vim/vim#1568)
aab93b12cb
2018-06-16 10:20:18 -04:00
33596d5d07 fix lint 2018-06-16 19:46:41 +08:00
bbf00120f7 vim-patch:8.0.0545: edit test may fail on some systems
Problem:    Edit test may fail on some systems.
Solution:   If creating a directory with a very long path fails, bail out.
15ecbd6f3d
2018-06-16 19:43:01 +08:00
3ff1907593 vim-patch:8.0.0543: test_edit causes older xfce4-terminal to close
Problem:    Test_edit causes older xfce4-terminal to close. (Dominique Pelle)
Solution:   Reduce number of columns to 2000.  Try to restore the window
            position.
ba6ec18297
2018-06-16 19:41:58 +08:00
264725c25f vim-patch:8.0.0532: test with long directory name fails on Mac
Problem:    Test with long directory name fails on Mac.
Solution:   Skip the test on Mac systems.
c77d675747
2018-06-16 19:41:18 +08:00
9a1234e57f vim-patch:8.0.0531: test with long directory name fails on non-unix systems
Problem:    Test with long directory name fails on non-unix systems.
Solution:   Skip the test on non-unix systems.
9b81079ddd
2018-06-16 19:40:46 +08:00
ebc7f69d92 vim-patch:8.0.0530: buffer overflow when 'columns' is very big
Problem:    Buffer overflow when 'columns' is very big. (Nikolai Pavlov)
Solution:   Correctly compute where to truncate.  Fix translation.
            (closes vim/vim#1600)
658a3a2caf
2018-06-16 19:39:40 +08:00
eeeaf04c5e Merge #8565 from janlazo/vim-8.0.0575 2018-06-16 12:42:05 +02:00
4bb039e225 Merge #8543 from janlazo/vim-8.0.0596 2018-06-16 12:01:09 +02:00
4c3c04d03c Merge #8526 from janlazo/vim-8.0.0451 2018-06-16 11:55:40 +02:00
f4dffe7181 vim-patch:8.0.0577: warning for uninitialized variable
Problem:    Warning for uninitialized variable. (John Marriott)
Solution:   Initialize "indent".
97db5541a6
2018-06-16 00:37:37 -04:00
9ab6fe4fed vim-patch:8.0.0575: using freed memory when resetting 'indentexpr'
Problem:    Using freed memory when resetting 'indentexpr' while evaluating
            it. (Dominique Pelle)
Solution:   Make a copy of 'indentexpr'.
a701b3b6f0
2018-06-16 00:37:37 -04:00
1cc3b32f4c build/test: skip empty TEST_TAG, TEST_FILTER
- Empty "--tags=", "--filter=" prevents TEST_FILE from running.
- Fix another bug: TEST_FILTER overwrote TEST_TAG.
2018-06-16 02:12:35 +02:00
2a274cbe30 gen_events.lua: define NUM_EVENTS as an enum value
Fix PVS warnings:

    fileio.c:7293   Medium  V547    Expression is always true.
    fileio.c:7351   Medium  V547    Expression 'event == 100' is always false.

event_name2nr returns event_T, so PVS infers that nothing outside of
that range could possibly be returned.
2018-06-16 01:57:30 +02:00
c990d65c37 get_maphash: fix off-by-one
Patch-by: oni-link <knil.ino@gmail.com>

ref: https://github.com/neovim/neovim/pull/6236#discussion_r195113807
2018-06-14 19:00:37 +02:00
c46997aa87 Merge pull request #8546 from bfredl/eob
Add fillchar for EndOfBuffer and check for invalid UTF-8
2018-06-14 18:00:59 +02:00
f39a0f5dd0 build/win: Add workaround for Windows command length limit
When building with the Ninja generator on Windows, it was possible for
the external_blobs target to fail when the generated command exceeds the
command length limit (8191 characters). To workaround the problem, a
CMake script is used to copy the files instead of a shell command.

Visual Studio bug report:
https://developercommunity.visualstudio.com/content/problem/212207/file-open-cmake-the-command-line-is-too-long.html
2018-06-14 09:34:18 -05:00
f27a665e05 Merge pull request #8549 from jamessan/output_spec-printf
functionaltest: Use octal escapes for printf
2018-06-14 08:06:38 -04:00
5442f0b622 fillchars: make checks more strict and improve tests 2018-06-14 14:00:09 +02:00
6c0f1903e6 functionaltest: Use octal escapes for printf
According to POSIX[0], only octal escapes are supported by the printf
command.  GNU coreutils' printf and some shells' builtin printf versions
which support hex escapes, but dash and non-GNU printf do not.

[0]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html
2018-06-13 23:03:37 -04:00
a7bb63c55d Add ‘eob’ option to fillchars
This option allows configuring what character is shown on the empty
lines at the end of a buffer, previously hardcoded to ‘~’
2018-06-13 17:54:16 +02:00
3462acbbff lint 2018-06-13 07:10:17 -04:00
463da84806 Merge pull request #7992 from bfredl/mbscreen
Represent Screen state as UTF-8
2018-06-13 11:11:12 +02:00
f4ba20d1c0 Fix implicit conversion warning (#8536) 2018-06-13 10:48:29 +02:00
050f3975f6 options: remove 'maxcombine` option (always use 6) 2018-06-13 10:11:35 +02:00
d8e18c96a9 screen: use UTF-8 representation
Store text in ScreenLines as UTF-8, so it can be sent as-is to the UI
layer. `utfc_char2bytes(off,buf)` is removed, as `ScreenLines[off]` now
already contains this representation.

To recover the codepoints that the screen arrays previously contained, use
utfc_ptr2char (or utf_ptr2char to ignore composing chars).

NB: This commit does NOT change how screen.c processes incoming UTF-8 data
from buffers, cmdline, messages etc. Any algorithm that operates on UCS-4
(like arabic shaping, treatment of non-printable chars)
is left unchanged for now.
2018-06-13 10:11:11 +02:00
3e0188e92d vim-patch:8.0.0596: crash when complete() called after complete_add()
Problem:    Crash when complete() is called after complete_add() in
            'completefunc'. (Lifepillar)
Solution:   Bail out if compl_pattern is NULL. (closes vim/vim#1668)
            Also avoid using freed memory.
4475b62396
2018-06-13 00:18:50 -04:00
315b7f8632 test/ui: doublewidth rendering. multibyte and cmdwin chars in folded lines (#8534) 2018-06-12 17:57:47 +02:00
40a257e11f Revert "makedeps.bat" 2018-06-12 08:47:16 -05:00
f419f914fc charset: include option_defs.h for breakat_flags 2018-06-12 09:34:10 -04:00
f52ace459a doc 2018-06-12 09:18:25 +02:00
3c7ea8d619 vim-patch:8.0.0451: some macros are in lower case
Problem:    Some macros are in lower case.
Solution:   Make a few more macros upper case. Avoid lower case macros use an
            argument twice.
91acfffc1e
2018-06-12 02:00:50 -04:00
fa2ad305e3 version bump 2018-06-11 10:58:54 +02:00
44c6deb91a NVIM v0.3.0
FEATURES:
3cc7ebf810 #7234 built-in VimL expression parser
6a7c904648 #4419 implement <Cmd> key to invoke command in any mode
b8363283fa #7679 'startup: treat stdin as text instead of commands'
58b210e114 :digraphs : highlight with hl-SpecialKey #2690
7a13611ba2 #8276 'startup: Let `-s -` read from stdin'
1e71978cf0 events: VimSuspend, VimResume #8280
1e7d5e8cdf #6272 'stdpath()'
f96d99ad11 #8247 server: introduce --listen
e8c39f72fd #8226 insert-mode: interpret unmapped META as ESC
98e7112390 msg: do not scroll entire screen (#8088)
f72630b784 #8055 let negative 'writedelay' show all redraws
5d2dd2ebe2 win: has("wsl") on Windows Subsystem for Linux #7330
a4f6cec7a3 cmdline: CmdlineEnter and CmdlineLeave autocommands (#7422)
207b7ca4bc #6844 channels: support buffered output and bytes sockets/stdio

API:
f85cbea725 #7917 API: buffer updates
418abfc9d0 #6743 API: list information about all channels/jobs.
36b2e3f743 #8375 API: nvim_get_commands
273d2cd5d5 #8329 API: Make nvim_set_option() update `:verbose set …`
8d40b3617c #8371 API: more reliable/descriptive VimL errors
ebb1acb3c0 #8353 API: nvim_call_dict_function
9f994bb699 #8004 API: nvim_list_uis
34057045be #7520 API/UI: forward option updates to UIs
911b1e49ab #7821 API: improve nvim_command_output

WINDOWS OS:
9cefd83cc7 #8084, #8516 build/win: support MSVC
ee4e1fd8ec win: Fix reading content from stdin (#8267)

TUI:
ffb8904913 #8309 TUI: add support for mouse release events in urxvt
8d5a46e77b #8081 TUI: implement "standout" attribute
60716371e9 TUI: support TERM=konsole-256color
67848c0b91 #7653 TUI: report TUI info with -V3 ('verbose' >= 3)
3d0ee17c91 TUI/rxvt: enable focus-reporting
d109f5645b #7640 TUI: 'term' option: reflect effective terminal behavior

FIXES:
ed6a113804 #8273 'job-control: avoid kill-timer race'
4e02f1ab87 #8107 'jobs: separate process-group'
451c48a092 terminal: flush vterm output buffer on pty output #8486
5d6732ff09 :checkhealth fixes #8335
53f11dcfc7 #8218 'Fix errors reported by PVS'
d05712fbe7 inccommand: pause :terminal redraws (#8307)
51af911a27 inccommand: do not execute trailing commands #8256
84359a467f terminal: resize to the max dimensions (#8249)
d49c1dda8b #8228 Make vim_fgets() return the same values as in Vim
60e96a45b4 screen: winhl=Normal:Background should not override syntax (#8093)
0c59ac1a2c #5908 'shada: Also save numbered marks'
ba87a2cde7 cscope: ignore EINTR while reading the prompt (#8079)
b1412dc412 #7971 ':terminal Enter/Leave should not increment jumplist'
3a5721e91b TUI: libtermkey: force CSI driver for mouse input #7948
6ff13d78b7 #7720 TUI: faster startup
1c6e956079 #7862 TUI: fix resize-related segfaults
a58c9094db #7676 TUI: always hide cursor when flushing, never flush buffers during unibilium output
303e1df13f #7624 TUI: disable BCE almost always
249bdb07dd #7761 mark: Make sure that jumplist item will not have zero lnum
6f41ce0260 #7704 macOS: Set $LANG based on the system locale
a043899ba2 #7633 'Retry fgets on EINTR'

CHANGES:
ad60927d09 #8304 default to 'nofsync'
f3f1970597 #8035 defaults: 'fillchars'
a6052c7307 #7984 defaults: sidescroll=1
b69fa866db #7888 defaults: enable cscopeverbose
7c4bb23ff3 defaults: do :filetype stuff unless explicitly "off"
2aa308c685 #5658 'Apply :lmap in macros'
8ce6393048 terminal: Leave 'relativenumber' alone (#8360)
e46534b423 #4486 refactor: Remove maxmem, maxmemtot options
131aad953c win: defaults: 'shellcmdflag', 'shellxquote' #7343
c57d315963 #8031 jobwait(): return -2 on interrupt also with timeout
6452831cf9 clipboard: macOS: fallback to tmux if pbcopy is broken #7940
300d3651e2 #7919 Make 'langnoremap' apply directly after a map
ada1956206 #7880 'lua/executor: Remove lightuserdata'

INTERNAL:
de0a9548f7 #7806 internal statistics for list impl
dee78a4095 #7708 rewrite internal list impl
2018-06-11 00:46:49 +02:00
fe5675ba0a Merge #8523 from justinmk/doc 2018-06-11 00:36:57 +02:00
feaefdfba2 doc: API 2018-06-11 00:20:39 +02:00
51961da511 doc/man: mention $NVIM_LOG_FILE
closes #8043
2018-06-11 00:16:15 +02:00
f72f638f97 doc: job/channel, misc #7783
doc: termios defaults. ref #6992
doc: :help shell-powershell
doc: provider: Python minimum version is 2.7, 3.4
doc: remove :!start special-case. #5844
doc: mention #7917 change which accepts empty Array for Dictionary parameter
doc: <Cmd> pseudokey
doc: lmap change #5658
doc: -s, -es
2018-06-11 00:08:27 +02:00
c69ea3b4b8 checkhealth: fix nodejs provider advice (#8522)
closes #8515
2018-06-10 20:09:10 +02:00
61890382eb deps: Build bundled dependencies automatically for IDEs
Environment variables are used to detect when the project is being built
from within Clion or Visual Studio, so that the build process can be
simplified by automatically building the bundled dependencies for them.
2018-06-10 09:57:12 -05:00
dc5fdbc758 test: fix startup_spec
This behavior was changed (improved) by 5861dc5966 which actually
makes -E more faithful to Vim's behavior.
2018-06-10 16:27:13 +02:00
0191061e34 deps: bump lua client 2018-06-10 16:11:49 +02:00
b8363283fa Merge #7679 'startup: treat stdin as text instead of commands' 2018-06-10 15:10:59 +02:00
23d172a948 Merge #8499 from janlazo/vim-8.0.0533 2018-06-10 14:30:19 +02:00
3fddd04565 Merge #8516 'win/build: bundle libiconv, gettext tools' 2018-06-10 13:56:42 +02:00
7cc9d2b2b2 vim-patch:8.0.0520: using a function pointer while the function is known (#8513)
Problem:    Using a function pointer instead of the actual function, which we
            know.
Solution:   Change mb_ functions to utf_ functions when already checked for
            Unicode. (Dominique Pelle, closes vim/vim#1582)
ace95989ed
2018-06-10 12:31:51 +02:00
bbb88607c9 vim-patch:8.0.0466: still macros that should be all-caps (#8510)
Problem:    There are still a few macros that should be all-caps.
Solution:   Make a few more macros all-caps.
8820b48654
2018-06-10 12:24:00 +02:00
e17728a632 build/msvc: Add support for building gettext tools with MSVC
Only includes the tools needed for Neovim: xgettext, msgfmt, and
msgmerge.
2018-06-09 20:50:44 -05:00
d87e5d7016 build/msvc: Add libiconv to bundled dependencies 2018-06-09 20:50:02 -05:00
b94b59e4e8 refactor: buf_collect_lines (#8509)
Move redundant common logic into a function.
2018-06-09 09:32:49 +02:00
392b3396fd vim-patch:8.0.0541: compiler warning on MS-Windows
Problem:    Compiler warning on MS-Windows.
Solution:   Add a type cast. (Mike Williams)
04000560ca
2018-06-08 21:13:33 -04:00
3bcbf802ce vim-patch:8.0.0533: abbreviation doesn't work after backspacing newline
Problem:    Abbreviation doesn't work after backspacing newline. (Hkonrk)
Solution:   Set the insert start column. (closes vim/vim#1609)
878c263a48
2018-06-08 21:13:33 -04:00
aaece78492 expand_env_esc: fix invalid memory access (#8508)
ref be68f218ff

    [OLDTEST] Running test_options
    Failed: F /tests/oldtests|test_options :: Nvim exited with non-zero code
    -en travis_fold:start:-tests-oldtests-test-options

    =================================================================

    ==26191==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x621000067900 at pc 0x0000004768bd bp 0x7ffe6bd02de0 sp 0x7ffe6bd02580
    READ of size 4096 at 0x621000067900 thread T0
        0 0x4768bc in __interceptor_getpwnam /local/mnt/workspace/tmp/ubuntu_rel/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:1726:3
        1 0x12847c5 in os_get_user_directory /home/travis/build/neovim/neovim/build/../src/nvim/os/users.c:82:8
        2 0x125a3e3 in expand_env_esc /home/travis/build/neovim/neovim/build/../src/nvim/os/env.c:380:25
        3 0x1257fdb in expand_env_save_opt /home/travis/build/neovim/neovim/build/../src/nvim/os/env.c:255:3
        4 0x1291b77 in gen_expand_wildcards /home/travis/build/neovim/neovim/build/../src/nvim/path.c:1195:13
        5 0x129e2e7 in expand_wildcards /home/travis/build/neovim/neovim/build/../src/nvim/path.c:2018:12
        6 0x129e193 in expand_wildcards_eval /home/travis/build/neovim/neovim/build/../src/nvim/path.c:1986:11
        7 0xc2ddc3 in ExpandFromContext /home/travis/build/neovim/neovim/build/../src/nvim/ex_getln.c:4685:11
        8 0xc29412 in ExpandOne /home/travis/build/neovim/neovim/build/../src/nvim/ex_getln.c:3775:9
        9 0x931364 in f_expand /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:8257:32
        10 0x811954 in call_func /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:6373:11
        11 0x8256b8 in get_func_tv /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:6119:11
        12 0x8ad6a1 in eval7 /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:4217:15
        13 0x8a9c6b in eval6 /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:3914:7
        14 0x8a797f in eval5 /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:3765:7
        15 0x8a319f in eval4 /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:3502:7
        16 0x8a263c in eval3 /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:3420:7
        17 0x8a1adc in eval2 /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:3351:7
        18 0x809b21 in eval1 /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:3278:7
        19 0x824f24 in get_func_tv /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:6092:9
        20 0x81e674 in ex_call /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:2726:9
        21 0xb4db73 in do_one_cmd /home/travis/build/neovim/neovim/build/../src/nvim/ex_docmd.c:2238:5
        22 0xb30119 in do_cmdline /home/travis/build/neovim/neovim/build/../src/nvim/ex_docmd.c:602:20
        23 0x845232 in call_user_func /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:21396:3
        24 0x81127b in call_func /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:6358:11
        25 0x8256b8 in get_func_tv /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:6119:11
        26 0x81e674 in ex_call /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:2726:9
        27 0xb4db73 in do_one_cmd /home/travis/build/neovim/neovim/build/../src/nvim/ex_docmd.c:2238:5
        28 0xb30119 in do_cmdline /home/travis/build/neovim/neovim/build/../src/nvim/ex_docmd.c:602:20
        29 0x8645f1 in ex_execute /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:19541:7
        30 0xb4db73 in do_one_cmd /home/travis/build/neovim/neovim/build/../src/nvim/ex_docmd.c:2238:5
        31 0xb30119 in do_cmdline /home/travis/build/neovim/neovim/build/../src/nvim/ex_docmd.c:602:20
        32 0x845232 in call_user_func /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:21396:3
        33 0x81127b in call_func /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:6358:11
        34 0x8256b8 in get_func_tv /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:6119:11
        35 0x81e674 in ex_call /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:2726:9
        36 0xb4db73 in do_one_cmd /home/travis/build/neovim/neovim/build/../src/nvim/ex_docmd.c:2238:5
        37 0xb30119 in do_cmdline /home/travis/build/neovim/neovim/build/../src/nvim/ex_docmd.c:602:20
        38 0xb19f2d in do_source /home/travis/build/neovim/neovim/build/../src/nvim/ex_cmds2.c:2973:3
        39 0xb16580 in cmd_source /home/travis/build/neovim/neovim/build/../src/nvim/ex_cmds2.c:2718:14
        40 0xb16677 in ex_source /home/travis/build/neovim/neovim/build/../src/nvim/ex_cmds2.c:2699:3
        41 0xb4db73 in do_one_cmd /home/travis/build/neovim/neovim/build/../src/nvim/ex_docmd.c:2238:5
        42 0xb30119 in do_cmdline /home/travis/build/neovim/neovim/build/../src/nvim/ex_docmd.c:602:20
        43 0xb362c5 in do_cmdline_cmd /home/travis/build/neovim/neovim/build/../src/nvim/ex_docmd.c:278:10
        44 0xe8e3a3 in exe_commands /home/travis/build/neovim/neovim/build/../src/nvim/main.c:1705:5
        45 0xe7bbba in main /home/travis/build/neovim/neovim/build/../src/nvim/main.c:518:5
        46 0x2b0e17bd1f44 in __libc_start_main /build/eglibc-ripdx6/eglibc-2.19/csu/libc-start.c:287
        47 0x44dcfb in _start (/home/travis/build/neovim/neovim/build/bin/nvim+0x44dcfb)

    0x621000067900 is located 0 bytes to the right of 4096-byte region [0x621000066900,0x621000067900)
    allocated by thread T0 here:
        0 0x4eeed3 in malloc /local/mnt/workspace/tmp/ubuntu_rel/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:67:3
        1 0xf87981 in try_malloc /home/travis/build/neovim/neovim/build/../src/nvim/memory.c:87:15
        2 0xf87ba9 in xmalloc /home/travis/build/neovim/neovim/build/../src/nvim/memory.c:121:15
        3 0x1257f6f in expand_env_save_opt /home/travis/build/neovim/neovim/build/../src/nvim/os/env.c:254:15
        4 0x1291b77 in gen_expand_wildcards /home/travis/build/neovim/neovim/build/../src/nvim/path.c:1195:13
        5 0x129e2e7 in expand_wildcards /home/travis/build/neovim/neovim/build/../src/nvim/path.c:2018:12
        6 0x129e193 in expand_wildcards_eval /home/travis/build/neovim/neovim/build/../src/nvim/path.c:1986:11
        7 0xc2ddc3 in ExpandFromContext /home/travis/build/neovim/neovim/build/../src/nvim/ex_getln.c:4685:11
        8 0xc29412 in ExpandOne /home/travis/build/neovim/neovim/build/../src/nvim/ex_getln.c:3775:9
        9 0x931364 in f_expand /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:8257:32
        10 0x811954 in call_func /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:6373:11
        11 0x8256b8 in get_func_tv /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:6119:11
        12 0x8ad6a1 in eval7 /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:4217:15
        13 0x8a9c6b in eval6 /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:3914:7
        14 0x8a797f in eval5 /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:3765:7
        15 0x8a319f in eval4 /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:3502:7
        16 0x8a263c in eval3 /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:3420:7
        17 0x8a1adc in eval2 /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:3351:7
        18 0x809b21 in eval1 /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:3278:7
        19 0x824f24 in get_func_tv /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:6092:9
        20 0x81e674 in ex_call /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:2726:9
        21 0xb4db73 in do_one_cmd /home/travis/build/neovim/neovim/build/../src/nvim/ex_docmd.c:2238:5
        22 0xb30119 in do_cmdline /home/travis/build/neovim/neovim/build/../src/nvim/ex_docmd.c:602:20
        23 0x845232 in call_user_func /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:21396:3
        24 0x81127b in call_func /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:6358:11
        25 0x8256b8 in get_func_tv /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:6119:11
        26 0x81e674 in ex_call /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:2726:9
        27 0xb4db73 in do_one_cmd /home/travis/build/neovim/neovim/build/../src/nvim/ex_docmd.c:2238:5
        28 0xb30119 in do_cmdline /home/travis/build/neovim/neovim/build/../src/nvim/ex_docmd.c:602:20
        29 0x8645f1 in ex_execute /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:19541:7

    SUMMARY: AddressSanitizer: heap-buffer-overflow /local/mnt/workspace/tmp/ubuntu_rel/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:1726:3 in __interceptor_getpwnam
    Shadow bytes around the buggy address:
      0x0c4280004ed0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0c4280004ee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0c4280004ef0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0c4280004f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      0x0c4280004f10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    =>0x0c4280004f20:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      0x0c4280004f30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      0x0c4280004f40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      0x0c4280004f50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      0x0c4280004f60: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      0x0c4280004f70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
    Shadow byte legend (one shadow byte represents 8 application bytes):
      Addressable:           00
      Partially addressable: 01 02 03 04 05 06 07
      Heap left redzone:       fa
      Freed heap region:       fd
      Stack left redzone:      f1
      Stack mid redzone:       f2
      Stack right redzone:     f3
      Stack after return:      f5
      Stack use after scope:   f8
      Global redzone:          f9
      Global init order:       f6
      Poisoned by user:        f7
      Container overflow:      fc
      Array cookie:            ac
      Intra object redzone:    bb
      ASan internal:           fe
      Left alloca redzone:     ca
      Right alloca redzone:    cb
    ==26191==ABORTING
    Failed: E /tests/oldtests|logs :: Runtime errors detected.
    Job exited with code 1
    Screen (23 lines)
2018-06-09 00:46:11 +02:00
cca29112d5 vim-patch:8.0.0525: completion for user command argument not tested (#8506)
Solution:   Completion for user command argument not tested.
Problem:    Add a test.
a33ddbbd04
2018-06-09 00:20:09 +02:00
77192889f0 vim-patch:8.0.0452: some macros are in lower case (#8505)
Problem:    Some macros are in lower case.
Solution:   Make a few more macros upper case.
1c46544412
2018-06-08 19:24:58 +02:00
c7e6bb2467 doc: API: api-buffer-updates
- move to api.txt
- rewrite
2018-06-08 10:19:46 +02:00
f85cbea725 Merge #7917 'API: buffer updates' 2018-06-08 10:13:04 +02:00
c500f22f3c Merge #8498 from janlazo/vim-8.0.0523 2018-06-08 08:15:37 +02:00
be68f218ff vim-patch:8.0.0355: using uninitialized memory when 'isfname' is empty (#8493)
Problem:    Using uninitialized memory when 'isfname' is empty.
Solution:   Don't call getpwnam() without an argument. (Dominique Pelle,
            closes vim/vim#1464)
187a4f2814
2018-06-08 08:10:38 +02:00
4871f26c22 vim-patch:8.0.0586: no test for mapping timing out (#8501)
Problem:    No test for mapping timing out.
Solution:   Add a test.
b7637c44c2
2018-06-08 08:07:31 +02:00
bd736a98e3 vim-patch:8.0.0560: :windo allows for ! but it's not supported (#8500)
Problem:    :windo allows for ! but it's not supported.
Solution:   Disallow passing !. (Hirohito Higashi)
451a4a1cb7
2018-06-08 08:06:32 +02:00
231539cf3c lint 2018-06-07 21:44:27 -04:00
451c48a092 terminal: flush vterm output buffer on pty output #8486
Fixes #4151

libvterm uses an "output buffer" for terminal reporting
(e.g. \e[6n to report cursor position)
Flush it in on_channel_output() not just terminal_send_key()

See also this line from pangoterm:
https://bazaar.launchpad.net/~leonerd/pangoterm/trunk/view/607/pangoterm.c#L2159
2018-06-08 02:18:27 +02:00
34c0688790 vim-patch:8.0.0523: dv} deletes part of a multi-byte character.
Problem:    dv} deletes part of a multi-byte character. (Urtica Dioica)
Solution:   Include the whole character.
bf3d58073f
2018-06-07 19:41:30 -04:00
db68d1d638 Merge #8491 from janlazo/vim-8.0.0255 2018-06-07 18:31:50 +02:00
e0d39d8e53 vim-patch:8.0.0256: missing changes to one file breaks test
Problem:    Tests fail because some changes were not included.
Solution:   Add changes to evalfunc.c
3a29abcb61
2018-06-07 12:02:57 -04:00
3abf17ae88 API: validation: mention invalid method name (#8489) 2018-06-07 10:56:44 +02:00
5a82afa17a vim-patch:8.0.0265: ml_get error when :pydo deletes lines (#8492)
Problem:    May get ml_get error when :pydo deletes lines or switches to
            another buffer. (Nikolai Pavlov, issue vim/vim#1421)
Solution:   Check the buffer and line every time.
a58883b4ea

(We only include the tests, the Vim code changes are N/A for Nvim.)
2018-06-07 10:06:06 +02:00
7f6c1d256f vim-patch:8.0.0254: error message of assert functions (#8488)
Problem:    When using an assert function one can either specify a message or
            get a message about what failed, not both.
Solution:   Concatenate the error with the message.
c7b831ca15
2018-06-07 09:59:45 +02:00
2d456f84d1 vim-patch:8.0.0255: setpos() does not use the buffer argument for all marks
Problem:    When calling setpos() with a buffer argument it often is ignored.
            (Matthew Malcomson)
Solution:   Make the buffer argument work for all marks local to a buffer.
            (neovim vim/vim#5713)  Add more tests.
f13e00b2cf
2018-06-06 20:37:35 -04:00
36ac80d5dd Merge #8464 from justinmk/cmake-findpkg-required 2018-06-06 01:52:29 +02:00
f795c3ce7c ex_getln.c: Fix PVS/V519: variable assigned twice 2018-06-06 01:15:37 +02:00
ec29eeef43 win/build: avoid "C4142: benign redefinition of type"
ssize_t is already typedef's by libuv:uv-win.h
2018-06-06 00:58:58 +02:00
b7032cf1e3 win: enable DYNAMIC_ICONV 2018-06-06 00:58:58 +02:00
90e3dd9220 makedeps.bat 2018-06-06 00:58:57 +02:00
7303dd3e54 win/build: download iconv, gettext tools
- We need the gettext tools (msgmerge.exe) because these aren't built
  when we build from source (not trivial).
- We can use the pre-built libiconv-2.dll for DYNAMIC_ICONV_DLL.
2018-06-06 00:58:57 +02:00
420379330e cmake/FindLibIntl.cmake: handle passive case explicitly
If check_c_source_compiles() succeeded (HAVE_WORKING_LIBINTL is set)
then the result of find_xxx() doesn't matter. This happens on systems
(linux+glibc) where libintl is available passively.

This allows `find_package(LibIntl REQUIRED)` to work and will still
correctly fail (REQUIRED) on systems lacking libintl.
2018-06-06 00:58:57 +02:00
21c9db1861 build/CMake: find_package(… REQUIRED)
"Always use `find_package` with `REQUIRED`."

- We make an exception for LuaJit (not REQUIRED): the `nvim-test` target
  is included only if we can find LuaJit.

This is partially a cargo-cult (reference below), but it uncovered at
least one problem: `find_package(LibIntl REQUIRED)` fails on my vanilla
ubuntu 16.04 system.

ref: https://schneide.blog/2017/11/06/4-tips-for-better-cmake/

> optional dependencies is nice, but skipping on REQUIRED is not the way
> you want to do it. In the worst case, some of your features will just
> not work if those packages are not found, with no explanation
> whatsoever. Instead, use explicit feature-toggles (e.g. using option())
> that either skip the find_package call or use it with REQUIRED, so the
> user will know that another lib is needed for this feature.
2018-06-06 00:58:57 +02:00
5861dc5966 Merge #8461 from bfredl/scrollstatus 2018-06-06 00:34:08 +02:00
078202d6f8 vim-patch:8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch' (#8483)
Problem:    'colorcolumn' has a higher priority than 'hlsearch', it should be
            the other way around. (Nazri Ramliy)
Solution:   Change the priorities. (LemonBoy, closes vim/vim#1794)
774e5a9673
2018-06-05 17:10:07 +02:00
d9d91bbfef Merge #8482 'test: give more time for nodejs' 2018-06-05 14:08:32 +02:00
6ffcc2b800 fixup: exclude node_modules/ for crash detection
node.js client uses lodash which has core.js.
2018-06-05 07:33:26 -04:00
ae927a49f7 Merge #8479 from janlazo/vim-8.0.0529 2018-06-05 08:43:01 +02:00
b2633bba73 vim-patch:8.0.0851: 'smartindent' is used even when 'indentexpr' is set (#8481)
Problem:    'smartindent' is used even when 'indentexpr' is set.
Solution:   Ignore 'smartindent' when 'indentexpr' is set. (Hirohito Higashi)
69a76feda9

---

This also fixes "delfunction!" which was not merged fully in  a185ab70fd (vim-patch:8.0.0655)
2018-06-05 08:20:38 +02:00
f274b84e1e test: give more time for nodejs
Link neovim package to project root directory.
Increase delay to 3 seconds.
Reduce the total lines in temporary node scripts.
2018-06-04 19:42:28 -04:00
2ab7165214 lint 2018-06-04 17:51:15 -04:00
21aa4bc428 vim-patch:8.0.0623: error for invalid regexp is not very informative
Problem:    The message "Invalid range" is used for multiple errors.
Solution:   Add two more specific error messages. (Itchyny, Ken Hamada)
966e58e413
2018-06-04 08:44:19 -04:00
fe5c891fe0 vim-patch:8.0.0529: line in test commented out
Problem:    Line in test commented out.
Solution:   Uncomment the lines for character classes that were failing before
            8.0.0519. (Dominique Pelle, closes vim/vim#1599)
13489b9c41
2018-06-04 08:38:27 -04:00
d8c7ff1335 cleanup, test interactive -E 2018-06-04 02:09:28 +02:00
1f300e08b8 win/startup: remove --literal
Fixes 2 failing tests in startup_spec.lua.

The Windows-only `--literal` option complicates support of "stdin-as-text
+ file-args" (#7679).  Could work around it, but it's not worth
the trouble:
- users have a reasonable (and englightening) alternative: nvim +"n *"
- "always literal" is more consistent/predictable
- avoids platform-specific special-case

Unrelated changes:
- Replace fileno(stdxx) with STDXX_FILENO for consistency (not motivated
  by any observed technical reason).
2018-06-04 02:09:27 +02:00
4211255c75 startup: allow explicit "-" file arg with --headless 2018-06-04 02:09:27 +02:00
63058fb5b0 startup: fix -es/-Es so they are actually silent
silent-mode (-es/-Es) has been broken for years.  The workaround up to
now was to include --headless.  But --headless is not equivalent because
it prints all messages, not the limited subset defined by silent-mode.
2018-06-04 02:09:27 +02:00
787ae1b38b startup: silent-mode is not full_screen
silent-mode (AKA batch-mode, -es/-Es) by definition should not behave
like a UI.

There are still some places that check `full_screen` to decide behavior,
e.g. msg_start().  Future: maybe eliminate `full_screen`, check
`ui_active()` instead?
2018-06-04 02:09:27 +02:00
d00ef758c3 lint 2018-06-04 02:09:24 +02:00
4b70ebe013 startup: stdin-text with -E, -Es (improved Ex-mode)
Special-case for -E/-Es (as opposed to -e/-es).

-es/-Es is the only mode that really allows N/Vim to work as a batch
script engine.  Adding a new flag (say `-x`) would involve a lot of
churn: -es/-Es is implemented by checking `exmode_active` in numerous
places.

This commit does not change -es because some scripts use it. But scripts
are unlikely to use -Es because it is not functionally different from
-es.

Also, both -es and -Es were broken in Nvim for years and no one
mentioned it...
2018-06-04 02:07:40 +02:00
905d4d78fc startup: stdin-text with file args 2018-06-04 02:07:40 +02:00
51e817dc1b startup: stdin as text instead of commands
Treat stdin as text by default (so the "-" file is not needed):
    echo foo | nvim

It works with file args (implemented in next commit), too:
    echo foo | nvim file1.txt file2.txt

Why? Because:
- Execution of input is (1) almost always unintentional/confusing,
  and (2) potentially destructive.
- Avoids the need for time-delayed warning.  #7659
- The _common_ case is to open text in a buffer, not send commands.

Note:
- Not for Ex-mode (-es) because it is used by scripts.  But maybe `-Es`?
- Not for --headless, because stdio may be a protocol stream and may be
  used for any purpose by stdioopen().

To treat stdin as Normal-mode commands, use `-s -` instead:
    echo ifoo | nvim -s -
Other alternatives:
  - Replay a register. E.g. the following mostly works, except @q aborts
    on any "beep" (e.g. if the cursor can't move).
    nvim -c '%d q|norm @q' -
  - Future: Let `:%source` work with unsaved buffer contents?

closes #2087
closes #7659
2018-06-04 02:07:39 +02:00
fad748dffa main.c: remove check_tty(), delayed warning
This code was essentially dead because this condition:
    (!parmp->err_isatty && (!parmp->output_isatty || !parmp->input_isatty))
is almost never true.

ref #7659
2018-06-04 02:07:39 +02:00
488f6ecdda lint 2018-06-04 02:07:39 +02:00
a1f562b044 doc/man: brevity, clarity 2018-06-04 02:07:39 +02:00
cf92a76285 vim-patches: 8.0.0399 8.0.0401 (#8475)
vim-patch:8.0.0399: crash when using balloon_show() when not supported
Problem:    Crash when using balloon_show() when not supported. (Hirohito
            Higashi)
Solution:   Check for balloonEval not to be NULL. (Ken Takata)
caf6434ac9

vim-patch:8.0.0401: test fails with missing balloon feature
Problem:    Test fails with missing balloon feature.
Solution:   Add check for balloon feature.
a0107bdf87

vim-patch:8.0.0414: balloon eval is not tested
2018-06-04 01:58:36 +02:00
7795829767 vim-patch:8.0.1237: ":set scroll&" often gives an error (#8473)
Problem:    ":set scroll&" often gives an error.
Solution:   Don't use a fixed default value, use half the window height. Add a
            test. (Ozaki Kiichi, closes vim/vim#2104)
af2d20c628
2018-06-04 01:31:37 +02:00
807a16dbc1 version.c: update [ci skip] (#8413)
vim-patch:8.0.0349: redrawing errors with GTK 3
vim-patch:8.0.0363: Travis is too slow to keep up with patches
vim-patch:8.0.0366: build fails with tiny features
vim-patch:8.0.0373: build fails without +folding
vim-patch:8.0.0397: can't build with +viminfo but without +eval
vim-patch:8.0.0410: newer gettext/iconv library has extra dll file-
vim-patch:8.0.0418: ASAN logs are disabled
vim-patch:8.0.0445: getpgid is not supported on all systems-
vim-patch:8.0.0449
vim-patch:8.0.0462: failure of an MS-Windows test may go unnoticed
vim-patch:8.0.0494: build failure with older compiler on MS-Windows
vim-patch:8.0.0501: on MS-Windows ":!start" does not work as expected
vim-patch:8.0.0508: Coveralls no longer shows per-file coverage
vim-patch:8.0.0509: no link to codecov.io results
vim-patch:8.0.0510: typo in link to codecov.io results
vim-patch:8.0.0512: check for available characters takes too long
vim-patch:8.0.0521: GtkForm handling is outdated
vim-patch:8.0.0527: leftover file from RISC OS
vim-patch:8.0.0534: defaults.vim does not work well with tiny features
vim-patch:8.0.0557: GTK: using static gravities is not useful
vim-patch:8.0.0566: setting nocompatible for the tiny version moves the cursor
vim-patch:8.0.0570: can't run make with several jobs
vim-patch:8.0.0573: running parallel make after distclean fails
vim-patch:8.0.0576: can't build when configure choses "install-sh"
vim-patch:8.0.0578: :simalt on MS-Windows does not work properly
vim-patch:8.0.0589: :simalt still does not work
vim-patch:8.0.0594: build failure when windows feature is missing
vim-patch:8.0.0619: GUI gets stuck if timer uses feedkeys()
vim-patch:8.0.0624: warning for unused variable in tiny build
vim-patch:8.0.0638: cannot build with new MSVC version 
vim-patch:8.0.0651: build failure without the auto command feature
vim-patch:8.0.0695: missing dependencies breaks parallel make
vim-patch:8.0.0711: cannot build without the wildmenu feature
vim-patch:8.0.0756: cannot build libvterm with MSVC 
vim-patch:8.0.0757: libvterm MSVC Makefile not included in the distribution
vim-patch:8.0.0765: build fails with tiny features
vim-patch:8.0.0767: build failure with Athena and Motif
vim-patch:8.0.0780: build failure on Travis
vim-patch:8.0.0786: build failures on Travis 
vim-patch:8.0.0796: no coverage on Travis with clang 
vim-patch:8.0.0814: file in Filelist does not exist
vim-patch:8.0.0961: the script to build the installer does not include winpty
vim-patch:8.0.0989: ActiveTcl dll name has changed in 8.6.6
vim-patch:8.0.1032: "make tags" doesn't work well on MS-Windows-
vim-patch:8.0.1050: terminal window feature not included by default
vim-patch:8.0.1056: cannot build with +diff but without +multi_byte-
vim-patch:8.0.1084: GTK build has compiler warnings 
vim-patch:8.0.1086: can't build with GTK 3
vim-patch:8.0.1098: build failure if libvterm installed
vim-patch:8.0.1099: warnings for GDK calls
vim-patch:8.0.1122: vimtutor.bat doesn't work well with vim.bat
vim-patch:8.0.1124: use of MZSCHEME_VER is unclear
vim-patch:8.0.1147: fail to build with tiny features
vim-patch:8.0.1156: trouble from removing one -W argument from Perl CFLAGS
vim-patch:8.0.1178: using old compiler on MS-Windows
vim-patch:8.0.1183: MS-Windows build instructions are outdated
vim-patch:8.0.1185: Ruby library includes minor version number
vim-patch:8.0.1187: building with lua fails for OSX on Travis
vim-patch:8.0.1196: crash when t_RF is not set
vim-patch:8.0.1212: MS-Windows: tear-off menu does not work on 64 bit
vim-patch:8.0.1233: typo in dos installer
vim-patch:8.0.1235: cannot disable the terminal feature in a huge build
vim-patch:8.0.1252: incomplete translations makefile for MinGW/Cygwin
vim-patch:8.0.1268: PC install instructions are incomplete
vim-patch:8.0.1288: GUI: cannot drag the statusline of a terminal window
vim-patch:8.0.1294: GUI: get stuck when splitting a terminal window
vim-patch:8.0.1301: generated license file for NSIS has a modeline
vim-patch:8.0.1313: missing dependencies cause parallel make to fail
vim-patch:8.0.1314: build fails on Mac
vim-patch:8.0.1351: warning for unused variables building with MinGW
vim-patch:8.0.1373: no error when settting 'renderoptions' before starting GUI
vim-patch:8.0.1379: configure check for selinux does not check for header file
vim-patch:8.0.1385: Python 3.5 is getting old
vim-patch:8.0.1390: DirectX scrolling can be slow, vertical positioning is off
vim-patch:8.0.1392: build fails with --with-features=huge --disable-channel
vim-patch:8.0.1399: warnings and errors when building tiny version
vim-patch:8.0.1401: cannot build with GTK but without XIM
vim-patch:8.0.1407: GUI: CursorHold may trigger before 'updatetime'
vim-patch:8.0.1431: MS-Windows: vimtutor fails if %TMP% has special chars
vim-patch:8.0.1444: missing -D_FILE_OFFSET_BITS=64 may cause problems
vim-patch:8.0.1450: GUI: endless loop when stopping cursor blinking
vim-patch:8.0.1466: older GTK versions don't have gtk_entry_get_text_length()
vim-patch:8.0.1471: on MS-Windows CursorIM highlighting no longer works
vim-patch:8.0.1473: MS-Windows: D&D fails between 32 and 64 bit apps
vim-patch:8.0.1474: Visual C 2017 has multiple MSVCVER numbers
vim-patch:8.0.1530: dump test fails when using a shadow directory-
vim-patch:8.0.1548: screen dump test script not included in distribution-
vim-patch:8.0.1555: build error for some combination of features
vim-patch:8.0.1559: build failure without GUI
vim-patch:8.0.1560: build failure without GUI on MS-Windows 
vim-patch:8.0.1800: X11: getting color is slow-
vim-patch:8.0.1808: can't build without TGETENT-
vim-patch:8.0.1822: make uninstall does not remove colors/tools-
vim-patch:8.0.1826: configure uses old compiler flag-
vim-patch:8.0.1828: get no clue why :gui does not fork-
vim-patch:8.0.1833: X11: ":echo 3.14" gives E806- 
vim-patch:8.0.1834: GUI: find/replace dialog does not handle some chars-
vim-patch:8.0.1847: some build options don't have an example-
2018-06-04 01:13:00 +02:00
32935c8612 Merge #8414 'Windows fixes' 2018-06-03 23:44:06 +02:00
a80f73f043 deps: Fix libvterm and libtermkey escape sequences for MSVC
The escape sequence `\e` is non-standard and not supported by MSVC.
It caused the terminal emulator to incorrectly interpret certain keys.
2018-06-03 22:31:02 +02:00
90f9f8af6c deps: Ignore whitespace when applying libuv patch 2018-06-03 22:31:02 +02:00
f8eb5c83ed deps: Upgrade LuaRocks and remove patch 2018-06-03 22:31:01 +02:00
611e379685 build/MSVC: TUI: Fix uninitialized variable
closes #8459
2018-06-03 22:31:01 +02:00
a93690bceb TUI: skip SIGWINCH during teardown #8470
closes #8409

Although 8b05da1577 prevents UI events during TUI teardown, there's
still a chance a SIGWINCH event (which emits from a different source,
not the UI pump) could be queued.

Backtrace:

    Program terminated with signal SIGSEGV, Segmentation fault.
    0  0x0828b5e2 in update_size (ui=0xf7130000) at ../src/nvim/tui/tui.c:1231
    1231	  if (data->out_isatty

    Thread 2 (Thread 0xf749c740 (LWP 15704)):
    0  0xf76f4be9 in __kernel_vsyscall ()
    No symbol table info available.
    1  0xf7585847 in syscall () from /lib32/libc.so.6
    No symbol table info available.
    2  0x082d280b in uv__epoll_wait (epfd=9, events=events@entry=0xff8570a0, nevents=nevents@entry=1024, timeout=timeout@entry=10) at /home/travis/nvim-deps/build/src/libuv/src/unix/linux-syscalls.c:321
            result = -4
    3  0x082d095b in uv__io_poll (loop=loop@entry=0x843bb20 <main_loop>, timeout=10) at /home/travis/nvim-deps/build/src/libuv/src/unix/linux-core.c:289
            no_epoll_pwait = 0
            no_epoll_wait = 0
            events = {{events = 1, data = 12}, {events = 0, data = 17828744682641817600}, {events = 0, data = 595427328019700187}, {events = 1, data = 256}, {events = 8, data = 38646673644}, {events = 138656544, data = 0}, {events = 0, data = 4433601024}, {events = 0, data = 0} <repeats 11 times>, {events = 0, data = 5066646634167795712}, {events = 4286935584, data = 206168555883}, {events = 0, data = 471020612051744}, {events = 4286935503, data = 17828744133024637728}, {events = 1, data = 17317007001}, {events = 4286935503, data = 10619564869973704705}, {events = 1024, data = 595525515121881824}, {events = 4150558720, data = 17823414452125790712}, {events = 138530816, data = 4432135917}, {events = 4286935544, data = 10144519793148261088}, {events = 3966, data = 10619579670432006720}, {events = 138530816, data = 595525326143320812}, {events = 1, data = 595525321993555278}, {events = 138656852, data = 1}, {events = 3995, data = 4295967296}, {events = 1, data = 595526644706312193}, {events = 0, data = 17033840295937}, {events = 4286935776, data = 206168555900}, {events = 4286937292, data = 4398046511113}, {events = 4286937584, data = 1}, {events = 0, data = 154475121641}, {events = 534, data = 188970531020}, {events = 4286936336, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 1, data = 10}, {events = 0, data = 0} <repeats 11 times>, {events = 0, data = 48}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 138530816, data = 18412251243033639712}, {events = 4286936040, data = 189114457288}, {events = 0, data = 4294967296}, {events = 0, data = 17803669134559412224}, {events = 44, data = 18412251243033639712}, {events = 4286936088, data = 189114457380}, {events = 43, data = 587839499189486944}, {events = 0, data = 18412250572880084992}, {events = 4145239744, data = 17803668932546221712}, {events = 4286936136, data = 18412251054051721307}, {events = 1, data = 17828741581675430017}, {events = 1, data = 17828941684201750528}, {events = 4151062887, data = 188813018680}, {events = 4286936184, data = 594985324343494205}, {events = 138656544, data = 589074057631462644}, {events = 138657344, data = 17735744192413433899}, {events = 136867048, data = 0}, {events = 138530816, data = 595528757965521683}, {events = 136865087, data = 589073507718137052}, {events = 4129424952, data = 17735744192413433899}, {events = 136867048, data = 587831072767851296}, {events = 4129424604, data = 17735745120263524155}, {events = 43, data = 587839499189486944}, {events = 1, data = 4151078100}, {events = 137102077, data = 18412251277393378816}, {events = 1024, data = 0}, {events = 0, data = 595526301108928512}, {events = 138656544, data = 18412251247181919476}, {events = 1, data = 9281074407080460288}, {events = 0, data = 18446466442728570881}, {events = 4294901792, data = 4294967295}, {events = 35, data = 18446462783416434688}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 2305913371515420672}, {events = 3092376453, data = 138513204574}, {events = 2098047, data = 0}, {events = 0, data = 0}, {events = 8064, data = 196607}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 2147483648, data = 16382}, {events = 3951370240, data = 70402120267857}, {events = 0, data = 0}, {events = 0, data = 5280832615950057472}, {events = 1229539657, data = 5280832617179597129}, {events = 16711680, data = 0}, {events = 255, data = 0}, {events = 0, data = 8589934592}, {events = 0, data = 0}, {events = 4144925328, data = 8589934600}, {events = 0, data = 0}, {events = 4144060920, data = 8589934597}, {events = 0, data = 0} <repeats 11 times>, {events = 0, data = 10441860757015494656}, {events = 2357, data = 1000000}, {events = 0, data = 0}, {events = 138656544, data = 0}, {events = 0, data = 5066646694297337856}, {events = 948, data = 7}, {events = 832, data = 0}, {events = 0, data = 0}, {events = 0, data = 12884901888}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 4400483032669}, {events = 4286937344, data = 17826513962666277708}, {events = 4286937112, data = 594985328358030594}, {events = 137168621, data = 18412254696048689153}, {events = 4286937344, data = 1024}, {events = 1000000, data = 2896717541055035201}, {events = 4148807356, data = 595525510834946052}, {events = 137169476, data = 10125674444609}, {events = 1000000, data = 0}, {events = 0, data = 595525321856385024}, {events = 0, data = 0}, {events = 0, data = 18412255692481101824}, {events = 10125674, data = 48}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 0}, {events = 0, data = 1179670597}, {events = 0, data = 4400482871034}, {events = 4286937584, data = 17826513962666277708}, {events = 4286937352, data = 594985328358030594}, {events = 137168621, data = 18412255726840840193}, {events = 4286937584, data = 17160756302592}, {events = 1000000, data = 594985326644596377}, {events = 4286937584, data = 4433623840}, {events = 137169713, data = 595526352787192608}, {events = 1, data = 0}, {events = 0, data = 1}, {events = 1, data = 138656852}, {events = 0, data = 18412256723273256859}, {events = 10125669, data = 48}, {events = 0, data = 0} <repeats 11 times>, {events = 0, data = 4294967296}, {events = 12, data = 0}, {events = 0, data = 0}, {events = 2430806547, data = 18412258097662788608}, {events = 138656588, data = 18412257105380933632}, {events = 4149837058, data = 589134741370949632}...}
            pe = <optimized out>
            e = {events = 4127768836, data = 7}
            real_timeout = 10
            q = <optimized out>
            w = <optimized out>
            sigset = {__val = {832, 0, 0, 138656544, 0, 0, 4286935144, 135300669, 4144063488, 138656544, 138633728, 0, 0, 0, 0, 0, 0, 0, 4286935224, 135309369, 4144063520, 135309195, 138633728, 0, 0, 0, 0, 0, 138633728, 135309195, 138633728, 0}}
            sigmask = <optimized out>
            base = <optimized out>
            have_signals = <optimized out>
            nevents = <optimized out>
            count = 48
            nfds = <optimized out>
            fd = <optimized out>
            op = <optimized out>
            i = <optimized out>
            __PRETTY_FUNCTION__ = "uv__io_poll"
    4  0x082c0cab in uv_run (loop=0x843bb20 <main_loop>, mode=UV_RUN_ONCE) at /home/travis/nvim-deps/build/src/libuv/src/unix/core.c:359
            timeout = <optimized out>
            r = 1
    5  0x08107e61 in loop_poll_events (loop=0x843bb20 <main_loop>, ms=10) at ../src/nvim/event/loop.c:57
            mode = UV_RUN_ONCE
            timeout_expired = false
    6  0x0829225a in ui_bridge_stop (b=0xf70330e0) at ../src/nvim/ui_bridge.c:122
            bridge = 0xf70330e0
            stopped = false
    7  0x0828f0a5 in ui_builtin_stop () at ../src/nvim/ui.c:144
            ui = 0xf70330e0
            i = 0
    8  0x081e9b85 in mch_exit (r=1) at ../src/nvim/os_unix.c:141
    No locals.
    9  0x0818076e in getout (exitval=1) at ../src/nvim/main.c:666
            tp = 0x0
            next_tp = 0x0
    10 0x081a80df in preserve_exit () at ../src/nvim/misc1.c:2655
            really_exiting = true
    11 0x081e8e2e in deadly_signal (signum=1) at ../src/nvim/os/signal.c:137
    No locals.
    12 0x081e8eaa in on_signal (handle=0x8436200 <shup>, signum=1, data=0x0) at ../src/nvim/os/signal.c:162
            __PRETTY_FUNCTION__ = "on_signal"
            __func__ = "on_signal"
    13 0x0810a7bb in signal_event (argv=0xff85a328) at ../src/nvim/event/signal.c:47
            watcher = 0x8436200 <shup>
    14 0x0810869b in multiqueue_process_events (this=0xf7016420) at ../src/nvim/event/multiqueue.c:150
            event = {handler = 0x810a78b <signal_event>, argv = {0x8436200 <shup>, 0x0, 0x0, 0x0, 0x0, 0x0}}
            __PRETTY_FUNCTION__ = "multiqueue_process_events"
    15 0x08107eac in loop_poll_events (loop=0x843bb20 <main_loop>, ms=3984) at ../src/nvim/event/loop.c:65
            mode = UV_RUN_ONCE
            timeout_expired = false
    16 0x081e5d6f in input_poll (ms=4000) at ../src/nvim/os/input.c:349
            remaining = 3984
            before = 10125692630347
    17 0x081e5e50 in inbuf_poll (ms=4000) at ../src/nvim/os/input.c:372
    No locals.
    18 0x081e568f in os_inchar (buf=0x0, maxlen=0, ms=-1, tb_change_cnt=0) at ../src/nvim/os/input.c:110
            result = (unknown: 136905872)
    19 0x0826b0a1 in state_enter (s=0xff85a4c0) at ../src/nvim/state.c:55
            check_result = 1
            key = 58
            execute_result = 1
    20 0x0813802b in command_line_enter (firstc=58, count=1, indent=0) at ../src/nvim/ex_getln.c:392
            state = {state = {check = 0x8138588 <command_line_check>, execute = 0x81385b3 <command_line_execute>}, firstc = 58, count = 1, indent = 0, c = 58, i = 0, j = 1, gotesc = 0, do_abbr = 1, lookfor = 0x0, hiscnt = 10000, histype = 0, search_start = {lnum = 1, col = 0, coladd = 0}, save_cursor = {lnum = 1, col = 0, coladd = 0}, old_curswant = 0, init_curswant = 0, old_leftcol = 0, init_leftcol = 0, old_topline = 1, init_topline = 1, old_topfill = 0, init_topfill = 0, old_botline = 2, init_botline = 2, match_start = {lnum = 1, col = 0, coladd = 0}, match_end = {lnum = 0, col = 0, coladd = 0}, did_incsearch = 0, incsearch_postponed = 0, did_wild_list = 0, wim_index = 0, res = 0, save_msg_scroll = 0, save_State = 1, save_p_icm = 0xf7015e50 "", some_key_typed = 1, ignore_drag_release = 1, break_ctrl_c = 0, xpc = {xp_context = 0, xp_pattern = 0x0, xp_pattern_len = 0, xp_arg = 0x0, xp_scriptID = 0, xp_backslash = 0, xp_shell = 0, xp_numfiles = -1, xp_files = 0x0, xp_line = 0x0, xp_col = 0}, b_im_ptr = 0x0, save_ccline = {cmdbuff = 0x0, cmdbufflen = 0, cmdlen = 0, cmdpos = 0, cmdspos = 0, cmdfirstc = 0, cmdindent = 0, cmdprompt = 0x0, cmdattr = 0, overstrike = 0, xpc = 0x0, xp_context = 0, xp_arg = 0x0, input_fn = 0, prompt_id = 0, highlight_callback = {data = {funcref = 0x0, partial = 0x0}, type = kCallbackNone}, last_colors = {prompt_id = 0, cmdbuff = 0x0, colors = {size = 0, capacity = 0, items = 0x0}}, level = 0, prev_ccline = 0x0, special_char = 0 '\000', special_shift = false, redraw_state = kCmdRedrawNone}}
            s = 0xff85a4c0
            tstate = {current_exception = 0x832fc5a <arena_run_split_remove+74>, private_msg_list = 0xcb, msg_list = 0xc8, trylevel = 309, got_int = 0, need_rethrow = 0, did_emsg = -148897536}
            err = {type = kErrorTypeNone, msg = 0x0}
            tl_ret = true
            dict = 0xf701e180
            firstcbuf = ":"
    21 0x0813bf33 in getcmdline (firstc=58, count=1, indent=0) at ../src/nvim/ex_getln.c:1991
    No locals.
    22 0x0813c273 in getexline (c=58, cookie=0x0, indent=0) at ../src/nvim/ex_getln.c:2171
    No locals.
    23 0x0812178e in do_cmdline (cmdline=0x0, fgetline=0x813c23b <getexline>, cookie=0x0, flags=0) at ../src/nvim/ex_docmd.c:521
            next_cmdline = 0x0
            cmdline_copy = 0x0
            used_getline = 0
            recursive = 0
            msg_didout_before_start = 0
            count = 0
            did_inc = 0
            retval = 1
            cstack = {cs_flags = {-149727708, -149727552, 44, -149749760, 0, -8018024, 135896356, 44, 0, -8018008, 137102848, 138530816, -149749760, -165425056, -149727552, -153095488, 0, -8017976, 135301762, -165613500, -149727516, 136875711, -143908912, -153095488, 8, 18, -143904672, 8, -143889324, -8017928, 137102848, 138530816, -149749760, 0, 137154491, -153095488, 0, -149749760, 136875711, -149749760, 0, 136875711, 135298863, -153095488, 136911089, -150785824, 135298732, 0, 0, -149749760}, cs_pending = "@\004!\366 d\001\367\000\000\000\000h\250\205\377\023\217(\b\240\357\337\366\361\030)\b\340\060\003\367\254~\020\b\000\000\000\000\000\000\000\000\000\000\023\367@\004", cs_pend = {csp_rv = {0x0, 0x0, 0xff85a888, 0x81fb319 <rbuffer_consumed+138>, 0xf70b3e00, 0x2, 0xff85a8b8, 0x829198a <ui_bridge_flush+117>, 0x82918f1 <ui_bridge_flush_event>, 0xf70330e0, 0x8107eac <loop_poll_events+230>, 0x0, 0x0, 0x108, 0xff85a8c8, 0x81fb4bf <rbuffer_read+152>, 0xf70b3e00, 0xff85a8ac, 0x2b, 0x8107eac <loop_poll_events+230>, 0x0, 0x0, 0xf7130000, 0x0, 0x0, 0xf70b3e4b, 0x58, 0x2b, 0xf70330e0, 0x0, 0xff85a8f8, 0x8161750 <fix_input_buffer+11>, 0xf70b3e00, 0x843070b <typebuf_init+43>, 0xff85a9a8, 0xf7648000, 0xff85a908, 0xf7597d02 <clock_gettime+34>, 0x841d000, 0x82cdd00 <uv__run_timers+16>, 0x1, 0xff85a908, 0xff85a9d8, 0x816172b <inchar+496>, 0x84306e0 <typebuf_init>, 0xf4240, 0xff85a928, 0x8108748 <multiqueue_empty+62>, 0xf7016424, 0x843bb20 <main_loop>}, csp_ex = {0x0, 0x0, 0xff85a888, 0x81fb319 <rbuffer_consumed+138>, 0xf70b3e00, 0x2, 0xff85a8b8, 0x829198a <ui_bridge_flush+117>, 0x82918f1 <ui_bridge_flush_event>, 0xf70330e0, 0x8107eac <loop_poll_events+230>, 0x0, 0x0, 0x108, 0xff85a8c8, 0x81fb4bf <rbuffer_read+152>, 0xf70b3e00, 0xff85a8ac, 0x2b, 0x8107eac <loop_poll_events+230>, 0x0, 0x0, 0xf7130000, 0x0, 0x0, 0xf70b3e4b, 0x58, 0x2b, 0xf70330e0, 0x0, 0xff85a8f8, 0x8161750 <fix_input_buffer+11>, 0xf70b3e00, 0x843070b <typebuf_init+43>, 0xff85a9a8, 0xf7648000, 0xff85a908, 0xf7597d02 <clock_gettime+34>, 0x841d000, 0x82cdd00 <uv__run_timers+16>, 0x1, 0xff85a908, 0xff85a9d8, 0x816172b <inchar+496>, 0x84306e0 <typebuf_init>, 0xf4240, 0xff85a928, 0x8108748 <multiqueue_empty+62>, 0xf7016424, 0x843bb20 <main_loop>}}, cs_forinfo = {0x2, 0x82c0cb3 <uv_run+291>, 0x843bb20 <main_loop>, 0x0, 0xff85a968, 0x81086a6 <multiqueue_process_events+103>, 0xf7016420, 0x0, 0x843bb44 <main_loop+36>, 0xff85a948, 0xf70b3e00, 0x1, 0xff85a978, 0x81e5fd4 <process_interrupts+126>, 0xf70b3e00, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff85a9a8, 0x8107eac <loop_poll_events+230>, 0xf7016420, 0x2, 0x80, 0xf76c6892 <__lll_lock_wait+34>, 0xff85aa18, 0x1, 0xff85a9a8, 0x815f1ab <may_sync_undo+55>, 0x0, 0x0, 0x6d2000, 0x2, 0x0, 0x0, 0xff85a9d8, 0x815f15b <gotchars+134>, 0x3a, 0x0, 0x0, 0x82ccfbb <uv_mutex_unlock+27>, 0xf6220638, 0x0, 0x84306e1 <typebuf_init+1>, 0x3a, 0x0, 0x0, 0xff85aab8, 0x81608af <vgetorpeek+2629>}, cs_line = {1, 0, -1, 1, -149727600, 0, -8017384, 135300936, -150903772, 43, 2248736, 0, 138656544, 58, 58, 0, -150903776, 0, -8017256, -144408576, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 10125, 674433438, 138530816, 0, 0, 137103323, 0, 257, -8017256, 136208557, -150258176, 1000000, 5330103, 136221690, 0, 0, 0, 136207882, 5330103, 0}, cs_idx = -1, cs_looplevel = 0, cs_trylevel = 0, cs_emsg_silent_list = 0x0, cs_lflags = 0}
            lines_ga = {ga_len = 0, ga_maxlen = 0, ga_itemsize = 8, ga_growsize = 10, ga_data = 0x0}
            current_line = 0
            fname = 0x0
            breakpoint = 0x0
            dbg_tick = 0x0
            debug_saved = {trylevel = 0, force_abort = 0, caught_stack = 0x0, vv_exception = 0x0, vv_throwpoint = 0x0, did_emsg = 0, got_int = 0, need_rethrow = 0, check_cstack = 0, current_exception = 0x0}
            initial_trylevel = 0
            saved_msg_list = 0x0
            private_msg_list = 0x0
            cmd_getline = 0x813c23b <getexline>
            cmd_cookie = 0x0
            cmd_loop_cookie = {lines_gap = 0xff85a748, current_line = 135896356, repeating = 44, getline = 0x30, cookie = 0xff85a758}
            real_cookie = 0x0
            getline_is_func = 0
            call_depth = 1
    24 0x081bc48e in nv_colon (cap=0xff85abdc) at ../src/nvim/normal.c:4561
            old_p_im = 0
            cmd_result = 255
            is_cmdkey = false
    25 0x081b5382 in normal_execute (state=0xff85ab70, key=58) at ../src/nvim/normal.c:1137
            s = 0xff85ab70
            __PRETTY_FUNCTION__ = "normal_execute"
    26 0x0826b0ec in state_enter (s=0xff85ab70) at ../src/nvim/state.c:67
            check_result = 1
            key = 58
            execute_result = 1
    27 0x081b3a1d in normal_enter (cmdwin=false, noexmode=false) at ../src/nvim/normal.c:467
            state = {state = {check = 0x81b5881 <normal_check>, execute = 0x81b4cee <normal_execute>}, conceal_old_cursor_line = 0, conceal_new_cursor_line = 0, command_finished = false, ctrl_w = false, need_flushbuf = false, conceal_update_lines = false, set_prevcount = false, previous_got_int = false, cmdwin = false, noexmode = false, toplevel = true, oa = {op_type = 0, regname = 0, motion_type = kMTCharWise, motion_force = 0, use_reg_one = false, inclusive = false, end_adjusted = false, start = {lnum = 0, col = 0, coladd = 0}, end = {lnum = 0, col = 0, coladd = 0}, cursor_start = {lnum = 0, col = 0, coladd = 0}, line_count = 0, empty = false, is_VIsual = false, start_vcol = 0, end_vcol = 0, prev_opcount = 0, prev_count0 = 0}, ca = {oap = 0xff85ab8c, prechar = 0, cmdchar = 58, nchar = 0, ncharC1 = 0, ncharC2 = 0, extra_char = 0, opcount = 0, count0 = 0, count1 = 1, arg = 0, retval = 0, searchbuf = 0x0}, mapped_len = 0, old_mapped_len = 0, idx = 60, c = 58, old_col = 0, old_pos = {lnum = 1, col = 0, coladd = 0}}
    28 0x08180336 in main (argc=7, argv=0xff85adc4) at ../src/nvim/main.c:566
            fname = 0x0
            params = {argc = 7, argv = 0xff85adc4, use_vimrc = 0xff85b50d "NONE", n_commands = 0, commands = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, cmds_tofree = "\000\000\000\000\000\000\000\000\000", n_pre_commands = 1, pre_commands = {0xff85b520 "set noswapfile noshowcmd noruler undodir=. directory=. viewdir=. backupdir=.", 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, edit_type = 0, tagname = 0x0, use_ef = 0x0, want_full_screen = 1, input_isatty = true, output_isatty = true, err_isatty = true, no_swap_file = 0, use_debug_break_level = -1, window_count = 1, window_layout = 0, diff_mode = 0, listen_addr = 0x0}
            cwd = 0x0
            __PRETTY_FUNCTION__ = "main"
            reading_input = true

    Thread 1 (Thread 0xf6dffb40 (LWP 15705)):
    0  0x0828b5e2 in update_size (ui=0xf7130000) at ../src/nvim/tui/tui.c:1231
            data = 0x0
            width = 0
            height = 0
            val = 0x8199d72 <xfree+17> "\311\303U\211\345\203\354(\203}\b"
            advance = 0
    1  0x08288f42 in sigwinch_cb (watcher=0xf622091c, signum=0, data=0xf7130000) at ../src/nvim/tui/tui.c:408
            ui = 0xf7130000
    2  0x0810a7bb in signal_event (argv=0xf6dfeeb8) at ../src/nvim/event/signal.c:47
            watcher = 0xf622091c
    3  0x0810869b in multiqueue_process_events (this=0xf620f020) at ../src/nvim/event/multiqueue.c:150
            event = {handler = 0x810a78b <signal_event>, argv = {0xf622091c, 0x82d27cb <uv__epoll_ctl+59>, 0xff, 0x14, 0x0, 0x0}}
            __PRETTY_FUNCTION__ = "multiqueue_process_events"
    4  0x08107eac in loop_poll_events (loop=0xf6dfefa0, ms=20) at ../src/nvim/event/loop.c:65
            mode = UV_RUN_ONCE
            timeout_expired = true
    5  0x08288d08 in tui_main (bridge=0xf70330e0, ui=0xf7130000) at ../src/nvim/tui/tui.c:362
            ms = 3
            tui_loop = {uv = {data = 0xf6dfefa0, active_handles = 2, handle_queue = {0xf6dff104, 0xf62204fc}, active_reqs = {0xf6dfefb0, 0xf6dfefb0}, stop_flag = 0, flags = 0, backend_fd = 15, pending_queue = {0xf6dfefc4, 0xf6dfefc4}, watcher_queue = {0xf6dfefcc, 0xf6dfefcc}, watchers = 0xf620c000, nwatchers = 30, nfds = 2, wq = {0xf6dfefe0, 0xf6dfefe0}, wq_mutex = {__data = {__lock = 0, __count = 0, __owner = 0, __kind = 0, __nusers = 0, {d = {__espins = 0, __elision = 0}, __list = {__next = 0x0}}}, __size = '\000' <repeats 23 times>, __align = 0}, wq_async = {data = 0x0, loop = 0xf6dfefa0, type = UV_ASYNC, close_cb = 0x0, handle_queue = {0xf6dff290, 0xf6dff104}, u = {fd = 0, reserved = {0x0, 0x0, 0x0, 0x0}}, next_closing = 0x0, flags = 49152, async_cb = 0x82d3fe0 <uv__work_done>, queue = {0xf6dff2b4, 0xf6dff084}, pending = 0}, cloexec_lock = {__data = {__lock = 0, __nr_readers = 0, __readers_wakeup = 0, __writer_wakeup = 0, __nr_readers_queued = 0, __nr_writers_queued = 0, __flags = 0 '\000', __shared = 0 '\000', __pad1 = 0 '\000', __pad2 = 0 '\000', __writer = 0}, __size = '\000' <repeats 31 times>, __align = 0}, closing_handles = 0x0, process_handles = {0xf6dff064, 0xf6dff064}, prepare_handles = {0xf6dff06c, 0xf6dff06c}, check_handles = {0xf6dff074, 0xf6dff074}, idle_handles = {0xf6dff07c, 0xf6dff07c}, async_handles = {0xf6dff034, 0xf6dff2b4}, async_unused = 0x0, async_io_watcher = {cb = 0x82c01f0 <uv__async_io>, pending_queue = {0xf6dff094, 0xf6dff094}, watcher_queue = {0xf6dff09c, 0xf6dff09c}, pevents = 1, events = 1, fd = 18}, async_wfd = -1, timer_heap = {min = 0x0, nelts = 0}, timer_counter = 5, time = 10125712, signal_pipefd = {16, 17}, signal_io_watcher = {cb = 0x82c9900 <uv__signal_event>, pending_queue = {0xf6dff0d8, 0xf6dff0d8}, watcher_queue = {0xf6dff0e0, 0xf6dff0e0}, pevents = 1, events = 1, fd = 16}, child_watcher = {data = 0x0, loop = 0xf6dfefa0, type = UV_SIGNAL, close_cb = 0x0, handle_queue = {0xf6dff010, 0xf6dfefa8}, u = {fd = 0, reserved = {0x0, 0x0, 0x0, 0x0}}, next_closing = 0x0, flags = 32768, signal_cb = 0x0, signum = 0, tree_entry = {rbe_left = 0x0, rbe_right = 0x0, rbe_parent = 0x0, rbe_color = 0}, caught_signals = 0, dispatched_signals = 0}, emfile_fd = 19, inotify_read_watcher = {cb = 0x0, pending_queue = {0x0, 0x0}, watcher_queue = {0x0, 0x0}, pevents = 0, events = 0, fd = 0}, inotify_watchers = 0x0, inotify_fd = -1}, events = 0xf620f000, thread_events = 0xf620f040, fast_events = 0xf620f020, children = 0xf620d000, children_watcher = {data = 0xf6dff1b0, loop = 0xf6dfefa0, type = UV_SIGNAL, close_cb = 0xf74a1ed4, handle_queue = {0xf6dff1e0, 0xf6dff290}, u = {fd = 0, reserved = {0x0, 0x0, 0x0, 0x0}}, next_closing = 0x0, flags = 8192, signal_cb = 0x0, signum = 0, tree_entry = {rbe_left = 0x5, rbe_right = 0x421, rbe_parent = 0xf7669aa0, rbe_color = -144272712}, caught_signals = 0, dispatched_signals = 0}, children_kill_timer = {data = 0xf76b9f94, loop = 0xf6dfefa0, type = UV_TIMER, close_cb = 0x0, handle_queue = {0xf6dff238, 0xf6dff190}, u = {fd = -153095436, reserved = {0xf6dff2f4, 0xf76f0608, 0xf6dff2b0, 0xf76fe91a}}, next_closing = 0x0, flags = 8192, timer_cb = 0x0, heap_node = {0xf7716a94, 0x0, 0xf7669aa0}, timeout = 5, repeat = 0, start_id = 0}, poll_timer = {data = 0xf620e008, loop = 0xf6dfefa0, type = UV_TIMER, close_cb = 0x0, handle_queue = {0xf622092c, 0xf6dff1e0}, u = {fd = -153095436, reserved = {0xf6dff2f4, 0xf6dff268, 0xf6dff260, 0xf76bb648}}, next_closing = 0x0, flags = 8192, timer_cb = 0x8108315 <timer_cb>, heap_node = {0x0, 0x0, 0x0}, timeout = 10125732, repeat = 20, start_id = 4}, async = {data = 0x0, loop = 0xf6dfefa0, type = UV_ASYNC, close_cb = 0x0, handle_queue = {0xf6dff190, 0xf6dff010}, u = {fd = 0, reserved = {0x0, 0x0, 0x0, 0xf7716000}}, next_closing = 0x0, flags = 24576, async_cb = 0x810826b <async_cb>, queue = {0xf6dff084, 0xf6dff034}, pending = 0}, mutex = {__data = {__lock = 0, __count = 0, __owner = 0, __kind = 0, __nusers = 0, {d = {__espins = 0, __elision = 0}, __list = {__next = 0x0}}}, __size = '\000' <repeats 23 times>, __align = 0}, recursive = 0}
            data = 0xf6210440
    6  0x08292172 in ui_thread_run (data=0xf70330e0) at ../src/nvim/ui_bridge.c:104
            bridge = 0xf70330e0
    7  0xf76bff5b in start_thread (arg=0xf6dffb40) at pthread_create.c:312
            __res = <optimized out>
            pd = 0xf6dffb40
            now = <optimized out>
            unwind_buf = {cancel_jmp_buf = {{jmp_buf = {-143843328, -153093312, 4001536, -153095192, -1395719907, -992530146}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
            not_first_call = <optimized out>
            pagesize_m1 = <optimized out>
            sp = <optimized out>
            freesize = <optimized out>
            __PRETTY_FUNCTION__ = "start_thread"
    8  0xf758a52e in clone () from /lib32/libc.so.6
    No symbol table info available.
2018-06-03 19:29:57 +02:00
54f72efa70 Merge #8467 'vim-patches' 2018-06-03 18:12:27 +02:00
513804ed91 oldtests: comment out highlight group assertions
nvim always defines default highlight groups so hlexists() returns 1.
This happens even with `-u NONE --cmd`.
2018-06-03 10:48:54 -04:00
3818a47211 oldtests: comment out v:none assertions
nvim does not support v:none for json_encode() and json_decode().
2018-06-03 10:41:51 -04:00
8652458184 Merge #8465 'vim-patch:8.0.0558,8.0.0562' 2018-06-03 09:36:03 +02:00
402a797d08 Merge #8456 'API: nvim_list_uis: include channel id' 2018-06-03 08:29:45 +02:00
7b53b5380a vim-patch:8.0.1311: no test for strpart()
Problem:    No test for strpart().
Solution:   Add a test. (Dominique Pelle, closes vim/vim#2347)
c7d16dce2f
2018-06-02 12:20:01 -04:00
1ef585d6dc vim-patch:8.0.0435: some functions are not tested
Problem:    Some functions are not tested.
Solution:   Add more tests for functions. (Dominique Pelle, closes vim/vim#1541)
41042f3cfd
2018-06-02 12:13:32 -04:00
803baf3631 vim-patch:8.0.0261: not enough test coverage for eval functions
Problem:    Not enough test coverage for eval functions.
Solution:   Add more tests. (Dominique Pelle, closes vim/vim#1420)
24c2e48ef8
2018-06-02 12:08:06 -04:00
b8331e1a1c tui: handle termguicolors rgb value in bridge for now
When/if TUI/bridge teardown is refactored to use events, this
commit can be reverted.
2018-06-02 17:44:48 +02:00
dad7882cac vim-patch:8.0.0562: not enough test coverage for syntax commands
Problem:    Not enough test coverage for syntax commands.
Solution:   Add a few more tests. (Dominique Pelle, closes vim/vim#1624)
ea588154d0
2018-06-02 08:26:35 -04:00
9cd75ce73e oldtests: add conceal check for patch 8.0.0562 2018-06-02 08:19:01 -04:00
37e00c6e65 ex_getln: remove msg_scrolled cargo-cult magic, fixes #8251 2018-06-02 10:07:07 +02:00
1efe65a155 ex_getln: don't redraw statusline on top of scrolled messages 2018-06-02 09:39:39 +02:00
245b1ad7fa vim-patch:8.0.0558: :ownsyntax is not tested
Problem:    The :ownsyntax command is not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#1622)
f8ec998613
2018-06-01 21:20:24 -04:00
39a03c0fe7 wildmenu: close before redrawing statusline (#8453)
Fixes #8385
2018-06-02 00:22:53 +02:00
49a497a67c vim-patch:8.0.0519: character classes not well tested (#8460)
Problem:    Character classes are not well tested. They can differ between
            platforms.
Solution:   Add tests.  In the documentation make clear which classes depend
            on what library function.  Only use :cntrl: and :graph: for ASCII.
            (Kazunobu Kuriyama, Dominique Pelle, closes vim/vim#1560)
            Update the documentation.
0c078fc7db
2018-06-01 19:57:22 +02:00
5be3865ce7 nvim_list_uis: include channel id 2018-06-01 10:20:13 +02:00
c7350f542a vim-patch:8.0.0516 (#8458)
Problem:    A large count on a normal command causes trouble. (Dominique
            Pelle)
Solution:   Make "opcount" long.
b1e04fca37
2018-06-01 08:59:29 +02:00
4339fdd802 Merge #8454 from janlazo/vim-8.0.0321 2018-06-01 08:56:47 +02:00
2a30a71596 vim-patch:8.0.1232: MS-Windows users are confused about default mappings
Problem:    MS-Windows users are confused about default mappings.
Solution:   Don't map keys in the console where they don't work.  Add a choice
            in the installer to use MS-Windows key bindings or not. (Christian
            Brabandt, Ken Takata, closes vim/vim#2093)
c3fdf7f80b
2018-05-30 23:05:47 -04:00
27694577c3 vim-patch:8.0.0321: errors when trying to use scripts in tiny version
Problem:    When using the tiny version trying to load the matchit plugin
            gives an error. On MS-Windows some default mappings fail.
Solution:   Add a check if the command used is available. (Christian Brabandt)
8cc2a9c062
2018-05-30 23:03:21 -04:00
3585df3f0b Merge #8451 from ckelsel/vim-8.0.0507 2018-05-30 09:35:07 +02:00
77a2eaf08b vim-patch:8.0.0515: ml_get errors in silent Ex mode (#8452)
Problem:    ml_get errors in silent Ex mode. (Dominique Pelle)
Solution:   Clear valid flags when setting the cursor.  Set the topline when
            not in full screen mode.
d5d37537d1
2018-05-30 09:11:52 +02:00
6a0c727a0b vim-patch:8.0.0511: message for skipping client-server tests is unclear
Problem:    Menuage for skipping client-server tests is unclear.
Solution:   Be more specific about what's missing (Hirohito Higashi, Kazunobu
            Kuriyama)
a683ec44c3
2018-05-30 09:01:36 +08:00
bce3e95691 vim-patch:8.0.0507: client-server tests fail when $DISPLAY is not set
Problem:    Client-server tests fail when $DISPLAY is not set.
Solution:   Check for E240 before running the test.
a2845b8f5a
2018-05-30 08:45:07 +08:00
f711b63513 Merge #8434 'win/build: prefer Ninja' 2018-05-27 19:38:17 +02:00
2bfdceba37 Change to use bundled libuv to build luv 2018-05-27 18:16:29 +09:00
5b2cee03c8 vim-patch:8.0.0505: failed window split for :stag not handled (#8439)
Problem:    Failed window split for :stag not handled. (Coverity CID 99204)
Solution:   If the split fails skip to the end. (bstaletic, closes vim/vim#1577)
ba6ad17378
2018-05-26 11:29:12 +02:00
47fa9de580 vim-patch:8.0.0496: insufficient testing for folding (#8438)
Problem:    Insufficient testing for folding.
Solution:   Add a couple more fold tests. (Dominique Pelle, closes vim/vim#1579)
518c9b133b
2018-05-26 11:26:01 +02:00
438f2b6474 Merge #8436 win: test: cleanup on exit' 2018-05-26 11:14:59 +02:00
e21f454e11 fixup: always delete Xfile, fix exit code check
after_each + os.remove ensures Xfile is deleted after every test.
Windows exit code is inconsistent.
2018-05-25 07:43:02 -04:00
05282069db win: test: close shada file before os.remove 2018-05-24 22:11:16 -04:00
51db8ebf67 win: test: delete sautest/ 2018-05-24 22:11:15 -04:00
64177e3e98 win: test: don't test symlink if not admin user 2018-05-24 22:11:14 -04:00
209f05b487 win: test: disable non-admin failing tests
mkfifo (msysgit) does not work outside of msys2 environment.
gzip tests fail on Windows.

mklink requires admin privs for file symbolic links so mklink fails.
2018-05-24 22:11:12 -04:00
d2c460638c vim-patch:8.0.0454: compiler warnings for "always true" comparison (#8431)
Problem:    Compiler warnings for comparing unsigned char with 256 always
            being true. (Manuel Ortega)
Solution:   Add type cast.
977d037336
2018-05-24 23:32:32 +02:00
c67139f8aa vim-patch:8.0.0503: endless loop in updating folds with 32 bit ints (#8433)
Problem:    Endless loop in updating folds with 32 bit ints.
Solution:   Subtract from LHS instead of add to the RHS. (Matthew Malcomson)
vim/vim@9d20ce6
2018-05-24 23:30:21 +02:00
2ca6223967 API: Accept empty lists as dictionaries 2018-05-23 22:07:27 +02:00
333679ad0e Add empty options dict to buf_attach 2018-05-23 22:07:27 +02:00
65e7f6f0b9 Rename some more, fixe borked renaming 2018-05-23 22:07:27 +02:00
0bee3925ab Send changedtick as first event if buffer contents weren't requested 2018-05-23 22:07:27 +02:00
ad151847f1 Unify updates_start and updates to lines_event
Also rename changedtick -> changedtick_event
2018-05-23 22:07:27 +02:00
8ef3fb4e73 Use autogenerated declarations 2018-05-23 22:07:27 +02:00
491efc89d2 Lint 2018-05-23 22:07:27 +02:00
3866137eed Update test 2018-05-23 22:07:27 +02:00
e7451f8a91 Some renamings and doc changes 2018-05-23 22:07:27 +02:00
de5d1e863c Try fixing that test on travis 2018-05-23 22:07:27 +02:00
5aa8af7cdb Increase sendkeys timeout 2018-05-23 22:07:27 +02:00
2106bada5b Enable -Wconversion 2018-05-23 22:07:27 +02:00
6bdcbef2f5 The grand renaming 2018-05-23 22:07:27 +02:00
a1d831a49c Doc 2018-05-23 22:07:27 +02:00
995a2fad8c Fix memory leak 2018-05-23 22:07:27 +02:00
ec215a1962 Fix tests on windows
`cat` is distributed with neovim, so when can use it everywhere, as
opposed to `sort`.

The diffget test fails for unknown reasons on appveyor, mark it pending
for now.
2018-05-23 22:07:27 +02:00
61f467499b Bump up buffer capacity to 2GB 2018-05-23 22:07:27 +02:00
0476e0aef3 Make LiveUpdate return lastline instead of numreplaced
In analogy to `nvim_buf_set_lines`.
2018-05-23 22:07:27 +02:00
37b8e95fd6 Lint 2018-05-23 22:07:27 +02:00
8bcc011959 Make separate functions to start/stop live updates 2018-05-23 22:07:27 +02:00
71816e584c Adjust FUNC_API_SINCE for nvim_buf_live_updates 2018-05-23 22:07:27 +02:00
bafae1c427 Add argument to not send a buffers content when updates are enabled
Add a test.
2018-05-23 22:07:27 +02:00
9e97f14de2 Update to latest master 2018-05-23 22:07:27 +02:00
79184809bb Tests for buffer updates
Originally written by @phodge in
https://github.com/neovim/neovim/pull/5269.
2018-05-23 22:07:27 +02:00
db15a3b8f7 API: Document buffer updates
Originally written by @phodge in
https://github.com/neovim/neovim/pull/5269.
2018-05-23 22:07:27 +02:00
edcc73e766 API: Implement buffer updates
Originally written by @phodge in
https://github.com/neovim/neovim/pull/5269.
2018-05-23 22:07:27 +02:00
418abfc9d0 Merge pull request #6743 from bfredl/channel_info
Add methods to enumerate channels and clients to identify themselves
2018-05-23 20:34:27 +02:00
6da4548f0e api: list information about all channels/jobs.
Fire autocmd when channel opens or its info changes.
Add a way for API clients can describe themselves.
2018-05-23 18:18:16 +02:00
7f0095cc94 Change to use RUNTIME target for DLL installation 2018-05-23 22:13:53 +09:00
d337965e09 Change to not use library prefix on MSVC 2018-05-23 22:12:37 +09:00
655e3167ee Change conditions to more generally 2018-05-23 20:06:37 +09:00
fefb67fa88 Remove unnecessary copy of header 2018-05-23 20:03:53 +09:00
f1bc152fa0 doc: remove mentions of vimrc_example
closes #8426
2018-05-22 22:46:44 +02:00
fdf17e33d5 Change to always use cmake to build libuv on Windows 2018-05-22 21:42:05 +09:00
5000c9dc1f Change to use cmake to build libuv 2018-05-22 01:08:41 +09:00
828c9baad2 Change to enable build by Ninja on Windows 2018-05-21 19:32:19 +09:00
1642917f9b test/old: fix test filename 2018-05-20 19:12:34 +02:00
a93658502c win/build: Fix install (#8420) 2018-05-20 18:50:07 +02:00
35cc15e157 Merge #8419 'Fix PVS warnings' 2018-05-20 09:42:18 +02:00
ff0350d2ed Merge #8417 'vim-patch: 8.0.0489, 8.0.0491, 8.0.0495, 8.0.0500' 2018-05-20 09:14:27 +02:00
efa10881e5 deps: update to msgpack 3.0.0
Upgrade msgpack so that Nvim 0.3.0 builds on gcc 8.

ref #7506
2018-05-20 08:52:20 +02:00
5284b85d07 socket.c: Ignore PVS/V547: False positive
https://github.com/neovim/neovim/pull/8218#issuecomment-383412049
2018-05-20 08:46:26 +02:00
e24d338194 getchar.c: Fix PVS/V522: Dereference of null pointer mp_match 2018-05-20 08:46:17 +02:00
8e20b77bd1 strings.c: Fix PVS/V781: value of 'l + 1' is checked after it was used 2018-05-20 08:36:40 +02:00
7e9afca990 win/package: move gui shim to its runtime folder (#8418)
Close #7517

gui shim is for nvim-qt only.
2018-05-20 08:27:52 +02:00
fd5cc7dd0a vim-patch:8.0.0500: quotestar test is still a bit flaky
Problem:    Quotestar test is still a bit flaky.
Solution:   Add a slower check for v:version.
4889ad7c6c
2018-05-20 10:31:29 +08:00
4dd614e51a vim-patch:8.0.0495: quotestar test uses timer instead of timeout
Problem:    The quotestar test uses a timer instead of a timeout, thus it
            cannot be rerun like a flaky test.
Solution:   Remove the timer and add a timeout. (Kazunobu Kuriyama)
f5610da7a8
2018-05-20 10:28:18 +08:00
3046f4499b vim-patch:8.0.0491: quotestar test fails when features are missing
Problem:    The quotestar test fails when a required feature is missing.
Solution:   Prepend "Skipped" to the thrown exception.
bfd830d3e2
2018-05-20 10:22:38 +08:00
d0e07c043b vim-patch:8.0.0489: clipboard and "* register is not tested
Problem:    Clipboard and "* register is not tested.
Solution:   Add a test for Mac and X11. (Kazunobu Kuriyama)
7dd4850698
2018-05-20 10:19:41 +08:00
9af2e144a6 Merge #8411 from justinmk/vimpatches 2018-05-19 13:28:09 +02:00
725400d75d version.c: update [ci skip] (#8118)
vim-patch:8.0.0312: failure when a channel receives a split json message
vim-patch:8.0.0313: not enough testing for GUI functionality
vim-patch:8.0.0317: no test for setting 'guifont'
vim-patch:8.0.0318: small mistake in 7x13 font name
vim-patch:8.0.0329: xfontset and guifontwide are not tested
vim-patch:8.0.0332: GUI test fails on some systems
vim-patch:8.0.0348: using shadow dir on Mac lack +clipboard
vim-patch:8.0.0356: leaking memory when setting 'ttytype'
vim-patch:8.0.0362: tests fail on MS-Windows
vim-patch:8.0.0371: leaking memory when setting v:completed_item
vim-patch:8.0.0375: the "+ register is not tested
vim-patch:8.0.0382: warning in tiny build for unused variable
vim-patch:8.0.0383: misplaced vim/vim#ifdef
vim-patch:8.0.0384: timer test failed for no apparent reason
vim-patch:8.0.0403: GUI tests may fail
vim-patch:8.0.0409: set_progpath is defined but not always used              
vim-patch:8.0.0415: balloon test fails on MS-Windows                         
vim-patch:8.0.0416: setting v:progpath is not quite right                    
vim-patch:8.0.0419: test for v:progpath fails on MS-Windows                  
vim-patch:8.0.0438:                                                          
vim-patch:8.0.0441: dead code in vim/vim#ifdef                               
vim-patch:8.0.0447: getting font name does not work on X11                   
vim-patch:8.0.0450: v:progpath is not reliably set                           
vim-patch:8.0.0456: typo in MinGW test makefile                              
vim-patch:8.0.0460: can't build on HPUX                                      
vim-patch:8.0.0463: side effects from resetting 'compatible' in defaults.vim 
vim-patch:8.0.0464: can't find executable name on Solaris and FreeBSD        
vim-patch 8.0.0809: MS-Windows: tests hang                                   
vim-patch 8.0.0810: MS-Windows: tests still hang                             
vim-patch 8.0.0811: MS-Windows: test_expand_dllpath fails                    
vim-patch:8.0.0881: win32.mak no longer included in Windows SDK              
vim-patch:8.0.0925: MS-Windows GUI: channel I/O not handled right away       
vim-patch:8.0.1121: can uncheck executables in MS-Windows installer          
vim-patch:8.0.1141: MS-Windows build dependencies are incomplete
vim-patch:8.0.1150: MS-Windows GUI: dialog font size is incorrect
vim-patch:8.0.1180: MS-Windows testclean target deletes the color script
vim-patch:8.0.1181: tests using Vim command fail on MS-Windows
vim-patch:8.0.1191: MS-Windows: missing 32 and 64 bit files in installer
vim-patch:8.0.1197: MS-Windows build instructions are not up to date
vim-patch:8.0.1234: MS-Windows: composing chars are not shown properly
vim-patch:8.0.1472: MS-Windows: nsis installer is a bit slow
2018-05-19 13:26:52 +02:00
fdd59ef901 vim-patch:8.0.0559: setting ttytype to xxx does not always fail
Problem:    Setting ttytype to xxx does not always fail as expected. (Marvin
            Schmidt)
Solution:   Catch both possible errors. (closes vim/vim#1601)
f803a76978
2018-05-19 12:46:25 +02:00
39f16a0fee vim-patch:8.0.0342: double free with EXITFREE and setting 'ttytype'
Problem:    Double free when compiled with EXITFREE and setting 'ttytype'.
Solution:   Avoid setting P_ALLOCED on 'ttytype'. (Dominique Pelle,
            closes vim/vim#1461)
673911457d
2018-05-19 12:46:24 +02:00
a5de6770c5 vim-patch:8.0.0304: assign test fails in the GUI
Problem:    Assign test fails in the GUI.
Solution:   Skip the test for setting t_k1.
1fb0d49803

vim-patch:8.0.0354
2018-05-19 12:46:24 +02:00
0ea685ed9e test/old: remove abort from test declaration
No idea why this was added, it isn't in the Vim patch. The Vim (oldtest)
test-runner doesn't work with `Test_` functions marked as `abort`.
2018-05-19 12:38:14 +02:00
fb28b0c734 Merge #8377 'TextChangedP autocommand' 2018-05-19 11:48:37 +02:00
d995825c66 Merge #8377 'TextChangedP autocommand' 2018-05-19 11:44:52 +02:00
a82ac8accb vim-patch:8.0.0497: arabic support is not fully tested (#8404)
Problem:    Arabic support is not fully tested.
Solution:   Add more tests for the untested functions.  Comment out
            unreachable code.
vim/vim@3ff2f09
2018-05-19 10:37:10 +02:00
e3707c312a win: set TERMINFO_DIRS at build-time (#8408)
Fixes abnormal terminaion when TERM environment variable
is set in Windows.
2018-05-19 00:19:04 +02:00
50ec030b26 terminal: tickle statusline on entering #8323 2018-05-18 23:55:17 +02:00
3de81ea351 test: inccommand_spec: retry unreliable test (#8311) 2018-05-18 19:41:14 +02:00
2ed2939597 Merge #8406 'stdpath(): handle NULL default values' 2018-05-18 19:33:28 +02:00
91c4de83c9 cleanup 2018-05-18 19:04:37 +02:00
23f052edac main.c: remove useless call
Vim's vimrc_found() also handles setting 'nocompatible', that's why it
does vimrc_found(NULL, NULL).
2018-05-18 19:04:37 +02:00
26d5a981eb do not pass NULL to os_getenv
closes #8393
2018-05-18 19:04:37 +02:00
0ed297bdb4 Merge pull request #8381 from bfredl/chancrash
channel: avoid references to non-rooted vimL list with output
2018-05-18 10:10:45 +02:00
a676c658cc channel: avoid references to non-rooted vimL list with output
likely fixes #7768 #7913

If multiple internal stream callbacks were recieved before vimL
callbacks got called, only invoke one vimL callback with all data.
2018-05-17 19:09:32 +02:00
e121b1dbe7 Merge #8331 'handle various errors'
closes #8331
2018-05-17 09:14:54 +02:00
d2944e6a29 mf_open(): never fails (except for OOM) 2018-05-17 09:03:44 +02:00
c2d1684e05 coverity/13702: open_spellbuf: handle failed ml_open() 2018-05-17 09:03:13 +02:00
189a5f2b95 coverity/13713: do_pending_operator: handle failed u_save_cursor() 2018-05-17 09:03:02 +02:00
aea70b4404 coverity/13709: spell_add_word: handle failed fseek()
Check the return status after removing a duplicate word.  Add a
log for a nonzero return status.
2018-05-17 09:01:05 +02:00
32df42549a coverity/13700: ignore failed win_split()
win_split() does EMSG for all failure cases, so we don't need to log it.

Easiest thing to do here is ignore the return value (otherwise we need
to do some cleanup and might require some refactoring. jumpto_tag() can
deal with a failed split, so it's no big deal.
2018-05-17 08:49:14 +02:00
b44b533ada coverity/13969: handle u_save() failure
Looking at the implementation of u_save suggests that its failure is
a normal and expected situation (e.g. if undo isn't allowed for some
reason, it will fail). Also (most of) the other calls to u_save() in
do_put() return early.
2018-05-17 08:48:42 +02:00
2aa308c685 Merge #5658 'Apply :lmap in macros' 2018-05-17 02:13:31 +02:00
de7a0bdc35 Merge pull request #8383 from bfredl/timercrash
always run timer close callback after due callback
2018-05-15 07:47:33 +02:00
efb6caa39b test: nodejs_spec: fix test after upstream API change
closes https://github.com/neovim/node-client/issues/72
2018-05-15 00:03:21 +02:00
021c5875c1 vim-patch:8.0.1494: no autocmd triggered in Insert mode with visible popup menu
Problem:    No autocmd triggered in Insert mode with visible popup menu.
Solution:   Add TextChangedP. (Prabir Shrestha, Christian Brabandt,
            closes vim/vim#2372, closes vim/vim#1691)
            Fix that the TextChanged autocommands are not always triggered
            when sourcing a script.

5a09343719
2018-05-14 19:14:25 +08:00
11b55aa004 timer: make sure to free callback after the last timer due callback
fixes #6974

Before this change, the partial could be freed before the last due
callback got invoked, which caused a use-after-free when the due
callback called the partial.
2018-05-13 19:59:28 +02:00
36b2e3f743 Merge #8375 'API: nvim_get_commands'
closes #7833
ref #8029
2018-05-12 08:17:21 +02:00
137eedb4ed API: nvim_get_commands(): return Dictionary 2018-05-12 07:29:21 +02:00
cb6672853a API: nvim_get_commands(): builtin is irrelevant for buffer-local
builtin commands are never buffer-local, so we can return empty for that
case.
2018-05-12 07:29:21 +02:00
738bffea2c API: nvim_get_commands(): more attributes
Support more :command attributes:
  -bang
  -bar
  -register
2018-05-11 13:50:00 +02:00
9fa7727ce0 API: nvim_get_commands(): always return keys
- Always return all keys, with at least NIL value.
- Require `opts` param to be {"builtin":false}
- Validate `opts` param
2018-05-11 13:20:43 +02:00
25b6304840 API: nvim_get_commands() 2018-05-11 13:20:19 +02:00
273d2cd5d5 Merge #8329 'API: Make nvim_set_option() update :verbose set …' 2018-05-11 10:08:09 +02:00
e31d8ed36a lint 2018-05-10 22:31:55 -05:00
8d40b3617c Merge #8371 'API: more reliable/descriptive VimL errors' 2018-05-10 19:18:58 +02:00
1cd8517344 man.vim: s:get_path(): trim newline in all cases
ref #8372
2018-05-10 16:03:13 +02:00
966e7abc49 msgpack.vim: require python3 on Windows
timestamp.strftime('%s') workaround only works on unix.

ref: https://github.com/neovim/neovim/pull/8371#discussion_r186311766
2018-05-10 15:56:13 +02:00
3a6b80f2f4 UI: redraw statusline when entering cmdline (#8347) 2018-05-10 14:55:07 +02:00
f1a3075553 man.vim: get() first item if -w returns multiple paths #8372
OpenBSD's man returns all candidates when searching with -w instead of
the first one it finds.  So this patch takes the first one if multiple
entries are found.

closes #8372
closes #8341
2018-05-10 14:42:10 +02:00
cb8ea55d71 nvim_eval: fix memory leak 2018-05-10 04:01:25 +02:00
79a0d82755 test: API: fix tests after improved error capture 2018-05-10 04:01:25 +02:00
2326a4ac3a API: nvim_eval(): return non-generic VimL errors
Use the same pattern as nvim_call_function (_call_function).
2018-05-09 23:18:39 +02:00
32b0470b03 API: better way to capture abort-causing non-exception errors
This condition is not perfectly reliable:
    (did_emsg && force_abort && !current_exception)

The more proper way to check for abort-causing non-exception errors is
to set up `msg_list` using the "pattern" given by do_cmdline().
2018-05-09 23:18:38 +02:00
c9f3174075 API: return non-generic VimL errors
- Return VimL errors instead of generic errors for:
  - nvim_call_function
  - nvim_call_dict_function
- Fix tests which were silently broken before this change.

This violates #6150 where we agreed not to translate API errors.  But
that can be fixed later.
2018-05-09 23:18:38 +02:00
33bfea31b0 msgpack.vim: fix syntax errors, python2 errors 2018-05-09 23:18:38 +02:00
34b6a3d944 doc 2018-05-09 23:18:38 +02:00
ebb1acb3c0 Merge #8353 'API: nvim_call_dict_function' 2018-05-06 16:27:02 +02:00
cabffb0182 API: nvim_call_dict_function: expect actual function, not name 2018-05-06 14:52:21 +02:00
fe7ab60af7 API: nvim_call_dict_function: eliminate internal param
The `internal` param is difficult to explain, and will rarely be
anything but `true`.  To avoid it, use a hack: check if the resolved
dict value starts with "function(".
2018-05-06 14:38:26 +02:00
19c2ce1901 refactor: nvim_call_dict_function
- Add test coverage for errors.
- Rename, rearrange.
2018-05-06 14:38:26 +02:00
124275dd58 API: nvim_call_dict_function #3032 2018-05-06 14:38:26 +02:00
f46f138fb6 test: nvim_call_function: verify "too many arguments" error 2018-05-06 14:38:26 +02:00
8abd677d82 CI/travis: remove reference to non-exisiting script (#8366) 2018-05-06 11:40:59 +02:00
f8575fd1e4 CI/travis: fix building 32bit on linux (#8365)
Fixes #8351
2018-05-06 11:33:21 +02:00
8ce6393048 terminal: Leave 'relativenumber' alone (#8360)
ref #6796
2018-05-05 18:45:15 +02:00
bcc9a74e48 Merge pull request #8333 from jamessan/ccache
travis: Enable ccache
2018-05-04 19:43:43 -04:00
5009317525 Merge pull request #8358 from mhinz/screen
[RFC] screen: avoid artifacts
2018-05-04 19:42:58 -04:00
ec1a7791b0 test: screen artifacts 2018-05-04 22:14:27 +02:00
16ce2e006b screen: avoid artifacts
Put back the condition that was accidentally removed in
d42f934bcb

  -    if (enc_utf8 && ScreenLinesUC[off] != 0)
  -      bytes[utfc_char2bytes(off, bytes)] = NUL;
  -    else if (enc_dbcs == DBCS_JPNU && ScreenLines[off] == 0x8e) {
  -      bytes[0] = ScreenLines[off];
  -      bytes[1] = ScreenLines2[off];
  -      bytes[2] = NUL;
  -    } else if (enc_dbcs && MB_BYTE2LEN(bytes[0]) > 1) {
  -      bytes[1] = ScreenLines[off + 1];
  -      bytes[2] = NUL;
  -    }
  +    bytes[utfc_char2bytes(off, bytes)] = NUL;

Fixes #8357
2018-05-04 20:59:51 +02:00
0a349fd77d Merge pull request #8356 from bfredl/tabmsg
messages: redraw tabline if it was overdrawn by messages
2018-05-04 20:54:08 +02:00
0d037ad978 messages: redraw tabline if it was overdrawn by messages
fixes #8354

Regression from #8088, where we try to avoid clearing the screen
if not absolutely necessary
2018-05-04 09:15:19 +02:00
7170de1971 api: Make nvim_set_option() update :verbose set ...
Make `:verbose set ...` show when an option was last modified by an
API client or Lua script/chunk. In the case of an API client, the
channel ID is displayed.
2018-05-03 21:05:20 -05:00
e46534b423 Merge #4486 'refactor: Remove maxmem, maxmemtot options'
After this change we never release blocks from memory (in practice it
never happened because the memory limits are never reached).  Let the OS
take care of that.

---

On today's systems the 'maxmem' and 'maxmemtot' values are huge (4+ GB)
so the limits are never reached in practice, but Vim wastes a lot of
time checking if the limit was reached.

If the limit is reached Vim starts saving pieces of the swap file that were in
memory to the disk. Said in a different way: Vim implements its own
memory-paging mechanism. This is unnecessary and inefficient since the
operating system already has virtual memory and will swap to the disk if
programs start using too much memory.

This change does...

1. Reduce the number of config options and need for documentation.
2. Make the code more efficient as we don't have to keep track of memory
   usage nor check if the memory limits were reached to start swapping
   to disk every time we need memory for buffers.
3. Simplify the code. Once memfile.c is simple enough it could be
   replaced by actual operating system memory mapping (mmap,
   MemoryViewOfFile...). This change does not prevent Vim to recover
   changes from swap files since the swapping code is never triggered
   with the huge limits set by default.
2018-05-02 10:14:42 +02:00
c9e340b7be Point README to fullhtml PVS report rather then error list
[ci skip]
2018-05-01 21:00:16 +03:00
d5da357925 travis: Enable ccache 2018-05-01 07:02:44 -04:00
58b210e114 :digraphs : highlight with hl-SpecialKey #2690
closes #2690
2018-05-01 11:33:50 +02:00
5d6732ff09 Merge #8335 from blueyed/provider 2018-05-01 08:41:43 +02:00
1f2301eacf health#provider: fix sys.path for Python
Remove "" from sys.path (typically the first entry), which could cause
e.g. "logging" to be added from the current directory.
This gets done already for loading the host in
runtime/autoload/provider/pythonx.vim.
2018-04-30 16:54:35 +02:00
7d8327fd30 health#provider: improve error reporting
- quote command, so that e.g. markdown handling is not applied to `__init__.py`
- include cwd
2018-04-30 16:50:01 +02:00
87d3f265bc health#provider: fix logic with s:shellify
It should be quoted if there is any character that needs escaping, but
not if there is a character that does not need escaping.
2018-04-30 16:48:32 +02:00
4744142fad lint 2018-04-28 11:01:16 +02:00
6208c7fb98 doc: clarify stdout_buffered docs (#8299)
Fixes #8150
2018-04-28 00:45:55 +02:00
7e7c3111b6 Merge #4985
closes #4985
2018-04-27 23:37:30 +02:00
bd17ef75b3 test/unit/undo_spec.lua: fixup after rebase #4985 2018-04-27 13:06:41 +02:00
d6a1640260 test/util: move general functions into global helpers 2018-04-27 13:06:41 +02:00
34f29ac858 test/unit: some unit tests for undo.c #4985 2018-04-27 13:06:31 +02:00
53f11dcfc7 Merge #8218 'Fix errors reported by PVS'
closes #4983
2018-04-27 09:25:02 +02:00
009ccfe170 win: open child stdio handles in overlapped-mode (#8113)
This will be used e.g. by the python client for native asyncio support
2018-04-25 10:11:08 +02:00
a369385009 ci/travis: fix restore from cache #8316
closes #8281
2018-04-24 21:43:13 +02:00
ad60927d09 Merge #8304 "default to 'nofsync'" 2018-04-24 02:51:07 +02:00
77cb14cc6d API: nvim__stats()
Use it to verify fsync() behavior.
2018-04-24 00:44:06 +02:00
32f3937477 test: fsync() codepaths 2018-04-23 21:29:07 +02:00
ZyX
4ce8521ee4 pvscheck: Disable V011 warning 2018-04-22 20:54:17 +03:00
ZyX
a37819dbb1 spellfile: Fix clint error 2018-04-22 20:35:17 +03:00
ZyX
953d167015 syntax: Fix PVS/V560: condition was already checked 2018-04-22 20:34:32 +03:00
ZyX
76c2a60ff3 spellfile: Fix PVS/V547: allocator now never returns NULL 2018-04-22 20:33:42 +03:00
ZyX
03c2844b53 functests: Fix testlint errors 2018-04-22 20:32:25 +03:00
ZyX
4bab9d34e6 *: Fix clint errors 2018-04-22 20:31:40 +03:00
ffb8904913 tui/input.c: add support for mouse release events in urxvt (#8309)
Some terminals don't report which buttons are involved in some mouse
events. For example, the urxvt protocol
(http://www.huge-man-linux.net/man7/urxvt.html section "Mouse
reporting") does not report which button has been released.
In this case libtermkey reports button 0
(http://www.leonerd.org.uk/code/libtermkey/doc/termkey_interpret_mouse.3.html)

Up to now, forward_mouse_event did not handle button==0.
On press events there is not much we can do, and we keep the
current behavior which is dropping the event. But on drag-and-release
events we can compensate by remembering the last button pressed.

fixes #3182 for urxvt
fixes #5400
2018-04-22 19:26:04 +02:00
ZyX
4b41680828 window: Fix PVS/V547: expression already checked in previous if() 2018-04-22 20:25:44 +03:00
ZyX
c8648daab3 window: Silence PVS/V547: height may be changed by curwin ptr 2018-04-22 20:24:57 +03:00
ZyX
d9c010e45d api/vim: Fix PVS/V547: node was already dereferenced, so can’t be NULL 2018-04-22 20:23:50 +03:00
ZyX
a90672fc3d undo: Silence PVS/V547: expression may be false on other system 2018-04-22 20:22:46 +03:00
ZyX
43df2edd20 ui_bridge: Silence PVS/V547: assuming stopped may be changed via ptr 2018-04-22 20:21:55 +03:00
ZyX
6c2b442ee0 eval/typval: Silence PVS/V576: format is correct 2018-04-22 20:20:53 +03:00
ZyX
f50670aeff ugrid: Silence PVS/V625: UGRID_FOREACH_CELL may be used for one row 2018-04-22 20:18:29 +03:00
ZyX
f9b728e2f8 tui: Silence PVS/V560: condition is set to true in prev-previous if() 2018-04-22 20:16:58 +03:00
ZyX
9da2e7b021 syntax: Fix PVS/V560: condition was checked in previous if(), breaking 2018-04-22 20:15:42 +03:00
ZyX
3f4ec1aed2 syntax: Fix PVS/V547: condition was checked
In surrounding if() `off` was checked for being non-zero and in previous if() it
was checked for being positive.
2018-04-22 20:15:42 +03:00
ZyX
e724667ef4 syntax: Silence PVS/V560: condition is always true at that point 2018-04-22 20:12:23 +03:00
ZyX
2a951d16a4 syntax: Silence PVS/V522: retval is always non-NULL on this round 2018-04-22 20:08:49 +03:00
ZyX
5ba267722c syntax: Fix PVS/V560: condition checked in previous if() 2018-04-22 20:06:35 +03:00
ZyX
0eaecbaf47 strings: Fix PVS/V547: condition already checked by surrounding if 2018-04-22 20:05:32 +03:00
ZyX
b9b17a58da strings: Fix PVS/V779: wrong assert() position 2018-04-22 20:03:48 +03:00
ZyX
fb0c35105f spellfile: Silence PVS/V547: expression may be true on other systems 2018-04-22 20:02:50 +03:00
ZyX
f45df71081 spellfile: Fix PVS/V547: allocator never returns NULL now 2018-04-22 20:02:50 +03:00
ZyX
0ba2ec0bae spellfile: Fix PVS/V560: allocator never returns NULL now 2018-04-22 19:54:40 +03:00
ZyX
60577eeaf5 spell: Fix PVS/V512: use of sprintf() 2018-04-22 19:53:06 +03:00
ZyX
9f3e67a814 search: Fix PVS/V547: allocator never returns NULL now 2018-04-22 19:50:13 +03:00
ZyX
2cdf9d1388 search: Fix PVS/V560: condition checked in previous if with goto 2018-04-22 19:47:45 +03:00
ZyX
db1c9b625c search: Fix PVS/V547: condition already checked in surrounding if 2018-04-22 19:46:27 +03:00
ZyX
b144a77f38 search: Fix PVS/V547: checking variable right after assigning it 2018-04-22 19:44:56 +03:00
ZyX
3c7cc03f34 screen: Fix PVS/V560: col never reassigned in this part of code 2018-04-22 19:43:27 +03:00
ZyX
4ff4e66fd7 screen: Fix PVS/V519: duplicate successive assignment 2018-04-22 19:40:47 +03:00
ZyX
9c981f5a19 screen: Fix PVS/V560: condition was checked in surrounding if 2018-04-22 19:39:39 +03:00
ZyX
e3bffa47a6 globals: Do not use false for enc_dbcs
Based on screen.c code this value is not a boolean, so `false` is not 
appropriate. It should be either 0 or one of DBCS_… values.
2018-04-22 19:33:46 +03:00
ZyX
d42f934bcb screen: Get rid of ScreenLines2 as it is no longer used
Should also fix some PVS warnings in process.
2018-04-22 19:32:17 +03:00
ZyX
adfc1212b5 regexp_nfa: Silence PVS/V560: current code is more obvious
While warning is technically true (cannot enter this case with `state->c` 
greater then NFA_Z…9) it makes condition less readable and relies on knownledge 
of enum internal structure.
2018-04-22 19:09:20 +03:00
ZyX
190cc43cf3 quickfix: Silence PVS/V560: memory is referenced and may be changed 2018-04-22 18:59:23 +03:00
ZyX
3ee187b770 quickfix: Fix PVS/V547: allocator never returns NULL now 2018-04-22 18:57:34 +03:00
ZyX
4d43ce85f1 quickfix: Fix PVS/V547,V560: no conversion with fixed &encoding 2018-04-22 18:54:52 +03:00
d05712fbe7 inccommand: pause :terminal redraws (#8307)
fix #5584
2018-04-22 12:26:16 +02:00
51af911a27 inccommand: do not execute trailing commands #8256
fix #7494
2018-04-21 13:06:46 +02:00
b71697bc67 lint 2018-04-21 12:51:27 +02:00
9139bf81cf defaults: disable 'fsync'
ref #6725

fsync() is very slow on some systems.  And since the parent commit, Nvim
is smarter about flushing files at certain times (e.g. CursorHold),
regardless of whether 'fsync' is enabled.  So it's less risky to disable
'fsync'.

Profiling showed slow (2-4s) :write and :quit caused by fsync():

:quit
    shada_write_file(NULL, false);

:write + fsync
    0  0x00007f72da567b2d in fsync () at ../sysdeps/unix/syscall-template.S:84
    1  0x0000000000638970 in uv__fs_fsync (req=<optimized out>) at /home/vagrant/neovim/.deps/build/src/libuv/src/unix/fs.c:150
    2  uv__fs_work (w=<optimized out>) at /home/vagrant/neovim/.deps/build/src/libuv/src/unix/fs.c:953
    3  0x0000000000639a70 in uv_fs_fsync (loop=<optimized out>, req=<optimized out>, file=41, cb=0x7f72da567b2d <fsync+45>)
       at /home/vagrant/neovim/.deps/build/src/libuv/src/unix/fs.c:1094
    4  0x0000000000573694 in os_fsync (fd=41) at ../src/nvim/os/fs.c:631
    5  0x00000000004ec9dc in buf_write (buf=<optimized out>, fname=<optimized out>, sfname=<optimized out>, start=1, end=1997, eap=0x7fffc864c570,
       append=<optimized out>, forceit=<optimized out>, reset_changed=<optimized out>, filtering=<optimized out>) at ../src/nvim/fileio.c:3387
    6  0x00000000004b44ff in do_write (eap=0x7fffc864c570) at ../src/nvim/ex_cmds.c:1745
    ...

:write + nofsync
    0  0x00007f72da567b2d in fsync () at ../sysdeps/unix/syscall-template.S:84
    1  0x0000000000638970 in uv__fs_fsync (req=<optimized out>) at /home/vagrant/neovim/.deps/build/src/libuv/src/unix/fs.c:150
    2  uv__fs_work (w=<optimized out>) at /home/vagrant/neovim/.deps/build/src/libuv/src/unix/fs.c:953
    3  0x0000000000639a70 in uv_fs_fsync (loop=<optimized out>, req=<optimized out>, file=36, cb=0x7f72da567b2d <fsync+45>)
       at /home/vagrant/neovim/.deps/build/src/libuv/src/unix/fs.c:1094
    4  0x0000000000573694 in os_fsync (fd=36) at ../src/nvim/os/fs.c:631
    5  0x0000000000528f5a in mf_sync (mfp=0x7f72d8968d00, flags=5) at ../src/nvim/memfile.c:466
    6  0x000000000052d569 in ml_preserve (buf=0x7f72d890f000, message=0) at ../src/nvim/memline.c:1659
    7  0x00000000004ebadf in buf_write (buf=<optimized out>, fname=<optimized out>, sfname=<optimized out>, start=1, end=1997, eap=0x7fffc864c570,
       append=<optimized out>, forceit=<optimized out>, reset_changed=<optimized out>, filtering=<optimized out>) at ../src/nvim/fileio.c:3071
    8  0x00000000004b44ff in do_write (eap=0x7fffc864c570) at ../src/nvim/ex_cmds.c:1745
    ...
2018-04-21 12:51:27 +02:00
498731615c IO: let 'fsync' option control more cases
Vim has the 'swapsync' option which we removed in 62d137ce09.
Instead let 'fsync' control swapfile-fsync.

These cases ALWAYS force fsync (ignoring 'fsync' option):
- Idle (CursorHold).
- Exit caused by deadly signal.
- SIGPWR signal.
- Explicit :preserve command.
2018-04-21 12:51:27 +02:00
a02d22cca8 IO: shada should respect 'fsync' option
shada_write_file() is called on exit (:quit and friends), this can be
very slow.

Note: AFAICT Vim (do_viminfo()) does not appear to fsync() viminfo.
2018-04-21 12:50:28 +02:00
fe5f38d8bd terminal: do not call redraw_buf_later() (#8306)
fixes #8290
2018-04-21 04:11:45 +02:00
be2a3ddd58 test: "Command-line option -s": avoid indeterminism (#8305)
closes #8303
2018-04-21 03:15:18 +02:00
c10a207a20 test/util: throttle retry() (#8296)
Avoid a hot loop in retry(), there's no need to retry more than 50/s.

Also use luv.sleep() to implement sleep() instead of spinning the
event-loop, so events are not silently discarded.
2018-04-20 23:56:50 +02:00
d29c243bef doc: platform-specific config locations (#8297)
Fixes #7374.
2018-04-20 19:04:30 +02:00
ZyX
b7a46f2299 eval/typval: Remove struct dictitem_S which is not used anywhere 2018-04-20 00:04:25 +03:00
be1448213c Merge pull request #8291 from bfredl/ui_resize
ui_events: correct wrong argument order in resize event
2018-04-19 10:22:19 +02:00
a1530ece87 Merge #8293 from justinmk/test-nodejs
test: nodejs_spec: allow more time for nodejs init
2018-04-18 19:58:05 +02:00
522443d6bf test/util: retry(): also decorate non-string error 2018-04-18 09:47:51 +02:00
1dc497398e test: nodejs_spec: allow more time for nodejs init 2018-04-18 09:42:56 +02:00
c8189096e8 ui_events: correct wrong argument order 2018-04-17 19:09:18 +02:00
7a13611ba2 Merge #8276 'startup: Make -s - read from stdin' 2018-04-17 10:33:36 +02:00
ZyX
8cdaac0d80 event/process: Silence PVS/V547: assuming stream->num_bytes changes
Not familiar with the code, but I assume that loop_poll_events can actually 
change stream->num_bytes, so condition is not always false.
2018-04-17 01:49:46 +03:00
ZyX
cb3bb0becb pvscheck: Add --update switch 2018-04-17 01:44:11 +03:00
ZyX
57c66bc168 pvscheck: Remove outputs before running plog-converter
plog-converter behaviour is not the best one when creating fullhtml report and
directory already exists: it puts report inside an existing directory. Not sure
what exactly it does if inside exists as well, but if I am not mistaking report
will not be created.
2018-04-17 01:37:58 +03:00
ZyX
eba61fbc97 path: Silence PVS/V557: impossible to reach with NUL-terminated string 2018-04-17 01:36:18 +03:00
ZyX
4a1251206a path: Fix PVS/V560: condition is essentially A && A 2018-04-17 01:07:16 +03:00
48967695c4 test: tui_spec.lua: relax test (#8289)
Sometimes an extra FocusGained/FocusLost event might trigger. This
doesn't matter, we just want to test that the events were received in
cmdline-mode.
2018-04-16 23:35:58 +02:00
0cec184cd6 startup: ignore -X
closes #8285
2018-04-16 22:38:02 +02:00
84359a467f terminal: resize to the max dimensions (#8249)
closes #8096
2018-04-16 22:25:23 +02:00
9a1f57b488 contrib: fix local.mk.example (#8286)
We have two ways to disable third-party/

  1. make USE_BUNDLED_DEPS=OFF
  2. cmake USE_BUNDLED=OFF

The example used the make option in a cmake context.
2018-04-16 21:21:44 +02:00
ZyX
fab09ea0d6 option: Silence PVS/V547: expression is true on 64-bit systems 2018-04-16 11:37:39 +03:00
ZyX
d0850586df option: Fix PVS/V547: var is always NULL at that point 2018-04-16 11:36:06 +03:00
ZyX
6a5b9de546 option: Fix PVS/V560: EXPAND_BOOL_SETTINGS already caused early return 2018-04-16 11:34:26 +03:00
ZyX
61b6eb926d option: Fix PVS/V547: allocator never returns NULL now 2018-04-16 11:33:11 +03:00
ZyX
d66217ab6d option: Fix PVS/V517: duplicate check for titlelen 2018-04-16 11:32:00 +03:00
ZyX
0eb1d7ca4c option: Silence PVS/V594: GLOBAL_WO macros is not really necessary
In that case it is completely possible to just use w_allbuf_opt directly.
2018-04-16 11:31:27 +03:00
ZyX
95cc2507c9 ops: Fix PVS/V560: pre may not be zero as that was already checked 2018-04-16 11:23:22 +03:00
ed6a113804 Merge #8273 'job-control: avoid kill-timer race' 2018-04-16 08:44:28 +02:00
ZyX
fc1ebb060e ops: Fix PVS/V614: use of uninitialized variable
I have actually no idea how code managed to work and not trigger ASAN/etc here. 
It does not look like a false positive at all.
2018-04-15 21:49:47 +03:00
ZyX
dae1975394 ops: Fix PVS/V547: allocator never returns NULL 2018-04-15 21:46:32 +03:00
ZyX
2b7a8ceeb6 ops: Fix PVS/V547: did_change is almost always set
Only exception is early `goto theend`.
2018-04-15 21:44:36 +03:00
ZyX
4a145f2036 ops: Silence PVS/V614: regtype is always initialized 2018-04-15 21:40:30 +03:00
ZyX
3b32e717d9 message: Fix PVS/V547: c is never equal to KS_ZERO
Since `c` there is a result of evaluating `TO_SPECIAL` macros it may be only one 
of the following three things:

1. K_SPECIAL
2. K_ZERO (note: not KS_ZERO)
3. negative integer resulting from evaluating TERMCAP2KEY macro.

All variants here are negative and thus fail next !IS_SPECIAL(c) check (negative 
is special). If `c` was really NUL it would fall into the `!IS_SPECIAL(c)` block 
and use whatever character is third in `<80>{a}{b}` combo. For `<Nul>` it is 
X (`<80><ff>X`).
2018-04-15 21:32:26 +03:00
ZyX
cb3230776e memline: Fix PVS/V547: allocator now never returns NULL 2018-04-15 20:56:42 +03:00
ZyX
2940af8321 memline: Fix PVS/V560: allocator now never returns NULL 2018-04-15 20:55:26 +03:00
ZyX
a2f9188418 mbyte: Fix PVS/V557: do not do useless job
I do not see how array overrun is actually possible, but still EUC encodings may 
do fine without a cycle.
2018-04-15 20:53:29 +03:00
ZyX
24ee261317 if_cscope: Fix PVS/V560: condition would result in earlier return
Previous block just checks for totmatches being zero and returns if it is. And 
totmatches is unsigned, so `totmatches > 0` may never be true.
2018-04-15 20:36:21 +03:00
ZyX
b8f69b6b9a os/fs: Fix PVS/V560: condition was already checked in while()
It is not possible to enter while loop body with unsigned2 == 0 if loop 
condition requires unsigned1 < unsigned2.
2018-04-15 20:34:27 +03:00
ZyX
3189841984 fileio: Silence PVS/V614: buffer is initialized if conv_restlen > 0 2018-04-15 20:32:21 +03:00
ZyX
cd27198526 fileio: Fix PVS/V547: split is not used
This is removed functionality, specifically no longer supported 16-bit integers.
2018-04-15 20:30:31 +03:00
ZyX
1fb4282f1c fileio: Fix PVS/V560: end was already checked
See condition at line 3309.
2018-04-15 20:27:41 +03:00
ZyX
11f6411771 file_search: Silence PVS/V614: used buffer is never uninitialized 2018-04-15 20:18:20 +03:00
ZyX
d084628c4b kvec: Silence PVS/V512: it is not needed to fill the whole array 2018-04-15 20:14:55 +03:00
ZyX
a20261fae7 viml/parser/expressions: Fix PVS/V547: condition checked earlier
See previous goto with the same label.
2018-04-15 20:11:21 +03:00
ZyX
bc235bf1f6 viml/parser/expressions: Fix PVS/V547: condition checked earlier
See previous goto with the same label.
2018-04-15 20:10:48 +03:00
ZyX
6196738a3b ex_cmds: Fix PVS/V547: expression was already checked in outer if() 2018-04-15 20:08:32 +03:00
ZyX
17e21eae24 eval: Silence PVS/V547: PVS cannot stand !known_val expressions 2018-04-15 20:07:07 +03:00
ZyX
092b4d9774 *: Add some PVS comments 2018-04-15 20:07:07 +03:00
ZyX
469ba2fb49 ex_getln: Fix PVS/V547: function is stated to never return NULL 2018-04-15 20:07:07 +03:00
ZyX
c90e9df5b5 ex_getln: Fix PVS/V560: there are no longer NULL returns for OOM 2018-04-15 20:07:07 +03:00
ZyX
cad616c94e ex_docmd: Fix PVS/V547: condition was already checked in surr. if() 2018-04-15 20:07:07 +03:00
ZyX
d7e4449adb ex_docmd: Fix PVS/V547: due to short-circuiting name_len is never > 4 2018-04-15 20:07:07 +03:00
ZyX
103be37f42 ex_cmds: Fix PVS/V557: possible array overrun in :ascii
Some calculation show that with the current setup there will not be enough bytes
occupied for that, barring the case of malicious translation. Still should be
possible to have array overrun with specially crafted translation.
2018-04-15 20:07:07 +03:00
b2c066409d job-control: children_kill_cb(): do not check elapsed time
1. Don't check elapsed time in children_kill_cb(), it's already implied
   by the start-time of the timer itself.
2. Restart timer from children_kill_cb() for PTY jobs, to send SIGKILL
   after SIGTERM. There is an edge case where SIGKILL might follow
   SIGTERM too quickly, if jobstop() is called near the 2-second timer
   window.  But this edge case is not worth code complication.
2018-04-15 18:23:11 +02:00
142ac021ac job-control: one-shot timer instead of repeating
Before f31c26f1af the timer was used to try SIGTERM *and* SIGKILL, so
a repeating timer was needed.  After f31c26f1af process_stop() sends
SIGTERM immediately, and the timer only sends SIGKILL.

So we don't need a repeating timer.
- Simplifies the logic: don't need to call uv_timer_stop() explicitly.
- Avoids a problem: if process_stop() is called more than once in the
  2-second window, the first on_process_exit() would call
  uv_timer_stop() which stops the timer for all stopped processes.
2018-04-15 18:23:11 +02:00
8fa0b8051d job-control: mitigate process-kill race
children_kill_cb() is racey. One obvious problem is that
process_close_handles() is *queued* by on_process_exit(), so when
children_kill_cb() is invoked, the dead process might still be in the
`loop->children` list.  If the OS already reclaimed the dead PID, Nvim
may try to SIGKILL it.

Avoid that by checking `proc->status`.

Vim doesn't have this problem because it doesn't attempt to kill
processes that ignored SIGTERM after a timeout.

closes #8269
2018-04-15 18:23:11 +02:00
c8f409c2f2 loop: remove children_stop_requests
It serves no purpose because process_stop() is already guarded by
`proc->stopped_time`.
2018-04-15 18:23:11 +02:00
7598e6cf17 Merge #8120 'test: win: prefer cmd.exe' 2018-04-15 18:16:37 +02:00
ZyX
aa5008c1f0 ex_cmds: Simplify do_ascii
Specifically apply constants like enc_utf8 (which are constants *now*) and 
simplify conditions after that. Also some style changes.
2018-04-15 19:01:58 +03:00
ZyX
db7f80302b ex_cmds: Remove #ifdef USE_GUI
`ag` shows that this identifier (`USE_GUI`) is found in exactly one place (zero 
after this commit). So I assume macros is never defined.
2018-04-15 18:52:37 +03:00
ZyX
1df9ac1c03 eval: Fix PVS/V547: skipping is now done using eval0 2018-04-15 18:50:02 +03:00
ZyX
f8d574225b eval: Silence PVS/V547: E882 may be triggered
I failed to deduce why analyzer thinks E882 may not be triggered, though 
conditions for triggering it are strange: it would trigger E882 only in the 
single case “function returned non-number”. Cases “function thrown exception”, 
or “built-in sorter encountered error” will neither yield E882 nor stop 
sort()/uniq().

Note though that searching test code revealed that neither E702 nor E882 are not 
tested anywhere.
2018-04-15 18:45:12 +03:00
1e71978cf0 events: VimSuspend, VimResume #8280
closes #3648
ref #5959
2018-04-15 15:05:02 +02:00
1e7d5e8cdf Merge #6272 'stdpath()' 2018-04-15 04:09:30 +02:00
5abfa94ed2 test: win: use "start" to test backgrounded job (#8171) 2018-04-15 02:43:18 +02:00
a7e7f7bd83 Merge #8160 'win: oldtests: prefer cmd.exe' 2018-04-15 02:37:22 +02:00
ee4e1fd8ec win: Fix reading content from stdin (#8267)
Fixes #6890 by reading from the Windows console input buffer after
stdin has been closed.

Vim defines HAVE_DUP for Windows and does the close-dup dance[1]:

    close(0);
    dup(2);

which always fails, then falls back to reading from the Windows console
input buffer[2].

[1] e7499ddc33/src/fileio.c (L2397-L2398)
[2] e7499ddc33/src/os_win32.c (L1703-L1714)
2018-04-14 21:59:07 +02:00
387fbcd95c win: Fix reading from stdin
* Reading from stdin on Windows is fixed in the same way as it was in
  #8267.
* The file_read function was returning without filling the
  destination buffer when it was called with a non-blocking file
  descriptor.
2018-04-14 14:21:36 -05:00
ad999eaa77 Merge branch 'master' into s-dash-stdin 2018-04-14 14:17:51 -05:00
ef4feab0e7 version: rename "0.2.3" to "0.3.0" (#8268)
0.2.1 was a big release, it should have been renamed to 0.3.0.
0.2.3 also has significant changes, so rename it.
2018-04-13 22:15:52 +02:00
51b9d85bb4 ci/win: redirect stderr to fix mingw build 2018-04-13 13:42:12 -04:00
ad30907814 Revert "ci/win: don't use lastexitcode hack on mingw build"
This reverts commit bc43d2559f.

stderr redirection should make the workaround work for mingw builds.
2018-04-13 13:38:31 -04:00
8e87d89a99 oldtests: win: skip test49
Vim doesn't test it on Windows.
See https://github.com/vim/vim/blob/master/src/testdir/Make_all.mak
2018-04-12 21:11:55 -04:00
27e26b10a2 tui: abort on unexpected enum value (#8266)
ref #8261
2018-04-13 01:03:00 +02:00
1c3a849881 API/nvim_command_output: handle :echon capture (#8265)
ref https://github.com/neovim/python-client/pull/290
2018-04-13 00:49:37 +02:00
5e18550ddd Merge #7813 'channels: delay free'
fix #7699
2018-04-13 00:35:50 +02:00
0865adbbc2 channels: cleanup channel freeing code 2018-04-12 22:33:05 +02:00
aea079a25d channels: delay free so that libuv can cleanup handles
add test for a crash this caused
2018-04-12 18:22:47 +02:00
2cbeb7ca56 ui_set_option: pass String.data, not String 2018-04-12 12:58:27 +02:00
f44fb5b1a5 build/freebsd: set CMAKE_MAKE_PROGRAM iff "Unix Makefiles" (#8260)
It's only appropriate to set CMAKE_MAKE_PROGRAM to gmake when we're
using the "Unix Makefiles" generator.  On QB, the nodes have Ninja
available and will use it, which means CMAKE_GENERATOR is set to
"Ninja".  Setting CMAKE_MAKE_PROGRAM was forcing the build to use gmake
instead of ninja, which was causing the build failure.
2018-04-12 12:51:38 +02:00
d48df146d1 tui: fix uninitialize variable usage (#8261)
This fixes an issue with compiles failing in release mode due to shape
having the possibility of being used uninitialized (since the default
case was missing).
2018-04-12 12:50:01 +02:00
714e0f8bf0 oldtests: win: keep set dir=/
Any user can create a directory on root.
Creating a directory on root allows any user to write files within that directory.

Test_recover_root_dir() passes when run locally as a regular user (not admin).
2018-04-12 02:44:06 -04:00
bc43d2559f ci/win: don't use lastexitcode hack on mingw build
The heck is for MSVC builds to workaround msbuild error detection for cmake.
2018-04-12 02:39:25 -04:00
7c8122f36d win: getftype(symlink) returns 'link'
Vim doesn't detect symlinks correctly so stick with Neovim's behaviour.
2018-04-12 02:28:38 -04:00
49e86cebf0 oldtests: check +iconv for makeencoding
MSVC builds don't include it.
Test utf8 and latin only if +iconv is missing.
2018-04-12 02:27:10 -04:00
4bbe51b79e oldtests: win: help sp?it opens split()
Vim 8 and Neovim 0.2.3 open the same target on Windows.
2018-04-12 02:24:46 -04:00
6245b4873d oldtests: win: shellslash for cdpath,tags,:find 2018-04-12 02:24:29 -04:00
fa0e32fba2 oldtests: win: cmd.exe echo has trailing CR 2018-04-12 02:23:53 -04:00
e3687165a7 oldtests: use expand() to fix pathsep
Fix failing oldtests because of noshellslash.
2018-04-12 02:22:33 -04:00
979569356f ci/win: prefer msys find.exe
runnvim.sh depends on it for file glob patterns.
2018-04-12 02:19:03 -04:00
79a8d905ab oldtests: newstyle: win: reset shell to cmd.exe
Unset $SHELL so that child nvim use cmd.exe as default shell.

Unset $TERM so that child nvim don't segfault with negative exit code.
sh/bash use TERM=cygwin by default if it is unset.
mintty sets TERM to xterm.
2018-04-12 02:18:18 -04:00
87f4d2592c test/util: expect_err() (#8257)
other cleanup, ref #8245
2018-04-11 22:07:00 +02:00
f96d99ad11 Merge #8247 'server: introduce --listen' 2018-04-11 03:29:18 +02:00
777d34ec37 lint 2018-04-11 02:41:05 +02:00
704ba4151e server: init v:servername if $NVIM_LISTEN_ADDRESS is invalid
Before this change, if $NVIM_LISTEN_ADDRESS was invalid, v:servername
was left empty.
2018-04-11 02:41:05 +02:00
507bda1c95 server: introduce --listen, deprecate $NVIM_LISTEN_ADDRESS 2018-04-11 02:41:05 +02:00
7362ca4430 cleanup: remove main_start_gui() 2018-04-11 01:58:42 +02:00
9f598e5765 serverstop(): return FALSE for invalid address 2018-04-11 01:58:41 +02:00
b11b681289 test/util: matches() 2018-04-11 01:58:41 +02:00
f19db1b9ba remove scripts/run-api-tests.exp
Usage of this script was removed 0c2ec77ae0.
2018-04-11 00:56:36 +02:00
ZyX
6f19b9f4e1 eval: Silence PVS/V614: use of potentially uninitialized pointer
It is hard to say whether it actually is uninitialized, need to go deeper into 
regex code. Probably analyzer did not go that far as regmatch for sure would not 
be initialized up until calling NFA/DFA engine functions, which is to be done by 
pointer.
2018-04-10 01:52:18 +03:00
ZyX
4d1b3bf317 eval: Fix PVS/V560: unneded check for name_len
It is unsigned, zero length would already cause early return and length 1 is 
checked earlier in the same condition.
2018-04-10 01:52:08 +03:00
ZyX
07b67f9eff eval: Fix PVS/V547: ufunc_T is actually an incomplete type 2018-04-10 01:51:52 +03:00
ZyX
536d9a6168 edit: Fix PVS/V560: remove always true/false checks 2018-04-10 01:12:59 +03:00
ZyX
ef57cd81fe diff: Fix PVS/V547: remove no longer needed OOM handler 2018-04-10 01:12:38 +03:00
84bac9f507 Merge pull request #8250 from bfredl/shellscreen
remove last usages of screen functions in os/shell.c
2018-04-09 11:39:03 +02:00
d4688add96 os/shell: use msg functions instead of screen when throttling 2018-04-09 10:34:31 +02:00
c28dbede27 os/shell: remove dead calls to screen functions 2018-04-09 10:30:24 +02:00
ZyX
5acda03576 eval/decode: Silence PVS/V547: code written for 32-bit integers 2018-04-09 10:29:34 +03:00
ZyX
db29fa8164 charset: Fix PVS/V560: remove condition which was already checked 2018-04-09 10:29:33 +03:00
ZyX
1edb4894dc charset: Silence PVS/V785: remove switch()
No idea why it thinks that pre is constant expression, but switch() may be 
removed.
2018-04-09 10:29:32 +03:00
ZyX
f8a44b73f0 event/loop: Silence PVS/V547: condition is false in case of no timeout 2018-04-09 10:29:32 +03:00
ZyX
92759ef34f buffer: Fix PVS/V560: condition was checked three lines above 2018-04-09 10:29:31 +03:00
ZyX
840027c7f5 buffer: Fix PVS/V547: base is never set to octal 2018-04-09 10:29:30 +03:00
ZyX
93be2ba542 charset: Fix transchar() with multibyte characters
It appears that transchar() was working under assumption that 
`transchar_nonprint()` may be used for multibyte characters while its 
documentation stated exact opposite. It was not actually untrue though, except 
that longer buffer would be needed then the one stated in documentation. But it 
is false now with assert().
2018-04-09 10:29:29 +03:00
ZyX
58a5699a44 buffer: PVS/V557: Refactor maketitle() 2018-04-09 10:29:28 +03:00
ZyX
2a6491cdf8 os/env: Refactor home_replace() to the new style and to return length 2018-04-09 10:29:26 +03:00
ZyX
0d7daaad98 charset,*: Refactor transstr() 2018-04-09 01:39:33 +03:00
ZyX
e670756676 memory: Fix documentation of some string copying functions 2018-04-09 01:36:52 +03:00
ZyX
414ef75ee6 buffer: Beautify code a bit 2018-04-09 01:35:23 +03:00
fa6415f13f test/API: validate channel arg (#8245) 2018-04-08 03:01:15 +02:00
929a732d00 build/clang 6.0.0: fix type conversion warnings (#8235) 2018-04-07 16:20:31 +02:00
1ca138f236 build/OpenBSD: force gmake (#8222)
fix #8216
2018-04-07 16:10:01 +02:00
2ec94eb23f win/install: xxd.exe (#8241) 2018-04-07 04:09:43 +02:00
7034feb666 Merge pull request #8236 from bfredl/tuishape
TUI: clean up handling of CursorShape enum
2018-04-06 12:51:19 +02:00
de0d1a0d2a TUI: EMSG2 must not be used from TUI thread 2018-04-06 11:50:11 +02:00
d49c1dda8b Merge #8228 from mhinz/fix-fgets 2018-04-05 00:54:58 +02:00
1fd54f29c1 Make vim_fgets() return the same values as in Vim
The implementation of vim_fgets() differs between Neovim and Vim.

Vim says that it only returns `true` for EOF. But it always returns `true` when
fgets() returns NULL. This happens for EOF _or_ errors.

That probably misguided the author of Neovim's vim_fgets(), which does NOT
return `true` for errors.

Since all the callers of vim_fgets() probably expect it to work as it does in
Vim (and not as it says), it now returns the same values as the Vim
implementation.

Fixes #8227
2018-04-04 21:13:14 +02:00
e8c39f72fd Merge #8226 from justinmk/insert-mode-meta 2018-04-04 04:36:13 +02:00
224ebc0078 insert-mode: interpret unmapped META as ESC
closes #2454
closes #8213
ref #7972
2018-04-04 03:23:15 +02:00
8b8a75b2cf Merge #7524 from justinmk/vim-8.0.1281 2018-04-04 01:29:56 +02:00
e40e300c16 ins_compl_add_tv: fix memory leaks via get_spec_reg (#8224)
Fixes #8186
2018-04-03 01:30:48 +02:00
e25e552a3d vim-patch:8.0.1284: loading file type detection slows down startup
Problem:    Loading file type detection slows down startup.
Solution:   Store the last pattern of an autocommand event to make appending
            quicker.
462455ee8b
2018-04-02 23:59:49 +02:00
eb00fc0cf0 vim-patch:8.0.0564: cannot detect Bazel BUILD files on some systems
Problem:    Cannot detect Bazel BUILD files on some systems.
Solution:   Check for BUILD after script checks. (Issue vim/vim#1340)
39170e2d97

vim-patch:8.0.1283: test 86 fails under ASAN
2018-04-02 23:59:49 +02:00
b982f0e654 vim-patch:8.0.1285
d09a206ee9

vim-patch:8.0.0564: cannot detect Bazel BUILD files on some systems
2018-04-02 23:59:49 +02:00
411d578137 vim-patch:8.0.1282
Problem:    script-local variable defined in the wrong script
Solution:   Move variable to autoload/filetype.vim.

cef7322d8a
2018-04-02 23:59:48 +02:00
04f5062978 vim-patch:8.0.1281
Problem:    Loading file type detection slows down startup.
Solution:   Move functions to an autoload script.
851ee6c3da

---

vim-patch:8.0.0635
Problem:    When 'ignorecase' is set script detection is inaccurate.
Solution:   Enforce matching case for text. (closes #1753)
2018-04-02 23:59:46 +02:00
60e96a45b4 screen: winhl=Normal:Background should not override syntax (#8093)
fixes #7375
2018-04-02 14:21:14 +02:00
cb5cde6e2b build/CMake: use CMake-2.8.7-compatible list-check (#8220)
Tested with:
    make CMAKE_EXTRA_FLAGS='-DLANGUAGES="en_GB;ja;sk"'

closes #8219
2018-04-02 12:40:31 +02:00
0c59ac1a2c Merge #5908 'shada: Also save numbered marks' 2018-04-02 12:01:00 +02:00
4b26e365ae Merge #8208 'Clean up dependency patches'
closes #6659
2018-04-02 11:57:27 +02:00
9b7ce00486 build/OpenBSD: need -lpthread -lc++abi for LuaJIT (#8215) 2018-04-02 11:08:11 +02:00
ZyX
5d9bb16d66 functests: Use proper path in eq() 2018-04-02 11:14:11 +03:00
ec459965f5 test/options: Fix stdpath() failures on Windows 2018-04-01 22:40:20 -04:00
1b898d7af5 build/windows: Patch Luv with a patch file instead of CMake 2018-04-01 20:32:22 -05:00
57fef8b49b build/windows: Move libtermkey patches into this repository 2018-04-01 20:32:22 -05:00
ZyX
1fc09b5b98 eval/typval_encode: Silence PVS/V501,V547,V779
These kinds of warnings are inevitable for generic macros.
2018-04-02 00:46:18 +03:00
ZyX
5660482406 api/buffer: Fix PVS/V547: use correct border for lnum
Should actually be silencing that for the sake of the case when `long` is 
actually not 64-bit. But it appears that Vim had already defined maximal line 
number. And even declared that exact value invalid, so no need in silencing.
2018-04-02 00:41:00 +03:00
ZyX
bf160dd668 quickfix: Fix PVS/V560: remove duplicate condition
Condition was checked in surrounding if().
2018-04-02 00:31:29 +03:00
ZyX
6b84f7813c pvscheck: Also provide source tree root to plog-converter 2018-04-02 00:16:22 +03:00
ZyX
65d0b8ed32 pvscheck: Also produce fullhtml reports 2018-04-02 00:15:31 +03:00
ZyX
7eceac218e pvscheck: Make realdir work with nonexistent directories 2018-04-02 00:07:05 +03:00
ZyX
bdf5f57989 shada: Fix conversion warnings 2018-04-01 23:37:23 +03:00
ZyX
dd1b493f75 shada: Fix some memory leaks and completely ignore numbered mark names
Problems:
- In two places in shada_read_when_writing() memory just was not freed. Both 
  places were verified to cause test failures.
- Numbered marks got assigned incorrect (off-by-one compared to position in the 
  array) numbers in replace_numbered_mark.
- It was possible to have non-continuously populated array of numbered marks 
  which messed up code for merging them.

(Note about tests: marks with additional data are always compared different when 
merging, that caused some confusion regarding why test did not work the way 
I expected.)
2018-04-01 21:29:47 +03:00
ZyX
f5373e2cdc shada: Add functions to format ShaDa entries for debugging purposes
To be used in debugging printfs.
2018-04-01 21:23:43 +03:00
ZyX
200898546e shada: When storing numeric marks reset the numbers
Attempt to fix observed crash. Crash currently not reproduced.
2018-04-01 20:05:19 +03:00
ZyX
1ac1f520f0 functests: Add test for merging with file with only numeric mark
Known to cause memory leak, but not an expected crash.
2018-04-01 20:04:35 +03:00
98e7112390 msg: do not scroll entire screen (#8088) 2018-03-31 11:12:27 +02:00
362346f563 build/CMake: LANGUAGES config option #8203
Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
2018-03-31 10:59:45 +02:00
c8fd7ce08b ci/AppVeyor: cover MinGW and MSVC in PRs (#8206) 2018-03-30 21:54:39 +02:00
30f6ff7021 .gitignore 2018-03-30 17:47:25 +02:00
f21867a15c timer_pause: stop the timer resource (#8199)
If the timer isn't stopped, it still emits events which consume some CPU.

Fix #8188
2018-03-30 17:09:29 +02:00
868b84199e eval: Add stdpath() method (#5297)
Adds the :stdpath method for fetching XDG standard directories.

Fixes #5297
2018-03-29 10:41:04 -04:00
e54ff10d44 lint 2018-03-29 10:32:12 -04:00
b5a47f4907 Merge pull request #6377 from yagebu/option-fixes
options: fixes and some refactoring for number options

Closes #6696
2018-03-29 09:11:22 -04:00
e9cf40f2b6 build/NetBSD: use kinfo_proc2; undef uint64_t (#8197)
closes #8196

For historical reasons, uint64_t and friends are defined both as 
typedefs and macros. Some platforms that do that define the macros as
identity (#define uint64_t uint64_t), others like NetBSD define to the
backing type (#define uint64_t __uint64_t). This is normally
transparent, except when multiple levels of macro expansions are used
inconsistently.
2018-03-29 10:37:49 +02:00
bbca3142e8 ci/AppVeyor: build MinGW only on master branch (#8193)
Else the build takes too long.
2018-03-29 09:17:44 +02:00
79f9c2d9c6 Merge branch 'master' into yagebu/option-fixes 2018-03-28 21:54:39 -04:00
3f3de9b1a9 Merge #8183 'build/msvc: Fix functional tests'
MSBuild still returns a non-zero exit code because it detects the word "error" in the stdout which is caused by some of the test names such as api/buf {get,set,del}_line get_line : out-of-bounds is an error. 

CMake mailing list thread:
https://cmake.org/pipermail/cmake-developers/2015-October/026775.html

There isn't any good solution for it, so I modified the build script to detect the error message printed by RunTests.cmake.
2018-03-27 23:02:27 +02:00
8d5a46e77b TUI: implement "standout" attribute #8081
closes #8054
2018-03-27 04:38:19 +02:00
ZyX
3df11cfbca Revert "shada: In place of ignoring cursor position with lnum 0 save with 1"
This reverts commit aa728798b4.
2018-03-27 03:03:02 +03:00
ZyX
920c582320 test/helpers: Support booleans 2018-03-27 01:35:21 +03:00
ZyX
aa728798b4 shada: In place of ignoring cursor position with lnum 0 save with 1 2018-03-27 01:35:21 +03:00
ZyX
30e7fb2e32 shada: Also filter out invalid cursor position when writing '0' mark
Based on https://github.com/neovim/neovim/pull/5908#issuecomment-375909903, but 
with adjusted condition as line number or column less then zero should not 
appear at all based on what I know.
2018-03-27 01:33:59 +03:00
ZyX
7941aaa3bf macros: Rename LAST_ARRAY_ENTRY to ARRAY_LAST_ENTRY 2018-03-27 01:33:59 +03:00
ZyX
0bfc91be96 shada: Make ignore_buf also inline 2018-03-27 01:33:59 +03:00
ZyX
17ea0f2214 functests: Fix existing functional tests 2018-03-27 01:33:59 +03:00
393935c32d ci/AppVeyor: enable MSVC_32 build 2018-03-26 10:54:44 -05:00
c7caca60b9 ci/AppVeyor: Remove gperf from downloaded MSYS2 packages 2018-03-26 10:54:44 -05:00
cffdc1da02 ci/AppVeyor: Remove Git Unix utilities from the PATH 2018-03-26 10:54:44 -05:00
ab6051331c build/msvc: Fix check for cksum on Windows 2018-03-26 10:54:44 -05:00
afe6b4881f build/msvc: Add workaround for false positive exit code from MSBuild
See https://cmake.org/pipermail/cmake-developers/2015-October/026775.html
2018-03-26 10:54:44 -05:00
afd46b78c5 build/msvc: Fix libvterm patch 2018-03-26 10:54:44 -05:00
51f5cfc16e test: win: enable jobpid() tests
Use ping to test job detach
Use find.exe as an alternative to cat.exe
Use nvim_get_proc to check pid
2018-03-26 01:45:42 -04:00
ad6d577314 fixup: ping.exe works with cmd.exe pipe 2018-03-26 01:45:41 -04:00
e6ee06ee11 Revert "test/win: use cmd.exe for test"
This reverts commit ae409b5042.

This PR (#8120) defaults to cmd.exe for job_spec.lua
2018-03-26 01:45:41 -04:00
03e69a5d9c test: win: use find.exe /v "" as alternative cat - 2018-03-26 01:45:40 -04:00
3bd555f1e6 test: win: try stderr callback and slow output 2018-03-26 01:45:38 -04:00
cf4fbb6f04 test: win: use powershell for Start-Sleep only
cmd.exe (shell) is faster and more reliable than powershell (.NET frontend).
It's best for short and basic tests that don't require non-trivial scripting.
cmd.exe doesn't support sleep so use powershell's Start-Sleep as substitute.
2018-03-26 01:45:37 -04:00
ZyX
607e0d2202 shada: Save numbered marks
Problems so far:

- Marks in the current instance are not adjusted.
- Duplicates are not removed (not that it works in Vim either now, not at 
  8.0.134 at least).
2018-03-26 00:38:29 +03:00
a9c94f7bb0 Merge #7881 from ZyX-I/fix-7876 2018-03-25 19:13:45 +02:00
ce5c2030bf vim-patch:8.0.0417: test for the clipboard fails sometimes (#8174)
Problem:    Test for the clipboard fails sometimes.
Solution:   Add it to the flaky tests.
0fbff646d5
2018-03-25 17:20:59 +02:00
9ebe2ad331 runtime/dircolors.vim: support termguicolors (#8175) 2018-03-25 15:45:02 +02:00
ZyX
201a4ef11c *: Replace did_throw checks with current_exception checks
Removes obsolete did_throw after that.
2018-03-25 15:13:05 +03:00
ZyX
79b4b6fc86 *: Make sure that !did_throw implies !current_exception
Fixes #7876
2018-03-25 14:50:48 +03:00
f8d2aef4f2 vim-patch.sh: remove blank line before URL
This "stacks" better in squashed PRs, etc.
2018-03-24 23:08:40 +01:00
5fecd59c26 Merge #8167, #7943 2018-03-24 23:06:36 +01:00
8d64a2fb1d test: lua test for vim-patch:8.0.0184
2b7bc567b9
2018-03-24 23:06:09 +01:00
29395fd304 vim-patches: test_system.vim
vim-patch:8.0.0185: system() test fails on MS-Windows
vim-patch:8.0.0197: system() test skips some parts for MS-Windows
vim-patch:8.0.0701: system test failing when using X11 forwarding
2018-03-24 23:06:09 +01:00
f50ce7d510 vim-patch:8.0.0184: fix ex-mode exit code #7943
Problem:    When in Ex mode and an error is caught by try-catch, Vim still
            exits with a non-zero exit code.
Solution:   Don't set ex_exitval when inside a try-catch. (partly by Christian
            Brabandt)

2b7bc567b9
2018-03-24 22:33:41 +01:00
131aad953c win: defaults: 'shellcmdflag', 'shellxquote' #7343
closes #7698

Wrapping a command in double-quotes allows cmd.exe to safely dequote the
entire command as if the user entered the entire command in an
interactive prompt. This reduces the need to escape nested and uneven
double quotes.

The `/s` flag of cmd.exe makes the behaviour more reliable:

    :set shellcmdflag=/s\ /c

Before this patch, cmd.exe cannot use cygwin echo.exe (as opposed to
cmd.exe `echo` builtin) even if it is wrapped in double quotes.

Example:
:: internal echo
> cmd /s /c " echo foo\:bar" "
foo\:bar"

:: cygwin echo.exe
> cmd /s /c " "echo" foo\:bar" "
foo:bar
2018-03-24 22:05:53 +01:00
be67d926c5 build/msvc: Add libintl to bundled dependencies (#8163) 2018-03-24 17:58:32 +01:00
6a7c904648 Merge #4419 'implement <Cmd> key' 2018-03-24 17:45:48 +01:00
1b61167373 Merge #8168 'refactor: rename some functions' 2018-03-24 16:07:11 +01:00
0ecf7e3a2d refactor/rename: path_to_absolute() 2018-03-24 14:17:40 +01:00
7ae4144208 refactor/rename: path_try_shorten_fname() 2018-03-24 14:17:40 +01:00
998a16c926 refactor/rename: path_is_absolute() 2018-03-24 14:17:40 +01:00
84a25770ac Merge #8165 'provider/RPC: fix double-free' 2018-03-24 14:03:16 +01:00
82cd0be2ea refactor: eliminate autocmd_fname_full global
It's a micro-optimization; check path_is_absolute_path(autocmd_fname)
instead.

The main optimization (which is still in place) afforded by Vim 7.2.021
was to avoid resolving <afile> when it is not needed.
2018-03-24 12:16:39 +01:00
189c5abeba provider/RPC: apply_autocmds_group(): fix double-free
During provider dispatch, eval_call_provider() saves global
state--including pointers, such as `autocmd_fname`--into
`provider_caller_scope` which is later restored by f_rpcrequest().

But `autocmd_fname` is special-cased in eval_vars(), for performance
(see Vim patch 7.2.021; this is also the singular purpose of the
`autocmd_fname_full` global. Yay!)

If eval_vars() frees `autocmd_fname` then its provider-RPC-scoped alias
becomes a problem.

Solution: Don't free autocmd_fname in eval_vars(), just copy into it.

closes #5245
closes #5617

Reference
------------------------------------------------------------------------

Vim patch 7.2.021
f6dad43c98
Problem:    When executing autocommands getting the full file name may be
            slow. (David Kotchan)
Solution:   Postpone calling FullName_save() until autocmd_fname is used.

vim_dev discussion (2008): "Problem with CursorMoved AutoCommand when
Editing Files on a Remote WIndows Share"
https://groups.google.com/d/msg/vim_dev/kj95weZa_eE/GTgj4aq5sIgJ
2018-03-24 11:01:24 +01:00
d407a48665 getchar: implement <Cmd> key to invoke command in any mode 2018-03-23 14:01:49 +01:00
9627325684 vim-patch:8.0.0387: compiler warnings (#8162)
Problem:    compiler warnings
Solution:   Add type casts. (Christian Brabandt)
b113c3a618
2018-03-23 07:59:08 +01:00
ce3bc12e25 vim-patch:8.0.0357: crash when setting 'guicursor' to weird value (#8161)
Problem:    Crash when setting 'guicursor' to weird value.
Solution:   Avoid negative size. (Dominique Pelle, closes vim/vim#1465)
24922ec233
2018-03-22 07:34:42 +01:00
535bf89597 Merge #8147 'Run old tests in :terminal' 2018-03-21 00:26:39 +01:00
ZyX
519ff2ad42 oldtests: Make test output least verbose
Also removes `-` before `rm -rf` as `-f` is supposed to already suppress error.
2018-03-21 00:54:32 +03:00
10008f7d49 build/cmake: avoid CMP0054 (#8149)
CMP0054: Only interpret if() arguments as variables or keywords when unquoted.
2018-03-20 22:19:07 +01:00
739fb93a90 Merge #8128 'build/windows: Simplify build requirements' 2018-03-18 23:46:12 +01:00
1fb44676cd build: avoid CMP0046 "dependency target does not exist" #8128 2018-03-18 23:41:48 +01:00
ZyX
1c0a2a39b6 oldtests: Run old tests in :terminal
Reasoning:

- No need to check for terminal size.
- No need to mess with terminal title.
- Allows old tests to timeout with the rest of the build proceeding.
- Less and less messy output to travis log.
- Opens a path allowing old tests run in parallel. Though last bit needs test
  refactoring.
2018-03-18 23:51:43 +03:00
3bf57c1171 log/channels: Formatting. Also log loopback channel. #8146 2018-03-18 21:15:41 +01:00
c49dac7cd3 build: Fix CMake target dependency problem
nvim was being ran before its runtime dependencies were copied.
2018-03-18 12:51:39 -05:00
feee814b30 build/windows: Add CMakeLists.txt for gperf 2018-03-18 12:51:39 -05:00
229604213e build/windows: Add CMake script to generate headers for Libvterm
On Windows the CMake script will replace the Perl script used by
Libvterm to generate headers.
2018-03-18 12:51:30 -05:00
15c53a44d3 build/windows: Add CMakeLists.txt for Libuv on Windows
Adding a CMakeLists.txt for Libuv removes the need for Python
when building on Windows.
2018-03-18 12:50:39 -05:00
bf789b04f3 build/windows: Ignore whitespace when applying patches
The --ignore-whitespace argument was added when applying patches to
prevent failures when patched files have different line endings.
2018-03-18 12:50:39 -05:00
4e02f1ab87 Merge #8107 'jobs: separate process-group' 2018-03-18 18:36:02 +01:00
0848add488 screen.c: define column width by function (#5802)
This does not change the behavior but centralizes column size for future use
(like dynamic signcolumn width depending on the maximum number of signs on a line).

The returned value is limited by the size of the `extra` tab in win_line
(currently allows for 18 ASCII characters).
2018-03-18 17:31:28 +01:00
ae409b5042 test/win: use cmd.exe for test
Can revert this after #8120.
2018-03-18 17:15:06 +01:00
167898a517 test: jobstop() kills entire process tree
Test correctly fails before 8d90171f8b.
ref #6530
2018-03-18 17:03:05 +01:00
72e4c9d8e7 Merge #8142 'build/msvc: fix some warnings' 2018-03-18 16:47:25 +01:00
65b66bc332 build/MSVC: fix "C4005: RGB: macro redefinition" 2018-03-18 14:30:05 +01:00
26b84a8b3e build/MSVC: fix "C4003: not enough actual parameters for macro"
For the case of TV_DICTITEM_STRUCT, we can't just pass `1` because:
https://github.com/neovim/neovim/pull/8142#discussion_r175262436
> this variant will trigger array overrun warnings from various static analyzers.
2018-03-18 14:30:05 +01:00
960f093625 build/MSVC: fix "C4028: formal parameter different from declaration" 2018-03-18 14:11:39 +01:00
66a8b593e7 ci/travis: report cache size 2018-03-18 14:11:39 +01:00
8f82f95c1c ci/travis: also cache $DEPS_DOWNLOAD_DIR
ref #5166
2018-03-18 14:11:38 +01:00
a034d4b69d API: nvim_get_proc()
TODO: "exepath" field (win32: QueryFullProcessImageName())

On unix-likes `ps` is used because the platform-specific APIs are
a nightmare.  For reference, below is a (incomplete) attempt:

diff --git a/src/nvim/os/process.c b/src/nvim/os/process.c
index 09769925aca5..99afbbf290c1 100644
--- a/src/nvim/os/process.c
+++ b/src/nvim/os/process.c
@@ -208,3 +210,60 @@ int os_proc_children(int ppid, int **proc_list, size_t *proc_count)
   return 0;
 }

+/// Gets various properties of the process identified by `pid`.
+///
+/// @param pid Process to inspect.
+/// @return Map of process properties, empty on error.
+Dictionary os_proc_info(int pid)
+{
+  Dictionary pinfo = ARRAY_DICT_INIT;
+#ifdef WIN32
+
+#elif defined(__APPLE__)
+  char buf[PROC_PIDPATHINFO_MAXSIZE];
+  if (proc_pidpath(pid, buf, sizeof(buf))) {
+    name = getName(buf);
+    PUT(pinfo, "exepath", STRING_OBJ(cstr_to_string(buf)));
+    return name;
+  } else {
+    ILOG("proc_pidpath() failed for pid: %d", pid);
+  }
+#elif defined(BSD)
+# if defined(__FreeBSD__)
+#  define KP_COMM(o) o.ki_comm
+# else
+#  define KP_COMM(o) o.p_comm
+# endif
+  struct kinfo_proc *proc = kinfo_getproc(pid);
+  if (proc) {
+    PUT(pinfo, "name", cstr_to_string(KP_COMM(proc)));
+    xfree(proc);
+  } else {
+    ILOG("kinfo_getproc() failed for pid: %d", pid);
+  }
+
+#elif defined(__linux__)
+  char fname[256] = { 0 };
+  char buf[MAXPATHL];
+  snprintf(fname, sizeof(fname), "/proc/%d/comm", pid);
+  FILE *fp = fopen(fname, "r");
+  // FileDescriptor *f = file_open_new(&error, fname, kFileReadOnly, 0);
+  // ptrdiff_t file_read(FileDescriptor *const fp, char *const ret_buf,
+  //                     const size_t size)
+  if (fp == NULL) {
+    ILOG("fopen() of /proc/%d/comm failed", pid);
+  } else {
+    size_t n = fread(buf, sizeof(char), sizeof(buf) - 1, fp);
+    if (n == 0) {
+      WLOG("fread() of /proc/%d/comm failed", pid);
+    } else {
+      size_t end = MIN(sizeof(buf) - 1, n);
+      end = (end > 0 && buf[end - 1] == '\n') ? end - 1 : end;
+      buf[end] = '\0';
+      PUT(pinfo, "name", STRING_OBJ(cstr_to_string(buf)));
+    }
+  }
+  fclose(fp);
+#endif
+  return pinfo;
+}
2018-03-18 00:11:45 +01:00
b0e5187e49 ci/travis: Don't destroy cache during prepare
This change was missed in c7f95fde1b.
ref #5166
2018-03-17 14:26:34 +01:00
f407a94032 vim-patch:8.0.0344: unlet command leaks memory (#8141)
Problem:    Unlet command leaks memory. (Nikolai Pavlov)
Solution:   Free the memory on error. (closes vim/vim#1497)
49439c4cdf
2018-03-17 09:49:06 +01:00
330e5acbce win: nvim_get_proc_children()
TODO: Raymond Chen explains[1] racy behavior of the
CreateToolhelp32Snapshot approach.  Better approach:

> create a job object and put process P in it. Then call
> QueryInformationJobObject with JobObjectBasicProcessIdList to get the
> list of child processes.

[1] "Why is CreateToolhelp32Snapshot returning incorrect parent process IDs all of a sudden?"
    https://blogs.msdn.microsoft.com/oldnewthing/20150403-00/?p=44313
2018-03-16 10:55:12 +01:00
12af7016e2 nvim_get_proc_children: fallback to shell
/proc/…/children may be unavailable because of an unset kernel option.
Fallback to `pgrep` invoked in a shell.
2018-03-16 10:55:12 +01:00
dbad797edd API: nvim_get_proc_children()
ref https://github.com/libuv/libuv/pull/836
2018-03-16 10:55:12 +01:00
de86f82483 win: os_proc_tree_kill()
XXX: comment at https://stackoverflow.com/q/1173342 :
> Windows recycles PIDs quite fast, you have to be extra careful not
> to kill unrelated processes. These APIs will report PPIDs for long
> dead processes whose PIDs may have been recycled. Check the parent
> start date to make sure it is related to the processes you spawned.
2018-03-16 10:55:12 +01:00
8d90171f8b jobs: child proc must have a separate process-group
UV_PROCESS_DETACHED compels libuv:uv__process_child_init() to call
setsid() in the child just after fork().  That ensures the process and
its descendants are grouped in a separate session (and process group).

The following jobstart() call correctly groups `sh` and `sleep` in a new
session (and process-group), where `sh` is the "session leader" (and
process-group leader):

    :call jobstart(['sh','-c','sleep 60'])

     SESN  PGRP   PID  PPID  Command
    30383 30383 30383  3620  │  ├─ -bash
    30383 31432 31432 30383  │  │  └─ nvim -u NORC
    30383 31432 31433 30383  │  │     ├─ nvim -u NORC
     8105  8105  8105 31432  │  │     └─ sh -c sleep 60
     8105  8105  8106  8105  │  │        └─ sleep 60

closes #6530
ref: https://stackoverflow.com/q/1046933
ref: https://unix.stackexchange.com/a/404065

Helped-by: Marco Hinz <mh.codebro+github@gmail.com>

Discussion
------------------------------------------------------------------------

On my linux box before this patch, the termclose_spec.lua:'kills job
trapping SIGTERM' test indirectly causes cmake/busted to wait for 60s.
That's because the test spawns a `sleep 60` descendant process which
hangs around even after nvim exits: nvim killed the parent PID, but not
PGID (process-group), so the grandchild "reparented" to init (PID 1).

Session contains processes (and process-groups) which are logically part
of the same "login session". Process-group is a set of
logically/informally-related processes within a session; for example,
shells assign a process group to each "job". Session IDs and PGIDs both
have type pid_t (like PIDs).

These OS-level mechanisms are, as usual, legacy accidents whose purpose
is upheld by convention and folklore.  We can use session-level grouping
(setsid), or we could use process-group-level grouping (setpgid).

Vim uses setsid() if available, otherwise setpgid(0,0).

Windows
------------------------------------------------------------------------

UV_PROCESS_DETACHED on win32 sets CREATE_NEW_PROCESS_GROUP flag.
But uv_kill() does not kill the process-group:
https://github.com/nodejs/node/issues/3617

Ideas:
- Set UV_PROCESS_DETACHED (CREATE_NEW_PROCESS_GROUP), then call
  GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, pid)
   - Maybe won't work because MSDN says "Only processes that share the
     same console as the calling process receive the signal."
     https://docs.microsoft.com/en-us/windows/console/generateconsolectrlevent
     But CREATE_NEW_PROCESS_GROUP creates a new console ...
     ref https://stackoverflow.com/q/1453520
- Group processes within a "job". libuv does that *globally* for
  non-detached processes: uv__init_global_job_handle.
- Iterate through CreateToolhelp32Snapshot().
   - https://stackoverflow.com/q/1173342
   - Vim does this, see terminate_all()
2018-03-16 10:55:12 +01:00
de47515477 test: use luv.now() instead of os.time() 2018-03-16 10:55:12 +01:00
cca407b43e DirChanged: support <buffer> (#8140) 2018-03-16 07:29:20 +01:00
0093c25dd3 doc: nodejs 2018-03-15 04:59:18 +01:00
338664e96c node/provider: support g:node_host_prog #8135 2018-03-15 04:55:48 +01:00
9058a5a19a clint 2018-03-14 10:39:14 +00:00
cc58ec9a80 Update documentation
Update vim_diff.txt with :lmap differences, update documentation on
'keymap', and add tests.

The tests added are to demonstrate the behaviour specified in the
documentation of :loadkeymap.
2018-03-14 10:39:14 +00:00
3b304fc04a 'keymap' now uses :lmap instead of :lnoremap
This means that the major way that :lmap mappings are applied works as
one would expect with macros.
This also means that having a translation with 'keymap' does not
preclude using mappings in insert mode with :imap.
2018-03-14 10:39:14 +00:00
d989051220 Split :lnoremap test into done and pending
There is some behaviour that we keep with the recent changes, and some
behaviour that we change.
Instetad of having one failing test covering  all behaviour, we split
the test into two.
2018-03-14 10:39:14 +00:00
e01f35c4bb :lnoremap mappings should not be remapped when replaying a recording 2018-03-14 10:39:14 +00:00
9beaf84d2f Ensure :lmap mappings take preference
If the mental model of :lmap mappings is a translation between your
keyboard and vim proper, then they should take preference over :imap
(and other) mappings. This patch makes that happen.
2018-03-14 10:39:14 +00:00
8e71a26e19 Record :lmap transformed keys in gotchars()
The mental model of :lmap and 'keymap' is of a transformation done
before anything else. Hence when recording a macro, or writing to a
scriptfile, the transformed keys should be recorded instead of the keys
before the transformation.
2018-03-14 10:39:14 +00:00
20bfe0f2a3 Account for :lmap in macros
close #5652
Start by adding some tests
2018-03-14 10:39:14 +00:00
1aefbff641 Add some basic tests for macros 2018-03-14 10:39:14 +00:00
5ce8158a5d vim-patch:8.0.0316: :help z? does not work (#8134)
Problem:    ":help z?" does not work. (Pavol Juhas)
Solution:   Remove exception for z?.
dad7309dd2
2018-03-14 10:30:24 +01:00
f5b0f5e17f Merge pull request #8127 from jamessan/update-pvs-headers
Add missing PVS headers to new files
2018-03-11 20:17:28 -04:00
e24e98534b ci/AppVeyor: use PowerShell (#8124) 2018-03-11 23:44:07 +01:00
4e5e6506b5 pvscheck: Ignore exit code of pvs-studio-analyzer
Since its typically non-zero, the script immediately exits instead of
converting the binary log into useful formats.
2018-03-11 18:01:44 -04:00
8bd1bbcec8 Add missing PVS headers to new files 2018-03-11 17:24:09 -04:00
c7f95fde1b ci/travis: Don't destroy cache during prepare
Use `cp -r` instead of `mv`.
Remove use of `dirname`, that was missed in 10cdf8c286.

closes #5166
2018-03-11 20:29:20 +01:00
241c380da9 Merge #8117 'build/CI/MSVC/LuaRocks' 2018-03-11 19:53:05 +01:00
a2d1e9cc79 vim-patch:8.0.0262,8.0.0263 (#8123)
vim-patch:8.0.0262: Farsi support is barely tested
Problem:    Farsi support is barely tested.
Solution:   Add more tests for Farsi.  Clean up the code.
ddf662a1c8

vim-patch:8.0.0263: Farsi support is not tested enough
Problem:    Farsi support is not tested enough.
Solution:   Add more tests for Farsi.  Clean up the code.
80627cf51f
2018-03-11 19:22:58 +01:00
b0b656dd37 ci/travis: rename $BUILD_NVIM_DEPS to $CACHE_ENABLE 2018-03-11 15:38:18 +01:00
9a0147754c build: respect $DEPS_BUILD_DIR
Without this, the CI_TARGET=lint travis job cant't find the cached deps
(in $HOME/nvim-deps), nor can it update the cache.
2018-03-11 15:38:18 +01:00
45e81e03f8 ci/macOS: skip python2 on travis macOS
macOS travis builds recently started failing (travis caches were cleared
recently, maybe related). python2 is reasonably covered by linux CI. Not
going to waste time on it for macOS CI.

    ==> Installing python@2
    ==> Downloading https://homebrew.bintray.com/bottles/python@2-2.7.14_3.el_capita
    ==> Pouring python@2-2.7.14_3.el_capitan.bottle.tar.gz
    Error: The `brew link` step did not complete successfully
    The formula built, but is not symlinked into /usr/local
    Could not symlink bin/2to3-2
    Target /usr/local/bin/2to3-2
    is a symlink belonging to python. You can unlink it:
      brew unlink python
    To force the link and overwrite all conflicting files:
      brew link --overwrite python@2
    To list all files that would be deleted:
      brew link --overwrite --dry-run python@2
    Possible conflicting files are:
    /usr/local/bin/2to3-2 -> /usr/local/Cellar/python/2.7.12_1/bin/2to3-2
    /usr/local/bin/2to3-2.7 -> /usr/local/Cellar/python/2.7.12_1/bin/2to3-2.7
    /usr/local/bin/idle -> /usr/local/Cellar/python/2.7.12_1/bin/idle
    ...
2018-03-11 12:45:15 +01:00
968c7ab17e ci/travis: use ninja instead of make 2018-03-11 12:45:15 +01:00
ffad8d4c51 ci/AppVeyor: disable MSVC_32 build
The MSVC_32 currently hangs.  When MSVC becomes the primary Windows
target, we can enable MSVC_32 and retire one of the mingw builds.  In
the meantime it adds too much time.
2018-03-11 12:43:42 +01:00
de919b9b94 build/luarocks: avoid parallelism for luarocks build
Is there a race between the luarocks `make bootstrap` dependencies?

reverts f73b4911312b35bfe38ed068672a2f8ba8875ba7
ref https://github.com/luarocks/luarocks/pull/774
2018-03-11 12:43:42 +01:00
90963a9c55 build/luarocks: apply "Fix siteconfig" patch
upstream: https://github.com/luarocks/luarocks/pull/774
2018-03-11 12:43:42 +01:00
496b0f944f test: next_msg(): default timeout to 10s
Infinite timeout results in hangs which waste time. If some test needs
longer than 10s to wait for a message, it should specify the timeout
explicitly.
2018-03-11 12:43:42 +01:00
fd4021387e test: rename next_message() to next_msg() 2018-03-11 12:43:42 +01:00
d554a6c7f0 ci/AppVeyor: fix set whitespace quoting 2018-03-11 12:43:42 +01:00
2bf0869160 test: handle non-deterministic message cadence 2018-03-11 12:43:42 +01:00
9154782386 Merge pull request #8122 from jamessan/appimagev2
Create v2 AppImages and include update information
2018-03-09 22:06:57 -05:00
9dc3cc2c68 genappimage: Include update information for releases/nightlies
This will allow users to use AppImageUpdate to update their AppImage.
It requires publishing the created zsync file alongside the appimage
file for the releases.
2018-03-09 20:49:26 -05:00
e1f27cdb4c genappimage: Create a type 2 AppImage 2018-03-09 20:49:26 -05:00
b0d08998f5 genappimage: Use AppImage/AppImages repo to avoid redirects 2018-03-09 20:49:24 -05:00
d53aa0e94f vim-patch.sh: more colorful #8115 2018-03-09 00:58:12 +01:00
9cefd83cc7 Merge #8084 'build/win: support MSVC' 2018-03-08 20:26:18 +01:00
d82621877b version.c: update [ci skip] (#7999)
NA:
vim-patch:8.0.0207: leaking file descriptor when system() fails
vim-patch:8.0.1434: GTK: :promtfind does not put focus on text input
2018-03-08 20:11:30 +01:00
5ec0a6d13f vim-patch:8.0.0513: fix getting name of cleared highlight group (#8103)
Problem:    Getting name of cleared highlight group is wrong. (Matt Wozniski)
Solution:   Only skip over cleared names for completion. (closes vim/vim#1592)
            Also fix that a cleared group causes duplicate completions.
c96272e30e
2018-03-08 19:49:21 +01:00
0adf950ccf build/msvc: Fix AppVeyor build script for 'MINGW_64-gcov' configuration 2018-03-07 11:07:07 -06:00
8ba8d7244f build/msvc: Add Git as a requirement for Windows patches 2018-03-06 20:52:27 -06:00
c29a82c45f build/msvc: Make shell-test fix only apply to MSCV 2018-03-06 20:38:10 -06:00
e0d55f2871 build/msvc: Allow MSVC AppVeyor builds to fail 2018-03-05 11:01:47 -06:00
7612ba5ad9 build/msvc: Change MSBuild verbosity to normal 2018-03-05 11:00:01 -06:00
fb3667cd16 build/msvc: Remove confusing comment 2018-03-04 17:44:23 -06:00
cfb713b5c6 build/msvc: Add Appveyor CI for MSVC 2018-03-04 17:44:23 -06:00
353ca83f73 build/msvc: Workaround for compiler optimization bug 2018-03-04 17:44:23 -06:00
d7ee323326 build/msvc: Fix errors caused by compiler intrinsics 2018-03-04 17:44:23 -06:00
773f23e00d build/msvc: Make shell-test work
MSVC doesn't have unistd.h or usleep() so it was replaced with the
Sleep() WinAPI function.
2018-03-04 17:44:23 -06:00
01fc02beee build/msvc: Add missing WIN32 macro
MSVC predefines `_WIN32`, but not `WIN32`. Also, some unnecessary includes have been removed.
2018-03-04 17:44:23 -06:00
8e30598115 build/msvc: Remove pkgconfig dependency on Windows 2018-03-04 17:44:23 -06:00
1d5eec2c62 health/provider: python: warning with correct host prog (#8049)
I have `g:python3_host_prog` set to the system Python, where a package
is also installed to provide the "neovim" module.

`:checkhealth provider` however displays a warning for this:

> Your virtualenv is not set up optimally.

This is because /usr/bin/python is not in /home/user/.pyenv.

I think this warning should not get displayed if host_prog_var exists.

It goes back to the initial commit (20447ba09), and is maybe only
missing the `!` there as with the previous commit.

Full output:
```
  - INFO: pyenv: /home/user/.pyenv/libexec/pyenv
  - INFO: pyenv root: /home/user/.pyenv
  - INFO: Using: g:python3_host_prog = "/usr/bin/python"
  - WARNING: Your virtualenv is not set up optimally (/usr/bin/python is not in /home/user/.pyenv).
    - ADVICE:
      - Create a virtualenv specifically for Neovim and use `g:python3_host_prog`.  This will avoid the need to install Neovim's Python module in each virtualenv.
  - WARNING: $VIRTUAL_ENV exists but appears to be inactive. This could lead to unexpected results.
    - ADVICE:
      - If you are using Zsh, see: http://vi.stackexchange.com/a/7654
  - INFO: Executable: /usr/bin/python
  - INFO: Python3 version: 3.6.4
  - INFO: python-neovim version: 0.2.1
  - OK: Latest python-neovim is installed: 0.2.1
```
2018-03-04 20:04:52 +01:00
b615192a37 vim-patch:8.0.0220: highlight completion misses some values #8013
Problem:    Completion for :match does not show "none" and other missing
            highlight names.
Solution:   Skip over cleared entries before checking the index to be at the
            end.
15eedf1d62
2018-03-04 16:34:59 +01:00
544cef0155 vim-patch:8.0.0234,8.0.0236,8.0.0225 (#8052)
vim-patch:8.0.0234: crash when using put in Visual mode
Problem:    When several lines are visually selected and one of them is short,
            using put may cause a crash. (Axel Bender)
Solution:   Check for a short line. (Christian Brabandt)
941c12da3c

vim-patch:8.0.0236: gcc complains about uninitialized variable
Problem:    Gcc complains that a variable may be used uninitialized. Confusion
            between variable and label name. (John Marriott)
Solution:   Initialize it.  Rename end to end_lnum.
6a717f17ec

vim-patch:8.0.0225: put in Visual block mode terminates early
Problem:    When a block is visually selected and put is used on the end of
            the selection only one line is changed.
Solution:   Check for the end properly. (Christian Brabandt, neovim issue
            5781)
9957a10d0f
2018-03-04 15:53:50 +01:00
b22d3385b9 Merge pull request #8077 from bfredl/msgchar
message: don't output unprintable chars to screen
2018-03-04 09:37:30 +01:00
cee9a8ce8a message: don't output unprintable chars to screen
fixes #7586 #8070
2018-03-04 08:37:57 +01:00
a98736b9c0 scripts: fix shebang of shadacat.py [ci skip] 2018-03-04 02:52:23 +01:00
90fc7c6ad0 ci: the homebrew formula for Python 3 was renamed (#8094)
Homebrew changed a few formulae to meet their standards. "python3" was renamed
to "python", and "python2" to "python@2".

As for why, read this announcement: https://brew.sh/2018/01/19/homebrew-1.5.0

Since we install Python 3 via homebrew anyway, we now do the same for Python 2
as well. We do that because the system Python 2 of macOS comes without pip
installed and this way seems cleaner than doing "sudo easy_install pip".

The Python 2 formula is keg-only now, so it doesn't interfere with the system
Python 2. Therefore we have to add its executables to $PATH ourselves.
2018-03-04 01:11:09 +01:00
c21cf6d3cc vim-patch:8.0.1561: crash with rust syntax highligting (#8095)
Problem:    Crash with rust syntax highligting. (Edd Barrett)
Solution:   Avoid going past the end of an empty line.

069dafc1de

Closes #6248
2018-03-03 22:14:16 +01:00
9f994bb699 api: nvim_list_uis #8004
ref #7438
closes #4842
2018-03-03 15:06:24 +01:00
37b755ab47 Merge #8072 from mhinz/vim-8.0.1439
vim-patch: 8.0.1439, 8.0.1442
2018-03-03 13:09:36 +01:00
de3a833ec7 Merge branch 'master' into msvc-compat 2018-03-01 22:56:59 -06:00
adfad73d8e build/msvc: Make libtermkey depend on Unibilium 2018-03-01 22:50:02 -06:00
b3d0241416 build/msvc: Add patch for LuaRocks
LuaRocks bundles an outdated wget.exe for downloading packages on Windows. It is too old to support GitHub's TLS, so this patch will replace it with curl.
2018-03-01 22:50:02 -06:00
305673e923 build/msvc: Add patch for libvterm
The patch removes VLAs because MSVC does not support them.
2018-03-01 22:50:02 -06:00
fa6f892055 build/msvc: Add CMakeLists.txt and header for Unibilium
A header was added for compatibility with MSVC and CMakeLists.txt was
added for building with CMake.
2018-03-01 22:48:15 -06:00
3d2f4154b1 third-party: build all deps with debugging symbols (#8042)
When building with CMAKE_BUILD_TYPE=Debug, the dependencies are built like this:

| Dep        | Defaults  | Debug                                       |
|------------|-----------|---------------------------------------------|
| unibilium  | `-O2`     | `make CFLAGS=-O0 DEBUG=1`                   |
| msgpack    | `-g -O3`  | `cmake . -DCMAKE_C_FLAGS_DEBUG="-O0 -ggdb"` |
| libuv      | `-g -O2`  | `./configure CFLAGS="-O0 -ggdb"`            |
| luv        | `-g -O2`  | `cmake . -DCMAKE_C_FLAGS_DEBUG="-O0 -ggdb"` |
| libvterm   | not set   | `make CFLAGS=-O0 DEBUG=1`                   |
| libtermkey | not set   | `make CFLAGS=-O0 DEBUG=1`                   |
| jemalloc   | `-g3 -O3` | `./configure CFLAGS="-O0 -ggdb"`            |
| gperf      | `-g -O2`  | `./configure CXXFLAGS="-O0 -ggdb"`          |
| luajit     | `-g -O2`  | haven't checked yet                         |

This means that only unibilium, libtermkey, and libvterm don't build with
debugging symbols by default.

Build them with debugging symbols and optimisations that don't hinder
debugging: -Og -g
2018-03-01 10:23:21 +01:00
f2b6145d74 build/msvc: Use patched libvterm for MSVC 2018-02-28 19:38:30 -06:00
cb245a71ca build/msvc: Add MSVC compiler flag when building LuaRocks 2018-02-28 19:38:30 -06:00
3a6ee8819e build/msvc: Remove unnecessary copy command for msgpack DLL 2018-02-28 19:38:30 -06:00
0169872fd3 build/msvc: Fix linking for luajit and luv 2018-02-28 19:38:30 -06:00
9aec64c34e build/msvc: Allow building Unibilium on Windows 2018-02-28 19:38:30 -06:00
8f39e96d21 build/msvc: Remove unnecessary header include 2018-02-28 19:38:30 -06:00
60a341a05f build/msvc: Fix standard IO file number definitions
With MSVC, STDOUT_FILENO and STDERR_FILENO are defined as function calls instead of constants, meaning they can't be assigned to enum values. The enum was only used in one file, so it has been removed. A definition for STDIN_FILENO has been added that is consistent with the other two definitions.
2018-02-28 19:37:58 -06:00
2c414fbbb1 build/msvc: Fix missing restrict keyword
MSVC has the __restrict keyword and a marco is defined for it in `win_defs.h`.
2018-02-28 19:37:58 -06:00
f04b53aa24 build/msvc: Move include into unix_defs.h 2018-02-28 19:37:58 -06:00
d99f8feea3 build/msvc: Fix name of import library 2018-02-28 19:37:58 -06:00
d520e2590a build/msvc: Add mode_t typedef to win_defs.h 2018-02-28 19:37:58 -06:00
69da692b0a build/msvc: Fix preprocessor parsing
Preprocessor directives on the first line of the file were not being parsed.
2018-02-28 19:37:58 -06:00
ba87a2cde7 cscope: ignore EINTR while reading the prompt (#8079)
The following code..

    au VimEnter,DirChanged * if filereadable('.git/cscope.out') |
        \ exe 'cs add .git/cscope.out' | endif

..would lead to this issue:

    Error detected while processing VimEnter Auto commands for "*":
    cs_read_prompt EOF: Interrupted system call
    Error detected while processing VimEnter Auto commands for "*":
    E262: error reading cscope connection 0

A signal, in this case SIGCHLD, during a system call leads to errno being set
to EINTR. Ignore it.

This is merely a workaround for the time being. We don't block SIGCHLD signals,
since they're needed by libuv. The proper fix would be to rewrite if_cscope.c to
use libuv for handling processes.
2018-02-28 23:37:05 +01:00
611351677d Merge pull request #8069 from jamessan/use-luacheck-release
third-party: Use luacheck releases (0.21.2 for now) instead of master
2018-02-26 21:38:06 -05:00
e237cff0c8 vim-patch:8.0.1442: using pointer before it is set
Problem:    Using pointer before it is set.
Solution:   Search in whole buffer instead of next token.

a172b63ab8
2018-02-26 14:42:54 +01:00
81a520e60e vim-patch:8.0.1439: if cscope fails a search Vim may hang
Problem:    If cscope fails a search Vim may hang.
Solution:   Bail out when a search error is encountered. (Safouane Baroudi,
            closes vim/vim#2598)

1274d33493
2018-02-26 14:40:27 +01:00
ff8c848128 third-party: Explicitly version pin all luarocks modules 2018-02-26 08:09:00 -05:00
9938196298 third-party: Install all luarocks by name instead of URL 2018-02-25 19:02:39 -05:00
f588113191 shada: fix typo (#8066) 2018-02-25 20:14:32 +01:00
c19ff66bfd third-party: Use luacheck releases (0.21.2 for now) instead of master
Tracking master subjects us to breakages (as happened when
luacheck-scm-1.rockspec got renamed to luacheck-dev-1.rockspec) and
makes older releases unbuildable when that happens.
2018-02-25 13:11:27 -05:00
158f8b7ce3 unittest: Ignore all _Float-prefixed types (#8067)
Previously, we ignored only _Float128. But glibc 2.27 added _Float32
and _Float32x.  Rather than play whack-a-mole, ignore everything.
2018-02-25 10:23:12 +01:00
f72630b784 Merge pull request #8055 from bfredl/strictwritedelay
make 'writedelay' show all redraws when negative
2018-02-24 09:40:20 +01:00
e18177692a screen.c: make negative 'writedelay' show all redraws
Currently writedelay shows the sequence of characters that are sent to
the UI/TUI module. Here nvim has already applied an optimization: when
attempting to put a char in a screen cell, if the same char already was
there with the same attributes, UI output is disabled. When debugging
redrawing it it sometimes more useful to inspect the redraw stream one
step earlier, what region of the screen nvim actually is recomputing
from buffer contents (win_line) and from evaluating statusline
expressions.

Take the popupmenu as an example. When closing the popupmenu (in the
TUI), currently 'writedelay' looks like vim only is redrawing the region
which the pum covered. This is not what happens internally: vim redraws
the entire screen, even if only outputs the changed region.

This commit allows negative values of 'writedelay', which causes a delay
for all redrawn characters, even if the character already was displayed
by the UI before.
2018-02-24 09:10:00 +01:00
f3f1970597 Merge #8035 from justinmk/teto-fillchars-pr 2018-02-23 01:14:30 +01:00
384a39479a 'fillchars': fix defaults logic; handle ambiwidth=double #7986
Update tests.
2018-02-23 00:48:35 +01:00
0c930c2969 defaults: 'fillchars'
Most fonts should have these by now. Both are a significant visual
improvement.

- Vertical connecting bar `│` is used by tmux, pstree, Windows 7 cmd.exe
  and nvim-qt.exe.
- Middle dot `·` works on Windows 7 cmd.exe, nvim-qt.exe.

For reference: tmux uses these chars to draw lines: │ ├ ─
2018-02-23 00:48:35 +01:00
15670ca1ad Merge pull request #8050 from bfredl/stopbridge
ui_bridge: make sure TUI receives no more messages after "stop" message
2018-02-22 15:51:28 +01:00
8b05da1577 ui_bridge: make sure TUI receives no more UI events after "stop" event 2018-02-22 10:26:45 +01:00
8c8cf46c71 Merge #8044 'build: improve Lua module checks' 2018-02-22 09:38:10 +01:00
4696a5a10e health.vim: minor cleanup (#8046) 2018-02-22 02:42:08 +01:00
830b5819a0 health/provider: check Python also with loaded_var (#8047)
`g:loaded_python3_provider` gets set when the autoload file is sourced,
but this might error out, e.g. with deoplete:

    [deoplete] Failed to load python3 host. You can try to see what happened by starting nvim with $NVIM_PYTHON_LOG_FILE set and opening the generated log file. Also, the host stderr is available in messages.
    [deoplete] function remote#define#FunctionBootstrap[1]..remote#host#Require[10]..provider#pythonx#Require[13]..provider#Poll, line 14
    [deoplete] deoplete requires Python3 support("+python3").
    [deoplete] deoplete failed to load. Try the :UpdateRemotePlugins command and restart Neovim.  See also :checkhealth.

It refers to `:checkhealth` from there explicitly, which would then
(without this patch) say that Python 3 is disabled.

This patch changes the reported info to include that it might have been
disabled due to some error, and keeps on going.
2018-02-22 02:38:00 +01:00
1eb4aff57a checkhealth: python: do not report pythonx_errs twice (#8045)
They get reported unconditionally as errors below.
2018-02-22 02:37:23 +01:00
c8074e3792 runtime/autoload/health/*.vim: fix vint warning (#8048) 2018-02-22 02:30:39 +01:00
ef0a07c073 cmake/LuaHelpers.cmake: check_lua_module: use 'lua -l'
It only shortens the traceback a bit for when a module is not found
though, only removing the "(command line):1: in main chunk" (with
lua5.2).
2018-02-22 01:22:26 +01:00
8851903434 cmake/LuaHelpers.cmake: check_lua_module: display errors
This helps to figure out what the problem is, e.g. in my case I have
lua51-mpack installed to be used with luajit, but it is broken (missing
libmpack).

With this patch you get:

    -- Checking Lua interpreter /usr/bin/luajit
    /usr/bin/luajit: error loading module 'mpack' from file '/usr/lib/lua/5.1/mpack.so':
            libmpack.so.0: cannot open shared object file: No such file or directory
    stack traceback:
            [C]: at 0x55fcf0166fb0
            [C]: in function 'require'
            (command line):1: in main chunk
            [C]: at 0x55fcf01188a0
    -- [/usr/bin/luajit] The 'mpack' lua package is required for building Neovim
    -- Checking Lua interpreter /usr/bin/lua5.1
    /usr/bin/lua5.1: error loading module 'mpack' from file '/usr/lib/lua/5.1/mpack.so':
            libmpack.so.0: cannot open shared object file: No such file or directory
    stack traceback:
            [C]: ?
            [C]: in function 'require'
            (command line):1: in main chunk
            [C]: ?
    -- [/usr/bin/lua5.1] The 'mpack' lua package is required for building Neovim
    -- Checking Lua interpreter /usr/bin/lua5.2
    /usr/bin/lua5.2: (command line):1: module 'mpack' not found:
            no field package.preload['mpack']
            no file '/usr/share/lua/5.2/mpack.lua'
            no file '/usr/share/lua/5.2/mpack/init.lua'
            no file '/usr/lib/lua/5.2/mpack.lua'
            no file '/usr/lib/lua/5.2/mpack/init.lua'
            no file './mpack.lua'
            no file '/usr/lib/lua/5.2/mpack.so'
            no file '/usr/lib/lua/5.2/loadall.so'
            no file './mpack.so'
    stack traceback:
            [C]: in function 'require'
            (command line):1: in main chunk
            [C]: in ?
    -- [/usr/bin/lua5.2] The 'mpack' lua package is required for building Neovim
    -- Checking Lua interpreter /usr/bin/lua
    /usr/bin/lua: (command line):1: module 'mpack' not found:
            no field package.preload['mpack']
            no file '/usr/share/lua/5.3/mpack.lua'
            no file '/usr/share/lua/5.3/mpack/init.lua'
            no file '/usr/lib/lua/5.3/mpack.lua'
            no file '/usr/lib/lua/5.3/mpack/init.lua'
            no file './mpack.lua'
            no file './mpack/init.lua'
            no file '/usr/lib/lua/5.3/mpack.so'
            no file '/usr/lib/lua/5.3/loadall.so'
            no file './mpack.so'
    stack traceback:
            [C]: in function 'require'
            (command line):1: in main chunk
            [C]: in ?
    -- [/usr/bin/lua] The 'mpack' lua package is required for building Neovim
    CMake Error at CMakeLists.txt:459 (message):
      A suitable Lua interpreter was not found.

While this makes it more verbose for the expected error case ("module
'mpack' not found"), the behavior before this patch hides too much.
This is the old output:

    -- Checking Lua interpreter /usr/bin/luajit
    -- [/usr/bin/luajit] The 'mpack' lua package is required for building Neovim
    -- Checking Lua interpreter /usr/bin/lua5.1
    -- [/usr/bin/lua5.1] The 'mpack' lua package is required for building Neovim
    -- Checking Lua interpreter /usr/bin/lua5.2
    -- [/usr/bin/lua5.2] The 'mpack' lua package is required for building Neovim
    -- Checking Lua interpreter /usr/bin/lua
    -- [/usr/bin/lua] The 'mpack' lua package is required for building Neovim
    CMake Error at CMakeLists.txt:459 (message):
      A suitable Lua interpreter was not found.

This is for when the whole configuration runs (i.e. after `make
distclean`), afterwards only one Lua interpreter gets checked only.
2018-02-22 01:22:19 +01:00
4a8f081971 vim-patch:8.0.0225: put in Visual block mode terminates early (#8040)
Problem:    When a block is visually selected and put is used on the end of
            the selection only one line is changed.
Solution:   Check for the end properly. (Christian Brabandt, neovim issue
            5781)
9957a10d0f
2018-02-21 21:56:47 +01:00
471d6d4db5 Merge pull request #8039 from bfredl/deadscreen
remove dead code in screen.c for terminals without scroll regions
2018-02-21 20:33:33 +01:00
464ac8fe2a screen: win_del_lines/win_ins_lines cleanup 2018-02-21 19:20:23 +01:00
54c0bf6429 screen: remove dead code emulating terminals without scroll regions
This logic is now in tui/tui.c
2018-02-21 16:10:10 +01:00
ec02d9aad6 vim-patch:8.0.0222: blockwise put on multi-byte char (#8030)
Note: code change was covered by c2a1821611

Problem:    When a multi-byte character ends in a zero byte, putting blockwise
            text puts it before the character instead of after it.
Solution:   Use int instead of char for the character under the cursor.
            (Luchr, closes vim/vim#1403)  Add a test.
c81299684b
2018-02-20 21:44:37 +01:00
c57d315963 Merge pull request #8031 from bfredl/gotintstatus
jobwait: return -2 on interrupt even with timeout
2018-02-20 15:15:06 +01:00
04fdbfe17d jobwait: return -2 on interrupt also with timeout 2018-02-20 12:32:23 +01:00
6bbec71fde Merge pull request #8019 from jamessan/invalid-provider-stderr
Improve error handling and reduce duplication of providers' #Require()
2018-02-19 20:10:10 -05:00
e215b6cb85 Merge #7412 'win: enable more tests' 2018-02-20 00:13:58 +01:00
e177c186e4 vim-patch:8.0.0214 (#8010)
vim-patch:8.0.0214: leaking memory when syntax cluster id is unknown

Problem:    Leaking memory when syntax cluster id is unknown. (Coverity)
Solution:   Free the memory.

d7a96151e0
2018-02-19 23:41:25 +01:00
4b81f627c6 build/gcc: disable -Warray-bounds entirely #7923
We need to disable -Warray-bounds locally for kbtree.h, but we can't
because _Pragma("GCC diagnostic pop") is broken in GCC 5.x+.

So this commit disables -Warray-bounds entirely (for GCC only).

GCC bug:
"_Pragma diagnostic 'ignored' in macro with strict-overflow not
suppressing warning fully with -Werror"
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66099

ref https://github.com/neovim/neovim/pull/7083#issuecomment-326323599
closes #7921
2018-02-19 22:14:34 +01:00
06b7561e78 build: remove contents of build/runtime/doc/* surgically (#8024)
Only remove the directory contents. If the directory itself is removed,
then `sudo make install` creates a root-owned …/doc/ directory. That
breaks the next non-root build.

This was an accident of 0b1904d835.

Note: the following does not work, because it misses renamed help files
(which would no longer be in the build-tree definition)

    COMMAND ${CMAKE_COMMAND} -E remove ${BUILDDOCFILES} ${GENERATED_HELP_TAGS}
2018-02-19 21:10:16 +01:00
7fa69fb288 Resolve issues mentioned in PR review 2018-02-19 07:10:47 -05:00
795da343bb test: win: emulate yes with for loop 2018-02-19 07:10:46 -05:00
07dfe0f5ea test: win: enable ui/wildmode_spec.lua 2018-02-19 07:10:46 -05:00
8dcfd58e2c test: win: enable termclose_spec.lua 2018-02-19 07:10:46 -05:00
d80bf3c656 test: enable ex_cmds/cd_spec.lua on Windows 2018-02-19 07:10:46 -05:00
df99ab461e test: enable legacy/fixeol_spec in Windows
Try nvim's delete() for cross-platform file remove in Windows
2018-02-19 07:10:45 -05:00
55ce6bfffb test: enable ex_cmds/write_spec.lua in Windows 2018-02-19 07:10:45 -05:00
6beb7ee77a win: enable legacy test 051 2018-02-19 07:10:44 -05:00
f1e6828b7b win: enable legacy test 059 2018-02-19 07:10:44 -05:00
2943056f75 win: enable legacy test 107 2018-02-19 07:10:44 -05:00
44dc8b4753 win: enable legacy test 093 2018-02-19 07:10:43 -05:00
10fbae086a win: enable legacy/arglist_spec.lua 2018-02-19 07:10:43 -05:00
18a53b6502 win: enable legacy test 30 2018-02-19 07:10:43 -05:00
c5a7f451ce win: enable legacy/getcwd_spec.lua 2018-02-19 07:10:43 -05:00
3c0cc9c2fb win: enable legacy/wordcount_spec.lua 2018-02-19 07:10:43 -05:00
e55de56a99 win: enable legacy/packadd_spec.lua 2018-02-19 07:10:42 -05:00
f4d82c1438 win: enable legacy test 011 2018-02-19 07:10:42 -05:00
4f65cd7c0a win: enable legacy/delete_spec.lua 2018-02-19 07:10:42 -05:00
bde32edefe win: enable legacy test 097 2018-02-19 07:10:42 -05:00
0fd899aa07 win: enable legacy test 025 2018-02-19 07:10:41 -05:00
3e19e18f4c win: enable job tests that use jobstart only
- echo "" does not hang in powershell
    - cmd.exe's echo command does not hang.
    - job tests default to powershell (WHY?)
- wait 5 seconds for powershell to create an empty file
    - powershell is slow
    - cannot reliably validate the id returned by jobstart via jobpid, jobstop
    - if using cmd.exe, waiting for a second should be enough
- remaining job tests are unreliable in Windows because any build can pass/fail
  for same conditions without changes, especially if the error is in stderr
2018-02-19 07:10:41 -05:00
00665d3c70 vim-patch:8.0.1493: completion items cannot be annotated (#8003)
Problem:    Completion items cannot be annotated.
Solution:   Add a "user_data" entry to the completion item. (Ben Jackson,
            coses vim/vim#2608, closes vim/vim#2508)

9b56a57cda
2018-02-18 23:56:59 +01:00
eccd60aaf4 runtime/doc: modeline is mandatory in help docs
see Vim 8.0.0650 e9134421ab
2018-02-18 22:17:47 +01:00
44071fe77a vim-patch:8.0.0212: buffer for key name may be too small (#8009)
Problem:    The buffer used to store a key name theoreticaly could be too
            small. (Coverity)
Solution:   Count all possible modifier characters.  Add a check for the
            length just in case.

423977d3ce
2018-02-18 21:55:39 +01:00
71e89cec23 Merge #8018 from justinmk/test-eq_any 2018-02-18 19:59:06 +01:00
7973847d02 test/util: remove eq_any()
It was added in the parent commit, but ended up not being used. And
I can't think of a case where it will be used: instead we would probably
want to generalize expect_msg_seq() if necessary.
2018-02-18 19:22:44 +01:00
e72ecdb7ca test/util: expect_msg_seq()
job_spec.lua on AppVeyor (Windows) often fails like this:

      FAILED  ] C:/projects/neovim/test/functional\core\job_spec.lua @ 72: jobs changes to given `cwd` directory
    C:/projects/neovim/test/functional\core\job_spec.lua:81: Expected objects to be the same.
    Passed in:
    (table) {
      [1] = 'notification'
      [2] = 'stdout'
     *[3] = {
        [1] = 0
       *[2] = {
          [1] = 'C:\projects\neovim\Xtest-tmpdir\nvimmSjq1S\0' } } }
    Expected:
    (table) {
      [1] = 'notification'
      [2] = 'stdout'
     *[3] = {
        [1] = 0
       *[2] = {
          [1] = 'C:\projects\neovim\Xtest-tmpdir\nvimmSjq1S\0'
         *[2] = '' } } }
    stack traceback:

Message chunking is non-deterministic, so we need to try different
variants.
2018-02-18 19:19:03 +01:00
8b543d09d8 Merge pull request #8011 from nimitbhardwaj/vim-8.0.0649
vim-patch:8.0.0649 and vim-patch:8.0.0650
2018-02-17 12:09:44 +01:00
2f018b1833 third-party: upgrade libunibilium from 1.2.1 to 2.0.0 (#8016)
❯ git log --oneline v2.0.0...v1.2.1
e3b16d6 (HEAD -> master, tag: v2.0.0, origin/master, origin/HEAD) version 2.0.0
6f0037b (origin/wide-int) update README with build instructions / prerequisites
f40c97a explicitly mention the new "wide integer" format in the man pages
37aa305 use ncurses*-config to get TERMINFO_DIRS if possible
2461ee1 use perl instead of sed hackery to create unibilium.pc
23e9dea don't cast between pointer types of different alignments
1b5b8fd add basic test for wide format
cfe4216 add xterm-256color; regenerate static tests from ncurses 6.1
6e55e75 escape backslashes properly
42f3cdd add 32 bit number support (wide terminfo format)
73385ba unibi-dump: accept a filename as argument
ec9ef0a don't pass NULL to memcpy
b42315b (origin/typecheck) make unibi_var_t slightly more type-safe
2018-02-17 00:35:39 +01:00
3af3515e74 Add provider#Poll() to handle starting and polling the provider 2018-02-16 14:08:12 -05:00
6fbb8d6739 provider: Safely access job.stderr in #Require
If `jobstart()` fails, then the subsequent `rpcrequest()` will throw due
to an invalid channel id.  This causes `job.stderr` not to exist, so we
throw another exception when trying to dump the job's stderr.

    Error detected while processing function remote#define#AutocmdBootstrap[1]..remote#host#Require[10]..provider#pythonx#Require:
    line 22:
    E716: Key not present in Dictionary: stderr

This obfuscates the actual problem.
2018-02-16 13:33:23 -05:00
48dc1f3f90 provider: ruby: Use stderr_buffered to collect stderr 2018-02-16 13:33:07 -05:00
e9134421ab vim-patch-8.0.0649 and vim-patch-8.0.0650: autocmd open help 2 times 2018-02-17 00:02:16 +05:30
09b51bbf87 vim-patch:8.0.0323: one second pause when running cmdline test (#8015)
Problem:    When running the command line tests there is a one second wait.
Solution:   Change an Esc to Ctrl-C. (Yegappan Lakshmanan)

31eb139b88
2018-02-16 12:04:06 +01:00
77286915a8 Merge pull request #8008 from bfredl/arrayfree
ex_getln: clear cmdline_block after it's freed
2018-02-14 19:23:11 +01:00
d9497053e8 ex_getln: clear cmdline_block after it's freed 2018-02-14 19:20:28 +01:00
674cb2afde cmake/GetCompileFlags: remove duplicate include dirs
Reduces noise in :version message.
2018-02-14 09:57:58 +01:00
0daa45bd44 Merge pull request #7759 from bfredl/ext_options
ui: refactor external widget options
2018-02-13 21:57:15 +01:00
6e5cb0debd ui: refactor ui options 2018-02-13 20:48:51 +01:00
0f1bc5ddce test/python: less-noisy Python skip-message
Developer can use :checkhealth to get more details, don't need to blast
the details in the skip-message every time.
2018-02-12 13:24:48 +01:00
9e9e4431c1 Merge #8001 from justinmk/vimpatches 2018-02-12 02:59:29 +01:00
7da4d1561b lint 2018-02-12 01:32:52 +01:00
418947fcb3 Merge #7966 'vim-patch:8.0.0470,8.0.0471' 2018-02-12 00:55:56 +01:00
c68d89521f vim-patch:8.0.1271: still too many old style tests
Problem:    Still too many old style tests.
Solution:   Convert a few more tests to new style. (Yegappan Lakshmanan,
            closes vim/vim#2290)

fb094e14c1
2018-02-12 00:48:30 +01:00
6bcee20806 vim-patch:8.0.0490: vertical split makes 'winfixwidth' window smaller (#7990)
Problem:    Splitting a 'winfixwidth' window vertically makes it one column
            smaller. (Dominique Pelle)
Solution:   Add one to the width for the separator.
38e3483637
2018-02-12 00:00:24 +01:00
5191f963bf test/old: skip encoding=latin1 test 2018-02-11 23:53:05 +01:00
ef39f854d7 vim-patch:8.0.1302: still too many old style tests
Problem:    Still too many old style tests.
Solution:   Convert a few more tests to new style. (Yegappan Lakshmanan,
            closes vim/vim#2326)

209d3874c1
2018-02-11 23:30:18 +01:00
04993f220a vim-patch:8.0.1205: it is possible to unload a changed buffer
Problem:    Using "1q" it is possible to unload a changed buffer. (Rick Howe)
Solution:   Check the right window for changes.

ff930cad8a
2018-02-11 22:50:54 +01:00
2929dbf223 vim-patch:8.0.0858: can exit while a terminal is still running a job
Problem:    Can exit while a terminal is still running a job.
Solution:   Consider a buffer with a running job like a changed file.

eb44a68b42
2018-02-11 22:40:12 +01:00
3ffeceb851 vim-patch:8.0.1226: edit and popup tests failing
Problem:    Edit and popup tests failing.
Solution:   Make the tests pass.

2a45d64d0a
2018-02-11 22:40:12 +01:00
43631675d8 vim-patch:8.0.1333: some tests are run twice
Problem:    Some tests are run twice.
Solution:   Invoked most utf8 tests only from test_alot_utf8. (Yegappan
            Lakshmanan, closes vim/vim#2369)

2c997d7603
2018-02-11 22:40:12 +01:00
aaff91d925 vim-patch:8.0.0311: linebreak tests are old style
Problem:    Linebreak tests are old style.
Solution:   Turn the tests into new style. Share utility functions. (Ozaki
            Kiichi, closes vim/vim#1444)

544d3bc9f0
2018-02-11 22:40:12 +01:00
85e240c045 vim-patch:26a280c47a1c
Fix duplication of patch.

26a280c47a
2018-02-11 22:40:12 +01:00
67e3b1e0c5 vim-patch:8.0.0699: checksum tests are not actually run
Problem:    Checksum tests are not actually run.
Solution:   Add the tests to the list. (Dominique Pelle, closes vim/vim#1819)

710b4a1646
2018-02-11 20:15:44 +01:00
e3cfe7853d vim-patch:8.0.0684: old style tests are not nice
Problem:    Old style tests are not nice.
Solution:   Turn two tests into new style. (pschuh, closes vim/vim#1797)

28b238225a
2018-02-11 20:15:44 +01:00
1257b04747 vim-patch:8.0.0446: the ";" command does not work after some characters
Problem:    The ";" command does not work after characters with a lower byte
            that is NUL.
Solution:   Properly check for not having a previous character. (Hirohito
            Higashi)

454709baff
2018-02-11 20:15:44 +01:00
ff4a628081 test/old: restore test_alot_utf8.vim
Needed for later Vim patches.
Stub test_alot_latin.vim to avoid merge-conflict noise.

vim-patch:7.4.1700
vim-patch:7.4.1734
vim-patch:7.4.1740
vim-patch:7.4.2086
vim-patch:7.4.2223
vim-patch:8.0.0250
2018-02-11 20:15:43 +01:00
f389196a34 Merge #7960 'vim patches' 2018-02-11 19:59:37 +01:00
f26a4d484b lint 2018-02-11 19:03:29 +01:00
22173a64dd vim-patch:8.0.0479: remote_peek() is not tested
Problem:    remote_peek() is not tested.
Solution:   Add a test.

6caf606b14
2018-02-11 19:03:29 +01:00
fda2b1e906 vim-patch:8.0.0295: test_viml hangs
Problem:    test_viml hangs.
Solution:   Put resetting 'more' before sourcing the script.

7a073549a3
2018-02-11 19:03:29 +01:00
7a91177bc9 vim-patch:8.0.0293: some tests have a one or three second wait
Problem:    Some tests have a one or three second wait.
Solution:   Reset the 'showmode' option.  Use a test time of one to disable
            sleep after an error or warning message.

e5f2a075e3
2018-02-11 19:03:29 +01:00
840a2bb67d vim-patch:8.0.1370: channel test for callback is flaky
Problem:    Channel test for callback is flaky.
Solution:   Add the test to thelist of flaky tests.

1eca6f13d6
2018-02-11 19:03:28 +01:00
bef505c158 vim-patch:8.0.1365: when one channel test fails others fail as well
Problem:    When one channel test fails others fail as well.
Solution:   Stop the job after a failure.  Also add a couple of tests to the
            list of flaky tests.

24820691e6
2018-02-11 19:03:28 +01:00
44f275d518 vim-patch:8.0.1329: when a flaky test fails it also often fails the second time
Problem:    When a flaky test fails it also often fails the second time.
Solution:   Sleep a couple of seconds before the second try.

5505860152
2018-02-11 19:03:28 +01:00
1be0107168 vim-patch:8.0.0480: the remote_peek() test fails on MS-Windows
Problem:    The remote_peek() test fails on MS-Windows.
Solution:   Check for pending messages. Also report errors in the first run if
            a flaky test fails twice.

15e737f768
2018-02-11 19:03:28 +01:00
bcd8541863 vim-patch:7.4.1477
Problem:    Test_reltime is flaky, it depends on timing.
Solution:   When it fails run it a second time.

b5760a1ce5
2018-02-11 19:03:28 +01:00
8dd63dbe31 vim-patch:8.0.1262: terminal redir test is flaky
Problem:    Terminal redir test is flaky.
Solution:   Add it to the list of flaky tests.

7dd88c5133
2018-02-11 19:03:28 +01:00
e4952ee006 vim-patch:8.0.1219: terminal test is flaky
Problem:    Terminal test is flaky.
Solution:   Add test function to list of flaky tests.

f204e05ae9
2018-02-11 19:03:28 +01:00
f69e0d314f vim-patch:8.0.0975: using freed memory when setting 'backspace'
Problem:    Using freed memory when setting 'backspace'.
Solution:   When changing oldval also change origval.

edbc0d46cf
2018-02-11 19:03:28 +01:00
82a9051857 vim-patch:8.0.1188: autocmd test fails on MS-Windows
Problem:    Autocmd test fails on MS-Windows.
Solution:   Give the buffer a name and find the buffer to be wiped out by
            name.

1d68d9b2bd
2018-02-11 19:03:28 +01:00
5c05cd43cb test/old: skip test for unsupported 'cpoptions' flag 2018-02-11 19:03:28 +01:00
9bf9cc69c1 test/arglist_spec: update to Vim 8.0.0721 behavior 2018-02-11 19:03:28 +01:00
163b2b241b vim-patch:8.0.1200: tests switch the bell off twice
Problem:    Tests switch the bell off twice.
Solution:   Don't set 'belloff' in individual tests. (Christian Brabandt)

67418d97b4
2018-02-11 19:03:28 +01:00
66f5e5c7d7 test/old: TODO: skip Test_BufLeave_Wipe()
This test exposes a bug (present on current master).

Steps to reproduce:

  CC=clang make CMAKE_BUILD_TYPE=Debug CMAKE_EXTRA_FLAGS="-DCLANG_ASAN_UBSAN=ON"
  export ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-5.0/bin/llvm-symbolizer
  TEST_FILE=test_autocmd.res make oldtest

==3668==ERROR: AddressSanitizer: heap-use-after-free on address 0x6260001411c8 at pc 0x000000a38a47 bp 0x7fff9982ee50 sp 0x7fff9982ee48
READ of size 4 at 0x6260001411c8 thread T0
    0 0xa38a46 in _typval_encode_nothing_convert_one_value /home/vagrant/neovim/build/../src/nvim/eval/typval_encode.c.h:320:15
    1 0xa340d5 in encode_vim_to_nothing /home/vagrant/neovim/build/../src/nvim/eval/typval_encode.c.h:830:9
    2 0xa0ad63 in tv_clear /home/vagrant/neovim/build/../src/nvim/eval/typval.c:2189:25
    3 0x85d584 in vars_clear_ext /home/vagrant/neovim/build/../src/nvim/eval.c:18894:9
    4 0x7efac9 in vars_clear /home/vagrant/neovim/build/../src/nvim/eval.c:18871:3
    5 0x7ef471 in eval_clear /home/vagrant/neovim/build/../src/nvim/eval.c:638:3
    6 0xf80a7c in free_all_mem /home/vagrant/neovim/build/../src/nvim/memory.c:676:3
    7 0x12789dc in mch_exit /home/vagrant/neovim/build/../src/nvim/os_unix.c:152:3
    8 0xe85039 in getout /home/vagrant/neovim/build/../src/nvim/main.c:671:3
    9 0xbb4496 in ex_quit_all /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:6051:5
    10 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    11 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    12 0x845302 in call_user_func /home/vagrant/neovim/build/../src/nvim/eval.c:21332:3
    13 0x81097b in call_func /home/vagrant/neovim/build/../src/nvim/eval.c:6358:11
    14 0x825778 in get_func_tv /home/vagrant/neovim/build/../src/nvim/eval.c:6120:11
    15 0x81e361 in ex_call /home/vagrant/neovim/build/../src/nvim/eval.c:2735:9
    16 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    17 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    18 0xb17fdd in do_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2973:3
    19 0xb14630 in cmd_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2718:14
    20 0xb14727 in ex_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2699:3
    21 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    22 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    23 0xb34015 in do_cmdline_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:280:10
    24 0xe829d3 in exe_commands /home/vagrant/neovim/build/../src/nvim/main.c:1702:5
    25 0xe708bd in main /home/vagrant/neovim/build/../src/nvim/main.c:524:5
    26 0x7f0cd5b7e82f in __libc_start_main /build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:291
    27 0x44d628 in _start (/home/vagrant/neovim/build/bin/nvim+0x44d628)

0x6260001411c8 is located 200 bytes inside of 10256-byte region [0x626000141100,0x626000143910)
freed by thread T0 here:
    0 0x50df60 in __interceptor_cfree.localalias.0 (/home/vagrant/neovim/build/bin/nvim+0x50df60)
    1 0xf7dbe4 in xfree /home/vagrant/neovim/build/../src/nvim/memory.c:133:3
    2 0x676577 in free_buffer /home/vagrant/neovim/build/../src/nvim/buffer.c:749:5
    3 0x66e15b in close_buffer /home/vagrant/neovim/build/../src/nvim/buffer.c:590:5
    4 0x67a835 in do_buffer /home/vagrant/neovim/build/../src/nvim/buffer.c:1216:9
    5 0x681a1d in do_bufdel /home/vagrant/neovim/build/../src/nvim/buffer.c:945:16
    6 0xb9cd72 in ex_bunload /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:4585:17
    7 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    8 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    9 0x845302 in call_user_func /home/vagrant/neovim/build/../src/nvim/eval.c:21332:3
    10 0x81097b in call_func /home/vagrant/neovim/build/../src/nvim/eval.c:6358:11
    11 0x825778 in get_func_tv /home/vagrant/neovim/build/../src/nvim/eval.c:6120:11
    12 0x81e361 in ex_call /home/vagrant/neovim/build/../src/nvim/eval.c:2735:9
    13 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    14 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    15 0x8646b1 in ex_execute /home/vagrant/neovim/build/../src/nvim/eval.c:19478:7
    16 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    17 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    18 0x845302 in call_user_func /home/vagrant/neovim/build/../src/nvim/eval.c:21332:3
    19 0x81097b in call_func /home/vagrant/neovim/build/../src/nvim/eval.c:6358:11
    20 0x825778 in get_func_tv /home/vagrant/neovim/build/../src/nvim/eval.c:6120:11
    21 0x81e361 in ex_call /home/vagrant/neovim/build/../src/nvim/eval.c:2735:9
    22 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    23 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    24 0xb17fdd in do_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2973:3
    25 0xb14630 in cmd_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2718:14
    26 0xb14727 in ex_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2699:3
    27 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    28 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    29 0xb34015 in do_cmdline_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:280:10

previously allocated by thread T0 here:
    0 0x50e340 in calloc (/home/vagrant/neovim/build/bin/nvim+0x50e340)
    1 0xf7dc97 in xcalloc /home/vagrant/neovim/build/../src/nvim/memory.c:147:15
    2 0x67eb65 in buflist_new /home/vagrant/neovim/build/../src/nvim/buffer.c:1641:11
    3 0xa8fdcc in do_ecmd /home/vagrant/neovim/build/../src/nvim/ex_cmds.c:2221:13
    4 0x683b21 in empty_curbuf /home/vagrant/neovim/build/../src/nvim/buffer.c:1031:12
    5 0x67a098 in do_buffer /home/vagrant/neovim/build/../src/nvim/buffer.c:1196:14
    6 0x68173f in do_bufdel /home/vagrant/neovim/build/../src/nvim/buffer.c:927:11
    7 0xb9cd72 in ex_bunload /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:4585:17
    8 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    9 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    10 0x845302 in call_user_func /home/vagrant/neovim/build/../src/nvim/eval.c:21332:3
    11 0x81097b in call_func /home/vagrant/neovim/build/../src/nvim/eval.c:6358:11
    12 0x825778 in get_func_tv /home/vagrant/neovim/build/../src/nvim/eval.c:6120:11
    13 0x81e361 in ex_call /home/vagrant/neovim/build/../src/nvim/eval.c:2735:9
    14 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    15 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    16 0x8646b1 in ex_execute /home/vagrant/neovim/build/../src/nvim/eval.c:19478:7
    17 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    18 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    19 0x845302 in call_user_func /home/vagrant/neovim/build/../src/nvim/eval.c:21332:3
    20 0x81097b in call_func /home/vagrant/neovim/build/../src/nvim/eval.c:6358:11
    21 0x825778 in get_func_tv /home/vagrant/neovim/build/../src/nvim/eval.c:6120:11
    22 0x81e361 in ex_call /home/vagrant/neovim/build/../src/nvim/eval.c:2735:9
    23 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    24 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    25 0xb17fdd in do_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2973:3
    26 0xb14630 in cmd_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2718:14
    27 0xb14727 in ex_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2699:3
    28 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    29 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20

SUMMARY: AddressSanitizer: heap-use-after-free /home/vagrant/neovim/build/../src/nvim/eval/typval_encode.c.h:320:15 in _typval_encode_nothing_convert_one_va
lue
Shadow bytes around the buggy address:
  0x0c4c800201e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4c800201f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4c80020200: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4c80020210: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4c80020220: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x0c4c80020230: fd fd fd fd fd fd fd fd fd[fd]fd fd fd fd fd fd
  0x0c4c80020240: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c4c80020250: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c4c80020260: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c4c80020270: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c4c80020280: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==3668==ABORTING
2018-02-11 19:03:27 +01:00
9af9ea6099 test/old: TODO: skip Test_virtual_replace()
This test exposes a bug (present on current master) in ins_char_bytes()
or somewhere earlier.

Steps to reproduce:

    inoremap <C-D> <Del>
    enew!
    exe "normal a\nabcdefghi\njk\tlmn\n    opq  rst\n\<C-D>uvwxyz"
    call cursor(1,1)
    exe "normal gR0\<C-D> 1\nA\nBCDEFGHIJ\n\tKL\nMNO\nPQR"

or run `TEST_FILE=test_visual.res make oldtest`.

Executing Test_virtual_replace()
2 buffers wiped out=================================================================
==31341==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000c4f34 at pc 0x0000004f7971 bp 0x7ffdf87bb190 sp 0x7ffdf87ba940
WRITE of size 1 at 0x6020000c4f34 thread T0
    0 0x4f7970 in __asan_memmove (/home/vagrant/neovim/build/bin/nvim+0x4f7970)
    1 0xfde7a3 in ins_char_bytes /home/vagrant/neovim/build/../src/nvim/misc1.c:1488:3
    2 0xfdef41 in ins_char /home/vagrant/neovim/build/../src/nvim/misc1.c:1403:3
    3 0x79dd03 in insertchar /home/vagrant/neovim/build/../src/nvim/edit.c:5285:7
    4 0x7be70f in insert_special /home/vagrant/neovim/build/../src/nvim/edit.c:5071:5
    5 0x7bd94a in insert_handle_key /home/vagrant/neovim/build/../src/nvim/edit.c:1229:7
    6 0x76df14 in insert_execute /home/vagrant/neovim/build/../src/nvim/edit.c:764:10
    7 0x173cda9 in state_enter /home/vagrant/neovim/build/../src/nvim/state.c:67:26
    8 0x77601d in insert_enter /home/vagrant/neovim/build/../src/nvim/edit.c:458:5
    9 0x76986e in edit /home/vagrant/neovim/build/../src/nvim/edit.c:1327:3
    10 0x1118661 in invoke_edit /home/vagrant/neovim/build/../src/nvim/normal.c:7591:7
    11 0x10e60bc in nv_Replace /home/vagrant/neovim/build/../src/nvim/normal.c:6070:7
    12 0x10f235d in nv_g_cmd /home/vagrant/neovim/build/../src/nvim/normal.c:6541:5
    13 0x10c0eaa in normal_execute /home/vagrant/neovim/build/../src/nvim/normal.c:1136:3
    14 0x10b8444 in normal_cmd /home/vagrant/neovim/build/../src/nvim/normal.c:7995:9
    15 0xb80982 in exec_normal /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:8197:5
    16 0xb8065b in exec_normal_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:8180:3
    17 0xbb08df in ex_normal /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:8098:7
    18 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    19 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    20 0x8646b1 in ex_execute /home/vagrant/neovim/build/../src/nvim/eval.c:19478:7
    21 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    22 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    23 0x845302 in call_user_func /home/vagrant/neovim/build/../src/nvim/eval.c:21332:3
    24 0x81097b in call_func /home/vagrant/neovim/build/../src/nvim/eval.c:6358:11
    25 0x825778 in get_func_tv /home/vagrant/neovim/build/../src/nvim/eval.c:6120:11
    26 0x81e361 in ex_call /home/vagrant/neovim/build/../src/nvim/eval.c:2735:9
    27 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    28 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    29 0x8646b1 in ex_execute /home/vagrant/neovim/build/../src/nvim/eval.c:19478:7
    30 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    31 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    32 0x845302 in call_user_func /home/vagrant/neovim/build/../src/nvim/eval.c:21332:3
    33 0x81097b in call_func /home/vagrant/neovim/build/../src/nvim/eval.c:6358:11
    34 0x825778 in get_func_tv /home/vagrant/neovim/build/../src/nvim/eval.c:6120:11
    35 0x81e361 in ex_call /home/vagrant/neovim/build/../src/nvim/eval.c:2735:9
    36 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    37 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    38 0xb17fdd in do_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2973:3
    39 0xb14630 in cmd_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2718:14
    40 0xb14727 in ex_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2699:3
    41 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    42 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    43 0xb34015 in do_cmdline_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:280:10
    44 0xe829d3 in exe_commands /home/vagrant/neovim/build/../src/nvim/main.c:1702:5
    45 0xe708bd in main /home/vagrant/neovim/build/../src/nvim/main.c:524:5
    46 0x7f0012a7782f in __libc_start_main /build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:291
    47 0x44d628 in _start (/home/vagrant/neovim/build/bin/nvim+0x44d628)

0x6020000c4f34 is located 0 bytes to the right of 4-byte region [0x6020000c4f30,0x6020000c4f34)
allocated by thread T0 here:
    0 0x50e128 in malloc (/home/vagrant/neovim/build/bin/nvim+0x50e128)
    1 0xf7d871 in try_malloc /home/vagrant/neovim/build/../src/nvim/memory.c:87:15
    2 0xf7da99 in xmalloc /home/vagrant/neovim/build/../src/nvim/memory.c:121:15
    3 0xfde3c7 in ins_char_bytes /home/vagrant/neovim/build/../src/nvim/misc1.c:1473:18
    4 0xfdef41 in ins_char /home/vagrant/neovim/build/../src/nvim/misc1.c:1403:3
    5 0x79dd03 in insertchar /home/vagrant/neovim/build/../src/nvim/edit.c:5285:7
    6 0x7be70f in insert_special /home/vagrant/neovim/build/../src/nvim/edit.c:5071:5
    7 0x7bd94a in insert_handle_key /home/vagrant/neovim/build/../src/nvim/edit.c:1229:7
    8 0x76df14 in insert_execute /home/vagrant/neovim/build/../src/nvim/edit.c:764:10
    9 0x173cda9 in state_enter /home/vagrant/neovim/build/../src/nvim/state.c:67:26
    10 0x77601d in insert_enter /home/vagrant/neovim/build/../src/nvim/edit.c:458:5
    11 0x76986e in edit /home/vagrant/neovim/build/../src/nvim/edit.c:1327:3
    12 0x1118661 in invoke_edit /home/vagrant/neovim/build/../src/nvim/normal.c:7591:7
    13 0x10e60bc in nv_Replace /home/vagrant/neovim/build/../src/nvim/normal.c:6070:7
    14 0x10f235d in nv_g_cmd /home/vagrant/neovim/build/../src/nvim/normal.c:6541:5
    15 0x10c0eaa in normal_execute /home/vagrant/neovim/build/../src/nvim/normal.c:1136:3
    16 0x10b8444 in normal_cmd /home/vagrant/neovim/build/../src/nvim/normal.c:7995:9
    17 0xb80982 in exec_normal /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:8197:5
    18 0xb8065b in exec_normal_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:8180:3
    19 0xbb08df in ex_normal /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:8098:7
    20 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    21 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    22 0x8646b1 in ex_execute /home/vagrant/neovim/build/../src/nvim/eval.c:19478:7
    23 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
    24 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
    25 0x845302 in call_user_func /home/vagrant/neovim/build/../src/nvim/eval.c:21332:3
    26 0x81097b in call_func /home/vagrant/neovim/build/../src/nvim/eval.c:6358:11
    27 0x825778 in get_func_tv /home/vagrant/neovim/build/../src/nvim/eval.c:6120:11
    28 0x81e361 in ex_call /home/vagrant/neovim/build/../src/nvim/eval.c:2735:9
    29 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5

SUMMARY: AddressSanitizer: heap-buffer-overflow (/home/vagrant/neovim/build/bin/nvim+0x4f7970) in __asan_memmove
Shadow bytes around the buggy address:
  0x0c0480010990: fa fa fd fa fa fa fd fa fa fa 00 fa fa fa 01 fa
  0x0c04800109a0: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fa
  0x0c04800109b0: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fa
  0x0c04800109c0: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fa
  0x0c04800109d0: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fa
=>0x0c04800109e0: fa fa 05 fa fa fa[04]fa fa fa fa fa fa fa fa fa
  0x0c04800109f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c0480010a00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c0480010a10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c0480010a20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c0480010a30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==31341==ABORTING
2018-02-11 19:03:27 +01:00
d285d6ca0d vim-patch:8.0.1223: crash when using autocomplete and tab pages
Problem:    Crash when using autocomplete and tab pages.
Solution:   Check if the current tab changed. (Christian Brabandt, closes
            vim/vim#2239)

9ad89c6c4f
2018-02-11 19:03:27 +01:00
abed6a0b1a vim-patch:8.0.1475: invalid memory access in read_redo()
Problem:    Invalid memory access in read_redo(). (gy741)
Solution:   Convert the replacement character back from a negative number to
            CR or NL. (hint by Dominique Pelle, closes vim/vim#2616)

f12519dec8
2018-02-11 19:03:27 +01:00
4b7f7be301 test: port Test_edit_08() to Lua test
Test_edit_08() depends on special-case handling in has_compl_option()
and redrawing() which are in Vim but are not wanted in Nvim. Using a Lua
test instead of depending on workarounds in the core to make the VimL
test work.
2018-02-11 19:03:27 +01:00
9b6ed6c71c vim-patch:8.0.1224: still interference between test functions
Problem:    Still interference between test functions.
Solution:   Clear autocommands. Wipe all buffers.  Fix tests that depend on a
            specific start context.

cf1ba35fc2
2018-02-11 19:03:27 +01:00
348193f49c vim-patch:8.0.1222: test functions interfere with each other
Problem:    Test functions interfere with each other.
Solution:   Cleanup tab pages, windows and buffers.  Reset option.

ce11de87e2
2018-02-11 19:03:27 +01:00
48af5991b9 vim-patch:8.0.1007: no test for filetype detection for scripts
Problem:    No test for filetype detection for scripts.
Solution:   Add a first test file script filetype detection.

cbe6944956
2018-02-11 19:03:27 +01:00
e15f2b4b96 vim-patch:8.0.0906: don't recognize Couchbase files
Problem:    Don't recognize Couchbase files.
Solution:   Add filetype detection. (Eugene Ciurana, closes vim/vim#1951)

d9bc8a801a
2018-02-11 19:03:27 +01:00
6ab9e87599 vim-patch:8.0.0895: filetype test fails on MS-Windows
Problem:    Filetype test fails on MS-Windows.
Solution:   Fix file names.

8ab3c1dc6b
2018-02-11 19:03:27 +01:00
9c14a78afd test/oldtest: account for Nvim man.vim handling 2018-02-11 19:03:26 +01:00
9baf60c617 vim-patch:8.0.0894: there is no test for runtime filetype detection
Problem:    There is no test for runtime filetype detection.
Solution:   Test a list of filetypes from patterns.

0a0217abfa
2018-02-11 19:03:26 +01:00
16a4168364 vim-patch:8.0.0613: the conf filetype is used before ftdetect from packages
Problem:    The conf filetype detection is done before ftdetect scripts from
            packages that are added later.
Solution:   Add the FALLBACK argument to :setfiletype. (closes vim/vim#1679,
            closes vim/vim#1693)

3e54569b17
2018-02-11 19:03:26 +01:00
a1ee06a099 test/oldtest: restore test_autochdir.vim
We have a ported Lua version, but we should also keep the Vim version
around to make merging easier.
2018-02-11 15:29:19 +01:00
cebf31cf70 vim-patch:8.0.1210: CTRL-G and CTRL-T are ignored with typeahead
Problem:    When typing a search pattern CTRL-G and CTRL-T are ignored when
            there is typeahead.
Solution:   Don't pass SEARCH_PEEK and don't call char_avail(). (haya14busa,
            closes vim/vim#2233)

f8e8c0643b
2018-02-11 15:29:19 +01:00
2de447b60c vim-patch:8.0.1221: still too many old style tests
Problem:    Still too many old style tests.
Solution:   Convert a few more tests to new style. (Yegappan Lakshmanan,
            closes vim/vim#2256)

15993ce921
2018-02-11 15:29:19 +01:00
0a531ddf87 vim-patch:8.0.0847: :argadd without argument can't handle space in file name
Problem:    :argadd without argument can't handle space in file name. (Harm te
            Hennepe)
Solution:   Escape the space. (Yasuhiro Matsumoto, closes vim/vim#1917)

398ee7326b
2018-02-11 15:29:19 +01:00
bbdb074aec vim-patch:8.0.0721: :argedit can only have one argument
Problem:    :argedit can only have one argument.
Solution:   Allow for multiple arguments. (Christian Brabandt)
90305c66a8
2018-02-11 15:29:19 +01:00
6df80e8762 vim-patch:8.0.0439: ":%argdel" gives an error for an empty arglist
Problem:    Using ":%argdel" while the argument list is already empty gives an
            error. (Pavol Juhas)
Solution:   Don't give an error. (closes vim/vim#1546)
69a92fb5ae

Also:
vim-patch:8.0.0473
2018-02-11 15:29:18 +01:00
77bfbc3006 test/oldtest: restore test_arglist.vim
We have a ported Lua version, but we should also keep the Vim version
around to make merging easier.

---

vim-patch:8.0.0723: arglist test fails if file name case is ignored
Problem:    Arglist test fails if file name case is ignored.
Solution:   Wipe existing buffers, check for fname_case property.
9b50bba643
2018-02-11 15:29:18 +01:00
e247dd2535 test/oldtest: runtest.vim: align with upstream 2018-02-11 15:29:16 +01:00
070f8df4dd vim-patch:8.0.1204: a QuitPre autocommand may get the wrong file name
Problem:    A QuitPre autocommand may get the wrong file name.
Solution:   Pass the buffer being closed to apply_autocmds(). (Rich Howe)

87ffb5c1a3
2018-02-11 15:27:57 +01:00
b5acf6e0c1 vim-patch:8.0.0700: segfault with QuitPre autocommand closes the window
Problem:    Segfault with QuitPre autocommand closes the window. (Marek)
Solution:   Check that the window pointer is still valid. (Christian Brabandt,
            closes vim/vim#1817)

0ea5070d79
2018-02-11 15:27:57 +01:00
6116af02ef vim-patch:8.0.1403: using freed buffer in grep command
Problem:    Using freed buffer in grep command. (gy741, Dominique Pelle)
Solution:   Lock the dummy buffer to avoid autocommands wiping it out.

4fb921e388
2018-02-11 15:27:57 +01:00
5ae90c84ea vim-patch:8.0.1402: crash with nasty autocommand
Problem:    Crash with nasty autocommand. (gy741, Dominique Pelle)
Solution:   Check that the new current buffer isn't wiped out. (closes vim/vim#2447)

9bca805ec4
2018-02-11 15:27:57 +01:00
e578d586f2 vim-patch:8.0.0974: resetting a string option does not trigger OptionSet
Problem:    Resetting a string option does not trigger OptionSet. (Rick Howe)
Solution:   Set the origval.

8efa026a25
2018-02-11 15:27:57 +01:00
fd58863eb6 vim-patch:8.0.0703: illegal memory access with empty :doau command
Problem:    Illegal memory access with empty :doau command.
Solution:   Check the event for being out of range. (James McCoy)

faf29d7f91
2018-02-11 15:27:57 +01:00
2d151f7739 vim-patch:8.0.0676: crash when closing quickfix window in autocmd
Problem:    Crash when closing the quickfix window in a FileType autocommand
            that triggers when the quickfix window is opened.
Solution:   Save the new value before triggering the OptionSet autocommand.
            Add the "starting" flag to test_override() to make the text work.

182a17b1e8
2018-02-11 15:27:57 +01:00
61f9a7b0d0 vim-patch:8.0.0736: OptionSet not triggered when entering diff mode
Problem:    The OptionSet autocommand event is not triggered when entering
            diff mode.
Solution:   use set_option_value() instead of setting the option directly.
            Change the tests from old to new style. (Christian Brabandt)

04f62f881c
2018-02-11 15:27:56 +01:00
ce92e784e1 vim-patch:8.0.1186: still quite a few old style tests
Problem:    Still quite a few old style tests.
Solution:   Convert old to new style tests. (Yegappan Lakshmanan)
            Avoid ringing the bell while running tests.
4a6fcf8047
2018-02-11 15:27:56 +01:00
c9aafda6ac vim-patch:8.0.0600: test_recover fails on some systems
Problem:    test_recover fails on some systems.
Solution:   Explicitly check if "/" is writable. (Ken Takata)

2a0b06def4
2018-02-11 15:27:56 +01:00
4c83567da3 vim-patch:8.0.0338: :recover test fails on MS-Windows
Problem:    :recover test fails on MS-Windows.
Solution:   Use non-existing directory on MS-Windows.

803452046b
2018-02-11 15:27:56 +01:00
4c1afd1e83 vim-patch:8.0.0337: invalid memory access in :recover command
Problem:    Invalid memory access in :recover command.
Solution:   Avoid access before directory name. (Dominique Pelle,
            closes vim/vim#1488)

c525e3a1c2
2018-02-11 15:27:56 +01:00
fafe23cad7 vim-patch:8.0.0472: when a test fails another test may also fail
Problem:    When a test fails and test.log is created, Test_edit_CTRL_I
            matches it instead of test1.in.
Solution:   Match with runtest.vim instead.
c537947100
2018-02-11 15:27:56 +01:00
cbecae46f4 vim-patch:8.0.0861: still many old style tests
Problem:    Still many old style tests.
Solution:   Convert several tests to new style. (Yegappan Lakshmanan)
4a137b4586

vim-patch:8.0.0862: file size test fails on MS-Windows
Problem:    File size test fails on MS-Windows.
Solution:   Set fileformat after opening new buffer.  Strip CR.
07c043af5f
2018-02-11 15:27:56 +01:00
4fe4b5abb6 vim-patch:8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Problem:    Using a text object to select quoted text fails when 'selection'
            is set to "exclusive". (Guraga)
Solution:   Swap cursor and visual start position. (Christian Brabandt,
            closes vim/vim#1687)

c5e2b040b4
2018-02-11 15:27:56 +01:00
54b9510e05 vim-patch:8.0.1158: still old style tests
Problem:    Still old style tests.
Solution:   Convert serveral tests to new style. (Yegappan Lakshmanan)

db51007108
2018-02-11 15:27:56 +01:00
7d12597d29 vim-patch:8.0.0692: CTRL-G with 'incsearch' and ? goes in the wrong direction
Problem:    Using CTRL-G with 'incsearch' and ? goes in the wrong direction.
            (Ramel Eshed)
Solution:   Adjust search_start. (Christian Brabandt)

da5116da45
2018-02-11 15:27:56 +01:00
ca24ad0b95 vim-patch:8.0.0689: ~ character not escaped when extending search pattern
Problem:    The ~ character is not escaped when adding to the search pattern
            with CTRL-L. (Ramel Eshed)
Solution:   Escape the character. (Christian Brabandt)

a693d0584b
2018-02-11 15:27:55 +01:00
c8356e1151 vim-patch:8.0.0440: not enough test coverage in Insert mode
[Nvim note: test_override() omitted]

Problem:    Not enough test coverage in Insert mode.
Solution:   Add lots of tests.  Add test_override(). (Christian Brabandt,
            closes vim/vim#1521)
eb992cb90f
2018-02-11 15:27:55 +01:00
b67ce84c45 vim-patch.sh: delete *.orig files 2018-02-11 15:27:55 +01:00
e69a71427c vim-patch.sh: remove --posix from patch invocation
This was supposed to avoid creating *.orig. It doesn't do that, and
worse, it also seems to prevent new files from being created.
2018-02-11 15:27:47 +01:00
2cfc1b055b Merge #7939 "fix crash: 'spell' and long lines" 2018-02-11 13:04:39 +01:00
ed0d135247 Merge #7939 "fix crash: 'spell' and long lines"
closes #7937
2018-02-11 13:03:24 +01:00
564ad60c06 Merge pull request #7982 from bfredl/hlrefactor
Refactor HlAttrs so that termguicolors is implemented purely on TUI side
2018-02-11 13:01:31 +01:00
dd068928c1 version.c: update [ci skip] (#7953) 2018-02-11 12:27:47 +01:00
5d8da126d0 ui/tui: highlighting refactor
Make HlAttr contain highlighting state for both color modes (cterm and rgb).
This allows us to implement termguicolors completely in the TUI.

Simplify some logic duplicated between ui.c and screen.c. Also avoid
some superfluous highlighting reset events.
2018-02-11 10:29:32 +01:00
c205360f00 Merge pull request #7993 from blueyed/vim-8.0.1483
vim-patch:8.0.1483: searchpair() might return an invalid value on timeout
2018-02-10 23:18:04 +01:00
d929a41f5f vim-patch:8.0.1483: searchpair() might return an invalid value on timeout
Problem:    Searchpair() might return an invalid value on timeout.
Solution:   When the second search times out, do not accept a match from the
            first search. (Daniel Hahler, closes vim/vim#2552)

9d32276b52
2018-02-10 22:49:42 +01:00
34b99bc06b Merge pull request #7979 from bfredl/shellbell
Shell: support bell and buffer incomplete UTF-8 sequences
2018-02-10 22:30:49 +01:00
c03a847884 win: enable backtick_expansion and shell output tests 2018-02-10 22:28:12 +01:00
f75c4b39ec shell: handle split-up UTF-8 sequences 2018-02-10 22:28:12 +01:00
01cdeff626 tests: integrate ex_cmds/bang_filter_spec into ui/output_spec
they test the same thing. Filtering is tested elsewhere.
2018-02-10 22:28:12 +01:00
60ce7d9e0a shell: support bell 2018-02-10 22:28:12 +01:00
a6052c7307 Merge #7984 'defaults: sidescroll=1' 2018-02-09 11:46:13 +01:00
7229493eb1 test/oldtest: move Nvim setup to testdir/setup.vim 2018-02-09 02:25:03 +01:00
a265334406 defaults: sidescroll=1
ref #6289
2018-02-09 02:15:25 +01:00
dc53629587 macOS: Use pbpaste to detect a working clipboard (#7983)
`pbcopy` writes to the clipboard, it should not be used to sanity-check the clipboard.
2018-02-08 00:27:54 +01:00
a6136e8b0b screen.c: resolve neovim issue #7937 2018-02-07 13:46:37 -06:00
f66ebcd0a2 Merge pull request #7977 from jamessan/remove-coveralls
Switch to codecov and track coverage per test suite
2018-02-07 09:47:10 -05:00
d071578ed0 codecov: Report coverage even if some CI failed 2018-02-07 07:51:22 -05:00
366528130e Merge #6713 'tests for :! output' 2018-02-07 09:57:23 +01:00
35a7892781 lint, minor cleanup 2018-02-07 09:25:51 +01:00
ed37136c5c UI: restore 'writedelay' feature.
Removed by e0e41b30c6, probably
unintentionally. Useful for ye olde redraw debugging.

TODO: Also delay redraw of statusline.
2018-02-07 09:25:51 +01:00
352a51e831 test: :! print binary data, control chars
closes #5442
closes #4142
ref #6618
ref #4376
ref #7844
ref #2958
ref #4338
2018-02-07 09:25:51 +01:00
9fdd5d7f03 codecov: Submit test suite specific coverage 2018-02-06 23:23:59 -05:00
6e2bb564e1 ci: Remove coveralls coverage reporting 2018-02-06 21:18:54 -05:00
538361955d exit: annotate FUNC_ATTR_NORETURN functions #7954 (#7954)
This should fix a particular false positive from clang 5.0.0 scan-build,
which thinks that nlua_init() can continue after preserve_exit().
2018-02-07 02:32:50 +01:00
b1412dc412 Merge #7971 ':terminal Enter/Leave should not increment jumplist' 2018-02-07 01:52:10 +01:00
d73dd1588c :terminal Enter/Leave should not increment jumplist
The old behavior is probably not justified, for the usual reason:
terminal buffers may have interactive processes, so cursor placement is
arbitrary, therefore tracking it in the jumplist is useless (or worse).

N.B.: per the docstring for `checkpcmark()` it looks like we were
calling `checkpcmark()` and `setpcmark()` in the wrong order.

closes #3723
2018-02-07 00:01:58 +01:00
2a4c9c6e45 Merge pull request #7844 from bfredl/shellout
shell: use msg functions for :!cmd so UTF-8 and binary is supported.
2018-02-06 22:58:38 +01:00
6744f48d88 tests: cleanup bufhl test 2018-02-06 20:16:38 +01:00
4e7d85e635 shell: update execute('!cmd') test to new behavior
And similarly nvim_command_output test
2018-02-06 20:16:38 +01:00
9af14506e5 shell: add test for binary and multibyte output
Also update existing tests for new (vim-compatible) newline behavior
2018-02-06 10:23:26 +01:00
5f5caa367a use split instead of smile for neovim 2018-02-06 09:09:59 +08:00
2d99b81ab5 shell: use msg_outtrans_len_attr for :!cmd
fixes #7830 and #7788
2018-02-05 22:57:43 +01:00
0851057a8d Merge pull request #7957 from jamessan/lua-functionaltest
[RFC] Ensure build works without LuaJIT available
2018-02-04 07:54:30 -05:00
ab35caf9cf vim-patch:8.0.0471: exit callback test sometimes fails
Problem:    Exit callback test sometimes fails.
Solution:   Add it to the list of flaky tests.

0529b3eb01
2018-02-04 16:10:22 +08:00
40d6a95670 vim-patch:8.0.0470: not enough testing for help commands
Problem:    Not enough testing for help commands.
Solution:   Add a few more help tests. (Dominique Pelle, closes vim/vim#1565)

751ba616d1
2018-02-04 16:04:03 +08:00
de10ea55f3 lint 2018-02-03 22:19:08 -05:00
ZyX
2316a38dd1 tests: Make format_string('%q', ...) output more stable
It appears to be different on lua and luajit.
2018-02-02 07:28:56 -05:00
ZyX
a2dfeb8a16 functests: Improve error reporting in _check_parsing function
May be needed for unit tests as well though.
2018-02-02 07:28:56 -05:00
e243dbdc32 test: man_spec: Fix use of nested [[ quoting
Lua (not LuaJIT) complains about the "^[[" strings inside the expect,
since it sees them as nested quotes.  Change the quoting to [=[ ]=] to
avoid the issue.
2018-02-02 07:28:56 -05:00
5da6f0e903 travis: Don't run unit tests for functionaltest-lua build 2018-02-02 07:28:56 -05:00
86ee92f2a2 cmake: Set TEST_LIBNVIM_PATH to empty string when not unit testing 2018-02-02 07:28:56 -05:00
e34f2897d5 third-party: Install luabitop if using Lua 2018-02-02 07:28:56 -05:00
71190f1f34 third-party: lua: Set LUA_ROOT to ${DEPS_INSTALL_DIR} 2018-02-02 07:28:55 -05:00
204ec6337e third-party: luarocks: Use Lua if LuaJIT is disabled 2018-02-02 07:28:55 -05:00
4487657576 travis: Disable LuaJIT for functionaltest-lua build
Since we're already using Lua for the testing this allows us to ensure
our build still works properly without LuaJIT available.
2018-02-02 07:28:49 -05:00
e2afcfb020 build: BuildLuarocks.cmake: fix luacheck rockspec (#7961)
luacheck renamed the filename from luacheck-scm-1.rockspec to luacheck-dev-1.rockspec.
2018-02-02 11:21:58 +01:00
709a87d194 Merge #7463 'incsearch + hlsearch highlight all' 2018-02-01 23:25:55 +01:00
6710164c2c provider: make has('ruby') only return 1 if gem is installed (#7944) 2018-02-01 13:14:29 +01:00
f8010ea3ec test: robust cleanup, unique filenames #7950 (#7950)
Use unique filenames to avoid test conflicts.
Use read_file() instead of io.popen(), to ensures the file is closed.
Use helpers.rmdir(), it is far more robust than lfs.

closes #7911
2018-02-01 03:12:37 +01:00
648fed975e os_system(): do not set up input stream for empty string #7951
Test failure:
test/functional/eval/system_spec.lua: "works with an empty string"
E5677: Error writing input to shell-command: EPIPE

ref https://github.com/neovim/neovim/pull/6558#issuecomment-361061035
ref #6554
2018-02-01 02:28:54 +01:00
ec7cbabf01 version.c: update [ci skip] (#7886)
vim-patch:8.0.0175: setting language on MS-Windows does not always work
vim-patch:8.0.0185: system() test fails on MS-Windows
vim-patch:8.0.1435: memory leak in test_arabic
vim-patch:8.0.0424: compiler warnings on MS-Windows
vim-patch:8.0.0434: clang version not correctly detected
vim-patch:8.0.0458: potential crash if adding list or dict to dict fails
2018-02-01 02:24:45 +01:00
dfcd09dc22 vim-patch:8.0.0672: synconcealed() changes too often #7887
Problem:    Third item of synconcealed() changes too often. (Dominique Pelle)
Solution:   Reset the sequence number at the start of each line.
cc0750dc6e

closes #7589
2018-02-01 02:12:21 +01:00
3a5721e91b tui: libtermkey: force CSI driver for mouse input #7948
Fixes #7932

Nvim (tui.c) always enables SGR mouse (TUIData.unibi_ext.enable_mouse).
But if libtermkey sees key_mouse (kmous) in terminfo its terminfo driver
(driver-ti.c) will be activated, which by accident only supports X10
protocol. The libtermkey CSI driver (driver-csi.c), in contrast,
supports SGR.

We can force libtermkey to ignore the terminfo key_mouse entry by
returning NULL in the tui_tk_ti_getstr hook. That forces the CSI driver.

What is the effect of returning NULL from `tui_tk_ti_getstr()`?
- libtermkey `driver-ti.c:load_terminfo()` skips the entry.
- `termkey.c:peekkey()` iterates through all drivers, it finds
  `TERMKEY_RES_NONE` for the ti driver and falls back to the CSI driver.
2018-01-31 23:55:15 +01:00
6452831cf9 clipboard: macOS: fallback to tmux if pbcopy is broken #7940
On some versions of macOS, pbcopy doesn't work in tmux <2.6
https://superuser.com/q/231130
Fallback to tmux in that case.

Add a healthcheck for this scenario.
2018-01-31 11:37:05 +01:00
649123d07c vim-patch:8.0.0358,8.0.0359 (#7832)
vim-patch:8.0.0358: invalid memory access in C-indent code
Problem:    Invalid memory access in C-indent code.
Solution:   Don't go over end of empty line. (Dominique Pelle, closes vim/vim#1492)
60629d6425

vim-patch:8.0.0359: 'number' and 'relativenumber' are not properly tested
Problem:    'number' and 'relativenumber' are not properly tested.
Solution:   Add tests, change old style to new style tests. (Ozaki Kiichi,
            closes vim/vim#1447)
dc9a081712
2018-01-30 21:21:29 +01:00
5d2dd2ebe2 win: has("wsl") on Windows Subsystem for Linux #7330
Per CMAKE docs, CMAKE_HOST_SYSTEM_VERSION is the result of `uname -r`:
https://cmake.org/cmake/help/v3.4/variable/CMAKE_HOST_SYSTEM_VERSION.html?highlight=uname

    A numeric version string for the system. On systems that support
    uname, this variable is set to the output of uname -r. On other
    systems this is set to major-minor version numbers.

On Windows it is something like "6.1", so it won't match ".*-Microsoft".

Closes #7329
2018-01-30 21:12:49 +01:00
8728a5d50b vim-patch:8.0.0448: some macros are lower case (#7936)
Problem:    Some macros are in lower case, which can be confusing.
Solution:   Make a few lower case macros upper case.
b5aedf3e22

ref #6297
2018-01-30 20:29:15 +01:00
2a1a624878 vim-patch:8.0.0443: terminal width is set to 80 in test3 (#7933)
Problem:    Terminal width is set to 80 in test3.
Solution:   Instead of setting 'columns' set 'wrapmargin' depending on
            'columns.

38a3d6c960
2018-01-30 20:15:05 +01:00
397ff2c35b Merge #5822 'mouse.c: Fix mouse click on multibyte + concealed' 2018-01-29 23:50:43 +01:00
ca31f81a31 dist: snap packaging #7918 2018-01-29 23:02:15 +01:00
b55f831678 Merge #7842 'win: fnamemodify()' 2018-01-29 22:56:35 +01:00
41b3c7850f test: use helpers.pathroot() to avoid a syscall 2018-01-29 00:05:35 -05:00
1813c53e8d Updated tests 2018-01-28 23:47:11 -05:00
2eb8dc40ac Safer loop for skipping consecutive concealed chars 2018-01-28 23:47:11 -05:00
be7990bb49 Use one variable for tracking adjustment instead of two 2018-01-28 23:47:11 -05:00
caf87f597f Adjust cursor according to character display widths 2018-01-28 23:47:11 -05:00
60d0353119 Don't move cursor to the left if on the first column of wrapped line
ref: #7887
2018-01-28 23:47:11 -05:00
d2ff5d5bb0 Use utfc_ptr2len instead of utf_ptr2len 2018-01-28 23:47:11 -05:00
0376874c32 mouse.c: Fix mouse click on lines with multibyte text
fixes #5341, #5801
2018-01-28 23:47:11 -05:00
9a36337d32 vim-patch:8.0.0528: highlight wrong text when 'wim' includes "longest" (#7927)
Problem:    When 'wildmenu' is set and 'wildmode' has "longest" then the first
            file name is highlighted, even though the text shows the longest
            match.
Solution:   Do not highlight the first match. (LemonBoy, closes vim/vim#1602)

ef8eb08978
2018-01-29 02:01:16 +01:00
2569fabf04 vim-patch:8.0.0427: 'makeencoding' missing from the options window (#7907)
Problem:    'makeencoding' missing from the options window.
Solution:   Add the entry.
ad4187e6fc
2018-01-28 22:53:53 +01:00
b251c42195 Merge #7924 'test/old: various fixes' 2018-01-28 22:51:51 +01:00
f9b738235e test/old: fix Test_set_completion()
Vim's src/testdir has more directories in it, so the "./samples/" item
happens to have a space in front of it.  This isn't relevant to the
test, so just elide the space for our case.
2018-01-28 22:29:17 +01:00
0578087e5e test: osx: try resolve($TMPDIR) 2018-01-28 13:58:56 -05:00
5c09f37d4a test: fix failed tests with $TMPDIR in QuickBuild 2018-01-28 13:58:56 -05:00
7ac21332cf Revert "test: fix failed test cases with tmpdir = $TMPDIR"
This reverts commit f7fe3012204169f22412194a78f196ffc72bb8c3.

Fails on QuickBuild because it uses a non-local path.
Need a environment-agnostic solution
2018-01-28 13:58:56 -05:00
28236867a0 test: fix failed test cases with tmpdir = $TMPDIR 2018-01-28 13:58:55 -05:00
c08c09add7 test: try $TMPDIR for temporary directory 2018-01-28 13:58:55 -05:00
5a39d2d00e test: fnamemodify with :8 filename modifier 2018-01-28 13:58:54 -05:00
984a93df96 win: enable legacy/fnamemodify_spec.lua 2018-01-28 13:58:54 -05:00
eb59dd6547 fixup: get network drive only, not entire path 2018-01-28 13:58:54 -05:00
273c7cfa2a fixup: lint errors 2018-01-28 13:58:53 -05:00
534abe4aaf test: win: get current network drive via io.popen 2018-01-28 13:58:53 -05:00
ec5af91b90 win: explicitly specify pathsep 2018-01-28 13:58:53 -05:00
e39be42c09 fixup: compile-time errors 2018-01-28 13:58:52 -05:00
909c967f35 win: detect / and \ as root path separator 2018-01-28 13:58:52 -05:00
a619c3fcf9 test: win: add tests for shellslash 2018-01-28 13:58:51 -05:00
afbdafffc2 test: fnamemodify() 2018-01-28 13:58:51 -05:00
499c9a1553 test/win: fix some environment assumptions #7912
fix #7909
fix #7910
2018-01-28 19:10:18 +01:00
8821579baa test/old: $TMPDIR must be absolute
Internals `chdir` here and there, this causes relative $TMPDIR to break
some things. Don't know why this only happened on macOS...
2018-01-28 13:16:33 +01:00
6f4c4be952 ex_diffpatch: don't need redraw_later(CLEAR), Nvim uses pipes 2018-01-28 12:33:22 +01:00
16a6f44570 Merge #7903 'test/old: minor fixes for local invocation' 2018-01-28 11:33:56 +01:00
c6fe06bbc0 tui: fix use-after-free after UI stop event #7922
ui_bridge:ui_bridge_stop() calls ui_detach_impl() last, so the check for
ui_active() in ui:ui_refresh() doesn't help: tui_main() already freed
the `ui` object.

There is a race between ui_bridge_stop (thread T0) and tui_main (thread T1).
UIBridgeData.stopped could be set while ui_bridge_stop() is in the
middle of loop_poll_events(), which may invoke tui_scheduler() on T0.
The pointers in tui_scheduler() may be invalid by then.

Solution(?): Use the `UI.data` field as a "stopped" flag and check it in
tui_scheduler().

ASAN use-after-free report observed in #7908:

    = ==20066==ERROR: AddressSanitizer: heap-use-after-free on address 0x611000000cd0 at pc 0x00000182abed bp 0x7ffe23b07070 sp 0x7ffe23b07068
    = READ of size 8 at 0x611000000cd0 thread T0
    =     0 0x182abec in tui_scheduler /home/travis/build/neovim/neovim/src/nvim/tui/tui.c:393:23
    =     1 0x1876afd in ui_bridge_update_fg /home/travis/build/neovim/neovim/build/src/nvim/auto/ui_events_bridge.generated.h:205:3
    =     2 0x186c130 in ui_resize /home/travis/build/neovim/neovim/src/nvim/ui.c:310:3
    =     3 0x146b9c2 in screen_resize /home/travis/build/neovim/neovim/src/nvim/screen.c:7483:3
    =     4 0x186a6f0 in ui_refresh /home/travis/build/neovim/neovim/src/nvim/ui.c:284:3
    =     5 0x186bbe0 in ui_refresh_event /home/travis/build/neovim/neovim/src/nvim/ui.c:297:3
    =     6 0xa2219a in multiqueue_process_events /home/travis/build/neovim/neovim/src/nvim/event/multiqueue.c:150:7
    =     7 0xa1bd7f in loop_poll_events /home/travis/build/neovim/neovim/src/nvim/event/loop.c:63:3
    =     8 0x1872709 in ui_bridge_stop /home/travis/build/neovim/neovim/src/nvim/ui_bridge.c:121:5
    =     9 0x1864247 in ui_builtin_stop /home/travis/build/neovim/neovim/src/nvim/ui.c:143:3
    =     10 0x1249ec8 in mch_exit /home/travis/build/neovim/neovim/src/nvim/os_unix.c:140:3
    =     11 0xe56ba9 in getout /home/travis/build/neovim/neovim/src/nvim/main.c:671:3
    =     12 0xfc4c8f in preserve_exit /home/travis/build/neovim/neovim/src/nvim/misc1.c:2653:3
    =     13 0x1247c02 in deadly_signal /home/travis/build/neovim/neovim/src/nvim/os/signal.c:137:3
    =     14 0x1247921 in on_signal /home/travis/build/neovim/neovim/src/nvim/os/signal.c:162:9
    =     15 0xa35618 in signal_event /home/travis/build/neovim/neovim/src/nvim/event/signal.c:47:3
    =     16 0xa2219a in multiqueue_process_events /home/travis/build/neovim/neovim/src/nvim/event/multiqueue.c:150:7
    =     17 0xa1bd7f in loop_poll_events /home/travis/build/neovim/neovim/src/nvim/event/loop.c:63:3
    =     18 0x1237bd6 in input_poll /home/travis/build/neovim/neovim/src/nvim/os/input.c:349:3
    =     19 0x123334f in inbuf_poll /home/travis/build/neovim/neovim/src/nvim/os/input.c:372:24
    =     20 0x123316d in os_inchar /home/travis/build/neovim/neovim/src/nvim/os/input.c:110:19
    =     21 0x170d20e in state_enter /home/travis/build/neovim/neovim/src/nvim/state.c:55:13
    =     22 0xbd7441 in command_line_enter /home/travis/build/neovim/neovim/src/nvim/ex_getln.c:384:3
    =     23 0xbd0a60 in getcmdline /home/travis/build/neovim/neovim/src/nvim/ex_getln.c:1920:10
    =     24 0xbdb365 in getexline /home/travis/build/neovim/neovim/src/nvim/ex_getln.c:2100:10
    =     25 0xb00a6b in do_cmdline /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:528:47
    =     26 0x10a7837 in nv_colon /home/travis/build/neovim/neovim/src/nvim/normal.c:4552:18
    =     27 0x1091e15 in normal_execute /home/travis/build/neovim/neovim/src/nvim/normal.c:1136:3
    =     28 0x170d439 in state_enter /home/travis/build/neovim/neovim/src/nvim/state.c:67:26
    =     29 0x104ee14 in normal_enter /home/travis/build/neovim/neovim/src/nvim/normal.c:466:3
    =     30 0xe4295c in main /home/travis/build/neovim/neovim/src/nvim/main.c:572:3
    =     31 0x2b2ba340bf44 in __libc_start_main /build/eglibc-ripdx6/eglibc-2.19/csu/libc-start.c:287
    =     32 0x44d24b in _start (/home/travis/build/neovim/neovim/build/bin/nvim+0x44d24b)
    =
    = 0x611000000cd0 is located 16 bytes inside of 240-byte region [0x611000000cc0,0x611000000db0)
    = freed by thread T1 here:
    =     0 0x4ee0e2 in __interceptor_free /local/mnt/workspace/tmp/ubuntu_rel/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:47:3
    =     1 0xf4f6d4 in xfree /home/travis/build/neovim/neovim/src/nvim/memory.c:133:3
    =     2 0x182a963 in tui_main /home/travis/build/neovim/neovim/src/nvim/tui/tui.c:383:3
    =     3 0x18792b0 in ui_thread_run /home/travis/build/neovim/neovim/src/nvim/ui_bridge.c:106:3
    =     4 0x2b2ba2697183 in start_thread /build/eglibc-ripdx6/eglibc-2.19/nptl/pthread_create.c:312
    =
    = previously allocated by thread T0 here:
    =     0 0x4ee61a in calloc /local/mnt/workspace/tmp/ubuntu_rel/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:76:3
    =     1 0xf4f787 in xcalloc /home/travis/build/neovim/neovim/src/nvim/memory.c:147:15
    =     2 0x182000a in tui_start /home/travis/build/neovim/neovim/src/nvim/tui/tui.c:127:12
    =     3 0x1863f7c in ui_builtin_start /home/travis/build/neovim/neovim/src/nvim/ui.c:125:3
    =     4 0xe41bb9 in main /home/travis/build/neovim/neovim/src/nvim/main.c:457:5
    =     5 0x2b2ba340bf44 in __libc_start_main /build/eglibc-ripdx6/eglibc-2.19/csu/libc-start.c:287
    =
    = Thread T1 created by T0 here:
    =     0 0x4d774d in __interceptor_pthread_create /local/mnt/workspace/tmp/ubuntu_rel/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_interceptors.cc:317:3
    =     1 0x1aae6b0 in uv_thread_create /home/travis/nvim-deps/build/src/libuv/src/unix/thread.c:75
    =     2 0x18217fa in tui_start /home/travis/build/neovim/neovim/src/nvim/tui/tui.c:159:10
    =     3 0x1863f7c in ui_builtin_start /home/travis/build/neovim/neovim/src/nvim/ui.c:125:3
    =     4 0xe41bb9 in main /home/travis/build/neovim/neovim/src/nvim/main.c:457:5
    =     5 0x2b2ba340bf44 in __libc_start_main /build/eglibc-ripdx6/eglibc-2.19/csu/libc-start.c:287

---

Alternative attempt:

    commit 6ad9c02491606a0c31e907f38c9931f324327aa5
    Author: Justin M. Keyes <justinkz@gmail.com>
    Date:   Sat Jan 27 15:12:58 2018 +0100

        tui: fix use-after-free: swap in empty scheduler

        This should make life easier for UIs like VimR which implement their own
        in-process bridged UI: they don't need to worry that their `scheduler`
        might receive an invalid pointer.

        To avoid that, ui_bridge_stopped() swaps in an empty scheduler. Note
        that this requires the call to loop_poll_events() to be moved into the
        critical section.

    diff --git a/src/nvim/ui_bridge.c b/src/nvim/ui_bridge.c
    index 779585416f80..491052d19d3b 100644
    --- a/src/nvim/ui_bridge.c
    +++ b/src/nvim/ui_bridge.c
    @@ -93,10 +93,18 @@ UI *ui_bridge_attach(UI *ui, ui_main_fn ui_main, event_scheduler scheduler)
       return &rv->bridge;
     }

    +static void ui_bridge_null_scheduler(Event event, void *d)
    +{
    +  WLOG("ignoring event (bridge stopped)");
    +}
    +
     void ui_bridge_stopped(UIBridgeData *bridge)
     {
       uv_mutex_lock(&bridge->mutex);
       bridge->stopped = true;
    +  // Replace with an empty scheduler, so that the UI internal scheduler does
    +  // not get invoked with an invalid pointer. #7922
    +  bridge->scheduler = ui_bridge_null_scheduler;
       uv_mutex_unlock(&bridge->mutex);
     }

    @@ -111,14 +119,11 @@ static void ui_bridge_stop(UI *b)
       UIBridgeData *bridge = (UIBridgeData *)b;
       bool stopped = bridge->stopped = false;
       UI_BRIDGE_CALL(b, stop, 1, b);
    -  for (;;) {
    +  while (!stopped) {
         uv_mutex_lock(&bridge->mutex);
         stopped = bridge->stopped;
    -    uv_mutex_unlock(&bridge->mutex);
    -    if (stopped) {
    -      break;
    -    }
         loop_poll_events(&main_loop, 10);  // Process one event (at most).
    +    uv_mutex_unlock(&bridge->mutex);
       }
       uv_thread_join(&bridge->ui_thread);
       uv_mutex_destroy(&bridge->mutex);
2018-01-28 03:08:04 +01:00
300d3651e2 Merge #7919 from hardenedapple/langremap-after-map 2018-01-27 16:26:14 +01:00
df4f9342b9 Make 'langnoremap' apply directly after a map
We were initially checking whether to apply 'langmap' translation based
on typebuf.tb_maplen.
This gets set to 0 on the last byte of a map when the del_typebuf()
function is called, which means that the option was not working for the
last character of a mapping.
For this reason, we switched to using KeyTyped to decide whether to
apply the transformation or not in commit 53da57d27.
Substituting one for the other isn't enough, because KeyTyped isn't set
until vgetorpeek() is returning.
This means 'langmap' translations are not applied when searching for
characters to map in the vgetorpeek() function if the *previous* key was
not typed.

We can't assert that both hold, as we would then *not* apply the
transformation when looking for a map starting with the first typed key
after a previously expanded map (as KeyTyped would be `false` from the
previously expanded map, and not yet reset).

Hence we assert that if we are looking for the mapping while in
vgetorpeek(), the map length should be zero, otherwise, KeyTyped must be
`true`.

This is implemented by checking for the variable `vgetc_busy`.
2018-01-27 11:44:15 +00:00
f2ea15f364 Add some tests for 'langmap' 2018-01-27 11:20:10 +00:00
87e03c2b85 vim-patch:8.0.1393: too much highlighting with 'hlsearch' and 'incsearch' set
Problem:    Too much highlighting with 'hlsearch' and 'incsearch' set.
Solution:   Do not highlight matches when the pattern matches everything.

6621605eb9
2018-01-26 18:39:20 +03:00
9bc1410ee1 vim-patch:8.0.1304: CTRL-G/CTRL-T don't work with incsearch and empty pattern
Problem:    CTRL-G/CTRL-T don't work with incsearch and empty pattern.
Solution:   Use the last search pattern. (Christian Brabandt, closes vim/vim#2292)

d048009717
2018-01-26 18:39:20 +03:00
cd59577d57 vim-patch:8.0.1396: memory leak when CTRL-G in search command line fails
Problem:    Memory leak when CTRL-G in search command line fails.
Solution:   Move restore_last_search_pattern to after "if".

a1d5c154db
2018-01-26 18:39:20 +03:00
997fc8b133 Add tests 2018-01-26 18:39:20 +03:00
660bfb3fb3 Update included_patches 2018-01-26 18:39:20 +03:00
cd973be11b vim-patch:8.0.1250
Problem:    'hlsearch' highlighting not removed after incsearch (lacygoill)
Solution:   Redraw all windows. Start search at the end of the match.  Improve
            how CTRL-G works with incremental search. Add tests. (Christian
            Brabandt, Hirohito Higashi, haya14busa, closes vim/vim#2267)

f8f8b2eadb
2018-01-26 18:39:20 +03:00
41394d8236 vim-patch:8.0.1238
Problem:    Incremental search only shows one match.
Solution:   When 'incsearch' and and 'hlsearch' are both set highlight all
            matches. (haya14busa, closes vim/vim#2198)

2e51d9a097
2018-01-26 18:39:20 +03:00
0a56bd3330 build/macOS: remove -iframework line #7891
Linker error:

    [1/3] Linking C executable bin/nvim
    ld: warning: directory not found for option '-FCoreFoundation'

Only the -isysroot change is needed, see
https://github.com/neovim/neovim/pull/7891#discussion_r164036958
2018-01-26 11:42:07 +01:00
83880cced3 Merge pull request #6558 from jamessan/tv_as_string-fix
eval: save_tv_as_string: Correctly handle an empty string
2018-01-25 14:09:36 -05:00
8b1f7d8774 vim-patch:8.0.0431 (#7908)
vim-patch:8.0.0431: 'cinoptions' cannot set indent for extern block
Problem:    'cinoptions' cannot set indent for extern block.
Solution:   Add the "E" flag in 'cinoptions'. (Hirohito Higashi)
7720ba8599
2018-01-25 11:26:47 +01:00
a3daa8cb13 build: fix luacheck detection (avoids re-download on win32) (#7905) 2018-01-24 10:29:30 +01:00
3ff92ba1ee eval: save_tv_as_string: Correctly handle an empty string
When tv_get_string_chk returns a non-NULL value, we have a valid string.
Propagating an error state (*len = -1, NULL return) for an empty string
is invalid.

Closes #6554
2018-01-23 17:56:50 -05:00
5d88830d51 test/old: always set $TMPDIR
On macOS $TMPDIR defaults to something very long. There's not really
a need to support overriding the $TMPDIR used by tests, so always use
the workspace-local path "Xtest-tmpdir".
2018-01-23 23:06:22 +01:00
090cd10975 test/old: Fix_truncated_tmpfile(): more flexible 2018-01-23 23:06:22 +01:00
15119f943a test: system(): fix test
For the test to be valid it should actually send input.

ref #3529
ref #5241
2018-01-23 21:33:44 +01:00
6762c20af8 Merge pull request #7894 from jamessan/cmake-cmp0026-fix
cmake: Use generator expression to determine libnvim-test path
2018-01-23 08:41:04 -05:00
7dd97eb597 test/inccommand_spec: test the test (#7897) 2018-01-23 00:53:22 +01:00
3308b76339 Merge #7890 'vim-patch: various' 2018-01-22 23:13:54 +01:00
41a91af5cf cmake: Use generator expression to determine libnvim-test path
Prior to CMake 2.8.12, generator expressions could only be used in
custom commands so the path to libnvim-test in test/config/paths.lua was
set by inspecting the target's LOCATION property.  Post 2.8.12, the
file(GENERATE) command exists to handle this, but it can't interpolate
normal CMake variables.

In order to bridge the gap while < 2.8.12 is supported, use
configure_file() to create paths.lua.gen with the
$<TARGET_FILE:nvim-test> generator expression and then generate the
final paths.lua file.

Closes #7077
2018-01-22 14:16:31 -05:00
84d4e4a7ef Merge #7891 'build: fix creating generated files on macOS' 2018-01-22 19:40:58 +01:00
59ac170340 Merge #7893 'man.vim: use correct offset in presence of modifier commands' 2018-01-22 17:31:36 +01:00
dbcdd29139 man.vim: use correct offset in presence of modifier commands
The argument expansion for :Man depends on the number of arguments given to it
starting at the command itself. But user completion functions always provide the
entire command-line which can include modifier commands like :tab, :vert, etc.
leading to a wrong number of arguments.

Prune all arguments up to :Man.

Fixes #7872.
2018-01-22 17:05:52 +01:00
17b21eae52 build: fix creating generated files on macOS
For some reason, using the clang executable inside of the Xcode default
toolchain the platform's sysroot include isn't present.  This was
debugged by adding "-###" on the command line for generating the header
for nvim/os/lang.c and is was evident the flag was missing.
2018-01-22 06:27:14 -05:00
b69fa866db Merge #7888 'defaults: enable cscopeverbose' 2018-01-22 10:17:55 +01:00
872ee4259a vim-patch: NA
vim-patch:8.0.0674: cannot build with eval but without timers
vim-patch:8.0.0673: build failure without conceal feature
vim-patch:8.0.0668: nsis installer script does not work
vim-patch:8.0.0666: dead for loop
vim-patch:8.0.0665: warning for uninitialized variable
vim-patch:8.0.0664: mouse does not work in tmux
vim-patch:8.0.0661: recognizing urxvt mouse codes does not work well
vim-patch:8.0.0660: silent install on MS-Windows shows dialog
2018-01-21 18:42:45 +01:00
d6cbe6ca87 vim-patch:8.0.0667: more tests for :endfunc
[Only the test is merged; code was addressed by 60c025267265.]

Problem:    Memory access error when command follows :endfunction. (Nikolai
            Pavlov)
Solution:   Make memory handling in :function straightforward. (closes vim/vim#1793)
53564f7c1a
2018-01-21 18:42:45 +01:00
fb855feb52 vim-patch:8.0.0662: stray FIXME for fixed problem
Problem:    Stray FIXME for fixed problem.
Solution:   Remove the comment. (Dominique Pelle)

4670490673
2018-01-21 18:42:45 +01:00
154822933e vim-patch:8.0.0659: no test for conceal mode
Problem:    No test for conceal mode.
Solution:   Add a conceal mode test. (Dominique Pelle, closes vim/vim#1783)

4d785895d1
2018-01-21 18:42:45 +01:00
a5d33d5e90 vim-patch:8.0.0656: cannot use ! after some user commands
[Test passes, and the code change doesn't look applicable. So this only
includes the test.]

Problem:    Cannot use ! after some user commands.
Solution:   Properly check for existing command. (Higashi Higashi)
6f9a476b2f
2018-01-21 18:42:45 +01:00
a185ab70fd vim-patch:8.0.0655: not easy to make sure a function does not exist
Problem:    Not easy to make sure a function does not exist.
Solution:   Add ! as an optional argument to :delfunc.

d6abcd154c
2018-01-21 18:42:45 +01:00
52778d62fc vim-patch:8.0.0654: no warning for text after :endfunction
Problem:    Text found after :endfunction is silently ignored.
Solution:   Give a warning if 'verbose' is set.  When | or \n are used,
            execute the text as a command.
663bb23316

Note: the code part of this patch was addressed by 60c0252672.
2018-01-21 18:42:44 +01:00
2820860ba3 Merge #7885 'vim-patch: diff-related patches' 2018-01-21 13:33:04 +01:00
53749e1749 defaults: enable 'cscopeverbose', and deprecate it 2018-01-21 13:18:05 +01:00
e2eff5269f doc: if_cscop: cleanup 2018-01-21 12:41:35 +01:00
ab279c6fb8 vim-patch:8.0.0444: diffpatch fails when the file name has a quote
Problem:    Diffpatch fails when the file name has a quote.
Solution:   Escape the name properly. (zetzei)

a95ab32120
2018-01-21 12:21:48 +01:00
456cf72974 vim-patch:8.0.0442: patch shell command not well escaped
Problem:    Patch shell command uses double quotes around the argument, which
            allows for $HOME to be expanded. (Etienne)
Solution:   Use single quotes on Unix. (closes vim/vim#1543)

1ef73e33c9
2018-01-21 12:21:47 +01:00
ce09d4134b vim-patch:8.0.0433: beeps when running tests
Problem:    Quite a few beeps when running tests.
Solution:   Set 'belloff' for these tests. (Christian Brabandt)

c3c766ea8c
2018-01-21 12:21:47 +01:00
9c92eed86f vim-patch:8.0.0599: diff mode is insufficiently tested
Problem:    diff mode is insufficiently tested
Solution:   Add more test cases. (Dominique Pelle, closes vim/vim#1685)

79a213d6a4

NA / already applied:
---------------------
vim-patch:8.0.0421: diff mode wrong when adding line at end of buffer
Problem:    Diff mode is displayed wrong when adding a line at the end of a
            buffer.
Solution:   Adjust marks in diff mode. (James McCoy, closes vim/vim#1329)
f58a8475e1
2018-01-21 12:21:47 +01:00
9db4dc971d vim-patch:8.0.0301 #7685
Problem:    No tests for ":set completion" and various errors of the :set
            command.
Solution:   Add more :set tests. (Dominique Pelle, closes vim/vim#1440)
698f8b207b

---

Also move test_options from test_alot to Makefile.  (That's done upstream
in Vim patch 8.0.0430.)
2018-01-21 11:22:43 +01:00
72422b0748 version.c: update [ci skip] (#7828) 2018-01-21 11:04:39 +01:00
eb4aab7173 ui: forward 'linespace' option #7883
ref #7520
2018-01-21 09:39:12 +01:00
ada1956206 Merge #7880 'lua/executor: Remove lightuserdata' 2018-01-21 08:09:16 +01:00
6bf359fa79 vim-patch:8.0.0426: insufficient testing for statusline (#7882)
Problem:    Insufficient testing for statusline.
Solution:   Add several tests. (Dominique Pelle, closes vim/vim#1534)

300af82eca
2018-01-21 06:50:31 +01:00
ZyX
db346b5b48 lua/executor: Remove all places where lightuserdata is used
Should fix problems with luajit+arm64.

Fixes #7879
Ref LuaJIT/LuaJIT#230
2018-01-21 01:47:46 +03:00
0daaa49586 Merge #7863 'mingw64: fix gcc warnings' 2018-01-20 17:18:32 +01:00
ee84da358c Merge #7878 from justinmk/keymap-leak 2018-01-20 16:33:43 +01:00
5a96a9eba2 free_buf_options(): free buf_T.b_kmap_ga
ASAN log:

    ==23244==ERROR: LeakSanitizer: detected memory leaks

    Direct leak of 3348 byte(s) in 228 object(s) allocated from:
        0 0x4ee3d3 in malloc /local/mnt/workspace/tmp/ubuntu_rel/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:67:3
        1 0xf4e681 in try_malloc /home/travis/build/neovim/neovim/src/nvim/memory.c:87:15
        2 0xf4e8a9 in xmalloc /home/travis/build/neovim/neovim/src/nvim/memory.c:121:15
        3 0xf4ee68 in xmallocz /home/travis/build/neovim/neovim/src/nvim/memory.c:196:15
        4 0x170e3ee in vim_strnsave /home/travis/build/neovim/neovim/src/nvim/strings.c:70:28
        5 0x73b2ff in ex_loadkeymap /home/travis/build/neovim/neovim/src/nvim/digraph.c:1814:16
        6 0xb1ef4c in do_one_cmd /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:2242:5
        7 0xb011b3 in do_cmdline /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:609:20
        8 0xaee67d in do_source /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2970:3
        9 0xae82ae in source_callback /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2326:9
        10 0xae7adf in do_in_path /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2404:15
        11 0xae7f48 in do_in_path_and_pp /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2448:12
        12 0xae8281 in source_in_path /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2496:10
        13 0xae610c in source_runtime /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2490:10
        14 0x739887 in keymap_init /home/travis/build/neovim/neovim/src/nvim/digraph.c:1755:9
        15 0x11d423e in did_set_string_option /home/travis/build/neovim/neovim/src/nvim/option.c:2678:16
        16 0x11eecc4 in set_string_option /home/travis/build/neovim/neovim/src/nvim/option.c:2409:27
        17 0x119852f in set_option_value /home/travis/build/neovim/neovim/src/nvim/option.c:4849:14
        18 0x11bccac in set_bool_option /home/travis/build/neovim/neovim/src/nvim/option.c:3984:7
        19 0x11a9d50 in do_set /home/travis/build/neovim/neovim/src/nvim/option.c:1424:30
        20 0xb8caf7 in ex_set /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:9764:9
        21 0xb1ef4c in do_one_cmd /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:2242:5
        22 0xb011b3 in do_cmdline /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:609:20
        23 0x818b42 in call_user_func /home/travis/build/neovim/neovim/src/nvim/eval.c:21315:3
        24 0x7e41bb in call_func /home/travis/build/neovim/neovim/src/nvim/eval.c:6358:11
        25 0x7f8fb8 in get_func_tv /home/travis/build/neovim/neovim/src/nvim/eval.c:6120:11
        26 0x7f1ba1 in ex_call /home/travis/build/neovim/neovim/src/nvim/eval.c:2735:9
        27 0xb1ef4c in do_one_cmd /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:2242:5
        28 0xb011b3 in do_cmdline /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:609:20
        29 0x837ef1 in ex_execute /home/travis/build/neovim/neovim/src/nvim/eval.c:19463:7

    Direct leak of 456 byte(s) in 228 object(s) allocated from:
        0 0x4ee3d3 in malloc /local/mnt/workspace/tmp/ubuntu_rel/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:67:3
        1 0xf4e681 in try_malloc /home/travis/build/neovim/neovim/src/nvim/memory.c:87:15
        2 0xf4e8a9 in xmalloc /home/travis/build/neovim/neovim/src/nvim/memory.c:121:15
        3 0xf4ee68 in xmallocz /home/travis/build/neovim/neovim/src/nvim/memory.c:196:15
        4 0x170e3ee in vim_strnsave /home/travis/build/neovim/neovim/src/nvim/strings.c:70:28
        5 0x73b18f in ex_loadkeymap /home/travis/build/neovim/neovim/src/nvim/digraph.c:1811:18
        6 0xb1ef4c in do_one_cmd /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:2242:5
        7 0xb011b3 in do_cmdline /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:609:20
        8 0xaee67d in do_source /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2970:3
        9 0xae82ae in source_callback /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2326:9
        10 0xae7adf in do_in_path /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2404:15
        11 0xae7f48 in do_in_path_and_pp /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2448:12
        12 0xae8281 in source_in_path /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2496:10
        13 0xae610c in source_runtime /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2490:10
        14 0x739887 in keymap_init /home/travis/build/neovim/neovim/src/nvim/digraph.c:1755:9
        15 0x11d423e in did_set_string_option /home/travis/build/neovim/neovim/src/nvim/option.c:2678:16
        16 0x11eecc4 in set_string_option /home/travis/build/neovim/neovim/src/nvim/option.c:2409:27
        17 0x119852f in set_option_value /home/travis/build/neovim/neovim/src/nvim/option.c:4849:14
        18 0x11bccac in set_bool_option /home/travis/build/neovim/neovim/src/nvim/option.c:3984:7
        19 0x11a9d50 in do_set /home/travis/build/neovim/neovim/src/nvim/option.c:1424:30
        20 0xb8caf7 in ex_set /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:9764:9
        21 0xb1ef4c in do_one_cmd /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:2242:5
        22 0xb011b3 in do_cmdline /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:609:20
        23 0x818b42 in call_user_func /home/travis/build/neovim/neovim/src/nvim/eval.c:21315:3
        24 0x7e41bb in call_func /home/travis/build/neovim/neovim/src/nvim/eval.c:6358:11
        25 0x7f8fb8 in get_func_tv /home/travis/build/neovim/neovim/src/nvim/eval.c:6120:11
        26 0x7f1ba1 in ex_call /home/travis/build/neovim/neovim/src/nvim/eval.c:2735:9
        27 0xb1ef4c in do_one_cmd /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:2242:5
        28 0xb011b3 in do_cmdline /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:609:20
        29 0x837ef1 in ex_execute /home/travis/build/neovim/neovim/src/nvim/eval.c:19463:7

    SUMMARY: AddressSanitizer: 3804 byte(s) leaked in 456 allocation(s).
    Failed: E /tests/oldtests|logs :: Runtime errors detected.
2018-01-20 15:35:08 +01:00
6a826fce91 busted: explicit LUA_PATH to test scripts (#7864)
in case LUA_PATH does not contain `./?.lua`, busted can not load lua test scripts.
(for instance on nixos). Thus we make it explicit.
2018-01-20 14:43:16 +01:00
ecf851bc60 Merge #7867 'Add completion for :checkhealth'
Add completion for :checkhealth
2018-01-20 13:15:21 +01:00
b00fd49640 vim-patch:8.0.0423: changing 'cinoptions' does not always work
Problem:    The effect of adding "vim/vim#" to 'cinoptions' is not always removed.
            (David Briscoe)
Solution:   Reset b_ind_hash_comment. (Christian Brabandt, closes vim/vim#1475)

6b64394f34
2018-01-20 15:48:23 +08:00
10b1738f59 Fix lint error in option.c 2018-01-19 13:01:30 +08:00
82adba0f2f Fix for lint 2018-01-19 13:01:30 +08:00
e76c6e2ee8 Fix warning: multi-line comment [-Wcomment] use :341,355s/: \zs.*/\=string(submatch(0)) 2018-01-19 13:01:29 +08:00
2408a05151 Fix warning, read/write have unsigned int count on windows. 2018-01-19 13:01:29 +08:00
94f4469638 man.vim: infer $MANPAGER invocation in more cases
This should handle most cases where Nvim was invoked as $MANPAGER.

Ultimately the stakes are low: :quit will prompt if there are unsaved
changes.

fix #7873
2018-01-19 02:05:23 +01:00
20e0cb8d47 Merge #7424 'vim-patch: 8.0.0198, 8.0.0200, 8.0.0201, 8.0.0202, 8.0.0204' 2018-01-18 22:58:50 +01:00
72a7a884b4 tests: :checkhealth completion 2018-01-18 22:47:37 +01:00
6acbd76b00 Add completion for :checkhealth 2018-01-18 22:47:36 +01:00
421f2605c0 Fix warning about NULL compare 2018-01-18 21:43:45 +08:00
23102bc18e Fix bug, use &loop->uv replace loop. 2018-01-18 21:43:44 +08:00
43833af53c Fix warning about math functions, include isnan, isinf, fpclassify. 2018-01-18 21:43:44 +08:00
3632f02564 Fix warning about variable length array. 2018-01-18 21:43:43 +08:00
5a594091dc Fix warning about unused value. 2018-01-18 21:30:06 +08:00
15334dcd89 Fix warning unused static function 2018-01-18 21:30:05 +08:00
12acf0f7a7 Fix warning when assing size_t type value to uv_buf_t.len, convert type to ULONG on Windows. 2018-01-18 21:30:04 +08:00
bac86a1941 Fix warning when redefine RGB on Windows
1
2018-01-18 21:30:04 +08:00
06994e0e21 Fix warning about conversion on mingw64 2018-01-18 21:30:03 +08:00
bc17ad31dc os/input.c: parse keycodes in non-string context #7411
cb02137dfa had two mistakes, of the same nature: trans_special() must
be invoked with in_string=false unless the parsing context is a VimL
string. replace_termcodes() and input_enqueue() are low-level
mechanisms where VimL strings do not exist.

keymap.c: adjust double-quote case to satisfy keymap_spec.lua

closes #7410
2018-01-18 01:37:51 +01:00
8fc437ef43 runtime: UpdateRemotePlugins: allow bar (#7865) 2018-01-17 20:50:17 +01:00
1c6e956079 Merge #7862 'fix resize-related segfaults' 2018-01-16 10:10:02 +01:00
fed928b438 ugrid.c: destroy_cells(): avoid double-free
https://github.com/neovim/neovim/issues/7572#issuecomment-345257295
2018-01-16 09:38:08 +01:00
1be315de37 tui: final_column_wrap(): fix row calculation
closes #7572
closes #7579
closes #7628

ASAN report:

    ==9500==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6040000024c0 at pc 0x00000187d2ca bp 0x7fc3c6e58d10 sp 0x7fc3c6e58d08
    READ of size 8 at 0x6040000024c0 thread T1
        0 0x187d2c9 in ugrid_put /home/vagrant/neovim/build/../src/nvim/ugrid.c:107:17
        1 0x1850adf in tui_put /home/vagrant/neovim/build/../src/nvim/tui/tui.c:1012:10
        2 0x18a6ce6 in ui_bridge_put_event /home/vagrant/neovim/build/src/nvim/auto/ui_events_bridge.generated.h:154:3
        3 0xa4dcda in multiqueue_process_events /home/vagrant/neovim/build/../src/nvim/event/multiqueue.c:150:7
        4 0xa478bf in loop_poll_events /home/vagrant/neovim/build/../src/nvim/event/loop.c:63:3
        5 0x185451c in tui_main /home/vagrant/neovim/build/../src/nvim/tui/tui.c:362:12
        6 0x18a3080 in ui_thread_run /home/vagrant/neovim/build/../src/nvim/ui_bridge.c:106:3
        7 0x7fc3caaac6b9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76b9)
        8 0x7fc3c9ca33dc in clone /build/glibc-bfm8X4/glibc-2.23/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:109

    0x6040000024c0 is located 0 bytes to the right of 48-byte region [0x604000002490,0x6040000024c0)
    allocated by thread T1 here:
        0 0x50e048 in malloc (/home/vagrant/neovim/build/bin/nvim+0x50e048)
        1 0xf7ab71 in try_malloc /home/vagrant/neovim/build/../src/nvim/memory.c:87:15
        2 0xf7ad99 in xmalloc /home/vagrant/neovim/build/../src/nvim/memory.c:121:15
        3 0x187937b in ugrid_resize /home/vagrant/neovim/build/../src/nvim/ugrid.c:32:17
        4 0x184be58 in tui_resize /home/vagrant/neovim/build/../src/nvim/tui/tui.c:770:3
        5 0x18a3dc8 in ui_bridge_resize_event /home/vagrant/neovim/build/src/nvim/auto/ui_events_bridge.generated.h:4:3
        6 0xa4dcda in multiqueue_process_events /home/vagrant/neovim/build/../src/nvim/event/multiqueue.c:150:7
        7 0xa478bf in loop_poll_events /home/vagrant/neovim/build/../src/nvim/event/loop.c:63:3
        8 0x185451c in tui_main /home/vagrant/neovim/build/../src/nvim/tui/tui.c:362:12
        9 0x18a3080 in ui_thread_run /home/vagrant/neovim/build/../src/nvim/ui_bridge.c:106:3
        10 0x7fc3caaac6b9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76b9)

    Thread T1 created by T0 here:
        0 0x4655ed in __interceptor_pthread_create (/home/vagrant/neovim/build/bin/nvim+0x4655ed)
        1 0x1ad87b0 in uv_thread_create /home/vagrant/neovim/.deps/build/src/libuv/src/unix/thread.c:75
        2 0x184b9aa in tui_start /home/vagrant/neovim/build/../src/nvim/tui/tui.c:159:10
        3 0x188dd4c in ui_builtin_start /home/vagrant/neovim/build/../src/nvim/ui.c:125:3
        4 0xe6d399 in main /home/vagrant/neovim/build/../src/nvim/main.c:457:5
        5 0x7fc3c9bbc82f in __libc_start_main /build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:291
2018-01-16 09:37:55 +01:00
60d6a8b13d Merge #7860 'fix get_buffer_lines' 2018-01-16 08:21:25 +01:00
514a51ef3e get_buffer_lines: Return a string, when requested, on invalid input
Closes #7859
2018-01-15 22:55:15 -05:00
c06995b34d Merge #7858 'vim-patch: spell-related patches' 2018-01-16 02:14:41 +01:00
9cabe826ba lint 2018-01-16 01:12:16 +01:00
b558f750bf vim-patch:8.0.1419: cursor column is not updated after ]s
Problem:    Cursor column is not updated after ]s. (Gary Johnson)
Solution:   Set the curswant flag.

b73fa629d6
2018-01-16 00:13:22 +01:00
6020e8b69e vim-patch:8.0.1225: no check for spell region being zero
Problem:    No check for spell region being zero. (geeknik)
Solution:   Check for zero. (closes vim/vim#2252)

ee03b94124
2018-01-16 00:08:22 +01:00
fe7a53f3cf test/old: skip enc=latin1 tests 2018-01-16 00:06:59 +01:00
682d5ff8e6 vim-patch:8.0.0792: spell test leaves files behind
Problem:    Spell test leaves files behind.
Solution:   Delete the files.

1a0f200500
2018-01-16 00:04:13 +01:00
34cc04d753 vim-patch:8.0.0658: spell test is old style
Problem:    Spell test is old style.
Solution:   Turn the spell test into a new style test (pschuh, closes vim/vim#1778)

d2c061d24c
2018-01-16 00:03:05 +01:00
3f9f7cfab1 vim-patch:8.0.0601: no test coverage for :spellrepall
Problem:    No test coverage for :spellrepall.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#1717)

545cb79da5
2018-01-16 00:01:19 +01:00
2b1bcd446b runtime: include en.utf-8.spl
Install en.utf-8.spl by default.

- Allows spell-related tests to run.
- Avoids download prompt for spelllang=en users
2018-01-15 23:58:52 +01:00
26251d6d06 vim-patch:8.0.0374: invalid memory access when using :sc in Ex mode (#7849)
Problem:    Invalid memory access when using :sc in Ex mode. (Dominique Pelle)
Solution:   Avoid the column being negative.  Also fix a hang in Ex mode.

ba748c8a84
2018-01-15 23:54:56 +01:00
f8f7f9d5f5 vim-patch:8.0.0151,3,4 #7389
vim-patch:8.0.0151
Problem:    To pass buffer content to system() and systemlist() one has to
            first create a string or list.
Solution:   Allow passing a buffer number. (LemonBoy,
            closes vim/vim#1240)
12c4492dd3

vim-patch:8.0.0153
Problem:    system() test fails on MS-Windows.
Solution:   Deal when extra space and CR.
9d9c356517

vim-patch:8.0.0154
Problem:    system() test fails on OS/X.
Solution:   Deal with leading spaces.
31f19ce0a0
2018-01-15 23:50:40 +01:00
de0a9548f7 Merge #7806 from ZyX-I/list-stat
Add a way to collect list usage statistics
2018-01-15 23:35:20 +01:00
726197d890 Merge #7850 'vim patches' 2018-01-15 22:42:52 +01:00
f09a30d5b0 Merge #7839 'coverity fixes' 2018-01-15 22:31:11 +01:00
900708f93b Merge #7855 from ckelsel/vim-8.0.0398 2018-01-15 22:10:05 +01:00
7dd3910f47 tutor: don't resize (#7854) 2018-01-15 21:59:37 +01:00
ac87d9de69 Fix an off-by-one error in the documentation of nvim_buf_clear_highlight (#7853) 2018-01-15 21:45:10 +01:00
423d7af3df man.lua: avoid float conversion on lua 5.3 (#7851)
Error detected while processing function man#open_page[58]..<SNR>54_put_page:
    line    8:
    E5105: Error while calling lua chunk: /usr/share/nvim/runtime/lua/man.lua:165: Vim(let):E805: Using a Float as a Number
2018-01-15 20:14:27 +01:00
808f504305 vim-patch:8.0.0421: diff mode wrong when adding line at end of buffer
Problem:    Diff mode is displayed wrong when adding a line at the end of a
            buffer.
Solution:   Adjust marks in diff mode. (James McCoy, closes vim/vim#1329)

f58a8475e1
2018-01-15 20:20:15 +08:00
28998cfd81 vim-patch:8.0.0402: :map completion does not have <special>
Problem:    :map completion does not have <special>. (Dominique Pelle)
Solution:   Recognize <special> in completion.  Add a test.

cf5fdf7d16
2018-01-15 19:48:18 +08:00
63bb7198df vim-patch:8.0.0398: illegal memory access with "t"
Problem:    Illegal memory access with "t".
Solution:   Use strncmp() instead of memcmp(). (Dominique Pelle, closes vim/vim#1528)

66727e1607
2018-01-15 19:41:01 +08:00
b9f3805447 vim-patch:8.0.0406: arabic shaping code is verbose
Problem:    The arabic shaping code is verbose.
Solution:   Shorten the code without changing the functionality.

7f73b54631
2018-01-15 19:16:04 +08:00
770ec228c7 vim-patch:8.0.0391: arabic support is verbose and not well tested
Problem:    Arabic support is verbose and not well tested.
Solution:   Simplify the code.  Add more tests.

5f53dd3f74
2018-01-15 18:18:59 +08:00
fc97e9fbdf vim-patch:8.0.0389: test for arabic does not check what is displayed
Problem:    Test for arabic does not check what is displayed.
Solution:   Improve what is asserted. (Dominique Pelle, closes vim/vim#1523)
            Add a first shaping test.

5342f00ff9
2018-01-15 17:33:13 +08:00
fe4ba69958 vim-patch:8.0.0385: no tests for arabic
Problem:    No tests for arabic.
Solution:   Add a first test for arabic. (Dominique Pelle, closes vim/vim#1518)

b5e8377364
2018-01-14 20:57:27 +08:00
7faeaf9f24 vim-patch:8.0.0381: diff mode is not sufficiently tested
Problem:    Diff mode is not sufficiently tested.
Solution:   Add more diff mode tests. (Dominique Pelle, closes vim/vim#1515)

aeb661e1f4
2018-01-14 20:50:59 +08:00
4b8d6caf48 vim-patch:8.0.0380: with 'linebreak' double wide char wraps badly
Problem:    With 'linebreak' set and 'breakat' includes ">" a double-wide
            character results in "<<" displayed.
Solution:   Check for the character not to be replaced. (Ozaki Kiichi,
            closes vim/vim#1456)

38632faf63
2018-01-14 20:50:35 +08:00
ZyX
a8cb510a2e channel: Make empty output be represented by [''] again 2018-01-14 01:33:18 +03:00
ZyX
6a1557f2f4 eval/typval: Log list actions
New logging is guarded by cmake LOG_LIST_ACTIONS define. To make it more
efficient it is allocated as a linked list with chunks of length
2^(7+chunk_num); that uses basically the same idea as behind increasing kvec
length (make appending O(1) (amortized)), but reduces constant by not bothering
to move memory around what realloc() would surely do: it is not like we need
random access to log entries here to justify usage of a single continuous memory
block.
2018-01-14 01:33:18 +03:00
ZyX
c10ae4bc85 os/fileio: Fix some flag names in file_* functions documentation 2018-01-14 01:33:17 +03:00
ZyX
9ea1752d60 *: Provide list length when allocating lists 2018-01-14 01:33:16 +03:00
8eb0888a5d vim-patch:8.0.0582: illegal memory access with z= command
Problem:    Illegal memory access with z= command. (Dominique Pelle)
Solution:   Avoid case folded text to be longer than the original text.  Use
            MB_PTR2LEN() instead of MB_BYTE2LEN().

5b276aa80e
2018-01-13 19:42:07 +01:00
9ddeb6e187 vim-patch:8.0.0364 (#7837)
vim-patch:8.0.0364: ]s does not move cursor with two spell errors in one line

Problem:    ]s does not move cursor with two spell errors in one line. (Manuel
            Ortega)
Solution:   Don't stop search immediately when wrapped, search the line first.
            (Ken Takata)  Add a test.

d3f78dc9eb

* disable spell test for now
2018-01-13 19:26:21 +01:00
624ac8aede coverity/161216: get_user_input: RETURN_LOCAL
*** CID 161216:  Memory - illegal accesses  (RETURN_LOCAL)
    /src/nvim/eval.c: 11143 in get_user_input()
    11137       rettv->vval.v_string =
    11138         (char_u *)getcmdline_prompt(inputsecret_flag ? NUL : '@', p, echo_attr,
    11139                                     xp_type, xp_arg, input_callback);
    11140       ex_normal_busy = save_ex_normal_busy;
    11141       callback_free(&input_callback);
    11142
    >>>     CID 161216:  Memory - illegal accesses  (RETURN_LOCAL)
    >>>     Using "cancelreturn", which points to an out-of-scope variable "def".
    11143       if (rettv->vval.v_string == NULL && cancelreturn != NULL) {
    11144         rettv->vval.v_string = (char_u *)xstrdup(cancelreturn);
    11145       }
    11146
    11147       xfree(xp_arg);
    11148
2018-01-11 10:45:16 +01:00
18d244eded coverity/169163: decode_string: Null pointer deref
*** CID 169163:  Null pointer dereferences  (FORWARD_NULL)
    /src/nvim/eval/decode.c: 290 in decode_string()
    284         if (elw_ret == -1) {
    285           tv_clear(&tv);
    286           return (typval_T) { .v_type = VAR_UNKNOWN, .v_lock = VAR_UNLOCKED };
    287         }
    288         return tv;
    289       } else {
    >>>     CID 169163:  Null pointer dereferences  (FORWARD_NULL)
    >>>     Passing null pointer "s" to "xmemdupz", which dereferences it. (The dereference is assumed on the basis of the 'nonnull' parameter attribute.)
    290         return (typval_T) {
    291           .v_type = VAR_STRING,
    292           .v_lock = VAR_UNLOCKED,
    293           .vval = { .v_string = (char_u *)(
    294               s_allocated ? (char *)s : xmemdupz(s, len)) },
    295         };
2018-01-11 10:45:16 +01:00
911b1e49ab Merge #7821 'api: nvim_command_output' 2018-01-11 10:39:41 +01:00
5055d4a755 api: nvim_command_output: direct impl 2018-01-10 23:58:56 +01:00
c095f83116 api: change nvim_command_output behavior
Implement nvim_command_output with `execute({cmd},"silent")`.

Behavior changes:
- does not provoke any hit-enter prompt
- no longer prepends a newline char
- does not capture some noise (like the "[New File]" message, see the
  change to tabnewentered_spec.lua)

Technically ("bug-for-bug") this a breaking change.  But the previous
behavior of nvim_command_output meant that it probably wasn't used for
anything outside of tests.

Also remove the undocumented `v:command_output` variable which was
a hack introduced only for the purposes of nvim_command_output.

closes #7726
2018-01-10 23:45:44 +01:00
f0845197d8 ci/travis: require "sudo" for ASAN_UBSAN build
Workaround for this fun new issue:

    ==27404==LeakSanitizer has encountered a fatal error.
    ==27404==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
    ==27404==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)
    Failed: E /build|logs :: Runtime errors detected.

https://github.com/travis-ci/travis-ci/issues/9033
https://github.com/google/sanitizers/issues/764
2018-01-10 23:35:10 +01:00
34de6d33c9 lint 2018-01-09 22:58:24 +00:00
b23fc444b5 vim-patch:8.0.0204: compiler warns for uninitialized variable
Problem:    Compiler warns for uninitialized variable. (Tony Mechelynck)
Solution:   When skipping set "id" to -1.

eb46f8fa14
2018-01-09 22:11:16 +00:00
e888439f55 vim-patch:8.0.0202: no test for invalid syntax group name
Problem:    No test for invalid syntax group name.
Solution:   Add a test for group name error and warning.

4007ed4a5e
2018-01-09 22:11:16 +00:00
7f70c5f7b7 vim-patch:8.0.0201: completion of highlight groups includes cleared names
Problem:    When completing a group name for a highlight or syntax command
            cleared groups are included.
Solution:   Skip groups that have been cleared.

d61e8aaae5
2018-01-09 22:11:16 +00:00
889bc3c20c vim-patch:8.0.0200: some syntax arguments are not tested
Problem:    Some syntax arguments are not tested.
Solution:   Add more syntax command tests.

58f60ca2fc
2018-01-09 22:11:16 +00:00
b58c17f8df vim-patch:8.0.0198
Problem:    Some syntax arguments take effect even after "if 0". (Taylor
            Venable)
Solution:   Properly skip the syntax statements.  Make "syn case" and "syn
            conceal" report the current state.  Fix that "syn clear" didn't
            reset the conceal flag.  Add tests for :syntax skipping properly.

de318c5c35
2018-01-09 22:11:15 +00:00
a8ad6b4d51 cmake: install *.lua files 2018-01-09 11:37:49 +01:00
59888b68ab Merge #7623 'man.vim: highlight bold, underlined text' 2018-01-09 10:10:22 +01:00
0ed31303b5 Merge #7826 from ckelsel/vim-8.0.0351 2018-01-08 22:23:05 +01:00
e182a8c836 vim-patch:8.0.0352: not easy to see when a typval needs to be cleared
Problem:    The condition for when a typval needs to be cleared is too
            complicated.
Solution:   Init the type to VAR_UNKNOWN and clear it always.

f06e5a549f
2018-01-08 13:23:05 +08:00
b61a305039 vim-patch:8.0.0351: no test for concatenating an empty string
Problem:    No test for concatenating an empty string that results from out of
            bounds indexing.
Solution:   Add a simple test.

218426896c
2018-01-08 12:24:21 +08:00
9370a0e5d8 ci/travis: install neovim npm module on osx (#7825)
Always get latest nvm on osx to fix lts aliases.
2018-01-08 00:37:31 +01:00
ccdbcfea0b Merge #7820 'ci/travis/macOS: skip ruby gem install' 2018-01-07 20:34:16 +01:00
46a9600d0e ci/travis: macOS: skip ruby-neovim install
With 6fa0a0a516 the neovim-ruby gem installs successfully, but
ruby_spec.lua can't find it: g:ruby_host_prog needs to be set correctly.

Just skip the whole thing for now, so that CI builds don't fail.
2018-01-07 20:09:25 +01:00
6fa0a0a516 ci/travis: macOS: switch ruby version
Travis macOS builds are failing because of neovim-ruby gem dependencies.
Switch default ruby to a newer version to make the builds pass.
2018-01-07 20:04:57 +01:00
8c2cb81d7e test: set_shell_powershell(): update flags (#7819) 2018-01-07 16:20:37 +01:00
4fedad6c5b Merge #7753 'win: enable more functional tests' 2018-01-06 17:52:14 +01:00
ab1e11e44f test: win: yes is unavailable on Windows 2018-01-06 17:50:49 +01:00
d4485f7cc0 win: test: check non-shell system() 2018-01-06 17:49:42 +01:00
8d58012786 test: use unix fileformat to test NULs on systemlist 2018-01-06 17:49:42 +01:00
7311fb7cad win: enable more functional tests
- plugin/shada_spec.lua: Use \r\n as Windows EOL for tests on
  BufWriteCmd, FileWriteCmd, FileAppendCmd. Alternative is 'set
  fileformat=unix'.
2018-01-06 17:47:00 +01:00
e9b5616eaf win: enable tests in ex_terminal_spec 2018-01-06 17:46:49 +01:00
c82e7c75fe version.c: update [ci skip] (#7780) 2018-01-06 16:35:19 +01:00
a18db72a36 third-party: revert to jemalloc 4.5.0
ref #7746
closes #7808
jemalloc-5.0.1 broke the Ubuntu Unstable PPA builds on arm64:
https://launchpadlibrarian.net/351647411/buildlog_ubuntu-artful-arm64.neovim_0.2.0ubuntu1+git201712291800+3837+26~ubuntu17.10.1_BUILDING.txt.gz).

    make[5]: Entering directory '/<<BUILDDIR>>/neovim-0.2.0ubuntu1+git201712291800+3837+26~ubuntu17.10.1/build'
    Segmentation fault (core dumped)
    runtime/CMakeFiles/vimball-tags.dir/build.make:57: recipe for target 'runtime/CMakeFiles/vimball-tags' failed
    make[5]: *** [runtime/CMakeFiles/vimball-tags] Error 139
    make[5]: Leaving directory '/<<BUILDDIR>>/neovim-0.2.0ubuntu1+git201712291800+3837+26~ubuntu17.10.1/build'
    CMakeFiles/Makefile2:7467: recipe for target 'runtime/CMakeFiles/vimball-tags.dir/all' failed

jemalloc bug:
https://github.com/jemalloc/jemalloc/issues/979
2018-01-06 16:22:38 +01:00
b616ef9b22 tests: stderr output contains cp noise
closes #7811
2018-01-05 18:18:26 +01:00
7c4bb23ff3 defaults: do :filetype stuff unless explicitly "off"
Until now, the default `:filetype ...` setup was skipped if the user
config touched `:filetype` in any way (including implicitly via `:syntax
on`).  No one needs that, and it's very confusing.

Instead, proceed with `:filetype ... on` unless the user explicitly
called `:filetype ... off`.

closes #7765
2018-01-04 10:32:09 +01:00
dc4a9cbe85 Merge #7805 'eval.c: fix some scan-build warnings' 2018-01-03 19:34:47 +01:00
0a881575da vim-patch:8.0.0955: Test_existent_file() fails on some file systems
Problem:    Test_existent_file() fails on some file systems.
Solution:   Run the test again with a sleep when the test fails without a
            sleep. (James McCoy, closes vim/vim#1984)

82de3c2c03
2018-01-03 19:16:17 +01:00
5898a1dcbb Merge #7801 'tutor: adjust for 80 columns' 2018-01-03 19:11:02 +01:00
d2bc610d64 Merge pull request #7804 from jamessan/vim-8.0.0160
[RFC] vim-patch:8.0.0160
2018-01-03 07:22:35 -05:00
d55881d278 test: enable K_spec tests in Windows 2018-01-03 00:12:28 -05:00
88d643eb36 Add null check when adding variable to dict. 2018-01-02 17:22:33 -08:00
1bbe6d0a30 Add null pointer assertions for do_unlet_var. 2018-01-02 17:22:33 -08:00
2e630d2611 Refactor profiling check in call_user_func.
do_profiling is a global variable, and as such the clang static
analyzer has trouble making arguments about it.

This commit does one comparison against do_profiling and puts the
result in a local variable. This prevents errors from the value of
do_profiling changing between comparisons.
2018-01-02 17:22:33 -08:00
65ec4ea629 Add assertions for watchers
The clang static analyzer convinced itself lp->ll_newkey could be NULL.
This adds an assertion that checks this doesn't actually happen, as well
as a parallel assertion for di->di_key.
2018-01-02 17:22:33 -08:00
dea7a41138 Add another const to tv_copy
Clang static analyzer had trouble with filter_map in eval.c because
tv_copy could, in principle, change the v_type of argvars[0]. It
saw a potential null pointer going somewhere it shouldn't as a result.

The from argument in tv_copy should be const, which also cleans up the
static analyzer's complaint.
2018-01-02 17:22:33 -08:00
d63c3d9d10 Add assertion in set_var_lval for null pointer.
If the lval is a index into a list, li should not be null.
2018-01-02 17:22:33 -08:00
5f5011e8f6 lint 2018-01-02 19:35:29 -05:00
b86e44aa35 vim-patch:8.0.0160: EMSG() is sometimes used where it should be IEMSG()
Problem:    EMSG() is sometimes used for internal errors.
Solution:   Change them to IEMSG(). (Dominique Pelle)  And a few more.

de33011ec6
2018-01-02 19:35:22 -05:00
09b9f9b7ce Merge pull request #7803 from jamessan/remove-ci-special-cases
[RFC] Simplify Travis builds
2018-01-02 19:12:57 -05:00
dd0fa4fd0e ci: asan_check: No-op unless performing ASAN build 2018-01-02 08:15:32 -05:00
d162815ca9 travis: Reduce stages to flaky builds (gcov, tsan) and everything else
Separating the non-flaky builds (asan, normal builds, lint) into
separate stages simply slowed down overall CI turnaround.  Since none of
the builds rely on the output of others, reducing the stages increases
the opportunities for parallel builds.
2018-01-02 08:15:31 -05:00
dc1444e112 travis: Remove ubuntu-r-toolchain/test ppa
Use unversioned gcc/gcov commands rather than pulling in a separate
repo.
2018-01-02 08:15:31 -05:00
90aae43984 travis: Use Ubuntu's clang instead of llvm's repo
The llvm repos commonly have access issues, so removing them will
improve stability of the Travis builds.

Filtering check_log's output through asan_symbolize also avoids the
version dance every time a new clang version makes its way into Travis.
2018-01-02 08:15:31 -05:00
60716371e9 tui: support TERM=konsole-256color
TERM=konsole-256color is recognized by ncurses.

TERM=konsole-xterm might be more clever, but should not be necessary
(for Nvim at least), we already special-case Konsole in various places.
We may need to clean up some areas that currently assume Konsole always
"pretends xterm" (`TERM=xterm-256color`), though I didn't find any such
cases.

ref #6403
ref https://github.com/neovim/neovim/issues/6403#issuecomment-348713346
2018-01-01 20:30:30 +01:00
6a9f2cdc68 tutor: install metadata files for tutor documents 2018-01-01 19:08:01 +01:00
95a8af093f Merge #7800 'vim patches' 2018-01-01 18:36:36 +01:00
c5f9762b7e vim-patch:8.0.0336: flags of :substitute not sufficiently tested
Problem:    Flags of :substitute not sufficiently tested.
Solution:   Test up to two letter flag combinations. (James McCoy, closes
            vim/vim#1479)

8c50d50b6e
2018-01-01 16:47:11 +01:00
321a46b724 vim-patch: b:changedtick-related patches
vim-patch:8.0.0334
vim-patch:8.0.0335
vim-patch:8.0.0343
vim-patch:8.0.0345

Problem:    Can't access b:changedtick from a dict reference.
Solution:   Make changedtick a member of the b: dict. (inspired by neovim
            vim/vim#6112)
79518e2ace

vim-patch:8.0.0343: b:changedtick can be unlocked
Problem:    b:changedtick can be unlocked, even though it has no effect.
            (Nikolai Pavlov)
Solution:   Add a check and error E940. (closes #1496)

vim-patch:8.0.0345: islocked('d.changedtick') does not work
Problem:    islocked('d.changedtick') does not work.
Solution:   Make it work.

vim-patch:8.0.0335: functions test fails
Problem:    Functions test fails.
Solution:   Use the right buffer number.
507647da31
2018-01-01 16:43:38 +01:00
1d8c612f78 vim-patch:8.0.0339: illegal memory access with vi' (#7794)
Problem:    Illegal memory access with vi'
Solution:   For quoted text objects bail out if the Visual area spans more
            than one line.

46522af724
2018-01-01 16:08:26 +01:00
f4e372c8ab tutor: readjust tutor for 80 char wide terminals 2018-01-01 14:26:45 +01:00
907b2f18f7 Merge pull request #7795 from jamessan/vim-8.0.0591
[RFC] vim-patch:8.0.0591,8.0.0634,8.0.0641,8.0.0657
2017-12-31 16:07:53 -05:00
9fe6c12e81 doc: deprecate 'gdefault'
[ci skip]
2017-12-31 10:18:43 -05:00
d0c4bd23f7 vim-patch:8.0.0657: cannot get and set quickfix list items
Problem:    Cannot get and set quickfix list items.
Solution:   Add the "items" argument to getqflist() and setqflist(). (Yegappan
            Lakshmanan)

6a8958db25
2017-12-31 01:00:59 -05:00
3efc50d1d4 vim-patch:8.0.0641: cannot set a separate highlighting for the quickfix line
Problem:    Cannot set a separate highlighting for the current line in the
            quickfix window.
Solution:   Add QuickFixLine. (anishsane, closes vim/vim#1755)

2102035488
2017-12-31 00:32:59 -05:00
6742fd8aea vim-patch:8.0.0634: cannot easily get to the last quickfix list
Problem:    Cannot easily get to the last quickfix list.
Solution:   Add "$" as a value for the "nr" argument of getqflist() and
            setqflist(). (Yegappan Lakshmanan)

875feea6ce
2017-12-31 00:25:01 -05:00
89d1b36084 vim-patch:8.0.0591: changes to eval functionality not documented
Problem:    Changes to eval functionality not documented.
Solution:   Include all the changes.

45d2cca1ea
2017-12-30 23:35:45 -05:00
9ad557fb2d Merge pull request #7762 from ZyX-I/remove-some-listitems
Remove some tv_list_item_…() functions
2017-12-31 01:11:50 +01:00
ZyX
8ac7c23b7d eval: Fix linter errors 2017-12-31 01:00:13 +03:00
ZyX
c55cf5f4c1 eval,lua/converter: Fix problems spotted in review 2017-12-31 01:00:13 +03:00
46f432074e tests: termclose_spec: fix flaky SIGTERM test #7787
Followup to https://github.com/neovim/neovim/pull/7217.
Build failure: https://travis-ci.org/neovim/neovim/jobs/322930672#L2958.
2017-12-30 22:49:50 +01:00
a30242d661 Merge pull request #7791 from jamessan/vim-8.0.0608
[RFC] vim-patch:8.0.0608
2017-12-30 10:04:03 -05:00
0d548b73ef scripts/vim-patch.sh: continue when patching with -P fails (#7790)
The `set -e` caused the script to stop in case `patch` fails, but it is
better to continue giving instructions.
2017-12-30 14:15:51 +01:00
9dc90fcde1 Merge #7782 'Fix TabClose autocommand via close_windows' 2017-12-30 14:12:25 +01:00
caf94c72c5 lint 2017-12-30 07:56:12 -05:00
697fb05c58 vim-patch:8.0.0608: cannot manipulate other than the current quickfix list
Problem:    Cannot manipulate other than the current quickfix list.
Solution:   Pass the list index to quickfix functions. (Yegappan Lakshmanan)

a3921f48c6
2017-12-30 01:34:08 -05:00
5dd2ca767f use snprintf and has_event 2017-12-29 20:52:56 +01:00
e84e1b68c1 Move applying of TabClosed to win_close_othertab 2017-12-29 20:38:17 +01:00
3eaa9a2579 man.vim: always keep the alternate buffer (#7784)
Closes #7772
2017-12-29 19:00:10 +01:00
5563e808da health.vim: fix $VIRTUAL_ENV validation
Check that the full path to the python interpreter starts with
$VIRTUAL_ENV.

closes #7770
2017-12-29 18:45:21 +01:00
49f4358b0a third-party: update deps #7746
- Latest commit from LuaJIT 2.0.5
2017-12-29 17:38:37 +01:00
2c436b3362 Fix TabClose autocommand via close_windows
Fixes https://github.com/neovim/neovim/issues/7781
2017-12-29 16:56:14 +01:00
ddcfb49262 Merge #7755 2017-12-28 22:48:49 +01:00
eb44519b5d Address PR comments 2017-12-27 23:28:04 -05:00
134c0f0bdb Add functional tests for man highlighting 2017-12-27 23:27:14 -05:00
6740c94562 Add support for escape sequences 2017-12-27 23:27:14 -05:00
c28ce5f619 Switch to processing in Lua 2017-12-27 23:27:14 -05:00
0446d4d691 Highlight backspaced characters 2017-12-27 23:27:14 -05:00
061b942dc0 Merge #7771
health.vim: remove :CheckHealth command
2017-12-27 19:30:16 +01:00
2f3e001717 health.vim: minor refactor (group related logic) 2017-12-27 13:53:01 +01:00
341102fe9f health.vim: remove :CheckHealth command
For back-compat, :CheckHealth runs :checkhealth. But don't define
:CheckHealth explicitly, it adds noise to wildmenu completion.

Completion of healthchecks doesn't yet work with :checkhealth, this is
a regression but it needs to be implemented for :checkhealth rather than
keeping :CheckHealth around.
2017-12-27 13:00:58 +01:00
102e0689d8 Merge #7735 'runtime fixes, doc updates' 2017-12-27 12:53:54 +01:00
ac2f90f2e1 version.c: update 2017-12-27 12:30:55 +01:00
7773bbd098 vimpatch.lua: automate version.c
Invoke it like this:

    VIM_SOURCE_DIR=~/neovim/.vim-src/ nvim -i NONE -u NONE --headless +'luafile ./scripts/vimpatch.lua' +q
2017-12-27 12:30:55 +01:00
903ed09a61 vim-patch.sh: extract list_vimpatch_tokens()
Use streams instead of for-loop (20x speedup for list_vimpatch_tokens).
2017-12-26 04:00:18 +01:00
973bd10a12 vim-patch.sh: introduce -V 2017-12-26 04:00:18 +01:00
fe60fa9faa doc
vim-patch:8.0.1206: no autocmd for entering or leaving the command line
(commit a4f6cec7a3)

NA patches:
vim-patch:8.0.0320: warning for unused variable with small build
2017-12-26 03:58:28 +01:00
ZyX
b6ee90a243 eval: Refactor some potentially dangerous list appends 2017-12-25 01:44:44 +03:00
ZyX
6ab5eb347b eval: Remove magic numbers from find_some_match() type argument 2017-12-25 01:08:58 +03:00
ZyX
bc52ec6110 *: Fix linter errors 2017-12-24 23:09:26 +03:00
ZyX
7997147245 eval: Replace some tv_list_item_remove() calls
There is nothing wrong with them, just it is generally better to remove
a range then to remove items individually.
2017-12-24 17:52:24 +03:00
ZyX
2923e8533d unittests: Do gc after reporting error, not before
Reason: test may contain cleanup at the endwhich is needed for GC to work 
properly, but is not done if test fails. With collectgarbage() in former 
position it would crash when collecting garbage.
2017-12-24 17:42:23 +03:00
ZyX
32689aa5be unittests: Remove start of trace, not end 2017-12-24 17:13:49 +03:00
ZyX
67fa9e5237 eval: Rename tv_list_remove_items() to tv_list_drop_items()
tv_list_remove_items() may cause confusion with tv_list_item_remove()
2017-12-24 16:38:30 +03:00
ZyX
ac55558c97 eval/typval: Make tv_list_item_remove return pointer to the next item 2017-12-24 14:09:36 +03:00
ZyX
608c3d7baf eval/typval: Remove tv_list_item_free() as it is unused 2017-12-24 14:09:36 +03:00
ZyX
6bf3dc77c4 eval/typval: Make tv_list_item_alloc static
Better write this bit in lua then make reviewers or clint filter out 
tv_list_item_alloc().
2017-12-24 14:09:36 +03:00
ZyX
0c533a488f *: Remove most calls to tv_list_item_alloc
Still left calls in eval/typval.c and test/unit/eval/helpers.lua. Latter is the 
only reason why function did not receive `static` modifier.
2017-12-24 14:09:35 +03:00
249bdb07dd Merge #7761 from ZyX-I/fix-7169 2017-12-24 09:24:39 +01:00
ZyX
6b45dbca04 mark: Make sure that jumplist item will not have zero lnum
Fixes #7169
2017-12-24 00:32:43 +03:00
dee78a4095 Merge #7708 from ZyX-I/hide-container-impl 2017-12-23 18:17:01 +01:00
ec86f4215f Merge #7646 from bfredl/chan_buffered
Document and defer error message when buffered stream would overwrite channels dict key
2017-12-23 15:49:13 +01:00
61ba3c5e31 provider: delete vimL stderr collector, now that it exists builtin 2017-12-23 14:32:25 +01:00
308dd53783 channel: check for existance before trying to set key
This avoids an error message in async context, where it is not safe.
2017-12-23 14:02:00 +01:00
ZyX
5cb7a709e7 clint: Make linter report line where it found opening brace 2017-12-23 15:47:23 +03:00
ZyX
d2c01d529f regexp: Fix linter errors 2017-12-23 15:47:04 +03:00
ZyX
c9ab209f9e Merge branch 'master' into hide-container-impl 2017-12-23 15:27:42 +03:00
eb95b88156 vim-patch:8.0.0315: :help :[range] does not work
Problem:    ":help :[range]" does not work. (Tony Mechelynck)
Solution:   Translate to insert a backslash.

a76f59d817
2017-12-21 18:55:56 +08:00
6c731d33f6 vim-patch:8.0.0314: getcmd*() functions are not tested
Problem:    getcmdtype(), getcmdpos() and getcmdline() are not tested.
Solution:   Add tests. (Yegappan Lakshmanan)

65189a1294
2017-12-21 18:40:10 +08:00
aa951b1489 Merge pull request #7751 from jamessan/vim-8.0.0590
[RFC] vim-patch:8.0.0590,8.0.0595,8.0.0597,8.0.0606
2017-12-19 19:21:30 -05:00
190814bdae vim-patch:8.0.0606: cannot set the context for a specified quickfix list
Problem:    Cannot set the context for a specified quickfix list.
Solution:   Use the list index instead of the current list. (Yegappan
            Lakshmanan)

6e62da3e14
2017-12-19 14:07:24 -05:00
cdd86f42cf vim-patch:8.0.0597: off-by-one error in size computation
Problem:    Off-by-one error in buffer size computation.
Solution:   Use ">=" instead of ">". (Lemonboy, closes vim/vim#1694)

253f912877
2017-12-19 14:07:24 -05:00
6fcadab3ce vim-patch:8.0.0595: Coverity warning for not checking return value
Problem:    Coverity warning for not checking return value of dict_add().
Solution:   Check the return value for FAIL.

beb9cb19c6
2017-12-19 14:07:24 -05:00
20708a07bf vim-patch:8.0.0590: cannot add a context to locations
Problem:    Cannot add a context to locations.
Solution:   Add the "context" entry in location entries. (Yegappan Lakshmanan,
            closes vim/vim#1012)

8f77c5a4ec
2017-12-19 14:07:24 -05:00
53a530b2f5 Merge pull request #7747 from jamessan/vim-8.0.0565
vim-patch:8.0.0565,8.0.0574,8.0.0579,8.0.0580
2017-12-18 23:52:06 -05:00
4d2d844c12 vim-patch:8.0.0580: cannot set the valid flag with setqflist()
Problem:    Cannot set the valid flag with setqflist().
Solution:   Add the "valid" argument. (Yegappan Lakshmanan, closes vim/vim#1642)

f1d21c8cc8
2017-12-18 21:44:42 -05:00
9fb7926a0d vim-patch:8.0.0579: duplicate test case for quickfix
Problem:    Duplicate test case for quickfix.
Solution:   Remove the function. (Yegappan Lakshmanan)

9b77016545
2017-12-18 21:40:24 -05:00
dd27392861 vim-patch:8.0.0574: get only one quickfix list after :caddbuf
Problem:    Get only one quickfix list after :caddbuf.
Solution:   Reset qf_multiline. (Yegappan Lakshmanan)

99895eac1c
2017-12-18 21:39:51 -05:00
1b2d386a85 vim-patch:8.0.0565: using freed memory in :caddbuf
Problem:    Using freed memory in :caddbuf after clearing quickfix list.
            (Dominique Pelle)
Solution:   Set qf_last to NULL.

31bdd13c33
2017-12-18 21:36:44 -05:00
88863bb6ae Merge pull request #7744 from jamessan/vim-8.0.0517
[RFC] vim-patch:8.0.0517,8.0.0536,8.0.0584
2017-12-18 21:34:09 -05:00
c01a84e344 Updating to latest UNIBILIUM (#7745)
Update to unibilium 1.2.1
2017-12-18 18:53:53 -05:00
765ff94b5b vim-patch:8.0.0584: memory leak when executing quickfix tests
Problem:    Memory leak when executing quickfix tests.
Solution:   Free the list reference. (Yegappan Lakshmanan)

d788f6fe89
2017-12-18 14:57:57 -05:00
f0bd2bc39a vim-patch:8.0.0536: quickfix window not updated when freeing quickfix stack
Problem:    Quickfix window not updated when freeing quickfix stack.
Solution:   Update the quickfix window. (Yegappan Lakshmanan)

69f40be645
2017-12-18 14:56:17 -05:00
fb8592b7ba vim-patch:8.0.0517: there is no way to remove quickfix lists
Problem:    There is no way to remove quickfix lists (for testing).
Solution:   Add the 'f' action to setqflist(). Add tests. (Yegappan
            Lakshmanan)

b6fa30ccc3
2017-12-18 14:35:55 -05:00
6b5d92f9e0 Merge pull request #7740 from jamessan/vim-8.0.0404
[RFC] vim-patch:8.0.0404,8.0.0484
2017-12-18 07:05:51 -05:00
8536348813 vim-patch:8.0.0484: :lhelpgrep does not fail after a successful one
Problem:    Using :lhelpgrep with an argument that should fail does not
            produce an error if the previous :helpgrep worked.
Solution:   Use another way to detect that autocommands made the quickfix info
            invalid. (Yegappan Lakshmanan)

ee85df3763
2017-12-17 21:05:20 -05:00
ccbf14322a vim-patch:8.0.0404: not enough testing for quickfix
Problem:    Not enough testing for quickfix.
Solution:   Add some more tests. (Yegappan Lakshmanan)

391b1dd040
2017-12-17 20:55:50 -05:00
e6f8b105b0 Merge pull request #7736 from jamessan/vim-8.0.0420
[RFC] vim-patch:8.0.0420: text garbled when the system encoding differs from 'encoding'
2017-12-17 20:15:12 -05:00
cca6d4b267 provider/nodejs: more robust version-check (#7738) 2017-12-18 01:48:30 +01:00
451ff827b8 Merge #7739 'ASAN/LeakSanitizer: ignore loop_schedule_deferred()' 2017-12-18 01:44:22 +01:00
6e0c038a3c ASAN/LeakSanitizer: ignore loop_schedule_deferred()
clang ASAN/LeakSanitizer error (observed in #7706):

    ==21832==ERROR: LeakSanitizer: detected memory leaks
    Direct leak of 56 byte(s) in 1 object(s) allocated from:
        0 0x511b26 in malloc (/home/travis/build/neovim/neovim/build/bin/nvim+0x511b26)
        1 0x1009a84 in try_malloc /home/travis/build/neovim/neovim/src/nvim/memory.c:87:15
        2 0x1009c44 in xmalloc /home/travis/build/neovim/neovim/src/nvim/memory.c:121:15
        3 0xaa8c36 in loop_schedule_deferred /home/travis/build/neovim/neovim/src/nvim/event/loop.c:89:19
        4 0x190856a in tui_main /home/travis/build/neovim/neovim/src/nvim/tui/tui.c:367:5
        5 0x1963d61 in ui_thread_run /home/travis/build/neovim/neovim/src/nvim/ui_bridge.c:106:3
        6 0x2b5d4190d183 in start_thread /build/eglibc-SvCtMH/eglibc-2.19/nptl/pthread_create.c:312

Possible explanation: During exit, `Loop.thread_events` may not get
flushed, so `loop_deferred_event()` is never called.

We could instead try to unwind `Loop.thread_events` during teardown, but
it seems lower-risk to just tell ASAN to ignore it.

Valgrind does not complain:
    $ while :; do { 2>valglog.txt valgrind ./build/bin/nvim -u NONE +q ; } ; if ! [ $? = 0 ] ; then break ; fi ; done
2017-12-17 22:47:37 +01:00
4a58bd514e Merge pull request #7732 from jamessan/patch-summary
vim-patch.sh: Include upstream summary in commit message
2017-12-17 14:10:30 -05:00
2851bb9eff health.vim: mention g:ruby_host_prog #7737 2017-12-17 18:04:47 +01:00
f3d7eeff77 health.vim: Try pyenv root #7341 2017-12-17 17:45:59 +01:00
db0685a663 lint 2017-12-17 11:20:28 -05:00
c162bc6294 vim-patch:8.0.0420: text garbled when the system encoding differs from 'encoding'
Problem:    When running :make the output may be in the system encoding,
            different from 'encoding'.
Solution:   Add the 'makeencoding' option. (Ken Takata)

2c7292dc5b
2017-12-17 11:20:28 -05:00
067bb1e9f4 vim-patch.sh: Include upstream summary in commit message
[ci skip]
2017-12-17 10:45:55 -05:00
be53c209c0 Merge #7706 'ci: nodejs acceptance-test' 2017-12-17 16:10:40 +01:00
103ff26c0a provider/nodejs: check version in Detect() 2017-12-17 16:09:18 +01:00
e0054fef7d health.vim: nodejs: skip if nodejs is too old 2017-12-17 16:09:18 +01:00
5b692124cc test: remove inspect test; set NODE_PATH in nodejs_spec.lua
provider#node#can_inspect will fail on some systems because it is common
to have old node versions in OS (any Linux OS that has LTS releases)
and CI (Travis, Appveyor).

NODE_PATH can be trivially set with VimL.
Build scripts don't have to set it for the nodejs tests to work.
NODE_PATH is optional to begin with and is used only as a workaround
for the neovim node.js host.
2017-12-17 16:09:18 +01:00
a1adfdc7d5 ci: nodejs client acceptance-test #7706
ci: install nodejs 8 in Appveyor, Travis

provider: check node version for debug support
Resolve https://github.com/neovim/neovim/pull/7577#issuecomment-350590592 for Unix.

provider: test if nodejs in ci supports --inspect-brk

nodejs host for neovim requires nodejs 6+ to work properly.
nodejs 6.12+ or 7.6+ is required for debug support via `node --inspect-brk`.

provider: run cli.js of nodejs host directly

npm shims are useless because the user cannot set node to debug mode via
--inspect-brk. This is problematic on Windows which use batchfiles and
shell scripts to compensate for not supporting shebang.

The patch uses `npm root -g` to get the absolute path of the global npm
modules. If that fails, then the user did not install neovim npm package
globally. Use that absolute path to find `neovim/bin/cli.js`, which is
what the npm shim actually runs with node. glob() is for a simple file
check in case bin/ is removed because the npm shims are ignored now.
2017-12-17 16:09:18 +01:00
ZyX
edccf18df5 eval: Fix some issues found in review 2017-12-17 15:23:27 +03:00
ZyX
023631463c functests: Fix linter error 2017-12-16 16:14:53 +03:00
ZyX
7f3b9a4acc Merge branch 'master' into hide-container-impl 2017-12-16 14:27:41 +03:00
ZyX
76ffe0c5aa eval: Fix linter error 2017-12-16 14:21:56 +03:00
bfb21f3e01 tui: rework deferred-termcodes ... again
- Revert timer-based approach.
- Instead, call loop_poll_events() with a timeout in an "active" loop,
  to infer that "TUI startup activity has mostly finished", but also to
  enforce a mininum time (100 ms) before emitting "enable focus
  reporting" termcode. (If TUI startup takes longer than that minimum
  time, it's probably a slow environment anyways.)
- Tickle `main_loop` by sending a dummy event.  Without this, the
  initial "focus-gained" response from the terminal may not get
  processed until the user hits a key.

ref #7720
ref #7664
ref #7649
ref #7664
ref 27f9b1c7b0
2017-12-16 10:31:13 +01:00
7afd26a6d1 Merge pull request #7306 from DarkDeepBlue/vim-8.0.0074
vim-patch:8.0.0074
2017-12-15 19:10:25 -05:00
ZyX
91d3efa35a eval/encode: Avoid unnecessary tv_list_idx_of_item() calls 2017-12-16 01:48:20 +03:00
dcb2780b83 lint 2017-12-15 15:57:38 -05:00
d5bce42b52 vim-patch:8.0.0074
Problem:    Cannot make Vim fail on an internal error.
Solution:   Add IEMSG() and IEMSG2(). (Domenique Pelle)  Avoid reporting an
            internal error without mentioning where.

95f096030e

Signed-off-by: Michael Schupikov <michael@schupikov.de>
2017-12-15 15:50:58 -05:00
ZyX
fb07391ce4 window: Fix matchaddpos() and enhance error reporting 2017-12-15 11:38:34 +03:00
ZyX
c8a5d6181b *: Fix some problems found during review
Still missing: problems in window.c, it should be possible to construct a test
for them.
2017-12-15 02:39:46 +03:00
6ff13d78b7 Merge #7720 'tui: rework deferred-termcodes implementation' 2017-12-14 00:24:35 +01:00
7164f61850 typval_encode.c.h: avoid -Wnonnull-compare warning (#7712)
* typval_encode.c.h: avoid -Wnonnull-compare warning

closes #6847

The NULL check is needed because TYPVAL_ENCODE_CONV_EMPTY_DICT may be
invoked with literal `NULL`.

Warning occurs even for `Debug` build-type:

    neovim/src/nvim/eval/typval.c: In function ‘_typval_encode_nothing_convert_one_value’:
    neovim/src/nvim/eval/typval.c:1802:10: warning: nonnull argument ‘tv’ compared to NULL [-Wnonnull-compare]
           if (tv != NULL) { \
              ^
    ../src/nvim/eval/typval_encode.c.h:398:9: note: in expansion of macro ‘TYPVAL_ENCODE_CONV_EMPTY_DICT’
             TYPVAL_ENCODE_CONV_EMPTY_DICT(tv, tv->vval.v_dict);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

gcc version:
    gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406

* fixup! typval_encode.c.h: avoid -Wnonnull-compare warning
2017-12-13 22:22:02 +01:00
ed92ece815 tui: defer termcodes using a timer
With this implementation there is no "jank" during startup.

Using the main_loop in any fashion is janky. Using only the TUI loop
emits the termcodes too soon, or requires bad hacks like counting
tui_flush invocations (9 seems to work).

ref #7664
ref #7649
ref #7664
ref 27f9b1c7b0
2017-12-13 22:18:25 +01:00
6b51c72e0c tui: rework deferred-termcodes implementation
Try another approach to defer the termcodes. Seems less janky, but still
not perfect.

ref #7664
ref #7649
ref #7664
ref 27f9b1c7b0
2017-12-13 22:17:39 +01:00
6203c23449 pty_process_unix: _exit() on execvp() failure
Mostly cargo-culting based on a reading of the manpages, interwebs, and
the Vim source.
2017-12-13 22:17:38 +01:00
34057045be ui: forward relevant option updates to UIs (#7520)
also make termguicolors mutable after startup
2017-12-12 18:23:19 +01:00
ZyX
932ea7a0d1 clint,eval: Make linter check for direct usage of list attributes 2017-12-12 08:43:31 +03:00
f976826690 Merge pull request #7718 from jamessan/disable-titleold-translation
Disable translation of default 'titleold' value
2017-12-11 20:41:16 -05:00
ZyX
45998deb5d *: Fix linter errors 2017-12-12 00:52:14 +03:00
ZyX
1f9dd689b9 Merge branch 'master' into hide-container-impl 2017-12-12 00:44:25 +03:00
ceed29687f Disable translation of default 'titleold' value
It's an empty string, so there's no reason to try to translate it.

Closes #7717
2017-12-11 12:52:38 -05:00
ZyX
9f534422e6 eval/typval: Fix typo
[ci skip]
2017-12-11 11:09:09 +03:00
ZyX
1a961b5750 eval: Fix add() 2017-12-11 10:34:58 +03:00
ZyX
f4132fb38b *: Fix linter errors 2017-12-11 10:19:20 +03:00
ZyX
d46e37cb4c *: Finish hiding list implementation 2017-12-11 10:12:59 +03:00
8813b29cec Merge #7555 'vim-patch.sh, doc updates' 2017-12-11 02:12:05 +01:00
23fb833ea7 vim-patch.sh: remove version.c in generated patch
Vim patch tracking is now driven completely by `vim-patch:xxx` tokens in
the VCS logs. version.c will be auto-generated, if it is used at all.
2017-12-11 00:54:25 +01:00
56b49955b7 vim-patch.sh: introduce -L 2017-12-11 00:49:44 +01:00
ZyX
ceb45a0885 *: Fix test failures 2017-12-11 01:43:36 +03:00
ZyX
fe55f37083 eval: Still check for NULL when doing :unlet 2017-12-10 23:18:24 +03:00
ZyX
622d355ab4 functests: Add some more NULL tests 2017-12-10 23:16:00 +03:00
ZyX
d11884db49 eval: Fix uniq() crash in legacy test 055 2017-12-10 23:02:19 +03:00
ZyX
7572d5ac5a eval/encode: Fix crash in json_encode test suite 2017-12-10 22:41:00 +03:00
ZyX
0b03ac2cb2 functests: Mark islocked("v:_null_list") behaviour correct
It is the same for other VAR_FIXED lists.
2017-12-10 22:34:32 +03:00
ZyX
83f77c80c0 quickfix: Fix :cexpr and :lexpr 2017-12-10 22:33:05 +03:00
ZyX
5008205a3e eval: Fix setmatches(), setqflist() and setloclist() 2017-12-10 22:28:18 +03:00
ZyX
f572bd7e4e eval,functests: Fix tests and complete() and setline() behaviour 2017-12-10 22:24:11 +03:00
ZyX
ac4bbf55f6 *: Hide list implementation in other files as well 2017-12-10 22:04:43 +03:00
e9504b7fd8 vim-patch: NA
vim-patch:8.0.0299 NA
vim-patch:8.0.0309 NA
vim-patch:8.0.0310 NA

vim-patch:8.0.0215 NA
Problem:    When a Cscope line contains CTRL-L a NULL pointer may be used.
            (Coverity)
Solution:   Don't check for an emacs tag in a cscope line.
e362c3d2c3

vim-patch:8.0.0244 NA
Problem:    When the user sets t_BE empty after startup to disable bracketed
            paste, this has no direct effect.
Solution:   When t_BE is made empty write t_BD.  When t_BE is made non-empty
            write the new value.
d9c60648e5

Some patches were not properly marked in the commit logs. So they are
marked here:

vim-patch:8.0.1230
vim-patch:8.0.1229
vim-patch:8.0.0618
vim-patch:8.0.0104

vim-patch:8.0.0405
vim-patch:8.0.0400
vim-patch:8.0.0302
vim-patch:8.0.0288
vim-patch:8.0.0285
vim-patch:8.0.0284
vim-patch:8.0.0281
vim-patch:8.0.0279
vim-patch:8.0.0278
vim-patch:8.0.0277
vim-patch:8.0.0276
vim-patch:8.0.0273
vim-patch:8.0.0272
vim-patch:8.0.0271
vim-patch:8.0.0270
vim-patch:8.0.0269
vim-patch:8.0.0268
vim-patch:8.0.0267
vim-patch:8.0.0260
vim-patch:8.0.0257
vim-patch:8.0.0249
vim-patch:8.0.0248
vim-patch:8.0.0246
vim-patch:8.0.0244
vim-patch:8.0.0241
vim-patch:8.0.0240
vim-patch:8.0.0239
vim-patch:8.0.0232
vim-patch:8.0.0221
vim-patch:8.0.0217
vim-patch:8.0.0215
vim-patch:8.0.0213
vim-patch:8.0.0211
vim-patch:8.0.0203
vim-patch:8.0.0199
vim-patch:8.0.0193
vim-patch:8.0.0192
vim-patch:8.0.0191
vim-patch:8.0.0187
vim-patch:8.0.0183
vim-patch:8.0.0180
vim-patch:8.0.0173
vim-patch:8.0.0171
vim-patch:8.0.0170
vim-patch:8.0.0169
vim-patch:8.0.0166
vim-patch:8.0.0163
vim-patch:8.0.0162
vim-patch:8.0.0161
vim-patch:8.0.0152
vim-patch:8.0.0145
vim-patch:8.0.0144
vim-patch:8.0.0141
vim-patch:8.0.0139
vim-patch:8.0.0138
vim-patch:8.0.0130
vim-patch:8.0.0129
vim-patch:8.0.0123
vim-patch:8.0.0122
vim-patch:8.0.0120
vim-patch:8.0.0117
vim-patch:8.0.0115
vim-patch:8.0.0114
vim-patch:8.0.0113
vim-patch:8.0.0109
vim-patch:8.0.0108
vim-patch:8.0.0107
vim-patch:8.0.0105
vim-patch:8.0.0103
vim-patch:8.0.0098
vim-patch:8.0.0097
vim-patch:8.0.0095
vim-patch:8.0.0094
vim-patch:8.0.0093
vim-patch:8.0.0089
vim-patch:8.0.0087
vim-patch:8.0.0082
vim-patch:8.0.0080
vim-patch:8.0.0077
vim-patch:8.0.0076
vim-patch:8.0.0072
vim-patch:8.0.0071
vim-patch:8.0.0070
vim-patch:8.0.0067
vim-patch:8.0.0065
vim-patch:8.0.0063
vim-patch:8.0.0061
vim-patch:8.0.0059
vim-patch:8.0.0055
vim-patch:8.0.0054
vim-patch:8.0.0051
vim-patch:8.0.0050
vim-patch:8.0.0048
vim-patch:8.0.0045
vim-patch:8.0.0039
vim-patch:8.0.0036
vim-patch:8.0.0030
vim-patch:8.0.0029
vim-patch:8.0.0028
vim-patch:8.0.0027
vim-patch:8.0.0024
vim-patch:8.0.0022
vim-patch:8.0.0021
vim-patch:8.0.0018
vim-patch:8.0.0016
vim-patch:8.0.0015
vim-patch:8.0.0014
vim-patch:8.0.0013
vim-patch:8.0.0011
vim-patch:8.0.0010
vim-patch:8.0.0009
vim-patch:8.0.0007
vim-patch:8.0.0005
2017-12-10 17:13:22 +01:00
5bd8827431 vim-patch.sh: always use git log, not version.c 2017-12-10 17:13:22 +01:00
ad9c2d3cb9 doc
closes #7622
2017-12-10 17:13:22 +01:00
9ada97a810 gen_api_vimdoc.py: require "nvim_" prefix
Avoids doxygen bugs (things that aren't functions) and other noise (e.g.
`remote_ui_disconnect()` was incorrectly included in api.txt).
2017-12-10 17:13:22 +01:00
dc232b74fb doc: hack to avoid doxygen bug
Use `@cond <something>` to obscure a section from doxygen.

doxygen thinks kvec_withinit_t() is a function. That adds noise to the
generated API documentation, and also prevents the following function
from being noticed.
2017-12-10 17:13:22 +01:00
6f41ce0260 Merge pull request #7704 from jamessan/mac-lang-fix
mac: Set $LANG based on the system locale
2017-12-10 10:47:13 -05:00
abe38f7d26 window.c: do BufEnter in correct window after closing help #7431
closes #7429

Problem: after a help window was closed, a window was selected and its
autocommands triggered. After that, restore_snapshot was called and the
focused window changed, confusing the user.

Solution: Add function get_snapshot_focus() that returns the window that
holds the cursor in a snapshot. Use this function in win_close to make
sure the right window is selected before any autocommand is triggered.
2017-12-10 14:55:59 +01:00
1f2b35860f mac: Set $LANG based on the system locale
Unix's typical locale-related environment variables aren't always set
appropriately on a Mac.  Instead of relying on them, query the locale
information using Mac specific APIs and then set $LANG appropriately for
the rest of nvim.

Closes #5873
2017-12-10 07:45:04 -05:00
4a5bc6275d ci: run oldtests in Appveyor #7705 2017-12-10 02:45:41 +01:00
ZyX
5c1ddb5078 eval: Fix writefile() 2017-12-10 04:00:54 +03:00
ZyX
21745d72b8 eval: Fix inputlist() 2017-12-10 04:00:54 +03:00
ZyX
274f32d42e *: Start hiding list implementation
Most of files, except for eval.c and eval/* were only processed by perl.
2017-12-10 04:00:52 +03:00
ZyX
49dd615693 eval/typval: Add macros useful for hiding list item implementation 2017-12-10 03:40:34 +03:00
ZyX
ddce5bca03 eval/typval: Add functions useful for hiding list implementation 2017-12-10 03:40:34 +03:00
3cc7ebf810 Merge #7234 'built-in expression parser' 2017-12-09 18:47:34 +01:00
afae4b5141 ci: Install neovim gem in Appveyor (#7700)
ref #7655
2017-12-07 10:21:03 +01:00
a58c9094db Merge #7676 from florolf/atomic-unibilium
closes #7381
2017-12-06 20:51:24 +01:00
873af01245 Merge pull request #7692 from bfredl/wildcmd
ui: fix glitch with both ext_cmdline and cmd_wildmenu
2017-12-06 19:19:05 +01:00
b6c268b32a build: de-parallelize luarocks dependencies (#7697)
ref 6647f3c047
closes #7535
2017-12-06 14:14:07 +01:00
5cbd3b383c tui: ignore st terminfo cursor shape (Se, Ss) entries
closes #7641
2017-12-06 11:03:43 +01:00
ba7d6a9e6b ui: fix glitch with both ext_cmdline and cmd_wildmenu 2017-12-06 09:41:51 +01:00
54087d80f3 tui: always hide cursor when flushing
The previous commit ensures that we can never flush the buffer in a
state where toggling cursor visibility can corrupt other escape codes.
Thus, we can remove the workaround added as part of e838452, simplyfing
the code and hiding the cursor on more occasions.
2017-12-05 21:40:37 +01:00
90dd2b1473 tui: never flush buffers in midst of unibilium output
e83845285 fixed an issue where long (true color) escape sequences got
interrupted by the cursor visibility toggling caused by buffer flushes.

cdfaecb25 introduces a new issue which causes similar problems: While
the old buffer flushing code appended the cursor visibility escapes to
the buffer before/after flushing, the new code effectively prepends the
sequences.

Assume the following sequence of events occurs:

 - A long escape code is issued using unibi_out when the buffer is
   almost full
 - out() gets called for a prefix of that escape code, causing the
   buffer to fill up
 - flush_buf(ui, false) is called and (correctly) does not insert any
   cursor toggling escapes
 - The rest of the escape code is written into the now empty buffer
 - At some later point, some other part of nvim calls flush_buf(ui,
   true), which then toggles the cursor, corrupting the escape code

This could possibly also be fixed by tracking the state of the buffer
(i.e. does it contain a partially output escape code?), but this seems
fragile in the same way e83845285 turned out to be.

The root cause for all these problems is the mismatch between nvim's
(implicit) assumption that the buffer is flushable at any point in time
and the non-atomicity of unibilium's character based callback interface.
The proper fix (without modifying unibilium) is to ensure nvim's
assumption about the buffer state holds at all times.

To that end, add a "cork" flag which ensures one unibi_out-call never
splits its output across a buffer flush; if an escape code does not fit
into the current buffer, flush it without any part of the escape code in
it and insert the whole escape code in the emptied buffer. This is a
little more complex because it modifies the buffer in place rather than
printing into another buffer, checking the remaining space in the
terminal buffer and then memcpy'ing it.
2017-12-05 21:40:37 +01:00
9714b9f590 tests: cleanup ui/cmdline_spec.lua 2017-12-05 13:32:02 +01:00
aec81f44d1 Merge #7477 from FlorianGit/empty-lists-dicts-strings 2017-12-05 03:33:01 +01:00
67848c0b91 Merge #7653 from justinmk/tui-termcap 2017-12-05 02:42:10 +01:00
2d4abc1cae tui: flush -V3 ('verbose' >= 3) info ASAP 2017-12-05 01:46:41 +01:00
837100fcb1 test/tui: -V3log logs terminfo values 2017-12-05 01:46:41 +01:00
5f288220f9 test: write_file(): support append-mode 2017-12-05 01:46:41 +01:00
7f386b175c test: retry(): fix time calculation
libuv caches the results of uv.now() until the next loop tick. If a test
does not spin the libuv event loop, retry() enters an infinite cycle.
2017-12-05 01:46:40 +01:00
175174597d test: macOS 10.13: unibilium cannot find "xterm" terminfo
On some macOS versions we can't find the terminfo for whatever reason,
so just skip the test if it fails.
2017-12-05 01:46:40 +01:00
a11751eae8 test: tui_spec: narrower scope for timeout tweaks 2017-12-05 01:46:40 +01:00
1cae99b4bf msg_outtrans_special(): handle NULL
This is convenient for terminfo_info_msg().
2017-12-05 01:46:40 +01:00
5de1eae4f2 msg_outtrans_special(): const some strings 2017-12-05 01:46:40 +01:00
586dafee2f str2specialbuf(): fix comparison
regression by 832c158a66
2017-12-05 01:46:39 +01:00
9d689d639d tui: set descriptions on termcap extensions 2017-12-05 01:46:39 +01:00
3aa24042a8 tui: dump termcap info if -V3 ('verbose' >= 3)
Get terminal debugging info by starting Nvim with 'verbose' level 3:

    nvim -V3log

This is like Vim's `:set termcap`, which was removed in Nvim (and would
be very awkward to restore because of the decoupled UI).
2017-12-05 01:45:39 +01:00
a494c99918 Merge pull request #7683 from fszymanski/master
Fix job_control doc
2017-12-03 15:07:54 -05:00
e9990b43c2 Fix job_control doc 2017-12-03 20:49:01 +01:00
ZyX
fbdc3ac4ef tests: Fix linter errors 2017-12-03 20:22:09 +03:00
d763d2fe7a Viml: Make filter and map handle null list correct
filter('v:_null_list, 'v:val') should return v:_null_list and a similar
statement should hold for map.

Changes after review

 * Test inserted in legacy test suite has been removed by reverting the commit
adding it.
 * Change the fix to tv_copy the argument before returning.
 * Readd the two tests on crashes, and modified their expected return value.
 * Move the test from 'incorrect behaviour' section to 'correct behaviour section'
 * Add analogous tests for v:_null_dict

Always copy list or dictionary to return variable

If the type of input is correct (i.e. either a list or a dictionary), this
should also be returned.
2017-12-03 17:03:31 +01:00
ZyX
6bc54832ef Revert "fix! set lsan options"
This reverts commit 6299332349.
2017-12-03 16:53:29 +03:00
ZyX
78bc52ea53 getchar: Move REMAP_… values into a enum 2017-12-03 16:50:37 +03:00
ZyX
c49e22d396 Merge branch 'master' into s-dash-stdin 2017-12-03 16:49:30 +03:00
ZyX
7af8601db4 Merge branch 'master' into expression-parser
Hoping that could fix the LSAN issue: no idea what it is talking about.
2017-12-03 16:19:40 +03:00
27a577586e Merge pull request #7666 from wsdjeg/patch-1
Fix example in job_control doc
2017-12-02 20:34:31 +01:00
44421a22c0 vim-patch:8.0.0306 (#7675)
Problem:    mode() not sufficiently tested.
Solution:   Add more tests. (Yegappan Lakshmanan)

e971df39a5
2017-12-02 17:25:50 +01:00
ad32307e3b Merge #7672 from ckelsel/vim-8.0.0298 2017-12-02 17:20:05 +01:00
7a4c9dc1c2 vim-patch:8.0.0295 (#7671)
Problem:    test_viml hangs.
Solution:   Put resetting 'more' before sourcing the script.

7a073549a3
2017-12-02 17:14:18 +01:00
4b83f37912 tui.c: request focus-reporting (fix regression) #7670
ref #7649
ref #7664

27f9b1c7b0 caused a regression: it uses loop_schedule_deferred() to
defer emitting the "enable focus reporting" termcode. tui_main() never
processes `tui_loop.events` (which loop_schedule_deferred() depends on),
so the event was never actually processed.

But fixing that (by processing `tui_loop.events`) would bring back the
problem 27f9b1c7b0 tried to fix: it still emits the event too soon.

Instead, do a little dance: schedule the event on `main_loop` and then
forward it to `tui_loop`.

NOTE: after this commit, in tmux 2.3 with `focus-events` enabled,
FocusGained is fired on startup and when resuming from suspend.

Using `script` to record the terminal session (and `vterm-dump` to
post-process the result):

BEFORE:
    {DECSM 1049}{DECSM 1}{ESC =}
    {CUP *}{ED *}{DECSM 2004}{DECSM 1004}{CSI 1,43 r}
    {CUP 1,1}
    {CUP *}{ED *}{SM 34}{DECSM 25}
    {DECRM 25}{CSI 2   q}{CSI 2   q}
    {CUP *}{ED *}{LF}
    {SGR *}{LS1}{SGR 94}~
    ...

AFTER:
    {CUP *}{ED *}{CSI 1,43 r}
    {CUP 1,1}
    {CUP *}{ED *}{SM 34}{DECSM 25}
    {DECRM 25}{CSI 2   q}{CSI 2   q}
    {CUP *}{ED *}{DECSM 2004}{DECSM 1004}{LF}
    {SGR *}{LS1}{SGR 94}~
    ...
2017-12-02 15:55:09 +01:00
7ab36403e1 fix lint error 2017-12-02 15:45:19 +08:00
585d664b7b vim-patch:8.0.0298
Problem:    Ex command range with repeated search does not work. (Bruce
            DeVisser)
Solution:   Skip over \/, \? and \&.

cbf20fbcd3
2017-12-02 15:40:57 +08:00
ee2e6d1d1a Fix type in job_control doc 2017-12-01 06:40:03 -06:00
27f9b1c7b0 tui: emit some termcodes later (after startup) (#7664)
For some reason, enabling focus reporting during terminal setup, causes
slow rendering during Nvim startup on tmux 2.3 with the tmux
`focus-events` option enabled.

To workaround that issue, this commit defers the request.

closes #7649

init.vim:
    call plug#begin('~/.config/nvim/plugged')
    Plug 'morhetz/gruvbox'
    call plug#end()
    set background=light " background light just to see the effect more quickly
    colorscheme gruvbox
.tmux.conf:
    set -g focus-events on
    set-option -ga terminal-overrides ",xterm-256color:Tc"
    set-option -g default-terminal "screen-256color"

Using `script` to record the terminal session (and `vterm-dump` to
post-process the result):

BEFORE this commit:
    ./build/bin/nvim -u NONE{CR}{LF}
    {DECSM 1049}{DECSM 1}{ESC =}
    {CUP *}{ED 2}{DECSM 2004}{DECSM 1004}{CSI 8,44,156 t}{CSI * r}
    {CUP 1,1}
    {CUP *}{ED 2}{DECSM 25}
    {DECRM 25}{CSI 2   q}{CSI 2   q}
    {CUP *}{ED 2}{LF}
    {ESC (B}{SGR *}{SGR 94}~                                                                                                                                                           {CR}{LF}
    ~                                                                                                                                                           {CR}{LF}

AFTER this commit:
    ./build/bin/nvim -u NONE{CR}{LF}
    {DECSM 1049}{DECSM 1}{ESC =}
    {CUP *}{ED 2}{CSI 8,44,156 t}{CSI * r}
    {CUP 1,1}
    {CUP *}{ED 2}{DECSM 2004}{DECSM 1004}{DECSM 25}
    {DECRM 25}{CSI 2   q}{CSI 2   q}
    {CUP *}{ED 2}{LF}
    {ESC (B}{SGR *}{SGR 94}~                                                                                                                                                           {CR}{LF}
    ~                                                                                                                                                           {CR}{LF}
    ...
2017-12-01 04:18:34 +01:00
3d0ee17c91 tui/rxvt: enable focus-reporting
closes #7578
2017-12-01 04:12:59 +01:00
ZyX
6299332349 fix! set lsan options 2017-12-01 00:34:16 +03:00
ZyX
5ab0f988ca *: Replace all occurrences of NVim with Nvim 2017-11-30 11:53:25 +03:00
ZyX
0b4054e043 unittests: Reduce memory used by vim_str2nr test 2017-11-30 11:48:23 +03:00
10c3b206cb version.c: Mark 8.0.0171 as NA
[ci skip]
2017-11-29 20:43:07 -05:00
ZyX
b588ccddd7 Merge branch 'master' into expression-parser 2017-11-30 02:02:55 +03:00
ZyX
de45ec0146 keymap: Do not use vim_isIDc in keymap.c
Note: there are three changes to ascii_isident. Reverting first two (in 
find_special_key and first in get_special_key_code) normally fails the new test 
with empty &isident, but reverting the third does not. Hence adding `>` to 
&isident.

Ref vim/vim#2389.
2017-11-30 02:01:49 +03:00
4618c9c43b Revert "tui: update cleared area only if non-default bg"
Reverts 0b93bab6c2. This change was
counter-productive to the other changes which intended to reduce the
role of BCE.

ref #7624
2017-11-29 23:51:48 +01:00
e0466dc592 Merge pull request #7657 from jamessan/float128-ffi
unittest: Ignore _Float128 types in ffi
2017-11-29 15:23:49 -05:00
59f4bd435c unittest: Ignore _Float128 types in ffi
When building with certain GCC versions, a _Float128 type is present
when setting up the ffi for unit tests.

    ./test/unit/helpers.lua:256: declaration specifier expected near '_Float128' at line 396
    /usr/bin/luajit: /usr/share/lua/5.1/busted/runner.lua:99: attempt to concatenate local 'message' (a table value)
    stack traceback:
    	/usr/share/lua/5.1/busted/runner.lua:99: in function 'fn'
    	/usr/share/lua/5.1/mediator.lua:103: in function 'publish'
    	/usr/share/lua/5.1/busted/modules/helper_loader.lua:21: in function 'helperLoader'
    	/usr/share/lua/5.1/busted/runner.lua:147: in function </usr/share/lua/5.1/busted/runner.lua:11>
    	/usr/bin/busted:3: in main chunk
    	[C]: at 0x004044a0

    CMake Error at /<<PKGBUILDDIR>>/cmake/RunTests.cmake:53 (message):
      Running unit tests failed with error: 1.

Since this is being pulled in by a dependency, not directly used by
nvim, just ignore the type.

Closes #7423
2017-11-29 10:07:12 -05:00
2d732a11b1 provider: fix batchfile extension for ruby gem (#7651)
ruby uses batchfiles with 'cmd' extension.
gem creates batchfiles with 'bat' extension.
`gem install rails` does the following in Windows (not Cygwin):

1. Run `gem.cmd install rails` on cmd.exe
2. gem.cmd runs `ruby.exe -x gem install rails`
3. `rails` gem is installed.
   `rails.bat` is created in the same directory
   where ruby.exe and gem.cmd reside.
2017-11-29 03:19:33 +01:00
27a4fc436f Merge pull request #7639 from jamessan/openbsd-chr
Add OpenBSD as an expected OS for opening char devices
2017-11-28 19:47:44 -05:00
8f91f2c9b4 Use defined(BSD) check when defining OPEN_CHR_FILES
Rather than enumerate predefines for all BSD systems, just rely on the
fact that they all "#define BSD" in sys/param.h.

Debian's GNU/kFreeBSD still requires its own check, since it isn't using
the BSD userspace.

References:
OpenBSD - 210ebf9df0/sys/sys/param.h (L40)
FreeBSD - f5d95e1f8d/sys/sys/param.h (L43)
NetBSD - ea62098079/sys/sys/param.h (L49)
DragonFlyBSD - 94ecf1295b/sys/sys/param.h (L41)

vim-patch:8.0.1357
2017-11-28 18:07:51 -05:00
20bde8866e Add OpenBSD as an expected OS for opening char devices
Closes #7542
2017-11-28 17:53:41 -05:00
122dbc86ab Merge pull request #7650 from jamessan/na-patches
version.c: mark NA patches
2017-11-28 16:24:27 -05:00
27a70fec48 version.c: mark NA patches
- channels: vim-patch:8.0.0018
- GUI: vim-patch:8.0.0021
- Different recursive function implementation: vim-patch:8.0.0141
- JSON handling: vim-patch:8.0.0166, vim-patch:8.0.0169, vim-patch:8.0.0170,
  vim-patch:8.0.0171, vim-patch:8.0.0180

Mark vim-patch:8.0.0096 applied, since it was added in
860ecd7055.

[ci skip]
2017-11-28 15:56:51 -05:00
d109f5645b Merge #7640 'term' option 2017-11-27 22:07:23 +01:00
e3c4c8a90e tests: mark flaky socket test pending for now 2017-11-27 11:43:24 +01:00
df019cebd5 Revert "provider: delete vimL stderr collector, now that it exists builtin"
This change exposed a memory issue with buffered channels, possibly
involving GC. Revert until it has been fixed.

This reverts commit 0de019b6a6.
2017-11-27 11:07:49 +01:00
6cf186edb5 lint 2017-11-27 09:45:32 +01:00
c8b40930c0 test: tui_spec.lua: use robust settings 2017-11-27 09:45:32 +01:00
944e3c0619 tui: expose terminal type in 'term' option
Since "builtin" terminfo definitions were implemented (7cbf52db1b),
the decisions made by tui.c and terminfo.c are more relevant. Exposing
that decision in the 'term' option helps with troubleshooting.

Also: remove code that allowed setting t_Co. `:set t_Co=…` has never
worked; the highlight_spec test asserting that nvim_set_option('t_Co')
_does_ work makes no sense, and should not have worked.
2017-11-27 09:45:32 +01:00
a043899ba2 Merge #7633 'Retry fgets on EINTR'
closes #7632
2017-11-26 21:17:35 +01:00
ZyX
36a4f3a259 viml/parser/expressions: Make sure that listed nodes may be present
With the new test leaving `assert(false);` for any of the cases makes tests 
crash.
2017-11-26 16:57:42 +03:00
ZyX
cddf84c398 functests: Add some more tests 2017-11-26 16:45:29 +03:00
ZyX
17077b6813 viml/parser/expressions: Make $ENV not depend on &isident 2017-11-26 16:08:53 +03:00
ZyX
11a05e778f doc: Some small fixes 2017-11-26 15:56:27 +03:00
ZyX
b9c7813058 Merge branch 'master' into expression-parser 2017-11-26 15:54:03 +03:00
207b7ca4bc Merge pull request #6844 from bfredl/channel
channels: support buffered output and bytes sockets/stdio
2017-11-26 10:18:01 +01:00
0de019b6a6 provider: delete vimL stderr collector, now that it exists builtin 2017-11-26 09:17:06 +01:00
91b856ccce channels: tests 2017-11-26 09:17:04 +01:00
b57d9a4ff0 Merge #7631 'highlight: no refresh on validation error' 2017-11-25 23:22:46 +01:00
ebed8c6a2e test: :highlight validation errors
add test when highlight group doesn't exist.
add test when an invalid color name is used for `cterm`.
2017-11-25 23:22:23 +01:00
b1a4db0b69 :highlight : avoid redraw on error
do_highlight() should not redraw if a validation error occurred.
closes #7489
2017-11-25 23:22:08 +01:00
bab2f8200a io: fix handling EOF in vim_fgets
If an EOF is returned from `fgets`, `vim_fgets` might spin forever, as
it tries to consume the current line.

A `NULL` return value from `fgets` should break out of the function
(unless `errno` is `EINTR`), and then `feof` should be used to check for
the EOF condition on the stream.
2017-11-25 14:21:02 -08:00
0f9c90e0ed io: retry fgets on EINTR (#7632)
The calls to `fgets` in `src/nvim/if_cscope.c` (and elsewhere) can show
communication errors to the user if a signal is delivered during its
system calls. For plugins that proxy subprocess output into cscope
requests, a `SIGCHLD` might *always* interfere with calls into `fgets`.

To see this in a debugger, put a breakpoint on `cs_reading_emsg` and
watch signals come in (with lldb, using `process handle --notify true
--pass true`).  Next, run a subcommand from neovim that calls through
cscope when it returns.  A tag picker plugin, like vim-picker and fzy,
with `cscopetag` and `cscopetagorder=0` set, reproduced this reliably.
The breakpoint will hit after a `SIGCHLD` is delivered, and `errno` will
be set to 4, `EINTR`.

The caller of `fgets` should retry when `NULL` is returned with `errno`
set to `EINTR`.
2017-11-25 13:59:07 -08:00
303e1df13f Merge #7624 'tui: disable BCE almost always'
closes #7035
closes #7337
2017-11-25 22:36:34 +01:00
baa981ea21 channels: update documentation 2017-11-25 09:37:01 +01:00
753d0091e8 core dumps: don't use pipe, it does not work 2017-11-25 09:37:00 +01:00
8540b5e4ad test: add hexdump utilitiy function 2017-11-25 09:37:00 +01:00
85bc6630c0 input: only change mode of input fd if there is an input fd 2017-11-25 09:37:00 +01:00
9acd7bfe25 tui: job-control: use saved termios for pty jobs
On startup, if running in a terminal, save the termios properties.
Use the saved termios for `:terminal` and `jobstart()` pty jobs.

This won't affect nvim spawned outside of a terminal.

questions:

- This affects `:terminal` and `jobstart({'pty'✌️true})`.
  Should we be more conservative for `jobstart({'pty'✌️true})` (e.g.
  pass NULL to forkpty() and let the OS defaults prevail)?
  - Note: `iutf8` would not be set in that case.
2017-11-25 09:37:00 +01:00
a97cdff14d channels: improvements to buffering 2017-11-25 09:37:00 +01:00
fee367a74f channels: more consistent event handling
terminal: libvterm now receives data in async context. This was "almost" safe
already, as redraws were queued anyway.
2017-11-25 09:37:00 +01:00
f629f8312d channels: refactor jobwait 2017-11-25 09:37:00 +01:00
5517d2323b channels: reimplement logging (as stub for proper event) 2017-11-25 09:37:00 +01:00
5af4703177 channels: stderr channel 2017-11-25 09:37:00 +01:00
90e5cc5484 channels: generalize jobclose() 2017-11-25 09:37:00 +01:00
3e59c1e20d channels: move away term code from eval.c 2017-11-25 09:37:00 +01:00
1ebc96fe10 channels: allow bytes sockets and stdio, and buffered bytes output 2017-11-24 14:54:15 +01:00
5215e3205a channels: refactor 2017-11-24 14:50:00 +01:00
3717e2157f Revert channel logging, rebased on new code below 2017-11-24 14:04:56 +01:00
0b93bab6c2 tui: update cleared area only if non-default bg
This check was removed in 133ae5eeef without explanation.
2017-11-24 09:53:09 +01:00
b838ad5b7a tui: Disable BCE almost always. #7624
133ae5eeef implemented BCE (background color erase). But we can't
trust terminfo, so it is safer disable BCE if we are not certain.

Per https://github.com/kovidgoyal/kitty/issues/160#issuecomment-346470545
terminal support for BCE seems to be (1) optional and (2) inconsistent.

ref #4210 #4421 #7035 #7337 #7381 #7425 #7618
2017-11-24 09:18:13 +01:00
9888a54f15 tui: Disable BCE by default. #7624
133ae5eeef implemented BCE (background color erase).  That's fine if
the system terminfo claims to support it; but our built-in fallback
should not assume it.

Per https://github.com/kovidgoyal/kitty/issues/160#issuecomment-346470545
terminal support for BCE seems to be (1) optional and (2) inconsistent.
So the built-in terminfos should disable it by default.

ref #4210 #4421 #7035 #7337 #7381 #7425 #7618
2017-11-23 21:21:58 +01:00
d9b3ebfede FIXUP: duplicate error number in #7422 2017-11-23 07:36:35 +01:00
51637f4256 tui: move terminfo_is_term_family() 2017-11-22 23:19:51 +01:00
8c959be511 Merge #7593 'PVS static analysis fixes' 2017-11-22 23:12:30 +01:00
a4f6cec7a3 cmdline: CmdlineEnter and CmdlineLeave autocommands (#7422)
vim-patch:fafcf0dd59fd

patch 8.0.1206: no autocmd for entering or leaving the command line

Problem:    No autocmd for entering or leaving the command line.
Solution:   Add CmdlineEnter and CmdlineLeave.

fafcf0dd59
2017-11-22 22:35:20 +01:00
fe2546c81a move.c: remove unreachable break statement
n > 0 verified by while condition, (--n < 0) always false
2017-11-22 09:21:34 -08:00
1b94f24d6e eval.c: remove nonnullret deadcode
The following calls can't return null:
* xmalloc
* xcalloc
* get_buffer_info
* get_tabpage_info
* get_vim_var_str
* get_win_info
* tv_get_string
* tv_list_alloc
* tv_list_alloc_ret
* vim_strnsave
2017-11-22 09:21:34 -08:00
c030a38168 helpers.c: statically assert integer falls within range 2017-11-22 09:21:34 -08:00
c24b74c229 Fix for pvs V782, pointer access to first element of array 2017-11-22 09:21:34 -08:00
fdcde7dba3 input.c: replace if/else with switch 2017-11-22 09:21:34 -08:00
dddc609859 menu.c: remove conditional expression that is always true 2017-11-22 09:21:34 -08:00
9393be477a vim-patch:8.0.0289 (#7591)
Problem:    No test for "ga" and :ascii.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#1429)

21d7c9b601
2017-11-22 11:59:30 +01:00
bb7795e820 vim-patch:8.0.0292 (#7592)
Problem:    The stat test is a bit slow.
Solution:   Remove a couple of sleep comments and reduce another.

a2f28859bf
2017-11-22 11:57:56 +01:00
7b686881a1 win: default grepprg to findstr.exe (#7611) 2017-11-22 00:35:51 +01:00
9b6bf8fa37 Merge #7345 'location-list update on buffer-modified' 2017-11-21 01:53:12 +01:00
84d9245c70 pvscheck.sh: auto-detect URL by default
The hardcoded URL breaks very often, this confuses people.
Instead, auto-detect if no URL is provided.

Also auto-detect if the script is invoked with no arguments.
2017-11-21 01:38:30 +01:00
8674b0c3d1 syntax.c: Fix maybe-uninitialized warning (#7596)
When building in release mode, gcc generated a maybe-initialized
warning in get_syn_options. The warning is both right and wrong;
there is an execution path where the len variable is not
initialized in the code:
...
int len;
...
for (fidx = ARRAY_SIZE(flagtab); --fidx >= 0; ) {
  p = flagtab[fidx].name;
  int i;
  for (i = 0, len = 0; p[i] != NUL; i += 2, ++len)
    if (arg[len] != p[i] && arg[len] != p[i + 1])
      break;
  // <snip>
}
...
  arg = skipwhite(arg + len);
...

The initial for loop will not execute if ARRAY_SIZE(flagtab) == 0,
and thus len will never be initialized. flagtab is a local-static
variable, initialized to a long array of structured data, so
ARRAY_SIZE(flagtab) can't be 0.

However, gcc doesn't recognize ARRAY_SIZE(flagtab) as a constant.
There are any number of reasons this could happen. In any case,
the message can be fixed with a len=0 before the first for loop.

In addition to the above warning, I've labeled flagtab and
first_letters as const. They should never change.
2017-11-21 00:04:49 +01:00
c391401648 helptags: fix double-free (#7600)
closes #7599
Helped-by: oni-link <knil.ino@gmail.com>

Freeing `dirname` was first introduced by a code refactoring from `ex_helptags()` to `do_helptags()` (`vim-patch:7.4.1551`)(#4648) and later removed by `vim-patch:7.4.1562`(#4660).
Only problem with that is, that the patches were not applied in order so the fixing patch was declared `N/A`.

So `do_helptags()` should have never freed `dirname`.
2017-11-20 21:20:01 +01:00
7d24a95b45 vim-patch:8.0.0287 (#7590)
Problem:    Cannot access the arguments of the current function in debug mode.
            (Luc Hermitte)
Solution:   use get_funccal(). (Lemonboy, closes vim/vim#1432, closes vim/vim#1352)

c7d9eacefa
2017-11-20 02:02:15 +01:00
df10714991 server.c: Fix bug in release mode (#7594)
When compiling with CMAKE_BUILD_TYPE=RelWithDebInfo, several
-Wmaybe-uninitialized warnings are printed. These were thought to
be false positives (#5061); there are no control paths that lead
to an uninitialized value. However, when gcc is run in -O2 mode,
it makes a mistake while generating the necessary logic.

Specifically, for the code:
...
  int = 0; // Index of the server whose address equals addr.
  for (; i < watchers.ga_len; i++) {
    watcher = ((SocketWatcher **)watchers.ga_data)[i];
    // <snip>
  }
  if (i >= watchers.ga_len) {
    ELOG("Not listening on %s", addr);
    return;
  }
...

Gcc generates:
...
<+98>:  cmp  %ebx, %ebp
<+100>: jg   0x530f13   <server_stop+55>
<+102>: cmp  %ebp, ebx
<+104>: jl   0x530f7e   <server_stop+162>
...

Normally, the if statement should catch the only control path
where watcher is not assigned: watchers.ga_len <= 0. When
compiled, the assembly lines 98 and 100 correspond to checking if
i < watchers.ga_len, and the lines 102 and 104 correspond to
checking if i >= watchers.ga_len. The assembly seems to compare
ebp (which is watchers.ga_len) with ebx (which is i), and jump
if greater; then do the same comparison and jump if less. This is
where gcc makes a mistake: it flips the order of the cmp
instruction. This means that the REAL behavior is first check if
i < watchers.ga_len and then check if i < watchers.ga_len. Which
means the code inside the if statement is NEVER executed; no
combination of i and watchers.ga_len will ever trigger ELOG().

So not only is this a use of an uninitialized value if
watchers.ga_len == 0 (or technically, if it's less than zero too),
it also clobbers any error detection if the for loop reaches the
last entry (which would normally cause i == watchers.ga_len too).

This commit fixes this issue by adding a bool to keep track of
whether a watcher was found during the loop. This makes gcc
generate the correct code, avoiding both bugs.
2017-11-20 01:55:28 +01:00
ZyX
05a3c12118 unittests: Run vim_str2nr tests with GC enabled 2017-11-19 23:36:40 +03:00
ZyX
1ffa4e5047 doc: Update documentation 2017-11-19 23:33:02 +03:00
ZyX
64158f2b0b unittests: Populate ARGTYPES in child process only 2017-11-19 22:32:02 +03:00
ZyX
fe3a58273e cmake: Fix api/version test failure 2017-11-19 22:24:26 +03:00
ZyX
03a129aacf Merge branch 'master' into expression-parser 2017-11-19 22:05:22 +03:00
ZyX
6ea3a08fdb syntax: Fix duplicate group definitions 2017-11-19 22:01:19 +03:00
ZyX
7c20f60b88 unittests: Avoid infinite cycle somewhere because of init failure 2017-11-19 22:01:14 +03:00
ZyX
ebb33eddd9 tests: Stabilize float format and %e in format_luav and format_string 2017-11-19 22:00:59 +03:00
ZyX
731dc82f8c ex_getln: Fix memory leak in color_expr_cmdline 2017-11-19 21:21:45 +03:00
ZyX
f20f97c936 *: Fix linter errors 2017-11-19 21:13:27 +03:00
ZyX
a94255a7ac tests: Use single test file for unit and functional parser tests 2017-11-19 20:20:06 +03:00
ZyX
53fa435a1f functests: Fix ui/cmdline test 2017-11-19 19:34:15 +03:00
ZyX
764cf3251d charset: Add missing include needed for vim_str2nr 2017-11-19 19:27:21 +03:00
ZyX
c287893225 viml/parser/expressions,unittests: Do better testing, fix found issues 2017-11-19 19:22:54 +03:00
de8b1fd1de Merge #7587 'vim-patch:8.0.0283' 2017-11-19 13:47:37 +01:00
540ed64635 vim-patch:8.0.0283
Problem:    The return value of mode() does not indicate that completion is
            active in Replace and Insert mode. (Zhen-Huan (Kenny) Hu)
Solution:   Add "c" or "x" for two kinds of completion. (Yegappan Lakshmanan,
            closes vim/vim#1397)  Test some more modes.

e90858d022
2017-11-19 19:53:47 +08:00
d6f9d1df04 version bump 2017-11-18 12:46:38 +01:00
6d2c30daf3 NVIM v0.2.2
FEATURES:
a6de144c3e 'viewoptions': add "curdir" flag #7447
b6a603fe51 node.js remote-plugin support #7458
f5d4da0144 :checkhealth : validate 'runtimepath' #7526

FIXES:
e6beb60da5 :terminal : fix crash on resize #7547
f19e5d6530 work around gnome-terminal memory leak #7573
07931ed1c8 'guicursor': use DECSCUSR for xterm-likes #7576
f185c739bc 'os_open: UV_EINVAL on NULL filename' #7561
e8af34dc63 win: provider: Detect(): return *.cmd path #7577
eacd788cf5 :checkhealth : fix check for npm and yarn #7569
a43a573ad5 health.vim: normalize slashes for script path #7525
69e3308771 cmake: install runtime/rgb.txt
d0b05e3c36 runtime: syntax error in `runtime/syntax/tex.vim` #7518
55d8967147 tutor: some fixes #7510

CHANGES:
9837a9c401 remove legacy alias to `v:count` #7407
c5f001a46a runtime: revert netrw update #7557
67e4529292 defaults: scrollback=10000 #7556
881f9e42d1 process_close(): uv_unref() detached processes #7539
2017-11-18 12:39:14 +01:00
f19e5d6530 tui: setrgbf/setrgbb: emit semicolons for VTE
Severe memory leak observed on gnome-terminal 3.26.2 VTE 0.50.2 when
colon-delimited RGB sequences are used.

closes #7573
2017-11-18 12:26:09 +01:00
a6de144c3e 'viewoptions': add "curdir" flag #7447
The flag enables the current local directory set by ":lcd" to be saved
to views which is the current default behaviour. The option can be
removed to disable this behaviour.

closes #7435

vim-patch:8.0.1289
2017-11-18 12:02:15 +01:00
f185c739bc Merge #7561 'os_open: UV_EINVAL on NULL filename' 2017-11-18 01:01:25 +01:00
e8af34dc63 win: provider: Detect(): return *.cmd path (#7577)
neovim-ruby-host is a ruby script.
neovim-node-host is a shell script.
Both don't work in cmd.exe so gem and npm provide batchfile shims.

Return the full path of these shims, cmd.exe knows better what to do with these files.
2017-11-17 23:52:51 +01:00
bf3f0efb3a os_nodetype: rework
Make the Windows impl closer to Vim os_win32.c, and the Unix impl closer
to Vim os_unix.c.

Outcomes:
- Do not send negative fd to close(). ref #4806 #4772 #6860
- Fallback return-value is now correct in (hopefully) all cases.
- unix: check S_ISXXX instead of relying on os_open (which can fail for
  irrelevant reasons). buf_write() expects NODE_WRITABLE for character
  devices such as /dev/stderr. 96f834a842
2017-11-17 23:26:51 +01:00
d135ba99b2 os_open, os_stat: UV_EINVAL on NULL filename
EINVAL (instead of EFAULT) because that's what glibc does:
https://github.com/bminor/glibc/blob/master/io/open.c#L35

os_nodetype: check for UV_EINVAL explicitly.

ref #4370
ref https://github.com/neovim/neovim/issues/4370#issuecomment-344366571
ref ac055d677a

ref #4772
2017-11-17 22:30:38 +01:00
07931ed1c8 tui: 'guicursor': use DECSCUSR for xterm-likes (#7576)
Anything claiming to be an xterm gets DECSCUSR. This is the only
reasonable choice unless/until we get more reliable detection (#7490).

ref #6997
closes #7550
2017-11-17 22:24:01 +01:00
ee031eb525 lint #7562 2017-11-17 00:57:36 +01:00
eacd788cf5 :checkhealth: fix check for npm and yarn (#7569)
Fix bug that checked for npm AND yarn, where we wanted npm OR yarn.
But since we call `npm` exclusively, and it's highly unlikely you have
yarn installed without npm, let's just remove the yarn check altogether.

Addresses https://github.com/neovim/node-client/issues/41
2017-11-16 23:43:50 +01:00
59b0d9f62d doc: Fix pathshorten() example (#7571) 2017-11-16 23:41:16 +01:00
f8d40e7d53 health.vim: define highlights as default (#7560) 2017-11-14 22:08:50 +01:00
c5f001a46a runtime: revert netrw update (#7557)
fixes #7527
fixes #7536
2017-11-14 20:56:00 +01:00
67e4529292 defaults: scrollback=10000 (#7556) 2017-11-14 20:55:25 +01:00
30a21830d0 doc: test/README.md: migrate wiki info (#7552) 2017-11-14 01:43:52 +01:00
8fff2ef74a vim-patch:8.0.0227 (#7548)
Problem:    Crash when 'fileformat' is forced to "dos" and the first line in
            the file is empty and does not have a CR character.
Solution:   Don't check for CR before the start of the buffer.

2aa5f696b9
2017-11-13 08:30:25 +01:00
8d8212d384 Merge pull request #7545 from jamessan/test-fixes
Fix test failures found in Debian builds, closes #7522
2017-11-12 21:09:44 -05:00
d5b7f28b44 test/unit/path_spec: expect correct buffer size (#7514)
Fixed-size buffers and lfs.currentdir().. does not compute. The tests would fail
if the current working directory was longer than expected.
2017-11-13 02:28:07 +01:00
a43a573ad5 health.vim: normalize slashes for script path (#7525)
:checkhealth reports that remote plugins are unregistered
after running :UpdateRemotePlugins because of the backslashes in filepath.
Normalize them to forward slashes because the paths in rplugin.vim are normalized in autoload/remote/host.vim.
2017-11-13 02:10:06 +01:00
e6beb60da5 :terminal : fix crash on resize (#7547)
closes #7538
Fix wrong window references from #7440

Remove some eager resizing. Still mostly doesn't address #4997.
2017-11-13 02:06:32 +01:00
20c672a460 Merge #7530 'vim-patch:8.0.0226 vim-patch:8.0.0224' 2017-11-13 01:26:22 +01:00
6b8c34137c vim-patch: NA
* vim-patch:8.0.0245

Problem:    The generated zh_CN.cp936.po message file is not encoded properly.
Solution:   Instead of using zh_CN.po as input, use zh_CN.UTF-8.po.

16038d50c4

* vim-patch:8.0.0248

Problem:    vim_strcat() cannot handle overlapping arguments.
Solution:   Use mch_memmove() instead of strcpy(). (Justin M Keyes,
            closes vim/vim#1415)

45600ce8f2
2017-11-12 23:27:08 +01:00
ZyX
342239a9c5 unittests,viml/parser/expressions: Start adding asgn parsing tests 2017-11-13 01:11:13 +03:00
ZyX
39c75d31be unittests: Fix automatic test case generation 2017-11-13 01:11:13 +03:00
ZyX
556451a7f2 unittests,syntax: Check for sanity of highlight_init_cmdline
Also fixes some errors found.
2017-11-13 01:11:13 +03:00
b63cde97f4 tests: terminal: Assert for SIGWINCH handling before continuing
Fixes test failures like

    test/functional/terminal/cursor_spec.lua @ 62: terminal cursor with number column is positioned correctly when focused
    ./test/functional/ui/screen.lua:302: Row 2 did not match.
    Expected:
      |{7:  1 }tty ready                                     |
      |*{7:  2 }{1: }                                             |
      |{7:  3 }                                              |
      |{7:  4 }                                              |
      |{7:  5 }                                              |
      |{7:  6 }                                              |
      |{3:-- TERMINAL --}                                    |
    Actual:
      |{7:  1 }tty ready                                     |
      |*{7:  2 }rows: 6, cols: 46                             |
      |{7:  3 }{1: }                                             |
      |{7:  4 }                                              |
      |{7:  5 }                                              |
      |{7:  6 }                                              |
      |{3:-- TERMINAL --}                                    |
2017-11-12 16:45:39 -05:00
0407ddb364 Use PRId64 to format Integer when calling api_set_error
Integer is a 64-bit type so using %d can produce incorrect results.

    test/functional/api/highlight_spec.lua @ 35: highlight api nvim_get_hl_by_id
    ...W7Xi/neovim-0.2.1/test/functional/api/highlight_spec.lua:46: Expected objects to be the same.
    Passed in:
    (string) 'Invalid highlight id: 7671724'
    Expected:
    (string) 'Invalid highlight id: 30000'
2017-11-12 16:45:39 -05:00
cf75de710c tui_spec: Convert nil to "" before formatting it
This fixes an apparent difference in behavior between Lua and LuaJIT.
Lua fails to format nil:

    test/functional/terminal/tui_spec.lua:381: bad argument #2 to 'format' (string expected, got nil)
2017-11-12 16:45:39 -05:00
69e3308771 cmake: install runtime/rgb.txt
closes #6682
2017-11-12 15:52:21 +01:00
881f9e42d1 process_close(): uv_unref() detached processes (#7539)
Doc for UV_PROCESS_DETACHED in uv.h mentions:
> child process will still keep the parent's event loop alive unless
> the parent process calls uv_unref() on the child's process handle.

ref #3944
2017-11-12 15:34:04 +01:00
ZyX
45445e2e03 unittests: Add some more edge test cases 2017-11-12 03:52:26 +03:00
ZyX
c7495ebcc0 viml/parser/expressions: Add support for parsing assignments 2017-11-12 02:18:43 +03:00
ZyX
1aa6276c29 viml/parser/expressions: Replace lambda-specific WantedNode entries
This way code will be easier to adapt to handling (partially) non-expressions 
like :let lvalue part or :function definitions, and that would be needed in the 
future both for proper completion support and for the Ex commands parser.
2017-11-12 00:03:45 +03:00
ZyX
bbb21e5dd3 unittests: Add a way to show some custom messages only when crashed 2017-11-11 23:50:37 +03:00
ea020f2e26 fix lint error 2017-11-11 09:04:48 +08:00
b6a603fe51 Merge #7458 'remote: add node host' 2017-11-11 01:54:32 +01:00
a2fdd0a72f vim-patch:8.0.0237 (#7531)
Problem:    When setting wildoptions=tagfile the completion context is not set
            correctly. (desjardins)
Solution:   Check for EXPAND_TAGS_LISTFILES. (Christian Brabandt, closes vim/vim#1399)

ba47b51ff8
2017-11-11 01:26:55 +01:00
4fa0970519 vim-patch:8.0.0242 (#7532)
Problem:    Completion of user defined functions is not covered by tests.
Solution:   Add tests.  Also test various errors of user-defined commands.
            (Dominique Pelle, closes vim/vim#1413)

65c836e600
2017-11-11 00:00:11 +01:00
faa15c5b83 vim-patch:8.0.0218 (#7529)
Problem:    No command line completion for :cexpr, :cgetexpr, :caddexpr, etc.
Solution:   Make completion work. (Yegappan Lakshmanan)  Add a test.

2b2207ba69
2017-11-10 23:35:55 +01:00
f5d4da0144 :checkhealth : validate 'runtimepath' (#7526) 2017-11-10 22:37:54 +01:00
67a2207c4a vim-patch:8.0.0226
Problem:    The test for patch 8.0.0224 misses the CR characters and passes
            even without the fix. (Christian Brabandt)
Solution:   Use double quotes and \<CR>.

1695f99d08
2017-11-10 23:33:40 +08:00
7e8212c459 vim-patch:8.0.0224
Problem:    When 'fileformats' is changed in a BufReadPre auto command, it
            does not take effect in readfile(). (Gary Johnson)
Solution:   Check the value of 'fileformats' after executing auto commands.
            (Christian Brabandt)

7a2699e868
2017-11-10 23:28:24 +08:00
314ff440f7 doc/vim_diff.txt: mention NormalNC 2017-11-10 02:44:18 +01:00
d0b05e3c36 runtime: Fix syntax error in runtime/syntax/tex.vim (#7518) 2017-11-10 01:38:08 +01:00
9baa7ca37f test/oldtest: count is not special in Nvim #7407 2017-11-09 11:11:12 +01:00
9837a9c401 compat: "v:count" distinct from "count" (#7407) 2017-11-09 02:20:12 +01:00
55d8967147 tutor: some fixes (#7510)
- conceal inline types
- fix some links
2017-11-08 23:32:49 +01:00
a48e078c0d doc: 'clipboard': soft-remove autoselect* flags #7509
We may restore this feature, but docs shouldn't mention it until then.

ref #2325
2017-11-08 23:28:14 +01:00
e98bcf0523 Merge #7465 has('ttyin'), has('ttyout') 2017-11-08 04:10:22 +01:00
c46d6f8da2 version bump 2017-11-08 01:25:06 +01:00
c67dd5acd0 NVIM v0.2.1
FEATURES:
0e873a30f3 Lua(Jit) built-in #4411
5b32bce73c Windows: `:terminal` #7007
7b0ceb3726 UI/API: externalize cmdline #7173
b67f58b284 UI/API: externalize wildmenu #7454
b23aa1cf09 UI: 'winhighlight' #6597
17531ed082 UI: command-line coloring (`:help input()-highlight`) #6364
244a1f97db API: execute lua directly from the remote api #6704
45626de63f API: `get_keymap()` #6236
db999821d4 API: `nvim_get_hl_by_name()`, `nvim_get_hl_by_id()` #7082
dc685387a3 menu_get() function #6322
9db42d4ce9 :cquit : take an error code argument #7336
9cc185dc6d job-control: serverstart(): support ipv6 #6680
1b7a9bf4d2 job-control: sockopen() #6594
6efe84af68 clipboard: fallback to tmux clipboard #6894
6016ac270f clipboard: customize clipboard with `g:clipboard` #6030
3a86dd54f3 ruby: override ruby host via `g:ruby_host_prog` #6841
16cce1ac17 debug: $NVIM_LOG_FILE #6827
0cba3da26e `:checkhealth` built-in, validates $VIMRUNTIME #7399

FIXES:
105d680aea TUI: more terminals, improve scroll/resize #6816
cb912a3eda :terminal : handle F1-F12, other keys #7241
619838f85d inccommand: improve performance #6949
04b3c32772 inccommand: Fix matches for zero-width #7487
60b1e8ad12 inccommand: multiline, other fixes #7315
f1f7f3b512 inccommand: Ignore leading modifiers in the command #6967
1551f71321 inccommand: fix 'gdefault' lockup #7262
6338199b76 API: bufhl: support creating new groups #7414
541dde36e3 API: allow K_EVENT during operator-pending
8c732f7274 terminal: adjust for 'number' #7440
5bec94652c UI: preserve wildmenu during jobs/events #7110
c349083155 UI: disable 'lazyredraw' during ui_refresh. #6259
51808a244e send FocusGained/FocusLost event instead of pseudokey #7221
133f8bc628 shada: preserve unnamed register on restart #4700
1b70a1da04 shada: avoid assertion on corrupt shada file #6958
9f534f338a mksession: Restore tab-local working directory #6859
de1084f3c4 fix buf_write() crash #7140
7f7698649f syntax: register 'Normal' highlight group #6973
6e7a8c3fe2 RPC: close channel if stream was closed #7081
85f3084e21 clipboard: disallow recursion; show hint only once #7203
8d1ccb606d clipboard: performance, avoid weird edge-cases #7193
01487d4385 'titleold' #7358
01e53a5cbe Windows: better path-handling, separator (slash) hygiene #7349
0f2873ce99 Windows: multibyte startup arguments #7060

CHANGES:
9ff0cc7085 :terminal : start in normal-mode #6808
032b088c84 lower priority of 'cursorcolumn', 'colorcolumn' #7364
2a3bcd1ff8 RPC: Don't delay notifications when request is pending #6544
023f67cad8 :terminal : Do not change 'number', 'relativenumber' #6796
1ef2d768e7 socket.c: Disable Nagle's algorithm on TCP sockets #6915
6720fe253e help: `K` tries Vim help instead of manpage #3104
7068370560 help, man.vim: change "outline" map to `gO` #7405
2017-11-07 23:54:31 +01:00
bbf730aa31 Merge #7503 from justinmk/vim-patches 2017-11-07 23:50:10 +01:00
2ca59638ba vim-patch:b0d45e7f5354
Update runtime files.

b0d45e7f53
2017-11-07 23:07:03 +01:00
4175dfac9a vim-patch:01164a6546b4
Long overdue runtime update.

01164a6546
2017-11-07 23:07:03 +01:00
ea51f08276 vim-patch.sh: avoid creating *.orig files 2017-11-07 22:33:26 +01:00
3a7feb6989 vim-patch.sh: remove vimrc_example.vim
vimrc_example.vim is not relevant to Nvim. Anything worth having in
there should be made an actual default.

.gitignore:
  - remove *.orig ... super annoying
2017-11-07 20:38:04 +01:00
10e5040b61 vim-patch:24a98a0eb772
Update runtime files

24a98a0eb7
2017-11-07 20:16:48 +01:00
4be0379602 vim-patch: NA
vim-patch:2e6ab18729a6
Add back terminal.c
2e6ab18729

vim-patch:8b21de33bb28
Missing part of 8.0.1131.
8b21de33bb
2017-11-07 20:12:11 +01:00
8c6168565c vim-patch:37c64c78fd87
Note: Ignored changes to matchit.vim in favor of faca814116.

---

Update runtime files.

37c64c78fd
2017-11-07 20:03:24 +01:00
ae569ea57b Merge #7500 'vim-patch: runtime' 2017-11-07 18:59:39 +01:00
06fd32b8ff ui: remove ext_cmdline noise (#7486)
Only send cmdline contents once per ui_flush.
Don't send extra redraws due to 'arshape', it makes no difference to
external ui.
2017-11-07 18:53:42 +01:00
8c3377ee76 vim-patch:c572da5f67aa
Update runtime files

c572da5f67
2017-11-07 03:23:37 +01:00
1a3e54231a vim-patch:1ccd8fff8acf
Update runtime files.

1ccd8fff8a
2017-11-07 03:16:34 +01:00
39fa278216 vim-patch:f55e4c867f77
Updated runtime files

f55e4c867f
2017-11-07 03:14:31 +01:00
415927e4ed vim-patch:NA
vim-patch:b6e0ec6b71c4
Documentation updates.
b6e0ec6b71

vim-patch:59ee05b2f5d4
Switch travis back to precise temporarily
59ee05b2f5

vim-patch:bb543088a551
Remove ruby-dev from travis config.
bb543088a5

vim-patch:d243a2a5efd9
Do not invoke rvm reset
d243a2a5ef

vim-patch:38ed1f5bea7d
Do not run coverage with clang, currently fails.
38ed1f5bea
2017-11-07 03:07:59 +01:00
208dee4585 vim-patch:b6e0ec6b71c4
Documentation updates.

b6e0ec6b71
2017-11-07 02:57:50 +01:00
52748d266d Merge pull request #7496 from jamessan/windows-spellfile-fix
spellfile.vim: Search for a writable directory on Windows
2017-11-06 20:56:03 -05:00
b9b2fb7d5d spellfile.vim: Search for a writable directory on Windows
Fixes #6664 until #6272 is merged and sdtpath('data') can be used.
2017-11-06 20:54:07 -05:00
bd17fa487d vim-patch:bf92e3a3719f
Update translations.

bf92e3a371
2017-11-07 02:49:53 +01:00
ad527392ab Merge #7499 'vim-patch: runtime' 2017-11-07 02:49:08 +01:00
20e317e22a po: remove duplicate definitions 2017-11-07 02:25:46 +01:00
b7f1885fab health.vim: env var may be defined but empty #7498 2017-11-07 02:15:34 +01:00
85cfc4c4f9 vim-patch:74675a666b51
Updated runtime files and translations.

74675a666b
2017-11-07 01:46:19 +01:00
a39bf01958 vim-patch:3ec574f2b549
Update runtime files.

Includes changing &sw to shiftwidth() for all indent scripts.

3ec574f2b5
2017-11-07 01:37:30 +01:00
599170de83 vim-patch:6aa8cea46d41
Update runtime files.

6aa8cea46d
2017-11-07 01:33:46 +01:00
78223bc97f vim-patch:b4d6c3ea4a59
Update runtime files.

b4d6c3ea4a
2017-11-07 01:27:14 +01:00
60179b8a3b vim-patch:0635ee682481
Runtime file updates

0635ee6824
2017-11-07 01:20:39 +01:00
49a627dbd9 vim-patch:94237495c03f
Updated runtime files.

94237495c0
2017-11-07 01:19:56 +01:00
ef7af078ef vim-patch:cd5c8f825078
Update runtime files.

cd5c8f8250
2017-11-07 01:16:42 +01:00
8c6a92c6e2 vim-patch:e0720cbf63eb
Update runtime files.

e0720cbf63
2017-11-07 01:08:51 +01:00
0312fc2ddb vim-patch:3c2881dc1195
Update runtime files.  Add Rust support.

3c2881dc11
2017-11-07 01:04:17 +01:00
dc92901094 vim-patch.sh: new option -P 2017-11-07 00:54:05 +01:00
7bcbf5d456 health.vim: show TUI-related env vars (#7498)
ref #7473
ref #7490
2017-11-07 00:53:26 +01:00
c598c3ac77 doc: deprecate 'highlight'; remove howto.txt (#7497) 2017-11-07 00:51:03 +01:00
ZyX
4aebd00a9e *: Fix linter errors 2017-11-06 20:28:37 +03:00
ZyX
24a353364d Merge branch 'master' into expression-parser 2017-11-06 20:23:35 +03:00
ZyX
f2660bee6a *: Fix some typos found by oni-link 2017-11-06 20:20:31 +03:00
ZyX
42959d0e8f unittests: Add tests for vim_str2nr 2017-11-06 20:15:05 +03:00
ZyX
c85f485aa7 charset: Move vim_str2nr flags from vim.h to charset.h 2017-11-06 19:06:24 +03:00
946c2a8ee8 Merge #7491 'vim-patch: runtime' 2017-11-06 11:22:55 +01:00
c348f84f21 vim-patch:036986f1507d
Update runtime files.

036986f150
2017-11-06 05:35:32 +01:00
93fb7383a3 vim-patch:214641f77df6
Runtime file updates.

214641f77d

N/A:
vim-patch:26a280c47a1c
2017-11-06 05:26:16 +01:00
8f03014e88 eval/decode.c: Avoid NULL arg to memchr() #7332
Clang complains because memchr has undefined behavior if the ptr is
NULL, even if len==0.

Helped-by: Nikolai Aleksandrovich Pavlov <kp-pav@yandex.ru>
2017-11-06 05:00:58 +01:00
d31b94ac20 Merge #7188 from justinmk/doc
doc; minor runtime bug fixes
2017-11-06 05:04:37 +01:00
280943d9b9 doc: API (generated) 2017-11-06 04:51:34 +01:00
7e59b897c1 gen_api_vimdoc.py: workaround: attributes of (void) functions 2017-11-06 04:27:31 +01:00
7984959ef5 gen_api_vimdoc.py: support Doxygen @note 2017-11-06 04:16:07 +01:00
fb3c21e090 doc: job-control
closes #4266
closes #4746
ref https://github.com/neovim/neovim/issues/7058#issuecomment-317196803
2017-11-06 01:56:04 +01:00
5d2af7e452 man.vim: allow other ex-commands after :Man 2017-11-06 01:56:04 +01:00
8cb77acb44 spellfile.vim: use :keeppatterns before :global 2017-11-06 01:56:04 +01:00
73fabf4f15 doc: nvim_buf_add_highlight(): zero-indexed lines 2017-11-06 01:56:04 +01:00
842a54a1bb doc 2017-11-06 01:56:04 +01:00
ZyX
05f775b5f2 viml/parser/expressions: Briefly document some differences 2017-11-06 01:57:22 +03:00
ZyX
ebb5977837 api/vim: Add “len” dictionary key
This allows determining where parsing ended which may be needed for e.g. parsing
`:echo` with that API function.
2017-11-06 01:17:39 +03:00
ZyX
7849070f99 tests: Add missing test cases 2017-11-06 01:17:39 +03:00
ZyX
7bc6de7526 api/vim,functests: Add tests for nvim_parse_expression, fix found bugs 2017-11-06 01:17:39 +03:00
ZyX
07ec709141 vim/api: Actually dump AST, fix some bugs in nvim_parse_expression 2017-11-06 01:17:38 +03:00
ZyX
b9d5aea073 api/vim: Create part of nvim_parse_expression function 2017-11-06 01:17:38 +03:00
ZyX
d98199de9c charset: Refactor vim_str2nr 2017-11-06 01:17:38 +03:00
ZyX
3ecb95298f tests: Fix testlint errors 2017-11-06 01:17:37 +03:00
04b3c32772 'inccommand': Fix matches for zero-width (#7487)
closes #7485
2017-11-05 17:11:44 +01:00
54cac3033f test: startup_spec: cmd.exe escaping 2017-11-04 09:36:52 +01:00
68bef0a57d test: has("ttyin"), has("ttyout") 2017-11-04 09:36:52 +01:00
860ecd7055 vim-patch:8.0.0096: has('ttyin'), has('ttyout')
Nvim note: intentionally did not include `--ttyfail` since its purpose
is not clear. (And it isn't used in any Vim test files/scripts).

---

Problem:    When the input or output is not a tty Vim appears to hang.
Solution:   Add the --ttyfail argument.  Also add the "ttyin" and "ttyout"
            features to be able to check in Vim script.

2cab0e1910
2017-11-04 09:36:52 +01:00
739bc5124a docs: correct cmdline_special_char documentation (#7475) 2017-11-03 09:34:31 +01:00
a39c8b7ce3 test: server_spec: Tolerate missing protocol (#7478)
Travis disabled IPv6:

[ RUN      ] serverstart(), serverstop() parses endpoints correctly: FAIL
...build/neovim/neovim/test/functional/eval/server_spec.lua:83: Expected objects to be the same.
Passed in:
(table) {
  [1] = '127.0.0.1:12345' }
Expected:
(table) {
  [1] = '127.0.0.1:12345'
 *[2] = '::1:12345' }

Change all tests to ensure a server was actually started before
expecting it to be returned from serverlist().
2017-11-02 10:45:38 +01:00
ff819d8ad7 quickfix: fix location list updates.
Fix quickfix performance optimization which prevented quickfix items
from being updated when there were multiple windows with location lists
but the buffer with errors only in one of the lists.
2017-10-31 19:14:23 +01:00
6340689582 quickfix: fix location list updates (test). 2017-10-31 19:14:23 +01:00
eed10f7e23 use provider#stderr_collector 2017-10-31 08:35:29 -07:00
54b79f19d7 win/package: nvim-qt v0.2.8 (#7464) 2017-10-31 12:53:07 +01:00
b67f58b284 Merge #7454 'ui: ext_wildmenu'
closes #6168
ref #5686
2017-10-31 10:45:06 +01:00
60b1e8ad12 Merge #7315 "'inccommand': multiline, other fixes"
closes #5589
closes #5590
closes #5598
closes #5608
2017-10-31 01:11:35 +01:00
241fe704a5 pvs/V575: false positive (#7462)
./src/nvim/ex_getln.c:2787:1: error: V575 The 'memcpy' function doesn't
copy the whole string. Use 'strcpy / strcpy_s' function to preserve
terminal null.

We could instead "trick" PVS like this:

    diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
    index e79476ab532a..295630693b27 100644
    --- a/src/nvim/ex_getln.c
    +++ b/src/nvim/ex_getln.c
    @@ -2782,9 +2782,10 @@ static void ui_ext_cmdline_show(CmdlineInfo *line)

     void ui_ext_cmdline_block_append(int indent, const char *line)
     {
    -  char *buf = xmallocz(indent + strlen(line));
    +  size_t linelen = strlen(line);
    +  char *buf = xmallocz(indent + linelen);
       memset(buf, ' ', indent);
    -  memcpy(buf+indent, line, strlen(line));
    +  memcpy(buf + indent, line, linelen);

       Array item = ARRAY_DICT_INIT;
       ADD(item, DICTIONARY_OBJ((Dictionary)ARRAY_DICT_INIT));
2017-10-30 23:29:47 +01:00
efa9152852 Merge #7456 from justinmk/vim-8.0.1207 2017-10-30 09:49:50 +01:00
cc7285823c eval_clear: free profile data
Memory leak exposed by new test added in #7444.

==38771==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 2400 byte(s) in 1 object(s) allocated from:
    0 0x51163d in realloc (/home/travis/build/neovim/neovim/build/bin/nvim+0x51163d)
    1 0xfda51c in xrealloc /home/travis/build/neovim/neovim/src/nvim/memory.c:169:15
    2 0xda6802 in ga_grow /home/travis/build/neovim/neovim/src/nvim/garray.c:98:14
    3 0xb67ccd in script_line_start /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:3286:11
    4 0xb62885 in getsourceline /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:3110:5
    5 0xb5fbfd in do_source /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2951:15
    6 0xb5c484 in cmd_source /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2710:14
    7 0xb5c5b0 in ex_source /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2691:3
    8 0xb950b9 in do_one_cmd /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:2242:5
    9 0xb737e1 in do_cmdline /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:609:20
    10 0xb79ac5 in do_cmdline_cmd /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:280:10
    11 0xed8a7b in exe_commands /home/travis/build/neovim/neovim/src/nvim/main.c:1684:5
    12 0xec6602 in main /home/travis/build/neovim/neovim/src/nvim/main.c:521:5
    13 0x2ae968600f44 in __libc_start_main /build/eglibc-SvCtMH/eglibc-2.19/csu/libc-start.c:287
2017-10-30 08:37:59 +01:00
ZyX
0356dbbb36 ex_getln: Fix variable name which is wrong after the merge 2017-10-30 01:38:02 +03:00
ZyX
a9b203d23f *: Fix linter errors
Big function in expressions.c may be refactored, if I ever catch the idea how to 
split it right.
2017-10-30 01:32:10 +03:00
ZyX
b29a776550 Merge branch 'master' into expression-parser 2017-10-30 00:49:12 +03:00
ZyX
538af1c90a syntax,viml/parser/expressions: Add missing highlight groups
Also adjusts some names.
2017-10-29 22:02:19 +03:00
ZyX
b91cb18c36 syntax: Adjust position and arguments of syn_init_cmdline_highlight
This way it works both after `nvim -u NORC` and after that and `colorscheme 
wombat256mod`. Removed the comment because I do not actually know why it works 
here with these arguments and not in previous position with previous arguments.
2017-10-29 21:42:37 +03:00
ZyX
748f3ad5bb syntax,viml/expressions/parser: Create defaults for expr highlighting 2017-10-29 21:30:06 +03:00
7890157931 remote: add node.js as a remote plugin provider 2017-10-29 11:10:33 -07:00
8b199cb2fe health: add node health check 2017-10-29 11:06:47 -07:00
4daf63871a Fix cmd modifier tests for the new highlight 2017-10-29 18:21:26 +01:00
ZyX
22d161a5dd api/vim: Add nvim_parse_expression function 2017-10-29 20:11:44 +03:00
7b4baad674 Remove superflous parameter from show_sub 2017-10-29 18:11:32 +01:00
369ac900f9 Adjust tests for new highlighting.
Also extend an old test to show of the new way.
2017-10-29 18:11:32 +01:00
0c358725b1 Fix highlighting conflict 2017-10-29 18:11:32 +01:00
ab942b7ffb Test for clearing the highlight 2017-10-29 18:11:32 +01:00
353c81af1e Clear highlight when there's no match 2017-10-29 18:11:32 +01:00
be20b20cf3 Adjust tests for the new preview window
... that does not have that superflous last line.

Also, remove some indeterminism for the freebsd64 tests. Partially,
those were suggested by the tests themselves, while successfull. Some of
them were added after some testing because the lookaround test would
fail on freebsd64 only.
2017-10-29 18:11:32 +01:00
d8bb1dabb6 Fix the last line in the preview buffer
It would always show an empty line at the end that didn't belong.
2017-10-29 18:11:32 +01:00
3e5ecd9538 Remove pat/sub from show_sub
They were only used to not show the preview window when typing "s/" or
"s//" only, in which case the previous pattern would be reused. Now the
window is shown in that case.
2017-10-29 18:11:32 +01:00
a4e4f2bd02 Move tests into original file, lint, and add a test 2017-10-29 18:11:32 +01:00
35b867d786 Lint 2017-10-29 18:10:46 +01:00
1fcd838942 Fix old inccomand tests, and add more for the new functionality. 2017-10-29 18:10:46 +01:00
8d929f558c Inccommand: Multiline substitutions, highlighting, multibyte.
Make inccomand work with multiline patterns and substitutions. Also care
for proper highlighting and multibyte characters.
2017-10-29 18:10:46 +01:00
1e2ae942f3 vim-patch:8.0.1207
Problem:    Profiling skips the first and last script line.
Solution:   Check for BOM after setting script ID. (Lemonboy, closes vim/vim#2103,
            closes vim/vim#2112) Add a test. List the trailing script lines.

67435d9983
2017-10-29 17:42:37 +01:00
ZyX
1be29dc5ac gen_declarations: Do not generate line numbers by default 2017-10-29 16:56:59 +03:00
ZyX
b935a12dab ex_getln: Make use of new parser to color expressions
Retires g:Nvim_color_expr callback.
2017-10-29 16:32:13 +03:00
45296b331f Merge #7444 'vim-patch: test :profile' 2017-10-29 13:54:17 +01:00
6c43fccb27 vim-patch:8.0.0944
Problem:    Test_profile is a little bit flaky.
Solution:   Accept a match when self and total time are the same. (James
            McCoy, closes vim/vim#1972)

d21b16f3c0
2017-10-29 13:48:03 +01:00
59f5eb0065 doc: ui.txt 2017-10-29 08:18:03 +01:00
39e83fa7cb ui: allow external ui to draw wildmenu
Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
Updated docs and tests.
2017-10-29 08:18:03 +01:00
2a3bcd1ff8 rpc: Don't delay notifications when request is pending (#6544)
With the old behavior, if a GUI makes a blocking request that requires user
interaction (like nvim_input()), it would not get any screen updates.

The client, not nvim, should decide how to handle notifications during a
pending request. If an rplugin wants to avoid async calls while a sync call is
busy, it likely wants to avoid processing async calls while another async call
also is handled as well.

This may break the expectation of some existing rplugins. For compatibility,
remote/define.vim reimplements the old behavior. Clients can opt-out by
specifying `sync=urgent`.

- Legacy hosts should be updated to use `sync=urgent`. They could add a flag
  indicating which async methods are always safe to call and which must wait
  until the main loop returns.
- New hosts can expose the full asyncness, they don't need to offer both
  behaviors.

ref #6532
ref #1398 d83868fe90
2017-10-29 03:06:53 +01:00
3a938fff09 test/win: partially disable :terminal resize test (#7453) 2017-10-29 02:10:37 +01:00
7b0ceb3726 Merge #7173 'api/ui: externalize cmdline'
closes #6162
2017-10-29 02:13:12 +02:00
1a93f58831 test: ui/cmdline_spec.lua: enable on Windows 2017-10-29 02:12:45 +02:00
8526902790 doc/ui.txt 2017-10-29 02:12:45 +02:00
ZyX
06bdc9ed83 klee: Update vim_str2nr in mock as well 2017-10-29 01:40:55 +03:00
ZyX
c202f17c8d unittests: Avoid alloc log checking errors when printing tests 2017-10-29 01:31:31 +03:00
ZyX
568cf73c90 viml/parser/expressions: Fix last error found by KLEE 2017-10-29 01:29:48 +03:00
ZyX
b574e95850 charset: Some more refactoring of vim_str2nr 2017-10-29 01:17:00 +03:00
122f52bf89 vim-patch:8.0.0206 (#7446)
Problem:    Test coverage for :retab insufficient.
Solution:   Add test for :retab. (Dominique Pelle, closes vim/vim#1391)

8822744b4d
2017-10-28 18:05:59 +02:00
8c732f7274 Merge #7440 "terminal: adjust for 'number'"
closes #5310
2017-10-28 18:02:21 +02:00
da13d9a30c test: ctrl_c_spec: bias timeouts for success (#7451)
Having timeouts that are likely to fail incurs a penalty of waiting for
screen:expect() to fail, hence removing such small timeouts will speed
up the test on average.
2017-10-28 18:01:38 +02:00
bcf266de46 test: :terminal + numberwidth=9 2017-10-28 17:55:11 +02:00
b8a67551d8 terminal: Account for number column (#5310) 2017-10-27 17:59:54 -04:00
1de5b041a7 doc: debian badge 2017-10-27 19:34:02 +02:00
20f1bf325c fix TEST_FILE=test_profile.res make oldtest failed 2017-10-27 21:49:28 +08:00
45a95a8a5b vim-patch:8.0.0196
Problem:    The test for :profile is slow and does not work on MS-Windows.
Solution:   Use the "-es" argument. (Dominique Pelle)  Swap single and double
            quotes for system()

c011a3d083
2017-10-27 09:50:01 +08:00
2bd424c1c5 vim-patch:8.0.0194
Problem:    Profile tests fails if total and self time are equal.
Solution:   Make one time optional.

e32bbded64
2017-10-27 09:48:52 +08:00
aab16e6939 vim-patch:8.0.0189
Problem:    There are no tests for the :profile command.
Solution:   Add tests. (Dominique Pelle, closes vim/vim#1383)

296b1f28ca
2017-10-27 09:47:54 +08:00
f640ae0d6e docs: breakout ui.txt from msgpack_rpc.txt 2017-10-26 20:29:10 +02:00
445f25998c ext_cmdline: fix inputsecret() 2017-10-26 20:29:10 +02:00
91d8e26bc7 ext_cmdline: interact with cmdline window 2017-10-26 20:29:10 +02:00
bed0a3a842 ext_cmdline: implement redraw! 2017-10-26 20:29:08 +02:00
2050e66046 ext_cmdline: turn nested cmdlines into a linked list 2017-10-26 20:28:49 +02:00
91f94bfef8 ext_cmdline: restructure and improve tests 2017-10-26 20:28:49 +02:00
87a723963e ext_cmdline: documentation 2017-10-26 20:28:49 +02:00
f2aaa4ae8b ext_cmdline: rename cmdline_char to cmdline_special_char 2017-10-26 20:28:49 +02:00
a68817f565 ext_cmdline: extend "function" to generic "block" mechanism 2017-10-26 20:28:49 +02:00
ddfc077da4 ext_cmdline: disable some redraws 2017-10-26 20:28:49 +02:00
22402fb99d ext_cmdline: add support for highlighting 2017-10-26 20:28:47 +02:00
5ad591ef2d ext_cmdline: lint 2017-10-26 09:35:13 +02:00
fb389a6b4b ext_cmdline: added indent 2017-10-26 09:35:13 +02:00
461ae69824 ext_cmdline: Add function block support 2017-10-26 09:35:13 +02:00
866dadaf75 ext_cmdline: added cmdline level
add cchar_to_string
2017-10-26 09:35:13 +02:00
ab85999eb7 ext_cmdline: change to use ui_call 2017-10-26 09:35:13 +02:00
e164ba41c8 ext_cmdline: fix firstc, change cmdline_leave to cmdline_hide 2017-10-26 09:35:13 +02:00
daec81ab51 ext_cmdline: change the content format 2017-10-26 09:35:13 +02:00
550651c130 ext_cmdline: use standard external ui functions 2017-10-26 09:35:12 +02:00
b7a8a76f6e ext_cmdline: lint 2017-10-26 09:35:12 +02:00
26fd70bd18 ext_cmdline: add tests 2017-10-26 09:35:12 +02:00
6e90bc7200 ext_cmdline: Added cmdline prompt 2017-10-26 09:35:12 +02:00
439c39a2cf ext_cmdline: allow external ui to draw cmdline 2017-10-26 09:35:12 +02:00
f0c2f82e90 Merge pull request #6967 from jamessan/icm-skip-modifiers
inccommand: Ignore leading modifiers in the command
2017-10-24 20:48:27 -04:00
f1f7f3b512 inccommand: Ignore leading modifiers in the command 2017-10-24 19:55:29 -04:00
fdd9b1982b :version : show Lua[Jit] version (#7436)
Also remove vestigial `extra_patches` code.
2017-10-24 21:57:11 +02:00
e35a66d396 Merge #7430 'Ignore virtcols after 32000' 2017-10-22 16:43:43 +02:00
42b80c3acf Merge #7165 'lua: Move stricmp to vim module' 2017-10-22 16:29:36 +02:00
a3134bc480 test: tabstop=<big-number> #2838 2017-10-22 14:11:09 +02:00
e4a974c7cc plines_win_nofold(): Ignore virtcols after 32000th computation #3527
Avoid crashing or hanging when editing a file than contains ludicrously
long lines (more than 100,000,000 virtual columns).

The change is in plines_win_nofold, which is called by wrapping and folding
code. As a result, wrapping and folding may be done incorrectly when the UI is
capable of rendering more than 32000 characters at a time (tiny font).

fixes #2838
2017-10-22 13:28:02 +02:00
9db42d4ce9 :cquit : take an error code argument #7336
closes #2699

ex_cmds.lua: use flags consistent with similar commands such as `cnext`.

upstream discussion:
"[patch] :qcuit can take exit code"
https://groups.google.com/d/msg/vim_dev/_PjyNbUKyRc/oPgr5_ZXc6AJ
2017-10-22 13:02:31 +02:00
bead15f10d vim-patch:8.0.0140 (#7428)
Problem:    Pasting inserted text in Visual mode does not work properly.
            (Matthew Malcomson)
Solution:   Stop Visual mode before stuffing the inserted text. (Christian
            Brabandt, from neovim #5709)

f8eb9c51e5
2017-10-22 12:13:46 +02:00
d7594f9c33 Merge #7420 'vim-patch:8.0.0962, 8.0.1019' 2017-10-21 04:17:23 +02:00
a3a9ef9ad4 Merge #7030 'refactor/single-include'
ref #5321
2017-10-21 04:09:11 +02:00
3ce97879d0 cmake,bsd: Fix mandir to saner defaults. (#7417)
closes #7239

The old behaviour was to set CMAKE_INSTALL_MANDIR to /usr/local/man
when MANPREFIX wasn't defined. This caused mismatching installation
paths when the installation prefix wasn't /usr/local.

This fix explicitely checks that the prefix is /usr/local to change
the value of CMAKE_INSTALL_MANDIR, and uses the default behaviour
otherwise, as /usr/local is the exception rather than the norm
(as per man hier(7)).
2017-10-21 02:36:26 +02:00
7068370560 help, man.vim: change "outline" map to gO (#7405) 2017-10-21 02:33:58 +02:00
37420ef942 build: set MIN_LOG_LEVEL correctly (#7419)
closes #7283
regression by 42d892913d

- Don't need to explicitly put "-O2 -g" in RelWithDebInfo; CMake does
  that already. That was left-over from 42d892913d which removed the
  "Dev" custom build-type, but repurposed the logic for RelWithDebInfo.

- `if(DEFINED MIN_LOG_LEVEL)` doesn't work.
- `if(${MIN_LOG_LEVEL} MATCHES "^$")` doesn't work if -DMIN_LOG_LEVEL is
  omitted.
- `if(MIN_LOG_LEVEL)` also isn't what we want: it would be true if
  MIN_LOG_LEVEL=0.
2017-10-21 02:30:21 +02:00
b5b8966760 vim-patch:8.0.1019
Problem:    Pasting in virtual edit happens in the wrong place.
Solution:   Do not adjust coladd when after the end of the line (closes vim/vim#2015)

d41babef89
2017-10-21 02:24:49 +02:00
82b8382abe vim-patch:8.0.0962
closes #6726

Problem:    Crash with virtualedit and joining lines.
            (Joshua T Corbin, Neovim #6726)
Solution:   When using a mark check that coladd is valid.

9aa1569128
2017-10-21 02:18:00 +02:00
6338199b76 Merge pull request #7414 from bfredl/bufhl_new
bufhl: support creating new groups
2017-10-20 12:40:21 +02:00
dfe806ea8b bufhl: support creating new groups 2017-10-19 11:59:32 +02:00
dde3ece10e lint 2017-10-19 11:20:24 +02:00
0f74b7afeb refactor/single-include: undo.h 2017-10-19 11:20:08 +02:00
14e63271cc refactor/single-include: undo_defs.h 2017-10-19 11:17:18 +02:00
4b0a086d16 refactor/single-include: syntax_defs.h 2017-10-19 11:17:18 +02:00
69199958b7 refactor/single-include: regexp_defs.h 2017-10-19 11:16:46 +02:00
295c90989d refactor/single-include: terminal.h 2017-10-19 11:14:54 +02:00
ZyX
47938e1e22 viml/parser/expressions: Fix some errors spotted by KLEE
Not all of them are fixed yet though.
2017-10-19 10:48:05 +03:00
91586d1ad4 Merge pull request #7404 from jamessan/vim-8.0.0118
vim-patch:8.0.0118
2017-10-18 10:45:05 -04:00
0cba3da26e Merge #7399 ':checkhealth (built-in)' 2017-10-17 22:43:46 +02:00
70b574dab3 vim-patch:8.0.0118
Runtime updates that were bundled into the otherwise NA commit:

Problem:    "make proto" adds extra function prototype.
Solution:   Add vim/vim#ifdef.

5162822914
2017-10-17 14:51:04 -04:00
9467c8e16e Merge pull request #7372 from ckelsel/vim-8.0.0183
vim-patch:8.0.0183 NA
2017-10-17 12:51:07 -04:00
0f0fcce1ab Merge pull request #7313 from ckelsel/vim-8.0.0101
vim-patch:8.0.0101,8.0.0102,8.0.0104,8.0.0106
2017-10-17 12:48:48 -04:00
3bcee71cc8 :checkhealth : validate $VIM 2017-10-17 01:51:21 +02:00
014bd59957 ex_checkhealth: call health#check() directly
This allows us to remove :CheckHealth later (avoids wildmenu noise).
2017-10-17 01:51:21 +02:00
d5d7a9928d doc: E5009 "Invalid $VIMRUNTIME" 2017-10-17 01:51:21 +02:00
d214df4e9b doc: replace ":CheckHealth" with ":checkhealth" 2017-10-17 01:51:21 +02:00
5baeb4a49c ex-cmds: :checkhealth
Built-in `:checkhealth` checks for valid $VIMRUNTIME by attempting to
autoload `health#check()`.

closes #2977
closes #3159
2017-10-17 01:51:20 +02:00
2f4647e77b test: avoid redundant clear() #7340 2017-10-16 21:59:13 +02:00
a792c1f6db Merge #7340 'menu_get: print keycodes' 2017-10-16 09:15:31 +02:00
56eda2aa17 syntax: 'cursorline': revert priority change (#7400)
ref #7383
reverts d1874ab282
ref #6380
2017-10-16 08:18:03 +02:00
ZyX
895793fc82 viml/parser/expressions: Add some casts 2017-10-16 09:14:02 +03:00
ZyX
c9f511d24a viml/parser/expressions: Remove unused flag 2017-10-16 09:06:05 +03:00
ZyX
8e856ebcd0 klee: Add run.sh --help and run.sh -s 2017-10-16 09:00:39 +03:00
ZyX
252a76db80 unittests: Free everything and check for memory leaks
Also improves error reporting.
2017-10-16 03:06:34 +03:00
ZyX
c03dc13bb7 klee: Fix possible assertion error
No idea how it did not happen to hit me yet.
2017-10-16 03:05:27 +03:00
ZyX
4c8ed65b60 viml/parser/expressions: Fix memory leak when processing ternary 2017-10-16 03:04:22 +03:00
ZyX
248493f155 test/unit/formatc: Fix parsing of most recent viml_parser_highlight 2017-10-16 03:03:34 +03:00
ZyX
a535d68380 keymap: Remove incorrect cast 2017-10-16 01:00:58 +03:00
ZyX
15043e93b6 klee: Update key_name_entry table 2017-10-16 00:41:41 +03:00
ZyX
ed253b5fe6 klee: Include colors in test 2017-10-16 00:39:48 +03:00
ZyX
fe81380bf5 viml/parser/expressions: Highlight prefix separately from number
Should make accidental octals more visible.
2017-10-16 00:30:55 +03:00
ZyX
5e92ee6565 charset: Do not call strlen() from vim_str2nr 2017-10-16 00:19:02 +03:00
ZyX
1a3635304b charset: Avoid overflow in vim_str2nr 2017-10-16 00:07:32 +03:00
ZyX
2cb95bd937 viml/parser/expressions: Define east_node_type_tab only when needed 2017-10-15 21:39:01 +03:00
ZyX
4ccaf86110 keymap: Readd figure braces disappeared when resolving conflicts 2017-10-15 21:22:49 +03:00
ZyX
76f0466536 Merge branch 'master' into expression-parser 2017-10-15 21:16:27 +03:00
ZyX
3aa2c0d63a viml/parser/expressions,klee: Fix some problems found by KLEE run 2017-10-15 21:11:00 +03:00
ZyX
bc386c4882 charset: Fix out-of-bounds array access
It is incorrect to *first* access ptr[2] and *then* check whether maxlen allows 
it.
2017-10-15 21:09:08 +03:00
ZyX
57bb3346d9 viml/parser/expressions: Update some comments and add another check 2017-10-15 20:43:16 +03:00
ZyX
6c19cbef26 viml/parser/expressions,tests: Add AST freeing, with sanity checks 2017-10-15 20:05:35 +03:00
3e502fd7d6 Merge pull request #7373 from bfredl/cmdwin_clip
save and restore clipboard batch status when entering cmdline window
2017-10-15 18:32:43 +02:00
ZyX
206f7ae76a unittests: Test some edge cases 2017-10-15 19:18:17 +03:00
ZyX
c286155bfa viml/parser/expressions: Create tests for latest additions 2017-10-15 19:13:52 +03:00
ZyX
8178ba2871 klee: Fix some errors made in …parser.c 2017-10-15 19:13:52 +03:00
ZyX
fa3cfc0dd5 viml/parser/expressions: Finish parser
Note: formatc.lua was unable to swallow some newer additions to ExprASTNodeType 
(specifically `kExprNodeOr = '|'` and probably something else), so all `= …` 
were dropped: in any case they only were there in order to not bother updating 
viml_pexpr_debug_print_ast_node and since it is now known all nodes which will 
be present it is not much of an issue.
2017-10-15 19:13:52 +03:00
ZyX
af38cea133 viml/parser/expressions: Add support for string parsing 2017-10-15 19:13:52 +03:00
ZyX
c484613ce0 keymap: Lint some functions to be copied for symbolic tests 2017-10-15 19:13:52 +03:00
ZyX
e423cfe194 edit: Lint some functions which are to be copied for symbolic tests 2017-10-15 19:13:52 +03:00
ZyX
6f22b5afad mbyte: Lint some functions which are to be copied for symbolic tests 2017-10-15 19:13:52 +03:00
ZyX
bd3a4166b2 viml/parser/expressions: Add support for subscript and list literals 2017-10-15 19:13:51 +03:00
ZyX
e45e519495 viml/parser/expressions: Error out on multiple colons in a row 2017-10-15 19:13:51 +03:00
ZyX
21a5ce033c viml/parser/expressions: Add support for the dot operator and numbers 2017-10-15 19:13:50 +03:00
ZyX
163792e9b9 viml/parser/expressions: Make lexer parse numbers, support non-decimal 2017-10-15 19:13:50 +03:00
ZyX
0bc4e22379 viml/parser/expressions: Forbid dot or alpha characters after a float
This is basically what Vim already does, in addition to forbidding floats should
there be a concat immediately before it.
2017-10-15 19:13:50 +03:00
ZyX
6168e1127c viml/parser/expressions: Add support for comparison operators 2017-10-15 19:13:49 +03:00
ZyX
6791c57420 viml/parser/expressions: Make sure that arrows outside lambda throw 2017-10-15 19:13:49 +03:00
ZyX
6144e26eb9 viml/parser/expressions: Add support for ternary operator 2017-10-15 19:13:49 +03:00
ZyX
9e721031d5 viml/parser/expressions: Fix determining invalid commas/colons 2017-10-15 19:13:48 +03:00
ZyX
3735537a50 viml/parser/expressions: Fix call inside nested parenthesis
It may have incorrectly tried to call everything because of essentially “value” 
nodes being treated as not such.
2017-10-15 19:13:48 +03:00
ZyX
f33543377e viml/parser/expressions: Add a way to represent tokens from C code 2017-10-15 19:13:47 +03:00
2ecff0814e doc: remove E172 (#7395)
vim-patch:8.0.1189

We already made the code-change in 0e44916fff
2017-10-15 17:54:59 +02:00
4b3e51d4ee ops: save and restore clipboard batch status when entering cmdline window 2017-10-15 16:36:00 +02:00
68f3da5f61 Merge pull request #7394 from justinmk/health.vim
health.vim: check 'paste' option; fix highlighting
2017-10-15 13:16:01 +02:00
2a5a6a0541 health.vim: rename "suggestions" to "advice" in most places 2017-10-15 12:06:14 +02:00
c4ab110e04 health.vim: fix highlighting
`:syntax keyword` is affected by 'iskeyword'. When we aligned
'iskeyword' to that of filetype=help, colon (:) is now included.
Simplest way to deal with this is to include colon (:) in the `:syntax
keyword` directive.

Also:
- change "SUGGESTIONS" mouthful to "ADVICE"
- change "SUCCESS" to "OK"
2017-10-15 12:06:13 +02:00
7ca1f43f68 health.vim: warn about 'paste' option 2017-10-15 12:06:13 +02:00
02c2b1d1b3 Merge pull request #7380 from jamessan/silent-input
getcmdline_prompt: Temporarily disable msg_silent so prompt is displayed
2017-10-14 16:11:46 -04:00
dc513f7618 getcmdline_prompt: Temporarily disable msg_silent so prompt is displayed
vim-patch:7.4.1636
Closes #7378
2017-10-14 14:32:27 -04:00
97dc1350f0 vim-patch:8.0.0183 NA
Problem:    Ubsan warns for using a pointer that is not aligned.
Solution:   First copy the address. (Yegappan Lakshmanan)

7173b47958
2017-10-10 14:54:52 +08:00
7d3f302ef9 Merge branch 'vim-8.0.0101' of github.com:ckelsel/neovim into vim-8.0.0101 2017-10-10 14:50:42 +08:00
d2b0c5838a Merge branch 'master' of github.com:ckelsel/neovim into vim-8.0.0101 2017-10-10 14:50:13 +08:00
77f1392f07 Merge #7327 from ckelsel/vim-8.0.0131 2017-10-09 22:56:30 +02:00
2abd939dae Merge branch 'master' of github.com:ckelsel/neovim into vim-8.0.0101 2017-10-09 21:17:15 +08:00
ceb40c0411 Merge remote-tracking branch 'upstream/master' 2017-10-09 21:16:43 +08:00
ZyX
f265066081 unittests: Add support for dumping “expected” state
Purpose is similar to that of `screen:snapshot_util()`, but in different domain.
2017-10-08 22:25:09 +03:00
ZyX
9fa8f7fc0a viml/parser/expressions: Add a way to adjust lexer
It also adds support for kExprLexOr which for some reason was forgotten.

It was only made sure that KLEE test compiles in non-KLEE mode, not that
something works or that KLEE is able to run tests.
2017-10-08 22:25:08 +03:00
ZyX
0987d3b10f viml/parser/expressions: Make curly braces name actually work 2017-10-08 22:25:07 +03:00
ZyX
3cc65ac054 viml/parser/expressions: Make commas actually work when calling 2017-10-08 22:25:07 +03:00
ZyX
d4782fb1ca viml/parser/expressions: Make commas actually work when calling 2017-10-08 22:25:06 +03:00
ZyX
7980614650 viml/parser/expressions: Add support for figure braces (three kinds) 2017-10-08 22:25:06 +03:00
ZyX
7c97f78393 klee: Start preparing for klee tests
First stage: something compiling without klee, but with a buch of dirty
hacks - done.
Second stage: something running under klee, able to emit useful results,
but still using dirty hacks - done.

Third stage: make CMake care about clang argumnets - not done, may be
omitted if proves to be too hard. Not that klee can be run on CI in any
case.
2017-10-08 22:25:05 +03:00
ZyX
430e516d3a viml/parser/expressions: Start creating expressions parser
Currently supported nodes:

- Register as it is one of the simplest value nodes (even numbers are
  not that simple with that dot handling).
- Plus, both unary and binary.
- Parenthesis, both nesting and calling.

Note regarding unit tests: it stores data for AST in highlighting in
strings in place of tables because luassert fails to do a good job at
representing big tables. Squashing a bunch of data into a single string
simply yields more readable result.
2017-10-08 22:25:03 +03:00
db999821d4 Merge #7082 'api: nvim_get_hl_by_name/by_id' 2017-10-08 21:19:02 +02:00
52517321d1 test: nvim_get_hl_by_name/by_id #7082
- test all properties
- test failure modes
2017-10-08 21:17:20 +02:00
ZyX
919223c23a unittests: Move some functions into helpers modules 2017-10-08 22:12:00 +03:00
ZyX
1265da0288 viml/parser: Add helper functions for highlighting 2017-10-08 22:12:00 +03:00
ZyX
2d8b9937de viml/parser: Handle encoding conversions 2017-10-08 22:11:59 +03:00
ZyX
0300c4d109 viml/expressions: Add lexer with some basic tests 2017-10-08 22:11:57 +03:00
ZyX
ad58e50b45 kvec: Add kv_Z which is like kv_A, but zero is the last value 2017-10-08 22:11:57 +03:00
04187a1c74 Merge #7082 'api: nvim_get_hl_by_name/by_id' 2017-10-08 19:09:14 +02:00
1663599beb vim-patch:8.0.0164 (#7368)
Problem:    Outdated and misplaced comments.
Solution:   Fix the comments.

caa55b65c2
2017-10-08 18:52:57 +02:00
e565fc2294 gitignore: cmake-build-debug (#7359) 2017-10-08 18:26:44 +02:00
76606b6bc5 Merge remote-tracking branch 'upstream/master' 2017-10-08 09:35:23 +08:00
4b2592d7b6 Merge branch 'master' into vim-8.0.0131 2017-10-08 09:33:20 +08:00
032b088c84 Merge #7364 lower priority of 'cursorline', 'cursorcolumn' 2017-10-07 19:11:05 +02:00
d916ea107a resettitle(): remove conditions (#7360)
These conditions were added in #7358 for no apparent reason.

ref https://github.com/neovim/neovim/pull/7358#discussion_r143064448
2017-10-07 18:05:02 +02:00
e3ca1e6046 vim-patch:8.0.0142 (#7335)
see also #7082

Problem:    Normal colors are wrong with 'termguicolors'.
Solution:   Initialize to INVALCOLOR instead of zero. (Ben Jackson, closes vim/vim#1344)

0cdb72aa38
2017-10-07 17:20:34 +02:00
c0e45d97b0 vim-patch:8.0.0148 #7344
Problem:    When a C preprocessor statement has two line continuations the
            following line does not have the right indent. (Ken Takata)
Solution:   Add the indent of the previous continuation line. (Hirohito
            Higashi)

c6aa475a27
2017-10-07 17:10:37 +02:00
d1874ab282 syntax: 'cursorline': low priority #6380 2017-10-07 16:45:15 +02:00
7a832c312f syntax: 'cursorcolumn', 'colorcolumn': low priority #6380 2017-10-07 16:31:34 +02:00
9ad7529f70 vim-patch:8.0.0157 (#7362)
Problem:    No command line completion for ":syntax spell" and ":syntax sync".
Solution:   Implement the completion. (Dominique Pelle)

2d02839050
2017-10-07 14:32:37 +02:00
a4019bc9f6 eval.c: ga_concat_esc() #7357
vim-patch:2368917d8f0c0a997eac7a51ddfaa748dc528392
closes #7256
2017-10-07 12:45:23 +02:00
f2b9ccec10 Merge remote-tracking branch 'upstream/master' 2017-10-07 18:14:09 +08:00
01487d4385 Merge #7358 from justinmk/titleold 2017-10-05 21:49:06 +02:00
73b50de925 'titleold': move logic to getout() 2017-10-05 09:49:17 +02:00
70e84a7c4c 'titleold': simplify behavior
- default 'titleold' to empty
- set title on exit if 'title' is enabled and 'titleold' is non-empty
- update docs
2017-10-05 09:18:33 +02:00
5f4d2edeee 'titleold': set UI title on exit #7191
closes #7129
ref #4063
2017-10-05 09:18:30 +02:00
b7fe15d8f9 editorconfig: handle Vim help files (#7354) 2017-10-04 09:18:03 +02:00
07a0685b48 Merge pull request #7355 from jamessan/ngettext-fix
Stub ngettext when libintl isn't available
2017-10-03 17:29:27 -04:00
235fda5f86 Stub ngettext when libintl isn't available
This should have been included in #6547 as part of vim-patch:7.4.2152.

Closes #7352
2017-10-03 14:54:50 -04:00
1f6138702c More tests 2017-10-02 21:49:53 +02:00
41f624a85b Deal with NOP, add actext to output 2017-10-02 21:49:50 +02:00
01e53a5cbe Merge #7349 'win: more path-handling fixes' 2017-10-02 02:42:33 +02:00
6f7754dfa0 test: avoid extra clear() calls
also: various other cleanup
2017-10-02 01:46:16 +02:00
e9dba214ea test/shada: fixup for Windows backslashes #7287 2017-10-02 00:48:43 +02:00
2b133101cf win: vim_FullName(): force backslashes #7287
- Replace obvious cases of '/' literal with PATHSEP. (There are still
  some remaining cases that need closer inspection.)
- Fixup tests: ui/screen_basic

closes #7117
ref https://github.com/neovim/neovim/issues/2471#issuecomment-271193714
2017-10-02 00:48:30 +02:00
981387b7c8 ci/appveyor: modify compression options for cache
Attempt to workaround #7317 by using a different compression algorithm.
2017-10-01 12:17:26 +02:00
9fb8b47ad8 menu_get: adjust tests for prettyprinting
... and add a bit of new testing
2017-10-01 11:47:35 +02:00
4543fc1612 menu_get: prettyprint special chars 2017-10-01 11:47:31 +02:00
fae55937ac Merge remote-tracking branch 'upstream/master' 2017-09-30 21:38:29 +08:00
95458609ab runtime/syntax/vim.vim: highlight nvim groups #7338
regressed by 86b596dc7a
2017-09-30 15:03:06 +02:00
481e40cc8c Remove duplicate ATTRENTRY_INIT 2017-09-30 11:44:50 +09:00
3a00648639 Changed prototypes to accept a boolean "rgb" 2017-09-30 11:43:26 +09:00
e3a2cca387 Increased test coverage for RGB and cterm 2017-09-30 11:43:26 +09:00
ba7277cfb4 Adds nvim_get_hl_by_name/by_id
...in order to retrieve highlights.

Added test/functional/api/highlight_spec.lua
HL_NORMAL is not really a good name, since it's more like an empty attribute than the normal's one.
If one pays attention, syn_cterm_attr2entry is never called with attr=0 because it's always special cased before.
I suggest in subsequent PRs we remove the ATTR_OFF and just insert an EMPTY ATTR/RESET_ATTR/UNINITIALIZED for id 0.
2017-09-30 11:43:26 +09:00
ZyX
e479f3b944 kvec: Add kv_drop() which is to be used like (void)kv_pop(kvec) 2017-09-29 01:21:22 +03:00
ZyX
190c8516f5 unittests: Add a way to print trace on regular error 2017-09-29 01:21:13 +03:00
ZyX
520c0b91a5 test/helpers: Add format_string and format_luav
First intended to provide %r functionality like in Python (and also support for 
%*.*s, but this was not checked), second adds nice table formatting for use in 
cases similar to screen:snapshot_util().
2017-09-29 01:21:07 +03:00
c580ef68e8 Merge #7328 from jamessan/keep-testdir-make
Fix overzealous exclusions in vim-patch.sh
2017-09-28 08:16:55 +02:00
f97ca6b333 vim-patch:8.0.0155
Problem:    When sorting zero elements a NULL pointer is passed to qsort(),
            which ubsan warns for.
Solution:   Don't call qsort() if there are no elements. (Dominique Pelle)

a216255a4f
2017-09-28 12:28:25 +08:00
f1242c2a26 oldtest: Run test_mksession_utf8 tests 2017-09-27 08:27:31 -04:00
e6d4b7686c vim-patch.sh: Exclude testdir/ files from src/ file pruning
Without the testdir/ exclusion, all directories under src/ were affected
by this cleanup.  However, testdir/ has its own pruning that happens
later.
2017-09-27 08:20:43 -04:00
65c97961ec vim-patch:8.0.0132
Problem:    Test fails because of using :finish.
Solution:   Change to return.

4c8980b717
2017-09-27 20:07:09 +08:00
36f13ceb0a vim-patch:8.0.0131
Problem:    Not enough test coverage for syntax commands.
Solution:   Add more tests. (Dominique Pelle)

73b484c4da
2017-09-27 20:05:39 +08:00
c3de878ab1 Merge remote-tracking branch 'upstream/master' 2017-09-27 19:34:19 +08:00
5d369ad384 Merge branch 'vim-8.0.0101' of github.com:ckelsel/neovim into vim-8.0.0101 2017-09-27 19:32:02 +08:00
dde62900c8 Merge branch 'master' of https://github.com/neovim/neovim into vim-8.0.0101
fix Conflicts
2017-09-27 19:21:40 +08:00
542ed5f5d3 Merge pull request #7325 from jamessan/vim-8.0.0112
vim-patch:8.0.0112,8.0.0253,8.0.0258,8.0.1024,8.0.1025
2017-09-26 22:48:02 -04:00
e085a50c59 Merge pull request #7310 from ckelsel/vim-8.0.0330
vim-patch:8.0.0330
2017-09-26 16:56:19 -04:00
5c25d65f45 Merge pull request #7309 from ckelsel/vim-8.0.0328
vim-patch:8.0.0328
2017-09-26 16:39:56 -04:00
f66307475d lint 2017-09-26 16:08:15 -04:00
e0197a4d76 vim-patch:8.0.1025
Problem:    Stray copy command in test.
Solution:   Remove the copy command.

4e83961985
2017-09-26 16:04:32 -04:00
25d4cd7e28 vim-patch:8.0.1024
Problem:    Manual folds are lost when a session file has the same buffer in
            two windows. (Jeansen)
Solution:   Use ":edit" only once. (Christian Brabandt, closes vim/vim#1958)

4bebc9a056
2017-09-26 16:03:43 -04:00
43da7ea27b vim-patch:8.0.0258
Problem:    mksession test leaves file behind.
Solution:   Delete the file.  Rename files to start with "X".

c9b56b2ceb
2017-09-26 15:51:11 -04:00
5bb2a19417 vim-patch:8.0.0253
Problem:    When creating a session when winminheight is 2 or larger and
            loading that session gives an error.
Solution:   Also set winminheight before setting winheight to 1. (Rafael
            Bodill, neovim vim/vim#5717)

36ae89c550
2017-09-26 15:50:00 -04:00
1c7f396f0c vim-patch:8.0.0112
Problem:    Tests 92 and 93 are old style.
Solution:   Make test92 and test93 new style. (Hirohito Higashi, closes vim/vim#1289)

eca626fcdb
2017-09-26 15:49:55 -04:00
b3905c44d1 Merge pull request #7311 from ckelsel/vim-8.0.0333
vim-patch:8.0.0333
2017-09-26 15:06:08 -04:00
126b2ca077 test: lint whitespace in legacy/ (#7308) 2017-09-24 20:42:48 +02:00
2b4a52f901 vim-patch:8.0.0091 (#7312)
Problem:    Test_help_complete sometimes fails in MS-Windows console.
Solution:   Use getcompletion() instead of feedkeys() and command line
            completion. (Hirohito Higashi)

9f0e423c28
2017-09-24 17:20:45 +02:00
3a1c33a6c3 vim-patch:8.0.0106
Problem:    Cannot use a semicolon in 'backupext'. (Jeff)
Solution:   Allow for a few more characters when "secure" isn't set.

0945eaface
2017-09-24 13:42:48 +08:00
25a3f77f61 vim-patch:8.0.0106
Problem:    Cannot use a semicolon in 'backupext'. (Jeff)
Solution:   Allow for a few more characters when "secure" isn't set.

0945eaface
2017-09-24 13:42:15 +08:00
1a73ac7698 Merge branch 'vim-8.0.0101' of github.com:ckelsel/neovim into vim-8.0.0101 2017-09-24 13:11:47 +08:00
172722ec51 vim-patch: 8.0.0104
Problem:    Value of 'thesaurus' option not checked properly.
Solution:   Add P_NDNAME flag. (Daisuke Suzuki)
f422bcc7f9
2017-09-24 13:07:36 +08:00
e2bdfb573e fix conflict 2017-09-24 12:52:55 +08:00
cd13c24427 vim-patch:8.0.0102
Problem:    Cannot set 'dictionary' to a path.
Solution:   Allow for slash and backslash.  Add a test (partly by Daisuke
            Suzuki, closes vim/vim#1279, closes vim/vim#1284)

7554da4033
2017-09-24 12:49:16 +08:00
d2eba872fb vim-patch:8.0.0101
Problem:    Some options are not strictly checked.
Solution:   Add flags for strickter checks.

031cb743ae
2017-09-24 11:54:10 +08:00
583b68f5a9 vim-patch:8.0.0101
Problem:    Some options are not strictly checked.
Solution:   Add flags for strickter checks.

031cb743ae
2017-09-24 11:47:53 +08:00
2b53a565b9 vim-patch:8.0.0333
Problem:    Illegal memory access when 'complete' ends in a backslash.
Solution:   Check for trailing backslash. (Dominique Pelle, closes vim/vim#1478)

226c534291
2017-09-24 10:17:14 +08:00
006425b8b6 vim-patch:8.0.0330
Problem:    Illegal memory access after "vapo". (Dominique Pelle)
Solution:   Fix the cursor column.

84b2a38145
2017-09-24 10:00:53 +08:00
3ab6a519fc vim-patch:8.0.0328
Problem:    The "zero count" error doesn't have a number. (Hirohito Higashi)
Solution:   Give it a number and be more specific about the error.

23a5558cfd
2017-09-24 09:41:09 +08:00
90fc9039dd Merge remote-tracking branch 'upstream/master' 2017-09-24 09:16:59 +08:00
4bb0e95abb Merge pull request #7298 from jamessan/check-array-bounds-support
cmake: Check if the compiler understands -Wno-array-bounds
2017-09-23 08:30:45 -04:00
094bc39d01 Move definition of cstrchr above the functions which call it
Functions with FUNC_ATTR_ALWAYS_INLINE need to be defined before they
are called to work around bugs with some compiler versions.  When the
body is after the use of the function, compilation will fail with

    /home/niko/build/neovim/src/nvim/regexp.c: In function 'regmatch':
    /home/niko/build/neovim/build/src/nvim/auto/regexp.c.generated.h:77: sorry, unimplemented: inlining failed in call to 'cstrchr': function body not available
    /home/niko/build/neovim/src/nvim/regexp.c:4193: sorry, unimplemented: called from here
2017-09-23 07:42:21 -04:00
6d471636ee cmake: Check if the compiler understands -Wno-array-bounds
Closes #7297
2017-09-23 07:42:15 -04:00
f8dcd319d9 vim-patch:8.0.0294 (#7305)
Problem:    Argument list is not stored correctly in a session file.
            (lgpasquale)
Solution:   Use "$argadd" instead of "argadd". (closes vim/vim#1434)

79da563cf9
Signed-off-by: Michael Schupikov <michael@schupikov.de>
2017-09-23 08:32:29 +02:00
2e9a345b3e runtime/tutor: fix typos (#7302) 2017-09-23 06:07:05 +02:00
68bc73b107 doc: fix typo with :lcd (#7299) 2017-09-22 08:32:27 +02:00
460aab3950 escape amatch filename (#7292)
Fixes #7046
Fixes autozimu/LanguageClient-neovim#77
2017-09-19 08:13:44 +02:00
37609db6d0 Merge #7252 from justinmk/perf-vim.vim 2017-09-18 01:54:17 +02:00
43d32762e3 Merge pull request #7280 from bfredl/fix_helptags
cmake: remove stale doc files to avoid "duplicate tags" message
2017-09-17 21:32:53 +02:00
705739a162 Merge pull request #7277 from jamessan/deprecated-unibilium-APIs
tui: Use unibi_var_from_num when available
2017-09-17 15:30:27 -04:00
1f1728e9bf runtime/syntax/vim.vim: highlight vimEmbedError as Normal 2017-09-17 20:07:31 +02:00
20a79706e2 runtime/syntax/vim.vim: disable g:vimsyn_embed by default
This feature is extremely slow.
Also merge some minor upstream differences (missed by a previous merge).
2017-09-17 20:07:31 +02:00
12efbf897d vim-patch:8.0.0327 (#7281)
Problem:    The E11 error message in the command line window is not
            translated.
Solution:   use _(). (Hirohito Higashi)

75c19464ed
2017-09-17 20:05:22 +02:00
cf59d617bc vim-patch:8.0.0324 (#7279)
Problem:    Illegal memory access with "1;y".
Solution:   Call check_cursor() instead of check_cursor_lnum(). (Dominique
            Pelle, closes vim/vim#1455)

f1f6f3f7df
2017-09-17 20:04:17 +02:00
009c695f0a vim-patch:8.0.0302 NA (#7264)
(NA: Nvim removed the ability to set termcodes directly.)

Problem:    Cannot set terminal key codes with :let.
Solution:   Make it work.

e353c402e6
2017-09-17 19:56:08 +02:00
e53af2b1f5 vim-patch:8.0.0305 (#7265)
Problem:    Invalid memory access when option has duplicate flag.
Solution:   Correct pointer computation. (Dominique Pelle, closes vim/vim#1442)

aaaf57d8a9
2017-09-17 19:43:45 +02:00
0b1904d835 Revert cbda7d8 "build: Revert 464bc16."
In-tree builds are no longer allowed, so deleting build/docs/ is
harmless

ref 53eddb8
2017-09-17 19:19:50 +02:00
6258e33b11 Merge remote-tracking branch 'upstream/master' 2017-09-17 20:41:47 +08:00
b9cba41106 tui: Use unibi_var_from_num when available
As of unibilium 1.2.1, directly manipulating unibi_var_t is deprecated.

    ../src/nvim/tui/tui.c: In function 'update_attrs':
    ../src/nvim/tui/tui.c:321:7: warning: 'i' is deprecated: use unibi_var_from_num or unibi_num_from_var instead [-Wdeprecated-declarations]
           data->params[0].i = (fg >> 16) & 0xff;  // red
           ^~~~
    In file included from ../src/nvim/tui/tui.c:12:0:
    /usr/include/unibilium.h:632:9: note: declared here
         int i   UNIBI_DEPRECATED("use unibi_var_from_num or unibi_num_from_var instead");
             ^

All use should go through unibi_{num,str}_from_var and
unibi_var_from_{num,str}.  Wrap access of unibi_var_t behind a new
UNIBI_SET_NUM_VAR macro which uses the new functions when they're
available.
2017-09-16 23:23:01 -04:00
9d6bac3219 test: more coverage for RPC + op-pending #3732 2017-09-16 12:21:31 +02:00
47019bb167 getchar.c: add TERM_FOCUS to MAP_HASH (#7271)
vim-patch:8.0.1108

69fbc9e1da
2017-09-16 11:20:26 +02:00
1cebf17fbe build: show a hint for BSD make (#7275)
BSD Make will give preference to a BSDmakefile in the same directory
over a generic Makefile; this can be used to instruct BSD users to build
neovim with GNU Make (gmake) instead.

Otherwise, a flood of syntax errors stemming from the GNU-specific
Makefile will be displayed - which most BSD users are accustomed to, but
may confuse beginners nevertheless.
2017-09-16 10:54:49 +02:00
1551f71321 Merge #7262 'inccommand': fix 'gdefault' lockup 2017-09-15 00:04:42 +02:00
bf80a68d0d Merge remote-tracking branch 'upstream/master' 2017-09-13 20:45:12 +08:00
2736f0cb56 ex_cmds.c:do_sub(): macroize duplicate code 2017-09-13 00:00:42 +02:00
6d0f87a0bd 'inccommand': fix 'gdefault' lockup #7261
closes #7244
ref #7249
2017-09-12 22:44:11 +02:00
d2cbc31185 Vim-patch 8.0.0300 (#7258)
vim-patch:8.0.0300

Problem:    Cannot stop diffing hidden buffers. (Daniel Hahler)
Solution:   When using :diffoff! make the whole list if diffed buffers empty.
            (closes vim/vim#736)

25ea054458
2017-09-11 10:17:41 -04:00
5ad5bb0c0c Merge remote-tracking branch 'upstream/master' 2017-09-11 19:14:41 +08:00
f51a397010 ci/travis: ignore pip3 failure
Workaround for travis issue:
https://github.com/travis-ci/travis-ci/issues/8363

Cannot check `command -v pip3`, because that may point to
`/opt/pyenv/shims/pip3` which is also (sometimes) broken.

ref 6389bde0bc
2017-09-10 14:14:00 +02:00
ceade2fe53 vim-patch:8.0.0186 (#7154)
Problem:    The error message from assert_notequal() is confusing.
Solution:   Only mention the expected value.

5869cf060e
2017-09-10 12:52:43 +02:00
713a957e9c vim-patch:8.0.0282 vim-patch:8.0.0291 (#7255)
vim-patch:8.0.0291

Problem:    Visual block insertion does not insert in all lines.
Solution:   Don't bail out of insert too early. Add a test. (Christian
            Brabandt, closes vim/vim#1290)

23fa81d222

vim-patch:8.0.0282

Problem:    When doing a Visual selection and using "I" to go to insert mode,
            CTRL-O needs to be used twice to go to Normal mode.
            (Coacher)
Solution:   Check for the return value of edit(). (Christian Brabandt,
            closes #1290)

0b5c93a7f2
2017-09-10 12:21:52 +02:00
af2dd68272 Merge remote-tracking branch 'upstream/master' 2017-09-10 16:43:01 +08:00
d173d48177 Merge #7253 from justinmk/ci-travis 2017-09-09 21:59:46 +02:00
6389bde0bc ci/travis: skip pip3 upgrade if pip3 is missing
Workaround for travis issue:
https://github.com/travis-ci/travis-ci/issues/8363

Sometimes `pip3` works, sometimes not:
   pyenv: pip3: command not found
   The `pip3' command exists in these Python versions:
     3.5
     3.5.3

Tried these steps to fix the issue:
- add `python: 3.6` to top level of `.travis.yml`
- add `python3` to `addons.apt.packages` level of `.travis.yml`
- `pyenv global system 3.{4,5,6}`
- `pyenv global 3.6`
In all cases the presence or absence of `pip3` was random.
2017-09-09 21:26:56 +02:00
23cc41df55 ci/travis: report python environment info 2017-09-09 21:26:55 +02:00
b927e50c53 test: FocusGained: retry() cmdline-mode test 2017-09-09 21:26:55 +02:00
7c00b10d8d health.vim: always check pyenv if installed #7219
Always check for the presence of pyenv_root if pyenv is installed: if it
is not set, we don't know if it was intentional. If it wasn't
intentional, the warning is confusing (see #7176).

closes #7176
2017-09-09 15:56:51 +02:00
26d08dfd0d inccommand: fix optimization logic #7224
Before this change the preview changes in the buffer viewport were
limited to the size of the preview window ('cmdwinheight').

closes #7220
2017-09-09 15:02:06 +02:00
06f8ad5b2a terminal.c: need maketitle() in terminal-mode
normal_redraw() usually takes care of this, but that doesn't happen
during terminal-mode.

regression by c484323dc6
steps to reproduce:
    nvim -u NORC --cmd 'execute("set titlestring=" . $NVIM_LISTEN_ADDRESS) | set title | startinsert | !sleep 1' term://sh

closes #7248
2017-09-09 14:07:36 +02:00
618cfe03fc test: ex_terminal_spec.lua: retry flaky test (#7245)
https://api.travis-ci.org/jobs/271833660/log.txt
2017-09-07 09:40:37 +02:00
cb912a3eda Merge #7241 ':terminal : handle F1-F12, other keys' 2017-09-06 09:22:32 +02:00
51808a244e Merge #7221 from justinmk/ev-focusgained
tui: schedule event instead of <FocusGained> pseudokey
2017-09-06 07:25:01 +02:00
82795c2c3a vim-patch: 8.0.0{181,182,188} (#7152)
vim-patch:8.0.0181
Problem:    When 'cursorbind' and 'cursorcolumn' are both on, the column
            highlignt in non-current windows is wrong.
Solution:   Add validate_cursor(). (Masanori Misono, closes vim/vim#1372)
519d7785f4

vim-patch:8.0.0182
Problem:    When 'cursorbind' and 'cursorline' are set, but 'cursorcolumn' is
            not, then the cursor line highlighting is not updated. (Hirohito
            Higashi)
Solution:   Call redraw_later() with NOT_VALID.
e47683a091

vim-patch:8.0.0188
    Problem:    Using NOT_VALID for redraw_later() to update the cursor
                line/column highlighting is not efficient.
    Solution:   Call validate_cursor() when 'cul' or 'cuc' is set.
9506cad7a1
2017-09-05 19:04:57 +02:00
b9d6bda531 test: FocusGained: press-enter prompt 2017-09-05 18:44:01 +02:00
5696991c6d Merge #5014 ':terminal : handle F1-F12, other keys'
closes #3101
closes #4343
closes #5024
closes #5925
2017-09-05 18:11:38 +02:00
cdd9e868ef doc: channel, eventloop 2017-09-05 15:01:07 +02:00
c00a33ed19 eventloop: loop_schedule_deferred()
Generalize the "schedule schedule" technique.
2017-09-05 15:01:07 +02:00
ff32bacb2e test: FocusGained: let UI settle before sending input
This significantly increases the likelihood that the :echo'd text will
be included in the next UI flush, instead of being lost.
2017-09-05 15:01:07 +02:00
8716994cf0 lint 2017-09-05 15:01:07 +02:00
63c6470505 log: introduce context 2017-09-05 15:01:07 +02:00
6c53c3ee55 eventloop: restore redraw in cmdline K_EVENT handler
Restores behavior from commit: 02e86ef04cc1
2017-09-05 15:01:06 +02:00
d47b538f39 eventloop: do not redraw in cmdline K_EVENT handler
If :echo is done by an timer or event (such as FocusGained/FocusLost),
redrawcmdline() clobbers it.
2017-09-05 15:01:06 +02:00
4bf953cca4 test: FocusGained/FocusLost 2017-09-05 15:01:06 +02:00
f9af824832 test: use global_helpers.uname() instead of calling to nvim UUT 2017-09-05 15:01:06 +02:00
d30abd8857 eventloop: FocusGained: schedule the schedule
main_loop.fast_events does not manifest as K_EVENT, because it is
processed at a different stage than main_loop.events. In order to queue
into main_loop.events, we need to go through the threadsafe
loop_schedule(), which queues into main_loop.thread_events and
eventually main_loop.fast_events. _Then_ it is safe to directly queue
into main_loop.events.

This makes it more likely that the event is treated as K_EVENT.
2017-09-05 15:01:06 +02:00
46fdacc5b5 doc: eventloop 2017-09-05 15:01:06 +02:00
b6b6e4a96f eventloop: FocusGained: schedule event instead of pseudokey
closes #4840
closes #6164
2017-09-05 15:01:06 +02:00
ce852bab04 eventloop: K_EVENT does not finish mapping
The "mapping" tests added in 541dde36e3 were flawed:
- Unlike op-pending mode, RPCs are _blocked_ during map-pending. So
  a synchronous RPC like nvim_get_current_buf() waits until
  'timeoutlen', then the mapping is canceled.
- helpers.expect() also performs a blocking RPC, so again that must not
  intervene the two nvim_input() calls.

closes #6166
2017-09-04 22:51:04 +02:00
f050aaabbb tui: DECSCUSR workaround for Konsole (#7236)
closes #7235
2017-09-04 18:48:05 +02:00
3922237b14 test: lint 2017-09-04 10:46:10 +02:00
541dde36e3 eventloop: K_EVENT should not finish operator
normal_finish_command() and normal_prepare() assume that any pending
operator needs to be finished after any subsequent key.

Set `finish_op = false` in nv_event() to indicate that the pending
operator shouldn't be finished in normal_execute().

This is how nv_visual() indicates that 'v' or 'V' in operator-pending
mode should not finish the current pending operator.

fixes #5398
fixes #6166 (partially; mappings are still interrupted)
2017-09-04 08:20:04 +02:00
fec6ca7511 Merge pull request #7233 from yjhan96/vim-8.0.0125
vim-patch:8.0.0125
2017-09-03 12:58:41 -04:00
69a201d6c5 vim-patch:8.0.0125
Problem:    Not enough testing for entering Ex commands.
Solution:   Add test for CTRL-\ e {expr}. (Dominique Pelle)

eaaa9bbda6
2017-09-03 09:26:46 -04:00
11429f9429 vim-patch:8.0.0247 (#7232)
Problem:    Under some circumstances, one needs to type Ctrl-N or Ctrl-P twice
            to have a menu entry selected. (Lifepillar)
Solution:   call ins_compl_free(). (Christian Brabandt, closes vim/vim#1411)

aed6d0b81a
2017-09-03 10:58:32 +02:00
70c62d58d5 Merge remote-tracking branch 'upstream/master' 2017-09-01 07:33:29 +08:00
7bfa4406c1 Merge pull request #7227 from ckelsel/vim-8.0.0209
vim-patch:8.0.0209
2017-08-30 10:34:42 -04:00
0e13b15fde vim-patch:8.0.0209
Problem:    When using :substitute with the "c" flag and 'cursorbind' is set
            the cursor is not updated in other windows.
Solution:   Call do_check_cursorbind(). (Masanori Misono)

41baa7983a
2017-08-30 19:59:18 +08:00
9ae353ab44 Merge remote-tracking branch 'upstream/master' 2017-08-30 19:44:19 +08:00
5566f30006 Merge pull request #7218 from jamessan/stderr_collector-fix
provider: Remove dict attribute from stderr_collector
2017-08-26 15:06:48 -04:00
ffdddcd93d provider: Remove dict attribute from stderr_collector
If an autoloaded function hasn't been resolved before it is used in
function(), the self dict will not be created which causes E725 when
calling the function.  Since self isn't being used in
provider#stderr_collector, we can remove the dict attribute to
workaround the self dict bug[0].

Closes #7115

[0]: https://groups.google.com/d/msg/vim_dev/I7AXOyv-P4o/DzbyOxDHBgAJ
2017-08-26 13:49:39 -04:00
f612e99db5 ci: XXX: permissive termclose_spec timer (#7217)
We probably need to revisit the process_stop() logic.
In the meantime this hack avoids CI noise.
2017-08-26 17:18:46 +02:00
e1628fab00 tui: support new iterm2, iTerm2.app terminfo entries
iTerm2 got its own entry in Thomas Dickey's terminfo.src on 2017-08-16.
Make sure that the new entry is handled in the same way as the old entry.

closes #7209
closes #7214
2017-08-26 17:11:56 +02:00
6e7a8c3fe2 Merge #7081 from justinmk/rpcstop
rpc: close channel if stream was closed
2017-08-26 16:41:35 +02:00
46a4099dfb Merge pull request #7192 from llorens/vim-8.0.0092
vim-patch:8.0.0092
2017-08-25 11:21:36 -04:00
0f2873ce99 Merge #7205 from justinmk/win-wmain 2017-08-24 09:31:08 +02:00
da84f7dcf9 tui: always use unibi_add_ext_str with unibi_get_ext_str #7204
When using an index returned by unibi_add_ext_str() we should
always use unibi_get_ext_str() and not rely on the index being
lower than unibi_string_begin_.

Closes #7206
2017-08-24 09:22:21 +02:00
02e5eafa86 win: expect utf8-encoded argv when built as a library 2017-08-24 08:42:45 +02:00
71df5dde6d win: wmain(): use utf16_to_utf8() #7060 2017-08-24 08:42:45 +02:00
e5565891af win: wmain(): locale-independent argv (#7180)
fix #7060
2017-08-23 00:55:00 +02:00
85f3084e21 clipboard: disallow recursion; show hint only once (#7203)
- Show hint only once per session.
- provider#clipboard#Call(): prevent recursion
- provider#clear_stderr(): use has_key(), because :silent! is still
  captured by :redir.

closes #7184
2017-08-22 20:31:54 +02:00
7f7698649f Merge #6973 from teto/normal_hl 2017-08-22 20:01:50 +02:00
1d175f3448 Merge pull request #7201 from jamessan/vim-8.0.0308
vim-patch:8.0.0308,8.0.0325,8.0.0326,8.0.0437,8.0.0612,8.0.0680
2017-08-22 09:53:02 -04:00
5f6ad863c6 syntax.c: style
Converts some documentation to doxygen format + minor styling
improvements.
2017-08-22 12:37:59 +02:00
4d91369fd7 syntax.c: register 'Normal' highlight group
- :hi Normal works with -u NONE
- Makes HL_TABLE and ATTR_ENTYRY a function instead of a macro so that in can be used in gdb.
- Introduces ATTRENTRY_INIT to init attrentry_t
2017-08-22 12:37:59 +02:00
41d180abb4 vim-patch:8.0.0680
Problem:    Plugins in start packages are sourced twice. (mseplowitz)
Solution:   Use the unmodified runtime path when loading plugins (test by Ingo
            Karkat, closes vim/vim#1801)

07ecfa64a1
2017-08-21 20:29:49 -04:00
622c3454df vim-patch:8.0.0612
Problem:    Package directories are added to 'runtimepath' only after loading
            non-package plugins.
Solution:   Split off the code to add package directories to 'runtimepath'.
            (Ingo Karkat, closes vim/vim#1680)

ce876aaa9a
2017-08-21 20:29:49 -04:00
fc7bf1c71d vim-patch:8.0.0437
Problem:    The packadd test does not create the symlink correctly and does
            not test the right thing.
Solution:   Create the directory and symlink correctly.

644df41c44
2017-08-21 20:29:49 -04:00
651c6f9b6e vim-patch:8.0.0326
Problem:    Packadd test uses wrong directory name.
Solution:   Use the variable name value. (Hirohito Higashi)

24f8f543d4
2017-08-21 20:29:49 -04:00
24a5564196 vim-patch:8.0.0325
Problem:    Packadd test does not clean up symlink.
Solution:   Delete the link. (Hirohito Higashi)

913727e567
2017-08-21 20:29:48 -04:00
a66eca78c2 vim-patch:8.0.0308
Problem:    When using a symbolic link, the package path will not be inserted
            at the right position in 'runtimepath'. (Dugan Chen, Norio Takagi)
Solution:   Resolve symbolic links when finding the right position in
            'runtimepath'. (Hirohito Higashi)

2f9e575583
2017-08-21 20:29:48 -04:00
9ff0cc7085 Merge pull request #6808 from nelstrom/normal-mode-terminal
Make :terminal remain in normal mode when created
2017-08-21 19:46:43 -04:00
d2595ba1c4 vim-patch:8.0.0092
Problem:    C indenting does not support nested namespaces that C++ 17 has.
Solution:   Add check that passes double colon inside a name. (Pauli, closes
            vim/vim#1214)

ca8b8d6956
2017-08-21 23:00:51 +02:00
73286a81cf Repair tui_spec functional tests 2017-08-21 20:44:03 +01:00
ac52947838 Repair job_spec functional tests 2017-08-21 20:44:03 +01:00
642e14d9e7 Repair ex_terminal_spec functional tests 2017-08-21 20:44:03 +01:00
5a214a9ed0 Update documentation 2017-08-21 20:44:03 +01:00
7d183e89f7 Use Normal mode as default when opening a new terminal 2017-08-21 20:44:03 +01:00
0b6fa3a553 Merge remote-tracking branch 'upstream/master' 2017-08-21 09:19:08 +08:00
0f442c328e channel.c:call_set_error(): fix memory leak 2017-08-21 01:04:28 +02:00
af993da435 rpc: close channel if stream was closed
f_jobstop()/f_rpcstop() .. process_stop() .. process_close_in(proc)
closes the write-stream of a RPC channel. But there might be
a pending RPC notification on the queue, which may get processed just
before the channel is closed.

To handle that case, check the Stream.closed in
channel.c:receive_msgpack().

Before this change, the above scenario could trigger
this assert(!stream->closed) in wstream_write():

    0x00007f96e1cd3428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
    0x00007f96e1cd502a in __GI_abort () at abort.c:89
    0x00007f96e1ccbbd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x768f9b "!stream->closed",
    file=file@entry=0x768f70 "../src/nvim/event/wstream.c", line=line@entry=77,
    function=function@entry=0x768fb0 <__PRETTY_FUNCTION__.13735> "wstream_write") at assert.c:92
    0x00007f96e1ccbc82 in __GI___assert_fail (assertion=0x768f9b "!stream->closed", file=0x768f70 "../src/nvim/event/wstream.c", line=77,
    function=0x768fb0 <__PRETTY_FUNCTION__.13735> "wstream_write") at assert.c:101
    0x00000000004d2c1f in wstream_write (stream=0x7f96e0a35078, buffer=0x7f96e09f9b40) at ../src/nvim/event/wstream.c:77
    0x00000000005857b2 in channel_write (channel=0x7f96e0ae5800, buffer=0x7f96e09f9b40) at ../src/nvim/msgpack_rpc/channel.c:551
    0x000000000058567d in on_request_event (argv=0x7ffed792efa0) at ../src/nvim/msgpack_rpc/channel.c:523
    0x00000000005854c8 in handle_request (channel=0x7f96e0ae5800, request=0x7ffed792f1b8) at ../src/nvim/msgpack_rpc/channel.c:503
    0x00000000005850cb in parse_msgpack (channel=0x7f96e0ae5800) at ../src/nvim/msgpack_rpc/channel.c:423
    0x0000000000584f90 in receive_msgpack (stream=0x7f96e0a35218, rbuf=0x7f96e0d1d4c0, c=22, data=0x7f96e0ae5800, eof=false)
    at ../src/nvim/msgpack_rpc/channel.c:389
    0x00000000004d0b20 in read_event (argv=0x7ffed792f4a8) at ../src/nvim/event/rstream.c:190
    0x00000000004ce462 in multiqueue_process_events (this=0x7f96e18172d0) at ../src/nvim/event/multiqueue.c:150
    0x000000000059b630 in nv_event (cap=0x7ffed792f620) at ../src/nvim/normal.c:7908
    0x000000000058be69 in normal_execute (state=0x7ffed792f580, key=-25341) at ../src/nvim/normal.c:1137
    0x0000000000652463 in state_enter (s=0x7ffed792f580) at ../src/nvim/state.c:61
    0x000000000058a1fe in normal_enter (cmdwin=false, noexmode=false) at ../src/nvim/normal.c:467
    0x00000000005500c2 in main (argc=2, argv=0x7ffed792f8d8) at ../src/nvim/main.c:554

Alternative approach suggested by bfredl is to use close_cb of the
process. My unsuccessful attempt is below. (It seems close_cb is queued
too late, which is the similar problem addressed by this commit):

    commit 75fc12c6ab15711bdb7b18c6d42ec9d157f5145e
    Author: Justin M. Keyes <justinkz@gmail.com>
    Date:   Fri Aug 18 01:30:41 2017 +0200

        rpc: use Stream's close_cb instead of explicit check in receive_msgpack()

    diff --git a/src/nvim/event/process.c b/src/nvim/event/process.c
    index 8371d3cd482e..e52da23cdc40 100644
    --- a/src/nvim/event/process.c
    +++ b/src/nvim/event/process.c
    @@ -416,6 +416,10 @@ static void on_process_exit(Process *proc)
     static void on_process_stream_close(Stream *stream, void *data)
     {
       Process *proc = data;
    +  ILOG("on_process_stream_close");
    +  if (proc->stream_close_cb != NULL) {
    +    proc->stream_close_cb(stream, proc->stream_close_data);
    +  }
       decref(proc);
     }

    diff --git a/src/nvim/event/process.h b/src/nvim/event/process.h
    index 5c00e8e7ecd5..34a8d54f6f8c 100644
    --- a/src/nvim/event/process.h
    +++ b/src/nvim/event/process.h
    @@ -26,6 +26,11 @@ struct process {
       Stream *in, *out, *err;
       process_exit_cb cb;
       internal_process_cb internal_exit_cb, internal_close_cb;
    +
    +  // Called when any of the process streams (in/out/err) closes.
    +  stream_close_cb stream_close_cb;
    +  void *stream_close_data;
    +
       bool closed, detach;
       MultiQueue *events;
     };
    @@ -50,6 +55,8 @@ static inline Process process_init(Loop *loop, ProcessType type, void *data)
         .closed = false,
         .internal_close_cb = NULL,
         .internal_exit_cb = NULL,
    +    .stream_close_cb = NULL,
    +    .stream_close_data = NULL,
         .detach = false
       };
     }
    diff --git a/src/nvim/event/stream.c b/src/nvim/event/stream.c
    index 7c865bfe1e8c..c8720d1e45d9 100644
    --- a/src/nvim/event/stream.c
    +++ b/src/nvim/event/stream.c
    @@ -95,7 +95,11 @@ void stream_close(Stream *stream, stream_close_cb on_stream_close, void *data)
     void stream_close_handle(Stream *stream)
       FUNC_ATTR_NONNULL_ALL
     {
    +  ILOG("stream=%d", stream);
    +  // LOG_CALLSTACK();
       if (stream->uvstream) {
    +    // problem:  this schedules on the queue, but channel.c:receive_msgpack may
    +    // be processed before close_cb is called by libuv.
         uv_close((uv_handle_t *)stream->uvstream, close_cb);
       } else {
         uv_close((uv_handle_t *)&stream->uv.idle, close_cb);
    @@ -105,6 +109,7 @@ void stream_close_handle(Stream *stream)
     static void close_cb(uv_handle_t *handle)
     {
       Stream *stream = handle->data;
    +  ILOG(">>>>>>>>>>>>>>>>>>>>>>> stream=%p stream->internal_close_cb=%p", stream, stream->internal_close_cb);
       if (stream->buffer) {
         rbuffer_free(stream->buffer);
       }
    diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c
    index 782eabe04e4a..dc2b794e366a 100644
    --- a/src/nvim/msgpack_rpc/channel.c
    +++ b/src/nvim/msgpack_rpc/channel.c
    @@ -128,6 +128,8 @@ uint64_t channel_from_process(Process *proc, uint64_t id, char *source)
                                           source);
       incref(channel);  // process channels are only closed by the exit_cb
       channel->data.proc = proc;
    +  channel->data.proc->stream_close_cb = close_cb2;
    +  channel->data.proc->stream_close_data = channel;

       wstream_init(proc->in, 0);
       rstream_init(proc->out, 0);
    @@ -387,17 +389,6 @@ static void receive_msgpack(Stream *stream, RBuffer *rbuf, size_t c,
         goto end;
       }

    -  if ((chan_wstream(channel) != NULL && chan_wstream(channel)->closed)
    -      || (chan_rstream(channel) != NULL && chan_rstream(channel)->closed)) {
    -    char buf[256];
    -    snprintf(buf, sizeof(buf),
    -             "ch %" PRIu64 ": stream closed unexpectedly. "
    -             "closing channel",
    -             channel->id);
    -    call_set_error(channel, buf, WARN_LOG_LEVEL);
    -    goto end;
    -  }
    -
       size_t count = rbuffer_size(rbuf);
       DLOG("ch %" PRIu64 ": parsing %u bytes from msgpack Stream: %p",
            channel->id, count, stream);
    @@ -571,23 +562,6 @@ static Stream *chan_wstream(Channel *chan)
       abort();
     }

    -/// Returns the Stream that a Channel reads from.
    -static Stream *chan_rstream(Channel *chan)
    -{
    -  switch (chan->type) {
    -    case kChannelTypeSocket:
    -      return &chan->data.stream;
    -    case kChannelTypeProc:
    -      return chan->data.proc->out;
    -    case kChannelTypeStdio:
    -      return &chan->data.std.in;
    -    case kChannelTypeInternal:
    -      return NULL;
    -  }
    -  abort();
    -}
    -
    -
     static bool channel_write(Channel *channel, WBuffer *buffer)
     {
       bool success = false;
    @@ -799,6 +773,12 @@ static void close_cb(Stream *stream, void *data)
       decref(data);
     }

    +static void close_cb2(Stream *stream, void *data)
    +{
    +  ILOG("close_cb2");
    +  close_channel(data);
    +}
    +
     /// @param source description of source function, rplugin name, TCP addr, etc
     static Channel *register_channel(ChannelType type, uint64_t id,
                                      MultiQueue *events, char *source)
2017-08-21 01:04:28 +02:00
e006b1d98d log: some DEBUG-level stream logging 2017-08-21 01:04:28 +02:00
8d1ccb606d Merge #7193 from justinmk/cb-pathology 2017-08-21 00:46:45 +02:00
88165a798e clipboard: test g:clipboard validation, fix a bug
Also fix `:help foo` highlighting in health.vim
2017-08-20 22:17:03 +02:00
cc7e344f83 clipboard: remove start_batch_changes() in redir_write()
start_batch_changes() doesn't avoid invoking the clipboard
once-per-line, because the loop is actually in ex_echo(), which calls
redir_write() for each message. But we've already entered
start_batch_changes() by then, so that was never the problem.

    redir_write at /home/vagrant/old.neovim/build/../src/nvim/message.c:2523
    msg_puts_attr_len at /home/vagrant/old.neovim/build/../src/nvim/message.c:1600
    msg_outtrans_len_attr at /home/vagrant/old.neovim/build/../src/nvim/message.c:1221
    ex_echo at /home/vagrant/old.neovim/build/../src/nvim/eval.c:19433
    do_one_cmd at /home/vagrant/old.neovim/build/../src/nvim/ex_docmd.c:2242

Trying to defer _explicit_ clipboard updates is difficult.
    :redir @+ | silent echo system('cat foo') | redir END
is essentially equivalent to:
    for l in readfile('foo')
        let @+ .= l
    endfor
We cannot make judgements about when to ignore a script's bad decisions.
start_batch_changes() only works around the case of clipboard=unnamed,
i.e. _implicit_ clipboard updates (`:g/foo/d`).  Not explicit
assignment.
2017-08-20 20:01:22 +02:00
9882e25dc4 clipboard: avoid error flood during :redir
redir_write():
- This is a "batch" operation which was not yet covered by
  start_batch_changes()

adjust_clipboard_name():
- msg() and friends during :redir will, of course, cause redir_write()
  to try to capture that message, which causes recursion.
- EMSG() here is trouble: if it interrupts :redir it is a mess.
  Rather than deal with the mess, show a non-error message.

closes #7182
closes #7184
closes #7183
ref #6048
ref #7032
2017-08-20 19:49:42 +02:00
b3da396804 Merge #7171 from justinmk/doc 2017-08-19 13:15:12 +02:00
b13070ec01 doc/api: nvim_out_write() and friends
References #7178
2017-08-18 21:43:57 +02:00
af046a3a81 version: tweak layout, doc 2017-08-18 21:43:57 +02:00
6ca6a8134d intro: remove byline #6984 2017-08-18 21:29:01 +02:00
b2967a0320 nvim -h: omit special-case options
Group some options, and sort them alphabetically.
`nvim -h` should fit on one (smallish) screen.
Uncommon options don't need to be here, they live in the :help.
2017-08-18 21:29:01 +02:00
d7bc55c72d doc 2017-08-18 21:29:01 +02:00
f465bf0cfa Merge pull request #7185 from jamessan/fix-provider-clear_stderr
provider#clear_stderr: Use remove() not delete() to update s:stderr
2017-08-18 13:56:53 -04:00
3acbb490de provider#clear_stderr: Use remove() not delete() to update s:stderr
Ref #7184
2017-08-18 12:32:49 -04:00
673fc74823 Merge remote-tracking branch 'upstream/master' 2017-08-17 08:20:48 +08:00
5b32bce73c Merge #7007 'Windows :terminal'
References #6383
Closes #4748
2017-08-16 21:35:51 +02:00
cea1248f7d Merge pull request #7052 from ckelsel/vim-8.0.0044
vim-patch:8.0.0044
2017-08-16 15:35:22 -04:00
6844ff7561 Merge pull request #7145 from ckelsel/vim-8.0.0174
vim-patch:8.0.0174
2017-08-16 15:16:19 -04:00
370602a8f5 Merge pull request #6928 from justinmk/vim-patch-8.0.0678
vim-patch:8.0.0678 closing a window does not trigger resizing
2017-08-16 14:49:09 -04:00
8dddf55907 vim-patch:8.0.0044
Problem:    In diff mode the cursor may end up below the last line, resulting
            in an ml_get error.
Solution:   Check the line to be valid.

025e3e0baf
2017-08-16 12:48:58 -04:00
8e2096c3df Merge pull request #7174 from jamessan/appveyor-allow-cov-failure
ci: Ignore MINGW_64-gcov failures in overall ci status
2017-08-16 12:43:11 -04:00
1fb3339844 vim-patch:8.0.0679
Problem:    Using freed memory.
Solution:   Get the parent frame pointer earlier.

41cc038ff8
2017-08-16 12:22:41 -04:00
9a9d9a187f ci: Ignore MINGW_64-gcov failures in overall ci status 2017-08-16 11:24:12 -04:00
f0a9b7ff63 vim-patch:8.0.0678 closing a window does not trigger resizing
Closes #6748

Problem:    When 'equalalways' is set and closing a window in a separate
            frame, not all window sizes are adjusted. (Glacambre)
Solution:   Resize all windows if the new current window is not in the same
            frame as the closed window. (closes vim/vim#1707)

8eeeba8c02
2017-08-16 10:39:50 -04:00
9a6eb71eba test/win: give up on this one 2017-08-16 09:13:45 +02:00
dbb404542b test/win: place cursor at edge to tickle SIGWINCH 2017-08-16 09:13:44 +02:00
91c85a6378 test: tty-test.c: keep tty_out handle around
Now the window_split_tab_spec.lua test seems to work.
Also do some cleanup.
2017-08-16 09:13:44 +02:00
d2d76882f7 win/test: enable more :terminal tests
To deal with SIGWINCH limitations on Windows, change some resize tests
to _shrink_ the screen width. ... But this didn't work, so still
ignoring those tests on Windows.
2017-08-16 09:13:44 +02:00
e0763e94ad test: tty-test.c: restore win32 SIGWINCH handler 2017-08-16 09:13:44 +02:00
6a90f53862 test: cleanup 2017-08-16 09:13:44 +02:00
8642f05fd9 single-includes: ignore os/pty_process_win.h 2017-08-16 09:13:44 +02:00
8c1782b840 pty_process_win: avoid quoting for cmd.exe 2017-08-16 09:13:44 +02:00
d3a8c4f992 win/pty: log errors 2017-08-16 09:13:44 +02:00
84fb794da6 win/pyt: cleanup 2017-08-16 09:13:44 +02:00
1614e805b3 win/test: tty-test: print screen size explicitly with CTRL-Q
tty-test.exe causes abnormal termination with low repeatability, try
changing it so as not to use SIGWINCH.
2017-08-16 09:13:44 +02:00
3b992f1688 win/pty: quote_cmd_arg(): check bounds 2017-08-16 09:13:43 +02:00
e635754e8e win/pty: jobstart, jobstop: fix null-pointer dereference
- Make sure that proc->in is not NULL, because nvim crashed when
  starting a job with pty.
- Make sure that proc->out is not NULL, because nvim crashed when stopping
  a job opened with pty.
2017-08-16 09:13:43 +02:00
4b1f21de75 win: support :terminal 2017-08-16 09:13:43 +02:00
a797856755 win/install: winpty-agent.exe 2017-08-16 09:13:43 +02:00
7f22a27a10 win: integrate winpty (WIP)
Handling of process exit is still broken.  It detects the moment when the
child process exits, then quickly stops polling for process output.  It
should continue polling for output until the agent has scraped all of the
process' output.  This problem is easy to notice by running a command like
"dir && exit", but even typing "exit<ENTER>" can manifest the problem --
the "t" might not appear.

winpty's Cygwin adapter handles shutdown by waiting for the agent to close
the CONOUT pipe, which it does after it has scraped the child's last
output.  AFAIK, neovim doesn't do anything interesting when winpty closes
the CONOUT pipe.
2017-08-16 09:13:43 +02:00
30cb66e8ba Merge pull request #7168 from teto/fix_coverty
Closes #7149
2017-08-15 19:55:24 -04:00
ZyX
dd1943a3a7 doc: Describe everything what is in vim lua “module”
[ci skip]
2017-08-16 02:39:15 +03:00
bb70eec177 Merge #6364 'command-line color hook' 2017-08-16 00:20:37 +02:00
1f4090011e coverty: solve  #7149 2017-08-15 21:43:23 +02:00
ab72063a52 Merge pull request #7167 from jamessan/codecov
ci: Rename .codecov.yml → codecov.yml
2017-08-15 13:35:11 -04:00
ca4b3f3fda ci: Rename .codecov.yml → codecov.yml
According to codecov/support#431 the comment setting isn't honored when
the yaml file is named .codecov.yml.
2017-08-15 12:03:45 -04:00
ZyX
b1a8dcefee lua/executor: Fix crash when first string contains NUL and second not 2017-08-15 17:18:05 +03:00
ZyX
93ef823f5e lua/executor: Move stricmp to vim “module” and document it 2017-08-15 16:34:51 +03:00
ZyX
96b1600bc8 functests: Add test for stricmp 2017-08-15 16:34:25 +03:00
ZyX
ef6641ba69 lua/executor: Make stricmp function work with strings with NULs 2017-08-15 16:34:25 +03:00
44dc8bbb13 ci/win: list build permutations explicitly (#7163)
This avoids changing the matrix permutations for the old non-gcov
builds, so that old URLs continue to work:

https://ci.appveyor.com/api/projects/neovim/neovim/artifacts/build/Neovim.zip?branch=master&job=Configuration%3A%20MINGW_32
https://ci.appveyor.com/api/projects/neovim/neovim/artifacts/build/Neovim.zip?branch=master&job=Configuration%3A%20MINGW_64
2017-08-15 11:06:51 +02:00
bdc72c7c44 Merge pull request #7161 from jamessan/codecov
ci: Upload coverage data to codecov.io

Closes #7162
2017-08-14 11:03:26 -04:00
a8ae8ae770 ci: Ignore QB for codecov's CI status 2017-08-14 09:21:44 -04:00
e88fc35429 ci: Collect coverage data for MINGW_64 builds on appveyor 2017-08-14 09:15:59 -04:00
e463cb6fa0 ci: Switch to codecov.io for coverage data
Continue uploading to coveralls, for now, so we can compare the
services.
2017-08-14 09:15:54 -04:00
c349083155 Merge #6259 from justinmk/ui_refresh 2017-08-14 11:10:44 +02:00
f5938d9bcf doc: screen_resize(): remove mention of "mustset"
"mustset" is from Vim term.c:set_shellsize(), not relevant here: we
behave as if mustset=true always.
2017-08-14 03:09:40 +02:00
34e5654f21 ui: disable 'lazyredraw' during ui_refresh.
Could also try `do_redraw = true` instead of save/restore `p_lz`, but
the nice thing about save/restore of `p_lz` is that it is "atomic".
The semantics of `do_redraw` are not clear to me.

Closes #4884
References #6202
References https://github.com/neovim/neovim/pull/6202#issuecomment-284379503
References #3929 #5692 #6157
References #5866
2017-08-14 03:07:50 +02:00
5d332084e1 Merge remote-tracking branch 'upstream/master' into HEAD 2017-08-14 07:45:59 +08:00
c4e214a99c io: more guards against NULL filename (#7159)
References ac055d677a
References #4370
2017-08-14 07:45:50 +08:00
d0cb175cab lua/executor: Fix crash when printing empty string (#7157) 2017-08-14 07:45:50 +08:00
e6c528d9fc travis: Move TSAN to last stage and allow failure
TSAN build has been much less reliable lately, so it shouldn't hold up
the other tests.
2017-08-14 07:45:50 +08:00
809420233c tui: fix DECSCUSR logic #6997
Fix linuxvt cursor shape codes
Fix konsole cursor_shapes (even when inside tmux)
Do not trust old VTE terminal lies

Closes #6978
Closes #7002
Closes #7049
2017-08-14 07:45:50 +08:00
cd5f9d638e vim-patch:8.0.0235
Problem:    Memory leak detected when running tests for diff mode.
Solution:   Free p_extra_free.

b031c4ea04
2017-08-14 07:45:49 +08:00
e214cc2cdc oldtest: cannot :set term in Nvim 2017-08-14 07:45:49 +08:00
5ed2ab6d53 vim-patch:8.0.0524
Problem:    Folds are messed up when 'encodin' is "utf-8".
Solution:   Also set the fold character when it's not multi-byte.

8da1e6cedf
2017-08-14 07:45:49 +08:00
9b4cbd5cdc vim-patch:8.0.0518
Closes #7086

Problem:    Storing a zero byte from a multi-byte character causes fold text
            to show up wrong.
Solution:   Avoid putting zero in ScreenLines. (Christian Brabandt,
            closes vim/vim#1567)

c6cd8409c2
2017-08-14 07:45:49 +08:00
a7b98246b3 vim-patch:8.0.0290 vim-patch:8.0.0394
vim-patch:8.0.0290: cursor positioning wrong if wide character wraps
Problem:    If a wide character doesn't fit at the end of the screen line, and
            the line doesn't fit on the screen, then the cursor position may
            be wrong. (anliting)
Solution:   Don't skip over wide character. (Christian Brabandt, closes vim/1408)

vim-patch:8.0.0394
Problem:    Tabs are not aligned when scrolling horizontally and a Tab doesn't
            fit. (Axel Bender)
Solution:   Handle a Tab as a not fitting character. (Christian Brabandt)
            Also fix that ":redraw" does not scroll horizontally to show the
            cursor.  And fix the test that depended on the old behavior.

abc39ab642
2017-08-14 07:45:49 +08:00
f5e55e93aa vim-patch:8.0.0311
Problem:    Linebreak tests are old style.
Solution:   Turn the tests into new style. Share utility functions. (Ozaki
            Kiichi, closes vim/vim#1444)

544d3bc9f0
2017-08-14 07:45:49 +08:00
247c338517 vim-patch:8.0.0128
Problem:    Display test fails on MS-Windows.
Solution:   Set 'isprint' to "@".

7089237885
2017-08-14 07:45:49 +08:00
dfd45f26f1 vim-patch:8.0.0126
Problem:    Display problem with 'foldcolumn' and a wide character.
            (esiegerman)
Solution:   Don't use "extra" but an allocated buffer. (Christian Brabandt,
            closes vim/vim#1310)

6270660611
2017-08-14 07:45:49 +08:00
5e66c429e3 vim-patch:8.0.0090 fix breakindent bug
(original Vim commit-message is bogus)

6c896867c4
2017-08-14 07:45:49 +08:00
ZyX
19a28352a9 ex_getln: Make error messages look better 2017-08-14 01:56:48 +03:00
ZyX
5c60cd2abb doc: State that it is called for new *displayed* input 2017-08-14 01:40:21 +03:00
ZyX
0571b8cb0e functests: Alter comment 2017-08-14 01:22:10 +03:00
ZyX
f1ef94b871 doc: Clarify how function is executed 2017-08-14 01:20:52 +03:00
ZyX
a5449f79ac functests: Check that input is correctly silenced 2017-08-14 01:17:16 +03:00
d258ac8ed2 io: more guards against NULL filename (#7159)
References ac055d677a
References #4370
2017-08-13 18:46:09 +02:00
3c8d063786 Merge pull request #7158 from jamessan/move-tsan-stage
travis: Move TSAN to last stage and allow failure
2017-08-13 12:05:34 -04:00
bf1b1ea6ee lua/executor: Fix crash when printing empty string (#7157) 2017-08-13 17:37:35 +02:00
a2947a46a1 travis: Move TSAN to last stage and allow failure
TSAN build has been much less reliable lately, so it shouldn't hold up
the other tests.
2017-08-13 10:01:39 -04:00
1f9c139fd3 tui: fix DECSCUSR logic #6997
Fix linuxvt cursor shape codes
Fix konsole cursor_shapes (even when inside tmux)
Do not trust old VTE terminal lies

Closes #6978
Closes #7002
Closes #7049
2017-08-13 01:13:28 +02:00
d42547f322 Merge #7088 from justinmk/vimpatches 2017-08-12 21:44:12 +02:00
c87dbadc44 vim-patch:8.0.0235
Problem:    Memory leak detected when running tests for diff mode.
Solution:   Free p_extra_free.

b031c4ea04
2017-08-12 18:28:38 +02:00
7dc5e8fb8b oldtest: cannot :set term in Nvim 2017-08-12 17:39:07 +02:00
a0c7e35eee vim-patch:8.0.0524
Problem:    Folds are messed up when 'encodin' is "utf-8".
Solution:   Also set the fold character when it's not multi-byte.

8da1e6cedf
2017-08-12 17:39:07 +02:00
cddd4e613e vim-patch:8.0.0518
Closes #7086

Problem:    Storing a zero byte from a multi-byte character causes fold text
            to show up wrong.
Solution:   Avoid putting zero in ScreenLines. (Christian Brabandt,
            closes vim/vim#1567)

c6cd8409c2
2017-08-12 17:39:07 +02:00
49b671f8f1 vim-patch:8.0.0290 vim-patch:8.0.0394
vim-patch:8.0.0290: cursor positioning wrong if wide character wraps
Problem:    If a wide character doesn't fit at the end of the screen line, and
            the line doesn't fit on the screen, then the cursor position may
            be wrong. (anliting)
Solution:   Don't skip over wide character. (Christian Brabandt, closes vim/1408)

vim-patch:8.0.0394
Problem:    Tabs are not aligned when scrolling horizontally and a Tab doesn't
            fit. (Axel Bender)
Solution:   Handle a Tab as a not fitting character. (Christian Brabandt)
            Also fix that ":redraw" does not scroll horizontally to show the
            cursor.  And fix the test that depended on the old behavior.

abc39ab642
2017-08-12 17:39:07 +02:00
c747b53f84 vim-patch:8.0.0311
Problem:    Linebreak tests are old style.
Solution:   Turn the tests into new style. Share utility functions. (Ozaki
            Kiichi, closes vim/vim#1444)

544d3bc9f0
2017-08-12 17:39:06 +02:00
b7320471de vim-patch:8.0.0128
Problem:    Display test fails on MS-Windows.
Solution:   Set 'isprint' to "@".

7089237885
2017-08-12 17:39:06 +02:00
1bcb3ed0e2 vim-patch:8.0.0126
Problem:    Display problem with 'foldcolumn' and a wide character.
            (esiegerman)
Solution:   Don't use "extra" but an allocated buffer. (Christian Brabandt,
            closes vim/vim#1310)

6270660611
2017-08-12 17:39:06 +02:00
df02f9cc37 vim-patch:8.0.0090 fix breakindent bug
(original Vim commit-message is bogus)

6c896867c4
2017-08-12 17:39:06 +02:00
d59e9a2c25 Merge remote-tracking branch 'upstream/master' 2017-08-12 08:28:10 +08:00
f2fd5afb48 Merge pull request #7150 from jamessan/cid-166184
coverity/166184: Check length of str, not term
2017-08-11 12:24:45 -04:00
9edf00bddf coverity/166184: Check length of str, not term
32396b5879 add length checks to
TERMINAL_FAMILY/STARTS_WITH to ensure memcmp() wouldn't read past the
end of the string.  However, "term" was copy/pasted from TERMINAL_FAMILY
so STARTS_WITH() was unnecessarily reading the, potentially NULL, term
variable.
2017-08-11 10:30:38 -04:00
320b57311f Merge pull request #7143 from jamessan/log_callstack_to_file
log: Add log_callstack_to_file()
2017-08-11 10:02:51 -04:00
b7e84de7d2 vim-patch:8.0.0165 (#7132)
Problem:    Ubsan warns for integer overflow.
Solution:   Swap two conditions. (Dominique Pelle)

f446b48ff0
2017-08-10 04:20:55 +02:00
de1084f3c4 Merge #7140 'os_stat: return ENOENT on NULL fname' 2017-08-10 03:59:43 +02:00
7ae744b93d buf_write(): handle NULL fname on non-unix 2017-08-10 03:43:38 +02:00
4cd2749b10 vim-patch:8.0.0174
Problem:    For completion "locale -a" is executed on MS-Windows, even though
            it most likely won't work.
Solution:   Skip executing "locale -a" on MS-Windows. (Ken Takata)

b8f7bd68f6
2017-08-10 08:53:22 +08:00
9a5d309b57 Merge remote-tracking branch 'upstream/master' 2017-08-10 08:31:50 +08:00
ac055d677a os_stat: return ENOENT on NULL filename arg
Closes #4370

Explication:

    In the backtrace in #4370, we see that `buf_write()` was called with
    non-NULL `fname` and `sfname` arguments, but they've since _become_
    NULL.

    #7  0x00000000004de09d in buf_write (buf=0x1dee040, fname=0x0, fname@entry=0x1e985b0 "/home/sean/src/github.com/snczl/virta/pkg/meld/segment.go",
                                         sfname=0x0, sfname@entry=0x1ddfa60 "segment.go", start=1, end=72, eap=eap@entry=0x7ffc6b032e60, append=0,
                                         forceit=0, reset_changed=1, filtering=0)
    at /home/travis/build/neovim/bot-ci/build/neovim/src/nvim/fileio.c:2576

    This is most likely due to the code that restores those values from
    `buf`, which happens just before the fatal call to `os_fileinfo`

    ```c
        /*
         * The autocommands may have changed the name of the buffer, which may
         * be kept in fname, ffname and sfname.
         */
        if (buf_ffname)
          ffname = buf->b_ffname;
        if (buf_sfname)
          sfname = buf->b_sfname;
        if (buf_fname_f)
          fname = buf->b_ffname;
        if (buf_fname_s)
          fname = buf->b_sfname;
    ```

    It's worth noting that at this point `ffname` is still non-NULL, so
    it _could_ be used.  However, our current code is purely more strict
    than Vim in this area, which has caused us problems before (e.g.,
    `getdigits()`).  The commentary for `struct file_buffer` clearly
    indicate that all of `b_ffname`, `b_sfname`, and `b_fname` may be
    NULL:

    ```c
      /*
       * b_ffname has the full path of the file (NULL for no name).
       * b_sfname is the name as the user typed it (or NULL).
       * b_fname is the same as b_sfname, unless ":cd" has been done,
       *		then it is the same as b_ffname (NULL for no name).
       */
      char_u      *b_ffname;        /* full path file name */
      char_u      *b_sfname;        /* short file name */
      char_u      *b_fname;         /* current file name */
    ```

    Vim directly calls `stat(2)` which, although it is annotated to tell
    the compiler that the path argument is non-NULL, does handle a NULL
    pointer by returning a `-1` value and setting `errno` to `EFAULT`.
    This satisfies Vim's check, since it treats any `-1` return from
    `stat(2)` to mean the file doesn't exist (at least in this code
    path).

    Note that Vim's mch_stat() implementations on win32 and solaris
    clearly cannot accept NULL `name`. But the codepaths that call
    mch_stat will NULL `name` tend to be unix-only (eg: u_read_undo)!
2017-08-10 00:56:07 +02:00
085102fadf Merge #7134 from justinmk/oldtest-tmpdir 2017-08-09 23:36:48 +02:00
dac216cf8e Merge pull request #7135 from justinmk/buf_write
buf_write(): wrong argument to os_fileinfo_hardlinks()
2017-08-09 16:40:12 -04:00
17eb20b22e log: Add log_callstack_to_file()
This makes it trivial to log the callstack to, e.g., stderr, which can
simplify debug cycles.
2017-08-09 13:30:34 -04:00
f7e99fd8b0 oldtest: test_cmdline: Complete "Xtestf" so "Xtest-tmpdir" isn't matched 2017-08-09 11:02:35 -04:00
9854fc4657 oldtest: use TMPDIR 2017-08-09 11:02:15 -04:00
9506ee0370 buf_write(): wrong argument to os_fileinfo_hardlinks
This was broken in ye olde refactor from 2014:
e85fe0957d

References #4370
2017-08-09 10:45:17 +02:00
e13b4a21ca vim-patch:8.0.0149 (#7127)
Problem:    ":earlier" and ":later" do not work after startup or reading the
            undo file.
Solution:   Use absolute time stamps instead of relative to the Vim start
            time. (Christian Brabandt, Pavel Juhas, closes vim/vim#1300, closes
            vim/vim#1254)

cbd4de44e8
2017-08-08 03:32:47 +02:00
8b4dc955b7 Merge remote-tracking branch 'upstream/master' 2017-08-07 07:51:03 +08:00
2753d61e4c vim-patch:8.0.0111 (#7090)
Problem:    The :history command is not tested.
Solution:   Add tests. (Dominique Pelle)

eebd84eb94
2017-08-06 23:42:52 +02:00
120d1b80c9 vim-patch:8.0.0147 #7121
Problem:    searchpair() does not work when 'magic' is off. (Chris Paul)
Solution:   Add \m in the pattern. (Christian Brabandt, closes vim/vim#1341)

6e450a5754
2017-08-06 23:25:49 +02:00
644fa6537c vim-patch:8.0.0143 (#7120)
Problem:    Line number of current buffer in getbufinfo() is wrong.
Solution:   For the current buffer use the current line number. (Ken Takata)

f845b87f2b
2017-08-06 23:04:50 +02:00
d1f0b5aa5d vim-patch:8.0.0137 (#7119)
Problem:    When 'maxfuncdepth' is set above 200 the nesting is limited to
            200. (Brett Stahlman)
Solution:   Allow for Ex command recursion depending on 'maxfuncdepth'.

777b30f827
2017-08-06 23:03:08 +02:00
36ceb9397c vim-patch:8.0.0086 (#7118)
Problem:    Cannot add a comment after ":hide". (Norio Takagi)
Solution:   Make it work, add a test. (Hirohito Higashi)

2256c99471
2017-08-06 23:00:19 +02:00
ZyX
474aa823dc Merge branch 'master' into colored-cmdline 2017-08-06 15:25:17 +03:00
ZyX
36acfce4ea api/helpers: Fix typo 2017-08-06 15:23:05 +03:00
ZyX
efb03903eb functests: Remove wait() from input_spec 2017-08-06 14:43:46 +03:00
ZyX
4d8ff5ec01 api/helpers: Clarify try_start() usage 2017-08-06 14:38:54 +03:00
5bec94652c Merge #7110 from justinmk/preserve-wildmenu 2017-08-06 04:25:55 +02:00
3827d5bc71 input: skip dialogs if no UI is active
Treat dialogs in the same way as "silent mode" (`nvim -es`).

References #1984
References #3901
2017-08-06 04:22:45 +02:00
d801ce70c1 win_defs.h: redefine RGB macro after undefining
Before this change, if os_defs.h was included after macros.h then
win_defs.h would undefine our own RGB macro.

vim-patch:8.0.0146
2017-08-06 02:51:49 +02:00
50c8f19d61 build: silence maybe-uninitialized warning
False positive. From C:\msys64\mingw64\bin\gcc.exe (appveyor CI)
2017-08-06 02:51:49 +02:00
30996359ef clint: allow starting brace after enum 2017-08-06 02:51:49 +02:00
efb0aca0ee test/helpers: disable powershell logo/banner message 2017-08-06 02:51:48 +02:00
a31482db4d terminal: block redraw during c_CTRL-D
Unlike the normal wildmenu, the CTRL-D wild-list is not restored by
statusline redraw. (Semantics: ^D is controlled by 'wildoptions' option,
so it's in the "wild..." family.)

TODO: externalize the c_CTRL-D wild-list.
2017-08-05 21:32:34 +02:00
c695443727 win_redr_status(): skip if wildmenu is showing
This might be too coarse, but it passes all tests ...

A more nuanced approach might be: only skip the windows whose
statuslines are overwritten by the wildmenu.

Closes #2255
Closes #7108

vim-patch:8.0.0710 N/A because of the changes in this commit.
2017-08-05 21:32:34 +02:00
c972efc9d1 Merge remote-tracking branch 'upstream/master' 2017-08-05 10:28:02 +08:00
55c0401dfd vim-patch:8.0.0134 (#7109)
Problem:    Null pointer access reported by UBsan.
Solution:   Check curwin->w_buffer is not NULL. (Yegappan Lakshmanan)

c4bfedabe0

src/nvim/ex_cmds.c have been merged by someone. while version.c remain unmerged.
2017-08-05 04:17:30 +02:00
0743684199 Merge remote-tracking branch 'upstream/master' 2017-08-05 09:56:31 +08:00
37dd5ded7c Merge #7111 from justinmk/unrevert
Unrevert 	vim-patch:8.0.0133
2017-08-05 00:17:59 +02:00
678e87b90a test/oldtest: avoid delete() on files used by a subprocess
This should avoid the hangs observed in the TSAN build on travis CI.

TODO: Find the root cause ...
2017-08-04 22:48:26 +02:00
92101947fe test: job_spec.lua: disable shada in test instance 2017-08-04 22:25:39 +02:00
348229b1d3 vim-patch:8.0.0133 (#7107)
Problem:    "2;'(" causes ml_get errors in an empty buffer.  (Dominique Pelle)
Solution:   Check the cursor line earlier.

fe38b494ff
2017-08-04 22:25:39 +02:00
36a91c790e Merge pull request #7116 from lonerover/vim-8.0.0081
vim-patch:8.0.0081
2017-08-04 10:32:47 -04:00
0c3f4f3921 fix lint error 2017-08-04 21:47:40 +08:00
99aeb607f4 vim-patch:8.0.0081
Problem:    Inconsistent function names.
Solution:   Rename do_cscope to ex_cscope.  Clean up comments.

d4db7719bd
2017-08-04 20:36:36 +08:00
5cc4ea38c0 Merge #7105 from justinmk/doc-tui 2017-08-03 10:13:43 +02:00
8160a0e042 Revert "vim-patch:8.0.0133 (#7107)"
This reverts commit eb40b7ec40.

The change caused this error on QuickBuild:

    INFO  - # test/functional/core/job_spec.lua @ 668: pty process teardown does not prevent/delay exit. #4798 #4900
    INFO  - not ok 321 - pty process teardown does not prevent/delay exit. #4798 #4900
    INFO  - # test/functional/core/job_spec.lua @ 668
    INFO  - # Failure message: ./test/functional/ui/screen.lua:302: Row 1 did not match.
    INFO  - # Expected:
    INFO  - # |* |
    INFO  - # |[Process exited 0] |
    INFO  - # | |
    INFO  - # | |
    INFO  - # | |
    INFO  - # |-- TERMINAL -- |
    INFO  - # Actual:
    INFO  - # |*E575: Error while reading ShaD|
    INFO  - # |a file: mark entry at position|
    INFO  - # | 92 has invalid line number |
    INFO  - # |Press ENTER or type command to|
    INFO  - # | continue |
    INFO  - # |-- TERMINAL -- |
    INFO  - #
    INFO  - # To print the expect() call that would assert the current screen state, use
    INFO  - # screen:snaphot_util(). In case of non-deterministic failures, use
    INFO  - # screen:redraw_debug() to show all intermediate screen states.
    INFO  - # stack traceback:
    INFO  - #     ./test/functional/ui/screen.lua:302: in function 'wait'
    INFO  - #     ./test/functional/ui/screen.lua:216: in function 'expect'
    INFO  - #     test/functional/core/job_spec.lua:677: in function <test/functional/core/job_spec.lua:668>
2017-08-03 09:31:05 +02:00
9b3ed62b5a Merge remote-tracking branch 'upstream/master' 2017-08-03 08:30:53 +08:00
29f44aab5a doc: Remove/relocate win32 notes. 2017-08-03 00:29:51 +02:00
8aa0dfd684 doc: "terminal" always means "embedded terminal emulator"
- Prefer "TUI" where possible to refer to the host terminal.
- Remove obsolete tags and ancient TTY exposition.
- Establish "terminal" to consistently mean "terminal emulator" in all
  Nvim documentation. This removes the need for verbose qualifiers in
  tags and prose.

References #6280
References #6803
2017-08-03 00:29:51 +02:00
eb40b7ec40 vim-patch:8.0.0133 (#7107)
Problem:    "2;'(" causes ml_get errors in an empty buffer.  (Dominique Pelle)
Solution:   Check the cursor line earlier.

fe38b494ff
2017-08-02 10:22:04 +02:00
b16a4ad49a Merge remote-tracking branch 'upstream/master' 2017-08-02 09:24:24 +08:00
ZyX
a356d3c895 Merge branch 'master' into colored-cmdline 2017-07-31 13:13:14 +03:00
27356de269 Merge pull request #7104 from jamessan/run-oldtests-under-headless
oldtests: Run nvim using --headless to avoid requesting user input
2017-07-30 23:00:53 -04:00
10399165e5 vim-patch:8.0.0498 (#7103)
Problem:    Two autocmd tests are skipped on MS-Windows.
Solution:   Make the test pass on MS-Windows. Write the messages in a file
            instead of getting the output of system().
e94260f358
2017-07-31 03:54:18 +02:00
347dd9476a oldtests: Run nvim using --headless to avoid requesting user input
Certain functions (e.g. feedkeys(…, 'x!') and input()) will attempt to
read from stdin, which shouldn't be expected to work during oldtests.
In Debian/Ubuntu's build environment, it explicitly can't work because
/dev/null is redirected to stdin, which causes read_error_exit() to
exit.

Running oldtests with --headless prevents nvim from setting up its input
handling, thus avoiding the problem altogether.

Reference #6794
2017-07-30 21:07:41 -04:00
b5e713e70d options: remove ghost of :set termcap (#7102)
Closes #6763
2017-07-31 02:50:34 +02:00
ZyX
fbe60af538 Merge branch 'master' into colored-cmdline 2017-07-31 02:05:02 +03:00
13e8356f52 Merge #7100 from justinmk/tui-colors 2017-07-30 23:50:46 +02:00
0795dd3c90 vim-patch: 8.0.00{12, 46, 93} (#7098)
vim-patch:8.0.0012
Problem:    Typos in comments.
Solution:   Change "its" to "it's". (Matthew Brener, closes vim/vim#1088)
9af4184276

vim-patch:8.0.0046
version.c: mark 8.0.0046 applied

vim-patch:8.0.0063
version.c: mark 8.0.0063 as NA patch
2017-07-30 23:10:09 +02:00
a7538371fe build: linux does not always have execinfo.h (#7101)
Closes #7099
2017-07-30 23:02:41 +02:00
360ca18f55 doc: tui colors, cursor 2017-07-30 22:23:11 +02:00
cb13ef3596 tui: fix truecolor in libvte, tmux #7037
Closes #7041
2017-07-30 22:17:31 +02:00
5cd68b3900 vim-patch:8.0.0124 #7092
Problem:    Internal error for assert_inrange(1, 1).
Solution:   Adjust number of allowed arguments. (Dominique Pelle)

3421566376
2017-07-30 14:15:26 +02:00
7c7039767a Merge remote-tracking branch 'upstream/master' 2017-07-30 09:10:22 +08:00
743993eb55 vim-patch:8.0.0119 (#7091)
Problem:    No test for using CTRL-R on the command line.
Solution:   Add a test. (Dominique Pelle) And some more.

21efc3633e
2017-07-30 01:36:44 +02:00
b3ca7112c6 Merge #7093 from justinmk/fix-qb 2017-07-30 01:15:11 +02:00
a4d1505435 Merge pull request #7068 from jbradaric/vim-8.0.0020
vim-patch:8.0.0020

Closes #6910
2017-07-29 18:25:14 -04:00
a118134af1 test/legacy: avoid TSAN CI build hang
This delete() sometimes hangs the TSAN build. Work around it by using
a unique filename. Do it at the start instead of the end, for hygiene
(though it doesn't actually matter on CI, it helps local dev).
2017-07-29 23:51:42 +02:00
cca6d40ed6 test/busted: eager-flushing TAP.lua handler
This TAP.lua implementation was upstreamed:
f9db364291
but it has not been released yet. It avoids hangs, and helps debug
hangs, on QuickBuild, so inline it until the next busted release.
2017-07-29 23:50:29 +02:00
fe0bcc0800 vim-patch:8.0.0020
Problem:    The regexp engines are not reentrant.
Solution:   Add regexec_T and save/restore the state when needed.

6100d02aab
2017-07-29 16:27:11 -04:00
dc3c06e73d doc: how to enable ASan/UBSan 2017-07-29 18:51:54 +02:00
8ae16aa92c Merge #7087 from justinmk/test-locale
test: force LC_ALL=en_US.UTF-8
2017-07-29 14:25:57 +02:00
5c08c8c009 test: force LC_ALL=en_US.UTF-8
Tests that check localized error messages need a stable locale, else
errors like this occur:

    [  FAILED  ] 2 tests, listed below:
    [  FAILED  ] ...npack/file/vim/neovim/test/functional/eval/null_spec.lua @ 29: NULL list is accepted as an empty list by writefile()
    ...npack/file/vim/neovim/test/functional/eval/null_spec.lua:30: Expected objects to be the same.
    Passed in:
    (string) '
    E484: Cannot open file Xtest-functional-viml-null'
    Expected:
    (string) '
    E484: Can't open file Xtest-functional-viml-null'

    stack traceback:
            ...npack/file/vim/neovim/test/functional/eval/null_spec.lua:30: in function <...npack/file/vim/neovim/test/functional/eval/null_spec.lua:29>

    [  FAILED  ] ...k/file/vim/neovim/test/functional/ex_cmds/write_spec.lua @ 81: :write errors out correctly
    ...k/file/vim/neovim/test/functional/ex_cmds/write_spec.lua:97: Expected objects to be the same.
    Passed in:
    (string) 'Vim(write):E510: Cannot make backup file (add ! to override)'
    Expected:
    (string) 'Vim(write):E510: Can't make backup file (add ! to override)'

    stack traceback:
            ...k/file/vim/neovim/test/functional/ex_cmds/write_spec.lua:97: in function <...k/file/vim/neovim/test/functional/ex_cmds/write_spec.lua:81>

     10 SKIPPED TESTS
     2 FAILED TESTS
    -- Output to stderr:
    2017/07/29 00:41:32 ERROR 31133/open_log_file:170: Logging to stderr, failed to open $NVIM_LOG_FILE: Xtest-startup-xdg-logpath/nvim/log
    2017/07/29 00:41:32 WARN  31133/call_set_error:815: RPC: ch 1 was closed by the client

    CMake Error at /home/shlomif/Download/unpack/file/vim/neovim/cmake/RunTests.cmake:50 (message):
      Running functional tests failed with error: 1.

    FAILED: CMakeFiles/functionaltest
    cd /home/shlomif/Download/unpack/file/vim/neovim/build && /usr/bin/cmake -DBUSTED_PRG=/home/shlomif/Download/unpack/file/vim/neovim/.deps/usr/bin/busted -DLUA_PRG=/home/shlomif/Download/unpack/file/vim/neovim/.deps/usr/bin/luajit -DNVIM_PRG=/home/shlomif/Download/unpack/file/vim/neovim/build/bin/nvim -DWORKING_DIR=/home/shlomif/Download/unpack/file/vim/neovim -DBUSTED_OUTPUT_TYPE=nvim -DTEST_DIR=/home/shlomif/Download/unpack/file/vim/neovim/test -DBUILD_DIR=/home/shlomif/Download/unpack/file/vim/neovim/build -DTEST_TYPE=functional -DSYSTEM_NAME=Linux -P /home/shlomif/Download/unpack/file/vim/neovim/cmake/RunTests.cmake
    ninja: build stopped: subcommand failed.
    Makefile:102: recipe for target 'functionaltest' failed
    make: *** [functionaltest] Error 1
2017-07-29 14:21:58 +02:00
3c2640cce4 doc 2017-07-29 14:21:58 +02:00
5acda12419 coverity/155506: null dereference (#7089)
Coverity warning is a false positive: if rbuffer_read_ptr() returns
NULL then `cnt` is zero.

Revert 76ea97c809 (which caused
the TSan build to hang often--possibly because of the missing ui_flush()).
Instead, modify out_data_append_to_screen() to check for NULL.

ref #6862
2017-07-29 04:53:40 +02:00
973bc2b7e0 Merge remote-tracking branch 'upstream/master' 2017-07-29 09:33:29 +08:00
707bb37494 vim-patch:8.0.0100 (#7085)
vim-patch:8.0.0100

Problem:    Options that are a file name may contain non-filename characters.
Solution:   Check for more invalid characters.

319afe3804
2017-07-29 00:00:53 +02:00
3e0536eb29 Merge remote-tracking branch 'upstream/master' 2017-07-28 08:38:08 +08:00
3b45f676c0 menu_get(): doc 2017-07-28 02:34:24 +02:00
dc685387a3 viml: introduce menu_get() function #6322
menu_get({path}, {modes}). See :h menu_get.
2017-07-28 01:27:58 +02:00
e6d54407ba Merge #7083 'build: disable array bounds checking in gcc < 4.8.5'
References #6931
2017-07-28 01:18:05 +02:00
ZyX
1011462b40 Revert "functests: Replace wait() with nvim_async"
This reverts commit e129607988.

Tests stopped working in CI.
2017-07-27 18:49:13 +03:00
3abf4c72b4 build: disable array bounds checking in gcc < 4.8.5
Thanks to James McCoy (jamessan) for finding the source of this issue.
2017-07-27 07:35:15 -04:00
8eb54c5dec vim-patch:8.0.0088 (#7080)
Problem:    When a test fails in Setup or Teardown the problem is not reported.
Solution:   Add a try/catch. (Hirohito Higashi)

cc28e2d05d
2017-07-27 03:56:25 +02:00
861ba1ddd4 runtime: Fix where desktop file and icon are installed (#7072)
With `xdg-*` utilities CMAKE_INSTALL_PREFIX is incorrectly ignored.

Taken from [nvim-qt][1]. For some reason it only checks for !APPLE.

[1]: b26596d164/src/gui/CMakeLists.txt (L48-L55)
2017-07-27 03:52:22 +02:00
ZyX
c5857e3f38 ex_getln: Cache highlight callback calling results 2017-07-26 22:56:48 +03:00
a2dc33ba19 Merge pull request #7069 from jbradaric/vim-8.0.0034
vim-patch:8.0.0034
2017-07-26 15:36:07 -04:00
ZyX
e129607988 functests: Replace wait() with nvim_async 2017-07-26 22:04:39 +03:00
ZyX
2952a00d2e message: Only require second (format) argument to be not NULL 2017-07-26 22:01:48 +03:00
0d24af8112 Merge pull request #7071 from jbradaric/vim-8.0.0075
vim-patch:8.0.0075
2017-07-26 07:09:30 -04:00
86f0cd7902 Merge pull request #7070 from jbradaric/vim-8.0.0062
vim-patch:8.0.0062
2017-07-26 07:07:00 -04:00
6e83db479c Merge pull request #7065 from jamessan/collect-provider-stderr
Provide standard mechanism to collect stderr for providers
2017-07-26 07:03:52 -04:00
ZyX
1ba21b4a31 functests: Remove unneeded wait()s 2017-07-26 13:02:45 +03:00
ZyX
d23c0de0c1 doc: Update documentation 2017-07-26 12:31:01 +03:00
55c821184d git: ignore .nvimlog (#7074) 2017-07-26 11:11:28 +02:00
d94e39a517 vim-patch:8.0.0062
Problem:    No digraph for HORIZONTAL ELLIPSIS.
Solution:   Use ",.". (Hans Ginzel, closes vim/vim#1226)

8161551724
2017-07-25 19:35:56 +02:00
09470eb673 vim-patch:8.0.0075
Problem:    Using number for exception type lacks type checking.
Solution:   Use an enum.

8a5883b748
2017-07-25 19:06:23 +02:00
811c45163c vim-patch:8.0.0034
Problem:    No completion for ":messages".
Solution:   Complete "clear" argument. (Hirohito Higashi)

9e507ca8a3
2017-07-25 18:41:14 +02:00
722806a115 provider: clipboard: Only report stderr if the job failed
Closes #7054
2017-07-24 20:10:40 -04:00
58d8d91ec1 provider: Extra pythonx's stderr handling to common functions 2017-07-24 20:10:28 -04:00
5a0acd09c1 Merge #7043 'vim-patch:8.0.{0023,0025}' 2017-07-24 03:04:46 +02:00
2b473a9df8 Merge #7061 from ckelsel/vim-8.0.0069 2017-07-24 02:56:18 +02:00
86f2c473dc fix lint 2017-07-24 07:41:01 +08:00
d011facf45 Merge #6516 'log_callstack()' 2017-07-23 17:48:12 +02:00
eb2473e9ea log: log_callstack() 2017-07-23 17:16:19 +02:00
5fc775e2ef log.h: LOG_CALLSTACK 2017-07-23 17:02:06 +02:00
ca32eb31b8 Merge #7048 from justinmk/log-ui 2017-07-23 16:54:55 +02:00
4b390fafc9 log: termios info to DEBUG instead of INFO 2017-07-23 15:01:31 +02:00
bc6a3fe784 log: caller provides the source details 2017-07-23 15:01:31 +02:00
b656159fcf vim-patch:8.0.0073
Problem:    More comparisons between firstwin and lastwin.
Solution:   Use ONE_WINDOW for consistency. (Hirohito Higashi)

459ca56312
2017-07-23 11:25:39 +08:00
ad07e9c7fc vim-patch:8.0.0069
Problem:    Compiler warning for self-comparison.
Solution:   Define ONE_WINDOW and add vim/vim#ifdef.

a1f4cb93ba
2017-07-23 10:34:41 +08:00
31c018244d Merge remote-tracking branch 'upstream/master' 2017-07-23 10:05:51 +08:00
502af39f62 log: channel registration 2017-07-22 21:26:03 +02:00
13f5bc9586 log: all UI events, not just UI-bridge
Rename ui_bridge.c:UI_CALL to UI_BRIDGE_CALL.
2017-07-22 21:26:03 +02:00
253f6f3bbf vim-patch:8.0.0038 (#7051)
Problem:    OPEN_CHR_FILES not defined for FreeBSD using Debian userland
            files.
Solution:   Check for __FreeBSD_kernel__. (James McCoy, closes vim/vim#1166)

ca291aec99
2017-07-22 19:04:45 +02:00
8fb599029f vim-patch:8.0.0031 (#7050)
Problem:    After ":bwipeout" 'fileformat' is not set to the right default.
Solution:   Get the default from 'fileformats'. (Mike Williams)

e8ef3a0934
2017-07-22 19:03:15 +02:00
962e8cc1dd vim-patch:8.0.0052 (#7057)
Problem:    Conceal test passes even without the bug fix.
Solution:   Add a redraw command. (Christian Brabandt)

35a1f59d63
2017-07-22 18:59:14 +02:00
2c89195afd merge upstream 2017-07-21 20:25:36 +08:00
4bcc70b2b5 Merge pull request #7045 from jbradaric/vim-8.0.0085
vim-patch:8.0.0085
2017-07-20 09:46:32 -04:00
710546c5e9 vim-patch:8.0.0085
Problem:    Using freed memory with recursive function call. (Dominique Pelle)
Solution:   Make a copy of the function name.

8a01f969c1
2017-07-20 12:57:08 +02:00
c40093f47a Merge pull request #7027 from lonerover/vim-8.0.0003
vim-patch:8.0.0003
2017-07-19 06:48:16 -04:00
b98ea04226 vim-patch:8.0.0003
Problem:    getwinvar() returns wrong Value of boolean and number options,
            especially non big endian systems. (James McCoy)
Solution:   Cast the pointer to long or int. (closes vim/vim#1060)

789a5c0e3d
2017-07-19 11:48:10 +08:00
ZyX
0a46ae3c0a functests: Add sleep to <C-c> test 2017-07-18 01:29:41 +03:00
ZyX
740dcaef0d ex_getln: Avoid GCC “unused variable” warning from QB
17:25:45,363 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/ex_getln.c: In function ‘color_cmdline’:
    17:25:45,363 WARN  - /home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/ex_getln.c:2335:8: error: variable ‘printed_errmsg’ set but not used [-Werror=unused-but-set-variable]
    17:25:45,363 WARN  - bool printed_errmsg = false;
    17:25:45,363 WARN  - ^
    17:25:45,399 WARN  - cc1: all warnings being treated as errors
2017-07-18 01:25:55 +03:00
ZyX
25c6ac1af6 *: Fix clint errors 2017-07-18 01:21:23 +03:00
ZyX
25f669049c functests: Test input() nesting support 2017-07-18 01:17:59 +03:00
ZyX
759f71d50e functests: Check for previously unchecked errors 2017-07-18 00:34:39 +03:00
ZyX
8a581b918b ex_getln: Check prev_prompt_errors before running redrawcmdline
Otherwise there will be infinite recursion and shortly a crash. Running 
redrawcmdline recursively occurs under color_cmdline_error label.
2017-07-18 00:20:21 +03:00
ZyX
cfb1d937a6 api helpers: Also save and restore did_emsg 2017-07-18 00:08:57 +03:00
26124b4800 provider/clipboard.vim: fix logic issue #7042
Closes #7039
2017-07-17 17:20:37 +02:00
d0537961c1 Merge #7040 'vim-patch:8.0.{0017,0026,0078,0079,0084}' 2017-07-17 16:54:17 +02:00
24a0d4e122 vim-patch:8.0.0004 (#7044)
Problem:    A string argument for function() that is not a function name
            results in an error message with NULL. (Christian Brabandt)
Solution:   Use the argument for the error message.

5582ef1438
2017-07-17 16:38:03 +02:00
ZyX
3a923ad2db ex_getln: Replace global with entry in save_ccline 2017-07-17 02:33:18 +03:00
ZyX
cb3c71eac9 doc: Adjust documentation a bit
2 spaces after sentense ends, clarify what will be highlighted.
2017-07-17 02:32:32 +03:00
ZyX
dc0a496d41 ex_getln: Do not do useless try_enter/try_leave calls
These are actually needed for two modes only. And even for these modes they 
should eventually go away.
2017-07-17 01:57:27 +03:00
ZyX
f4744e1821 ex_getln: Do not goto color_cmdline_end without first cleaning up
The issue with debug mode was actually not cleaning up after `try_enter`: 
location `&tstate` was pointing to got invalidated and received some “garbage” 
(actually, values that got stored on the stack afterwards). But pointer to that 
garbage was still stored in `msg_list`, so next attempt to check it resulted in 
a crash.
2017-07-17 01:55:10 +03:00
9cf0415761 vim-patch:8.0.0025
Problem:    Inconsistent use of spaces vs tabs in gd test.
Solution:   Use tabs. (Anton Lindqvist)

936c48f8ca
2017-07-16 21:43:42 +02:00
9ffa22b7ef vim-patch:8.0.0023
Problem:    "gd" and "gD" may find a match in a comment or string.
Solution:   Ignore matches in comments and strings. (Anton Lindqvist)

226630a030
2017-07-16 21:43:06 +02:00
ZyX
2a6423eba7 api helpers: Save/restore more values in try_enter/try_leave
This fixes memory leak reported by ASAN. This also somehow fixes test40, though 
I have no idea why except that that test yields memory leak report.
2017-07-16 22:03:31 +03:00
ZyX
3660535f02 oldtests: Use $(TOOL) in place of $(VALGRIND) 2017-07-16 21:17:24 +03:00
a76da96e86 Merge #7028 from fmoralesc/vimtutor-disentangle2
Closes #4533
Closes #6389
Closes #4913 
Closes #7005
2017-07-16 18:19:41 +02:00
3241bce611 tutor: reorganize 2017-07-16 12:10:49 -04:00
e29ec131d6 vim-patch:8.0.0084
Problem:    Using freed memory when adding to a quickfix list. (Domenique
            Pelle)
Solution:   Clear the directory name.

7618e00d3b
2017-07-16 17:48:50 +02:00
875c356a83 vim-patch:8.0.0079
Problem:    Accessing freed memory in quickfix. (Domenique Pelle)
Solution:   Do not free the current list when adding to it.

2b946c9f9b
2017-07-16 17:48:50 +02:00
ffa2e43549 vim-patch:8.0.0078
Problem:    Accessing freed memory in quickfix.
Solution:   Reset pointer when freeing 'errorformat'. (Domenique Pelle)

63bed3d319
2017-07-16 17:48:50 +02:00
c00300ecdd vim-patch:8.0.0026
Problem:    Error format with %W, %C and %Z does not work. (Gerd Wachsmuth)
Solution:   Skip code when qf_multiignore is set. (Lcd)

9b45794818
2017-07-16 17:48:50 +02:00
33efad7dbc vim-patch:8.0.0017
Problem:    Cannot get the number of the current quickfix or location list.
Solution:   Use the current list if "nr" in "what" is zero. (Yegappan
            Lakshmanan)  Remove debug command from test.

890680ca63
2017-07-16 17:48:50 +02:00
cb95f71f71 merge upstream/master 2017-07-16 08:22:49 +08:00
4dee942e73 provider/clipboard.vim: capture/display errors (#6684)
TODO: handle errors in the `get`. systemlist() should take an
options dictionary like jobstart(), which may specify a stderr handler.

References #6565
2017-07-15 20:51:51 +02:00
d8fe63199f intro: change byline to "by al." (#6984)
Several people have suggested that the "by Bram" byline is misleading,
it implies that Bram is actively involved with the project. Up to now we
left it as an homage.

Bram agreed that it is misleading, and suggested a mention somewhere
other than the intro.
2017-07-15 18:13:49 +02:00
d72db1ac8f test: mouse_spec: remove obnoxious wait times (#7029)
helpers.skip_fragile() already skips the problematic tests
on the ASan build. But the 15s timeout plus 5s 'mousetime'
cause the tests to take 1+ minutes anyways.
2017-07-15 18:00:00 +02:00
ZyX
69719e658c Merge branch 'master' into colored-cmdline 2017-07-15 18:56:45 +03:00
37af859930 tutor: update syntax
sampletext regions no longer supported

make sure tutorExpect is available

don't conceal code region delimiters
2017-07-15 11:01:45 -04:00
8e48d7c19e tutor: disable old method for setting "expect" regions
tutor: remove movement mappings
2017-07-15 11:01:45 -04:00
cb0282ad98 tutor: update tutor-mode tutorial 2017-07-15 11:01:45 -04:00
c235ee3f05 tutor: don't enable folds by default 2017-07-15 11:01:45 -04:00
ec67d07065 tutor: allow metadata to exist outside of the documents.
this makes 'expect' regions simpler to handle.
2017-07-15 11:01:45 -04:00
2dc5b141da tutor: some tweaks to begginer's tutorial 2017-07-15 11:01:44 -04:00
8898793ade tui: Do not override 'termguicolors' choice (#7004)
* Do not guard true color support with white list
* Remove ext_bool (it is unused)

Closes #7003
2017-07-15 16:36:45 +02:00
d15317ece4 health.vim: fix test 2017-07-15 16:15:47 +02:00
72c38b5cd5 health.vim: validate g:clipboard
Closes #7020

Also fix 'iskeyword' setting, which I fumbled in
440133e0d5
2017-07-15 15:19:01 +02:00
e2216724ce Merge pull request #7026 from lonerover/vim_patch
vim-patch.sh: remove prefix "0", only show missing patches
2017-07-15 08:43:59 -04:00
307605e115 Merge pull request #7024 from jamessan/win32yank
third-party: Bump win32yank to v0.0.4 and install arch-specific binary
2017-07-15 08:37:38 -04:00
e3a2b7220f vim-patch.sh: only show missing patches 2017-07-15 20:34:24 +08:00
ad34f15ef2 third-party: Bump win32yank to v0.0.4 and install arch-specific binary
Closes #6933
2017-07-14 16:11:52 -04:00
da99ded25b Merge pull request #6486 from jamessan/vim8-patches
Bump Vim version to 8.0 and applied patches
2017-07-14 06:49:59 -04:00
08e4b6b4f3 version.c: Mark NA patches
- Netbeans: 0005, 0024, 0213
- Vim-specific documentation: 0007
- Vim CI/buildsystem: 0009, 0077, 0080, 0082, 0093, 0115, 0117, 0129,
  0130, 0144, 0145, 0203, 0239, 0240, 0249, 0257, 0272, 0279
- +cryptv: 0010, 0014
- Channel support: 0011, 0013, 0015, 0016, 0022, 0027, 0036, 0076, 0097,
  0103, 0105, 0107, 0108, 0120, 0122, 0152, 0267, 0284
- Timer implementation: 0028, 0098
- Removing legacy support: 0029, 0070, 0109, 0241, 0246
- TUI tweaks: 0030
- viminfo: 0039
- Jobs: 0045, 0048, 0050, 0051, 0054, 0071, 0087
- Style: 0055, 0114
- VMS/Sun support: 0059, 0067, 0123, 0173
- FEAT_* ifdefs: 0061, 0065, 0138, 0139, 0161, 0192, 0193, 0199, 0211,
  0217, 0221, 0260, 0276, 0281
- GUI support: 0072, 0089, 0095, 0113, 0162, 0273, 0277, 0278
- win32 fixes: 0094
- Test infrastructure: 0285, 0288, 0400
- Language bindings: 0163, 0187, 0191, 0268-0271
- Unsupported options: 0232

vim-patch:20eeb612
vim-patch:17777875
vim-patch:99c5eb4f
vim-patch:294740d2
vim-patch:a4ce25bd
vim-patch:7034a837
vim-patch:14a612fa
vim-patch:aaeabfbc
2017-07-14 06:44:22 -04:00
d67e48379f test: shada: Replace hard-coded 704 with dynamic version 2017-07-14 06:44:22 -04:00
06ec15121a Bump Vim version to 8.0 and applied patches 2017-07-14 06:44:06 -04:00
dabd9ef44b Merge pull request #6977 from ckelsel/_vim-7.4.2189.patch
vim-patch:7.4.2189
2017-07-14 06:42:52 -04:00
c4ac3ffbef Merge pull request #6993 from ckelsel/vim-7.4.2250
Vim 7.4.2250
2017-07-13 23:19:12 -04:00
06f4b96322 lint 2017-07-13 23:15:29 -04:00
c805f2cf54 vim-patch:7.4.2250
Problem:    Some error message cannot be translated.
Solution:   Enclose them in _() and N_(). (Dominique Pelle)

5b30291785
2017-07-13 23:15:29 -04:00
462a6148a6 lint 2017-07-13 23:09:03 -04:00
2999d7c0e8 vim-patch:7.4.2229
f04507d132

Author: Bram Moolenaar <Bram@vim.org>
Date:   Sat Aug 20 15:05:39 2016 +0200

    patch 7.4.2229
    Problem:    Startup test fails on Solaris.
    Solution:   Recognize a character device. (Danek Duvall)
2017-07-13 23:09:03 -04:00
04de6a64e2 vim-patch:7.4.2189
f71d7b9ee5

Author: Bram Moolenaar <Bram@vim.org>
Date:   Tue Aug 9 22:14:05 2016 +0200

    patch 7.4.2189
    Problem:    Cannot detect encoding in a fifo.
    Solution:   Extend the stdin way of detecting encoding to fifo.  Add a test
                for detecting encoding on stdin and fifo. (Ken Takata)
2017-07-13 23:09:03 -04:00
f746e38955 Merge pull request #7011 from mhinz/doc/jobcontrol-example
doc: rewrite job-control example
2017-07-14 00:08:15 +02:00
d40ca32095 doc: rewrite job-control example
Fixes https://github.com/neovim/neovim/issues/7009
2017-07-13 15:19:29 +02:00
8370373839 Merge pull request #6881 from Shougo/vim-7.4.2354
vim-patch:7.4.2354
2017-07-12 00:06:56 -04:00
b4ccf5c20a vim-patch:7.4.2354
Problem:    The example that explains nested backreferences does not work
            properly with the new regexp engine. (Harm te Hennepe)
Solution:   Also save the end position when adding a state. (closes vim/vim#990)

d563883a1f
2017-07-12 00:05:29 -04:00
8cc49f9f1a ignore patch-2367,2364 2017-07-12 11:34:22 +08:00
5f8f46ba8e Merge pull request #6983 from justinmk/libtermkey
third-party: Bump libtermkey to 0.20
2017-07-10 18:51:43 -04:00
465bbee520 Merge remote-tracking branch 'upstream/master' 2017-07-10 08:10:15 +08:00
6725667d31 Merge #6991 from jdebp/tui-fixes-201707
Fix #6982
2017-07-09 21:51:01 +02:00
0a7e7e0ecf tui: Remove superflous iTerm2 test added in error. 2017-07-09 19:29:04 +01:00
68d2fb7570 tui: Improve the setrgbf/setrgbb fallback logic.
The libvte test was too agressive, and is reduced to only triggering
when it is libvte 0.36 AND a gnome or xterm terminal type is used.

Contrastingly, tmux was not on the list at all and now is.
2017-07-09 19:08:56 +01:00
5bdad50307 doco: Document constant 'term' in more detail.
Also expand the example in term-dependent-settings.
2017-07-09 19:08:35 +01:00
702c94aacf mbyte: Fix crash when using multibyte chars in maparg() return (#6986)
This is a refactoring typo from #6947.

Fixes #6985

Combined with #6947 where typo was made it also fixes vim/vim#1827 which was
present in Neovim.
2017-07-09 10:40:46 +02:00
619838f85d inccommand: improve performance #6949
During a preview, we can stop looking for matches after we got enough
lines for the preview buffer.

Because of this perf improvement, the 'redrawtime' test needs to be
slowed down in a different way: _long_ lines instead of just many lines.
2017-07-08 17:51:42 +02:00
0fb4d173f8 Merge #6945 from justinmk/cpoptions 2017-07-08 17:33:43 +02:00
2555bd3ab0 third-party: Bump libtermkey to 0.20 2017-07-08 16:39:46 +02:00
829e1f2c43 lint 2017-07-08 16:34:35 +02:00
0b88bf256d doc: api.txt; deprecate <special> 2017-07-08 16:34:35 +02:00
0ea7e45bc1 'cpoptions': remove "<" flag; ignore <special>
Closes #6937 "nvim_get_keymap output is unreliable"
2017-07-08 16:34:35 +02:00
78c5201234 'cpoptions': remove "k" flag
This was already removed in 3baba1e7bc, except the documentation and
CPO_VI entry. find_term_bykeys() is irrelevant to Nvim.
2017-07-08 16:34:33 +02:00
6720fe253e runtime: K: prefer Vim help instead of man #3104 2017-07-08 15:11:56 +02:00
06f798cc38 doc: ISSUE_TEMPLATE.md 2017-07-08 14:59:06 +02:00
69e9cda5ac i_CTRL-O: fix :startinsert at end of line (#6963)
The gchar_cursor() == NUL check is already done in ins_ctrl_o.
ins_esc changes gchar_cursor() so this if block is probably never
entered.

Issue:

Pressing CTRL-O in insert mode at the end of the line and typing
:startinsert moves the cursor 1 column back, when I expect the cursor
to remain at the end of the line

This is a regression from Vim behavior. Since at least Vim version 7.0,
Vim returns you to insert mode at the end of the line.

091e7d033c is the first bad neovim commit

Steps to reproduce using `nvim -u NORC`:
`aaaa<C-o>:startinsert<CR>`

Fixes #6962
2017-07-08 12:50:58 +02:00
17298a7912 runtime: update vimCommand syntax pattern (#6976)
Update a flawed match pattern for the vimCommand syntax group. To see
the effect of this fix, open a vimscript buffer,

  nvim -u NONE foo.vim

configure a couple highlight groups,

  :hi! vimIsCommand ctermfg=Green
  :hi! vimCommand ctermfg=Red
  :syntax enable

and add the following lines to the buffer:

  let foo=xFoo
  let bar=zBar

You'll notice the "z" in zBar is Red, while xFoo and the rest of Bar are green. This will
be the case as long as the word following `=` starts with the letter "z". This has already
been fixed upstream by adding a "\>" word boundary to the match pattern:

  https://github.com/vim/vim/issues/124
  e271909625 (diff-86da060e2153c8ce5dc317a7b4b5a29dR27)

This particular match pattern was also mentioned in issue #5491, but in reference to a bug
that was related to the generated part of syntax/vim.vim, whereas this bug lives in the
non-generated part of the file.
2017-07-08 12:44:36 +02:00
226603a8d8 Merge pull request #6979 from jamessan/avoid-jemalloc-on-osx
Prefer the static jemalloc library by default on OSX
2017-07-07 15:46:39 -04:00
35fad15c89 Prefer the static jemalloc library by default on OSX
When neovim is dynamically linked against jemalloc on OSX, users are
hitting the deadlock described in jemalloc/jemalloc#895.
2017-07-07 14:33:54 -04:00
773ea9dbdc Merge pull request #6823 from blueyed/fix-term-stop
fix SIGTERM/SIGHUP for jobs
2017-07-07 10:29:49 -04:00
5f5f2ce0de test: tui_spec: Remove unused is_linux variable 2017-07-07 10:07:53 -04:00
f31c26f1af jobstop/process_stop: send SIGTERM directly
This reverts the revert of #6644 (7c1a5d1d4), and handles it properly
now (with tests).
2017-07-07 13:11:20 +02:00
105d680aea Merge #6816 'TUI improvements'
Removed these commits (test-suite changes):
e2fba01910
7c809c4bc7
18e7cd9e97
2017-07-07 00:34:37 +02:00
1ae7744f42 lint 2017-07-07 00:33:57 +02:00
852f21ed05 tui: Coding style changes only
Per warnings about house style from automated tools.
2017-07-06 10:17:13 +02:00
5701165f06 tui: Switch terminal keyboard mode properly.
The terminfo doco explicitly states that it covers the case where the
terminal is in application cursor/keypad (i.e. "keypad transmit") mode,
and not where it is in normal cursor/keypad (i.e.  "keypad local") mode.
Full screen applications like nvim must switch to and from keypad
transmit mode when expecting the control sequences given by terminfo.
2017-07-06 10:17:13 +02:00
de8a9f6c33 tui: Coding style changes only
Per warnings about house style from automated tools.
2017-07-06 10:17:13 +02:00
c07e144c82 Merge pull request #6969 from jamessan/ttimeoutlen
options: Default to 'ttimeout' and 'ttimeoutlen=50'
2017-07-06 04:02:37 +00:00
e4dc878f89 options: Default to 'ttimeout' and 'ttimeoutlen=50'
This gives libtermkey 50msec to reassemble split multibyte sequences
like DCSes.
2017-07-05 22:23:04 -04:00
69f0847ccc Merge #6959 from ZyX-I/pvs-fixes 2017-07-04 23:50:57 +02:00
1b70a1da04 Merge #6958 from ZyX-I/fix-6957 2017-07-04 21:56:05 +02:00
ZyX
ce30998221 bufhl_defs: Silence V512: buffer underflow 2017-07-04 20:11:35 +03:00
ZyX
7109f63e3c main: Flush file in place of closing it, also do error reporting
Apparently on travis OS X systems it crashes when cleaning up streams with
stdout closed:

    (lldb) bt all
    * thread #1: tid = 0x0000, 0x00007fff8703df06 libsystem_kernel.dylib`__pthread_kill + 10, stop reason = signal SIGSTOP
      * frame #0: 0x00007fff8703df06 libsystem_kernel.dylib`__pthread_kill + 10
        frame #1: 0x00007fff93a764ec libsystem_pthread.dylib`pthread_kill + 90
        frame #2: 0x00007fff97c056df libsystem_c.dylib`abort + 129
        frame #3: 0x00007fff97bccdd8 libsystem_c.dylib`__assert_rtn + 321
        frame #4: 0x0000000107a4e106 nvim`uv__close(fd=<unavailable>) + 102 at core.c:521
        frame #5: 0x0000000107a5307d nvim`uv__loop_close(loop=0x00007fff5847c018) + 77 at loop.c:118
        frame #6: 0x0000000107a4d149 nvim`uv_loop_close(loop=0x00007fff5847c018) + 57 at uv-common.c:626
        frame #7: 0x000000010783e5bc nvim`stream_set_blocking(fd=0, blocking=true) + 204 at stream.c:34
        frame #8: 0x000000010795d66b nvim`mch_exit(r=0) + 91 at os_unix.c:147
        frame #9: 0x00000001078d5663 nvim`command_line_scan(parmp=0x00007fff5847c760) + 1779 at main.c:787
        frame #10: 0x00000001078d4393 nvim`main(argc=2, argv=0x00007fff5847c898) + 163 at main.c:249
        frame #11: 0x00007fff8cdd65ad libdyld.dylib`start + 1
        frame #12: 0x00007fff8cdd65ad libdyld.dylib`start + 1
2017-07-04 19:58:02 +03:00
957a6506ef Merge pull request #6961 from ZyX-I/pvscheck-cc
pvscheck: Add --environment-cc switch
2017-07-04 19:27:12 +03:00
ZyX
aa3e3b4ca6 pvscheck: Add --environment-cc switch
To be used to make bot-ci able to use clang-4.0 without hacks.

[ci skip]
2017-07-04 19:25:05 +03:00
ZyX
28f6bd822b terminal: Silence -V666 error: value not correspond with string length
Looks like calling this function below with 4-character first strings
made PVS think that OPT_LOCAL (it is equal to 4) is a string length.
2017-07-04 18:37:02 +03:00
ZyX
af1f17f1dc syntax: Fix V763: parameter always rewritten before being used
This is the result of malloc error handling elimination: push_current_state() 
used to (not) return OK depending on whether growing garray failed or not and 
this return was checked, if errorred out push_next_match() will simply return 
its argument unchanged.

Now when allocations are supposed to either always succeed or crash Neovim this 
check was returned, push_current_state() was stripped of its return value and 
moved out of if() condition, resulting in V763.
2017-07-04 18:37:02 +03:00
ZyX
aaab5e3900 spell: Silence V512: buffer underflow 2017-07-04 18:37:02 +03:00
ZyX
4cb6317900 spell: Fix V728: excessive check 2017-07-04 18:37:02 +03:00
ZyX
f81d1ce003 regexp: Silence V595: potential null dereference
The code uses 2-iteration loop antipattern: retval is NULL on first iteration, 
not NULL on second, yet this is still a false positive.
2017-07-04 18:37:01 +03:00
ZyX
6552768c4f normal: Fix V728: excessive check 2017-07-04 18:37:01 +03:00
ZyX
605c8fb49c main: Use msgpack_file_write in place of “fbuffer”
Apparently the latter is not a part of the public C API.
2017-07-04 18:37:01 +03:00
ZyX
f0b3029ad3 os: Add OS_STD*_FILENO constants 2017-07-04 18:37:01 +03:00
ZyX
72b3fd9664 os/fileio: Add ability to use os/fileio.c for file descriptors
Code imported from #6299
2017-07-04 18:37:01 +03:00
ZyX
5ab9e9f617 os/fileio: Add msgpack_file_write function 2017-07-04 18:37:01 +03:00
ZyX
94bd0f9915 main: Fix V522: potential NULL dereference
It is useless to use sbuffer here and print that to stdout, just using “fbuffer”
instead.
2017-07-04 18:37:01 +03:00
ZyX
63f72ac27c shada: Fix linter error 2017-07-04 17:47:45 +03:00
ZyX
1f05ec95c0 ex_getln: Silent V519: value is assigned twice successively
This is usual “passing data via global” false positive.
2017-07-04 16:24:48 +03:00
ZyX
c930f32ab9 socket: Silence V641: buf size is not multiple of what it is cast to 2017-07-04 16:22:18 +03:00
5214798cfc Merge #6955 'Fix invalid :echo output' 2017-07-04 15:18:18 +02:00
ZyX
2e89aaf3bd charset: Fix V728: excessive check 2017-07-04 16:08:52 +03:00
ZyX
91b9ad7d82 shada: Make sure that code does not attempt to read too long items
Fixes #6957
2017-07-04 15:41:59 +03:00
ZyX
2208b64891 functests: Ensure different SIDs on successive source() calls 2017-07-04 15:15:23 +03:00
ZyX
480598dcda functests: Add some more :echo tests which also check for regression
Fixes #6954
2017-07-04 02:38:40 +03:00
ZyX
d113d3d737 functests: Make ex_cmds/echo actually use :echo 2017-07-04 02:22:26 +03:00
ZyX
e07e46f539 message: Fix :echo "\x80" printing ~@<80> 2017-07-04 02:06:40 +03:00
ZyX
b199194a2c functests: Copy eval/string_spec.lua to ex_cmds/echo_spec.lua 2017-07-04 02:06:04 +03:00
008b604bac Merge #6947 from ZyX-I/consistent-get_keymap 2017-07-03 23:33:08 +02:00
e333957a1a dict_get_value(): name the missing key (#6952) 2017-07-03 23:03:30 +02:00
82907ab5fe Merge pull request #6946 from jamessan/fix-expand_env_esc-test
test: expand_env_esc: Pass correct buffer size for outlen and assertion
2017-07-02 18:52:26 +00:00
ZyX
35898cff5d unittests: Fix allocation ordering for tv_dict_add_str() 2017-07-02 20:24:39 +03:00
ZyX
d5916a823a functests: Test how spaces appear in get_keymap output 2017-07-02 20:08:00 +03:00
4d01725699 test: expand_env_esc: Pass correct buffer size for outlen and assertion
Running this test with a mocked passwd file whose $HOME was set to
/home/jamessan/src/debian.org/pkg-vim/deb-packages/neovim/neovim-0.2.0/debian/fakehome
caused the test to fail, since the expanded result was >= 99 bytes.  The
test should be reflecting the actual size of the buffer, instead of some
arbitrary other number, anwyay.
2017-07-02 12:52:43 -04:00
ZyX
b97df0bdad getchar: Fix linter error 2017-07-02 19:52:04 +03:00
ZyX
5fe5d712aa functests: Use more extensive testing
Fixes #6937
2017-07-02 19:50:03 +03:00
ZyX
24f0056ca5 message: Add support for replacing < to str2special 2017-07-02 19:37:21 +03:00
ZyX
a1fee487ba functests: Add tests for new behaviour
Apparently it is not working yet.
2017-07-02 19:28:44 +03:00
ZyX
4b8bdd953e functests: Remove local_copy function 2017-07-02 19:21:21 +03:00
ZyX
936c070059 eval: Make nvim_get_keymap output more robust 2017-07-02 19:15:14 +03:00
ZyX
85a6329a2b eval: Use tv_dict_add_allocated_str() for mapblock_fill_dict 2017-07-02 19:02:15 +03:00
ZyX
df040e55fb eval/typval: Add tv_dict_add_allocated_str() function 2017-07-02 19:01:09 +03:00
ZyX
6140396d97 *: Adjust usages of modified functions 2017-07-02 18:50:16 +03:00
ZyX
832c158a66 message: Refactor str2specialbuf
Does not alter its usages.
2017-07-02 18:47:33 +03:00
ZyX
e9e1668ca6 message: Refactor str2special_save and str2special
Does not alter their usages as well.
2017-07-02 18:47:33 +03:00
ZyX
ac086d8ce2 mbyte: Refactor mb_unescape
Does not alter its usages.
2017-07-02 18:47:32 +03:00
1514cdc7d8 Merge remote-tracking branch 'upstream/master' 2017-07-02 09:27:32 +08:00
ca4633bfe4 ci/quickbuild: XXX: disable server_requests test (#6851)
Temporarily disable this test which hangs quickbuild.

From #6905: The hang occurs when calling nvim_set_current_line.

References #6594 5a151555c8
2017-07-02 00:30:00 +02:00
57d691e81a test: handle single-char hostname (#6939) 2017-07-01 18:48:17 +02:00
ZyX
7ab152aaa5 ex_getln: Save and restore try state
Problem: when processing cycle such as

    :for pat in [' \ze*', ' \zs*']
    :  try
    :    let l = matchlist('x x', pat)
    :    $put ='E888 NOT detected for ' . pat
    :  catch
    :    $put ='E888 detected for ' . pat
    :  endtry
    :endfor

`:let l = …` throwing an error causes this error to be caught after 
color_cmdline attempts to get callback for highlighting next line (the one with 
`$put = 'E888 NOT…`). Saving/restoring state prevents this from happening.
2017-07-01 15:34:25 +03:00
b96f43f2b8 rm test 2017-07-01 10:56:46 +08:00
3965449d05 test 2017-07-01 10:55:55 +08:00
fcbc7a8db4 Merge pull request #6936 from jamessan/unicode-10
Update to Unicode 10
2017-06-30 17:52:16 +00:00
39b431b3ed fix hostname_spec.lua test failed 2017-06-30 20:18:41 +08:00
03fc0e3f41 scripts: Tell curl to follow redirects 2017-06-29 20:25:51 -04:00
ddea5038e4 Update unicode files 2017-06-29 17:46:29 -04:00
25eced62b6 Update emoji-data URL for Unicode 10
vim-patch:8.0.0652
2017-06-29 17:46:27 -04:00
42d892913d cmake: Remove custom "Dev" build-type. (#6932)
The main purpose of this build-type was to avoid unwanted ~/.nvimlog
files (which could get really big, and also affects performance) for
non-devs. But that is no longer necessary since the log system now
avoids non-critical logging by default (#6827).

This essentially reverts 87e5a41316
2017-06-29 09:29:40 +02:00
ZyX
ea75966e42 ex_getln: Do not make <C-c> interrupt input() after interrupting hl cb 2017-06-28 22:54:13 +03:00
ZyX
564d5f921c ex_getln: Fix indent 2017-06-28 22:21:37 +03:00
ZyX
99079a164d ex_getln: Make sure standard error reporting facility is not used 2017-06-28 22:20:47 +03:00
ZyX
3da49cd68e ex_getln: Fix “echoerr msg not shown” problem
This also attempted to fix problem with cancelling input() on error by avoiding 
standard error printing facilities (assumed thrown error message is the 
problem), but with no luck so far.
2017-06-28 22:09:10 +03:00
4403864da3 update tests 2017-06-28 20:23:03 +02:00
e8829710bc Merge branch 'master' into option-fixes 2017-06-28 16:52:04 +02:00
ZyX
9ccb3abbb5 functests: Uncomment {REDRAW} part of “works” test 2017-06-28 14:39:52 +03:00
ZyX
5e4976559a functests: Partially uncomment <C-c> test 2017-06-28 14:34:12 +03:00
ZyX
0ed95423de ex_getln: Call highlight callback inside :try 2017-06-28 14:26:23 +03:00
ZyX
493d250446 functests: Make “stops executing callback” test work
Needed to be adjusted to use input() (previously relied on side-effects of 
executing `:cmd`) and dismiss something (hidden “Press ENTER” message?).
2017-06-28 13:58:51 +03:00
ZyX
36a84d8f4a functests: Fix typo 2017-06-28 13:54:04 +03:00
f0dafa89c2 provider/clipboard.vim: Handle missing g:clipboard keys 2017-06-28 09:42:03 +02:00
6016ac270f provider/clipboard.vim: allow configuration #6030
Closes #6029
2017-06-27 12:22:06 +02:00
91749c06dc Merge pull request #6927 from jamessan/vim-7.4.2259
vim-patch:7.4.2259,7.4.2268,7.4.2318,7.4.2320
2017-06-27 03:19:01 +00:00
6a842132bc ex_getln: Lint command_line_handle_key readability/fn_size
Create new functions to handle moving to the next incsearch match or
matching history index.
2017-06-26 22:08:13 -04:00
54d5e90a2b vim-patch:7.4.2320
Problem:    Redraw problem when using 'incsearch'.
Solution:   Save the current view when deleting characters. (Christian
            Brabandt) Fix that the '" mark is set in the wrong position. Don't
            change the search start when using BS.

dda933d06c
2017-06-26 22:08:13 -04:00
3679752dbd vim-patch:7.4.2318
Problem:    When 'incsearch' is not set CTRL-T and CTRL-G are not inserted as
            before.
Solution:   Move vim/vim#ifdef and don't use goto.

349e7d94e6
2017-06-26 22:08:13 -04:00
0dd6455659 vim-patch:7.4.2268
Problem:    Using CTRL-N and CTRL-P for incsearch shadows completion keys.
Solution:   Use CTRL-T and CTRL-G instead.

1195669f9e
2017-06-26 22:08:11 -04:00
518b42db91 functests/legacy: Add lua version of test_search.vim 2017-06-26 22:07:28 -04:00
f34befe74c Merge #6789 from ZyX-I/lua-path
lua: Add paths from &runtimepath to package.path and package.cpath
2017-06-27 02:29:15 +02:00
1ef2d768e7 socket.c: Disable Nagle's algorithm on TCP sockets (#6915)
Reducing latency is more interesting than optimizing bandwidth
for Nvim's typical use-cases.
2017-06-27 02:09:49 +02:00
ZyX
edc2a7ee46 functests: Make tests work with input()
There are still some issues: specifically, new “pending” test hangs busted.
2017-06-27 02:15:49 +03:00
ZyX
8e5134784c functests: Comment out failing test 2017-06-27 01:55:21 +03:00
ZyX
71616fce0b functests: Abstract away some ways to enter cmdline coloring mode
Reason: should actually switch to using input() coloring because other coloring 
variants are eventually going away.
2017-06-27 01:54:08 +03:00
ZyX
072a853fa2 ex_getln: Enable coloring for expression mode 2017-06-27 01:34:54 +03:00
ZyX
95fe5614a0 functests: Add missing wait() 2017-06-27 01:34:54 +03:00
ZyX
407abb3a6c eval,ex_getln: Add support for coloring input() prompts 2017-06-27 01:34:54 +03:00
ZyX
d82741f8c0 ex_getln: Add some more tests, fix some found errors 2017-06-27 01:34:54 +03:00
ZyX
3d25200127 functests: Start adding some tests 2017-06-27 01:34:54 +03:00
ZyX
c1d21e9dd6 ex_getln: Add basic support for coloring command-line prompt 2017-06-27 01:34:54 +03:00
ZyX
7db2f658e8 ex_getln: Do not do arabic shaping unless needed
Should speed up execution without arabic characters a bit, slowing down with 
arabic characters. More necessary, this allows coloring prompt without caring 
about arabic shaping at the first iteration.
2017-06-27 01:34:54 +03:00
ZyX
90f62cc749 ex_getln: Clean up draw_cmdline a bit 2017-06-27 01:34:54 +03:00
7955cf3515 vim-patch:7.4.2259
Problem:    With 'incsearch' can only see the next match.
Solution:   Make CTRL-N/CTRL-P move to the previous/next match. (Christian
            Brabandt)

4d6f32cbfb
2017-06-26 07:36:36 -04:00
2b377d89db scripts/pvscheck.sh: fix function rename 2017-06-25 07:53:27 +02:00
4b08b5d194 scripts/pvscheck.sh: HACK: de-parallelize on CI
https://github.com/neovim/bot-ci/pull/105#issuecomment-309282132
2017-06-25 07:35:01 +02:00
a469704495 scripts/pvscheck.sh: HACK: de-parallelize on CI
References https://github.com/neovim/bot-ci/pull/105
2017-06-25 03:26:24 +02:00
ca385db4d0 Merge pull request #5266 from bfredl/kbtree
add kbtree_t and use it for bufhl
2017-06-24 13:46:48 +02:00
8b375cf471 bufhl: fix move 2017-06-24 11:09:10 +02:00
7873660e1e bufhl: some style cleanup 2017-06-24 11:09:10 +02:00
28a549d597 kbtree: make warning free and delete deprecated macros 2017-06-24 11:09:10 +02:00
14e19b8aaf kbtree: eliminate unneccesary heap allocation 2017-06-24 11:09:10 +02:00
53cf88c27b kbtree: use proper structs 2017-06-24 11:09:10 +02:00
6712e08bba kbtree: allow iterators to start at arbitrary position 2017-06-24 11:09:10 +02:00
1eff241ec6 bufhl: use kbtree for bufhl 2017-06-24 11:09:10 +02:00
0b6b03c472 kbtree.h 2017-06-24 11:09:10 +02:00
144f584948 Merge #6914 from ZyX-I/func-def-trailing-error
Allow multiple function definitions in one :execute
2017-06-21 23:56:00 +02:00
ZyX
476c28f433 functests: Fix screen.lua supplying dedent additional argument 2017-06-21 10:58:47 +03:00
ZyX
ae457ff64a functests: Check that minimal distance between commands works 2017-06-21 10:58:47 +03:00
ZyX
607dc3e0f9 functests: Add tests 2017-06-21 10:58:47 +03:00
ZyX
60c0252672 eval: Allow running next command after :endfunction
This will still error out on `:endfunction | next`, but defining many functions
in one `:execute` should be possible.
2017-06-20 18:36:17 +03:00
ZyX
d5839770ee functests: Refactor redir_exec 2017-06-20 18:17:47 +03:00
ZyX
e57d4eef88 functests: Move function_spec to eval 2017-06-20 18:17:47 +03:00
ZyX
bad5b2f8cf eval: Error out when there is something after :endfunction
Ref #6844
2017-06-20 18:17:47 +03:00
cb8e47c4f8 Merge #6863 2017-06-19 12:35:16 +02:00
dcbeefcd23 coverity/112076: fixing "Explicit null dereferenced"
if (oap->regname == 0 &&
   oap->motion_type != kMTLineWise &&
   oap->line_count == 0 &&
   !oap->use_reg_one    ){
    then reg is not initialised
    and our call to set_clipboard will dereference NULL
}
2017-06-20 14:47:12 +10:00
76ea97c809 coverity/155506: fixing "dereference null after check" (#6862)
rbuffer_read_ptr may return a null

if ptr == null && cnt == 0 && !out_data_decide_throttle(cnt)
    then we would have called out_data_append_to_screen(ptr, cnt, eof)
    which dereferences the null pointer.
2017-06-19 02:01:29 +02:00
26235bc050 genappimage.sh: set CMAKE_INSTALL_MANDIR
Avoids attempt to install manpage to system location.

Also:
- Don't attempt `nvim --version` until after it was built.
- Remove unnecessary `mkdir`.
2017-06-19 01:44:38 +02:00
694eb18e03 vim-patch:7.4.2356 (#6880)
Problem:    Reading past end of line when using previous substitute pattern.
            (Dominique Pelle)
Solution:   Don't set "pat" only set "searchstr".

ea683da58c
2017-06-19 01:13:32 +02:00
3a86dd54f3 Merge #6841 from alexgenco/ruby-host-prog 2017-06-17 23:56:23 +02:00
b160a8b5ba Merge pull request #6898 from blueyed/pvscheck-fixes
scripts/pvscheck.sh: fixes
2017-06-17 18:40:49 +00:00
45df8f77df scripts/pvscheck.sh: fixes
[ci skip]
2017-06-17 20:37:13 +02:00
9b98b959d1 runtime: Add docs for g:ruby_host_prog 2017-06-17 09:07:29 -07:00
f400c6f05f runtime: Allow overriding ruby host with g:ruby_host_prog
This allows users who have per-project Ruby versions (e.g. with `rvm`)
to pin to a particular gem installation.

For example: `let g:ruby_host_prog = 'rvm system do neovim-ruby-host'`
2017-06-17 08:20:00 -07:00
826210a465 runtime: Fix issue with Ruby health latest_gem determination
Sometimes the `gem list` command used for finding the latest version of
the `neovim` gem prints an error, which can throw off the `split()` call
due to extra parenthesis. This locks down the split pattern to make
conflicts less likely.
2017-06-17 08:20:00 -07:00
e8aa58934e Update deps (#6885)
* Update libuv to 1.12.0
* Update msgpack-c to 2.13
* Update LuaJIT to 2.0.5 (82151a45 for a Windows build fix)
* Update jemalloc to 4.5.0
* Update luv to 1.9.1-1
* Update gperf to 3.1
2017-06-17 03:17:34 +00:00
f8e3bc63ef Merge pull request #6860 from justinmk/coverity
coverity/155509: negative close() arg
2017-06-15 12:55:05 +00:00
8b976c413e Merge pull request #6896 from jamessan/clang-bump
ci: Bump clang version to 4.0
2017-06-15 11:14:16 +00:00
6efe84af68 provider/clipboard: add tmux support (#6894) 2017-06-15 09:15:56 +02:00
a4825ebd5c ci: Bump clang version to 4.0 2017-06-15 00:14:57 -04:00
cb75db4c18 coverity/155509: negative close() arg 2017-06-14 22:53:09 -04:00
7918845215 Merge pull request #6700 from bfredl/winhl
window specific ui highlighting: part 2
2017-06-14 20:32:16 +02:00
ad73a70e5a screen.c: fix lint 2017-06-14 20:31:14 +02:00
16ae369474 screen.c: make more highlights window specific 2017-06-14 20:31:14 +02:00
6650588c4a vim-patch:7.4.2190 (#6882)
Problem:    When startup test fails it's not easy to find out why.
            GUI test fails with Gnome.
Solution:   Add the help entry matches to a list an assert that.
            Set $HOME for Gnome to create .gnome2 directory.

50fa8dd00c
2017-06-12 00:44:21 +02:00
6eb2bcd1a0 scripts/vim-patch.sh: do not git-reset on push failure (#6878)
This was added from the beginning to submit_pr in 775a16b0b, but I
cannot see why that is useful - in contrast, it will mess with the local
branch in case "origin" cannot be pushed to (i.e. when it points to
neovim/neovim itself).
2017-06-11 16:25:13 +02:00
9f534f338a mksession: Restore tab-local working directory #6859
The ':tcd' command is the first tab-specific command written to the file
and it is wrapped inside an 'if has('nvim')' block to keep the session
file compatible with Vim.

Closes #6678
2017-06-11 15:51:53 +02:00
d0ff2000b2 vim-patch:8.0.0607 (#6879)
Problem:    When creating a bufref, then using :bwipe and :new it might get
            the same memory and bufref_valid() returns true.
Solution:   Add br_fnum to check the buffer number didn't change.

45e5fd135d
2017-06-11 15:03:02 +02:00
2c236fc67b tui: Track cursor visibility.
This fixes a test failure caused by dfaecb25f6a9a94f29a38d9f2d24a579b3dff5f
not tracking what the current visibility is and whether it matches the
current business state.
2017-06-10 09:00:15 +01:00
90f20bd7b1 pvscheck: Fix argument handling in do_recheck
[ci skip]
2017-06-09 16:42:43 -04:00
cdfaecb25f tui: Eliminate more extraneous control sequences.
When higher layers flush the TUI layer output buffer, but there is
nothing in the buffer to flush, no longer does the TUI layer write out
unnecessary cnorm/civis sequences surrounding that nothing.
2017-06-09 19:50:13 +01:00
6d35c5c7ec tui: Another linux terminfo capability fix
For the linux terminal type apply the same fixup to the terminfo civis
string that is applied to the cnorm string.
2017-06-09 19:33:17 +01:00
1a093c08d0 Merge pull request #6345 from brcolow/vim-7.4.2360
vim-patch:7.4.2360
2017-06-08 16:38:21 +00:00
edced212db vim-patch:7.4.2360
Problem:    Invalid memory access when formatting. (Dominique Pelle)
Solution:   Make sure cursor line and column are associated.

80c3fd7c55
2017-06-08 10:27:39 -04:00
16cce1ac17 Merge #6827 'Always enable logging' 2017-06-07 23:19:02 +02:00
d3d0c9a7b1 Merge pull request #5621 from jamessan/vim-7.4.1975
vim-patch:7.4.1975,7.4.1976,7.4.1977,7.4.1978,7.4.1979,7.4.1986,7.4.2029,7.4.2224,8.0.0219,8.0.0614
2017-06-07 14:05:46 +00:00
2b35f40fc1 doco: Adjust TERM and terminfo doco.
Use a table and adjust cursor-shape a bit.
2017-06-07 14:21:53 +01:00
ca1ba1085a lint 2017-06-06 21:38:31 -04:00
af59a290d8 *: Fix conversion warnings for tv_get_number*() 2017-06-06 21:38:31 -04:00
bf4de3f6f7 functests/msgpack: Correct representation of literal INT64_MIN
In order to generate INT64_MIN from literal values, it's necessary to
use "-0x7fffffffffffffff - 1".  Using "-0x8000000000000000" causes the
value to get clamped to INT64_MAX and then negated.
2017-06-06 21:38:31 -04:00
d69286c065 functests/msgpack: Use assert_equal() for more informative errors 2017-06-06 21:38:30 -04:00
601bf9642f strings/tv_float: Explicitly cast v_number to float_T for -Wconversion 2017-06-06 21:38:27 -04:00
bc025ab117 doc: *standard-path*, *$NVIM_LOG_FILE* 2017-06-07 00:40:13 +02:00
b4b09afabd test: iswin(): detect without nvim session 2017-06-07 00:27:26 +02:00
d07661b9a3 log: Fall back to CWD-relative .nvimlog
If if the resolved $NVIM_LOG_FILE *and* stdpath("data")/log cannot be
created (e.g. because the XDG data directory does not exist), fall back
to .nvimlog in the current direcrtory.
2017-06-07 00:27:26 +02:00
a49c92fc5b test: Set $NVIM_LOG_FILE to test-local path
- Do not delete it: may need to inspect it after tests finished.
- Avoids writing to stderr in cases where the test-local $XDG_DATA_HOME
  was not created yet.
2017-06-07 00:27:26 +02:00
bb96b8219d log: set $NVIM_LOG_FILE; fallback to $XDG_DATA_HOME/nvim/log 2017-06-07 00:26:56 +02:00
05cdbbc18b ga_append_via_ptr: fix log arguments 2017-06-07 00:26:22 +02:00
eb6dd3e42d ci: Dump $NVIM_LOG_FILE contents 2017-06-07 00:26:21 +02:00
fe1af9c2bc log: Always enable; remove DISABLE_LOG
- Establish ERROR log level as "critical". Such errors are rare and will
  be valuable when users encounter unusual circumstances.
- Set -DMIN_LOG_LEVEL=3 for release-type builds
2017-06-07 00:26:21 +02:00
698ec9eb6e loop_close: Avoid infinite loop, and log it.
Avoids a hang, and also helps diagnose issues like:

https://github.com/neovim/neovim/pull/6594#issuecomment-298321826
2017-06-07 00:26:21 +02:00
f83d733318 log: log_uv_handles 2017-06-07 00:26:19 +02:00
2109fb18e6 eval/typval: Convert string to varnumber_T instead of intermediate long 2017-06-06 07:56:03 -04:00
6757c503bd vim-patch:8.0.0614
Problem:    float2nr() is not exactly right.
Solution:   Make float2nr() more accurate.  Turn test64 into a new style test.
            (Hirohito Higashi, closes vim/vim#1688)

863e80b445
2017-06-06 07:39:33 -04:00
9281653233 Merge remote-tracking branch 'origin/master' into vim-7.4.1975 2017-06-06 07:33:50 -04:00
cb0abce5be Merge pull request #6854 from jamessan/vim-8.0.0156
vim-patch:8.0.0156,8.0.0158,8.0.0167,8.0.0168,8.0.0360,8.0.0477,8.0.0478,8.0.0176,8.0.0561
2017-06-06 11:26:07 +00:00
75c32b549b lint 2017-06-06 06:15:16 -04:00
9a21d89b17 vim-patch:8.0.0561
Problem:    Undefined behavior when using backslash after empty line.
Solution:   Check for an empty line. (Dominique Pelle, closes vim/vim#1631)

478af67dd6
2017-06-06 06:15:16 -04:00
5f8411b7bf vim-patch:8.0.0176
Problem:    Using :change in between :function and :endfunction fails.
Solution:   Recognize :change inside a function. (ichizok, closes vim/vim#1374)

70bcd7336f
2017-06-06 06:15:16 -04:00
d707b2a171 vim-patch:8.0.0478
Problem:    Tests use assert_true(0) and assert_false(1) to report errors.
Solution:   Use assert_report().

37175409d7
2017-06-06 06:15:16 -04:00
dafc14b969 vim-patch:8.0.0477
Problem:    The client-server test may hang when failing.
Solution:   Set a timer.  Add assert_report()

42205551b1
2017-06-06 06:15:16 -04:00
cb8efa4fef vim-patch:8.0.0360
Problem:    Sometimes VimL is used, which is confusing.
Solution:   Consistently use "Vim script". (Hirohito Higashi)

b544f3c81f
2017-06-06 06:15:16 -04:00
0088ed0f1a vim-patch:8.0.0168
Problem:    Still some float functionality is not covered by tests.
Solution:   Add more tests. (Dominique Pelle, closes vim/vim#1364)

872004132f
2017-06-06 05:07:14 -04:00
17d616037d vim-patch:8.0.0167
Problem:    str2nr() and str2float() do not always work with negative values.
Solution:   Be more flexible about handling signs. (LemonBoy, closes vim/vim#1332)
            Add more tests.

08243d26d2
2017-06-06 05:07:14 -04:00
b1d4ef2b42 vim-patch:8.0.0158
Problem:    On MS-Windows some float functions return a different value when
            passed unusual values.  strtod() doesn't work for "inf" and "nan".
Solution:   Accept both results.  Fix str2float() for MS-Windows.  Also
            reorder assert function arguments.

6247361101
2017-06-06 05:07:14 -04:00
09eefbe92c vim-patch:8.0.0156
Problem:    Several float functions are not covered by tests.
Solution:   Add float tests. (Dominique Pelle)

453b576ee5
2017-06-06 05:07:06 -04:00
45d92e2563 doc: clang scan-build 2017-06-06 04:03:24 +02:00
b22a61cdbb tui: Recognize "Tc" terminfo capability.
This is a new convention pioneered by tmux.  It does not do much for
nvim; since nvim always looks to see whether it should be making up
"setrgbf" and "setrgbb" capabilities.  But it is a way for terminfo to
force this, irrespective of the hardwired list in the code, for more
terminal types.  On the gripping hand, updating terminfo descriptions to
actually have "setrgbf" and "setrgbb" capabilities so that nvim never
has to try to invent them in the first place, is as good if not better
an approach for overriding what is baked into the code.
2017-06-05 22:47:44 +01:00
054b03e07a tui: Combine multiple attribute changes.
Use the terminfo set_attribute capability to set multiple attributes in one
control sequence, if it is available.
2017-06-05 22:12:53 +01:00
b3129b3791 eexe_mod_op: Explicitly cast varnumber_T to float_T for -Wconversion 2017-06-04 22:12:15 -04:00
eb5e4a2476 *: Disable UBSAN for VimL arithmetic implementation
After merging +num64, the 64-bit sanitizer builds show that Vim doesn't
buffer the user from C's UB in signed arithmetic.  Upstream doesn't
appear to be [interested] in fixing the issue, so suppress UBSAN until
someone decides to fix the problem.

N.B., the problem existed before but went unnoticed since the sanitizer
builds weren't being run in 32-bit mode.

[interested]: https://groups.google.com/d/topic/vim_dev/_tqf8eQy5eA/discussion
2017-06-04 22:12:15 -04:00
fb2b3f98bb func_attr: Allow disabling UBSAN for a function 2017-06-04 22:12:15 -04:00
43534cab02 lint 2017-06-04 22:12:14 -04:00
2fb0a62553 vim-patch:8.0.0219
Problem:    Ubsan reports errors for integer overflow.
Solution:   Define macros for minimum and maximum values.  Select an
            expression based on the value. (Mike Williams)

7a40ea2138
2017-06-04 22:12:14 -04:00
55c93ea164 vim-patch:7.4.2224
Problem:    Compiler warnings with older compiler and 64 bit numbers.
Solution:   Add "LL" to large values. (Mike Williams)

af9c4c9b57

Equivalent change was made in ZyX's typval refactoring.
2017-06-04 22:12:14 -04:00
c3efb2804a vim-patch:7.4.2029
Problem:    printf() does not work with 64 bit numbers.
Solution:   use the "L" length modifier. (Ken Takata)

38ee6b041e
2017-06-04 22:12:14 -04:00
9c01efd6fb vim-patch:7.4.1986
Problem:    Compiler warns for loss of data.
Solution:   Use size_t instead of int. (Christian Brabandt)

fef524bbff

Equivalent change had already been made when merging earlier pack
patches.
2017-06-04 22:12:14 -04:00
03f5f78792 vim-patch:7.4.1979
Problem:    Getting value of binary option is wrong. (Kent Sibilev)
Solution:   Fix type cast.  Add a test.

2acfbed9db
2017-06-04 22:12:14 -04:00
0164a5fea3 vim-patch:7.4.1978
Problem:    Large file test does not delete its output.
Solution:   Delete the output. Check size properly when possible. (Ken Takata)

c5af40ae64
2017-06-04 22:12:14 -04:00
481654a88b vim-patch:7.4.1977
Problem:    With 64 bit changes don't need three calls to sprintf().
Solution:   Simplify the code, use vim_snprintf(). (Ken Takata)

bde9810d61

nvim already had the equivalent code, so only the patch number was
needed.
2017-06-04 22:12:14 -04:00
81be7358be vim-patch:7.4.1976
Problem:    Number variables are not 64 bits while they could be.
Solution:   Add the num64 feature. (Ken Takata)

22fcfad292
2017-06-04 22:12:13 -04:00
953f26bace vim-patch:7.4.1975
Problem:    On MS-Windows large files (> 2Gbyte) cause problems.
Solution:   Use "off_T" instead of "off_t".  Use "stat_T" instead of "struct
            stat".  Use 64 bit system functions if available.  (Ken Takata)

8767f52fbf

Only the off_T changes are relevant, since all the "struct stat" usage
is abstracted by libuv.
2017-06-04 22:12:13 -04:00
018383096c oldtests: Fix syntax of s:flaky 2017-06-04 22:09:19 -04:00
239b0aaf2e tui: Remove the iTerm2 corner case. 2017-06-04 22:44:24 +01:00
997411b635 tui: Do not optimize left motion at the right margin.
From observation, there are several different possible behaviours:

1. Deferred wrap like a real DEC VT.  The cursor stays visible in the last
   column, and CUB is calculated relative to that column.
   Examples: xterm, Unicode rxvt, PuTTY, nosh console-terminal-emulator,
   FreeBSD kernel's built-in emulator, Linux's built-in emulator
2. Deferred wrap like a real DEC VT.  CUB is calculated relative to the last
   column.  But the cursor is invisible.
   Examples: emulators using newer libvte
3. Non-deferred wrap.  The cursor has already wrapped to the next line and CUB
   does not wrap back.
   Examples: cygwin, Interix
4. Non-deferred wrap that acts like deferred wrap.  The cursor has already
   visibly wrapped to the next line, but CUB can wrap back around the left
   margin.
   Examples: Konsole
5. Deferred wrap with visibly out of bounds cursor.  The cursor visibly moves
   outwith the screen boundaries.  CUB is calculated relative to a cursor
   column that has overflowed the end of the screen grid array.
   Examples: iTerm2
6. Deferred wrap with invisibly out of bounds cursor.  CUB is calculated
   relative to a cursor column that has overflowed the end of the screen grid
   array.  And the cursor is invisible.
   Examples: emulators using older libvte

In many cases, nvim does not have enough information to know which behaviour
the terminal will exhibit, and thus the correct amount of CUB to issue.
2017-06-04 21:18:44 +01:00
1b2acb8d95 Merge pull request #6807 from bfredl/attrindent
[RFC] lint: check indentation of FUNC_ATTR lines
2017-06-03 21:00:05 +02:00
15500dbd8f tui: Treat cygwin as an immediate-wrap terminal.
Alongside interix.
2017-06-03 18:53:29 +01:00
86d796656c tui: Correct commentary on tmux colour tests. 2017-06-03 18:53:29 +01:00
f6116eeaa3 tui: Add tmux to the always 256-colour capable list. 2017-06-03 18:53:29 +01:00
b604e3a086 tui: Add terminfo patches for linux on MacOS.
Also enable italics on Konsole when it is falsely claiming to be xterm.
Also note the reasons for some of the patcher terminfo patches.
2017-06-03 18:53:29 +01:00
ae7bb47b4f tui: Coding style changes only. 2017-06-03 18:53:29 +01:00
6fe839a688 tui: Do some deferred wrap on iTerm2.
Partly undo 8ab08a65ba3bc9a44741a2ec9aa81fbcc77467fb.  Further testing
by Enrico Ghirardi suggests limiting the non-deferred automatic wrap to
only the bottom line, whose rightmost column is not printed for iTerm.
2017-06-03 18:53:29 +01:00
9475cf2cc6 screen: Correct commentary.
This "trick" is not conditional upon the type of UI.
2017-06-03 18:53:29 +01:00
98907c57ae tui: Several minor tweaks per commentary and 256-colourize PuTTY.
* Don't use &data->grid when we already have grid .
* Consolidate into a single assignment to the default_attr flag.
2017-06-03 18:53:29 +01:00
b672035ff5 tui: Coding style changes only 2017-06-03 18:53:29 +01:00
7cbf52db1b tui: Separate out built-in terminfo records.
They are now in their own nvim/tui/terminfo.c file.

Also turn the TERMINAL_FAMILY macro into a function.  Use the terminfo_
prefix for its name as other parts of the program are unlikely to want
that namespace, and the prefix is already used for some other TUI
functions.
2017-06-03 18:53:29 +01:00
94d00d9473 doco: Add some guidance on up-to-date terminfo. 2017-06-03 18:53:29 +01:00
a2aba3f2f1 tui: Handle a corner case for rare terminals.
Terminals that do not defer automatic right margin wrap cannot print
characters in the bottom right corner without immediately scrolling.
2017-06-03 18:53:29 +01:00
1903fb5de0 tui: Make iTerm2 have no deferred wrap.
Testing by Enrico Ghirardi and review of the source indicates that
iTerm2 is a second terminal emulator that does not defer automatic wrap
at the right margin.
2017-06-03 18:53:29 +01:00
63fd561815 tui: Fix OBOE in linux cnorm capability fixup code. 2017-06-03 18:53:29 +01:00
1aba6c607b tui: Change screen status line back to hardstatus.
Reverse the change in c11c60325a2baba94abe6bdfa1c11afe28c16661.
2017-06-03 18:53:29 +01:00
c201518674 doco: Correct :help term-dependent-settings .
The example used &term which is no longer meaningful.
Fortunately, we can change this into a useful example using $TERM that also
shows how to address a common need with termguicolors at the same time.
2017-06-03 18:53:29 +01:00
4408bd28cb tui: Char signedness fix for the big blocks of (signed) numbers. 2017-06-03 18:53:29 +01:00
1b008be1e6 tui: Correct to_status_line for screen.
PM...ST actually sends the string to screen's message area.  Sending the
string to the status line requires a different control sequence peculiar to
screen.

Also make iTerm2 SGR 38/48 consistent.
2017-06-03 18:53:29 +01:00
c2a0fd349e doco: Move TERM help into its own section and expand.
:help TERM previously pointed to a section that no longer even discussed the
variable.
2017-06-03 18:53:28 +01:00
533f5c38c4 doco: Note some common $TERM mistakes and how to fix them.
Also explain more clearly the difference between Vim and Nvim
when it comes to built-in terminfo entries.
2017-06-03 18:53:28 +01:00
1c1231bf13 tui: Add built-in terminfo entry for VTE.
Also slightly refactor the way in which GNOME/MATE Terminal pretending to be
xterm is detected.
2017-06-03 18:53:28 +01:00
32396b5879 tui: Perform length safety check in comparison macros. 2017-06-03 18:53:28 +01:00
41403c6d25 tui: Treat genuine Xterm and iTerm.app as standards-conformant.
They both can handle SGR control sequences in the form set out in
ISO 8613-6:1994/ITU T.416:1993.
2017-06-03 18:53:28 +01:00
5265ac5000 tui: Change terminal family recognition to avoid '+' entries.
The terminfo commentary states that these are not standalone
entries suitable for end-use.
2017-06-03 18:53:28 +01:00
5377de33ac tui: Add st to the always 256-colour capable list.
Also comment and augment some terminal colour tests.
2017-06-03 18:53:28 +01:00
3f8dedd7ae tui: Correct a copy and paste error in stterm tests.
The test decsription was correct; the test was not.
2017-06-03 18:53:28 +01:00
24db94b1a6 tui: Fix Interix and account for deferred wrap.
The Interix termcap entry is missing the carriage_return capability which nvim
relies upon.  And Interix is one of the few terminal emulators that does not
defer automatic wrap at the right margin, which is now accounted for when
moving the cursor left and when outputting whole lines at a time.
2017-06-03 18:53:28 +01:00
0d53767274 tui: Add iTerm and rxvt to the terminals that know extended DECSCUSR. 2017-06-03 18:53:28 +01:00
8f60395dd1 tui: Update colour tests some more. 2017-06-03 18:53:28 +01:00
6910bfee0f tui: Correct error in terminfo extension processing.
Using the right unibilium query function then revealed a latent NULL pointer
problem.
2017-06-03 18:53:28 +01:00
1f3b5e1a82 tui: Correct error in terminfo extension processing.
Using the wrong unibilium query function just happened to work with the
various terminfo records used in local testing.
2017-06-03 18:53:28 +01:00
8768b7f4a0 tui: Remove now-unused flag variable.
Follows on from fcf0d13f48bffbd41749069ce383d01153dd960c.
2017-06-03 18:53:28 +01:00
e6cbb01b55 tui: Update colour tests. 2017-06-03 18:53:28 +01:00
a2434aeddb tui: Remove tmux wrapper from the Konsole path.
tmux has its own code path, now; and the tmux wrapping was not the ideal thing
to do in the first place.

Also improve the commentary on the built-in terminfo records.
2017-06-03 18:53:28 +01:00
16300d02c7 tui: Improvements to RGB colour support.
The details are in the on-line help under :help true-color .

The brief precis is that nvim is (I hope.) converging with tmux and libvte.
It is taking the same approach with setrgbf and setrgbb terminfo capabilities
that it does with the Ss and Se terminfo capabilities.
2017-06-03 18:53:28 +01:00
67e2120459 tui: Refactor built-in teminfo records.
No change to their contents, but make the Big Blocks Of Numbers half as wide
but twice as deep, in order to accomodate house style.
2017-06-03 18:53:28 +01:00
9e9ffeb5eb tui: Update fallback terminfo records.
Replace the 8-color xterm from unibilium with the 256-colour one from terminfo.
Add a fallback record for suckless terminal.
2017-06-03 18:53:28 +01:00
503a5c458b tui: Spelling corrections in doco and commentary 2017-06-03 18:53:28 +01:00
74472f7b2b tui: Fix conflict with predefined "linux" macro. 2017-06-03 18:53:27 +01:00
756a17a848 doco: Replace termcap with terminfo where appropriate.
Also document better what to do on slow terminals.
2017-06-03 18:53:27 +01:00
76a6509c59 tui: More refactoring, and improvements to cursor shape support.
The details are in the on-line help under :help cursor-shape .

The brief precis is that nvim is following the lead of tmux, and going
beyond what tmux does to make cursor shape changes work on a broad range of
terminals.  This includes on tmux itself, which is no longer bypassed.
2017-06-03 18:53:27 +01:00
03683c375c tui: Disable interference in guicursor by higher layers.
Ironically, higher layers trying to be "smart" about the terminal type
but not actually being very smart at all, makes it more difficult rather
than less to correct the TUI layer.

Note that this orphans the os_term_is_nice() function and down the road,
presuming that we do not have to revert this, that function can be removed.
It incorporates knowledge of terminal types and behaviours in the wrong place.
2017-06-03 18:53:27 +01:00
3d8e0594e4 tui: Split fix_terminfo() up and refactor.
There are now a few built-in terminfo entries, taken either from unibilium
or ncurses terminfo, for falling back upon when there is no terminfo database
or when it is missing stuff.  In an ideal world, these would be in unibilium
itself.

The ultimate fallback, for no terminfo database and no built-in terminfo
record that matches the terminal type, is now the "ansi" terminal type; so
unknown terminal types are now considered to have at minimum the basic
ECMA-48 colour, motion, and editing capabilities.

The terminfo records are just blobs, raw images of the equivalent terminfo file
created with the od command.  No longer are incomplete terminfo records built
up with code.  These blobs are the full, real, records; already built.

The post-processing of the terminfo record, once found, is split into the
part where we fix known errors and deficiencies in terminfo, and the part
where we add extensions that we need that terminfo does not define
capabilities for.  In an ideal world, the former would be a no-op.

No part of the TUI layer apart from these is aware of terminal type or has
conditional code based upon checking environment variables at runtime.  It
is all pre-calculated and written into unibilium (or the TUIData object) at
initialization time.

This is fairly aggressive about turning on 256-colour and true colour support.

This also positively decodes genuine xterm for turning on DECSLRM use, rather
than assuming that anything that says that it is xterm is actually xterm,
fixing scrolling problems with vertically split windows.
2017-06-03 18:53:27 +01:00
d65cff9de8 doc: Document some more terminal behaviours.
This documents 256-colour and true colour handling, cursor shapes,
and scrolling regions.

Almost all of these headings are taken from the Vim doco, so that
the :help commands that people learn are a transferable skill.
2017-06-03 18:53:27 +01:00
6be921b71c doc: Relegate xterm-8bit to a removed feature. 2017-06-03 18:53:27 +01:00
ede4d620de tui: Fix cursor motion clear screen bug visible on line #1 in redraws.
The clear_screen capability moves the cursor position.
This needs to be accounted for.
2017-06-03 18:53:27 +01:00
d077a161ee tui: Coding style changes only
Per warnings about house style from automated tools.
2017-06-03 18:53:27 +01:00
e826ec0b0e tui: Optimize more cursor motions
A slight improvement on the CR optimization for some edge cases.
2017-06-03 18:53:27 +01:00
5b07ca1dfd tui: Use what scrolling PuTTY has.
PuTTY does not implement DECLRMM or DECSLRM, but it does implement DECSTBM.
So allow using PuTTY terminal scrolling when the scroll rectangle is the
full width of the terminal.
2017-06-03 18:53:27 +01:00
dbc25f5a87 tui: Optimize cursor motions
Instead of emitting CUP in several places each with their own poor local
optimizations, funnel all cursor motion through a central place.

This central function performs the same optimization for every place that
needs to move the cursor, and implements a better set of optimizations:

* Emit CUU/CUD/CUF/CUB instad of CUP when they are likely shorter.
* Use BS and LF when they are shorter than CUB and CUD.
* Use CR for quick returns to column zero.
* If printing the next few characters is shorter than a rightwards motion,
  then just write out the characters.
2017-06-03 18:53:27 +01:00
d711bb84e6 tui: Eliminate superfluous SGR resets.
Track whether the terminal is in no attribute mode, assuming that it starts
this way, and do not attempt to reset back to that mode if already in it.
2017-06-03 18:53:27 +01:00
5e5914655b tui: document fix_terminfo()'s several tasks 2017-06-03 18:53:27 +01:00
7821eef258 Separate 16- and 256- colour control sequences and tidy up some redundancy. 2017-06-03 18:53:27 +01:00
d5468d3cde Change TUI resize to use an extended terminal capability.
... rather than hardwiring the string and testing the terminal
type every time the screen is re-sized.
2017-06-03 18:53:27 +01:00
3f553ac0b9 lint: fix indentation of FUNC_ATTR lines 2017-06-03 08:17:22 +02:00
f3d8502115 clint: check FUNC_ATTR lines to have 2-space indent 2017-06-03 08:17:22 +02:00
fd07250e6c doc: README.md (#6839) 2017-06-02 23:45:32 +02:00
838277e28a test: fix bashisms (#6791) 2017-06-01 00:46:00 +02:00
133f8bc628 Merge #4700 from AdnoC/keep-default-register 2017-05-31 23:43:40 +02:00
c1026ff4b3 build: LuaRocks 2.4.2 #6059
LuaRocks 2.3 and onwards changed the /P option to no longer include the
version number which made newer releases of LuaRocks fail when compiling
on Windows.
2017-05-31 23:13:47 +02:00
2f2eeb19ba shada: Add default value for is_unnamed 2017-05-31 13:31:06 -04:00
745bac562d eval.c: Ignore unnamed register error in f_setreg
The error case is already handled and an appropriate error message is
already printed.
2017-05-31 13:31:06 -04:00
5908f562df test: Fix and add cases for unnamed register
Also:

Add ru to shada tests with all keys

Add test for unset unnamed and register 0
2017-05-31 13:31:05 -04:00
0c3dea5c4d style/lint 2017-05-31 13:31:01 -04:00
336412e1db shada/linting: Moved some code out of shada_write.
shada_write was too long (over 500 lines) and caused a linting error.
Register initialization was moved to its own function in order to save lines.
2017-05-31 13:19:09 -04:00
beca4dc16c eval/shada: Add testing for unnamed register with setreg and startup 2017-05-31 13:19:08 -04:00
9a91ce4fa6 eval: Add ability to set the unnamed register with setreg 2017-05-31 13:19:08 -04:00
a00b03d03f shada: Set the unnamed register to the previous unnamed register on startup 2017-05-31 13:18:59 -04:00
fcc9d99967 channel_write: fix compiler warning 2017-05-31 14:10:04 +02:00
033b1cb7d9 'pastetoggle': Revert support for multi-key value (#6724)
Reverts commit 337b6179df

Closes #6716 at the expense of not being able to use a
multi-key 'pastetoggle' manually.

Multi-key 'pastetoggle' can still be used when inserting the entire
option into the typebuffer at once (though the use here is
questionable).

Also remove those tests to do with waiting for the completion of
'pastetoggle' and mention in the documentation that 'pastetoggle'
doesn't wait for timeout.
2017-05-31 13:20:06 +02:00
43f40b8e1a Merge pull request #6740 from oni-link/fix.snprintf
if_cscope: Fix truncation of formated output
2017-05-30 00:47:27 +00:00
1b7a9bf4d2 Merge pull request #6594 from bfredl/sockopen
connect to socket (RPC only for the moment)
2017-05-29 20:33:00 +02:00
5a151555c8 sockets: don't deadlock when connecting to own pipe address 2017-05-29 19:02:49 +02:00
6a75938758 channels: implement sockopen() to connect to socket
Helped-By: oni-link <knil.ino@gmail.com>
2017-05-29 19:02:49 +02:00
ZyX
cab3a248b2 doc: Clarify documentation 2017-05-28 23:55:51 +03:00
ZyX
a409fa2b3f lua: Use automatic determining of suffixes only for package.cpath 2017-05-28 23:55:51 +03:00
9cc185dc6d Merge pull request #6680 from mhinz/listen/localhost
Use uv_getaddrinfo() for servers
2017-05-28 13:26:06 +00:00
62d020aba1 socket_watcher_start: Silence conversion warning for sin(6)_port
Although in_port_t is a typedef for uint16_t, GCC in Ubuntu 12.04
complains about potential loss of data due to converting int to
uint16_t.  Since we know this isn't possible, silence the warning to
avoid breaking QB until it gets upgraded to a newer Ubuntu.
2017-05-28 07:14:49 -04:00
6c135b89ee eval: serverstart: Return finalized address to user
In the process of setting up the socket watcher, the address may be
changed (e.g., adding the OS-selected port).
2017-05-28 07:14:49 -04:00
eb71bbb1da vim-patch:8.0.0605 (#6821)
Problem:    The buffer that quickfix caches for performance may become
            invalid. (Daniel Hahler)
Solution:   Reset qf_last_bufref in qf_init_ext(). (Daniel Hahler,
            closes vim/vim#1728, closes vim/vim#1676)

6dd4a53502
2017-05-28 13:01:46 +02:00
1cf377f23a Merge #6777 from justinmk/bsd 2017-05-28 02:37:07 +02:00
3f85c2e43a Server: Call uv_getaddrinfo with NULL service when no port
When using serverstart("ip.ad.d.r:") to listen on a random port, we need
to abide by getaddrinfo()'s API and pass in a NULL service, rather than
an empty string.

When given an empty string, getaddrinfo() is free to search for a
service by the given name (since the string isn't a number) which will
fail.  At least FreeBSD does perform this lookup.
2017-05-27 20:27:33 -04:00
a84926763f install: bsd: install manpages to /usr/local/man
https://svnweb.freebsd.org/ports/head/editors/neovim/Makefile?revision=428479&view=markup#l28

Closes #6771
2017-05-27 21:42:10 +02:00
023f67cad8 terminal: Do not change 'number', 'relativenumber' (#6796)
Showing the 'number' column in terminal buffers is a bit silly because
of 'scrollback'. But it's mostly harmless and technically works as
expected.

The least surprising thing is to leave the user's settings alone. Since
there are tradeoffs in both cases, we choose inertia.

We still disable 'relativenumber' in *terminal-mode* (as opposed to
normal-mode) because it is totally broken: the Nvim cursor (not terminal
cursor) is always on the last line.
2017-05-27 15:08:38 +02:00
967e892cb6 man.vim: feature-test section (-s) flag #6815
Different implementations of `man` might be using different
flags for sections.
2017-05-26 00:30:40 +02:00
ZyX
58f6ef50a8 ci: Also lint lua code in src/nvim/lua 2017-05-25 16:50:06 +03:00
ZyX
5b84c21182 cmake: Rename RunTestsLint to RunLuacheck 2017-05-25 16:34:04 +03:00
ZyX
643d620164 doc: Add example plugin 2017-05-25 16:27:40 +03:00
ZyX
97602371e6 lua: Add paths from &runtimepath to package.path and package.cpath 2017-05-25 16:27:40 +03:00
7a1a3a1258 build: Default BUSTED_OUTPUT_TYPE to "nvim" (#6811) 2017-05-25 14:51:53 +02:00
45626de63f get_keymap API (#6236)
* Add api function get keymap

nvim_get_keymap(mode)
nvim_buf_get_keymap(buffer, mode)
2017-05-25 12:41:53 +02:00
2dc27a8a78 shada: Remember whether "0 or "1 was the unnamed register
Ref #4645
2017-05-24 14:17:19 -04:00
f4fddbfb77 Merge #6799 from justinmk/tui-dtterm 2017-05-24 02:00:27 +02:00
133ae5eeef tui: Improve scrolling mechanism.
Respect the BGE flag from terminfo rather than guessing that it is
always off. Emit DECLRMM and DECSLRM (or equivalent) to properly define
the scroll rectangle.
2017-05-23 21:55:15 +02:00
0de7b17d03 tui: Reset the scroll region when resizing.
DECSLPP is explicitly documented as not affecting the scroll region. The
dtterm extension is not as well documented, but it is safer than not to
assume that it operates similarly.

This also eliminates a pointlessly repeated test from tui_scroll(). It
additionally uses a non-parameterized DECSTBM sequence when attempting
to reset back to whole-screen scrolling.
2017-05-23 15:35:47 +02:00
593af64943 tui: resize: use an extended terminal capability
... rather than hardwiring the string and testing the terminal
type every time the screen is re-sized.
2017-05-23 15:35:16 +02:00
36d1fd0602 tui: Only use dtterm's extension where supported.
This limits the use of dtterm's extension to DECSLPP to only those
terminal types where it is known to be supported.
Because it can be potentially understood as genuine DECSLPP
sequence, setting the number of lines to a number larger than 25,
which of course can cause confusion (especially if it is the width
parameter that results in this) only use it on terminals that are
known to support the dtterm extension.

rxvt (Unicode) also understands dtterm's extension.
2017-05-23 15:24:34 +02:00
c4a8950281 Merge pull request #6790 from justinmk/oldtest
oldtests: Mark Test_lambda_with_timer as flaky
2017-05-22 22:05:56 -04:00
41fd278317 oldtests: Mark Test_lambda_with_timer as flaky 2017-05-23 00:44:21 +02:00
41f27ae3f3 doc
Closes #6788
2017-05-23 00:25:15 +02:00
620df53860 doc: *Terminal-mode* #6757
Closes #6756
2017-05-23 00:08:24 +02:00
156e6f274f Doc: explain the format for serverstart() 2017-05-22 23:38:09 +02:00
fd5e4e2e4c Server: don't fall back to Unix sockets 2017-05-22 23:38:09 +02:00
ZyX
a5a5c83608 api/vim: Fix nvim_list_runtimepaths
It used to

1. Always omit last component in runtimepath.
2. Always omit trailing empty item and leave uninitialized memory in place of 
   it.
2017-05-23 00:16:23 +03:00
7b55d50bbd tui.c: Initialize TUI input component only once. (#6784)
term_input_start should be called only once. This fixes a leak
introduced by af2e629be4.

Closes #6780

Steps to demonstrate memory leak:

    CC=clang CFLAGS=" -O0 -g -DEXITFREE " cmake .. -DMIN_LOG_LEVEL=0 -DCMAKE_BUILD_TYPE=Debug -DBUSTED_OUTPUT_TYPE=nvim -DCMAKE_INSTALL_PREFIX=$PWD/root -DCLANG_ASAN_UBSAN=ON -DPREFER_LUAJIT=false
    nvim -u NONE -i NONE --cmd $'function S()\nsuspend\nendfunction' --cmd 'inoremap <expr> X S()' --cmd 'call feedkeys("iX", "t")'
    fg<CR><Esc>:cq<CR>

```
=================================================================
==25050==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 4159 byte(s) in 1 object(s) allocated from:
    #0 0x4f6a30 in calloc /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:72
    #1 0xf8d222 in xcalloc /home/zyx/a.a/Proj/c/neovim/src/nvim/memory.c:147:15
    #2 0x1349d28 in rbuffer_new /home/zyx/a.a/Proj/c/neovim/src/nvim/rbuffer.c:24:17
    #3 0xa6867b in rstream_init /home/zyx/a.a/Proj/c/neovim/src/nvim/event/rstream.c:42:20
    #4 0xa68651 in rstream_init_fd /home/zyx/a.a/Proj/c/neovim/src/nvim/event/rstream.c:28:3
    #5 0x1866451 in term_input_init /home/zyx/a.a/Proj/c/neovim/src/nvim/tui/input.c:55:3
    #6 0x187f049 in tui_terminal_start /home/zyx/a.a/Proj/c/neovim/src/nvim/tui/tui.c:223:3
    #7 0x187b491 in tui_main /home/zyx/a.a/Proj/c/neovim/src/nvim/tui/tui.c:258:3
    #8 0x18b3171 in ui_thread_run /home/zyx/a.a/Proj/c/neovim/src/nvim/ui_bridge.c:124:3
    #9 0x7f54c2d5f39b  (/lib64/libpthread.so.0+0x739b)

Direct leak of 4159 byte(s) in 1 object(s) allocated from:
    #0 0x4f6a30 in calloc /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:72
    #1 0xf8d222 in xcalloc /home/zyx/a.a/Proj/c/neovim/src/nvim/memory.c:147:15
    #2 0x1349d28 in rbuffer_new /home/zyx/a.a/Proj/c/neovim/src/nvim/rbuffer.c:24:17
    #3 0x1865a4a in term_input_init /home/zyx/a.a/Proj/c/neovim/src/nvim/tui/input.c:29:23
    #4 0x187f049 in tui_terminal_start /home/zyx/a.a/Proj/c/neovim/src/nvim/tui/tui.c:223:3
    #5 0x187b491 in tui_main /home/zyx/a.a/Proj/c/neovim/src/nvim/tui/tui.c:258:3
    #6 0x18b3171 in ui_thread_run /home/zyx/a.a/Proj/c/neovim/src/nvim/ui_bridge.c:124:3
    #7 0x7f54c2d5f39b  (/lib64/libpthread.so.0+0x739b)

Indirect leak of 7144 byte(s) in 62 object(s) allocated from:
    #0 0x4f6840 in malloc /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:64
    #1 0x7f54c231636c  (/usr/lib64/libtermkey.so.1+0x636c)

Indirect leak of 1500 byte(s) in 75 object(s) allocated from:
    #0 0x4f6840 in malloc /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:64
    #1 0x7f54c2316b34  (/usr/lib64/libtermkey.so.1+0x6b34)

Indirect leak of 704 byte(s) in 1 object(s) allocated from:
    #0 0x4f6840 in malloc /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:64
    #1 0x7f54c23129dd in _init (/usr/lib64/libtermkey.so.1+0x29dd)

Indirect leak of 520 byte(s) in 1 object(s) allocated from:
    #0 0x4f6c40 in realloc /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:77
    #1 0x7f54c2313b7c in termkey_register_keyname (/usr/lib64/libtermkey.so.1+0x3b7c)

Indirect leak of 256 byte(s) in 1 object(s) allocated from:
    #0 0x4f6840 in malloc /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:64
    #1 0x7f54c2313c3c  (/usr/lib64/libtermkey.so.1+0x3c3c)

Indirect leak of 48 byte(s) in 2 object(s) allocated from:
    #0 0x4f6840 in malloc /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:64
    #1 0x7f54c2313d9e  (/usr/lib64/libtermkey.so.1+0x3d9e)

Indirect leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x4f6840 in malloc /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:64
    #1 0x7f54c2316553  (/usr/lib64/libtermkey.so.1+0x6553)

Indirect leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x4f6840 in malloc /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:64
    #1 0x7f54c2315a2f  (/usr/lib64/libtermkey.so.1+0x5a2f)

Indirect leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x485ca8 in __interceptor_strdup /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/projects/compiler-rt/lib/asan/asan_interceptors.cc:562
    #1 0x7f54c2316bef  (/usr/lib64/libtermkey.so.1+0x6bef)

Indirect leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x485ca8 in __interceptor_strdup /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/projects/compiler-rt/lib/asan/asan_interceptors.cc:562
    #1 0x7f54c2316c0f  (/usr/lib64/libtermkey.so.1+0x6c0f)

Indirect leak of 4 byte(s) in 1 object(s) allocated from:
    #0 0x4f6840 in malloc /var/tmp/portage/sys-devel/llvm-3.9.1-r1/work/llvm-3.9.1.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:64
    #1 0x7f54c2316a26  (/usr/lib64/libtermkey.so.1+0x6a26)

SUMMARY: AddressSanitizer: 18574 byte(s) leaked in 149 allocation(s).
```
2017-05-22 17:26:26 +02:00
170d8af397 doc: on_stdout, on_stderr, onexit (#6761) 2017-05-22 16:57:16 +02:00
db0159be26 doc: update *feature-list*, remove "gui_running"
Closes #6783
2017-05-22 07:02:51 +02:00
afa781f420 Server tests: endpoint parsing in serverstart() 2017-05-22 01:05:40 +02:00
f913ba6e06 Server tests: use helpers.command() 2017-05-22 01:05:40 +02:00
3efc82cbb2 Server: use uv_getaddrinfo() for $NVIM_LISTEN_ADDRESS
This change implicitly adds IPv6 support.

If the address contains ":", we try to use a TCP socket instead of a Unix domain
socket. Everything in front of the last occurrence of ":" is the hostname and
everything after it the port.

If the hostname lookup fails, we fall back to using a Unix domain socket.

If the port is empty ("localhost:"), a random port will be assigned.

Examples:

  NVIM_LISTEN_ADDRESS=localhost:12345 -> TCP (IPv4 or IPv6), port: 12345
  NVIM_LISTEN_ADDRESS=localhost:      -> TCP (IPv4 or IPv6), port: random (> 1024)
  NVIM_LISTEN_ADDRESS=localhost:0     -> TCP (IPv4 or IPv6), port: random (> 1024)
  NVIM_LISTEN_ADDRESS=localhost       -> Unix domain socket "localhost" in current dir
2017-05-22 01:05:39 +02:00
17a46dc5e0 pty_process_unix.c: include <libutil.h> on DragonFly BSD
From FreeBSD ports patch:
https://svnweb.freebsd.org/ports/head/editors/neovim/files/patch-src_nvim_os_pty__process__unix.c?revision=425833&view=markup

References https://github.com/neovim/neovim/issues/6771#issuecomment-302921368
2017-05-21 13:47:39 +02:00
6255c4e053 build: FreeBSD: Disable -Wc11-extensions only for clang
From FreeBSD ports patch:
https://svnweb.freebsd.org/ports/head/editors/neovim/files/patch-CMakeLists.txt?revision=425833&view=markup

References #4363
2017-05-21 13:44:02 +02:00
9cc10c69f2 Merge #6775 from justinmk/doc 2017-05-21 13:38:59 +02:00
872465cf1d doc 2017-05-21 00:01:52 +02:00
bdd73fc07f api/nvim_replace_termcodes: Document keycodes behavior 2017-05-20 22:20:32 +02:00
bfb9cf1fc3 vim_getenv: Remove redundant NULL check. 2017-05-20 19:40:38 +02:00
6a7514feaa Merge pull request #6735 from justinmk/funcattr
clang 3.6+ REAL_FATTR_NONNULL_RET
2017-05-20 12:37:18 -04:00
bde46fdece Merge #6772 from ZyX-I/fix-pvs-errors 2017-05-20 17:07:35 +02:00
ZyX
7dc7d2f83f lua: Add PVS comment to lua/*.c 2017-05-20 05:06:55 +03:00
ZyX
c585a72cdc pvscheck: Provide arguments to patch_sources in correct order 2017-05-20 05:06:16 +03:00
ZyX
e14f678689 options: Silence V542 without using comments 2017-05-20 05:02:03 +03:00
ZyX
a052040430 options: Silence V542 the other way
Still does not work though.
2017-05-20 04:56:38 +03:00
ZyX
1dafe1e002 syntax: Silence V782
Just another pointer hack used with hash tables.
2017-05-20 04:47:01 +03:00
ZyX
a494bf847d tui: Fix V547: always true condition
The variable in question is initalized at the start of the function with
something non-NULL, specifically pointer to a static buffer.
2017-05-20 04:47:01 +03:00
ZyX
d9398982ea spellfile: Fix V547: always true condition
This condition was already checked at the surrounding if() at line 2422.
2017-05-20 04:47:01 +03:00
ZyX
c7c4aad387 tag: Silence V522: potential null dereference
Call PVS is referring to is using DT_FREE which will make function exit earlier,
in #ifdef EXITFREE block.
2017-05-20 04:47:01 +03:00
ZyX
b2265a0977 shada: Fix V581: adjacent branches with same condition 2017-05-20 04:29:54 +03:00
ZyX
8bd903cd51 search: Fix V502: ?: ambiguity 2017-05-20 04:28:21 +03:00
ZyX
5bea4906a2 options: Silence V542: odd casts for .def_val 2017-05-20 04:26:24 +03:00
ZyX
7d895ee053 memfile: Fix V547: always true condition
`blocksize` was checked against UINT_MAX after it was checked against 
MAX_SWAP_PAGE_SIZE which makes it always pass the check. Better use 
STATIC_ASSERT instead.
2017-05-20 04:21:00 +03:00
ZyX
40444e9186 main: Silence V522: potential NULL pointer dereference
AFAIK there is no way NULL can be there, including from the line it points to.
Dunno what analyser was thinking, but dereferencing of `argv[0]` happened just
before `get_number_arg()` call: in `ascii_isdigit()` two lines above. And `idx`
cannot possibly be NULL ever, it comes from `&varname`, this could not ever give
anything, but a valid pointer.
2017-05-20 04:21:00 +03:00
ZyX
9ec2bf26ce getchar: Eliminate two-iteration loop 2017-05-20 04:21:00 +03:00
ZyX
37a77506b0 eval: Silence V614: potentially uninitialized variable
Could not be uninitialized because `func_or_func_caller_profiling` is true only 
if `do_profiling` is `YES`, and if `do_profiling` is `YES` then 
`script_prof_save()` was called to initialize the variable.
2017-05-20 03:54:07 +03:00
ZyX
d9239181af eval: Fix V507 2017-05-20 03:51:19 +03:00
ZyX
98baea63ff eval: Silence V782 2017-05-20 03:49:36 +03:00
ZyX
1db29cb5e5 eval/encode: Silence V595 error 2017-05-20 03:47:01 +03:00
ZyX
7f24736ebc pvscheck: Handle invalid option error gracefully 2017-05-20 03:44:23 +03:00
ZyX
d72df05b93 pvscheck: Add --only-analyse mode 2017-05-20 03:35:50 +03:00
ZyX
a914029278 buffer: Silence V519 2017-05-20 03:28:44 +03:00
ZyX
956ef785f5 edit: Silence V595 2017-05-20 03:28:27 +03:00
ZyX
df67785886 *: Fix all V641 errors 2017-05-20 03:25:22 +03:00
ZyX
2411b6f137 charset: Fix V695: dead branches
Based on comments it appears that some non-printable characters intended to be 
shown as `|x` (0xA0..0xFE) and some as `~x` (0x80..0x9F, 0xFF, excluding 
previous). But this never happens because this is being catched by condition `c 
>= 0x80` above which makes them be represented as `<A0>`. Since I find this 
variant more useful and it additionally is backwards compatible (Vim does the 
same thing) I just dropped dead branches.
2017-05-20 03:21:18 +03:00
3280765f2d man.vim: check for -l flag #6766 2017-05-19 14:02:11 +02:00
060ce0e0bc startup: init v:progpath before calling vim_getenv (#6755) 2017-05-17 03:23:34 +02:00
96ede7c567 Merge pull request #6759 from jamessan/flaky-timers
oldtests: Mark test_timer's Test_oneshot as flaky
2017-05-16 20:24:11 -04:00
4a08320007 oldtests: Mark test_timer's Test_oneshot as flaky 2017-05-16 15:32:19 -04:00
597d65b4b7 Merge #6741 from justinmk/progpath 2017-05-15 16:11:01 +02:00
cc5a42a774 env_iter: Learn delim parameter. 2017-05-15 15:01:52 +02:00
5bda5c5bf2 vim_getenv: Use v:progpath instead of os_exepath. 2017-05-15 15:01:52 +02:00
4c5398bc40 startup: v:progpath fallback: path_guess_exepath
If procfs is missing then libuv cannot find the exe path.
Fallback to path_guess_exepath(), adapted from Vim findYourself().

Closes #6734
2017-05-15 15:01:52 +02:00
8e052f677e Merge #6737 "options: make 'highlight' read-only" 2017-05-15 14:53:31 +02:00
8d8b6224d9 options: make 'highlight' read-only 2017-05-15 07:22:31 +02:00
6e4e70f51b ci: Enable staged builds (#6739)
This should better allow distributing the load among PRs, while getting
critical feedback to the submitter sooner.

First stage runs the ASAN/UBSAN/TSAN since any failures in those are
gating issues.

Second stage runs the rest of the normal builds in parallel.

Remaining stages provide lower priority feedback.  The lint build runs
fast locally, so it's better to run that locally than wait on CI.  The
coverage build is pretty fickle, so it is only run once all other jobs
are green.
2017-05-14 06:46:30 +02:00
17531ed082 Merge #6480 from ZyX-I/colored-cmdline'/input-dict 2017-05-13 21:17:33 +02:00
ZyX
d01f140bb3 doc: Add a note to vim_diff.txt 2017-05-13 18:16:41 +03:00
7383274f66 cmake: Support building without LuaJIT. #6736
Compile `nvim` executable against Lua if PREFER_LUA=ON.

As the testing library `nvim-test` requires LuaJIT, it is
still compiled against LuaJIT. If LuaJIT is not available,
`nvim-test` is not built.
2017-05-13 16:59:06 +02:00
ZyX
a59ddde721 functests: Reword regression test headers 2017-05-13 17:07:31 +03:00
ZyX
9906db985d functests: Remove “correctly” from non-regression tests 2017-05-13 17:04:54 +03:00
ZyX
d66ef56739 eval/typval: Fix numbuf parameter documentation 2017-05-13 17:01:22 +03:00
244a1f97db Merge pull request #6704 from bfredl/luaexec
execute lua directly from the remote API
2017-05-13 15:06:41 +02:00
c77c54f1bc func_attr.h: use NVIM_HAS_ATTRIBUTE 2017-05-13 15:04:32 +02:00
8d98780932 func_attr.h: clang 3.7+: REAL_FATTR_NONNULL_RET
Closes #1627
2017-05-13 15:04:32 +02:00
9e5d55e2b0 path.c: Remove invalid FUNC_ATTR_NONNULL_RET
References https://github.com/neovim/neovim/pull/6514#issuecomment-301235265
2017-05-13 15:04:32 +02:00
f424189093 api: execute lua directly from the remote api 2017-05-13 15:03:42 +02:00
5886eaed7d if_cscope: Fix truncation of formated output
snprintf() has to truncate the string written to buffer buf for maximal
size_t value.

Increase buffer size to fix this.
2017-05-13 14:30:56 +02:00
ac47f8a506 Merge pull request #6514 from jamessan/gcc-7-fixes
Fix GCC 7 issues
2017-05-13 07:51:01 -04:00
ae3d5e5ecc Merge #6731 from ZyX-I/fix-oneline-script-skip 2017-05-13 11:32:23 +02:00
ZyX
19d38c4d0f functests: Replace check_provider -> missing_provider with err report 2017-05-13 03:06:50 +03:00
ZyX
50398e10fe ex_getln: Fix :lang code execution when skipping
Fixes #6727
2017-05-13 03:06:34 +03:00
ZyX
8b171b8c50 functests: Test invalid behaviour
Test correctly fail for oneline ruby, python and python3.
2017-05-13 03:06:30 +03:00
f3a508b4a3 oldtests: Fix spelling of testname in s:flaky 2017-05-12 17:32:26 -04:00
ad80a83a1a lint 2017-05-12 17:07:25 -04:00
901c8fbcdb regexp_nfa: Fix invalid fallthrough in character class detection
When the end character in a range matches a different standard range
(e.g., [0-z]), the range would be incorrectly detected as the class of
the end character (CLASS_az).

Instead of using a fallthrough, immediately FAIL when the end character
doesn't match the expected range.
2017-05-12 17:07:25 -04:00
5ec72aadbf *: Use __attribute__((fallthrough)) where comments aren't supported
Although GCC now detects possibly unintentional fall through, there
rules around which the comments are detected are rather strict.  In
cases where a comment isn't detected, upstream [recommends] using their
fallthrough attribute.

[recommends]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77817#c11
2017-05-12 17:07:25 -04:00
b43a3dbff8 Detect support for and use -Wimplicit-fallthrough 2017-05-12 14:41:51 -04:00
0ff959329b *: Comment intentional fallthroughs
Falling through a switch case should be commented so it's clear that
behavior is intentional.
2017-05-12 12:01:25 -04:00
d840ff7b70 ex_cmds: Use NULL, not NUL, to check for strrchr failure 2017-05-12 10:51:46 -04:00
63ad4caab5 os_unix: Mark mch_exit as NORETURN 2017-05-12 10:51:46 -04:00
77f8aebf41 func_attr: Support "noreturn" attribute 2017-05-12 10:51:46 -04:00
12fb634fe6 API version bump 2017-05-12 10:02:36 +02:00
edfe0980f1 doc: Lua (#6722)
Closes #6705
2017-05-11 17:45:11 +02:00
f57149d2f4 Merge #6721 from justinmk/health 2017-05-11 14:51:04 +02:00
147b4b63af doc (#6719)
Closes #6712
2017-05-11 14:34:48 +02:00
3eaf4a0d5b health.vim: Don't lose contents after hide. 2017-05-11 14:20:57 +02:00
73c6bf3879 health.vim: On error, show a valid shell command.
Helped-by: Nikolai Aleksandrovich Pavlov <kp-pav@yandex.ru>
Closes #6715
2017-05-11 14:20:57 +02:00
bc4fd8b10d health.vim: Fix hardcoded python name. #6714 2017-05-11 12:01:56 +02:00
ZyX
b6d73fb740 functests: Get rid of last redraws due to the “line above” issue 2017-05-11 12:15:41 +03:00
32b422cf90 ui_events: erase internal type HlAttrs (#6718) 2017-05-11 08:40:42 +02:00
ZyX
33ca9f711e functests: Remove outdated comments 2017-05-10 23:19:49 +03:00
ZyX
88d4a260e1 functests: Remove some redraw calls 2017-05-10 23:14:23 +03:00
ZyX
4c4f741aec functests: Remove all wait()s 2017-05-10 23:05:58 +03:00
031756c5e6 Merge pull request #6618 from bfredl/ui_event
generate UI remote event wrappers and add them to metadata
2017-05-10 17:39:09 +02:00
2d5920ae1a api: always use prefix FUNC_API, also change NOEVAL to REMOTE_ONLY 2017-05-10 17:37:34 +02:00
3adcc0c50b os/shell.c: temporary solution to not put ctrl chars on the screen grid 2017-05-10 17:36:34 +02:00
e82cb5de4a api: add metadata for ui events 2017-05-10 17:36:31 +02:00
7d6af9985c ui: cleanup UI_CALL wrappers
remove pointless control chars in the text stream
2017-05-10 16:14:12 +02:00
c778311505 generators: separate source generators from scripts 2017-05-10 16:14:12 +02:00
4eb781ce1d api: use generated events for popupmenu and tabline 2017-05-10 16:14:12 +02:00
489d10c57c api: generate ui events 2017-05-10 16:14:10 +02:00
ZyX
5e6f7e1d55 eval: Alter E5050 error message, test that 2017-05-10 15:52:49 +03:00
ZyX
475cd8f075 doc: Do not assume something is not supported in GUI 2017-05-10 15:52:49 +03:00
ZyX
f4d5d5250a eval: Refactor get_user_input to support dictionary 2017-05-10 15:52:48 +03:00
d9023b84e6 health.vim: Remove sensible.vim advice. (#6709)
sensible.vim now avoids setting ttimeoutlen for nvim.
2017-05-10 09:43:17 +02:00
c66fd37603 lua/converter: Fix typo in assert condition (#6708)
Ref https://github.com/neovim/neovim/pull/4411#issuecomment-300248206
2017-05-10 08:44:28 +02:00
d76a95824d Merge #6707 from ZyX-I/fix-strchr-invalid 2017-05-09 18:06:29 +02:00
ZyX
823b35e341 strings: Return NUL from vim_strchr for invalid input 2017-05-09 14:41:24 +03:00
ZyX
04e7eb1e29 tests: Add tests for vim_strchr 2017-05-09 14:41:23 +03:00
0e873a30f3 Merge #4411 from ZyX-I/luaviml'/lua 2017-05-09 00:39:17 +02:00
a9981e0e7e Merge pull request #6701 from ZyX-I/fix-ri-alias
CONTRIBUTING.md: Fix ri alias
2017-05-08 21:29:58 +03:00
ZyX
b4f0586596 CONTRIBUTING.md: Fix ri alias 2017-05-08 21:28:41 +03:00
ZyX
5b6d598ca8 functests: Fix tests 2017-05-08 21:21:03 +03:00
ZyX
85bf64da0a api/window: Fix memory leak in nvim_win_set_cursor 2017-05-08 20:55:00 +03:00
ZyX
577befef97 generators: Do not leak error messages text 2017-05-08 20:54:09 +03:00
e7a4d95a9e man.vim: Fix filename argument in mandoc #6693
Use the -l flag to open a man file.
TODO: Does not work on SunOS.

Fixes #6683
2017-05-08 17:45:06 +02:00
ZyX
db1155f713 cmake: Workaround CMake not supporting INCLUDE_DIRECTORIES target prop 2017-05-08 18:42:57 +03:00
8c8ea1f8f3 doc: nvim-from-vim: Prepend "~/.vim" #6694 2017-05-08 17:28:12 +02:00
b23aa1cf09 Merge #6597 'winhighlight' 2017-05-08 16:17:57 +02:00
4c3d7b29ec Merge #6595 from justinmk/term-refresh-on-exit 2017-05-08 15:18:08 +02:00
aace622ca5 refactor/single-include (#6687) 2017-05-08 15:08:12 +02:00
ZyX
09f849b600 Merge branch 'master' into luaviml'/lua 2017-05-08 15:43:45 +03:00
7c1a5d1d40 Revert "event/process.c: send SIGTERM directly (#6644)"
This reverts commit 34c3f03013.
2017-05-08 13:49:23 +02:00
a6f74debc0 terminal: refresh before on_exit. #5217
References #3030
References https://github.com/radenling/vim-dispatch-neovim/issues/6

The terminal is updated by a timer, but on_exit needs the final state.
Before this change, on_exit callback could see a stale terminal buffer.

Helped-by: oni-link <knil.ino@gmail.com>
2017-05-08 13:49:14 +02:00
a9605bb4af Merge #6460 from ZyX-I/1476-changes
Refactor functions which find character in a string
2017-05-08 13:45:14 +02:00
188bae586f docs: 'winhighlight' 2017-05-08 12:41:39 +02:00
ab48a3e9fd tests: add basic test for 'winhighlight` 2017-05-08 12:41:39 +02:00
bfcaf36404 options: allow different highlights in windows 2017-05-08 12:41:39 +02:00
443399c27d options: consolidate updates for window string options affected by copy_winopt
update note at options.c head about window options
2017-05-05 10:55:07 +02:00
631d55ada0 refactor/single-include (#6688) 2017-05-05 10:28:12 +02:00
34c3f03013 event/process.c: send SIGTERM directly (#6644)
Send SIGTERM to processes directly, instead of waiting for ~1s.

- removes TERM_TIMEOUT
- changes KILL_TIMEOUT to milliseconds
- removes Process.term_sent
2017-05-04 16:38:25 +02:00
052c2d0a0f tui: Also fix "linux*" terminfo entries. #6673
The terminfo entry for linux only advertises 8 colours, but nvim tries
to make it display 16 colours anyway, resulting in erroneous SGR control
sequences for colours 8 and above. The Linux kernel terminal emulator
itself has actually understood the 256-colour control sequences since
version 4.8 and the 16-colour control sequences since version 4.9. Thus
we apply the same terminfo fixup as we apply for *xterm* and *256*, to
emit the 16-colour and 256-colour control sequences even if terminfo's
setaf and setab do not advertise them.
2017-05-04 16:18:36 +02:00
3c0cc028b7 dist: AppImage #6638
scripts/genappimage.sh produces an executable:
    nvim-${NVIM_VERSION}-glibc${GLIBC_VERSION}-${ARCHITECTURE}.AppImage

Closes #6083
2017-05-04 14:43:41 +02:00
2e3b78d10b Merge #6670 from jamessan/conversion-overflow 2017-05-04 08:46:40 +02:00
b9dba14fa3 win: build: RelWithDebInfo 2017-05-03 20:28:54 -04:00
4f75e2f95c utf16_to_utf8: Allocate space for converted string and NUL
References #6646
2017-05-03 20:27:39 -04:00
2b3cb2c448 Make script_host.rb rubocop-clean
Fix the following issues according to rubocop:

    runtime/autoload/provider/script_host.rb:2:11: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
      require "neovim/ruby_provider"
              ^^^^^^^^^^^^^^^^^^^^^^
    runtime/autoload/provider/script_host.rb:5:5: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
        "Your neovim RubyGem is missing or out of date. " +
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    runtime/autoload/provider/script_host.rb:5:55: C: Use \ instead of + or << to concatenate those strings.
        "Your neovim RubyGem is missing or out of date. " +
    runtime/autoload/provider/script_host.rb:6:5: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
        "Install the latest version using `gem install neovim`."
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This commit assumes Ruby 2.0.0+.
2017-05-03 22:24:51 +02:00
53b38251bb build: OpenBSD: libuv does not use KVM, do not link to it. (#6663) 2017-05-03 20:16:06 +02:00
0502ac47fb 'guicursor': tui: Konsole: blinkon0 should disable blinking. 2017-05-03 18:08:54 +02:00
5fd1d09aa5 test/legacy: Add Test_with_partial_callback to s:flaky. (#6666) 2017-05-03 18:19:34 +02:00
685ca180f7 win: Terminal UI #6315
For CI builds unibilium is provided through msys2 packages, and
libtermkey is built from source in third-party from equalsraf/libtermkey.

In Windows we cannot read terminal input from the stdin file descriptor,
instead use libuv's uv_tty API. It should handle key input and encoding.

The UI suspend is not implemented for Windows, because the
SIGSTP/SIGCONT do not exist in windows. Currently this is a NOOP.

Closes #3902
Closes #6640
2017-05-03 12:48:24 +02:00
31e5053253 doc: README.md: PVS-studio badge (#6637) 2017-05-03 12:37:32 +02:00
de50c003d5 Use vim_strchr(s, c) when c may be NUL (#6656)
As part of the refactoring in #5119, some vim_strchr() were changed to
strchr().  However, vim_strchr() behaves differently than strchr() when
c is NUL, returning NULL instead of a pointer to the NUL.

Revert the strchr() calls where it isn't known whether c is NUL, since
this causes a semantic change the surrounding code doesn't expect.  In
the case of #6650, this led to a heap overrun.

Closes #6650
2017-05-03 10:12:38 +02:00
08b23d0806 Merge pull request #6653 from ZyX-I/pvs-fix-1
pvscheck: Use absolute path for finding test-include.c
2017-05-02 21:53:51 +03:00
ZyX
4f4d21693b pvscheck: Use absolute path for finding test-include.c
It was currently unknown in which directory create_compile_commands will end up 
in.

[ci skip]
2017-05-02 21:53:16 +03:00
249b37e2fb Merge #6647 from ZyX-I/pvs-deps 2017-05-02 18:22:54 +02:00
ZyX
0c6e0460b6 pvscheck: When using --recheck rerun build
[ci skip]
2017-05-02 18:40:51 +03:00
ZyX
3638d28f68 pvscheck: Add --deps to build with all dependencies
[ci skip]
2017-05-02 18:40:50 +03:00
ZyX
97806ee6d6 pvscheck: Add --pvs-install mode
[ci skip]
2017-05-02 18:40:50 +03:00
ZyX
68945ead63 pvscheck: Refactor script so that it only cds in a subshell
[ci skip]
2017-05-02 18:40:50 +03:00
ZyX
4cb61aa742 pvscheck: Create getopts_long implementation
Needed as argument list is growing large and I absolutely do not find short
options provided by getopts being particularly readable for unfamiliar commands.

[ci skip]
2017-05-02 18:40:22 +03:00
13ec521414 ci: DISABLE_LOG (#6498)
Should make builds slightly faster. We don't use these logs on CI.

References #6169
2017-05-02 15:04:47 +02:00
9b1cad7cb6 win/package: nvim-qt v0.2.7 (fixes cursor-shaping) (#6641) 2017-05-02 12:45:42 +02:00
1d4f8f6b6a Merge #6636 from ZyX-I/pvs-update 2017-05-02 12:00:35 +02:00
ZyX
15d39022ab pvscheck: Add --pvs key to pvscheck.sh
[ci skip]
2017-05-02 04:04:20 +03:00
ZyX
7fc3cccfaa pvscheck: Update pvs-studio URL
[ci skip]
2017-05-02 04:04:10 +03:00
ZyX
bcc97afbd2 pvscheck: Do not use test x
[ci skip]
2017-05-02 04:03:50 +03:00
1b0d573a65 version bump 2017-05-01 22:17:32 +02:00
52727d98d7 NVIM v0.2.0
FEATURES:
    bc4a2e1576 help, man.vim: "outline" (TOC) feature #5169
    58422f17d8 'guicursor' works in the TUI (and sends info to UIs) #6423
    129f107c0c api: nvim_get_mode() #6247
    0b59f988f4 api/ui: externalize tabline #6583
    bc6d868d00 'listchars': `Whitespace` highlight group #6367
    6afa7d66cd writefile() obeys 'fsync' option #6427
    c60e409471 eval.c refactor (also improves some error messages) #5119
    9d200cd0a3 getcompletion("cmdline") #6376
    2ea7bfc627 terminal: Support extra arguments in 'shell'. #4504
    bf5110266c DirChanged autocmd #5928 #6262
    1743df82f9 'cpoptions': "_" flag to toggle `cw` behaviour #6235
    22337b1c01 CTRL-R omits trailing ^M when pasting to cmdline #6137
    0e44916fff :edit allows unescaped spaces in filename #6119
    abdbfd26bc eval: Add id() function and make printf("%p") useful #6095
    bdfa1479d2 findfile(), :find, gf work in :terminal. #6009
    2f38ed11c9 providers: Disable if `g:loaded_*` exists.
    b5560a69b1 setpos() can set lowercase marks in other buffers #5753
    7c513d646d Throttle :! output, pulse "..." message. #5396
    d2e8c76dc2 v:exiting #5651

    :terminal improvements #6185 #6142
      - cursor keeps position after leaving insert-mode.
      - 4ceec30cd0 Follows output only if cursor is at end of buffer.
      - e7bbd35c81 new option: 'scrollback'
      - fedb8443d5 quasi-support for undo and 'modifiable'
      - b45ddf731b disables 'list' by default
      - disables 'relativenumber' by default

    :help now contains full API documentation at `:help api`.

    man.vim saw numerous improvements.

    Windows support:
      - Windows is no longer "experimental", it is fully supported.
      - Windows package includes a GUI, curl.exe and other utilities.

    "Vim 8" features: partials, lambdas.

SECURITY FIXES:
    CVE-2017-5953 CVE-2017-6349 CVE-2017-6350 #6485

CHANGES:
    NVIM_TUI_ENABLE_CURSOR_SHAPE was removed. Use 'guicursor' instead.
        See https://github.com/neovim/neovim/wiki/Following-HEAD#20170402

    81525dc5c3 'mouse=a' is no longer the default. (This will probably
                 change again after it is improved.) #6022

    0c1f783164 defaults: 'showcmd', 'belloff', 'ruler' #6087
    eb0e94f71b api: {get,set}_option update local options as appropriate #6405
    bdcb2a38b3 "Reading from stdin..." message was removed. #6298

FIXES:
    12fc1defd6 ops: fix i<c-r> with multi-byte text #6524
    dd391bfca1 Windows: system() and friends #6497
    13352c00f1 Windows: os_get_hostname() #6413
    16babc6687 tui: Less-noisy mouse seqs #6411
    3a9dd13f9e (vim bug) folding edge-cases  #6207
    f6946c68ae job-control: set CLOEXEC on pty processes. #5986
    d1afd434f3 rplugin: Call s:LoadRemotePlugins() on startup.
    1215084676 backtick-expansion works with `shell=fish` #6224
    e32ec03d67 tui: Improved behavior after resize. #6202
    86c2adc074 edit.c: CTRL-SPC: Insert previously-inserted text. #6090
    c318d8e672 b:changedtick now follows VimL rules #6112
    34e24cb2f7 terminal: Initialize colors in reverse order #6160
    e8899178ec undo: Don't set b_u_curhead in ex_undojoin() #5869
    d25649fa01 undo: :earlier, g-: Set b_u_seq_cur correctly. (#6016)
    043d8ba422 'Visual-mode put from @. register' #5782
    42c922b32c open_buffer(): Do `BufEnter` for directories.
    50d0d89129 inccommand: Preview :sub commands only after delimiter #5932
    1420e10474 CheckHealth improvements #5519
    c8d5e9230e jobstart(): Return -1 if cmd is not executable. #5671
2017-05-01 22:13:23 +02:00
9a1b144054 scripts/release.sh 2017-05-01 22:13:23 +02:00
62ab040fa4 doc: api 2017-05-01 18:52:56 +02:00
efea8a66b1 Merge #6632 from justinmk/doc 2017-05-01 18:37:14 +02:00
45ef3d9d0c doc: Replace hardcoded TOCs with <M-]> advice. 2017-05-01 17:48:06 +02:00
bc4a2e1576 help, man.vim: "outline" (TOC) feature #5169 2017-05-01 17:45:54 +02:00
cd190db8b3 Merge #6627 from ZyX-I/travis-folds 2017-05-01 17:23:45 +02:00
1483800cdf coverity/161682: FP: Dereference after null check (#6630) 2017-05-01 17:04:56 +02:00
ZyX
e4d0fa6e8d Do not trace in check_runtime_files 2017-05-01 17:38:21 +03:00
ZyX
1109ca7198 ci: Use \{1,\} in place of \+ 2017-05-01 17:36:45 +03:00
cc29827bc2 doc/eval.txt: remove references to E706 (#6629)
Removed in Vim in 7.4.1578 (975b5271) and 7.4.1546 (f6f32c38b).
2017-05-01 15:37:24 +02:00
ZyX
48fa42153a ci: Fold output in travis web interface 2017-05-01 16:36:24 +03:00
a2c2fa68c1 Merge #6625 from justinmk/vim-runtime 2017-05-01 15:18:34 +02:00
fa1ee0ac73 doc: bracketed-paste-mode 2017-05-01 14:55:26 +02:00
deccd843ed vim-patch:3df0173fa6d0
Updated runtime files.

3df0173fa6
2017-05-01 13:32:51 +02:00
ac107f7fdd vim-patch:690afe1fef87
Update runtime files.

690afe1fef
2017-05-01 13:23:12 +02:00
eb7ea6e122 vim-patch:369b6f57c426
Update runtime files.

369b6f57c4
2017-05-01 13:19:34 +02:00
44ea50cee4 vim-patch:68563937f58e
Updated runtime files.

68563937f5
2017-05-01 13:13:51 +02:00
4fbcfab127 vim-patch:bc2eada5424b
Updated runtime files.

bc2eada542

NA patches:
vim-patch:294740d2ac42
vim-patch:a4ce25bd987a
vim-patch:7034a8374345
vim-patch:14a612fa2e57
vim-patch:aaeabfbca571
2017-05-01 12:30:54 +02:00
940f35f664 vim-patch:cf49790443ee
Updated runtime files.

cf49790443

NA patches:
vim-patch:99c5eb4fd755
2017-04-30 22:16:30 +02:00
e5b640fdb8 vim-patch:c0514bf4777a
Updated runtime files.

c0514bf477
2017-04-30 22:10:21 +02:00
5d73a6e5df Merge pull request #6621 from jamessan/vim-7.4.2231
vim-patch:7.4.2231,7.4.2239,7.4.2244,7.4.2245,7.4.2246,7.4.2263,8.0.0150
2017-04-30 09:46:41 -04:00
4afc93b926 Merge #6588 from justinmk/guicursor 2017-04-30 14:36:40 +02:00
26a479ae41 Merge #6622 'api: Deprecate nvim_buf_get_number' 2017-04-30 14:27:21 +02:00
c1d3bcc184 'guicursor': TMUX_WRAP iTerm seqs. Do color seq before shape seq. 2017-04-30 13:44:31 +02:00
d349f610ac 'guicursor': No color/blink by default
Closes #6577
2017-04-30 13:44:31 +02:00
97126bfa02 api: deprecate obsolete nvim_buf_get_number function 2017-04-30 11:04:10 +02:00
35d817e68c oldfiles_spec: Add tests for ":filter ... oldfiles" 2017-04-29 23:58:03 -04:00
4488bfcfb3 oldfiles_spec: Set the shada file in the session 2017-04-29 23:48:28 -04:00
2b191ac5b9 lint 2017-04-29 23:48:28 -04:00
b6e36558d1 vim-patch:8.0.0150
Problem:    When the pattern of :filter does not have a separator then
            completion of the command fails.
Solution:   Skip over the pattern. (Ozaki Kiichi, clodes vim/vim#1299)

7069bf18e1
2017-04-29 23:48:28 -04:00
f219657453 vim-patch:7.4.2263
Problem:    :filter does not work for many commands.  Can only get matching
            messages.
Solution:   Make :filter work for :command, :map, :list, :number and :print.
            Make ":filter!" show non-matching lines.

d29459baa6
2017-04-29 23:48:27 -04:00
ab50c1fdb7 vim-patch:7.4.2246
Problem:    Oldfiles test fails.
Solution:   Include missing changes.

d6f2ee32dc
2017-04-29 23:48:27 -04:00
f477c23c62 vim-patch:7.4.2245
Problem:    Filter test fails.
Solution:   Include missing changes.

77401add71
2017-04-29 23:48:27 -04:00
7bd97127b4 vim-patch:7.4.2244
Problem:    Adding pattern to ":oldfiles" is not a generic solution.
Solution:   Add the ":filter /pat/ cmd" command modifier.  Only works for some
            commands right now.

7b668e83d0
2017-04-29 23:48:27 -04:00
059c3fc2f9 vim-patch:7.4.2239
Problem:    Warning for missing declaration of skip_vimgrep_pat(). (John
            Marriott)
Solution:   Move it to another file.

9baf297c99
2017-04-29 21:46:12 -04:00
dbdc2d40bb vim-patch:7.4.2231
Problem:    ":oldfiles" output is a very long list.
Solution:   Add a pattern argument. (Coot, closes vim/vim#575)

e11d61a3b1
2017-04-29 21:46:12 -04:00
0df1b6655b doc: Removed t_XX options/keycodes. (#6616)
Closes #4482

TODO: revisit find_key_option_len()
2017-04-29 16:56:40 +02:00
5a304b7864 Merge #6615 from justinmk/vim-patches 2017-04-29 14:59:10 +02:00
51a2d8dc36 win: health.vim/check_ruby(): find gem.cmd #6608
gem.cmd is not found by system(['gem', ...]), pass it to cmd.exe.
2017-04-29 01:57:09 +02:00
024ff6b808 vim-patch:25de4c232d58
Updated runtime files.

25de4c232d
2017-04-29 01:53:42 +02:00
789c46934b vim-patch:b4ada79aa7d0
Runtime file updates.

b4ada79aa7

Closes #5055
2017-04-29 01:51:56 +02:00
1e7806bd41 vim-patch:6d5ad4c4118c
Updated runtime files.

6d5ad4c411
2017-04-29 01:49:36 +02:00
8d3f8f639b vim-patch:46fceaaa8d14
Updated runtime files.

46fceaaa8d
2017-04-29 01:47:36 +02:00
9f6d693e26 Merge #6613 from justinmk/vim-patches 2017-04-29 01:41:29 +02:00
5341967315 vim-patch:4575876dc865
Updated runtime files.

4575876dc8
2017-04-29 01:03:42 +02:00
60e68f3096 vim-patch:dc08328821a2
Updated runtime files.

dc08328821

NA patches:
vim-patch:8.0.0028
vim-patch:8.0.0029
vim-patch:8.0.0030
2017-04-29 01:01:51 +02:00
460d5971f6 vim-patch:2ec618c9feac
Updated runtime files.

2ec618c9fe
2017-04-28 23:49:16 +02:00
40fb96c76a vim-patch:3e496b0ea319
Updated runtime files.

3e496b0ea3

NA patches:
vim-patch:8.0.0015
vim-patch:8.0.0016
vim-patch:177778575148
2017-04-28 23:39:24 +02:00
a5e9974ed7 vim-patch:50ba526fbf3e
Updated runtime files.

50ba526fbf

vim-patch:20eeb6129d12
2017-04-28 23:26:55 +02:00
59be0b4280 health.vim: syntax/style fixes (#6614) 2017-04-28 23:18:10 +02:00
2e64752250 vim-patch:64d8e25bf6ef
Updated runtime files.

64d8e25bf6

Closes #6611
2017-04-28 23:14:36 +02:00
06879e2e89 vim-patch:d07969093a9b
Updated runtime files.

d07969093a
2017-04-28 22:51:30 +02:00
becde1745a vim-patch:8.0.0002
Problem:    The netrw plugin does not work.
Solution:   Make it accept version 8.0.

9e1e7afc1f

vim-patch:b56e7ff0dbbf

Update translations for intro page.

b56e7ff0db
2017-04-28 22:41:07 +02:00
00bdf9ae83 vim-patch:8.0.0000
bb76f24af2

vim-patch:8.0.0001

Problem:    Intro screen still mentions version7. (Paul)
Solution:   Change it to version8.

6401024869
2017-04-28 22:34:16 +02:00
0d565d62ae vim-patch:220adb1e9f9e
A few more runtime updates.

220adb1e9f
2017-04-28 21:41:10 +02:00
9f7e1cec05 vim-patch:7e1479b86c59
Updated runtime files, Japanese translations.

7e1479b86c
2017-04-28 21:39:48 +02:00
2648c3579a vim-patch:abd468ed0fbc
Updated runtime files

abd468ed0f
2017-04-28 21:38:07 +02:00
86b596dc7a vim-patch:f37506f60f87
Updated runtime files.  Remove HiLink commands.

f37506f60f
2017-04-28 21:25:15 +02:00
a53409b564 vim-patch:89bcfda6834a
Updated runtime files.  Remove version checks for Vim older than 6.0.

89bcfda683
2017-04-28 21:13:55 +02:00
f09651ea78 vim-patch:36f44c21da2e
Updated runtime files.

36f44c21da
2017-04-28 21:06:07 +02:00
409e56b139 vim-patch:818078ddfbb8
Updated runtime files and translations.

818078ddfb
2017-04-28 21:01:25 +02:00
129f107c0c Merge #6247 'api: nvim_get_mode()' 2017-04-28 20:37:52 +02:00
8f59d14839 event: Remove "priority" concept.
It was replaced by the "child queue" concept (MultiQueue).
2017-04-28 19:20:09 +02:00
f17a818519 api/nvim_get_mode: Use child-queue instead of "priority". 2017-04-28 19:20:09 +02:00
acfd2a2a29 input.c: Process only safe events before blocking.
Introduce multiqueue_process_priority() to process only events at or
above a certain priority.
2017-04-28 19:19:51 +02:00
3ea1007753 api: nvim_get_mode()
Asynchronous API functions are served immediately, which means pending
input could change the state of Nvim shortly after an async API function
result is returned.

nvim_get_mode() is different:
  - If RPCs are known to be blocked, it responds immediately (without
    flushing the input/event queue)
  - else it is handled just-in-time before waiting for input, after
    pending input was processed. This makes the result more reliable
    (but not perfect).

Internally this is handled as a special case, but _semantically_ nothing
has changed: API users never know when input flushes, so this internal
special-case doesn't violate that. As far as API users are concerned,
nvim_get_mode() is just another asynchronous API function.

In all cases nvim_get_mode() never blocks for more than the time it
takes to flush the input/event queue (~µs).

Note: This doesn't address #6166; nvim_get_mode() will provoke #6166 if
e.g. `d` is operator-pending.

Closes #6159
2017-04-28 19:14:34 +02:00
7044aa6e82 api/ext_tabline: curtab should be a Tabpage handle. 2017-04-28 15:59:20 +02:00
b90a59333f Merge #6606 from justinmk/build_stl 2017-04-28 15:41:24 +02:00
0ddebbc354 lint 2017-04-28 05:33:11 +02:00
2b6a3819e5 build_stl_str_hl: Array name should be plural. 2017-04-28 04:11:29 +02:00
56911050e0 refactor/single-include (#6604) 2017-04-27 21:43:27 +02:00
ce245c2c61 Merge pull request #6600 from jamessan/post-sourcing-filetype
Test handling of "filetype ... off"/"syntax off" after startup scripts
2017-04-27 11:10:57 -04:00
e20691ccb4 defaults_spec: Test changing :filetype/:syntax in -c, after defaults 2017-04-27 09:20:03 -04:00
6755262194 test: inccommand_spec: Avoid indeterminism. (#6592) 2017-04-26 14:51:21 +02:00
0b59f988f4 Merge #6583 from justinmk/ui-tabline 2017-04-26 11:59:59 +02:00
6944abad2f api/ext_tabline: List of Dicts. 2017-04-26 03:41:24 +02:00
c8e1af93de api: nvim_ui_attach(): Flatten ext_* options. 2017-04-26 03:41:24 +02:00
00843902d3 api/ui: externalize tabline
- Work with a bool[] array parallel to the UIWidget enum.
- Rename some functions.
- Documentation.
2017-04-26 03:41:24 +02:00
88023d5123 api/ui: externalize tabline 2017-04-26 02:15:31 +02:00
7e571bca5d tui: Only set cursor color if the highlight group is valid (#6585)
Closes #6584
2017-04-25 21:05:33 +02:00
22932d8ac2 refactor/single-include (#6586) 2017-04-25 20:45:59 +02:00
a0acb2e195 doc: Revise nvim-from-vim advice (#6505) 2017-04-25 11:04:32 +02:00
e4dcf756ae Merge #6581 from ZyX-I/really-kill-single-includes
ci: When using restarting tests kill make with the shell
2017-04-25 00:18:14 +02:00
8f346a322b test/fs: sanity check for literal "~" directory (#6579)
If the CWD contains a directory with the literal name "~" then the tests
will have bogus failures.
2017-04-24 22:45:03 +02:00
ZyX
ee4daa6572 ci: Remove x from test x 2017-04-24 23:11:13 +03:00
ZyX
74d5705ca9 ci: Source ci/common/test.sh in run_test_wd subshell 2017-04-24 22:37:36 +03:00
ZyX
85903cb0e6 ci: Make scripts in common be dash-compatible
`ulimit` may still be not present: dash and busybox support it, but posh does
not.
2017-04-24 22:37:36 +03:00
ZyX
4ccef05829 ci: Make $cmd failure fail the build without -o pipefail 2017-04-24 21:44:17 +03:00
ZyX
fc16d02c3d ci: Do not use pipefail 2017-04-24 19:30:28 +03:00
ZyX
3a0117c850 ci: Do not accidentally kill something unneeded 2017-04-24 18:34:47 +03:00
ZyX
26fad863ba ci: When using restarting tests kill make with the shell 2017-04-24 18:28:46 +03:00
8dc3eca49b api/dispatch: Mark generated functions table readonly (#6576) 2017-04-24 12:39:48 +02:00
ff8b2eb435 Merge branch 'master' into option-fixes 2017-04-24 11:35:10 +02:00
7f6d3d3052 Merge #6569 from justinmk/apierror
api: Do not truncate errors <1 MB
2017-04-24 02:14:14 +02:00
086c354a0a api: Do not translate error messages.
Also re-word some error messages:
- "Key does not exist: %s"
- "Invalid channel: %<PRIu64>"
- "Request array size must be 4 (request) or 3 (notification)"
- "String cannot contain newlines"

References #6150
2017-04-24 00:11:27 +02:00
e2936ed397 tui/input.c: Use default 'ttimeoutlen' if option get fails.
Should never happen, but better to be explicit.

Helped-by: oni-link <knil.ino@gmail.com>
2017-04-23 23:44:59 +02:00
3fbc660d57 api_set_error(): rename 2017-04-23 23:44:57 +02:00
2ed91f222f api/internal: Remove set field from Error type. 2017-04-23 23:44:32 +02:00
62c3f436a9 api_clear_error: Skip if error was not set. 2017-04-23 23:44:32 +02:00
2a49163103 api_clear_error() 2017-04-23 23:44:32 +02:00
5c9860a0a2 api: Do not truncate errors <1 MB. #6237
Closes #5984
2017-04-23 23:44:29 +02:00
4524053874 test: api: Do not truncate errors <1 MB. 2017-04-23 23:24:16 +02:00
1fe8945748 refactor: Remove unused MAP_IMPL. (#6573) 2017-04-23 02:32:56 +02:00
a9d37c928e Merge #6513 from ZyX-I/lazier-arg_errmsg-gettext 2017-04-23 01:02:39 +02:00
77b6de0968 Merge #6572 from justinmk/guicursor 2017-04-23 00:37:13 +02:00
719095d7d3 os_term_is_nice: Return true for rxvt and iTerm. 2017-04-22 22:57:35 +02:00
c703d0529b 'guicursor': iTerm: Set cursor color.
iTerm uses proprietary escape codes to set cursor color.
https://www.iterm2.com/documentation-escape-codes.html
2017-04-22 22:57:29 +02:00
1e83add288 refactor/single-include: ui.h, ui_bridge.h, ugrid.h (#6571) 2017-04-22 16:55:28 +02:00
e41c044b53 refactor/single-include (#6563) 2017-04-22 15:44:58 +02:00
654c50b227 refactor/single-include: window.h, version.h (#6570) 2017-04-22 15:43:35 +02:00
10f119ab87 Merge #6539 'More cursor shape modes' 2017-04-21 19:09:50 +02:00
f50e03f2e3 ex_cmds.c: Fix bug in ex_z (#6557)
vim-patch:8.0.0571
2017-04-21 15:45:51 +02:00
a396874da0 refactor/single-include: getchar.h (#6560) 2017-04-21 15:21:02 +02:00
48f0542ad6 tests: detect invalid helpers.sleep 2017-04-21 14:21:26 +02:00
9cc9789681 ui: document new mode index and add note about forward-compatibility 2017-04-21 12:32:38 +02:00
7ea5c78687 ui: use an array for mode styles 2017-04-21 12:32:38 +02:00
2c5751b9b2 ui: add tests for new cursor shape modes 2017-04-21 12:32:38 +02:00
9cdbbd4982 ui: support more cursor shape modes
throttle unneccessary cursor shape events
2017-04-21 12:32:38 +02:00
ZyX
d463c9e03a Merge branch 'master' into lazier-arg_errmsg-gettext 2017-04-21 00:33:12 +03:00
19646a2985 health.vim: 'guicursor' advice #6506
Also:
- Mark provider sections as "(optional)".
- Fix help-link substitution to support single-quoted tags.
2017-04-20 22:44:51 +02:00
15af803cce Merge #6550 from ZyX-I/pvs-check-comment 2017-04-20 22:00:03 +02:00
3a606ee58d Merge #6552 from justinmk/loadview 2017-04-20 14:47:01 +02:00
d55fd9588f doc: Recommend :silent! for :loadview.
ex_loadview() was changed in 9b1c939370 to check the file open result.

If user doesn't care about failure to open, using :silent! instead of
:silent is a reasonable, conventional approach.

Closes #3196
2017-04-20 13:13:39 +02:00
17052946c7 'scrollback': Allow :setlocal -1 on normal buffers
Avoids a spurious :loadview error.
2017-04-20 13:13:39 +02:00
a6f50c1120 version.c: Mark 7.4.{2165,2173,2179} applied 2017-04-19 23:22:27 -04:00
2fb46adc5e Merge pull request #6531 from justinmk/vim-dc1f1645cb49
vim-patch: runtime updates
2017-04-19 23:16:36 -04:00
462c53eb3e Merge pull request #6547 from jamessan/vim-7.4.2152
vim-patch:7.4.2152,7.4.2165,7.4.2173,7.4.2179,7.4.2209
2017-04-19 23:15:45 -04:00
cb02137dfa vim-patch:7.4.2209
Problem:    Cannot map <M-">. (Stephen Riehm)
Solution:   Solve the memory access problem in another way. (Dominique Pelle)
            Allow for using <M-\"> in a string.

35a4cfa200
2017-04-19 22:26:30 -04:00
ac05c8585c Mark patches applied in 6baa669
vim-patch:7.4.2165
vim-patch:7.4.2173
vim-patch:7.4.2179
2017-04-19 22:25:18 -04:00
c5d7eaf664 vim-patch:7.4.2152
Problem:    No proper translation of messages with a count.
Solution:   Use ngettext(). (Sergey Alyoshin)

ee695f787a
2017-04-19 22:24:58 -04:00
b25fa94eb5 scripts/vim-patch.sh: word-boundaries in preprocess regex 2017-04-19 21:26:17 +02:00
d194380de9 vim-patch:e4a3bcf28d92
Updated runtime files.  Add Scala files.

e4a3bcf28d
2017-04-19 21:26:17 +02:00
c1edb4c39a vim-patch:7571d55f7dcc
Updated runtime files.

7571d55f7d
2017-04-19 21:26:16 +02:00
5da8bb92fc vim-patch:dc1f1645cb49
Updated runtime files.

dc1f1645cb
2017-04-19 21:26:16 +02:00
ZyX
c2f3e361c5 *: Add comment to all C files 2017-04-19 19:11:50 +03:00
ZyX
3351016dcd scripts: Add newline after the comment 2017-04-19 19:11:37 +03:00
ZyX
4555bf9e7f scripts: Allow patching only build files 2017-04-19 19:10:53 +03:00
ZyX
9fd048d901 scripts: Do not patch already patched sources in patch mode
Also do not patch header files, that is not needed.
2017-04-19 19:04:00 +03:00
ZyX
38b2bc9a88 scripts: Make pvs do not patch separate directory, add patch mode 2017-04-19 18:55:32 +03:00
f0c12012d9 Merge #6546 from justinmk/doc 2017-04-19 15:03:02 +02:00
6bc6d94ec8 doc: api-contract, CONTRIBUTING.md 2017-04-19 13:48:12 +02:00
29ab8c1ae2 doc/CONTRIBUTING.md: Recommend merge-based workflow.
References #6435
2017-04-19 04:03:09 +02:00
440133e0d5 health.vim: Set 'iskeyword' to that of ft=help. 2017-04-19 04:03:08 +02:00
14b1becb54 doc: fix typo (#6504) 2017-04-19 02:20:05 +02:00
ce7cba6d7f Merge #6533 'Fix PVS-studio warnings' 2017-04-17 22:02:46 +02:00
7debba9d42 Merge #6537 from justinmk/hlcursor
Cursor highlight after `:highlight clear|syntax reset`
2017-04-18 11:17:06 +02:00
45aa465fba test: Cursor after :hi clear|syntax reset
Also enable tests on Windows.
2017-04-17 21:15:51 +02:00
3345382cc2 highlight: default Cursor to guibg=fg, guifg=bg
Closes #6508
2017-04-17 05:47:43 +02:00
263849b2dd fold: foldMoveRange(): fix :move bug #6534
Closes #6540

In #6221 there was a mistake in calculating which folds need to be
re-ordered. When there are no folds after those that have been adjusted,
then `move_end` remains 0. This results in reverse_fold_order()
swapping folds that have been adjusted with uninitialised folds in the
remainder of the grow array.

Add a check in foldMoveRange() to account for this case.
2017-04-17 04:45:55 +02:00
ZyX
2eb9150a4f buffer: Adjust where do_buffer call is located
It is located there in Vim, but in dd7657c160 
position was for some reason swapped.
2017-04-16 23:58:32 +03:00
ZyX
58300d70d2 *: Fix linter errors 2017-04-16 22:20:19 +03:00
ZyX
9d302c60f0 regexp_nfa: Remove octal constant 2017-04-16 21:43:27 +03:00
ZyX
372b6af8ea regexp_nfa: Remove another has_mbyte/…-checking code 2017-04-16 21:43:27 +03:00
ZyX
30561afe41 regexp: Silence octal constant warning 2017-04-16 21:43:26 +03:00
ZyX
b7118a008a regexp: Remove another has_mbyte/…-checking stuff 2017-04-16 21:43:26 +03:00
ZyX
69ebfb8d8e regexp: Fix warning about octal constant 2017-04-16 21:43:26 +03:00
ZyX
76783963eb tag: Fix “initialized twice successively” false positive 2017-04-16 21:43:25 +03:00
ZyX
316789e14c tag: Silence “buffer underflow” warning 2017-04-16 21:43:25 +03:00
ZyX
c0cbc50720 screen: Remove another portion of has_mbyte/friends-checking stuff 2017-04-16 21:43:25 +03:00
ZyX
e131194db7 screen: Remove unneeded condition
Already checked in outer if()
2017-04-16 21:43:23 +03:00
ZyX
48ad8e0ff1 screen: Silence NULL dereference false positive
Based on the loop condition when shl_flag is true cur != NULL.
2017-04-16 21:43:23 +03:00
ZyX
7cf4b0ac06 screen: Silence “buffer underflow” warning 2017-04-16 21:18:00 +03:00
ZyX
a65867542d screen: Remove unneeded check 2017-04-16 21:17:08 +03:00
ZyX
b396a3f72e quicfix: Avoid possible NULL dereference 2017-04-16 21:13:49 +03:00
ZyX
4e7150ee94 quicfix: Remove duplicate condition 2017-04-16 21:13:25 +03:00
ZyX
be9d98cb45 quickfix: Remove unneeded condition
fmt_ptr was checked for being NULL in if() condition earlier.
2017-04-16 21:13:24 +03:00
ZyX
aa3b1f695f normal: Add figure braces so that code is clearer 2017-04-16 21:13:24 +03:00
ZyX
b5db7cde36 normal: Clarify the code
Current variant works only because of PUT_FIXINDENT being equal to true.
2017-04-16 21:13:24 +03:00
ZyX
54bd78b8a8 normal: Remove unneeded assignment 2017-04-16 21:06:22 +03:00
ZyX
cdbfff077b ops: Silence “counter not used in loop” false positive 2017-04-16 21:05:50 +03:00
ZyX
84aa457ccd os/env: Fix “invalid pointer to local” false positive 2017-04-16 21:02:43 +03:00
ZyX
dc523eed8e fileio: Silence “!= identical subexpressions” warning 2017-04-16 20:59:58 +03:00
ZyX
0718d0e6d4 message: Some more has_mbyte/enc_utf8 removal 2017-04-16 20:58:19 +03:00
ZyX
083792e137 message: Remove some enc_utf8/… checks 2017-04-16 20:56:30 +03:00
ZyX
10ce00efa8 memline: Fix “NULL pointer dereference” warning
It was actually a false positive indicating always-true condition, not real 
dereference.
2017-04-16 20:55:29 +03:00
ZyX
2394c9f2b7 memline: Silence “buffer underflow” warning, looks like false positive 2017-04-16 20:47:06 +03:00
ZyX
0f7c260cd8 fileio: Simlify help files encoding detection
Most of code is dead when enc_utf8 is always true. Given that `c` is being 
reused for other purposes I left it set to 1 just in case.
2017-04-16 20:39:57 +03:00
ZyX
e3de83a829 hardcopy: Remove unneeded prt_do_conv assignment 2017-04-16 20:32:10 +03:00
ZyX
d88ae748b5 getchar: Fix if block indentation 2017-04-16 20:29:19 +03:00
ZyX
fe01e9c947 ex_docmd: Remove unneeded if() 2017-04-16 20:27:47 +03:00
ZyX
87e107d921 ex_docmd: Remove :Ni! easter egg 2017-04-16 20:27:20 +03:00
ZyX
a894c82def ex_docmd: Remove excessive assignment 2017-04-16 20:25:00 +03:00
ZyX
d766607dc9 farsi: Simplify condition 2017-04-16 20:24:30 +03:00
ZyX
c5010c98ae eval: Fix position of buf declaration 2017-04-16 20:22:58 +03:00
ZyX
1bc0800787 eval: Remove unneeded !eap->skip check
Already checked in the outer if().
2017-04-16 20:22:12 +03:00
ZyX
9dd1926df0 eval: Remove unneeded varp check 2017-04-16 20:20:53 +03:00
ZyX
9b1dd08425 eval: Remove unneeded varp check 2017-04-16 20:20:38 +03:00
ZyX
787d71a3af eval: Fix condition in f_serverstop 2017-04-16 20:19:10 +03:00
ZyX
fbdef2e6f2 eval: Refactor nr2char()
Adds error messages, checks type and ignores the second argument.

Currently utf_char2bytes is able to handle any 31-bit character, not
limited by a unicode range. So checking for INT_MAX and not for
something else: function yet uses `int`.
2017-04-16 20:16:55 +03:00
ZyX
3c5f4b382f eval: Silence octal constant warning 2017-04-16 20:08:56 +03:00
ZyX
31190879cc eval: Fix useless NULL check
partial_name() as it is written now really cannot return NULL
2017-04-16 20:07:54 +03:00
ZyX
7c9e3d6cad eval: Refactor f_char2nr
With has_mbyte equal to 1 and &encoding always UTF-8 second argument is no 
longer useful: utf_ptr2char is the same as mb_ptr2char.

Also changes function behaviour a bit: now if second argument is not a number it 
immediately returns with error, without bothering to get a character.
2017-04-16 20:02:06 +03:00
ZyX
97a1ccf8e7 eval: Fix V547: d == NULL was already checked at line 2986 2017-04-16 19:56:55 +03:00
ZyX
05c1829a8c eval: Silence eap->skip false positives
`lnum` starts at `eap->line2` in case of skipping, so cycle is always run at 
least once.
2017-04-16 19:55:49 +03:00
ZyX
d70a0f6895 eval/typval_encode: Silence then/else equivalence warning 2017-04-16 19:51:35 +03:00
ZyX
dd5b0cc17a edit: Copy assert to before the warning 2017-04-16 19:50:23 +03:00
ZyX
fb4754104b macros: Fix excessive check 2017-04-16 19:39:55 +03:00
ZyX
9e9ba14e0e edit: Fix strange code
Based on the flow it looks like ptr could not be NULL here: if ptr_arg is NULL 
ptr is compl_leader, if compl_leader is NULL function exits. This also applies 
to Vim as far as I see.
2017-04-16 19:38:16 +03:00
ZyX
4f0fc1f06a digraph: Fix errors due to has_mbyte and friends being fixed 2017-04-16 19:32:38 +03:00
ZyX
2901921a1b digraph: Ignore false positive
Reversed order is intentional, digraphs allow swapping characters.
2017-04-16 19:30:18 +03:00
ZyX
a096766ee3 diff: Silence -V519
Not exactly a false positive, but previous assignment is a part of the pattern 
“change global, run code which uses it, change global back”.
2017-04-16 19:27:17 +03:00
ZyX
33952a7661 *: Silence some false positives 2017-04-16 19:18:54 +03:00
77a4f8f235 Merge #6219 from jbradaric/vim-7.4.2170
vim-patch:7.4.{2170,2180,2240,2241,2242}
2017-04-16 16:49:14 +02:00
d4c7f74ed1 Merge pull request #6493 from ZyX-I/pvs-script
[RFC] scripts: Create script which checks Neovim with PVS-studio
2017-04-16 03:03:38 +03:00
5c805f4566 Merge #6528 from ZyX-I/revise-malloc-attr
Revise places where FUNC_ATTR_MALLOC is present

Closes #6521
2017-04-15 22:12:31 +02:00
ec0fabd4d5 eval.c: Code style fixes 2017-04-15 18:48:06 +02:00
ZyX
d76a13bb65 os/shell: Remove FUNC_ATTR_MALLOC from shell_build_argv
Returns an array of allocated strings.
2017-04-15 19:39:53 +03:00
ZyX
ac47e64eca ops: Remove FUNC_ATTR_MALLOC from copy_register
Returned storage has a pointer to a newly allocated array.
2017-04-15 19:25:00 +03:00
ZyX
d191ba1db3 option: Remove FUNC_ATTR_MALLOC from get_winbuf_options
Same as tv_dict_alloc() and additionally it saves some strings inside 
a dictionary.
2017-04-15 19:23:00 +03:00
ZyX
82ba2891ae eval/typval: Remove FUNC_ATTR_MALLOC from tv_list_alloc_ret
Same as tv_list_alloc, but additionally ret_tv receives pointer to the newly 
allocated list.
2017-04-15 19:19:22 +03:00
ZyX
af3579d5f7 eval/typval: Remove FUNC_ATTR_MALLOC from tv_dict_alloc
Allocated dict points to previously allocated dict.
Queue in allocated dict points to itself.
Hashtab in allocated dict points to inside itself.
Allocated dict is saved to gc_first_dict.
2017-04-15 19:18:25 +03:00
ZyX
b9004d7448 eval/typval: Remove FUNC_ATTR_MALLOC from tv_dict_item_copy
Allocated storage may receive pointer to the list after tv_copy().
2017-04-15 19:16:40 +03:00
ZyX
b08b71c728 eval/typval: Remove FUNC_ATTR_MALLOC from tv_list_alloc
Allocated list points to previously allocated list.
Allocated list is saved to gc_first_list.
2017-04-15 19:16:00 +03:00
ZyX
0dddd8a27c os/fileio: Remove FUNC_ATTR_MALLOC for file_open_new
fp contains pointer to rbuffer
2017-04-15 19:13:43 +03:00
c70ab1a2e2 test: make locale dependent oldtest more reliable (#6526) 2017-04-15 15:06:50 +02:00
a8f7872f44 test_timers.vim: Adjust timing to handle difference in implementation 2017-04-15 08:50:43 -04:00
12fc1defd6 ops: fix i<c-r> with multi-byte text (#6524) 2017-04-15 11:19:40 +02:00
ZyX
c289986c89 eval/encode: Do translate “… argument” strings, but only in conv_error 2017-04-15 00:08:50 +03:00
ZyX
31fd6d4bbf eval/typval: Do not translate tv_clear argument, this is useless 2017-04-15 00:00:22 +03:00
ZyX
b54e5c220f unittests: Add a test for TV_CSTRING
Not using enum{} because SIZE_MAX exceeds integer and I do not really like how
enum definition is described in C99:

1. Even though all values must fit into the chosen type (6.7.2.2, p 4) the type
   to choose is still implementation-defined.
2. 6.4.4.3 explicitly states that “an identifier declared as an enumeration
   constant has type `int`”. So it looks like “no matter what type was chosen
   for enumeration, constants will be integers”. Yet the following simple
   program:

        #include <stdint.h>
        #include <stdio.h>
        #include <stddef.h>

        enum { X=SIZE_MAX };

        int main(int argc, char **argv)
        {
          printf("x:%zu m:%zu t:%zu v:%zu",
                 sizeof(X), sizeof(SIZE_MAX), sizeof(size_t), (size_t)X);
        }

    yields one of the following using different compilers:

    - clang/gcc/pathcc: `x:8 m:8 t:8 v:18446744073709551615`
    - pcc/tcc: `x:4 m:8 t:8 v:1844674407370955161`

    If I remove the cast of X to size_t then pcc/tcc both yield `x:4 m:8 t:8
    v:4294967295`, other compilers’ output does not change.

    All compilers were called with `$compiler -std=c99 -xc -` (feeding program
    from echo), except for `tcc` which has missing `-std=c99`. `pcc` seems to
    ignore the argument though: it is perfectly fine with `-std=c1000`.
2017-04-14 23:58:47 +03:00
ZyX
276ee1f7fb eval: Add comment regarding why special values are needed 2017-04-14 23:58:46 +03:00
ZyX
b2942d1e72 eval: Change the point at which arg_errmsg and its length are changed
Ref #6437
2017-04-14 23:58:46 +03:00
58d2ce9bdb test: check_cores(): Escape $TMPDIR path. (#6520)
Lua string:match() considers hyphen to be a special char, we want the
path to be a literal match. Also remove "./", etc.

References #6483
2017-04-14 20:34:54 +02:00
45b5ebea9d perf: tv_clear(): Cache gettext() result. (#6519)
Closes #6437
2017-04-14 17:41:59 +02:00
dd391bfca1 Merge #6497 from justinmk/win-quot
win: system('...'): special-case cmd.exe
2017-04-12 03:21:21 +02:00
7c4e5dfd27 win: os_shell_is_cmdexe() + tests 2017-04-12 02:28:43 +02:00
d31d177a0c win: default shellxescape, shellxquote to empty
Calling cmd.exe in Windows follows a very different pattern from Vim.
The primary difference is that Vim does a nested call to cmd.exe, e.g.
the following call in Vim

    system('echo a 2>&1')

spawns the following processes

    "C:\Program Files (x86)\Vim\vim80\vimrun" -s C:\Windows\system32\cmd.exe /c (echo a 2^>^&1
        ^>C:\Users\dummy\AppData\Local\Temp\VIoC169.tmp 2^>^&1)
    C:\Windows\system32\cmd.exe /c C:\Windows\system32\cmd.exe /c (echo a 2^>^&1
        ^>C:\Users\dummy\AppData\Local\Temp\VIo3C6C.tmp 2^>^&1)
    C:\Windows\system32\cmd.exe  /c (echo a 2>&1
        >C:\Users\dummy\AppData\Local\Temp\VIo3C6C.tmp 2>&1)

The escaping with ^ is needed because cmd.exe calls itself and needs to
preserve the special metacharacters for the last call. However in nvim
no nested call is made, system('') spawns a single cmd.exe process.
Setting shellxescape to "" disables escaping with ^.

The previous default for shellxquote=( wrapped any command in
parenthesis, in Vim this is more meaningful due to the use of tempfiles
to store the output and redirection (also see &shellquote). There is
a slight benefit in having the default be empty because some expressions
that run in console will not run within parens e.g. due to unbalanced
double quotes

    system('echo "a b')
2017-04-12 02:10:34 +02:00
f3cc843755 win: libuv_process_spawn(): special-case cmd.exe
Disable CommandLineToArgvW-standard quoting for cmd.exe.

libuv assumes spawned processes follow the convention expected by
CommandLineToArgvW(). But cmd.exe is non-conformant, so for cmd.exe:
- With system([]), the caller has full control (and responsibility) to
  quote arguments correctly.
- With system(''), shell* options are used.

libuv quoting is disabled if argv[0] is:
- cmd.exe
- cmd
- $COMSPEC resolving to a path with filename cmd.exe

Closes #6329
References #6387
2017-04-12 02:10:34 +02:00
799443c994 win/test: Enable more system() tests 2017-04-12 02:10:33 +02:00
f7611d74e7 win: vim_strsave_shellescape: Handle 'shellslash'.
From Vim, misc2.c:vim_strsave_shellescape
2017-04-12 02:10:33 +02:00
d6e5f94ae9 win: defaults: 'shellredir', 'shellxquote', 'shellxescape' 2017-04-12 01:35:49 +02:00
ZyX
1d7fde39a6 api/buffer: Validate replacement array in a separate cycle
Should not really change anything, but code should be more efficient by using 
more optimized libc functions (memchrsub is not libc, but it uses memchr) in 
place of a cycle.
2017-04-12 00:31:01 +03:00
ZyX
1bd39fb8d0 api: Remove FUNC_API_SINCE for nvim__ functions 2017-04-11 23:59:05 +03:00
7d0fc179e6 genmsgpack: Do not export functions with __ 2017-04-11 23:56:18 +03:00
2d72d85b23 refactor: pos_T macros to functions (#6496) 2017-04-11 22:44:48 +02:00
1b94852ccb Merge pull request #6495 from bfredl/localefix
run Turkish locale tests on travis and make the tests more reliable
2017-04-11 12:38:58 +02:00
69775f603f ci: install Turkish locale and make locale tests more reliable 2017-04-11 10:24:19 +02:00
ZyX
78082e8d3e functests: Check whether it is a problem with an array 2017-04-11 11:05:19 +03:00
ZyX
a8ade2441d lua/converter: Remove useless macros 2017-04-11 11:05:19 +03:00
ZyX
9bf15ca3fa lua: Fix header guards 2017-04-11 10:18:53 +03:00
337299c808 Merge #6490 from justinmk/test
Closes #6487
2017-04-11 03:14:10 +02:00
de378477cc ci/appveyor: fix cache pattern 2017-04-11 02:37:39 +02:00
119f0ca854 test: helpers.execute() => helpers.feed_command() 2017-04-11 02:37:39 +02:00
dab3f86d09 win/test: Enable recover_spec.lua 2017-04-11 02:37:39 +02:00
ZyX
acd9ed8d83 functests: Add another check for the similar transformation
Reasoning is majorly the same: check whether lua has bug or API function has 
bug, but on the other side: previous commit is checking whether similar bug when 
using API via msgpack RPC, this commit is checking whether another API function 
used via lua bindings triggers the same bug. Should additionally give a hint 
about which lua code contains a bug.
2017-04-11 02:32:13 +03:00
ZyX
add76592d9 functests: Test for “string cannot contain newline” set_lines error
Should make me able to determine whether they are lua bindings that contain 
a bug or set_lines.
2017-04-11 02:24:37 +03:00
4a63d9e5f8 win: mch_open_rw: specify S_IWRITE #6487
On Windows, `mch_open_rw` is not actually doing what it claims. This
manifests as "E301: Oops, lost the swap file !!!" when filename is
changed with :file {name}.

Steps to reproduce (covered by test/functional/ex_cmds/file_spec.lua):
    nvim -u NONE
    :edit test
    :file test2
    E301 Oops, lost the swap file!!!

From libuv/src/win/fs.c:
    void fs__open(uv_fs_t* req) {
      ...
      attributes |= FILE_ATTRIBUTE_NORMAL;
      if (flags & _O_CREAT) {
        if (!((req->fs.info.mode & ~current_umask) & _S_IWRITE)) {
          attributes |= FILE_ATTRIBUTE_READONLY;
        }
      }
2017-04-11 00:39:12 +02:00
2d29638744 test: :file {name} 2017-04-11 00:39:12 +02:00
6cbf290d56 test/rmdir(): fallback to Nvim delete()
Lua has too many pitfalls here:
- os.execute() requires shell-escaping
- os.execute() has breaking changes between Lua 5.1 and 5.2
- No native way in Lua to handle "readonly" etc. on Windows
2017-04-11 00:39:12 +02:00
d0b08f32f5 Remove the mf_dont_release global after getting rid of maxmem[tot] 2017-04-11 00:33:09 +02:00
9ea111d1af Remove maxmem and maxmemtot options
> The option 'maxmem' ('mm') is used to set the maximum memory used for one
> buffer (in kilobytes).  'maxmemtot' is used to set the maximum memory used for
> all buffers (in kilobytes).  The defaults depend on the system used.  These
> are not hard limits, but tell Vim when to move text into a swap file.  If you
> don't like Vim to swap to a file, set 'maxmem' and 'maxmemtot' to a very large
> value.  The swap file will then only be used for recovery.  If you don't want
> a swap file at all, set 'updatecount' to 0, or use the "-n" argument when
> starting Vim.

On today's systems these values are huge (4GB in my machine with 8GB of RAM
since it's set as half the available memory by default) so the limits are
never reached in practice, but Vim wastes a lot of time checking if the limit
was reached.

If the limit is reached Vim starts saving pieces of the swap file that were in
memory to the disk. Said in a different way: Vim implements its own memory
swapping mechanism. This is unnecessary and inefficient since the operating
system already virtualized the memory and will swap to the disk if programs
start using too much memory.

This change does...

1. Reduce the number of config options and need for documentation.
2. Make the code more efficient as we don't have to keep track of memory usage
   nor check if the memory limits were reached to start swapping to disk every
   time we need memory for buffers.
3. Simplify the code. Once `memfile.c` is simple enough it could be replaced by
   actual operating system memory mapping (`mmap`, `MemoryViewOfFile`...).

This change does not prevent Vim to recover changes from swap files since the
swapping code is never triggered with the huge limits set by default.
2017-04-11 00:33:09 +02:00
ZyX
0c5e359cb5 cmake: Append lua include also to single-includes targets 2017-04-11 01:32:35 +03:00
ZyX
9cad5155e3 functests: Make sure funcs.luaeval receives only one argument 2017-04-11 01:18:42 +03:00
ZyX
f98a3d85ed lua: Move files from src/nvim/viml/executor to src/nvim/lua 2017-04-11 01:09:36 +03:00
ZyX
1751ec192d viml/executor: Fix check-single-includes 2017-04-11 01:05:56 +03:00
0ce9618918 test/rmdir(): Remove readonly attr on Windows. 2017-04-10 22:59:30 +02:00
ZyX
57308c4f82 eval/decode: Include header needed for TriState 2017-04-10 23:22:59 +03:00
ZyX
3ea2063e07 cmake: Add FindLua.cmake
Copied from CMake v3.8.0-707-g0419ecb, modified one include() line.
2017-04-10 23:10:55 +03:00
ZyX
f3093bc508 api: Bump nvim__*id functions since value 2017-04-10 23:10:01 +03:00
ZyX
ab4d13e2fa Merge branch 'master' into luaviml'/lua 2017-04-10 22:21:06 +03:00
ZyX
22fb9d8d25 Merge branch 'master' into 1476-changes 2017-04-10 19:12:56 +03:00
9aface8c4d Merge #6489 from ZyX-I/own-output-handler 2017-04-10 15:53:40 +02:00
fec53f0bdf Merge #6479 from bfredl/tolower
remove vim_tolower/etc functions with broken locale-dependent behavior
2017-04-10 15:23:44 +02:00
ZyX
60ee50ce4b appveyor: Widen .deps cache dependency 2017-04-10 16:17:02 +03:00
ZyX
2a8055a8d9 ci: Make appveyor use new output handler as well 2017-04-10 15:11:41 +03:00
dd7f41e5a0 Merge #6488 from ZyX-I/coverity-fixes 2017-04-10 14:04:19 +02:00
ZyX
55292685d3 pvscheck: Add --recheck argument 2017-04-10 14:07:26 +03:00
ZyX
2b13c87fa2 pvscheck: Do not use --depth 2017-04-10 13:47:31 +03:00
ZyX
d7086f44f4 pvscheck: Do not trace help 2017-04-10 13:45:33 +03:00
ZyX
3bd11f2911 pvsscript: Use git clone and not git worktree 2017-04-10 13:42:31 +03:00
ZyX
59f0cbc282 pvscheck: Add help 2017-04-10 13:41:09 +03:00
ZyX
ebfcf2fa38 scripts: Create script which checks Neovim with PVS-studio 2017-04-10 13:24:31 +03:00
c1cf033981 lint: fix clint errors around mb_tolower calls 2017-04-10 12:02:26 +02:00
acc06b0b7b vim-patch:8.0.0552
Problem:    Toupper and tolower don't work properly for Turkish when 'casemap'
            is empty. (Bjorn Linse)
Solution:   Check the 'casemap' options when deciding how to upper/lower case.

3317d5ebbe

vim-patch:8.0.0553

Problem:    Toupper/tolower test with Turkish locale fails on Mac.
Solution:   Skip the test on Mac.

9f4de1f543

vim-patch:8.0.0554

Problem:    Toupper and tolower don't work properly for Turkish when 'casemap'
            contains "keepascii". (Bjorn Linse)
Solution:   When 'casemap' contains "keepascii" use ASCII toupper/tolower.

1cc482069a

vim-patch:8.0.0555

Problem:    Toupper/tolower test fails on OSX without Darwin.
Solution:   Skip that part of the test also for OSX. (Kazunobu Kuriyama)

d2381a2cad
2017-04-10 12:02:26 +02:00
4c857dae11 vim-patch:8.0.0243
Problem:    When making a character lower case with tolower() changes the byte
            cound, it is not made lower case.
Solution:   Add strlow_save(). (Dominique Pelle, closes vim/vim#1406)

cc5b22b3bf

Join almost identical strup_save and strlow_save functions to one
Function.
2017-04-10 12:02:26 +02:00
a3a06d0248 test: add tests for gu/gU behavior in Turkish locale 2017-04-10 12:02:25 +02:00
db9ef6263e mbyte: replace vim_tolower with mb_tolower handling locale correctly 2017-04-10 12:01:40 +02:00
3b88e37b83 Merge pull request #6492 from ZyX-I/fix-clint-incremental-build
cmake: Do not forget to actually create a touch file for errors.tar.gz
2017-04-10 11:26:33 +03:00
ZyX
6f5e87e4aa tests: Rename neovim output handler to nvim 2017-04-10 03:51:51 +03:00
ZyX
40dee97442 third-party: Update busted version 2017-04-10 03:51:50 +03:00
ZyX
accc7a0b6c tests: Skip dumping elapsed times when not available
Should provide some compatibility with old busted. And also removes duplicate 
parts from successString and skippedString, making them more like failureString 
and errorString which do not have times for technical reasons (busted for some 
reason did not yet compute duration before running the relevant handlers).
2017-04-10 03:51:50 +03:00
ZyX
1b66ed890b cmake: Do not forget to actually create a touch file for errors.tar.gz 2017-04-10 03:50:05 +03:00
ZyX
bc61058dd8 tests: Print description also at the end of the suite 2017-04-10 02:51:27 +03:00
ZyX
d909724d70 tests: Use our own output handler on travis
Reasoning:

1. gtest is better then something like utfTerminal, yet it is way too verbose.
2. gtest cannot be configured to show colors always.
3. Actually I am going to add a CMake target which will allow running tests 
   (especially, functional tests) in parallel, but this is not going to work 
   well with any of the default output handlers. Build in this case must be more 
   or less silent, yet debuggable. New handler does not support this in this 
   commit though.
2017-04-10 02:32:09 +03:00
d7fb7de70a Merge #6481 from ZyX-I/rename-execute
Rename execute() function to feed_command()
2017-04-09 22:51:59 +02:00
ZyX
ebe5051977 spellfile: Fix SAL sections reading 2017-04-09 23:46:38 +03:00
ZyX
fa7ace446e coverity/56795: Fix NULL dereference in :syn keyword non-printable
Bug was introduced 3 years earlier, in 13848aa: NULL keyword_copy was 
incorrectly treated as an indicator of OOM.
2017-04-09 23:38:05 +03:00
ZyX
eb3663eb10 spellfile: Fix clint errors 2017-04-09 22:39:23 +03:00
ZyX
aa857f9e48 spellfile: Fix memory leak 2017-04-09 22:33:45 +03:00
ZyX
35584594f5 coverity/13689: Check file header with memcmp
Not that it is actually useful (would fail in any case), but should fix coverity 
report.
2017-04-09 22:30:48 +03:00
ZyX
8f75b67c07 coverity/13688: Check for NUL bytes in salfrom 2017-04-09 22:16:26 +03:00
ZyX
ecce981dba coverity/13687: Do not allow NUL byte in region names 2017-04-09 22:02:51 +03:00
ZyX
5b4f07ee86 spellfile: Use old error
This makes first test not actually show any change in behaviour.
2017-04-09 22:02:51 +03:00
ZyX
8d982ab522 coverity/13686: Do not allow NUL byte in precondition regex
Before this commit it emitted e_spell_trunc in the first case and
treated file as completely valid on the second. While first is fine
(both errors are actually valid, though old error is probably better),
second results in incorrect regex used.
2017-04-09 22:02:36 +03:00
dbdd69e418 Merge pull request #6485 from jamessan/vim-8.0.0377
vim-patch:8.0.0377,8.0.0378,8.0.0322,8.0.0376
2017-04-09 13:25:15 -04:00
ZyX
dbe67868b5 Merge branch 'master' into rename-execute 2017-04-09 19:14:20 +03:00
26bf6e6f6f test/check_cores(): Skip workspace-local temp dir. (#6483)
Avoids this error:
    ./test/helpers.lua:27: cannot open ./Xtest-tmpdir/nvimfqH9dL: No such file or directory
    stack traceback:
        ./test/helpers.lua:27: in function 'glob'
        ./test/helpers.lua:195: in function 'check_cores'
        ./test/functional/helpers.lua:628: in function <./test/functional/helpers.lua:626>
2017-04-09 15:49:31 +02:00
06a96df510 lint 2017-04-09 01:17:15 -04:00
4af6c60826 vim-patch:8.0.0376
Problem:    Size computations in spell file reading are not exactly right.
Solution:   Make "len" a "long" and check with LONG_MAX.

6d3c8586fc
2017-04-09 00:49:53 -04:00
b338bb9d6c vim-patch:8.0.0322
Problem:    Possible overflow with spell file where the tree length is
            corrupted.
Solution:   Check for an invalid length (suggested by shqking)

399c297aa9

CVE-2017-5953
2017-04-09 00:49:32 -04:00
ad66826abe vim-patch:8.0.0378
Problem:    Another possible overflow when reading corrupted undo file.
Solution:   Check if allocated size is not too big. (King)

0c8485f0e4

CVE-2017-6350
2017-04-09 00:49:32 -04:00
fb66a7c69e vim-patch:8.0.0377
Problem:    Possible overflow when reading corrupted undo file.
Solution:   Check if allocated size is not too big. (King)

3eb1637b1b

CVE-2017-6349
2017-04-09 00:49:26 -04:00
ZyX
b99cac2778 cmake: Do not use ExternalProject
Necessary argument (EXCLUDE_FROM_ALL) only appears in 3.1.0.
2017-04-09 06:17:02 +03:00
ZyX
c8243ad071 cmake: Do not build clint-error-files by default 2017-04-09 05:18:09 +03:00
699e8406b5 Merge #6439 from ZyX-I/fix-gc-failures
unittests: Force GC, fix GC failures in typval_spec
2017-04-09 04:05:07 +02:00
cc8f640fb1 Merge #6478 from ZyX-I/conv-fixes
Remove conversions which are not needed when &encoding is UTF-8
2017-04-09 03:59:55 +02:00
3a6b8c28c8 cmake: Use archive instead of downloading *.json files (#6482) 2017-04-09 03:28:48 +02:00
ZyX
967fa96eb2 unittests: Fix linter error 2017-04-09 03:39:37 +03:00
ZyX
8e519a22dd vim.h: Remove strange comments 2017-04-09 03:36:18 +03:00
ZyX
0f4b4c7529 headers: Remove useless HAVE_CONFIG_H macros
We do not have non-cmake build options, cmake always does configure_file.
2017-04-09 03:36:18 +03:00
ZyX
8990490b50 unittests: Move allocating vimconv_T to a function 2017-04-09 03:36:18 +03:00
ZyX
233e71419e unittests: Do not GC typval_T which is owned by a di 2017-04-09 03:36:18 +03:00
ZyX
bac870433b unittests: Do not unref partial which is owned by Callback structure 2017-04-09 03:36:17 +03:00
ZyX
44cd4e63f5 unittests: Use Neovim memory allocation for vimconv_T
Not sure whether this is going to fix things though, but core dump does not 
contain Neovim functions in stack in this case.
2017-04-09 03:36:17 +03:00
ZyX
94c1af7c41 unittests: Do not gc what is already freed 2017-04-09 03:36:17 +03:00
ZyX
7c9c4d9da9 ci: Increase check-single-includes wait time to 10s 2017-04-09 03:36:17 +03:00
ZyX
3321232c81 ci: Allow check-single-includes to hang 2017-04-09 03:36:16 +03:00
ZyX
f5be643205 functests: Fix linter errors 2017-04-09 03:31:13 +03:00
ZyX
0ac2afdec7 functests: Fix some ui/*_spec tests 2017-04-09 03:24:26 +03:00
ZyX
ddaa41dee4 functests: Fix ui/bufhl_spec 2017-04-09 03:24:26 +03:00
ZyX
88ea362c70 functests: Fix ui/screen_basic_spec 2017-04-09 03:24:23 +03:00
ZyX
ba7d8bf0c2 functests: Fix terminal/highlight_spec 2017-04-09 03:24:22 +03:00
ZyX
e0560a0f3f functests: Fix terminal/cursor_spec
It looks like Neovim has a bug: if `startinsert` is called using `command()` 
then `-- TERMINAL --` gets replaced with `-- --` (and also a cursor appears).
2017-04-09 03:24:21 +03:00
ZyX
444cab3731 functests: Fix legacy/wordcount_spec
Another test where bug was hidden by execute().
2017-04-09 03:24:21 +03:00
ZyX
bd84bf8c81 functests: Fix legacy/eval_spec 2017-04-09 03:24:20 +03:00
ZyX
e170186a8d functests: Fix legacy/close_count_spec 2017-04-09 03:24:20 +03:00
ZyX
bc98c37532 functests: Fix legacy/autocmd_option_spec 2017-04-09 03:24:19 +03:00
ZyX
a3b0146fb7 functests: Fix legacy/arglist_spec 2017-04-09 03:24:19 +03:00
ZyX
2824eb7774 functests: Fix legacy/107_adjust_window_and_contents_spec 2017-04-09 03:24:18 +03:00
ZyX
5fd8f637af functests: Fix legacy/097_glob_path_spec 2017-04-09 03:24:18 +03:00
ZyX
9a0c921909 functests: Fix legacy/096_location_list_spec 2017-04-09 03:24:17 +03:00
ZyX
d53fae5f54 functests: Fix legacy/067_augroup_exists_spec 2017-04-09 03:24:15 +03:00
ZyX
69d1003bf7 functests: Fix some tests which are failing locally for unrelated reasons 2017-04-09 03:24:14 +03:00
ZyX
c35bd4d074 functests: Fix legacy/074_global_var_in_viminfo_spec 2017-04-09 03:24:13 +03:00
ZyX
4da4d5cfd9 functests: Fix legacy/065_float_and_logic_operators_spec 2017-04-09 03:24:12 +03:00
ZyX
cb57644cb4 functests: Fix legacy/063_match_and_matchadd_spec 2017-04-09 03:24:10 +03:00
ZyX
b3b31e1065 functests: Fix legacy/062_tab_pages_spec 2017-04-09 03:24:10 +03:00
ZyX
ed0ad7ce3e functests: Fix legacy/051_highlight_spec test 2017-04-09 03:24:09 +03:00
ZyX
a1b81f7eca functests: Fix legacy/030_fileformats_spec test
For some reason it had a number of not working bwipeout! commands. execute() 
successfully hid the failures, command() is not that permissive.
2017-04-09 03:24:09 +03:00
ZyX
65fb622000 functests: Replace execute with either command or feed_command
Hope this will make people using feed_command less likely: this hides bugs.
Already found at least two:

1. msgpackparse() will show internal error: hash_add() in case of duplicate
   keys, though it will still work correctly. Currently silenced.
2. ttimeoutlen was spelled incorrectly, resulting in option not being set when
   expected. Test was still functioning somehow though. Currently fixed.
2017-04-09 03:24:08 +03:00
a34408ef7f test: retry(): Report number of retries. (#6475)
tui_spec.lua: Retry the terminal-mode test.
2017-04-09 02:11:08 +02:00
ZyX
9158cc171f functests: Refactor options/pastetoggle
Note: typo, ttimeoutlen not set ever.

Mention @hardenedapple
2017-04-08 23:48:22 +03:00
ZyX
dd93733e52 functests: Refactor legacy/054_buffer_local_autocommands_spec 2017-04-08 22:33:02 +03:00
ZyX
cca029bc8d functests: Refactor legacy/003_cindent_spec and legacy/increment_spec 2017-04-08 22:17:39 +03:00
ZyX
7766b24f3c functests: Refactor legacy/018_unset_smart_indenting_spec 2017-04-08 22:02:44 +03:00
ZyX
e31aab8b61 functests: Refactor legacy/029_join test 2017-04-08 22:00:50 +03:00
ZyX
47b451c52b functests: Refactor legacy/012_directory_spec 2017-04-08 21:58:13 +03:00
ZyX
b0731290e8 functests: Move test from legacy/009 to autocmd/autocmd 2017-04-08 21:50:14 +03:00
ZyX
1ef98b34b3 functests: Refactor 009_bufleave_autocommand_spec
It was not testing anything actually: the `e yy` command simply failed because 
of unsaved changes, BufLeave never run thus.
2017-04-08 21:46:30 +03:00
ZyX
a40a969e9a api: Rename _vim_id functions to nvim__id 2017-04-08 20:33:48 +03:00
ZyX
7b6b629e1a api: Add FUNC_API_SINCE(1) to new functions 2017-04-08 20:30:26 +03:00
ZyX
7701014b65 *: Remove useless asserts 2017-04-08 20:22:46 +03:00
ZyX
467a02f88d doc: Update documentation 2017-04-08 19:34:01 +03:00
cd0a436622 refactor/single-include
Closes #6463
refactor/single-include: file_search.h
Closes #6455
refactor/single-include: hardcopy.h
Closes #6457
refactor/single-include: if_cscope.h
Closes #6458
refactor/single-include: mark.h
Closes #6461
refactor/single-include: mbyte.h
Closes #6462
refactor/single-include: memline.h
Closes #6464
refactor/single-include: menu.h
Closes #6468
refactor/single-include: ops.h
Closes #6470
2017-04-08 18:26:33 +02:00
ZyX
ab19fa1552 *: Fix linter errors
Drops comments `// for …` that do not pass linter for them being unmaintainable 
and fast to becoming incomplete or even incorrect.

Mention @dedmass
2017-04-08 19:20:42 +03:00
ZyX
dc9722326e unittests: Do not alter p_enc in decode unit test 2017-04-08 19:20:41 +03:00
ZyX
e814695223 eval/*code,shada: Drop support for converting UTF-8 from/to p_enc
Not needed any longer since p_enc is always utf-8.
2017-04-08 19:20:41 +03:00
ZyX
6006cb74ef eval/decode: Omit calling convert_setup for each string
Uses the same trick eval/encode does.
2017-04-08 19:00:05 +03:00
ZyX
b3587a456b shada: Initialize vimconv_T 2017-04-08 19:00:05 +03:00
ZyX
e586047a53 eval/decode,shada: Do not forget to clean up converters 2017-04-08 19:00:04 +03:00
3fd9b70c48 refactor/single-include: fold.h #6456 2017-04-08 04:53:17 +02:00
fd69c3f561 refactor/single-include: ex_getln.h #6454 2017-04-08 04:49:32 +02:00
89deb6ff22 refactor/single-include: memline_defs.h #6465 2017-04-08 04:20:37 +02:00
b47e1029a5 refactor/single-include: move.h #6469 2017-04-08 04:18:12 +02:00
3d4a2ee9c7 refactor/single-include: ex_cmds.h #6453 2017-04-08 04:16:29 +02:00
f4e97fe499 refactor/single-include: digraph.h #6444 2017-04-08 04:14:05 +02:00
fd8f18bce2 refactor/single-include: cursor_shape.h #6442 2017-04-08 04:09:32 +02:00
fd4b34af47 Merge #6473 from jamessan/vim-8.0.0499
vim-patch:8.0.0499,8.0.0550
2017-04-08 17:01:16 +02:00
ZyX
a83511d1a1 unittests: Move checking cores to check_child_err 2017-04-08 04:48:58 +03:00
ZyX
acc52a953b regexp: Update comment in cstrchr() 2017-04-08 02:55:51 +03:00
ZyX
043d8ff9f2 Merge branch 'master' into luaviml'/lua 2017-04-08 01:54:58 +03:00
123931e65e lint 2017-04-07 16:38:06 -04:00
98dd9b8012 vim-patch:8.0.0550
Problem:    Some etags format tags file use 0x01, breaking the parsing.
Solution:   Use 0x02 for TAG_SEP. (James McCoy, closes vim/vim#1614)

9585a1655b
2017-04-07 16:32:22 -04:00
ZyX
caeff6e1af regexp: Do not use locale-dependent functions in cstrchr 2017-04-07 23:18:36 +03:00
20dc04470e vim-patch:8.0.0499
Problem:    taglist() does not prioritize tags for a buffer.
Solution:   Add an optional buffer argument. (Duncan McDougall, closes vim/vim#1194)

c6aafbaf3e
2017-04-07 16:18:04 -04:00
ZyX
ac1cb1c72f regexp: Refactor cstrchr
Ref #1476
2017-04-07 23:15:56 +03:00
ZyX
171baaee93 strings: Remove vim_strbyte
Ref #1476
2017-04-07 23:15:53 +03:00
ZyX
19044a15f9 strings: Replace vim_strchr implementation with a saner one
Removes dead code (enc_utf8, enc_dbcs and has_mbyte now have hardcoded values),
relies on libc implementation being more optimized. Also where previously
negative character just would never be found it is an assertion error now.

Ref #1476
2017-04-07 23:15:08 +03:00
13352c00f1 win: os_get_hostname() #5416 (#6413) 2017-04-07 19:46:33 +02:00
1813076c44 eval: delimit string with NUL byte (#6467)
A recent refactor left cpy without a NUL terminator, simplify the code
instead of patching over it.

Instead of plain memcpy, it'd be better to employ harder to misuse string
functions made for this purpose like xstrlcpy(), but path_tail() takes
char_u arguments and returns them, leading to a lot of ugly casting.

Fixes #6431.
2017-04-07 12:29:17 +02:00
ZyX
654dd15bb8 unittests: Fix testlint failure 2017-04-07 00:46:52 +03:00
ZyX
c1416e0665 ci: Really continue tests on failure, print global summary 2017-04-07 00:46:52 +03:00
30e1cda8ac completion: fix segfault with ignorecase+infercase (#6452)
Helped-by: Matthew Malcomson <hardenedapple@gmail.com>

Closes #6451
2017-04-06 21:35:03 +02:00
071f2da66b vim-patch:7.4.2359
Problem:    Memory leak in timer_start().
Solution:   Check the right field to be NULL.

26fe0d5691
2017-04-06 08:58:47 -04:00
9edbeec077 vim-patch:7.4.2332
Problem:    Crash when stop_timer() is called in a callback of a callback.
            Vim hangs when the timer callback uses too much time.
Solution:   Set tr_id to -1 when a timer is to be deleted. Don't keep calling
            callbacks forever. (Ozaki Kiichi)

75537a93e9
2017-04-06 08:57:22 -04:00
0f99645b8f vim-patch:7.4.2304
Problem:    In a timer callback the timer itself can't be found or stopped.
            (Thinca)
Solution:   Do not remove the timer from the list, remember whether it was
            freed.

417ccd7138
2017-04-06 08:56:35 -04:00
6a6bbbc6d8 vim-patch:7.4.2281
Problem:    Timer test fails sometimes.
Solution:   Reduce minimum time by 1 msec.

0426bae2ab
2017-04-06 08:55:37 -04:00
c501d7c432 refactor/single-include: diff.h (#6443) 2017-04-06 14:48:42 +02:00
ZyX
271df03fa4 unittests: Force GC, fix GC failures in typval_spec 2017-04-06 07:29:15 +03:00
bb54d921aa Merge remote-tracking branch 'origin/master' into vim-7.4.2170 2017-04-05 22:39:40 -04:00
210b013ce7 vim-patch: Update regex for included_patches array (#6449)
28dafe3ff const-ified the array without updating the regex.

[ci skip]
2017-04-06 02:10:20 +02:00
cde51dd6f4 Merge #6440 'test: Remove "tickle" hack' 2017-04-06 01:07:22 +02:00
8863af28b8 test: retry() works with asserts; error() not required. 2017-04-06 01:06:40 +02:00
3b558e5d7b tests: short form screen:except(func) expects condition only. #6440
- Use this to properly test cursor shape events.
- tests: update screen_basic_spec to use `screen:expect` short form.
  Clearer than using `screen:wait` directy.
2017-04-06 01:06:39 +02:00
4566f7c7cd Merge #6432 from justinmk/guicursor 2017-04-04 15:26:32 +02:00
a7f34e1991 options: remove 'guiheadroom' 2017-04-04 14:19:26 +02:00
e348e256f3 'guicursor': Disable by default for unknown terminals.
User can still set guicursor explicitly in init.vim.

Closes #5990
Closes #6403
2017-04-04 14:19:26 +02:00
3ccd59ee82 'guicursor': enabled=false if 'guicursor' is empty
Closes #6429
Closes #6430
2017-04-04 14:19:26 +02:00
9d560d5c6b Merge #6436 from ZyX-I/restart-includes-cleanup
Clean-up before restarting single-includes test
2017-04-04 14:16:14 +02:00
ZyX
017f64b970 ci: Also fail if last restart hang up 2017-04-04 04:59:30 +03:00
ZyX
dcad882256 ci: Do not fail csi_clean if there are no files to remove 2017-04-04 04:17:40 +03:00
ZyX
d59378a5ca ci: Force make output coloring 2017-04-04 04:03:50 +03:00
ZyX
644db2165e ci: Clean up when restarting single includes test 2017-04-04 03:58:10 +03:00
bc6d868d00 'listchars': Whitespace highlight group #6367 2017-04-03 14:10:40 +02:00
6afa7d66cd Merge #6427 from ZyX-I/writefile-allow-omitting-fsync
eval: Make writefile() able to disable fsync()
2017-04-03 03:54:34 +02:00
ZyX
ae7d8d8ffb ci: Do not mark test as failed if it is previous one which failed 2017-04-03 03:47:42 +03:00
ZyX
ac87c7e5ae fileio: Fix most linter errors
One error is still kept: buf_write function is too large.
2017-04-03 03:46:44 +03:00
ZyX
dc75766081 tests: Fix testlint errors 2017-04-03 03:07:01 +03:00
ZyX
9912043103 functests: Test some :write errors 2017-04-03 03:04:10 +03:00
ZyX
2dbd49f73c fileio: Save details about E212 error 2017-04-03 03:02:17 +03:00
ZyX
97a7f4745d eval: Add s flag, use p_fs by default, error out on unknown flag 2017-04-03 02:11:27 +03:00
ZyX
5dcf280445 fileio: Refactor msg_add_fname to something which needs no comments 2017-04-03 02:03:05 +03:00
ZyX
1c41b9c775 fileio: Clean up IObuff-manipulation mess 2017-04-03 01:39:09 +03:00
ZyX
8eb598c08e fixup! 2017-04-03 00:44:49 +03:00
ZyX
8dd9c6edd8 message: Do not use IObuff in emsgf 2017-04-03 00:40:48 +03:00
ZyX
364709bedb fileio: Refactor errmsg handling
Adds os_strerror() result to a number of places. Also since I could not track 
where err\* variables are NULL and where they are not, using macros to make sure 
that all three variables are set at once.

Removes #ifdef UNIX around the use of os_fsync, makes it use os_close in place 
of close in some places.
2017-04-03 00:35:29 +03:00
ZyX
b10880dadc eval: Make writefile() able to disable fsync() 2017-04-02 22:11:35 +03:00
ddfa0359c6 unittests: Make it easier to determine on which _spec line it crashed (#6424)
Benchmarks:

Before change: 17.78s user 3.48s system  94% cpu 22.525 total
After change:  25.38s user 4.46s system 101% cpu 29.317 total
2017-04-02 13:25:47 +02:00
58422f17d8 Merge #6423 from justinmk/guicursor 2017-04-02 02:32:36 +02:00
a7569b50b7 Merge pull request #6338 from jamessan/llvm-update
Bump LLVM to 3.9
2017-04-01 20:09:26 -04:00
1ad5644006 Merge #6409 from ZyX-I/separate-clint
cmake: Add `clint` target to build Makefile
2017-04-02 01:20:16 +02:00
16babc6687 tui: Only enable/disable mouse when there's something to do (#6411)
If we get a mouse_on/mouse_off event, but the mouse is already in the
corresponding state, there's no need to send the event up to the
terminal.

Closes #4394
2017-04-02 00:00:42 +02:00
3a69dbfca6 api/cursor_style_set: mode descriptions 2017-04-01 23:29:10 +02:00
c2826a7830 'guicursor': Empty means "block cursor in all modes".
Also: update default 'guicursor' to match the documentation.
2017-04-01 23:14:05 +02:00
54bab0019b tui: 'guicursor' color
For now only supports valid hex colors (does not check for the validity
the hex color) when termguicolors is set, otherwise it won't attempt to
change the cursor color.
2017-04-01 23:14:05 +02:00
dd4a5fcbb6 tui: 'guicursor' shape #6044
Closes #2583
2017-04-01 23:14:05 +02:00
518f28f537 Merge #6422 from ZyX-I/fix-6420
eval,fileio: Omit additional fsync() call
2017-04-01 22:38:20 +02:00
337b6179df 'pastetoggle': support value >1 char (#6421)
If we `set pastetoggle=abcde`, and manually type it, then `vgetorpeek()`
sees part of the option before it has all been inserted into the
typebuffer.
To signify this it sets `keylen = KEYLEN_PART_KEY`, but the condition
about whether to return the current key from `vgetorpeek()` only checks
for `keylen = KEYLEN_PART_MAP`.
Add a check for `KEYLEN_PART_KEY` to account for the `'pastetoggle'`
option.
2017-04-01 21:50:29 +02:00
ZyX
19690d4a25 eval: Do not allocate FileDescriptor 2017-04-01 22:26:50 +03:00
0f6608d039 Merge #6418 from ZyX-I/better-unittests 2017-04-01 20:48:03 +02:00
ZyX
cc4523013f eval,fileio: Omit additional fsync() call
Fixes #6420
2017-04-01 21:15:13 +03:00
ZyX
ac22238b6a unittests: Replace two environment variables with one TRACE_LEVEL 2017-04-01 20:57:23 +03:00
33ff29fc74 Merge #6344 'vim-patch:7.4.2236,7.4.2306' 2017-04-01 17:42:15 +02:00
45a13c4bbc vim-patch:7.4.2306
Problem:    Default value for 'langremap' is wrong.
Solution:   Set the right value. (Jürgen Krämer)  Add a test.

da9ce2cde1
2017-04-01 22:46:27 +08:00
53da57d27a vim-patch:7.4.2236
Problem:    The 'langnoremap' option leads to double negatives.  And it does
            not work for the last character of a mapping.
Solution:   Add 'langremap' with the opposite value.  Keep 'langnoremap' for
            backwards compatibility.  Make it work for the last character of a
            mapping.  Make the test work.

920694c1b6
2017-04-01 22:45:36 +08:00
4049492b6d also test set_option 2017-04-01 12:26:58 +02:00
ZyX
2d158dde02 unittests: Fix linter error 2017-04-01 13:17:25 +03:00
ZyX
708a55ee15 unittests: Disable non-C-calls
Some benchmarks:

TRACE_EVERYTHING: 79.45s user 12.68s system 124% cpu 1:13.94  total

(default):        30.26s user  5.30s system  89% cpu   39.663 total
2017-04-01 13:16:25 +03:00
ZyX
9dd0d4f8b9 unittests: Add trace description right to the error message 2017-04-01 12:52:28 +03:00
ZyX
046d6a8dfe unittests: Collect traces
Some benchmarks:

MAIN_CDEFS + NO_TRACE:  3.81s user  1.65s system  33% cpu   16.140 total

MAIN_CDEFS:            73.61s user 10.98s system 154% cpu   54.690 total

NO_TRACE:              18.49s user  4.30s system  73% cpu   30.804 total

(default):             77.11s user 14.74s system 126% cpu 1:12.79  total
2017-04-01 12:25:10 +03:00
ZyX
8f7a48f46a unittests: Split itp implementation into multiple functions 2017-04-01 11:19:41 +03:00
ZyX
933d60bc23 unittests: Do not hang when error message is too long 2017-04-01 11:07:08 +03:00
8de53157b6 build: avoid cmake warning (#6417) 2017-04-01 03:22:56 +02:00
ZyX
6ddaace7ac ci: Do not shift if there are not enough arguments 2017-03-31 20:52:05 +03:00
ZyX
86f5b1276b ci: Add test watchdog and tracing for lint tests 2017-03-31 19:42:18 +03:00
8a55f9b1c8 update for changes in master; fix 'window'; tests 2017-03-31 18:30:06 +02:00
ZyX
929c398aab ci: Enable tracing 2017-03-31 19:09:18 +03:00
ZyX
d9069b9fe4 ci: Check for exact value of CI_TARGET, not its emptyness 2017-03-31 17:39:18 +03:00
4bae3f48fe ci: Bump clang version to 3.9 2017-03-31 10:03:43 -04:00
1b276be6e5 ci: Use LLVM's trusty repo to match Travis' Ubuntu version 2017-03-31 10:03:43 -04:00
ZyX
4c20733f6b ci: Add ${NL} variable 2017-03-31 16:19:47 +03:00
ZyX
2da3caef1b ci: Do not quote MAKE_CMD 2017-03-31 16:17:38 +03:00
ZyX
1e87061294 makefile: Make lint target depend on clint 2017-03-31 16:08:02 +03:00
ZyX
2bf9d36ccd ci: Refactor CI scripts
1. CI_TARGET now determines which run_${CI_TARGET}.sh script to use. Defaults to
   `tests`.
2. Build no longer halts on the first failing suit: e.g. if functional tests
   failed it will continue with unit tests, etc.
3. All ${MAKE_CMD} occurrences moved to `top_make` function, added `build_make`
   as an alias to `make -C build` (`"${MAKE_CMD}" -C "${BUILD_DIR}"`) which is
   too verbose.

`suite.sh` was copied from powerline (tests/common.sh file), assumes running
with POSIX shells (and actually uses dash in powerline). Then some convenience
functions were added (run_test and below).
2017-03-31 16:06:17 +03:00
ZyX
4d0f90f94d cmake: Also depend on LINT_PRG 2017-03-31 16:04:18 +03:00
ZyX
4fc2be490c clint: Do not report zero errors 2017-03-31 16:04:18 +03:00
ZyX
c61858a997 cmake: Replace RunLint.cmake with code in src/nvim/CMakeLists.txt
This also removes LINT_FILE environment variable, other then that functionality 
is kept. It is expected that developers needing partial linting will use `make 
lint`, touching interesting file before (if not done already by writing to 
them).
2017-03-31 16:04:18 +03:00
ZyX
24fd125893 cmake: Allow failing to download small suppress files 2017-03-31 16:04:18 +03:00
ZyX
8204eaea7f cmake: Make Download.cmake check for errors
Copying from third-party/cmake/DownloadAndExtractFile.cmake.
2017-03-31 16:04:17 +03:00
ZyX
0b528fc4b5 cmake: Use file-specific supprresses
`make -C build clint` time is now

    make -j5 clint  95.29s user 1.86s system 409% cpu 23.751 total

*without* downloading anything (much worse if something was not cached, still 
a bit better then top-level `make clint`). But since without neovim/bot-ci#95 it 
is downloading each file one-by-one total time with download (download also 
parallel!) is

    make -j5 -B clint  99.29s user 2.98s system 258% cpu 39.634 total

Top-level makefile still gives

    make -j5 clint  59.33s user 0.28s system 95% cpu 1:02.41 total
2017-03-31 16:04:17 +03:00
ZyX
030c0588a0 cmake: Add clint target to build Makefile
Allows linting only modified files and linting multiple files in
parallel. In the current state is rather slow because errors.json is
a 6 MiB file and needs to be reparsed each time.

Results on my system (6-core):

    # In build dir, actually parallel
    make -j5 clint  241.24s user 8.39s system 334% cpu 1:14.74 total
    # In root, one process
    make -j5 clint  60.69s user 0.37s system 93% cpu 1:05.19 total

In both cases download time included.

That is not well for travis (though I would keep travis as-is because
new variant will fail before checking all files), but already good
enough for regular development: total times are nearly identical and
this is the *full* build, further `make -C build clint` will check only
modified files.
2017-03-31 16:04:17 +03:00
a1c928e70c ci: Do not hide ci directory (#6410) 2017-03-31 14:32:58 +02:00
77539eef9b Merge pull request #6397 from jamessan/coverity
Fix latest Coverity issues
2017-03-31 07:52:45 -04:00
1097ba53f8 Merge pull request #6406 from jamessan/msgpack-c-2.1.x-compat
Add handling for MSGPACK_OBJECT_FLOAT{32,64}
2017-03-31 07:51:38 -04:00
338da727cd coverity/161216: Ensure buf is valid for lifetime of defstr
Depending on the type of argument for input()/inputdialog()'s {text}
argument, defstr may point to buf.  Therefore it needs to be in scope
for the lifetime of defstr.

Also, use a different buffer for the handling of the 3rd argument to
input()/inputdialog().  Although the buffer defstr points to is used
immediately, it avoids potential mishaps if the code changes.
2017-03-30 22:30:02 -04:00
193aa4c140 third-party: Avoid building msgpack-c examples 2017-03-30 21:35:37 -04:00
f4a3a96b68 Add handling for MSGPACK_OBJECT_FLOAT{32,64}
msgpack-c previously only had MSGPACK_OBJECT_FLOAT, which was a 64-bit
value.  Now, 32-bit and 64-bit floats are supported as distinct types,
but we'll simply continue to treat everything as 64-bit types.
2017-03-30 21:35:36 -04:00
af2ee9c5d1 cmake: Detect whether msgpack-c has MSGPACK_OBJECT_FLOAT{32,64} types 2017-03-30 21:35:36 -04:00
d92add8a4b third-party: Bump msgpack-c to 2.1.1 2017-03-30 21:35:29 -04:00
3a9dd13f9e fold.c: more edge-cases when updating (#6207)
When foldUpdateIEMSRecurse() re-uses an existing fold, it misses the
case where the existing fold spans from before startlnum to after
firstlnum, the new fold does not span this range, and there is no
"forced start" of a fold. We add a case for this in.

Ensure that if there was no forced break in folds, we merge folds that
now touch each other.

Include testing for a tricky foldmethod=expr case that has never been a
bug. This case works at the moment because of some effects that are not
obvious when reading the code.
A test for this could be useful to ensure a regression doesn't happen.

vim-patch:8.0.0408
2017-03-31 01:21:26 +02:00
831eb2a9bf vim-patch:7.4.2104 (#6332)
Problem:    Code duplication when unreferencing a function.
Solution:   De-duplicate.

97baee80f0
2017-03-31 01:07:39 +02:00
db095f6563 options: more tests; check first set later; stricter validation 2017-03-30 23:04:54 +02:00
44f039a1c8 options: fix setglobal for buf-local number options 2017-03-30 23:04:54 +02:00
2290a7a1b1 options: group num_option validation by type 2017-03-30 23:04:54 +02:00
2b0abdbd9a options: more of the same 2017-03-30 23:04:54 +02:00
0273f96ef6 options: move more validation together 2017-03-30 23:04:54 +02:00
1a56a032fe options: clean up num_options side-effects 2017-03-30 23:04:54 +02:00
f4920fb485 options: if invalid value is given, reset to old value 2017-03-30 23:04:54 +02:00
79d3e94942 options: move code around in set_num_option
handle side-effects after validation
2017-03-30 23:04:54 +02:00
628d0335b8 options: add some tests 2017-03-30 23:04:54 +02:00
e47622f26b options: setlocal should only set local value
For 'iminsert' and 'imsearch' the global value was always changed.
2017-03-30 23:04:54 +02:00
eb0e94f71b api: {get,set}_option should {get,set} global value of local options (#6405)
- nvim_get_option should return the global default of a local option.
- nvim_set_option should set the global default of a local option.
2017-03-30 22:03:52 +02:00
66b336d89b test: set 'nomore' by default (#6360)
Escaping from a '-- More --' prompt in tests is awkward as it doesn't
take keys from the typebuffer, requiring a call to `feed()` in lua at
the correct time. Moreover, it's rarer that a test will want the
'-- More --' prompt to be activated than not.
2017-03-30 19:00:34 +02:00
75b98f7c3f Remove PVS-Studio cruft
[ci skip]
2017-03-30 10:09:33 -04:00
8d13955328 Merge #6395 'test: Use workspace-local temp directory.' 2017-03-30 03:50:17 +02:00
1222c82799 coverity/16127: Verify lang is non-NULL before calling strlen 2017-03-29 21:34:04 -04:00
91dfebf050 ci: Update Coverity model for typval refactoring
[ci skip]
2017-03-29 21:16:58 -04:00
1c6ae58fd1 coverity/161194: Restore check for 'keywordprg' being ":help"
998d0ffc09 removed the explicit check for
":help", relying instead on whether the user was in a help buffer.
However, this breaks escaping the identifier for use in the lookup
command.

2f54d6927c tried to fix this by removing
"!kp_ex" in "if (cmdchar == 'K' && !kp_ex)", but that causes shell
escaping to be used instead of escaping for tag lookup.
2017-03-29 21:16:58 -04:00
3116f870ba coverity/161195: Increase scope of exe_name
Since exe_name is a stack allocated array, we need it to be in scope for
the lifetime that vim_path points to it.
2017-03-29 21:16:50 -04:00
1ea9ebf112 test: Use workspace-local temp directory.
Closes #6291
2017-03-30 02:55:00 +02:00
1f478cebeb win: tempname(): Use $TMPDIR if defined. 2017-03-30 02:55:00 +02:00
6964b67c00 refactor/single-include: buffer.h (#6396) 2017-03-30 00:50:11 +02:00
c60e409471 Merge #5119 from ZyX-I/split-eval 2017-03-29 23:15:07 +02:00
c35420558b Merge #6394 'ci: check-single-includes only in "lint" build' 2017-03-29 18:44:43 +02:00
afacda046d ci: Run check-single-includes in "lint" build only 2017-03-29 18:02:09 +02:00
05b74399aa build: remove unused get_preproc_output() call
ref https://github.com/neovim/neovim/pull/6375#discussion_r108573471
2017-03-29 17:39:06 +02:00
2846d508b2 vim-patch:7.4.2276 (#6393)
* vim-patch:7.4.2276

Problem:    Command line test fails on Windows when run twice.
Solution:   Wipe the buffer so that the directory can be deleted.

1773ddfdcd

* version.c: mark vim-patch 7.4.2269 as included (#5659)
2017-03-29 16:48:50 +02:00
ZyX
46efe14473 functests: Try sleeping a bit more 2017-03-29 10:08:46 +03:00
ZyX
b9603218be eval/executor: Fix check-single-includes 2017-03-29 10:08:46 +03:00
ZyX
a1d590a08b *: Use const char * in set_one_cmd_context
Also renames functions added in master and renamed here.
2017-03-29 10:08:46 +03:00
ZyX
114eaa15f0 eval/typval,api/buffer: Fix review comments 2017-03-29 10:08:46 +03:00
ZyX
58e34e8d99 eval/typval: Allow NULL dict as tv_dict_get_callback() argument
Also removes NULL key input: tv_dict_find() does not allow this.
2017-03-29 10:08:46 +03:00
ZyX
f4256243db eval: Fix -Werror=unitialized from QB 2017-03-29 10:08:46 +03:00
ZyX
29bad04f9e eval: Do not supply S_LEN to strncmp
It may be a macro as well.
2017-03-29 10:08:46 +03:00
ZyX
8daf756fb6 unittests: Fix linter errors 2017-03-29 10:08:46 +03:00
ZyX
7826ee1c03 unittests: Add tv_get_string* tests 2017-03-29 10:08:46 +03:00
ZyX
e08b27ba4a unittests: Add tv_get number tests 2017-03-29 10:08:46 +03:00
ZyX
4536c064e4 unittests: Move tv_dict_add* tests to a proper describe() block 2017-03-29 10:08:46 +03:00
ZyX
49195063fd unittests: Add tv_check… tests 2017-03-29 10:08:46 +03:00
ZyX
389274bef7 unittests: Add tv_equal() tests 2017-03-29 10:08:46 +03:00
ZyX
630ff33dc1 unittests: Test locks section 2017-03-29 10:08:46 +03:00
ZyX
ed4948a933 unittests: Test tv_copy() 2017-03-29 10:08:46 +03:00
ZyX
f0bbd1e825 unittests: Add tests for tv_clear() 2017-03-29 10:08:46 +03:00
ZyX
e43de6bb3e unittests: Add test for tv_dict_set_keys_readonly 2017-03-29 10:08:45 +03:00
ZyX
368a61c525 unittests: Add tv_dict_copy tests 2017-03-29 10:08:45 +03:00
ZyX
218fa1d806 charset: Remove useless condition from vim_iswordc_tab 2017-03-29 10:08:45 +03:00
ZyX
8b9a1fbf7a unittests: Add tests for tv_dict_extend 2017-03-29 10:08:45 +03:00
ZyX
fa852e7cdc eval: Fix extend() behaviour with NULL lists and dictionaries
Ref #4615
Ref vim/vim#768
2017-03-29 10:08:45 +03:00
ZyX
4987850cac unittests: Add tv_dict_clear tests 2017-03-29 10:08:45 +03:00
ZyX
43e9fad1c8 eval: Use tv_is_func in place of ==VAR_FUNC||==VAR_PARTIAL
Also fixes same error as in vim/vim#1557
2017-03-29 10:08:45 +03:00
ZyX
270a3889af unittests: Add tv_dict_add* unit tests
Also fixes incorrect location of `tv_dict_add` function and three bugs in other 
functions:

1. `tv_dict_add_list` may free list it does not own (vim/vim#1555).
2. `tv_dict_add_dict` may free dictionary it does not own (vim/vim#1555).
3. `tv_dict_add_dict` ignores `key_len` argument.
2017-03-29 10:08:45 +03:00
ZyX
bc87d23c28 unittests: Add tests for dictionary indexing 2017-03-29 10:08:45 +03:00
ZyX
b222453c95 eval/typval: Refactor errors a bit: use emsgf always 2017-03-29 10:08:45 +03:00
ZyX
5ce6243241 unittests: Enable tv_list_join tests back
Unable to reproduce the problem on Mac OS X Sierra VPS, need to check whether it 
is reproducible on travis.
2017-03-29 10:08:45 +03:00
ZyX
52e226ff74 unittests: Disable tv_list_join test on Mac OS only 2017-03-29 10:08:45 +03:00
ZyX
f830243ff7 mbyte: Include os_defs.h in mbyte.h 2017-03-29 10:08:45 +03:00
ZyX
3bf87a5a6b eval: Do not use S_LEN as snprintf argument 2017-03-29 10:08:45 +03:00
ZyX
38dd81c136 eval/typval: Fix SEGV in test_alot.vim test 2017-03-29 10:08:45 +03:00
ZyX
faddd83db8 eval: Fix SEGV in test49 2017-03-29 10:08:45 +03:00
ZyX
6c622ed08b unittests: Add tv_dict_item_{add,remove} tests 2017-03-29 10:08:45 +03:00
ZyX
ffaf7c7521 unittests: Add tv_dict_item_{alloc,free} tests 2017-03-29 10:08:45 +03:00
ZyX
cdb1aa3e47 eval: Fix len argument to xstrlcat 2017-03-29 10:08:45 +03:00
ZyX
2c8ad27652 ascii: Readd DEL_STR define 2017-03-29 10:08:45 +03:00
ZyX
c6c48e8672 syntax: Fix linter error 2017-03-29 10:08:45 +03:00
ZyX
78a0de2c1b eval/typval: Fix -Werror=return-type 2017-03-29 10:08:45 +03:00
ZyX
4c3be98db9 unittests: Add tv_dict_watcher_{add,remove} tests 2017-03-29 10:08:45 +03:00
ZyX
140174669e unittests: Run tv_list_join tests in case it stopped failing 2017-03-29 10:08:45 +03:00
ZyX
6aa6e50075 eval: Fix linter errors 2017-03-29 10:08:45 +03:00
ZyX
506b938947 *: Make some more things const and with length 2017-03-29 10:08:44 +03:00
ZyX
3025431c81 eval: Make sure that v:_null_dict does not crash dictwatcher*()
Ref #4615
2017-03-29 10:08:44 +03:00
ZyX
a56f2d27e3 eval: Make dictionary watchers work with empty keys
Looks like dict_notifications_spec test used to depend on some state which
should not be preserved. Changed all `setup()` calls to `before_each()` and
added necessary state in addition to changes required to test empty keys.

Note: unit tests for tv_dict_watcher* are still needed.
2017-03-29 10:08:44 +03:00
ZyX
1e3e302dc2 eval: Move part of dictwatcher* functions to eval/typval 2017-03-29 10:08:44 +03:00
ZyX
5239616297 functests: Fix buf_functions test on Windows 2017-03-29 10:08:44 +03:00
ZyX
4bcee96347 *: Fix some Windows-specific warnings
Also fixed an error in path_fnamecmp().
2017-03-29 10:08:42 +03:00
ZyX
9ed9af7e11 eval/typval: More const qualifiers in tv_dict* function signatures 2017-03-29 10:08:06 +03:00
ZyX
56e51033ab unittests: Add tests for tv_list_idx_of_item 2017-03-29 10:08:06 +03:00
ZyX
e5edf07ec4 unittests: Add tests for tv_list_find*() functions
Additional modifications:

- More `const` qualifiers in tested functions.
- `tv_list_find_str()` second argument is more in-line with other
  `tv_list_find*()` functions.
2017-03-29 10:08:06 +03:00
ZyX
b3672ae2fc eval/typval: Add tv_list_equal() tests, compare NULL lists equal 2017-03-29 10:08:06 +03:00
ZyX
4f9e784427 unittests: Test tv_list_join() 2017-03-29 10:08:06 +03:00
ZyX
cf45c7bb05 unittests: Fix tests crash
Tests crash at some point without
- `after_each(collectgarbage)` right before “typval.c list copy() copies list
  correctly and converts items” test.
- Commenting out that test.
- Adding `collectgarbage()` after the test (what actually this commit does).

Adding `collectgarbage()` to top-level `after_each` block right after
`restore_allocators` makes running this file crash even if it is run alone.
2017-03-29 10:08:06 +03:00
ZyX
7ceebacb3f eval/typval,tests: Fix extending list with itself, add tests
Adds unit test for tv_list_extend and regression test for extend() VimL
function.
2017-03-29 10:08:06 +03:00
ZyX
56e4c2f67e unittests: Test tv_list_concat() 2017-03-29 10:08:06 +03:00
ZyX
f80a00469f eval/typval: Make tv_list_concat handle NULL lists correctly
Fixes some FIXMEs in eval/null_spec.lua.
2017-03-29 10:08:06 +03:00
ZyX
82e6cac5f9 functests: Add null_spec.lua from #4615
For now it is full of FIXMEs and tests for incorrect behaviour. Sorted out to
have FIXMEs in one place, commented crashing tests in other and correctly
working tests in the third one.
2017-03-29 10:08:06 +03:00
ZyX
9898f36aa3 unittests: Test tv_list_copy
Also found some bugs:

1. var_item_copy() always fails to copy v:_null_list and v:_null_dict. Fixing
   this should mean fixing `deepcopy(v:_null_list)` which should’ve been, but
   was not listed in #4615. This also fixes `deepcopy(v:_null_dict)`.
2. var_item_copy() crashes when trying to copy NULL string with `conv != NULL`.
3. `conv` argument is ignored when copying list unless `deep` is true, but it
   was not reflected in documentation.
4. `tv_dict_item_alloc_len()` allocated more memory then needed.
5. typvalt2lua was not able to handle self-referencing containers.
2017-03-29 10:08:06 +03:00
ZyX
9b8beaff02 unittests: Add tests for tv_list_insert*()/…append*() functions 2017-03-29 10:08:06 +03:00
ZyX
be360d8841 unittests: Add tests for tv_list_insert() 2017-03-29 10:08:06 +03:00
ZyX
d2639e1e1d unittests: Add tests for list watchers and list alloc/free/unref 2017-03-29 10:08:06 +03:00
ZyX
a394167177 unittests: Test tv_list_item_\* functions
To check that memory is free()d correctly.
2017-03-29 10:08:06 +03:00
ZyX
a32db8ed19 eval/typval: Add missing includes, also add a script to find them
Contains unfinished attempt to integrate IWYU (ref #549). To finish it different
job should be done, specifically:

- Instead of feeding IWYU with modified file a mirror source tree should be
  created with the help of CMake which will contain modified sources. This
  solves the problem with IWYU thinking that `*.generated.h` headers should be
  included in place of `*` headers.
- Build IWYU as all other third-party utilities.
- Make modified sources avoid problems with `nvim/func_attr.h` includes and
  various related tricks.

Current script may only be used for manual checks like this:

    ./scripts/check-includes.py \
        --generated-includes-dir build/include \
        --generated-includes-dir build/src/nvim/auto \
        --file src/nvim/eval/typval.c \
        -- -Isrc -Ibuild/include -Ibuild/src/nvim/auto \
           -DINCLUDE_GENERATED_DECLARATIONS

(it is also somewhat fine with `--file src/nvim/eval/typval.h`). I have no idea
why (I mean, why developer think that these lines are needed, why they are
suggested is pretty obvious: because there is typedef which mentions them before
structs are defined), but for typval.h it reports, among other things, that it
should add lines

    struct dictvar_S;
    struct listitem_S;
    struct listvar_S;
    struct listwatch_S;
2017-03-29 10:08:06 +03:00
ZyX
2ad4fba46d eval: Move copy_tv to eval/typval 2017-03-29 10:08:06 +03:00
ZyX
8b0fa64ed3 message: Remove incorrect assertion
It was there only to prove that *now* `len` argument is not used to forbid 
putting message into history (i.e. that Neovim behaviour did not change). After 
this commit it should be possible to use msg_puts_attr_len with len>=0 to put 
message into history should new code need this.
2017-03-29 10:08:06 +03:00
ZyX
40feac6efc message: Revise maxlen argument in msg_puts_attr_len
`attr` argument is enough to forbid putting message in history. Also forbid 
strings with NUL before `len` just in case (it appears that this does not ever 
happen).
2017-03-29 10:08:06 +03:00
ZyX
3a3816c990 cmake: Use CMAKE_CURRENT_LIST_DIR and remove vars used only once 2017-03-29 10:08:06 +03:00
ZyX
86fc4580b8 eval: Fix max_min functions
Found two bugs:

1. Multiple unneeded error messages, vim/vim#1039.
2. Unformatted error string, vim/vim#1040.
2017-03-29 10:08:06 +03:00
ZyX
c4fe656fef typval.h: Allow non-var expressions in TV_DICT_ITER first argument 2017-03-29 10:08:06 +03:00
ZyX
6cc3d59ec8 misc1: Refactor ask_yesno() 2017-03-29 10:08:06 +03:00
ZyX
31a3158d0b eval: Make sort always stable
Should fix test failures on QB:

    20:00:51,837 INFO  - not ok 420 - sort() sorts “wrong” values between -0.0001 and 0.0001, preserving order
    20:00:51,837 INFO  - # test/functional/eval/sort_spec.lua @ 21
    20:00:51,837 INFO  - # Failure message: test/functional/eval/sort_spec.lua:39: Expected objects to be the same.
    20:00:51,837 INFO  - # Passed in:
    20:00:51,837 INFO  - # (string) '[-1.0e-4, v:true, v:false, v:null, function('tr'), {'a': 42}, 'check', [], 1.0e-4]'
    20:00:51,837 INFO  - # Expected:
    20:00:51,837 INFO  - # (string) '[-1.0e-4, function('tr'), v:true, v:false, v:null, [], {'a': 42}, 'check', 1.0e-4]'
    20:00:51,837 INFO  - # stack traceback:
    20:00:51,837 INFO  - #     test/functional/eval/sort_spec.lua:39: in function <test/functional/eval/sort_spec.lua:22>
    20:00:51,837 INFO  - #
2017-03-29 10:08:06 +03:00
ZyX
5df35297f8 eval: Remove eval_expr() completely 2017-03-29 10:08:05 +03:00
ZyX
c8e63a8db8 eval: Move remaining get_tv_string* functions to eval/typval.c 2017-03-29 10:08:05 +03:00
ZyX
50ebd1dff5 eval: Move free_tv to eval/typval.h, remove most of its usages 2017-03-29 10:08:05 +03:00
ZyX
233b0c93bb eval: Move get_tv_number[_chk] to eval/typval.c 2017-03-29 10:08:05 +03:00
ZyX
1b3e13da5b eval: Refactor get_tv_lnum_buf 2017-03-29 10:08:05 +03:00
ZyX
7ee5cc7429 eval: Move get_tv_lnum and get_tv_float to eval/typval.h
Additionally

- Rename former tv_get_float to tv_get_float_chk due to name conflict (former
  get_tv_float is better suited for being tv_get_float).
- Add E907 error to get_tv_float() and test that it is being raised when
  appropriate.
2017-03-29 10:08:05 +03:00
ZyX
949f09bdbb eval: Move get_tv_string_buf() to eval/typval.c 2017-03-29 10:08:05 +03:00
ZyX
28dafe3ff0 eval,*: Move get_tv_string to typval.c
Function was renamed and changed to return `const char *`.
2017-03-29 10:08:05 +03:00
ZyX
5cdf7177ec eval: Move get_float_arg to typval.h
Assuming `inline` is there for a reason, so it is kept and function was moved to
typval.h and not to typval.c which does not have problems with #including
message.h.
2017-03-29 10:07:43 +03:00
ZyX
2dcfc439b2 eval: Split and move dict_add_nr_str to typval.c
Function was split into tv_dict_add_nr() and tv_dict_add_str().
2017-03-29 10:07:43 +03:00
ZyX
210342d795 eval: Move dict_add_list and dict_add_dict to typval.c 2017-03-29 10:07:43 +03:00
ZyX
983a5532ca eval: Move dict_set_keys_readonly to typval.c 2017-03-29 10:07:43 +03:00
ZyX
ecff8387f4 eval: Move get_dict_callback to typval.c 2017-03-29 10:07:43 +03:00
ZyX
54bd2e8b73 eval: Make setmatches() return -1 in case of some failures 2017-03-29 10:07:43 +03:00
ZyX
e18a578308 *: Move some dictionary functions to typval.h and use char*
Also fixes buffer reusage in setmatches() and complete().
2017-03-29 10:07:42 +03:00
ZyX
50a48f2a0e functests: Add tests for some *buf* functions 2017-03-29 10:05:06 +03:00
ZyX
fb146e80aa eval: Split eval.c into smaller files 2017-03-29 10:05:06 +03:00
18e7d55200 terminal.c:redraw(): Avoid invalid cursor col (#6379)
Removed the call to validate_cursor() because mb_check_adjust_col() is
already called in adjust_topline().

Closes #6378
References #6203

https://s3.amazonaws.com/archive.travis-ci.org/jobs/215498258/log.txt

    [  ERROR   ] ...ovim/neovim/test/functional/terminal/scrollback_spec.lua @ 386: 'scrollback' option set to 0 behaves as 1 (10621.17 ms)
    ==================== File /home/travis/build/neovim/neovim/build/log/ubsan.12836 ====================
    = =================================================================
    = ==12836==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62100002cd00 at pc 0x000000eafe90 bp 0x7ffc8661fe50 sp 0x7ffc8661fe48
    = READ of size 1 at 0x62100002cd00 thread T0
    =     #0 0xeafe8f in utf_head_off /home/travis/build/neovim/neovim/src/nvim/mbyte.c:1457:7
    =     #1 0x6b890e in getvcol /home/travis/build/neovim/neovim/src/nvim/charset.c:1169:15
    =     #2 0x6bc777 in getvvcol /home/travis/build/neovim/neovim/src/nvim/charset.c:1336:5
    =     #3 0xfc067b in curs_columns /home/travis/build/neovim/neovim/src/nvim/move.c:730:5
    =     #4 0xfbc8db in validate_cursor /home/travis/build/neovim/neovim/src/nvim/move.c:510:5
    =     #5 0x14479ed in setcursor /home/travis/build/neovim/neovim/src/nvim/screen.c:6363:5
    =     #6 0x17fe054 in redraw /home/travis/build/neovim/neovim/src/nvim/terminal.c:1175:5
    =     #7 0x17f95e4 in terminal_enter /home/travis/build/neovim/neovim/src/nvim/terminal.c:392:3
    =     #8 0x70eb2b in edit /home/travis/build/neovim/neovim/src/nvim/edit.c:1300:7
    =     #9 0x11097d1 in normal_finish_command /home/travis/build/neovim/neovim/src/nvim/normal.c:947:13
    =     #10 0x1081191 in normal_execute /home/travis/build/neovim/neovim/src/nvim/normal.c:1138:3
    =     #11 0x170b813 in state_enter /home/travis/build/neovim/neovim/src/nvim/state.c:58:26
    =     #12 0x103631b in normal_enter /home/travis/build/neovim/neovim/src/nvim/normal.c:464:3
    =     #13 0xdfb7a8 in main /home/travis/build/neovim/neovim/src/nvim/main.c:552:3
    =     #14 0x2b8a3c85bf44 in __libc_start_main /build/eglibc-MjiXCM/eglibc-2.19/csu/libc-start.c:287
    =     #15 0x447b25 in _start (/home/travis/build/neovim/neovim/build/bin/nvim+0x447b25)
    =
    = 0x62100002cd00 is located 0 bytes to the right of 4096-byte region [0x62100002bd00,0x62100002cd00)
    = allocated by thread T0 here:
    =     #0 0x4f1e98 in malloc (/home/travis/build/neovim/neovim/build/bin/nvim+0x4f1e98)
    =     #1 0xf28774 in try_malloc /home/travis/build/neovim/neovim/src/nvim/memory.c:84:15
    =     #2 0xf28934 in xmalloc /home/travis/build/neovim/neovim/src/nvim/memory.c:118:15
    =     #3 0xec7be8 in mf_alloc_bhdr /home/travis/build/neovim/neovim/src/nvim/memfile.c:646:17
    =     #4 0xec58d4 in mf_new /home/travis/build/neovim/neovim/src/nvim/memfile.c:297:12
    =     #5 0xeda8a8 in ml_new_data /home/travis/build/neovim/neovim/src/nvim/memline.c:2697:16
    =     #6 0xed7beb in ml_open /home/travis/build/neovim/neovim/src/nvim/memline.c:349:8
    =     #7 0x643fcd in open_buffer /home/travis/build/neovim/neovim/src/nvim/buffer.c:109:7
    =     #8 0xa7038c in do_ecmd /home/travis/build/neovim/neovim/src/nvim/ex_cmds.c:2483:24
    =     #9 0xb5bb49 in do_exedit /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:6839:9
    =     #10 0xb7b6d8 in ex_edit /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:6767:3
    =     #11 0xb2a598 in do_one_cmd /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:2208:5
    =     #12 0xb08f47 in do_cmdline /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:602:20
    =     #13 0x109997b in nv_colon /home/travis/build/neovim/neovim/src/nvim/normal.c:4492:18
    =     #14 0x1081188 in normal_execute /home/travis/build/neovim/neovim/src/nvim/normal.c:1135:3
    =     #15 0x170b813 in state_enter /home/travis/build/neovim/neovim/src/nvim/state.c:58:26
    =     #16 0x103631b in normal_enter /home/travis/build/neovim/neovim/src/nvim/normal.c:464:3
    =     #17 0xdfb7a8 in main /home/travis/build/neovim/neovim/src/nvim/main.c:552:3
    =     #18 0x2b8a3c85bf44 in __libc_start_main /build/eglibc-MjiXCM/eglibc-2.19/csu/libc-start.c:287
    =
    = SUMMARY: AddressSanitizer: heap-buffer-overflow /home/travis/build/neovim/neovim/src/nvim/mbyte.c:1457:7 in utf_head_off
    = Shadow bytes around the buggy address:
    =   0x0c427fffd950: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    =   0x0c427fffd960: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    =   0x0c427fffd970: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    =   0x0c427fffd980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    =   0x0c427fffd990: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    = =>0x0c427fffd9a0:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
    =   0x0c427fffd9b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
    =   0x0c427fffd9c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
    =   0x0c427fffd9d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
    =   0x0c427fffd9e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
    =   0x0c427fffd9f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
    = Shadow byte legend (one shadow byte represents 8 application bytes):
    =   Addressable:           00
    =   Partially addressable: 01 02 03 04 05 06 07
    =   Heap left redzone:       fa
    =   Heap right redzone:      fb
    =   Freed heap region:       fd
    =   Stack left redzone:      f1
    =   Stack mid redzone:       f2
    =   Stack right redzone:     f3
    =   Stack partial redzone:   f4
    =   Stack after return:      f5
    =   Stack use after scope:   f8
    =   Global redzone:          f9
    =   Global init order:       f6
    =   Poisoned by user:        f7
    =   Container overflow:      fc
    =   Array cookie:            ac
    =   Intra object redzone:    bb
    =   ASan internal:           fe
    =   Left alloca redzone:     ca
    =   Right alloca redzone:    cb
    = ==12836==ABORTING
    =====================================================================================================
    ./test/helpers.lua:82: assertion failed!

    stack traceback:
    	./test/helpers.lua:82: in function 'check_logs'
    	./test/functional/helpers.lua:643: in function <./test/functional/helpers.lua:642>
2017-03-29 02:13:50 +02:00
e86042ae17 vim-patch:7.4.2343 and mark NA patches (#6384)
vim-patch:7.4.2343

Problem:    Too many old file tests.
Solution:   Turn several into new style tests. (Yegappan Lakshmanan)

53f1673cd9
2017-03-29 01:30:54 +02:00
b9e7ab1484 refactor/single-include: charset.h (#6385) 2017-03-29 01:21:30 +02:00
6fbcbebae0 win: health/provider.vim: check with .exe extension
Also fix `python_multiple` comparison.
2017-03-28 01:49:36 +02:00
9d200cd0a3 getcompletion("cmdline") (#6376)
Closes #5823
2017-03-27 21:04:52 +02:00
595acbbc42 rplugin.vim: GetManifestPath(): be more explicit (#6361) 2017-03-27 16:28:05 +02:00
72c29895e0 Merge #6375 from justinmk/check-single-includes 2017-03-27 15:16:17 +02:00
88124dfebc build: Prefix check-single-includes artifacts.
The previous naming scheme could conflict with the test fixture
artifacts from `test/functional/fixtures/`, which also produce
`foo-test` artifacts.
2017-03-27 14:44:14 +02:00
e20e9645b2 build: Rename NEOVIM_* to NVIM_* 2017-03-27 14:27:20 +02:00
62774e4356 ci: Check that #include "*.h" works as a single include
Lesser form of include-what-you-use: at least guarantees that header
file did not forget to include something through some other included
file.

Activate run_single_includes_tests on CI.
Fix some IWYU violations.

References #5321
2017-03-27 13:51:05 +02:00
7bc37ffb22 terminal: global 'scrollback' #6352
Make the 'scrollback' option work like most other buffer-local options:
- `:set scrollback=x` sets the global and local value
- `:setglobal scrollback=x` sets only the global default
- new terminal buffers inherit the global

Normal buffers are still always -1, and :setlocal there is an error.

Closes #6337
2017-03-27 13:43:20 +02:00
2b1398c31e Merge #6372 from lonerover/vim-7.4.2307 2017-03-27 13:16:17 +02:00
9cd7e19904 vim-patch:7.4.2334
Problem:    On MS-Windows test_getcwd leaves Xtopdir behind.
Solution:   Set 'noswapfile'. (Michael Soyka)

1b0c2fcf6e
2017-03-27 12:19:14 +08:00
85ba14af6a vim-patch:7.4.2330
Problem:    Coverity complains about not checking curwin to be NULL.
Solution:   Use firstwin to avoid the warning.

030cddc7ec
2017-03-27 12:19:14 +08:00
20e7652b69 vim-patch:7.4.2307
Problem:    Several tests are old style.
Solution:   Turn them into new style tests. (Yegappan Lakshmanan)

cd055da370
2017-03-27 12:19:14 +08:00
ZyX
5992cdf3c2 cmake: Use set_property in place of target_include_dirs
Should work with cmake-2.8.7.
2017-03-27 00:18:55 +03:00
ZyX
a24e94215e eval,functests: Fix linter errors 2017-03-27 00:18:55 +03:00
ZyX
d13fdfd446 functests: Add test for debug.debug 2017-03-27 00:18:54 +03:00
ZyX
73d37f8b6e executor: Add :lua debug.debug mock 2017-03-27 00:18:52 +03:00
edc80f6b46 vim-patch:7.4.2357 (#6354)
Problem:    Attempt to read history entry while not initialized.
Solution:   Skip when the index is negative.

46643713dc
2017-03-26 23:15:53 +02:00
ZyX
9fd2bf67aa executor,functests: Add print() tests, some fixes 2017-03-27 00:13:16 +03:00
ZyX
ebad046220 doc: Update vim_diff data regarding ShaDa 2017-03-27 00:13:16 +03:00
ZyX
279e3410cf doc: Update vim_diff.txt 2017-03-27 00:13:16 +03:00
ZyX
90e2a043e3 executor: Add print() function 2017-03-27 00:12:42 +03:00
ZyX
f2ad6201d9 api: Use a form of 1 << 63 for INTERNAL_CALL_MASK 2017-03-27 00:12:42 +03:00
ZyX
1801d44f53 executor: Do not use S_LEN for memcpy
Sometimes it is implemented as a macro and `S_LEN` is treated as a single 
argument in this case.
2017-03-27 00:12:42 +03:00
ZyX
09fe6185b7 doc: Enhance documentation 2017-03-27 00:12:42 +03:00
ZyX
dcb992ab37 executor: Add :luafile command 2017-03-27 00:12:42 +03:00
ZyX
295e7607c4 executor: Fix some memory leaks 2017-03-27 00:12:42 +03:00
ZyX
e1bbaca7ac executor,functests: Add tests for :luado, also some fixes
Fixes:
1. Allocate space for the NUL byte.
2. Do not exclude last line from range.
3. Remove code for sandbox: it is handled earlier.
4. Fix index in new_line_transformed when converting NULs to NLs.
5. Always allocate new_line_transformed, but save allocated value.
2017-03-27 00:12:42 +03:00
ZyX
9114d9be77 executor: Add :luado command 2017-03-27 00:12:42 +03:00
ZyX
b4e2860c69 doc,functests: Add documentation
Missing: updates to various lists.
2017-03-27 00:12:42 +03:00
ZyX
7a5646d594 functests: Add tests for :lua 2017-03-27 00:12:42 +03:00
ZyX
3d48c35d6b ex_getln: Refactor script_get()
1. Use `char *` for strings.
2. Add `const` qualifiers.
3. Add attributes and documentation.
4. Handle skipping *inside*.
5. Handle non-heredoc argument also inside: deferring this to the caller is
   pointless because all callers need the same thing. Though new ex_lua caller
   may live without allocations in this case, allocating nevertheless produces
   cleaner code.
6. Note that all callers call script_get with `eap` and `eap->arg`. Thus second
   argument is useless in practice: it is one and the same always and can be
   reached through the first argument.
2017-03-27 00:12:42 +03:00
ZyX
3531d8c8ea executor: Add some const qualifiers 2017-03-27 00:12:23 +03:00
ZyX
872a909150 executor: Add :lua command
Does not work currently.
2017-03-27 00:12:23 +03:00
ZyX
62fde31936 api: Also shift numbers in api_metadata output
Fixes problem introduced by “api: Allow kObjectTypeNil to be zero without 
breaking compatibility”: apparently there are clients which use metadata and 
there are which aren’t. For the first that commit would not be needed, for the 
second that commit misses this critical piece.
2017-03-27 00:12:23 +03:00
ZyX
140cd0da1d functests: Fix “function has more then 60 upvalues” error 2017-03-27 00:12:23 +03:00
ZyX
d836464cd2 cmake: Also include luajit directories for libnvim target 2017-03-27 00:12:23 +03:00
ZyX
ae4adcc707 gendeclarations: Make declarations generator work with macros funcs
Now it checks functions also after every semicolon and closing figure brace, 
possibly preceded by whitespaces (tabs and spaces). This should make messing 
with declarations in macros not needed.
2017-03-27 00:12:23 +03:00
ZyX
52c7066f4b gendeclarations: Handle case when text did not match 2017-03-27 00:12:23 +03:00
ZyX
c470fc32a8 gendeclarations: Also save information about directory 2017-03-27 00:12:23 +03:00
ZyX
f74322b9a5 gendeclarations: Save where declaration is comping from 2017-03-27 00:12:23 +03:00
ZyX
9c743df2d5 cmake: Use LuaJIT include directory for declarations generator 2017-03-27 00:12:23 +03:00
ZyX
d60302d517 cmake: Link libnvim-test with luajit in place of lua, disable ASAN
Reasoning: luajit is not being compiled with sanitizers, lua is. Given that 
linking with sanitized libraries requires sanitizers enabled, it is needed to 
either compile libnvim-test with sanitizers or link it with lua compiled without 
sanitizers. Most easy way to do the latter is just use luajit which is compiled 
without sanitizers (as they do not work well with luajit).
2017-03-27 00:12:23 +03:00
ZyX
d5228787ce deps: Always build lua with -fPIC and -O0 2017-03-27 00:12:23 +03:00
ZyX
d33b13dd6b cmake: Try fixing ASAN nvim-test compilation 2017-03-27 00:12:23 +03:00
ZyX
c5a2124e81 ci: When building lua use -fPIC 2017-03-27 00:12:23 +03:00
ZyX
22d3ce9c29 msgpack_rpc: Fix #HANDLE_TYPE_CONVERSION_IMPL
Function declarations generator is able to handle properly only the *first* 
function definition that is in macros, and only if it is the first entity in the 
macros. So msgpack_rpc_from_* was already really a static function, additionally 
its attributes were useless. This commit switches to explicit declarations and 
makes generated functions static.
2017-03-27 00:12:23 +03:00
ZyX
927e6efc3d clint: Allow omitting include guards in .c.h file and func_attr.h file 2017-03-27 00:12:23 +03:00
ZyX
ca4c8b7f8a api: Allow kObjectTypeNil to be zero without breaking compatibility 2017-03-27 00:12:23 +03:00
ZyX
6b4a51f7ea scripts: Make generate_vim_module more generic 2017-03-27 00:12:23 +03:00
ZyX
8fec4d53d0 ci: Make ASAN build link with lua, build lua with address sanitizer 2017-03-27 00:12:23 +03:00
ZyX
1646a28173 cmake: Allow switching from luajit to lua 2017-03-27 00:12:23 +03:00
ZyX
666d85d3ce functests: Some more tests 2017-03-27 00:12:22 +03:00
ZyX
53b89c1dcf executor/executor: Free lcmd on error 2017-03-27 00:12:22 +03:00
ZyX
bca9c2f3c4 functests: Move existing tests from lua_spec to lua/*, fix them 2017-03-27 00:12:22 +03:00
ZyX
f8d55266e4 executor/executor: When reporting errors use lua string length 2017-03-27 00:12:22 +03:00
ZyX
600bee9d4f genmsgpack: Include error source in error messages 2017-03-27 00:12:22 +03:00
ZyX
45feaa73d0 eval/decode: Fix memory leak in JSON functions 2017-03-27 00:12:22 +03:00
ZyX
a3ea05c1e5 functests: Add some tests 2017-03-27 00:12:22 +03:00
ZyX
8679feb3cb executor/converter: Use readable lua numbers for handles 2017-03-27 00:11:29 +03:00
ZyX
5c1b9a0d2a api: Reserve more numbers for internal calls
Reasoning; currently INTERNAL_CALL is mostly used to determine whether it is 
needed to deal with NL-used-as-NUL problem. This code is useful for nvim_… API 
calls done from VimL, but not for API calls done from lua, yet lua needs to 
supply something as channel_id.
2017-03-27 00:11:28 +03:00
ZyX
d932693d51 executor/converter: Allow converting self-referencing lua objects 2017-03-27 00:11:28 +03:00
ZyX
ba2f615cd4 functests: Test for error conditions
During testing found the following bugs:

1. msgpack-gen.lua script is completely unprepared for Float values either in 
   return type or in arguments. Specifically:

   1. At the time of writing relevant code FLOAT_OBJ did not exist as well as 
      FLOATING_OBJ, but it would be used by msgpack-gen.lua should return type 
      be Float. I added FLOATING_OBJ macros later because did not know that 
      msgpack-gen.lua uses these _OBJ macros, otherwise it would be FLOAT_OBJ.
   2. msgpack-gen.lua should use .data.floating in place of .data.float. But it 
      did not expect that .data subattribute may have name different from 
      lowercased type name.

2. vim_replace_termcodes returned its argument as-is if it receives an empty 
   string (as well as _vim_id*() functions did). But if something in returned 
   argument lives in an allocated memory such action will cause double free: 
   once when freeing arguments, then when freeing return value. It did not cause 
   problems yet because msgpack bindings return empty string as {NULL, 0} and 
   nothing was actually allocated.
3. New code in msgpack-gen.lua popped arguments in reversed order, making lua 
   bindings’ signatures be different from API ones.
2017-03-27 00:11:28 +03:00
ZyX
7a013e93e0 executor/converter: Make it possible to supply {} to Dictionary arg 2017-03-27 00:11:27 +03:00
ZyX
425d348f0f executor/converter: Make nlua_pop_Object not recursive 2017-03-27 00:11:27 +03:00
ZyX
9297d941e2 executor/converter: Fix how maxidx is determined 2017-03-27 00:11:27 +03:00
ZyX
3fa4ca8188 executor/converter: Fix conversion of self-containing containers 2017-03-27 00:11:26 +03:00
ZyX
ed3115bd26 executor: Make sure it works with API values 2017-03-27 00:11:25 +03:00
ZyX
a4dc8de073 *: Silence linter 2017-03-27 00:11:25 +03:00
ZyX
f551df17f3 viml/executor: Directly generate typval_T values
Note: this will *still* crash when using API in cases similar to the one
described in first commit. Just it needs different code to reproduce.
2017-03-27 00:11:24 +03:00
ZyX
e7bbd8256b eval: Add luaeval function
No tests yet, no documentation update, no :lua* stuff, no vim module.

converter.c should also work with typval_T, not Object.

Known problem: luaeval("1", {}) results in

    PANIC: unprotected error in call to Lua API (attempt to index a nil value)

Ref #3823
2017-03-27 00:11:24 +03:00
f9a31e9850 vim-patch:7.4.2349 (#6368)
Problem:    Valgrind reports using uninitialzed memory. (Dominique Pelle)
Solution:   Check the length before checking for a NUL.

2321ca2a78
2017-03-26 19:04:57 +02:00
43a99f77a8 highlight: :match should override 'list' (#6343)
Closes #4946
2017-03-26 13:04:20 +02:00
cf202b74db build: Do not ref libuv CMake target if USE_BUNDLED_LIBUV=OFF. (#6363)
CMake Warning: The dependency target "libuv" of target "luv-static" does
not exist. (CMP0046)

Closes #6355
2017-03-26 00:22:15 +01:00
b60e5c85ad cmake: USE_BUNDLED_X instead of X_USE_BUNDLED (#6357) 2017-03-25 23:02:20 +01:00
a346cb1d58 man.vim: call s:error in man#read_page (#6362)
The comment is incorrect, s:error does need to be called. I thought the
call was unnecessary because it didn't show any message for me but I had
shortmess+=F which was hiding the message.
2017-03-25 22:43:25 +01:00
098e91400e refactor: Remove allow_keys global (#6346)
* The allow_keys global is unused in nvim, remove it

* clint
2017-03-25 15:43:19 +01:00
0cd829161a Merge #6221 2017-03-25 00:16:33 +01:00
90ac8b09f5 fold.c: uppercase macros 2017-03-25 00:15:31 +01:00
d094a36e7c Merge pull request #6350 from jamessan/vim-8.0.0250
vim-patch:8.0.0250
2017-03-24 16:43:01 -04:00
2a6d44ca52 vim-patch:8.0.0250
Problem:    When virtcol() gets a column that is not the first byte of a
            multi-byte character the result is unpredictable. (Christian
            Ludwig)
Solution:   Correct the column to the first byte of a multi-byte character.
            Change the utf-8 test to new style.

0c0590d982

Closes #6269
2017-03-24 15:11:51 -04:00
38274051c0 Merge pull request #6323 from justinmk/vimpatches 2017-03-24 18:30:35 +01:00
a62ec4eb98 health.vim: tmux: Try -qvg and -qvgs (#6348) 2017-03-24 01:38:01 +01:00
7214d0bc84 XXX: ex_tabonly(): aucmd_win is not part of the window list.
During free_all_mem, somehow ex_tabonly() may free aucmd_win. But it
isn't fully destroyed (maybe autocmd_busy?). When win_free_all() tries
to free aucmd_win directly, it double-frees the sub-fields.

Tried unnsuccessfully to work around this by invoking `:tabonly!` with
autocmds disabled:

    diff --git a/src/nvim/memory.c b/src/nvim/memory.c
    index 58c01fbe7a12..91c845e94d22 100644
    --- a/src/nvim/memory.c
    +++ b/src/nvim/memory.c
    @@ -565,9 +565,9 @@ void free_all_mem(void)
       /* Close all tabs and windows.  Reset 'equalalways' to avoid redraws. */
       p_ea = false;
       if (first_tabpage->tp_next != NULL)
    -    do_cmdline_cmd("tabonly!");
    +    do_cmdline_cmd("noautocmd tabonly!");
       if (firstwin != lastwin)
    -    do_cmdline_cmd("only!");
    +    do_cmdline_cmd("noautocmd only!");

       /* Free all spell info. */
       spell_free_all();
2017-03-23 23:47:20 +01:00
ZyX
62108c3b0b functests: Disable system(-s -) test on Windows
Assume something with system() if second test hangs as well. Assume something 
with reading stdin if not.
2017-03-23 21:06:39 +03:00
ZyX
99b4f25b99 functests: Do not run termopen test on Windows 2017-03-23 21:04:45 +03:00
a6c9c91841 vim-patch:8.0.0407 : filtering folds with marker method not tested
Problem:    Filtering folds with marker method not tested.
Solution:   Also set 'foldmethod' to "marker".
2017-03-23 15:55:57 +00:00
308a953e0b Fix wrap-around in 32 bit 2017-03-23 14:37:47 +00:00
b2b88423aa Robustly handle folds during a :move command
In order to re-order marks according to the :move command, do_move()
uses mark_adjust() in a non-standard manner. The non-standard action is
that it moves some marks *past* other marks. This doesn't matter for
marks, but mark_adjust() calls foldMarkAdjust() which simply changes
fold starts and lengths and doesn't have enough information to know that
other folds have to be checked and reordered.

The array of folds for each window are assumed to be in order of
increasing line number, and if this gets broken some folds can get
"lost".

There has been a previous patch to avoid this problem by deleting and
recalculating all folds in the window, but this comes at the cost of
closing all folds when executing :move, and doesn't cover the case of
manual folds.
This patch adds a new function foldMoveRange() specifically for the
:move command that handles reordering folds as well as simply moving
them. Additionally, we allow calling mark_adjust_nofold() that does the
same as mark_adjust() but doesn't affect any fold array.

Calling mark_adjust_nofold() should be done in the same manner as
calling mark_adjust(), but according changes to the fold arrays must be
done seperately by the calling function.

vim-patch:8.0.0457
vim-patch:8.0.0459
vim-patch:8.0.0461
vim-patch:8.0.0465
2017-03-23 14:37:47 +00:00
06ed7a189b vim-patch:7.4.2329 (#6341)
Problem:    Error for min() and max() contains %s. (Nikolay Pavlov)
Solution:   Pass the function name. (closes vim/vim#1040)

26b84339fd
2017-03-23 08:54:01 +01:00
44e75eba30 vim-patch:7.4.2161 (#6340)
Problem:    Expression test fails without conceal feature.
Solution:   Only check "conceal" with the conceal feature.

7ab6defcaf
2017-03-22 21:57:20 +01:00
f7aa1bfde6 Merge pull request #6335 from bfredl/mbyte_dead
mbyte: remove dead code
2017-03-22 19:49:07 +01:00
c398402f12 vim-patch:8.0.0307
Problem:    Asan detects a memory error when EXITFREE is defined. (Dominique
            Pelle)
Solution:   In getvcol() check for ml_get_buf() returning an empty string.
            Also skip adjusting the scroll position.  Set "exiting" in
            mch_exit() for all systems.

955f198fc5
2017-03-22 18:43:01 +01:00
830b31683e vim-patch:8.0.0502
Problem:    Coverity complains about possible NULL pointer.
Solution:   Add an assert(), let's see if this works on all systems.

a37ffaa5e0
2017-03-22 18:43:01 +01:00
41bffeacff vim-patch:8.0.0331
Problem:    Restoring help snapshot accesses freed memory. (Dominique Pelle)
Solution:   Don't restore a snapshot when the window closes.

343b8c0429
2017-03-22 18:43:01 +01:00
54f31187ba vim-patch:8.0.0482
Problem:    The setbufvar() function may mess up the window layout. (Kay Z.)
Solution:   Do not check the window to be valid if it is NULL.

2c90d51123
2017-03-22 18:43:01 +01:00
f58a593cea vim-patch:8.0.0483
Problem:    Illegal memory access when using :all. (Dominique Pelle)
Solution:   Adjust the cursor position right after setting "curwin".

f79225ed4f
2017-03-22 18:43:01 +01:00
2b32053559 test/legacy: Test_three_windows: rtp for :help 2017-03-22 18:43:00 +01:00
51bc9f243a ex_tabnext: Disallow "+NN" arg.
Need to do this explicitly because our implementation of getdigits() is
slightly different.
2017-03-22 18:43:00 +01:00
33858ccb9b vim-patch:8.0.0485
Problem:    Not all windows commands are tested.
Solution:   Add more tests for windows commands. (Dominique Pelle,
            closes vim/vim#1575) Run test_autocmd separately, it interferes with
            other tests.  Fix tests that depended on side effects.

4520d440c5
2017-03-22 18:43:00 +01:00
01bf78971c vim-patch:8.0.0172
Problem:    The command selected in the command line window is not executed.
            (Andrey Starodubtsev)
Solution:   Save and restore the command line at a lower level. (closes vim/vim#1370)

1d669c233c
2017-03-22 18:43:00 +01:00
b82e3358e0 vim-patch:8.0.0083
Problem:    Using freed memory with win_getid(). (Domenique Pelle)
Solution:   For the current tab use curwin.

8e63905263
2017-03-22 18:43:00 +01:00
9c8540edfd vim-patch:8.0.0159
References #5406

Problem:    Using a NULL pointer when using feedkeys() to trigger drawing a
            tabline.
Solution:   Skip drawing a tabline if TabPageIdxs is NULL. (Dominique Pelle)
            Also fix recursing into getcmdline() from the cmd window.

c695cec469
2017-03-22 18:43:00 +01:00
f06a691326 vim-patch:8.0.0037
Problem:    Get E924 when switching tabs. ()
Solution:   Use win_valid_any_tab() instead of win_valid(). (Martin Vuille,
            closes vim/vim#1167, closes vim/vim#1171)

0a9046fbcb
2017-03-22 18:43:00 +01:00
a24c6cc6a8 get_tabpage_arg: satisfy clang warning
vim-patch:8.0.0266
2017-03-22 18:43:00 +01:00
7e23ce6b4f lint 2017-03-22 18:42:59 +01:00
0f3afdaa1b vim-patch:8.0.0259
Problem:    Tab commands do not handle count correctly. (Ken Hamada)
Solution:   Add ADDR_TABS_RELATIVE. (Hirohito Higashi)

2f72c70657
2017-03-22 18:42:59 +01:00
386a5f379b test/legacy: Makefile Add missing tests
These tests aren't in test_alot.vim, so they need to be added to the
Makefile or they won't be run.
2017-03-22 18:42:59 +01:00
c99514c2a4 test/legacy: Run test_match, test_tabpage isolated
These are failing when run as a batch. Most likely some Vim runtime
patch fixed something, but we don't have it yet. Just isolate them for
now.

Also test_matchadd_conceal_utf8 (it's not there in Vim tree, either).
2017-03-22 18:42:59 +01:00
78a4c73cf0 vim-patch:7.4.2339
Problem:    Tab page test fails when run as fake root.
Solution:   Check 'buftype' instead of 'filetype'. (James McCoy, closes vim/vim#1042)

100f5c90f4
2017-03-22 18:42:59 +01:00
89abed7d85 vim-patch:8.0.0032
Problem:    Tests may change the input file when something goes wrong.
Solution:   Avoid writing the input file.

3e8474dd50
2017-03-22 18:42:59 +01:00
cd9fc4627e vim-patch:8.0.0049
Problem:    When a match ends in part of concealed text highlighting, it might
            mess up concealing by resetting prev_syntax_id.
Solution:   Do not reset prev_syntax_id and add a test to verify. (Christian
            Brabandt, closes vim/vim#1092)

2f97912800
2017-03-22 18:42:59 +01:00
5ee211770d vim-patch:8.0.0033
Problem:    Cannot use overlapping positions with matchaddpos().
Solution:   Check end of match. (Ozaki Kiichi) Add a test (Hirohito Higashi)

a6c27ee6db
2017-03-22 18:42:58 +01:00
929859ed81 vim-patch:7.4.2355
Problem:    Regexp fails to match when using "\>\)\?". (Ramel)
Solution:   When a state is already in the list, but addstate_here() is used
            and the existing state comes later, add the new state anyway.

16b3578f35
2017-03-22 18:42:58 +01:00
53ccd07fa1 lint 2017-03-22 18:42:58 +01:00
b0e34497b3 test/legacy: fix test_autocmd.vim
vim-patch:8.0.0487
2017-03-22 18:42:58 +01:00
2e9c1a9c4a vim-patch:8.0.0178
Problem:    test_command_count may fail when a previous test interferes, seen
            on MS-Windows.
Solution:   Run it separately.

9b73c4a215
2017-03-22 18:42:58 +01:00
10f6624f65 vim-patch:7.4.2328
Problem:    Crash when BufWinLeave autocmd goes to another tab page.
            (Hirohito Higashi)
Solution:   Make close_buffer() go back to the right window.
2017-03-22 18:42:56 +01:00
4a2e6f460d vim-patch:7.4.2341
Problem:    Tiny things.  Test doesn't clean up properly.
Solution:   Adjust comment and white space. Restore option value.
2017-03-22 18:42:17 +01:00
4c18670e91 vim-patch:7.4.2346
Problem:    Autocommand test fails when run directly, passes when run as
            part of test_alot.
Solution:   Add command to make the cursor move.  Close a tab page.
2017-03-22 18:42:17 +01:00
6a8bad0308 vim-patch:8.0.0019
Problem:    Test_command_count is old style.
Solution:   Turn it into a new style test. (Naruhiko Nishino)
            Use more assert functions.
2017-03-22 18:42:16 +01:00
165ba3e636 vim-patch:7.4.2324
Problem:    Crash when editing a new buffer and BufUnload autocommand wipes
            out the new buffer. (Norio Takagi)
Solution:   Don't allow wiping out this buffer. (partly by Hirohito Higashi)
            Move old style test13 into test_autocmd. Avoid ml_get error when
            editing a file.

e0ab94e712
2017-03-22 18:42:16 +01:00
ca853edb6f vim-patch:8.0.0177
Problem:    When opening a buffer on a directory and inside a try/catch then
            the BufEnter event is not triggered.
Solution:   Return NOTDONE from readfile() for a directory and deal with the
            three possible return values. (Justin M. Keyes, closes vim/vim#1375,
            closes vim/vim#1353)

e13b9afe12
2017-03-22 18:42:16 +01:00
b9e1289819 vim-patch:8.0.0486
Problem:    Crash and endless loop when closing windows in a SessionLoadPost
            autocommand.
Solution:   Check for valid tabpage.  (partly neovim/neovim#6308)

8c752bd6c4

Closes #6308
2017-03-22 18:42:16 +01:00
1d8356a807 mbyte: remove dead code 2017-03-22 17:52:42 +01:00
a1732b46ab terminal: Avoid invalid cursor col (#6265)
Patch-by: oni-link <knil.ino@gmail.com>

Closes #6203

https://s3.amazonaws.com/archive.travis-ci.org/jobs/206794197/log.txt

References #3161

    [ RUN      ] ...d/neovim/neovim/test/functional/terminal/buffer_spec.lua @ 199: terminal buffer term_close() use-after-free #4393
    ./test/functional/helpers.lua:187: attempt to perform arithmetic on local 'written' (a nil value)

    stack traceback:
    	./test/functional/helpers.lua:187: in function 'nvim_feed'
    	./test/functional/helpers.lua:329: in function 'execute'
    	...d/neovim/neovim/test/functional/terminal/buffer_spec.lua:206: in function <...d/neovim/neovim/test/functional/terminal/buffer_spec.lua:199>

    [  ERROR   ] ...d/neovim/neovim/test/functional/terminal/buffer_spec.lua @ 199: terminal buffer term_close() use-after-free #4393 (199.47 ms)
    ==================== File /home/travis/build/neovim/neovim/build/log/ubsan.15466 ====================
    = =================================================================
    = ==15466==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x621000029101 at pc 0x000000ea7ba0 bp 0x7ffd5bb628c0 sp 0x7ffd5bb628b8
    = READ of size 1 at 0x621000029101 thread T0
    =     #0 0xea7b9f in utf_head_off /home/travis/build/neovim/neovim/src/nvim/mbyte.c:1637:7
    =     #1 0xeaaf53 in mb_adjustpos /home/travis/build/neovim/neovim/src/nvim/mbyte.c:1840:16
    =     #2 0xeaab48 in mb_adjust_cursor /home/travis/build/neovim/neovim/src/nvim/mbyte.c:1825:3
    =     #3 0x11000d0 in normal_finish_command /home/travis/build/neovim/neovim/src/nvim/normal.c:928:5
    =     #4 0x1077df1 in normal_execute /home/travis/build/neovim/neovim/src/nvim/normal.c:1147:3
    =     #5 0x16ff943 in state_enter /home/travis/build/neovim/neovim/src/nvim/state.c:58:26
    =     #6 0x102d8db in normal_enter /home/travis/build/neovim/neovim/src/nvim/normal.c:463:3
    =     #7 0xdf3398 in main /home/travis/build/neovim/neovim/src/nvim/main.c:540:3
    =     #8 0x2b973e8b4f44 in __libc_start_main /build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:287
    =     #9 0x447445 in _start (/home/travis/build/neovim/neovim/build/bin/nvim+0x447445)
    =
    = 0x621000029101 is located 1 bytes to the right of 4096-byte region [0x621000028100,0x621000029100)
    = allocated by thread T0 here:
    =     #0 0x4f17b8 in malloc (/home/travis/build/neovim/neovim/build/bin/nvim+0x4f17b8)
    =     #1 0xf1f374 in try_malloc /home/travis/build/neovim/neovim/src/nvim/memory.c:84:15
    =     #2 0xf1f534 in xmalloc /home/travis/build/neovim/neovim/src/nvim/memory.c:118:15
    =     #3 0xebe6a8 in mf_alloc_bhdr /home/travis/build/neovim/neovim/src/nvim/memfile.c:646:17
    =     #4 0xebc394 in mf_new /home/travis/build/neovim/neovim/src/nvim/memfile.c:297:12
    =     #5 0xed1368 in ml_new_data /home/travis/build/neovim/neovim/src/nvim/memline.c:2704:16
    =     #6 0xece6ab in ml_open /home/travis/build/neovim/neovim/src/nvim/memline.c:349:8
    =     #7 0x6438ad in open_buffer /home/travis/build/neovim/neovim/src/nvim/buffer.c:109:7
    =     #8 0xa6ec8d in do_ecmd /home/travis/build/neovim/neovim/src/nvim/ex_cmds.c:2489:24
    =     #9 0xb5a0f9 in do_exedit /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:6723:9
    =     #10 0xb791f8 in ex_edit /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:6651:3
    =     #11 0xb28b43 in do_one_cmd /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:2198:5
    =     #12 0xb077a7 in do_cmdline /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:601:20
    =     #13 0x10905db in nv_colon /home/travis/build/neovim/neovim/src/nvim/normal.c:4495:18
    =     #14 0x1077de8 in normal_execute /home/travis/build/neovim/neovim/src/nvim/normal.c:1144:3
    =     #15 0x16ff943 in state_enter /home/travis/build/neovim/neovim/src/nvim/state.c:58:26
    =     #16 0x102d8db in normal_enter /home/travis/build/neovim/neovim/src/nvim/normal.c:463:3
    =     #17 0xdf3398 in main /home/travis/build/neovim/neovim/src/nvim/main.c:540:3
    =     #18 0x2b973e8b4f44 in __libc_start_main /build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:287
    =
    = SUMMARY: AddressSanitizer: heap-buffer-overflow /home/travis/build/neovim/neovim/src/nvim/mbyte.c:1637:7 in utf_head_off
    stack traceback:
    	./test/helpers.lua:80: in function 'check_logs'
    	./test/functional/helpers.lua:639: in function <./test/functional/helpers.lua:638>

    [----------] 9 tests from /home/travis/build/neovim/neovim/test/functional/terminal/buffer_spec.lua (2263.12 ms total)
2017-03-22 14:49:37 +01:00
ef57ee23bd Merge #6312 from lonerover/vim-7.4.2255
vim-patch: 7.4.2255,7.42256
2017-03-22 12:32:52 +01:00
92d7cf4511 Merge #6331 from lonerover/vim-7.4.2283
vim-patch:7.4.2283,7.4.2296,7.4.2303
2017-03-22 11:42:17 +01:00
114a18b935 vim-patch:7.4.2303
Problem:    When using "is" the mode isn't always updated.
Solution:   Redraw the command line. (Christian Brabandt)

779f2fc3a7
2017-03-22 15:36:10 +08:00
c554b53040 vim-patch:7.4.2296
Problem:    No tests for :undolist and "U" command.
Solution:   Add tests. (Dominique Pelle)

c628fdcd46
2017-03-22 15:35:46 +08:00
56e400d800 vim_vsnprintf: fix conversion warning #6333
Re-apply fix from #6311 which was accidentally regressed in #6231.
2017-03-22 03:21:32 +01:00
ab16c07584 vim-patch:7.4.2283
Problem:    Part of ":oldfiles" command isn't cleared. (Lifepillar)
Solution:   Clear the rest of the line. (closes 1018)

885c00eabe
2017-03-22 08:33:12 +08:00
7cc4e782a0 doc: Update missing headers. (#6330)
pi_* docs are considered standalone plugins so they don't follow this
convention.
2017-03-22 01:13:51 +01:00
ab16535580 Merge #6231 from jbradaric/vim-7.4.2266
vim-patch:7.4.2266,7.4.2280,7.4.2291
2017-03-22 00:29:58 +01:00
3e33025133 strings: Fix problems found during code review 2017-03-21 22:56:05 +01:00
82c67768fa doc: Replace "For Vim ... Last change ..." headers (#6328) 2017-03-21 17:08:19 +01:00
6baa669c10 vim-patch:7.4.2164 (#6326)
Problem:    It is not possible to use plugins in an "after" directory to tune
            the behavior of a package.
Solution:   First load plugins from non-after directories, then packages and
            finally plugins in after directories.
            Reset 'loadplugins' before executing --cmd arguments.

66459b7c98

vim-patch:7.4.2172
vim-patch:7.4.2169
vim-patch:7.4.2177
vim-patch:7.4.2178
vim-patch:7.4.2184
vim-patch:8.0.0050
vim-patch:8.0.0105
vim-patch:8.0.0400
vim-patch:8.0.0405

Closes #6034
2017-03-21 17:07:00 +01:00
5657bb9ea6 Merge pull request #6327 from lonerover/issue-#6319
[RFC] fix the behavior of CTRL-F with 'scrolloff' (#6319)
2017-03-21 10:12:02 -04:00
7418adc143 move.c: add cursor adjustment for scrolloff (#6319) 2017-03-21 21:37:52 +08:00
26d7757ccb vim-patch:7.4.2256
Problem:    Coverity complains about null pointer check.
Solution:   Remove wrong and superfluous error check.

db249f26ed
2017-03-21 21:16:11 +08:00
2611ba8abb Merge #6324 from justinmk/vim-patch-bc8801c9317eb
vim-patch.sh, vim-patch:bc8801c9317eb
2017-03-21 13:52:38 +01:00
cc421270ee vim-patch:bc8801c9317eb
Updated runtime files.

bc8801c931
2017-03-21 12:19:17 +01:00
d6797e2865 .gitignore: Do not ignore *.rej 2017-03-21 12:19:16 +01:00
03a04172ec scripts/vim-patch.sh: Remove "Last change ..." lines.
Also:
- fix ignoring doc/tags file
- use 12 chars of hash instead of 7
2017-03-21 12:19:16 +01:00
66259e4c49 vim-patch:7.4.2293 (#6307)
The original patch makes all the modeline comments consistent, but these
have been removed in the neovim source. However there as a correction of
a comment included in the patch that we can use.

edf3f97ae2
2017-03-21 11:11:32 +01:00
c6c8e1e8cc version: Mark patch 2221 as applied.
It was implemented as a part of #3916.
2017-03-21 07:34:08 +01:00
cad9a76be2 vim-patch:7.4.2291
Problem:    printf() handles floats wrong when there is a sign.
Solution:   Fix placing the sign.  Add tests. (Dominique Pelle)

0418609534
2017-03-20 22:47:09 +01:00
6ca580be9b vim-patch:7.4.2280
Problem:    printf() doesn't handle infinity float values correctly.
Solution:   Add a table with possible infinity values. (Dominique Pelle)

e999782e36
2017-03-20 22:45:26 +01:00
b4cb5fa610 vim-patch:7.4.2266
Problem:    printf() test fails on Windows. "-inf" is not used.
Solution:   Check for Windows-specific values for "nan".  Add sign to "inf"
            when appropriate.

9992237a3e
2017-03-20 21:40:41 +01:00
4f69a8fb88 vim-patch:7.4.2242
Problem:    Timer test sometimes fails.
Solution:   Increase the maximum time for callback timer test.

17f1347b86
2017-03-20 21:15:56 +01:00
3558f89d22 vim-patch:7.4.2241
Problem:    Timer test sometimes fails.
Solution:   Increase the maximum time for repeating timer.

973365dcc4
2017-03-20 21:15:56 +01:00
5c2f1e29e3 vim-patch:7.4.2240
Problem:    Tests using the sleep time can be flaky.
Solution:   Use reltime() if available. (Partly by Shane Harper)

f267f8bdf7
2017-03-20 21:15:56 +01:00
420a9955fa version.c: Mark 7.4.2171 and 7.4.2181 as NA. 2017-03-20 21:15:56 +01:00
5b8ce2feed vim-patch:7.4.2180
Problem:    There is no easy way to stop all timers.  There is no way to
            temporary pause a timer.
Solution:   Add timer_stopall() and timer_pause().

b73598e2f0
2017-03-20 21:15:56 +01:00
8924e75f34 vim-patch:7.4.2170
Problem:    Cannot get information about timers.
Solution:   Add timer_info().

8e97bd74b5
2017-03-20 21:15:55 +01:00
df1e7b7eda Merge #6320 from jamessan/vim-8.0.0116
vim-patch:8.0.0116,8.0.0190,8.0.0195,8.0.0190,8.0.0223,8.0.0393
2017-03-20 20:20:35 +01:00
ae16e4fa13 doc: remove "only available when compiled with +timers" (#6321) 2017-03-20 13:23:19 +01:00
a56615214d lint 2017-03-19 23:43:49 -04:00
097d04ac71 vim-patch:8.0.0393
Problem:    When the same tag appears more than once, the order is
            unpredictable. (Charles Campbell)
Solution:   Besides using a dict for finding duplicates, use a grow array for
            keeping the tags in sequence.

98e83b2956
2017-03-19 23:43:43 -04:00
d3f15f1e6d vim-patch:8.0.0223
Problem:    Coverity gets confused by the flags passed to find_tags() and
            warnts for an uninitialized variable.
Solution:   Disallow using cscope and help tags at the same time.

fffbf308dd
2017-03-19 23:42:15 -04:00
e1af49b425 vim-patch:8.0.0195
Problem:    Jumping to a tag that is a static item in the current file fails.
            (Kazunobu Kuriyama)
Solution:   Make sure the first byte of the tag key is not NUL. (Suggested by
            James McCoy, closes vim/vim#1387)

a9d23c2087
2017-03-19 23:42:14 -04:00
058516aaf9 vim-patch:8.0.0190
Problem:    Detecting duplicate tags uses a slow linear search.
Solution:   Use a much faster hash table solution. (James McCoy, closes vim/vim#1046)
            But don't add hi_keylen, it makes hash tables 50% bigger.

810f9c361c
2017-03-19 23:42:01 -04:00
091a99afd4 Merge #6318 from justinmk/pr6244
test/legacy: fix test_normal.vim
2017-03-20 00:47:27 +01:00
2f54d6927c test/legacy: fix test_normal.vim 2017-03-19 23:52:17 +01:00
db128974fc vim-patch:7.4.2348
Problem:    Crash on exit when EXITFREE is defined. (Dominique Pelle)
Solution:   Don't access curwin when exiting.

9a27c7fde6
2017-03-19 21:14:11 +01:00
99f2dc1341 vim-patch:8.0.0229
Problem:    When freeing a buffer the local value of the 'formatprg' option is
            not cleared.
Solution:   Add missing change.

24a2d416ec
2017-03-19 21:14:11 +01:00
0f5c3f111a vim-patch:8.0.0179
Problem:    'formatprg' is a global option but the value may depend on the
            type of buffer. (Sung Pae)
Solution:   Make 'formatprg' global-local. (closes vim/vim#1380)

9be7c04e6c
2017-03-19 21:14:11 +01:00
2ad25c0466 linter: make changes pass the linter 2017-03-19 21:14:11 +01:00
86b1e7f583 vim-patch:7.4.2362
Problem:    Illegal memory access with ":1@". (Dominique Pelle)
Solution:   Correct cursor column after setting the line number.  Also avoid
            calling end_visual_mode() when not in Visual mode.

4930a76a03
2017-03-19 21:14:11 +01:00
a4f20db08c vim-patch:8.0.0066
Problem:    when calling an operator function when 'linebreak' is set, it is
            internally reset before calling the operator function.
Solution:   Restore 'linebreak' before calling op_function(). (Christian
            Brabandt)

4a08b0dc4d
2017-03-19 21:14:11 +01:00
88dd2e8a08 vim-patch:8.0.0064
Problem:    Normal test fails on MS-Windows.
Solution:   Don't try using an illegal file name.

eb828d01d9
2017-03-19 21:14:11 +01:00
151605cacc vim-patch:8.0.0060
Problem:    When using an Ex command for 'keywordprg' it is escaped as with a
            shell command. (Romain Lafourcade)
Solution:   Escape for an Ex command. (closes vim/vim#1175)

426f375422
2017-03-19 21:14:11 +01:00
707aea86bb vim-patch:7.4.2353
Problem:    Not enough test coverage for Normal mode commands.
Solution:   Add more tests. (Christian Brabandt)

2931f2a5df
2017-03-19 21:14:11 +01:00
ae828982ce vim-patch:7.4.2347
Problem:    Crash when closing a buffer while Visual mode is active.
            (Dominique Pelle)
Solution:   Adjust the position before computing the number of lines.
            When closing the current buffer stop Visual mode.

c4a908e836
2017-03-19 21:14:11 +01:00
4500b16f15 vim-patch:7.4.2336
Problem:    Running normal mode tests leave a couple of files behind.
            (Yegappan Lakshmanan)
Solution:   Delete the files. (Christian Brabandt)

df0db16cf7
2017-03-19 21:14:11 +01:00
1e33c88685 vim-patch:7.4.2333
Problem:    Outdated comments in test.
Solution:   Cleanup normal mode test. (Christian Brabandt)

31845093b7
2017-03-19 21:14:11 +01:00
e888864c28 vim-patch:7.4.2326
Problem:    Illegal memory access when Visual selection starts in invalid
            position. (Dominique Pelle)
Solution:   Correct position when needed.

d5824ce1b5
2017-03-19 21:14:11 +01:00
42caeccce6 vim-patch:7.4.2322
Problem:    Access memory beyond the end of the line. (Dominique Pelle)
Solution:   Adjust the cursor column.

bc54f3f3fe
2017-03-19 21:14:11 +01:00
afd8eacb4e vim-patch:7.4.2317
Problem:    Normal mode tests fail on MS-Windows.
Solution:   Do some tests only on Unix.  Set 'fileformat' to "unix".

0913a1089a
2017-03-19 21:14:11 +01:00
b87cb77570 vim-patch:7.4.2315
Problem:    Insufficient testing for Normal mode commands.
Solution:   Add a big test. (Christian Brabandt, closes vim/vim#1029)

87bc3f7459
2017-03-19 21:14:11 +01:00
934137fb48 vim-patch:8.0.0116
Problem:    When reading English help and using CTRl-] the language from
            'helplang' is used.
Solution:   Make help tag jumps keep the language. (Tatsuki, test by Hirohito
            Higashi, closes vim/vim#1249)

6dbf66aa3e
2017-03-19 13:19:24 -04:00
ZyX
ca116df260 main: Translate full -s error message, not part of it 2017-03-19 19:28:16 +03:00
ZyX
ae4fae9d3e unittests: Add tests for new fileio functions 2017-03-19 19:16:44 +03:00
ZyX
7df4fc8941 functests: Test -s errors 2017-03-19 18:53:21 +03:00
ZyX
83b39a4a02 os/fileio: Fix QB failure 2017-03-19 18:24:20 +03:00
ZyX
88e1a17cde *: Fix linter errors 2017-03-19 17:36:04 +03:00
ZyX
e78e75d85d fileio,main: Do not restart syscall at EAGAIN when reading for -s 2017-03-19 17:29:48 +03:00
ZyX
bd798a3267 getchar: Use fileio instead of fdopen
Problem: as fileio is cached and reads blocks this is going to wait
until either EOF or reading enough characters to fill rbuffer. This is
not good when reading user input from stdin as script.
2017-03-19 16:56:00 +03:00
ZyX
fdfa1ed578 main: Temporary fix assertion error
This variant uses `fdopen()` which is not standard, but it fixes problem on my 
system. In next commit `scriptin` will use `FileDescriptor*` from os/fileio in 
place of `FILE*`.
2017-03-19 16:09:48 +03:00
ZyX
d2268d5ebb functests: Do not check stdout, it is different on Windows 2017-03-19 14:13:21 +03:00
ZyX
29654cfee7 functests: Fix testlint errors 2017-03-19 14:13:21 +03:00
ZyX
d4639ea6d9 functests: Use Neovim instance and system() in place of lua io.popen 2017-03-19 14:13:21 +03:00
ZyX
38687ee394 functests: Make sure that line ending is LF and not CRLF 2017-03-19 14:13:21 +03:00
ZyX
1ea7541f65 functests: Alter the order of checks
Check whether `repeated_read_cmd` returned nil and did not actually run nvim or 
it did, but still returned nil for whatever reason.
2017-03-19 14:13:21 +03:00
ZyX
3cd7bf31e2 tests: Fix repeated_popen_r usage, rename the function 2017-03-19 14:13:21 +03:00
ZyX
0e9286a19e tests: Fix CI failures 2017-03-19 14:13:21 +03:00
ZyX
0320a58082 functests: Check that -s works as expected 2017-03-19 14:13:21 +03:00
ZyX
65c41e6c2b main: Make -s - read from stdin 2017-03-19 14:13:21 +03:00
0cab62ad6f Merge #6305 from lonerover/vim-7.4.2228
vim-patch:7.4.2228,7.4.2248
2017-03-19 12:05:03 +01:00
6a68a922b8 clipboard: set v:register after startup (#5708)
Fixes #5697
2017-03-18 19:33:25 +01:00
bdcb2a38b3 readfile(): Remove "Reading from stdin..." #6298 2017-03-18 13:43:47 +01:00
a5481957c6 vim-patch:7.4.2255
Problem:    The script that checks translations can't handle plurals.
Solution:   Check for plural msgid and msgstr entries.  Leave the cursor on
            the first error.

ec42059b78
2017-03-18 20:39:04 +08:00
b65d5ff11b vim-patch:7.4.2248
Problem:    When cancelling the :ptjump prompt a preview window is opened for
            a following command.
Solution:   Reset g_do_tagpreview. (Hirohito Higashi)  Add a test.  Avoid that
            the test runner gets stuck in trying to close a window.

358308dd99
2017-03-18 18:10:23 +08:00
700e13da82 vim-patch:7.4.2228
Problem:    Test files have inconsistant modelines.
Solution:   Don't set 'tabstop' to 2, use 'sts' and 'sw'.

9e4d8215d3
2017-03-18 18:08:20 +08:00
c6b3975774 vim_vsnprintf: fix conversion error #6311
This looks mostly like a case where the compiler that ships with Ubuntu
12.04 has gone a little too far: `fmt_spec` is actually a char, as are
the literals, so there's really no issue.
2017-03-18 03:45:54 +01:00
9abef7ded9 test/put_spec: 2x speedup (#6294)
Instead of helpers.clear() between each test, use execute('enew!')
and ensure the state that matters is reset between each test.
2017-03-18 01:59:51 +01:00
b6502b868e version.c: Add v prefix to NVIM_VERSION_MEDIUM (#6310) 2017-03-18 01:49:55 +01:00
1de50acc41 vim-patch:7.4.2292 (#6304)
Problem:    Not all systems understand %F in printf().
Solution:   Use %f.

965ed14973
2017-03-17 18:30:18 +01:00
147e115dd9 vim-patch:7.4.2249 (#6303)
Problem:    Missing colon in error message.
Solution:   Add the colon. (Dominique Pelle)

ba2099034f
2017-03-17 18:26:33 +01:00
62e14d6565 os_set_cloexec: Fix condition. #5986
Also: skip Test_undo_del_chars the right way. #6287
2017-03-17 18:14:24 +01:00
2ea7bfc627 terminal: Support extra arguments in 'shell'. #4504
Tokenize p_sh if used as default in ex_terminal(). Previously p_sh was
used as the first arg in a list when calling termopen(), this would try
to call an untokenized version of shell, meaning if you had an argument
in 'shell':
    set shell=/bin/bash\ --login
the command would fail.

Helped-by: oni-link <knil.ino@gmail.com>

Closes #3999
2017-03-17 17:47:33 +01:00
0c1f783164 Merge #6087 from justinmk/defaults
defaults: 'ruler', 'showcmd', 'belloff=all'
2017-03-17 13:00:19 +01:00
10045cddb6 vim-patch:7.4.2113 #6287
Problem:    Test for undo is flaky.
Solution:   Turn it into a new style test.  Use test_settime() to avoid
            flakyness.

170b10b421
2017-03-17 12:34:53 +01:00
f6946c68ae job-control: set CLOEXEC on pty processes. #5986
Before this change, new processes started with libuv prevented SIGHUP
from reaching pty processes (by keeping the ptmx file descriptor open).
2017-03-17 12:20:51 +01:00
ad1884be0d Merge pull request #6296 from FriedSock/use_handle_get_buffer_refactor
Use handle_get_buffer for buflist_findnr
2017-03-17 09:18:51 +01:00
694edc5504 test: fix the unit test build on macOS Sierra (#6300)
We need to add the SDK includes to the preprocessing step, otherwise it
will fail to resolve the system includes such as sys/stat.h and fcntl.h.
2017-03-17 09:14:56 +01:00
09583a791c Replace hashtab with handle buffer functions 2017-03-16 18:26:46 +00:00
1dbe7a4dec doc: handle_* function declarations 2017-03-16 18:44:10 +01:00
a90beeadbb defaults: 'showcmd', 'belloff', 'ruler'
- Vim "unix default" of 'noshowcmd' is serving few users. And it's
  inconsistent.
- 'ruler' and 'belloff=all' improve the out-of-the-box experience.
- Continue to use 'noshowcmd' and 'noruler' by default in the functional
  tests to keep them fast.

TODO: Add a "disable slow stuff" command or mapping to address the
use-case of a very slow terminal connection.
2017-03-16 18:44:10 +01:00
27e1b2dce4 Merge pull request #6292 from jszakmeister/fix-tempfile-test
unittests: avoid using pattern matching on file names
2017-03-16 08:41:06 -04:00
3c8d974f73 unittests: avoid using pattern matching on file names
The directory name could contain special characters that trips up the
matching used by find.  Instead, let's just make sure that the filename
starts with the directory name.
2017-03-16 06:58:15 -04:00
50953f9661 version.c: mark NA patch (#6285) 2017-03-15 23:43:26 +01:00
40cc49c5da test/termclose: Avoid indeterminism (#6281) 2017-03-15 23:28:37 +01:00
297e8d0fda version.c: mark NA patches (#6282) 2017-03-15 19:49:12 +01:00
f4b8dbeeb2 Merge pull request #5540 from bfredl/api_since
allow specify api since field and more api compatibility checks
2017-03-15 17:46:07 +01:00
7d28489a33 release.sh: add api metadata fixture if api level was bumped 2017-03-15 15:01:06 +01:00
a5d03be7b8 api: bump api level to 2 2017-03-15 15:01:06 +01:00
9500ecdda5 api: add detailed checks for compatibility and correct "since" value 2017-03-15 15:01:06 +01:00
da6f4c146e api: implement FUNC_API_SINCE 2017-03-15 15:01:06 +01:00
82f55503dd api: add api_level_1 fixure 2017-03-15 15:01:06 +01:00
ec4e84210b Merge #6254 'vim-patch:7.4.2135,7.4.2144,7.4.2151' 2017-03-15 14:10:56 +01:00
3b52e3c4c8 Merge #6252 from jamessan/vim-7.4.2069
vim-patch:7.4.2069,7.4.2101,7.4.2222,7.4.2223
2017-03-15 13:47:13 +01:00
227859ea79 vim-patch:7.4.2264 (#6275)
Problem:    When adding entries to an empty quickfix list the title is reset.
Solution:   Improve handling of the title. (Yegappan Lakshmanan)

2b529bb626
2017-03-14 15:07:48 +01:00
36fd879b25 doc: eval.txt fixup, README.md 2017-03-13 15:50:50 +01:00
33d0637521 Merge #6268 from lonerover/vim-7.4.2208
vim-patch: 7.4.2208,7.4.2305
2017-03-13 14:12:38 +01:00
76829898bd vim-patch:7.4.2305
Problem:    Marks, writefile and nested function tests are old style.
Solution:   Turn them into new style tests. (Yegappan Lakshmanan)

19a1669ffc
2017-03-13 20:24:48 +08:00
ec4c12570c vim-patch:7.4.2208
Problem:    Test for mappings is old style.
Solution:   Convert the test to new style.

2d1a248762
2017-03-13 20:11:24 +08:00
3f555cce3d Merge #6261 from lonerover/vim-ac80999
vim-patch: ac80999,7.4.2185,7.4.2187,7.4.2196
2017-03-13 03:06:12 +01:00
71d4b81b4c vim-patch:8.0.0453 (#6266)
Problem:    Adding fold marker creates new comment.
Solution:   Use an existing comment if possible. (LemonBoy, closes vim/vim#1549)

025a6b708a
2017-03-13 01:54:35 +01:00
c42aebf23e Merge #6264 'coverity fixes' 2017-03-12 20:18:55 +01:00
b45ddf731b terminal: disable 'list' by default (#6246) 2017-03-12 22:42:22 +01:00
bf5110266c Merge #6262 from justinmk/dirchanged
DirChanged fixes
2017-03-12 21:01:04 +01:00
c5e61b41a5 DirChanged: avoid redundant events on 'autochdir' 2017-03-12 15:45:50 +01:00
d9fcbc2cfb DirChanged: trigger when switching scopes
Closes #6054
2017-03-12 14:39:32 +01:00
99a1a58c66 DirChanged: Publish _after_ updating win/tab CWD.
So getcwd() works correctly during DirChanged event.

Closes #6260
2017-03-12 14:39:32 +01:00
10a5825b95 coverity/155507: remove condition where both branches were identical
`keylen` was always set to 0 from both branches of an if-statement. This
condition is removed, and the code is simplified based on the fact that
`keylen` is always 0 in this code. Also updated the surrounding comments,
some of which were outdated.
2017-03-12 14:18:13 +01:00
82117da5df tabpage_S: Name tp_localdir per convention. 2017-03-12 12:39:20 +01:00
c8f0f8fea6 Merge #6214 from ZyX-I/split-eval'/isolated-unittests
Run all unit tests in separate processes
2017-03-12 10:52:13 +01:00
013a9f9a04 vim-patch:7.4.2196
Problem:    glob2regpat test doesn't test everything on MS-Windows.
Solution:   Add patterns with backslash handling.

91c5262b19
2017-03-12 11:40:38 +08:00
a4b57c2089 vim-patch:7.4.2187
Problem:    glob2regpat test fails on Windows.
Solution:   Remove the checks that use backslashes.

7547a78446
2017-03-12 11:37:31 +08:00
9f13983de2 vim-patch:7.4.2185
Problem:    Test glob2regpat does not test much.
Solution:   Add a few more test cases. (Dominique Pelle)

71dd9744cf
2017-03-12 11:36:12 +08:00
ce6d2fbb61 vim-patch:ac80999
add missing test file

ac80999985
2017-03-12 11:33:49 +08:00
d72c177b2a lint 2017-03-11 20:32:39 -05:00
2ed2b1d505 vim-patch:7.4.2223
Problem:    Buffer overflow when using latin1 character with feedkeys().
Solution:   Check for an illegal character.  Add a test.

d3c907b5d2
2017-03-11 20:32:38 -05:00
eaf1f9b9dc vim-patch:7.4.2222
Problem:    Sourcing a script where a character has 0x80 as a second byte does
            not work. (Filipe L B Correia)
Solution:   Turn 0x80 into K_SPECIAL KS_SPECIAL KE_FILLER. (Christian
            Brabandt, closes vim/vim#728)  Add a test case.

6bff02eb53
2017-03-11 20:32:27 -05:00
564e9dc17f vim-patch:7.4.2101
Problem:    Looping over windows, buffers and tab pages is inconsistant.
Solution:   Use FOR_ALL_ macros everywhere. (Yegappan Lakshmanan)

2932359000
2017-03-11 20:32:09 -05:00
5674057e3a vim-patch:7.4.2069
Problem:    spell.c is too big.
Solution:   Split it in spell file handling and spell checking.

9ccfebddc3
2017-03-11 20:32:02 -05:00
ZyX
48e7a83447 unittests: Fix linter error 2017-03-12 04:20:31 +03:00
ZyX
def52ad668 tests: Add description of test directory structure and test env vars 2017-03-12 04:18:15 +03:00
ZyX
d559fe6e93 unittests: Allow running ffi.cdef in the main process 2017-03-12 03:14:34 +03:00
ZyX
a7f64ba517 unittests: Move filtering cdefs to main process 2017-03-12 03:02:14 +03:00
ZyX
bf68907778 unittests: Use more adequate names for some functions 2017-03-12 02:54:23 +03:00
ZyX
9d1b439fb7 tests: Allow lfs.attributes to be NULL when traversing FS 2017-03-12 00:25:55 +03:00
ZyX
8ef6cfa6ac unittests: Fix linter errors 2017-03-11 23:48:16 +03:00
ZyX
a54be846cf unittests: Update test/unit/message_spec.lua 2017-03-11 23:26:33 +03:00
ZyX
ec730daee9 unittests: Do not use which, add data to paths.lua.in instead 2017-03-11 23:23:50 +03:00
ZyX
ce12bda712 unittests: Always close all pipes 2017-03-11 23:23:49 +03:00
ZyX
e2a578f40d unittests: Do not import libnvim or headers in main process
Slows down unit tests much, but gets rid of as much preserved state as possible.
2017-03-11 23:23:49 +03:00
ZyX
9400466282 unittests: Check core dumps in after_each, like in functests 2017-03-11 23:23:49 +03:00
ZyX
12b062b2c8 unittests: Run all unit tests in their own processes
Used

    sed -r -i -e '/ helpers =/ s/$/\nlocal itp = helpers.gen_itp(it)/; s/^(\s*)it\(/\1itp(/' test/unit/**/*_spec.lua

to alter all tests. Locally they all run fine now.

Reasoning:

1. General: state from one test should not affect other tests.
2. Local: travis build is failing with something which may be an output of
   garbage collector. This should prevent state of the garbage collector from
   interferring as well.
2017-03-11 23:23:30 +03:00
ZyX
5898b42d82 unittests: Do not run failing test at all 2017-03-11 23:23:30 +03:00
ZyX
29ed5b3a39 unittests: Fix lint errors 2017-03-11 23:23:30 +03:00
ZyX
b442574862 unittests: Allow failing test to fail 2017-03-11 23:23:30 +03:00
ZyX
ff5dca6630 unittests: Log syscalls if requested 2017-03-11 23:23:30 +03:00
ZyX
1edb3ccc36 unittests: Use own bindings to libc syscall wrappers 2017-03-11 23:23:30 +03:00
ZyX
3adecd3ede unittests: Do not use syscall library: does not work well with cimport 2017-03-11 23:23:30 +03:00
ZyX
9f29a76cab unittests: Try using syscall library instead (ffi-based) 2017-03-11 23:23:30 +03:00
ZyX
b92d6aaf0d unittests: Pause garbage collector while executing tests
Temporary (?) workaround for currently failing check_alloc_log tests.
2017-03-11 23:23:30 +03:00
ZyX
82e5af85c1 unittests: Run tests in a separate process 2017-03-11 23:23:30 +03:00
e66c6dd9d5 coverity/155501: fix bug where P_NO_DEF_EXP was ignored 2017-03-11 19:09:55 +01:00
4ca8a69067 coverity/133900: intitialize scalar variable in struct 2017-03-11 19:09:17 +01:00
b2b15e6e13 win/package: nvim-qt v0.2.6 (#6258) 2017-03-11 16:00:26 +01:00
6493ffac1f contrib/ycm_extra_conf.py (#6257)
- Remove some unnecessary code: IsHeaderFile is no longer required, as the logic
  to find flags to headers is now built into YCM
- Add function to make paths in flags absolute: It seems YCM is not correctly
  resolving paths in flags to consider `build` as the compiler working
  directory.
- Update documentation.
2017-03-11 15:37:21 +01:00
fd27d5a70f test/scrollback: wiggle-room (#6256) 2017-03-11 14:46:35 +01:00
c5edde90cc win: third-party: win32yank v0.0.3 (#6255)
Fixes trailing newline bug when pasting text in Windows.

References:
https://github.com/equalsraf/neovim-qt/issues/218
https://github.com/equalsraf/neovim-qt/issues/253
2017-03-11 14:10:19 +01:00
eb8cbfc8f5 vim-patch:8.0.0068 (#6243)
Problem:    Checking did_throw after executing autocommands is wrong. (Daniel
            Hahler)
Solution:   Call aborting() instead, and only when autocommands were executed.

21662be221
2017-03-11 13:56:23 +01:00
d1afd434f3 rplugin: Call s:LoadRemotePlugins() on startup.
Dispense with the FuncUndefined/CmdUndefined quasi-optimization.
If there are no rplugins, plugin/rplugin.vim takes less than 1ms.

Closes #5821
Closes #6250

Helped-by: Qiming zhao <chemzqm@gmail.com>
2017-03-11 12:26:22 +01:00
2ecab2193d vim-patch:7.4.2151
Problem:    Quickfix test fails on MS-Windows.
Solution:   Close the help window. (Christian Brabandt)

cf25fdb8f1
2017-03-11 19:07:05 +08:00
6311ec3a63 vim-patch:7.4.2144
Problem:    On MS-Windows quickix does not handle a line with 1023 bytes
            ending in CR-LF properly.
Solution:   Don't consider CR a line break. (Ken Takata)

796aa9c804
2017-03-11 19:02:10 +08:00
3de3340132 vim-patch:7.4.2135
Problem:    Various tiny issues.
Solution:   Update comments, white space, etc.

89eaa4185e
2017-03-11 18:26:03 +08:00
1743df82f9 'cpoptions': "_" flag to toggle cw behaviour #6235
`cw` and `cW` behave like `ce` and `cE` respectively. This is
inconsistent compared to `dw` and `dW`.
Introduce a new cpoptions flag "_" to toggle the Vi behavior.

Closes #6234
Patch-by: Christian Brabandt <cblists@256bit.org>

References:
https://github.com/chrisbra/vim-mq-patches/blob/master/cpo_changeword
https://groups.google.com/d/msg/vim_use/aaBqT6ECkA4/ALf4odKzEDgJ
https://groups.google.com/d/msg/vim_dev/Dpn3xtUF16I/T6JcOPKN6usJ
http://www.reddit.com/r/vim/comments/26nut8/why_does_cw_work_like_ce/
2017-03-10 19:24:04 +01:00
59ea30adda version.c: mark NA patches (#6242)
Signed-off-by: Gavin Thomas Claugus <gclaugus@gmail.com>
2017-03-10 00:19:42 +01:00
087acd79f8 test/let_spec: self-referencing List. (#6228)
Regression test coverage for #6070.
2017-03-08 03:23:40 +01:00
58b5e14387 vim-patch:7.4.2299 (#6232)
Problem:    QuickFixCmdPre and QuickFixCmdPost autocommands are not always
            triggered.
Solution:   Also trigger on ":expr", ":cbuffer", etc. (Yegappan Lakshmanan)

04c4ce650f
2017-03-07 23:31:15 +01:00
f613dd016a Merge pull request #6225 from jamessan/vim-7.4.2051
vim-patch:7.4.2051,7.4.2068,7.4.2097
2017-03-07 09:03:52 -05:00
70bbd5a7ef Merge #6222 from jbradaric/vim-7.4.2220
vim-patch:7.4.2220,7.4.2265
2017-03-07 14:07:43 +01:00
b9cea7f13f vim-patch:7.4.2265
Problem:    printf() isn't tested much.
Solution:   Add more tests for printf(). (Dominique Pelle)

76efafba2a
2017-03-07 08:06:05 +01:00
6fe677c108 api: nvim_buf_set_lines(): Avoid invalid ml_get. #6019
When the buffer that nvim_buf_set_lines() is changing is not in any vim
window, fix_cursor() leads to calling ml_get_buf() with an invalid line
number. The condition that fix_cursor() was called on was (buf ==
curbuf), but this is always true because of the call to
switch_to_win_for_buf() earlier in the function.

Instead this should be predicated on (save_curbuf.br_buf == NULL)
2017-03-07 01:29:08 +01:00
1215084676 Merge #6224 from justinmk/test-fish-backtick
test: backtick-expansion for `shell=fish`
2017-03-06 23:44:54 +01:00
532197b4f9 lint 2017-03-06 15:36:14 -05:00
52e56954c6 vim-patch:7.4.2097
Problem:    Warning from 64 bit compiler.
Solution:   use size_t instead of int. (Mike Williams)

d4f31dc454
2017-03-06 15:36:14 -05:00
4e3a2784ec vim-patch:7.4.2068
Problem:    Not all arguments of trunc_string() are tested.  Memory access
            error when running the message tests.
Solution:   Add another test case. (Yegappan Lakshmanan)  Make it easy to run
            unittests with valgrind.  Fix the access error.

b9644433d2
2017-03-06 15:36:09 -05:00
04b91d6b89 strings.c: Fix problems found during code review. 2017-03-06 21:35:48 +01:00
2f80360e9a vim-patch:7.4.2220
Problem:    printf() gives an error when the argument for %s is not a string.
            (Ozaki Kiichi)
Solution:   Behave like invoking string() on the argument. (Ken Takata)

e5a8f35b42
2017-03-06 21:35:48 +01:00
7217360e34 vim-patch:7.4.2051
Problem:    No proper testing of trunc_string().
Solution:   Add a unittest for message.c.

502ae4ba63
2017-03-06 15:09:40 -05:00
d1d35c9cfc test: backtick expansion #6218 2017-03-06 12:40:22 +01:00
60fa3aa143 linter: make os_unix.c pass the linter 2017-03-06 13:18:52 +01:00
8f0f1a76c2 make backtick-expansion work with shell=fish 2017-03-06 13:18:24 +01:00
483e8257e5 vim_getenv: $VIMRUNTIME fallback: ../share/nvim/runtime (#6223)
Do this on all systems, so that portable builds work everywhere. This
allows us to ship archives with this folder structure:

    bin/nvim
    share/nvim/runtime

then ./bin/nvim works without the user needing to explicitly set VIMRUNTIME.
2017-03-06 04:04:25 +01:00
e5be3aaaef health.vim: tmux $TERM, default-terminal 2017-03-06 03:17:40 +01:00
e32ec03d67 Merge #6202 from justinmk/tui-resize-hack
ui: Ameliorate TUI resize bug.
2017-03-05 23:24:47 +01:00
6777b6ecbc ui: Fix TUI resize bug
statusline still disappears in some cases, but this change is a net
improvement.

References #3929 #5692 #4884 #6157
2017-03-05 22:17:32 +01:00
a568816253 lint
You cannot escape clint...
2017-03-05 22:17:15 +01:00
a314f6d79f Merge pull request #6215 from jamessan/coverity-model
ci: Add Coverity modeling
2017-03-05 09:17:50 -05:00
6a56ac2eca Merge #6209 from Shougo/vim-8.0.0319
vim-patch: 8.0.0319, 8.0.0347
2017-03-05 10:28:21 +01:00
b0fb1f4540 ci: Add Coverity modeling
[ci skip]
2017-03-04 23:20:00 -05:00
cf0b344df1 vim-patch:8.0.0347
Problem:    When using CTRL-X CTRL-U inside a comment, the use of the comment
            leader may not work. (Klement)
Solution:   Save and restore did_ai. (Christian Brabandt, closes vim/vim#1494)

d099e03370
2017-03-05 12:02:42 +09:00
4303399c10 vim-patch:8.0.0319
Problem:    Insert mode completion does not respect "start" in 'backspace'.
Solution:   Check whether backspace can go before where insert started.
            (Hirohito Higashi)

190b04cdd9
2017-03-05 12:02:32 +09:00
32a9808bc5 win/package: Upgrade to neovim-qt v0.2.5 (#6213) 2017-03-04 21:50:43 +01:00
3030ef825d terminal.c: Reset cursor postion when using termopen() (#6212)
After using 'termopen("echo") the current buffer content is changed,
but the cursor position of the current window is not updated.
Because of this, a call to 'mb_adjust_cursor()'  can lead to a
heap-buffer-overflow.

Fix this by resetting the cursor for the current window.

Fixes #3161
2017-03-04 20:12:57 +01:00
af63f32129 doc: quotes.txt was removed 2017-03-04 04:13:31 +01:00
8bbdef1fd8 buffer.c: enable -Wconversion #3744 2017-03-03 00:15:42 +01:00
165d525abd buffer.c: enable -Wconversion #3744
Closes #3744
2017-03-02 22:46:11 +01:00
b62f837395 terminal: Restore settings on same window only.
The window may have closed already, then `curwin` should not be altered.

Closes #6204
2017-03-02 13:32:29 +01:00
8a10497ce6 vim-patch:7.4.1981 (#6192)
Problem:    No testing for Farsi code.
Solution:   Add a minimal test.  Clean up Farsi code.

ee2615af64
2017-03-02 12:47:35 +01:00
286aacb2aa Merge #6194 'filtering manually folded lines' 2017-03-02 00:19:06 +01:00
b1731fe1b5 vim-patch:8.0.0388
Fix a problem when filtering manually folded lines

When foldMarkAdjustRecurse() is called to adjust folds that start inside
the range of lines that are being moved and end outside that range, it
calculates `amount_after` for its recursive call incorrectly.
The calculation assumes that folds inside the changed range are being
deleted, but this is not always the case.

This means nested folds that start after the changed range of lines are
shifted an incorrect amount.

We fix this by calculating the `amount_after` differently if the folds
inside the changed range are not being deleted.
2017-03-02 00:18:00 +01:00
689e0daa95 vim-patch:8.0.0136
Problem:    When using indent folding and changing indent the wrong fold is
            opened. (Jonathan Fudger)
Solution:   Open the fold under the cursor a bit later. (Christian Brabandt)

54b2bfa399
2017-03-02 00:11:30 +01:00
3c740f7424 vim-patch:8.0.0135
Problem:    An address relative to the current line, ":.,+3y", does not work
            properly on a closed fold. (Efraim Yawitz)
Solution:   Correct for including the closed fold. (Christian Brabandt)

ded2782783
2017-03-02 00:08:51 +01:00
985bc6c6e0 doc/api.txt: Merge with api-funcs.txt
It's important that users have a single, easy-to-remember place for
reading about the API. So this commit changes gen_api_vimdoc.py so that
the generated section is appended to api.txt instead of creating
a separate document.

Also remove the section numbering and ToC: it's a maintenance cost, and
it will be unnecessary when #5169 is integrated.
2017-03-01 23:14:45 +01:00
2c408c0c94 Merge #6185 from justinmk/term-cursor
terminal: Keep cursor position; Disable 'cursorline'
2017-03-01 18:28:45 +01:00
4e4c785063 scripts: Annotate API functions in generated docs (#6199) 2017-03-01 17:55:34 +01:00
4306e5ae0c test: luacheck update
We pull luacheck HEAD, so this is a "catch up" commit to fix
newly-discovered errors.
2017-03-01 14:47:49 +01:00
3aedf9d669 terminal: Avoid unnecessary redraws. 2017-03-01 14:47:49 +01:00
857113ca8c terminal: Disable some options in terminal-mode.
In terminal-mode these options are nonsense because cursor is placed at
end of buffer to "follow" output.

Closes #2259
2017-03-01 14:47:49 +01:00
937e54f865 terminal: Keep cursor position.
Let the terminal dictate the normal-mode cursor position. This will be
disorienting sometimes, but it is closer to what users expect vs always
going to the last line.
2017-03-01 14:47:49 +01:00
504693ce66 Merge #6139 from justinmk/win32-runtime
win/package: runtime files
2017-03-01 14:41:58 +01:00
410da0f678 vim-patch:8.0.0390 (#6197)
Problem:    When the window scrolls horizontally when the popup menu is
            displayed part of it may not be cleared. (Neovim issue #6184)
Solution:   Remove the menu when the windows scrolled. (closes vim/vim#1524)

Fixes #6184
2017-03-01 14:08:05 +01:00
5c421080f8 win/package: runtime files
runtime/plugin/gui_shim.vim is from Neovim-Qt. This is a temporary
measure, we will add real UI events which obviate gui_shim.vim.

Closes #6145
2017-03-01 14:03:58 +01:00
500454227f win/package: cat.exe 2017-03-01 12:35:49 +01:00
2872e57af2 Merge #6191 from jamessan/vim-42ebd06
vim-patch:42ebd06,7.4.2098,6f1d9a0,7.4.2095
2017-02-28 09:57:46 +01:00
5ed753044d test: Refactor fold tests (#5993) 2017-02-28 09:34:02 +01:00
adc6e636fe vim-patch:7.4.2095
Problem:    Man test fails when run with the GUI.
Solution:   Adjust for different behavior of GUI.  Add assert_inrange().

61c04493b0

Only changes related to assert_inrange() were included, since we have a
distinct man plugin.
2017-02-27 21:40:16 -05:00
f3d8bc8b61 vim-patch:6f1d9a0
Updated runtime files.

6f1d9a096b

This was already included as 6ba3b85382,
but the vim-patch: tag didn't contain enough digits for vim-patch.sh to
notice it.
2017-02-27 20:58:14 -05:00
ad202b8401 vim-patch:7.4.2098
Problem:    Text object tests are old style.
Solution:   Turn them into new style tests. (James McCoy, closes vim/vim#941)

00b24be454
2017-02-27 20:52:42 -05:00
1371e19e2b vim-patch:42ebd06
Update runtime files.

42ebd06642
2017-02-27 20:49:01 -05:00
e0705021c1 Merge pull request #6190 from jamessan/vim-7.4.1991
vim-patch:7.4.1991,7.4.1992,7.4.1993,7.4.1994
2017-02-27 20:33:43 -05:00
86c2adc074 edit.c: CTRL-SPC: Insert previously-inserted text. #6090
Default Vim behavior of i_CTRL-<Space> is to insert the last-inserted
text and exit insert mode. :help i_CTRL-@

Before this commit that did not happen because insert_handle_key()
checks for NUL instead of checking for ' ' with a CTRL `mod_mask`.

I'm leaving the check for NUL despite the fact that at the moment that
key is never seen when using the terminal UI (not for C-Space, nor C-@).
This is because I assume it's still allowed for other front-ends to pass
NUL, but at the moment the terminal UI isn't.
2017-02-28 01:16:18 +01:00
28a6d4393d Merge #6148 from delftswa2017/clang-scan-fix-dead-stores
vim-patch:8.0.0353
2017-02-28 00:46:09 +01:00
1fa6d95c67 vim-patch:7.4.1994
Problem:    True-false test fails.
Solution:   Filter the dict to only keep the value that matters.

05e418d436
2017-02-27 15:11:23 -05:00
f863b23fd9 vim-patch:7.4.1993
Problem:    Not all TRUE and FALSE arguments are tested.
Solution:   Add a few more tests.

6bb450145e
2017-02-27 15:04:54 -05:00
2f5aee561e vim-patch:7.4.1992
Problem:    Values for true and false can be confusing.
Solution:   Update the documentation.  Add a test.  Make v:true evaluate to
            TRUE for a non-zero-arg.

e381d3d5e0
2017-02-27 15:00:18 -05:00
c8ee0be745 man.vim: use 'eventignore' instead of :noautocmd #6149
We only need to ignore BufReadCmd (from runtime/plugin/man.vim).

Closes #6144
2017-02-27 18:16:37 +01:00
7046b9a78d Merge pull request #6121 from lonerover/vim-7.4.2046
vim-patch:7.4.2046
2017-02-27 17:57:28 -05:00
792fbed5f7 build: local.mk.example: doxygen target (#6187) 2017-02-27 23:51:45 +01:00
d290c13421 Merge pull request #6188 from jamessan/vim-7.4.2200
vim-patch:7.4.2200

Closes #5314
2017-02-27 14:35:57 -05:00
eb6651b7a9 vim-patch:7.4.1991
Problem:    glob() does not add a symbolic link when there are no wildcards.
Solution:   Remove the call to mch_getperm().

00efded106
2017-02-27 12:03:28 -05:00
a989851e3b lint 2017-02-27 11:41:52 -05:00
c9c3f92b49 vim-patch:7.4.2200
Problem:    Cannot get all information about a quickfix list.
Solution:   Add an optional argument to get/set loc/qf list(). (Yegappan
            Lakshmanan)

d823fa910c
2017-02-27 11:39:41 -05:00
be65fd88f4 Merge pull request #6186 from jamessan/base-vim-patch
vim-patch.sh: Bump base Vim version to 7.4.1980
2017-02-27 09:48:52 -05:00
0882ca50d8 vim-patch.sh: Bump base Vim version to 7.4.1980
All patches up through 7.4.1974 have been merged and 7.4.1975-1979 are
pending in a PR.

[ci skip]
2017-02-27 09:31:25 -05:00
6041fd7a86 build: Makefile: Try other cmake names, or override. #6163
Distributions like RHEL7 (yum) install CMake as `cmake3`.

Closes #6163
2017-02-27 14:28:15 +01:00
c318d8e672 Merge #6112 from ZyX-I/split-eval'/buf_get_changedtick
Better b:changedtick support
2017-02-27 10:29:46 +01:00
8c8ce1832e Merge #6111 from ZyX-I/split-eval'/os-fileio
Refactor writefile() and create more tests for it
2017-02-27 10:20:25 +01:00
e502cca010 Merge #6142 from justinmk/term-modifiable
terminal: 'modifiable'; 'scrollback'; follow output only if cursor is on last line
2017-02-27 09:59:58 +01:00
73a054d844 Merge pull request #6181 from jamessan/vim-8.0.0379
vim-patch:8.0.0379
2017-02-26 22:12:39 -05:00
69bfe14b79 vim-patch:8.0.0379
Problem:    CTRL-Z and mouse click use CTRL-O unnecessary.
Solution:   Remove stuffing CTRL-O. (James McCoy, closes vim/vim#1453)

74a47162a0
2017-02-26 14:20:54 -05:00
c484323dc6 terminal.c/redraw(): Remove cargo cult. 2017-02-26 13:00:02 +01:00
f7908b6f49 channel.c: logging 2017-02-26 13:00:02 +01:00
152921837e test: screen_setup(): Detect spawn failures, usage errors. 2017-02-26 13:00:01 +01:00
d90e5f5260 test: screen_setup(): Support cols parameter. 2017-02-26 13:00:01 +01:00
9dbda59715 test/window_split_tab_spec.lua: fixup
Make the test work after the "follows cursor" changes.
This "auto-resize" feature is going away soon, anyways.
2017-02-26 13:00:01 +01:00
4ceec30cd0 terminal: Follow output only if cursor is at end.
Closes #2257
Closes #2636
References #2683
2017-02-26 13:00:01 +01:00
e7bbd35c81 terminal: 'scrollback'
Closes #2637
2017-02-26 11:57:52 +01:00
300eca3d30 options: 'scrollback' 2017-02-26 11:57:52 +01:00
fedb8443d5 terminal: Allow undo and 'modifiable'.
Partial step towards #2637. Will crash if *all* lines are deleted.

Closes #2607
References #5431
2017-02-26 11:29:02 +01:00
7ea81fe443 terminal: Don't redraw the entire screen when resizing (#6167) 2017-02-26 10:21:44 +01:00
0ef2b07d69 vim-patch:7.4.2230 (#6080)
Problem:    There is no equivalent of 'smartcase' for a tag search.
Solution:   Add value "followscs" and "smart" to 'tagcase'. (Christian
            Brabandt, closes vim/vim#712) Turn tagcase test into new style.

66e29d7112
2017-02-25 15:42:25 +01:00
ZyX
a85021068d *: Fix linter errors 2017-02-25 01:23:14 +03:00
ZyX
77ebe85be6 buffer: Hide one of the asserts from lua parser 2017-02-25 00:22:46 +03:00
ZyX
5f7d8f889c buffer: Provide an initializer for di_key 2017-02-24 20:14:01 +03:00
039c7ab607 ci: MIN_LOG_LEVEL=2 (#6169)
DEBUG_LOG_LEVEL is very noisy and causes a lot of disk activity.
It is not needed on CI.
2017-02-24 11:03:56 +01:00
ZyX
dfb28c524c buffer: Remove b:changedtick from b: before freeing b:
Avoids loosing b:changedtick value at `:bdelete`.
2017-02-24 05:10:31 +03:00
ZyX
fe30d8ccef memory: Free buffers after freeing variables
Avoids use-after-free crashes when compiling with -DEXITFREE.
2017-02-24 05:09:34 +03:00
ZyX
cd8f07cb75 eval: Do not allocate b:changedtick dictionary item 2017-02-24 02:47:43 +03:00
ZyX
9c1865c7f8 *: Fix linter errors 2017-02-23 19:48:41 +03:00
ZyX
858ac9d8e5 api: Make sure dict_set_var doesn’t edit read-only values
Fixes #6147
2017-02-23 19:48:41 +03:00
ZyX
8faa4af396 api: Rename dict_set_value to dict_set_var
Reasonings:
1. It is not used for anything, but scope dictionaries currenly. So there is no 
   need to generalize and split it into dict_set_var (which will contain some 
   scope-dictionary-specific checks) and dict_set_value (which will work for any 
   dictionary).
2. Check for key size is no longer valid for non-scope dictionaries: you *can* 
   use empty keys there. In scope dictionaries also, but you actually are not 
   supposed to store there anything, but variables.

Note that actually one may still do

    let b:[''] = 1

and “bypass” check for variable name. It won’t change what `echo b:` will show, 
but it may affect code which iterates over scope dictionary keys and sets them 
to something (if there is such code).
2017-02-23 19:48:41 +03:00
ZyX
6550caee50 functests: Destroy accidental folds in api/vim_spec 2017-02-23 19:48:41 +03:00
ZyX
f387de4ec0 eval: Remove incorrect workaround
Was replaced by the previous patch. Also fixes legacy test 055.
2017-02-23 19:48:41 +03:00
ZyX
d8a7e5fdbb eval: Forbid (un)locking b:changedtick
Port of vim-patch:8.0.0343
2017-02-23 19:48:41 +03:00
ZyX
9668d26a43 eval: Make sure islocked('b:.changedtick') does not error out
Port of vim-patch:8.0.0345
2017-02-23 19:48:41 +03:00
ZyX
9972db79c8 eval: Specify more precise len for var_check_ro in get_lval 2017-02-23 19:46:45 +03:00
ZyX
d5ab50a040 eval: Refactor var_check_ro, tv_check_lock and var_check_fixed
- They are no longer responble for using gettext.
- They now receive string length and use %.* format specifier in messages.
- And one less global: one of the error messages is never repeated.
2017-02-23 19:46:45 +03:00
ZyX
d820daf076 functests: Add some more tests 2017-02-23 19:46:45 +03:00
ZyX
7869b978e8 eval: Fix memory leak
Ref vim/vim#1497
2017-02-23 19:46:45 +03:00
ZyX
3277eff31a buffer: Forbid unletting b:changedtick 2017-02-23 19:46:45 +03:00
ZyX
e2fbbb292f eval: Refactor item_lock
If I am not mistaking, this commit should not change any functionality.
2017-02-23 19:46:45 +03:00
ZyX
f2c9fd312c eval: Make sure that b:changedtick may not be unlocked via :unlo b:var
It still may be unlocked by `:unlock b:.var`.
2017-02-23 19:46:44 +03:00
ZyX
908e53d98d functests: Add tests
Contains a number of FIXMEs.
2017-02-23 19:46:44 +03:00
ZyX
4f10d42f82 buffer: Bind b:changedtick to b:['changedtick'], remove special cases 2017-02-23 19:46:44 +03:00
ZyX
0eab7ac4b9 api/buffer: Add nvim_buf_get_changedtick method 2017-02-23 19:46:44 +03:00
9752a333c3 Merge pull request #5771 from brcolow/lambda
Lambda Support
2017-02-23 07:30:20 -05:00
4e21311f9c vim-patch:8.0.0341 (#6151)
Problem:    When using complete() and typing a character undo is saved after
            the character was inserted. (Shougo)
Solution:   Save for undo before inserting the character.

d56a79d339
2017-02-23 12:37:46 +01:00
34e24cb2f7 terminal: Initialize colors in reverse order (#6160)
Closes #3601

Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
2017-02-23 11:44:09 +01:00
d4dd447ded win: test: Fix closure jobs test on Windows 2017-02-23 01:24:55 -05:00
bc76ce2c4f Merge remote-tracking branch 'origin/master' into lambda 2017-02-22 19:23:20 -05:00
ZyX
31cdb227ba eval: Flush buffer in write_list
This way success/failure return from this function is more precise.
2017-02-23 01:49:05 +03:00
1a81ec6d88 strings.c: remove unused assignment
As reported by clang-scan, `length_modifier` is never read in any code path
following this branch. It is safe to remove.
2017-02-20 20:06:38 +01:00
192fd161f9 hardcopy.c: fix dead assignment
`has_mbyte` is deprecated (globals.h), so `outputlen` is always assigned
within the if statement. Therefore, the previous initialization is
unnecessary.
2017-02-20 20:06:38 +01:00
ddd8f7d333 message.c: fix dead assignment by removing dead code
`enc_dbcs` and `enc_utf8` are deprecated (globals.h), so the second branch is
always taken.
2017-02-20 20:06:38 +01:00
8e194c53c7 misc1.c: remove dead initialization 2017-02-20 20:06:38 +01:00
83666f3ce2 screen.c: remove dead code
As stated in globals.h, mbyte flags are deprecated, and code using it can be
refractored to remove dead code. Since has_mbyte is defined to true, this
refractoring correct.
2017-02-20 20:06:38 +01:00
04fb65fd76 screen.c: account for translated string length
`[RO]` is appended to the status line and `len` is increased with the length of
this string (4). However, the string is marked for translation and may
thus well be larger (or smaller) than 4. Therefore, we check the length at
runtime. The resulting len is never actually used, and thus could be removed.
However, by keeping this line, the body of this if-statement is kept consistent
with surrounding code, and future changes can not forget to add this line when
additional strings are added to p.
2017-02-20 19:56:58 +01:00
ddab4661f7 strings.h: Include <stdarg.h> for vim_vsnprintf's use of va_list
This fully resolves #6141.
2017-02-20 11:54:58 -05:00
a667972568 string.c: Include <stdarg.h> for va_list type and va_* macros
Closes #6141
2017-02-19 18:40:33 -05:00
3a2ae17062 globals.h: Avoid expression in array definition.
See aa56b24ee6 (commitcomment-20949000)
2017-02-19 02:55:27 +01:00
22337b1c01 Merge #6137 from justinmk/cmdline-ctrl-r
cmdline: CTRL-R: Omit trailing ^M character
2017-02-19 14:20:52 +01:00
baab49ee89 cmdline: CTRL-R: Omit trailing <CR>.
The "technically correct" interpretation is to execute the first line
that is seen (and this is what happens on middle-click paste in Vim).
^M is only intended to "defuse" the newline, so the user can review it.

The parent commit changed the behavior to insert <Space> between lines,
but that's a higher-risk change: it is arguably possible that some user
*wants* the literal ^M chars when e.g. assigning to a register:
    :let @a='<C-R>b'

To avoid that risk, keep the old behavior and only omit the last ^M.
This makes `yy:<C-R>0` nicer at no cost.
2017-02-18 23:24:35 +01:00
308ccb6f5e cmdline: CTRL-R: <Space> instead of CR between lines.
^M isn't any more "correct" than space: the "technically correct"
interpretation is to execute the first line that is seen (and this is
what happens on middle-click paste in Vim). ^M is only intended to
defuse the newline, so that the user can review the command. We can do
that with a space instead, and then the command can be executed without
having to fix it up first.
2017-02-18 14:49:05 +01:00
b0bbe82a60 eval.c: has("unnamedplus"). (#6136)
Return 1 for UNIX  with a functioning clipboard provider.

Closes #6103
2017-02-18 14:04:46 +01:00
158ea52854 options: Remove 'esckeys' (#6138)
This was never supported and it does not make sense for Nvim.
2017-02-18 14:01:20 +01:00
b49a74a1af doc: README.md 2017-02-17 17:44:10 +01:00
59254e4ae7 doc: README.md 2017-02-17 17:41:30 +01:00
c1bc784ad8 Merge #6110 'refactor: Move vim_*printf to strings.c'. 2017-02-17 16:25:19 +01:00
f017ae6115 doc/provider: python virtualenvs #6135
Closes #1887

Helped-by: Tommy Allen <tommy@esdf.io>
2017-02-17 03:44:05 +01:00
706b01ba79 Merge #6114 'Partial string handling refactoring'. 2017-02-17 02:08:21 +01:00
4a107a11a1 Merge #6105 from justinmk/win32-bindeps
Windows: ship with common tools
2017-02-16 16:53:34 +01:00
0095ad5693 win/CI: Cache dependencies. 2017-02-16 16:23:18 +01:00
ab9298ec15 win/package: Copy externals without analyzing.
These are just blobs that we jammed into the package. find_program() and
WindowsDllCopy.cmake do not make sense here, they search include paths
and try to determine DLL dependencies (GetPrerequisites).
2017-02-16 16:23:18 +01:00
3378ffac8a win/package: nvim-qt GUI
Closes #6126
2017-02-16 16:23:18 +01:00
2fbc42aa8a win/package: provide common tools
References #1507
Closes #1811

curl.exe curl_7_52_1_openssl_nghttp2_x86.7z from https://winampplugins.co.uk/curl/
    curl 7.52.1 (x86_64-pc-win32) libcurl/7.52.1 OpenSSL/1.0.2k zlib/1.2.8 nghttp2/1.19.0
    Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
    Features: AsynchDNS IPv6 Largefile NTLM SSL libz HTTP2 HTTPS-proxy

tidy.exe http://tidybatchfiles.info
    HTML Tidy for Windows
    tidy version 5.3.14 date 2017.01.09 compiled for Windows win32 x86.

7za.exe http://www.7-zip.org
    7-Zip 16.04 (2016-10-04)

cat.exe http://unxutils.sourceforge.net

from gVim:
    diff.exe GNU diffutils version 2.7
    xxd.exe V1.10 27oct98 by Juergen Weigert (Win32)
    ye olde hacked-up tee.exe
2017-02-16 16:23:18 +01:00
7caaa106e3 win/build: Download winpty
Winpty has x86/x64 binary builds, download them when building
Neovim.
2017-02-16 16:23:18 +01:00
bddea0caff win/build: Fix libuv recipe for Windows/NMake X86_64
The 64bit check for the libuv recipe worked for the VS generator
but not for NMake.
2017-02-16 16:23:18 +01:00
91205d219a win/build: detect architecture 2017-02-16 16:23:17 +01:00
a05690ae2d tui.c: Handle missing "key_dc" terminfo entry (#6128)
Closes #6025
2017-02-16 11:59:01 +01:00
362298e141 vim-patch:7.4.2061
Problem:    qf_init_ext() is too big.
Solution:   Move code to qf_parse_line() (Yegappan Lakshmanan)

e87e6dddc2
2017-02-16 16:26:12 +08:00
0e44916fff ex_docmd.c: Allow unescaped spaces in :edit filename (#6119)
This makes :edit consistent on all platforms. 
Also affects :argedit, et al. Wild (tab) completion doesn't work, though.

Closes #6010
2017-02-15 11:12:31 +01:00
a926f10d45 vim-patch:7.4.2047
Problem:    Compiler warning for initializing a struct.
Solution:   Initialize in another way. (Anton Lindqvist)

bfafb4c4a0
2017-02-15 12:18:44 +08:00
9380574cf7 vim-patch:7.4.2046
Problem:    The qf_init_ext() function is too big.
Solution:   Refactor it. (Yegappan Lakshmanan)

e0d3797664
2017-02-15 12:14:59 +08:00
10c9ecc211 vim-patch:8.0.0297
Problem:    Double free on exit when using a closure. (James McCoy)
Solution:   Split free_al_functions in two parts. (closes #1428)

03ff9bcbc9
2017-02-14 17:38:19 -07:00
ef8701610b Allow lambdas to be used with jobs, timers and dictwatchers. 2017-02-14 17:38:19 -07:00
bae8a19c63 vim-patch:7.4.2235
Problem:    submatch() does not check for a valid argument.
Solution:   Give an error if the argument is out of range. (Dominique Pelle)

989f592f7f
2017-02-14 17:38:19 -07:00
effe760b13 vim-patch:7.4.2233
Problem:    Crash when using funcref() with invalid name. (Dominique Pelle)
Solution:   Check for NULL translated name.

843b884461
2017-02-14 17:38:19 -07:00
8cae66b5e0 vim-patch:7.4.2197
Problem:    All functions are freed on exit, which may hide leaks.
Solution:   Only free named functions, not reference counted ones.

c257487035
2017-02-14 17:38:18 -07:00
e2f76d190d vim-patch:7.4.2143
Problem:    A funccal is garbage collected while it can still be used.
Solution:   Set copyID in all referenced functions.  Do not list lambda
            functions with ":function".

bc7ce675b2
2017-02-14 17:38:18 -07:00
00ac82eae2 vim-patch:7.4.2142
Problem:    Leaking memory when redefining a function.
Solution:   Don't increment the function reference count when it's found by
            name. Don't remove the wrong function from the hashtab.  More
            reference counting fixes.

8dd3a43d75
2017-02-14 17:38:18 -07:00
42727ecf08 vim-patch:7.4.2141
Problem:    Coverity reports bogus NULL check.
Solution:   When checking for a variable in the funccal scope don't pass the
            varname.

ba96e9af38
2017-02-14 17:38:18 -07:00
e71e9020eb vim-patch:7.4.2139
Problem:    :delfunction causes illegal memory access.
Solution:   Correct logic when deciding to free a function.

0588d4f9d2
2017-02-14 17:38:18 -07:00
53fad45115 vim-patch:7.4.2137
Problem:    Using function() with a name will find another function when it is
            redefined.
Solution:   Add funcref().  Refer to lambda using a partial.  Fix several
            reference counting issues.

437bafe4c8
2017-02-14 17:38:18 -07:00
1f715ac1c1 vim-patch:7.4.2136
Problem:    Closure function fails.
Solution:   Don't reset uf_scoped when it points to another funccal.

5801644819
2017-02-14 17:38:18 -07:00
1e3c0efa0f vim-patch:7.4.2134
Problem:    No error for using function() badly.
Solution:   Check for passing wrong function name. (Ken Takata)

b54c3ff317
2017-02-14 17:38:17 -07:00
d7c798cd86 vim-patch:7.4.2121
Problem:    No easy way to check if lambda and closure are supported.
Solution:   Add the +lambda feature.

9532fe7fbe
2017-02-14 17:38:17 -07:00
f59321e319 vim-patch:7.4.2120
Problem:    User defined functions can't be a closure.
Solution:   Add the "closure" argument. Allow using :unlet on a bound
            variable. (Yasuhiro Matsumoto, Ken Takata)

10ce39a0d5
2017-02-14 17:38:17 -07:00
9f6f7fe26d vim-patch:7.4.2119
Problem:    Closures are not supported.
Solution:   Capture variables in lambdas from the outer scope. (Yasuhiro
            Matsumoto, Ken Takata)

1e96d9bf98
2017-02-14 17:38:17 -07:00
6563d85990 vim-patch:7.4.2104
Problem:    Code duplication when unreferencing a function.
Solution:   De-duplicate.

97baee80f0
2017-02-14 17:38:17 -07:00
cbaa87a639 vim-patch:7.4.2096
Problem:    Lambda functions show up with completion.
Solution:   Don't show lambda functions. (Ken Takata)

b49edc11a1
2017-02-14 17:38:17 -07:00
7f4848aff4 vim-patch:7.4.2090
Problem:    Using submatch() in a lambda passed to substitute() is verbose.
Solution:   Use a static list and pass it as an optional argument to the
            function.  Fix memory leak.

df48fb456f
2017-02-14 17:38:17 -07:00
a0ce663710 vim-patch:7.4.2076
Problem:    Syntax error when dict has '>' key.
Solution:   Check for endchar. (Ken Takata)

4f0383bc3f
2017-02-14 17:38:16 -07:00
fc46efd3f2 vim-patch:7.4.2072
Problem:    substitute() does not support a Funcref argument.
Solution:   Support a Funcref like it supports  a string starting with "\=".

72ab729c3d
2017-02-14 17:38:16 -07:00
bb7d0deb2f vim-patch:7.4.2044
Problem:    filter() and map() either require a string or defining a function.
Solution:   Support lambda, a short way to define a function that evaluates an
            expression. (Yasuhiro Matsumoto, Ken Takata)

069c1e7fa9
2017-02-14 17:38:16 -07:00
6c423989fc vim-patch:7.4.2002
Problem:    Crash when passing number to filter() or map().
Solution:   Convert to a string. (Ozaki Kiichi)

a06ec8f345
2017-02-14 17:38:16 -07:00
bb2afeb026 vim-patch:7.4.1989
Problem:    filter() and map() only accept a string argument.
Solution:   Implement using a Funcref argument (Yasuhiro Matsumoto, Ken
            Takata)

b33c7eb5b8
2017-02-14 17:38:16 -07:00
b0fc6108c9 vim-patch:7.4.1727
Problem:    Cannot detect a crash in tests when caused by garbagecollect().
Solution:   Add garbagecollect_for_testing().  Do not free a job if is still
            useful.

ebf7dfa6f1
2017-02-14 17:38:15 -07:00
64c375c589 unittest: Filter out standard defines so that they do not spam stderr (#6113) 2017-02-15 01:21:06 +01:00
ZyX
095e6cc2e0 *: Fix linter errors 2017-02-15 03:15:47 +03:00
ZyX
efa2682e3b *: Partial string handling refactoring
Main points:

- Replace `char_u` with `char` in some cases.
- Remove `str[len] = NUL` hack in some cases when `str` may be considered
  `const`.
2017-02-15 02:48:33 +03:00
ZyX
ee16f78fa9 strings: Fix “unexpected format specifier: %lp” ASAN error 2017-02-15 00:45:04 +03:00
ZyX
0086991b1b eval: Fix linter error 2017-02-15 00:28:34 +03:00
2a50ff7e2f Merge #6108 from ZyX-I/pr-5678
Better core dumps checking
2017-02-14 21:43:01 +01:00
ZyX
f489827b5f eval: Fix error messages from writefile
1. When calling writefile(list, fname, []) do not show error message twice.
2. Do not allow file name to be overwritten for writefile([1], 2).
3. Do not show “Can’t open file with an empty name” error after error like 
   “using Float as a String” when type of the second argument is not correct.
4. Do not give multiple error messages and still continue for code like 
   `writefile(["test", [], [], [], "tset"])`.

Note that to fix 4. ideally I need tv_check_str_or_nr which is currently present 
in two PRs: #6114 and #5119. I would want to avoid copying this function into 
a yet another PR.

Ref vim/vim#1476.
2017-02-14 20:46:12 +03:00
ZyX
066e6b8e9b eval: Return immediately after an error in write_list()
Previously it could attempt to write trailing newline before returning.
2017-02-14 19:40:16 +03:00
eaf9caaf43 Merge pull request #6118 from lonerover/vim-patch
scripts/vim-patch.sh: don't ignore runtime/doc/tagsrch.txt
2017-02-14 06:02:21 -05:00
891d412d6c vim-patch.sh: don't ignore runtime/doc/tagsrch.txt 2017-02-14 16:14:41 +08:00
6e881872f4 api/helpers: Remove NULL dereference (#6109)
Even though all used compilers can swallow this code, it is still
undefined behaviour.
2017-02-14 00:09:49 +01:00
2f38ed11c9 providers: Disable if g:loaded_* exists.
The exists('g:loaded_foo') convention is rather common, and may be
relied upon in some cases. It's also very unlikely that a user or plugin
has any reason to set g:loaded_foo to zero, so the principle of least
surprise can be brushed aside here.

https://github.com/neovim/neovim/issues/6107#issuecomment-279532143
2017-02-14 00:02:50 +01:00
ZyX
2e179214b8 eval: Remove outdated comment 2017-02-14 01:39:43 +03:00
ZyX
fe0eecf9cc eval: writefile: Give more adequate IO errors and do not call putc() 2017-02-14 01:10:31 +03:00
ZyX
222d98310a os/fileio: Support appending to a file 2017-02-14 01:10:05 +03:00
ZyX
85e1a56560 os/fileio: Allow certain failures during file_fsync
According to the documentation fsync() may fail with EROFS or EINVAL if “file 
descriptor is bound to a special file which does not support synchronization” 
(e.g. /dev/stderr). This condition is completely valid in this case since main 
point of `file_fsync()` is dumping buffered input.
2017-02-14 01:09:59 +03:00
ZyX
a429235b6d message,strings: Move vim_*printf functions to strings.c
Allows eval/typval.h to #include message.h.
2017-02-14 00:53:03 +03:00
ZyX
943531cf9e ci: Make sure core* is the last component of path 2017-02-14 00:33:52 +03:00
59f12e7d61 ui_detach: Do not redraw during teardown/exit. 2017-02-14 00:33:52 +03:00
ZyX
d670591887 ci: Better core dump checking
- Do not exclude any directories from `find` search, remove dumps before tests
  instead.
- Install `apport` on travis so that linux tests should produce core dumps
  (based on information from travis-ci/travis-ci#3754, not sure whether it still
  applies).
- Check cores in lua so that one has an idea which test is failing exactly. Do
  this only 10% of time on linux because traversing the file system is slow.

Unit tests are still not touched, though it is what `app` argument in
`check_cores` is for.

TODO? consider using `find`, it may be faster. Consider retiring `os.execute`,
      dealing with escaping is bad.
2017-02-14 00:33:52 +03:00
ZyX
3e94510570 ci: Try checking for core dumps
Note: can’t use `dbg_cmd` string because I need arguments with spaces (i.e. `bt
all` and `thread apply all bt full`).
2017-02-14 00:33:20 +03:00
ZyX
da2139296d ci: Extract prepare_build() from build_nvim() 2017-02-14 00:32:52 +03:00
9451647d9b health.vim: Do not check intentionally disabled providers.
Closes #6107
2017-02-13 22:21:23 +01:00
4a511de881 ci: Do not use oldtest target on Travis. (#6101)
We must invoke src/nvim/testdir/Makefile directly.
Explained in 3d1084f264:
> Running tests from the top-level Makefile will use the third-party
> dependencies from .deps instead of the ones from the Travis cache.

If we could run `oldtest` with CMake, we would not need to do this. Need
USES_TERMINAL feature (CMake 3.2+) for that.
2017-02-13 15:07:49 +01:00
b5965bbd24 Merge #6106 from justinmk/health.vim
health.vim: Reduce visual noise.
2017-02-13 02:33:50 +01:00
770d60d904 coverity/13728: Null pointer dereference (#6100)
coverity claims that `valid_tabpage(NULL)` can return true...
2017-02-12 21:09:52 +01:00
2ddadaa28c Merge #6084 from justinmk/fix-coverity-155968
coverity/155968: resource leak
2017-02-12 21:09:16 +01:00
f50de5be41 health.vim: ruby provider advice 2017-02-12 12:51:54 +01:00
c43ba671c3 health.vim: Reduce visual noise.
- SUCCESS should be extra green, regardless of colorscheme.
- Do not highlight INFO and SUGGESTIONS, they should not demand the
  user's attention.
2017-02-12 11:38:28 +01:00
aa56b24ee6 os/*: Use os_buf instead of NameBuff, IObuff. 2017-02-12 06:25:27 +01:00
30826cb2d6 build: oldtest target: TEST_FILE, NVIM_PRG (#6098)
- Add support for TEST_FILE to the `oldtest` target, for consistency
  with the busted/lua tests.
  Caveat: with the busted/lua tests TEST_FILE takes a full path, whereas
  for `oldtest` it must be "test_foo.res".
- Add support for NVIM_PRG, again so that all test-related targets are
  consistent.
- Use consistent name for NVIM_PRG. But still need to support NVIM_PROG
  for QuickBuild CI.

Note: The `oldtest` target is driven by the top-level Makefile, because
it requires a TTY. CMake 3.2 added a USES_TERMINAL flag to
add_custom_target(). But we support CMake 2.8...

    add_custom_target(oldtest
      COMMAND make clean
      COMMAND make NVIM_PRG=$<TARGET_FILE:nvim> $ENV{MAKEOVERRIDES}
      DEPENDS nvim
      WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/nvim/testdir"
      USES_TERMINAL true
    )
2017-02-12 01:02:54 +01:00
abdbfd26bc eval: Add id() function and make printf("%p") return something useful (#6095) 2017-02-11 19:47:02 +01:00
b1cf50c684 doc: fr.po: fix intro typo (#6094) 2017-02-11 17:52:50 +01:00
14fc4825f3 eval/typval_encode: Restore original copyID (#6070)
Does not actually matter for most uses, but critical for mark&sweep garbage
collector.

Closes #5234
Closes #5774
Closes #5817
Closes #5883
Closes #5934
Closes #5970
Closes #5548

Helped-by: James McCoy <jamessan@jamessan.com>
Helped-by: Tommy Allen <tommy@esdf.io>
Helped-by: Justin M. Keyes <justinkz@gmail.com>

---

Steps to reproduce:

    Compile fb9745785226c3251d4c40e84abe7d031183929a with:
       CC=clang CFLAGS=" -O0 -g -DEXITFREE " cmake .. -DMIN_LOG_LEVEL=0 -DCMAKE_BUILD_TYPE=Debug -DBUSTED_OUTPUT_TYPE=utf
       -DCMAKE_INSTALL_PREFIX=$PWD/root -DJEMALLOC_USE_BUNDLED=1 -DCLANG_ASAN_UBSAN=ON -DPREFER_LUAJIT=false

    Directory `crash` contains:
    1. unite directory with be09b0e578
    2. vimfiler directory with 72c37e897d
    3. `init.vim` with a single line which sets `&rtp` to the above two directories (absolute path).

    bin/nvim -u ../crash/init.vim -i NONE --headless -s <(<<< $':split\n:VimFiler\n\C-ww:call garbagecollect()\n\C-w\C-w\C-w')

---

Sample backtrace showing dv_copyID being overwritten by clear_tv, which
allows it to be collected by garbage_collect .. free_unref_items:

    Old value = 152911
    New value = 152912
    0x00000000004938e5 in encode_vim_to_nothing (ignored=0x7fb6348f3b20, top_tv=0x7fb6348f3b20, objname=0x6d62e9 "clear_tv argument") at ../src/nvim/eval/typval_encode.c.h:641
    641               cur_mpsv->data.d.dict->dv_copyID = copyID - 1;
    (rr) bt
    #0  0x00000000004938e5 in encode_vim_to_nothing (ignored=0x7fb6348f3b20, top_tv=0x7fb6348f3b20, objname=0x6d62e9 "clear_tv argument") at ../src/nvim/eval/typval_encode.c.h:641
    #1  0x0000000000485dee in clear_tv (varp=0x7fb6348f3b20) at /home/foo/src/github.com/neovim/src/nvim/eval.c:19876
    #2  0x0000000000494e5e in vars_clear_ext (ht=0x7fb634351460, free_val=1) at /home/foo/src/github.com/neovim/src/nvim/eval.c:20378
    #3  0x0000000000494dca in vars_clear (ht=0x7fb634351460) at /home/foo/src/github.com/neovim/src/nvim/eval.c:20355
    #4  0x000000000048efa3 in free_funccal (fc=0x7fb634351200, free_val=0) at /home/foo/src/github.com/neovim/src/nvim/eval.c:22927
    #5  0x0000000000491d8f in call_user_func (fp=0x7fb6340ae4e0, argcount=0, argvars=0x7ffdd216a050, rettv=0x7ffdd216a2b0, firstline=2, lastline=2, selfdict=0x0)
        at /home/foo/src/github.com/neovim/src/nvim/eval.c:22818
    #6  0x00000000004873a4 in call_func (funcname=0x7fb6348ba3e0 "vimfiler#view#_redraw_screen", len=28, rettv=0x7ffdd216a2b0, argcount_in=0, argvars_in=0x7ffdd216a050, argv_func=0x0, firstline=2,
        lastline=2, doesrange=0x7ffdd216a2ac, evaluate=true, partial=0x0, selfdict_in=0x0) at /home/foo/src/github.com/neovim/src/nvim/eval.c:7687
    #7  0x000000000048a6f0 in get_func_tv (name=0x7fb6348ba3e0 "vimfiler#view#_redraw_screen", len=28, rettv=0x7ffdd216a2b0, arg=0x7ffdd216a2c8, firstline=2, lastline=2, doesrange=0x7ffdd216a2ac,
        evaluate=1, partial=0x0, selfdict=0x0) at /home/foo/src/github.com/neovim/src/nvim/eval.c:7459
    #8  0x0000000000489691 in ex_call (eap=0x7ffdd216a598) at /home/foo/src/github.com/neovim/src/nvim/eval.c:2817
    #9  0x00000000004fae46 in do_one_cmd (cmdlinep=0x7ffdd216a878, flags=7, cstack=0x7ffdd216a880, fgetline=0x4f7c30 <get_loop_line>, cookie=0x7ffdd216a7f8)
        at /home/foo/src/github.com/neovim/src/nvim/ex_docmd.c:2198
    #10 0x00000000004f6ae3 in do_cmdline (cmdline=0x0, fgetline=0x499f50 <get_func_line>, cookie=0x7fb634350800, flags=7) at /home/foo/src/github.com/neovim/src/nvim/ex_docmd.c:601
    #11 0x00000000004918c0 in call_user_func (fp=0x7fb6340ae6a0, argcount=0, argvars=0x7ffdd216b6d0, rettv=0x7ffdd216b930, firstline=2, lastline=2, selfdict=0x0)
        at /home/foo/src/github.com/neovim/src/nvim/eval.c:22728
    #12 0x00000000004873a4 in call_func (funcname=0x7fb6348f3ee0 "vimfiler#view#_redraw_all_vimfiler", len=34, rettv=0x7ffdd216b930, argcount_in=0, argvars_in=0x7ffdd216b6d0, argv_func=0x0,
        firstline=2, lastline=2, doesrange=0x7ffdd216b92c, evaluate=true, partial=0x0, selfdict_in=0x0) at /home/foo/src/github.com/neovim/src/nvim/eval.c:7687
    #13 0x000000000048a6f0 in get_func_tv (name=0x7fb6348f3ee0 "vimfiler#view#_redraw_all_vimfiler", len=34, rettv=0x7ffdd216b930, arg=0x7ffdd216b948, firstline=2, lastline=2, doesrange=0x7ffdd216b92c,
        evaluate=1, partial=0x0, selfdict=0x0) at /home/foo/src/github.com/neovim/src/nvim/eval.c:7459
    #14 0x0000000000489691 in ex_call (eap=0x7ffdd216bc18) at /home/foo/src/github.com/neovim/src/nvim/eval.c:2817
    #15 0x00000000004fae46 in do_one_cmd (cmdlinep=0x7ffdd216bef8, flags=7, cstack=0x7ffdd216bf00, fgetline=0x539820 <getnextac>, cookie=0x7ffdd216c508)
        at /home/foo/src/github.com/neovim/src/nvim/ex_docmd.c:2198
    #16 0x00000000004f6ae3 in do_cmdline (cmdline=0x0, fgetline=0x539820 <getnextac>, cookie=0x7ffdd216c508, flags=7) at /home/foo/src/github.com/neovim/src/nvim/ex_docmd.c:601
    #17 0x00000000005390ee in apply_autocmds_group (event=EVENT_VIMRESIZED, fname=0x7fb6348ed2c0 "/home/foo/src/github.com/neovim/build/vimfiler:default", fname_io=0x0, force=false, group=-3,
        buf=0x7fb634858000, eap=0x0) at /home/foo/src/github.com/neovim/src/nvim/fileio.c:6882
    #18 0x000000000052f67c in apply_autocmds (event=EVENT_VIMRESIZED, fname=0x0, fname_io=0x0, force=false, buf=0x7fb634858000) at /home/foo/src/github.com/neovim/src/nvim/fileio.c:6527
    #19 0x0000000000640df2 in screenalloc (doclear=false) at /home/foo/src/github.com/neovim/src/nvim/screen.c:6234
    #20 0x00000000006320d2 in screenclear () at /home/foo/src/github.com/neovim/src/nvim/screen.c:6277
    #21 0x0000000000641edf in screen_resize (width=49, height=56) at /home/foo/src/github.com/neovim/src/nvim/screen.c:7366
    #22 0x00000000006b2d82 in ui_refresh () at /home/foo/src/github.com/neovim/src/nvim/ui.c:175
    #23 0x00000000006b3121 in ui_refresh_event (argv=0x7ffdd216c748) at /home/foo/src/github.com/neovim/src/nvim/ui.c:181
    #24 0x00000000004d8297 in multiqueue_process_events (this=0x7fb634812370) at /home/foo/src/github.com/neovim/src/nvim/event/multiqueue.c:146
    #25 0x00000000004d7616 in loop_poll_events (loop=0x96e900 <main_loop>, ms=-1) at /home/foo/src/github.com/neovim/src/nvim/event/loop.c:56
    #26 0x00000000005eb635 in input_poll (ms=-1) at /home/foo/src/github.com/neovim/src/nvim/os/input.c:326
    #27 0x00000000005ea700 in inbuf_poll (ms=-1) at /home/foo/src/github.com/neovim/src/nvim/os/input.c:348
    #28 0x00000000005ea61d in os_inchar (buf=0x0, maxlen=0, ms=-1, tb_change_cnt=0) at /home/foo/src/github.com/neovim/src/nvim/os/input.c:110
    #29 0x000000000068e0af in state_enter (s=0x7ffdd216c888) at /home/foo/src/github.com/neovim/src/nvim/state.c:49
    #30 0x00000000005ac514 in normal_enter (cmdwin=false, noexmode=false) at /home/foo/src/github.com/neovim/src/nvim/normal.c:463
    #31 0x0000000000565c62 in main (argc=9, argv=0x7ffdd216cc28) at /home/foo/src/github.com/neovim/src/nvim/main.c:540

---

ASAN trace after provoking the bug with VimFiler:

=================================================================
==8540==ERROR: AddressSanitizer: heap-use-after-free on address 0x613000054748 at pc 0x0000007d1dd8 bp 0x7ffe71be6660 sp 0x7ffe71be6658
READ of size 4 at 0x613000054748 thread T0
    #0 0x7d1dd7 in copy_tv /home/foo/src/github.com/neovim/src/nvim/eval.c:20116:37
    #1 0x87b92c in f_get /home/foo/src/github.com/neovim/src/nvim/eval.c:9895:5
    #2 0x7b35c0 in call_func /home/foo/src/github.com/neovim/src/nvim/eval.c:7286:11
    #3 0x7c8d7a in get_func_tv /home/foo/src/github.com/neovim/src/nvim/eval.c:7091:11
    #4 0x8667f9 in eval7 /home/foo/src/github.com/neovim/src/nvim/eval.c:4353:15
    #5 0x8621e5 in eval6 /home/foo/src/github.com/neovim/src/nvim/eval.c:4073:7
    #6 0x85ce69 in eval5 /home/foo/src/github.com/neovim/src/nvim/eval.c:3925:7
    #7 0x858071 in eval4 /home/foo/src/github.com/neovim/src/nvim/eval.c:3666:7
    #8 0x857613 in eval3 /home/foo/src/github.com/neovim/src/nvim/eval.c:3588:7
    #9 0x856bb3 in eval2 /home/foo/src/github.com/neovim/src/nvim/eval.c:3525:7
    #10 0x7ab772 in eval1 /home/foo/src/github.com/neovim/src/nvim/eval.c:3458:7
    #11 0x7abe36 in eval1 /home/foo/src/github.com/neovim/src/nvim/eval.c:3494:9
    #12 0x7a9ecc in eval0 /home/foo/src/github.com/neovim/src/nvim/eval.c:3420:9
    #13 0x830cac in ex_return /home/foo/src/github.com/neovim/src/nvim/eval.c:22191:10
    #14 0xb06a1c in do_one_cmd /home/foo/src/github.com/neovim/src/nvim/ex_docmd.c:2198:5
    #15 0xae5557 in do_cmdline /home/foo/src/github.com/neovim/src/nvim/ex_docmd.c:601:20
    #16 0x7f2490 in call_user_func /home/foo/src/github.com/neovim/src/nvim/eval.c:21993:3
    #17 0x7b2eee in call_func /home/foo/src/github.com/neovim/src/nvim/eval.c:7271:11
    #18 0x7c8d7a in get_func_tv /home/foo/src/github.com/neovim/src/nvim/eval.c:7091:11
    #19 0x8667f9 in eval7 /home/foo/src/github.com/neovim/src/nvim/eval.c:4353:15
    #20 0x8621e5 in eval6 /home/foo/src/github.com/neovim/src/nvim/eval.c:4073:7
    #21 0x85ce69 in eval5 /home/foo/src/github.com/neovim/src/nvim/eval.c:3925:7
    #22 0x858071 in eval4 /home/foo/src/github.com/neovim/src/nvim/eval.c:3666:7
    #23 0x857613 in eval3 /home/foo/src/github.com/neovim/src/nvim/eval.c:3588:7
    #24 0x856bb3 in eval2 /home/foo/src/github.com/neovim/src/nvim/eval.c:3525:7
    #25 0x7ab772 in eval1 /home/foo/src/github.com/neovim/src/nvim/eval.c:3458:7
    #26 0x7a9ecc in eval0 /home/foo/src/github.com/neovim/src/nvim/eval.c:3420:9
    #27 0x7b78f2 in ex_let /home/foo/src/github.com/neovim/src/nvim/eval.c:1479:9
    #28 0xb06a1c in do_one_cmd /home/foo/src/github.com/neovim/src/nvim/ex_docmd.c:2198:5
    #29 0xae5557 in do_cmdline /home/foo/src/github.com/neovim/src/nvim/ex_docmd.c:601:20
    #30 0x7f2490 in call_user_func /home/foo/src/github.com/neovim/src/nvim/eval.c:21993:3
    #31 0x7b2eee in call_func /home/foo/src/github.com/neovim/src/nvim/eval.c:7271:11
    #32 0x7c8d7a in get_func_tv /home/foo/src/github.com/neovim/src/nvim/eval.c:7091:11
    #33 0x7c1d3d in ex_call /home/foo/src/github.com/neovim/src/nvim/eval.c:2843:9
    #34 0xb06a1c in do_one_cmd /home/foo/src/github.com/neovim/src/nvim/ex_docmd.c:2198:5
    #35 0xae5557 in do_cmdline /home/foo/src/github.com/neovim/src/nvim/ex_docmd.c:601:20
    #36 0x7f2490 in call_user_func /home/foo/src/github.com/neovim/src/nvim/eval.c:21993:3
    #37 0x7b2eee in call_func /home/foo/src/github.com/neovim/src/nvim/eval.c:7271:11
    #38 0x7c8d7a in get_func_tv /home/foo/src/github.com/neovim/src/nvim/eval.c:7091:11
    #39 0x7c1d3d in ex_call /home/foo/src/github.com/neovim/src/nvim/eval.c:2843:9
    #40 0xb06a1c in do_one_cmd /home/foo/src/github.com/neovim/src/nvim/ex_docmd.c:2198:5
    #41 0xae5557 in do_cmdline /home/foo/src/github.com/neovim/src/nvim/ex_docmd.c:601:20
    #42 0xca2918 in apply_autocmds_group /home/foo/src/github.com/neovim/src/nvim/fileio.c:6882:5
    #43 0xc6c446 in apply_autocmds /home/foo/src/github.com/neovim/src/nvim/fileio.c:6527:10
    #44 0x140f374 in screenalloc /home/foo/src/github.com/neovim/src/nvim/screen.c:6234:5
    #45 0x13958d1 in screenclear /home/foo/src/github.com/neovim/src/nvim/screen.c:6277:3
    #46 0x1417573 in screen_resize /home/foo/src/github.com/neovim/src/nvim/screen.c:7366:5
    #47 0x17fb59b in ui_refresh /home/foo/src/github.com/neovim/src/nvim/ui.c:175:3
    #48 0x17fc100 in ui_refresh_event /home/foo/src/github.com/neovim/src/nvim/ui.c:181:3
    #49 0xa05bbf in multiqueue_process_events /home/foo/src/github.com/neovim/src/nvim/event/multiqueue.c:146:7
    #50 0x9ff8b6 in loop_poll_events /home/foo/src/github.com/neovim/src/nvim/event/loop.c:56:3
    #51 0x120d584 in input_poll /home/foo/src/github.com/neovim/src/nvim/os/input.c:326:3
    #52 0x12092ef in inbuf_poll /home/foo/src/github.com/neovim/src/nvim/os/input.c:348:24
    #53 0x1209193 in os_inchar /home/foo/src/github.com/neovim/src/nvim/os/input.c:110:18
    #54 0x16d3615 in state_enter /home/foo/src/github.com/neovim/src/nvim/state.c:49:13
    #55 0x101090b in normal_enter /home/foo/src/github.com/neovim/src/nvim/normal.c:463:3
    #56 0xdd0a82 in main /home/foo/src/github.com/neovim/src/nvim/main.c:542:3
    #57 0x7f3c61df42b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0)
    #58 0x44b959 in _start (/home/foo/src/github.com/neovim/build/bin/nvim+0x44b959)

0x613000054748 is located 8 bytes inside of 352-byte region [0x613000054740,0x6130000548a0)
freed by thread T0 here:
    #0 0x4e9d70 in __interceptor_cfree.localalias.0 (/home/foo/src/github.com/neovim/build/bin/nvim+0x4e9d70)
    #1 0xefa184 in xfree /home/foo/src/github.com/neovim/src/nvim/memory.c:130:3
    #2 0x7e52b5 in dict_free_dict /home/foo/src/github.com/neovim/src/nvim/eval.c:6431:3
    #3 0x7e1e2c in free_unref_items /home/foo/src/github.com/neovim/src/nvim/eval.c:6063:7
    #4 0x7946cd in garbage_collect /home/foo/src/github.com/neovim/src/nvim/eval.c:5985:16
    #5 0xd08f4f in before_blocking /home/foo/src/github.com/neovim/src/nvim/getchar.c:1331:5
    #6 0x1209157 in os_inchar /home/foo/src/github.com/neovim/src/nvim/os/input.c:109:9
    #7 0x16d3615 in state_enter /home/foo/src/github.com/neovim/src/nvim/state.c:49:13
    #8 0x101090b in normal_enter /home/foo/src/github.com/neovim/src/nvim/normal.c:463:3
    #9 0xdd0a82 in main /home/foo/src/github.com/neovim/src/nvim/main.c:542:3
    #10 0x7f3c61df42b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0)

previously allocated by thread T0 here:
    #0 0x4e9f08 in malloc (/home/foo/src/github.com/neovim/build/bin/nvim+0x4e9f08)
    #1 0xef9ee4 in try_malloc /home/foo/src/github.com/neovim/src/nvim/memory.c:84:15
    #2 0xefa0a4 in xmalloc /home/foo/src/github.com/neovim/src/nvim/memory.c:118:15
    #3 0x78bcc6 in dict_alloc /home/foo/src/github.com/neovim/src/nvim/eval.c:6321:15
    #4 0x86dc02 in get_dict_tv /home/foo/src/github.com/neovim/src/nvim/eval.c:6789:9
    #5 0x865751 in eval7 /home/foo/src/github.com/neovim/src/nvim/eval.c:4296:21
    #6 0x8621e5 in eval6 /home/foo/src/github.com/neovim/src/nvim/eval.c:4073:7
    #7 0x85ce69 in eval5 /home/foo/src/github.com/neovim/src/nvim/eval.c:3925:7
    #8 0x858071 in eval4 /home/foo/src/github.com/neovim/src/nvim/eval.c:3666:7
    #9 0x857613 in eval3 /home/foo/src/github.com/neovim/src/nvim/eval.c:3588:7
    #10 0x856bb3 in eval2 /home/foo/src/github.com/neovim/src/nvim/eval.c:3525:7
    #11 0x7ab772 in eval1 /home/foo/src/github.com/neovim/src/nvim/eval.c:3458:7
    #12 0x7a9ecc in eval0 /home/foo/src/github.com/neovim/src/nvim/eval.c:3420:9
    #13 0x7b78f2 in ex_let /home/foo/src/github.com/neovim/src/nvim/eval.c:1479:9
    #14 0xb06a1c in do_one_cmd /home/foo/src/github.com/neovim/src/nvim/ex_docmd.c:2198:5
    #15 0xae5557 in do_cmdline /home/foo/src/github.com/neovim/src/nvim/ex_docmd.c:601:20
    #16 0x7f2490 in call_user_func /home/foo/src/github.com/neovim/src/nvim/eval.c:21993:3
    #17 0x7b2eee in call_func /home/foo/src/github.com/neovim/src/nvim/eval.c:7271:11
    #18 0x7c8d7a in get_func_tv /home/foo/src/github.com/neovim/src/nvim/eval.c:7091:11
    #19 0x8667f9 in eval7 /home/foo/src/github.com/neovim/src/nvim/eval.c:4353:15
    #20 0x8621e5 in eval6 /home/foo/src/github.com/neovim/src/nvim/eval.c:4073:7
    #21 0x85ce69 in eval5 /home/foo/src/github.com/neovim/src/nvim/eval.c:3925:7
    #22 0x858071 in eval4 /home/foo/src/github.com/neovim/src/nvim/eval.c:3666:7
    #23 0x857613 in eval3 /home/foo/src/github.com/neovim/src/nvim/eval.c:3588:7
    #24 0x856bb3 in eval2 /home/foo/src/github.com/neovim/src/nvim/eval.c:3525:7
    #25 0x7ab772 in eval1 /home/foo/src/github.com/neovim/src/nvim/eval.c:3458:7
    #26 0x93f89a in filter_map_one /home/foo/src/github.com/neovim/src/nvim/eval.c:9398:7
    #27 0x93f33a in filter_map /home/foo/src/github.com/neovim/src/nvim/eval.c:9372:13
    #28 0x8ceb57 in f_map /home/foo/src/github.com/neovim/src/nvim/eval.c:12900:3
    #29 0x7b35c0 in call_func /home/foo/src/github.com/neovim/src/nvim/eval.c:7286:11

SUMMARY: AddressSanitizer: heap-use-after-free /home/foo/src/github.com/neovim/src/nvim/eval.c:20116:37 in copy_tv
Shadow bytes around the buggy address:
  0x0c2680002890: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c26800028a0: fd fd fd fd fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c26800028b0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c26800028c0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c26800028d0: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa
=>0x0c26800028e0: fa fa fa fa fa fa fa fa fd[fd]fd fd fd fd fd fd
  0x0c26800028f0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2680002900: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2680002910: fd fd fd fd fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2680002920: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2680002930: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==8540==ABORTING
2017-02-11 07:20:24 +01:00
4baa059605 Merge pull request #6089 from jamessan/vim-7.4.1948
vim-patch:7.4.1948,7.4.1954,7.4.1962
2017-02-10 19:02:08 -05:00
99cadb7d27 doc: fr.po: Translate :intro (#6091) 2017-02-10 22:01:12 +01:00
bc33df2453 Merge pull request #6076 from lonerover/vim-7.4.2275
vim-patch: 7.4.2275,7.4.2279
2017-02-10 10:10:09 -05:00
714db8bd6c vim-patch:7.4.1962
Problem:    Two test files for increment/decrement.
Solution:   Move the old style test into the new style test. (Hirohito
            Higashi, closes vim/vim#881)

52df117df7
2017-02-10 09:55:33 -05:00
af6bc3b3bf Re-add upstream's test_increment.vim 2017-02-10 09:53:45 -05:00
3677189bfc vim-patch:7.4.1954
Problem:    No test for what 7.4.1948 fixes.
Solution:   Add a test. (Hirohito Higashi, closes vim/vim#880)

d388d2ac8b

Some adjustments had to be made from upstream since nvim always uses
utf-8 internally.

* Removed the 'set encoding=cp932' line from the test
* Adjusted the expected values for getpos(), since the number of bytes
  is different in utf-8
2017-02-10 09:42:42 -05:00
91efe96b96 vim-patch:7.4.1948
Problem:    Using Ctrl-A with double-byte encoding may result in garbled text.
Solution:   Skip to the start of a character. (Hirohito Higashi)

ad5ca9bc1e
2017-02-10 09:29:16 -05:00
7ed1422521 Merge pull request #5904 from lonerover/vim-7.4.2148
vim-patch:7.4.2148,7.4.2159,7.4.2175,7.4.2295
2017-02-10 07:22:46 -05:00
0b81addd0a fix cscope test failure 2017-02-10 00:35:34 -05:00
971d0590be vim-patch:7.4.2295
Problem:    Cscope test fails.
Solution:   Avoid checking for specific line and column numbers.

4792255eff
2017-02-10 00:35:34 -05:00
40a306fe90 vim-patch:7.4.2175
Problem:    Insufficient testing of cscope.
Solution:   Add more tests. (Dominique Pelle)

812ad4f3a2
2017-02-10 00:35:34 -05:00
a5dd127462 vim-patch:7.4.2159
Problem:    Insufficient testing for cscope.
Solution:   Add more tests. (Dominique Pelle)

5971dab112
2017-02-10 00:35:34 -05:00
845fa57db8 vim-patch:7.4.2148
Problem:    Not much testing for cscope.
Solution:   Add a test that uses the cscope program. (Christian Brabandt)

edf634e0f1
2017-02-10 00:34:47 -05:00
13ce5fd108 Merge pull request #5877 from lonerover/vim-7.4.2082
vim-patch: 7.4.2082,7.4.2084,7.4.2085,7.4.2087,7.4.2088
2017-02-10 00:34:14 -05:00
ea87bf79f6 oldtest: Add vim-default for 'backspace' to runtest.vim 2017-02-09 23:36:54 -05:00
c69bbc0964 vim-patch:7.4.2088
Problem:    Keymap test fails with normal features.
Solution:   Bail out if the keymap feature is not supported.

f36213597d
2017-02-09 22:14:04 -05:00
1861f12a5f vim-patch:7.4.2087
Problem:    Digraph code test coverage is still low.
Solution:   Add more tests. (Christian Brabandt)

e25bc5abb4
2017-02-09 22:14:04 -05:00
bec7e47938 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
2017-02-09 22:14:04 -05:00
6f4a963e0e vim-patch:7.4.2085
Problem:    Digraph tests fails on some systems.
Solution:   Run it separately and set 'encoding' early.

dfd63e30d1
2017-02-09 22:14:04 -05:00
775dfc6000 vim-patch:7.4.2084
Problem:    New digraph test makes testing hang.
Solution:   Don't set "nocp".

6008433381
2017-02-09 22:13:03 -05:00
fb177c2c48 vim-patch:7.4.2082
Problem:    Not much test coverage for digraphs.
Solution:   Add a new style digraph test. (Christian Brabandt)

397eadbe25
2017-02-09 22:12:48 -05:00
5b8fac8ace process_spawn: Return status code (#6075) 2017-02-09 14:20:24 +01:00
0c7751f6ab coverity/155968: resource leak 2017-02-09 10:07:48 +01:00
67eae93557 vim-patch:7.4.2279
Problem:    Starting diff mode with the cursor in the last line might end up
            only showing one closed fold. (John Beckett)
Solution:   Scroll the window to show the same relative cursor position.

46328f9a1c
2017-02-09 08:24:43 +08:00
3aa8795469 doc: Fix section reference (#6079) 2017-02-08 18:09:27 +01:00
a2d44c9af6 Merge #6068 from lonerover/vim-7.4.2106
vim-patch:7.4.2106,7.4.2107
2017-02-07 15:00:11 +01:00
7629176fb1 vim-patch:7.4.2275
Problem:    ":diffoff!" does not remove filler lines.
Solution:   Force a redraw and invalidate the cursor. (closes vim/vim#1014)

e67d546f3c
2017-02-07 15:47:28 +08:00
a090f1a3a4 vim-patch:7.4.2107
Problem:    Misplaced equal sign.
Solution:   Remove it.

d955a0971c
2017-02-07 15:12:20 +08:00
ca1b683f00 vim-patch:7.4.2106
Problem:    Clang warns about missing field in initializer.
Solution:   Define COMMA and use it.  (Kazunobu Kuriyama)

ac77aec4da
2017-02-07 15:02:15 +08:00
cca8d2751a Merge pull request #6064 from jamessan/patch-review-preprocess
vim-patch: Use get_vim_patch to retrieve patch for review
2017-02-06 19:43:12 -05:00
7c0d091404 Merge pull request #6063 from jamessan/vim-8.0.0208
vim-patch:8.0.0208
2017-02-06 18:40:05 -05:00
1df492dd3a vim-patch: Use get_vim_patch to retrieve patch for review
This ensures the downloaded Vim patch is preprocessed so unused material
isn't presented to the reviewer.

[ci skip]
2017-02-06 15:58:33 -05:00
86242841e3 lint 2017-02-06 15:26:24 -05:00
18404003c4 vim-patch:8.0.0208
Problem:    Internally used commands for CTRL-Z and mouse click end up in
            history. (Matthew Malcomson)
Solution:   Use do_cmdline_cmd() instead of stuffing them in the readahead
            buffer. (James McCoy, closes vim/vim#1395)

25b0e6b701

Closes #5966
Closes #5967
2017-02-06 15:24:22 -05:00
24ade150f9 Merge pull request #6061 from justinmk/vim-ancient-bugs
vim-patch: fix some resize bugs
2017-02-06 10:23:55 -05:00
11efbc80e3 Merge pull request #5913 from mhinz/buf-lookup-patches
vim-patch:7.4.2017,7.4.2018,7.4.2021,7.4.2022,7.4.2023,7.4.2024
2017-02-06 10:20:49 -05:00
a767fee8cd eval: set_ref_in_item(): remove dead code
Missed in 25438f149f
2017-02-06 03:05:16 +01:00
b77cad183d vim-patch:8.0.0275
Problem:    When checking for CTRL-C typed the GUI may detect a screen resize
            and redraw the screen, causing trouble.
Solution:   Set updating_screen in ui_breakcheck().

e3caa11090
2017-02-06 01:21:01 +01:00
bb2f36d038 Merge #6038 from justinmk/win32-executable
win: executable()
2017-02-05 01:11:06 +01:00
b0cf071d43 Fix clint issues 2017-02-04 17:55:46 -05:00
d3f97232e8 Make Nvim work with latest vim-patch v7.4.2024
v7.4.2024 changed a few function signatures of functions that we use in
Neovim-specific code, e.g. the API.

Due to that the commit for 7.4.2024 doesn't build on its own, only together with
this commit.
2017-02-04 17:55:46 -05:00
c05e7f0fdd vim-patch:7.4.2024
Problem:  More buf_valid() calls can be optimized.
Solution: Use bufref_valid() instead.

NOTE: Some changes related to channels and the Python and Netbeans interfaces
were obviously left out.

7c0a2f367f
2017-02-04 17:55:46 -05:00
e3b92c77da vim-patch:7.4.2023
Problem:  buflist_findname_stat() may find a dummy buffer.
Solution: Set the BF_DUMMY flag after loading a dummy buffer. Start
          finding buffers from the end of the list.

NOTE: In Neovim, buflist_findname_stat() was replaced by
buflist_findname_file_id() in c41535d69.

ea3f2e7be4
2017-02-04 17:55:45 -05:00
d60d1b3232 vim-patch:7.4.2022
Problem:  Warnings from 64 bit compiler.
Solution: Add type casts. (Mike Williams)

25065ec375
2017-02-04 17:55:45 -05:00
1836f3cb9b vim-patch:7.4.2021
Problem:  Still too many buf_valid() calls.
Solution: Make au_new_curbuf a bufref.  Use bufref_valid() in more places.

19ff9bf454
2017-02-04 17:55:45 -05:00
e177226d51 vim-patch:7.4.2018
Problem:  buf_valid() can be slow when there are many buffers.
Solution: Add bufref_valid(), only go through the buffer list
          when a buffer was freed.

b25f9a97e9
2017-02-04 17:55:29 -05:00
951dd1571c vim-patch:7.4.2017
Problem:  When there are many errors adding them to the quickfix list takes
          a long time.
Solution: Add BLN_NOOPT.  Don't call buf_valid() in buf_copy_options().
          Remember the last file name used.  When going through the buffer
          list start from the end of the list.  Only call buf_valid() when
          autocommands were executed.

8240433f48
2017-02-04 17:15:11 -05:00
1ec52b893a vim-patch:8.0.0274
Problem:    When update_single_line() is called recursively, or another screen
            update happens while it is busy, errors may occur.
Solution:   Check and update updating_screen. (Christian Brabandt)

070b33da93
2017-02-04 17:43:42 +01:00
18127f64c4 test: executable(): AppVeyor: Ignore "sibling" failure
This test sometimes fails on AppVeyor, but we still want to exercise the
code path and get at least a "soft" notification in the pending list.
2017-02-04 11:07:50 +01:00
ea449b16b9 refactor: fix warnings 2017-02-04 11:07:50 +01:00
67fbbdb1b5 win: executable(): full path without extension
Absolute path is considered executable even *without* an extension.
2017-02-04 11:07:50 +01:00
cd5b131575 vim-patch:8.0.0280
patch 8.0.0280: problem setting multi-byte environment var on MS-Windows

Problem:    On MS-Windows setting an environment variable with multi-byte
            strings does not work well.
Solution:   Use wputenv when possible. (Taro Muraoka, Ken Takata)

7c23d1d9d9cc
2017-02-04 11:07:49 +01:00
978c95e5c4 test: helpers.clear(): Set common env vars only if not passed. 2017-02-04 11:07:49 +01:00
bbfdb84ae1 build: Do not force busted into front of $PATH
This was a workaround from long ago, but it doesn't seem to be needed
anymore. And it breaks the $PATH on the Windows build (AppVeyor CI).

After this change python3 (and 2) is correctly detected on AppVeyor CI.

References #5946
2017-02-04 11:07:49 +01:00
611411bf85 CheckHealth: choose correct $PATH separator 2017-02-04 11:07:49 +01:00
224f99b85d win: Append process dir to $PATH
This allows executables to be found by :!, system(), and executable() if
they live next to ("sibling" to) nvim.exe. This is what gvim on Windows
does, and also matches the behavior of Win32 SearchPath().

c4a249a736/src/os_win32.c (L354-L370)
2017-02-04 11:07:49 +01:00
7d58aba80c test: executable() 2017-02-04 11:07:49 +01:00
8371d6fb07 win: executable()
Windows: prepend `".;"` to PATH, as Vim does.
c4a249a736/src/os_win32.c (L1916)
2017-02-04 11:07:49 +01:00
3d3b1641d0 man.vim: more robust s:verify_exists #6043
Closes #6039

Also: close the window if we could not get the page from man but only if
we opened it ourselves.
2017-02-04 10:02:59 +01:00
6d4e08d226 test: Remove whitespace (avoid LF/CRLF discrepancy) 2017-02-04 04:04:27 +01:00
4b7d3aec04 Revert "tui: update_size(): Fix race condition."
This reverts commit 0e75438a38.
2017-02-04 03:25:36 +01:00
5ef619eb33 Revert "build: LuaRocks: require unzip (#6049)"
This reverts commit 54293b73d4.
2017-02-04 03:25:17 +01:00
bea2e5738d tests: Migrate legacy test 8. #4179
The test produces some "hit enter" prompts and error messages that had to be
dealt with by `feed`ing CTRL-L to nvim.
2017-02-03 23:05:08 +01:00
6239492d9c Merge #2990 'tests: Migrate legacy test 69.' 2017-02-03 22:55:05 +01:00
54293b73d4 build: LuaRocks: require unzip (#6049) 2017-02-04 01:03:04 +01:00
b4c172d612 tests: Modernize migrated legacy test 69. 2017-02-03 22:54:38 +01:00
11f2bd5fa3 Merge pull request #6050 from jamessan/fix-xclip-tests
Fix xclip tests to cleanup on their own
2017-02-03 11:36:52 -05:00
0e75438a38 tui: update_size(): Fix race condition.
bridge.width and bridge.height reach ui.c:ui_refresh() when it iterates
through all UIs, so they do not need to be set directly by
tui.c:update_size().

Race found by helgrind:

==18532== Helgrind, a thread error detector
==18532== Copyright (C) 2007-2015, and GNU GPL'd, by OpenWorks LLP et al.
==18532== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==18532== Command: ./build/bin/nvim -u NONE --cmd set\ rtp+=~/.vim/bundle/vimfiler.vim,~/.vim/bundle/unite.vim --cmd runtime\ plugin/vimfiler.vim --cmd runtime\ plugin/unite.vim
==18532== Parent PID: 6477
==18532==
==18532== ---Thread-Announcement------------------------------------------
==18532==
==18532== Thread #2 was created
==18532==    at 0x68FA98E: clone (clone.S:73)
==18532==    by 0x5270179: create_thread (createthread.c:102)
==18532==    by 0x5271BE2: pthread_create@@GLIBC_2.2.5 (pthread_create.c:679)
==18532==    by 0x4C32B07: pthread_create_WRK (hg_intercepts.c:427)
==18532==    by 0x4E53A3F: uv_thread_create (in /usr/lib/x86_64-linux-gnu/libuv.so.1.0.0)
==18532==    by 0x6A7154: ui_bridge_attach (ui_bridge.c:89)
==18532==    by 0x6A164C: tui_start (tui.c:116)
==18532==    by 0x6A4CFC: ui_builtin_start (ui.c:89)
==18532==    by 0x55A825: main (main.c:433)
==18532==
==18532== ---Thread-Announcement------------------------------------------
==18532==
==18532== Thread #1 is the program's root thread
==18532==
==18532== ----------------------------------------------------------------
==18532==
==18532== Possible data race during write of size 4 at 0x770E7B4 by thread #2
==18532== Locks held: none
==18532==    at 0x6A3071: update_size (tui.c:759)
==18532==    by 0x6A30DB: sigwinch_cb (tui.c:269)
==18532==    by 0x4D0A54: signal_event (signal.c:44)
==18532==    by 0x4CDDB6: multiqueue_process_events (multiqueue.c:146)
==18532==    by 0x4CD135: loop_poll_events (loop.c:56)
==18532==    by 0x6A2451: tui_main (tui.c:239)
==18532==    by 0x6A857A: ui_thread_run (ui_bridge.c:112)
==18532==    by 0x4E539F6: ??? (in /usr/lib/x86_64-linux-gnu/libuv.so.1.0.0)
==18532==    by 0x4C32D06: mythread_wrapper (hg_intercepts.c:389)
==18532==    by 0x5271423: start_thread (pthread_create.c:333)
==18532==    by 0x68FA9BE: clone (clone.S:105)
==18532==
==18532== This conflicts with a previous read of size 4 by thread #1
==18532== Locks held: none
==18532==    at 0x6A542A: ui_refresh (ui.c:169)
==18532==    by 0x6A5870: ui_refresh_event (ui.c:181)
==18532==    by 0x4CDDB6: multiqueue_process_events (multiqueue.c:146)
==18532==    by 0x4CD135: loop_poll_events (loop.c:56)
==18532==    by 0x5DEDB4: os_breakcheck (input.c:150)
==18532==    by 0x59263D: line_breakcheck (misc1.c:2667)
==18532==    by 0x621AE5: nfa_regmatch (regexp_nfa.c:6171)
==18532==    by 0x61DCF7: nfa_regtry (regexp_nfa.c:6240)
==18532==  Address 0x770e7b4 is 4 bytes inside a block of size 352 alloc'd
==18532==    at 0x4C2EFE5: calloc (vg_replace_malloc.c:711)
==18532==    by 0x57C962: xcalloc (memory.c:119)
==18532==    by 0x6A6E29: ui_bridge_attach (ui_bridge.c:53)
==18532==    by 0x6A164C: tui_start (tui.c:116)
==18532==    by 0x6A4CFC: ui_builtin_start (ui.c:89)
==18532==    by 0x55A825: main (main.c:433)
==18532==  Block was alloc'd by thread #1
==18532==
==18532== ----------------------------------------------------------------
==18532==
==18532== Possible data race during write of size 4 at 0x770E7B8 by thread #2
==18532== Locks held: none
==18532==    at 0x6A3085: update_size (tui.c:760)
==18532==    by 0x6A30DB: sigwinch_cb (tui.c:269)
==18532==    by 0x4D0A54: signal_event (signal.c:44)
==18532==    by 0x4CDDB6: multiqueue_process_events (multiqueue.c:146)
==18532==    by 0x4CD135: loop_poll_events (loop.c:56)
==18532==    by 0x6A2451: tui_main (tui.c:239)
==18532==    by 0x6A857A: ui_thread_run (ui_bridge.c:112)
==18532==    by 0x4E539F6: ??? (in /usr/lib/x86_64-linux-gnu/libuv.so.1.0.0)
==18532==    by 0x4C32D06: mythread_wrapper (hg_intercepts.c:389)
==18532==    by 0x5271423: start_thread (pthread_create.c:333)
==18532==    by 0x68FA9BE: clone (clone.S:105)
==18532==
==18532== This conflicts with a previous read of size 4 by thread #1
==18532== Locks held: none
==18532==    at 0x6A5455: ui_refresh (ui.c:170)
==18532==    by 0x6A5870: ui_refresh_event (ui.c:181)
==18532==    by 0x4CDDB6: multiqueue_process_events (multiqueue.c:146)
==18532==    by 0x4CD135: loop_poll_events (loop.c:56)
==18532==    by 0x5DEDB4: os_breakcheck (input.c:150)
==18532==    by 0x59263D: line_breakcheck (misc1.c:2667)
==18532==    by 0x621AE5: nfa_regmatch (regexp_nfa.c:6171)
==18532==    by 0x61DCF7: nfa_regtry (regexp_nfa.c:6240)
==18532==  Address 0x770e7b8 is 8 bytes inside a block of size 352 alloc'd
==18532==    at 0x4C2EFE5: calloc (vg_replace_malloc.c:711)
==18532==    by 0x57C962: xcalloc (memory.c:119)
==18532==    by 0x6A6E29: ui_bridge_attach (ui_bridge.c:53)
==18532==    by 0x6A164C: tui_start (tui.c:116)
==18532==    by 0x6A4CFC: ui_builtin_start (ui.c:89)
==18532==    by 0x55A825: main (main.c:433)
==18532==  Block was alloc'd by thread #1
2017-02-03 14:04:38 +01:00
8b804948df Merge #5975 from jamessan/execute-with-attrs
execute: Correctly capture output with highlight attributes
2017-02-03 12:36:17 +01:00
ce51fa0955 test: Turn printargs_path into a function
When test/functional/eval/system_spec.lua is run on its own,
helpers.os_name() was being called before a session had been created.
This caused that describe block to fail.

Turning printargs_path into a function delays the call of
helpers.os_name() until the test is being run, which ensures a session
is available.
2017-02-02 19:52:59 -05:00
7e30fe3157 test: Make xclip exit after one selection request
Closes #4900
2017-02-02 19:52:06 -05:00
e8899178ec Merge pull request #5869 from hardenedapple/undojoin-curhead
Don't set `b_u_curhead` in `ex_undojoin()`
2017-02-02 12:45:02 -05:00
0508192774 Merge pull request #6045 from jamessan/vim-a02a551
vim-patch:a02a551,802a0d9,e18dbe8,063b9d1
2017-02-01 21:10:33 -05:00
8c09dbf082 vim-patch:063b9d1
Updated runtime files.

063b9d15ab
2017-02-01 18:35:12 -05:00
5752bfb224 Run cleanup.vim on {eo,fr}.po 2017-02-01 18:34:58 -05:00
a5b875fe86 vim-patch:e18dbe8
Updated runtime files.

e18dbe865d
2017-02-01 18:34:58 -05:00
4e47568f89 vim-patch:802a0d9
Updated runtime files.

802a0d902f
2017-02-01 18:34:57 -05:00
cb0eead4ee vim-patch:a02a551
Updated runtime files.

a02a551e18
2017-02-01 18:34:52 -05:00
f8b21b6d82 test: execute() + :redir 2017-02-01 18:31:53 -05:00
7e7f01a3be execute: Correctly capture output with highlight attributes
Closes #5422
2017-02-01 18:28:32 -05:00
3803314f78 doc: QuickBuild 2017-01-31 08:58:43 +01:00
88bc9f8e92 xstrlcat: Allow overlapped pointers. (#6017)
memcpy is not equivalent to memmove (which is used by vim_strcat), this
could cause subtle bugs if xstrlcat is used as a replacement for
vim_strcat. But vim_strcat is inconsistent: in the `else` branch it uses
strcpy, which doesn't allow overlap.

Helped-by: oni-link <knil.ino@gmail.com>
Helped-by: James McCoy <jamessan@jamessan.com>
Helped-by: Nikolai Aleksandrovich Pavlov <kp-pav@yandex.ru>
2017-01-31 17:42:22 +01:00
d25649fa01 undo: :earlier, g-: Set b_u_seq_cur correctly. (#6016)
Previously alternate branches were not accounted for properly, with this
change g- after an undo to a branch point works.

The current sequence number b_u_seq_cur is used in undo_time(), in
u_doit() this was calculated by subtracting one from the curhead
sequence number.

The curhead header entry represents the change that was just undone, so
the sequence number we want is that of the change we have moved to. This
is the sequence number of the undo head that is the uh_next element of
this curhead. That sequence number is not always one less than the
curhead sequence number -- there may have been an alternate branch at
this point.

Instead of subtracting one, we now directly find the sequence number of
curhead->uh_next.
2017-01-31 05:46:55 +01:00
39a6f835e7 man.vim: get page after opening split (#6032)
This will ensure that $MANWIDTH is correctly set.
2017-01-31 16:03:45 +01:00
5bcb972a88 man.vim: remove terminal escape characters (#6033)
This will make man.vim work on nixOS.
2017-01-31 16:00:00 +01:00
7c83657397 dist: runtime/nvim.desktop
Closes #3689

cmake: Add `desktop-install` and `icon-install` targets. `runtime`
target will trigger them.

Specification:
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys

Icons are stored system-wide in /usr/share/applications or user wide at
/usr/share/icons/hicolor/scalable/apps and can be overriden in ~/.local/share/icons

nvim.desktop file can be installed system wide or in
~/.local/share/applications/

To test without an installer:
$ xdg-desktop-menu install --novendor runtime/nvim.desktop
$ xdg-icon-resource install --novendor --mode user --size 64 contrib/nvim-icon.png

Once it is installed, you can test with gtk-launch if installed or
dmenu/rofi (drun mode)
2017-01-31 02:02:09 +01:00
bdfa1479d2 eval.c: Fix findfile(), :find, gf in :terminal. #6009
Closes #4299
2017-01-31 00:48:30 +01:00
81525dc5c3 defaults: Revert 'mouse=a' (#6022)
This default causes too much confusion for terminal users. Until
a better approach is implemented, revert to the traditional default.

Better solution would be:
- Implement a right-click menu for TUI
- Set 'mouse=a' *only* if clipboard is working.

Closes #5938
2017-01-28 14:30:57 +01:00
5527754f95 Merge pull request #6012 from jamessan/override-TI-cursor-normal
tui: Ignore DECRST 12 in terminfo's cursor_normal, if present
2017-01-26 09:50:59 -05:00
59fd0c4132 refactor: Remove strncpy/STRNCPY. (#6008)
Closes #731
References #851

Note: This does not remove some intentional legacy usages of strncpy.
      - memcpy isn't equivalent because it doesn't check the string
        length of `src`, and doesn't zero-out the remainder of `dst`.
      - xstrlcpy isn't equivalent because it doesn't zero-out the
        remainder of `dst`. Some Vim logic depends on that (e.g.
        ex_append which calls vim_strnsave).

Helped-by: Douglas Schneider <ds3@ualberta.ca>
Helped-by: oni-link <knil.ino@gmail.com>
Helped-by: James McCoy <jamessan@jamessan.com>
2017-01-26 14:33:03 +01:00
f78982620a build: Disable jemalloc for FreeBSD. (#6007)
jemalloc's README states:

> jemalloc [is] the FreeBSD libc allocator since 2005. ...  Modern jemalloc
> releases continue to be integrated back into FreeBSD

Since FreeBSD ships with jemalloc in some form, we don't need to require
jemalloc there. Less risk, low cost.
2017-01-26 13:07:30 +01:00
fd2d4c5ab9 tui: Ignore DECRST 12 in terminfo's cursor_normal, if present
As discussed in neovim/neovim#5977, it's typical for the terminfo
database to disable cursor blink as part of setting up the normal
cursor.  Since this interferes with the user's control over the cursor,
we'll skip over DECRST 12 if it starts the cursor_normal entry.

Note, this doesn't handle any case where DECRST 12 is not at the start
of the entry since unibilium simply stores the given pointer.  We would
need to allocate (and somewhere free) a modified copy of what we get
back from unibi_get_str to handle that.
2017-01-25 11:15:05 -05:00
25427ae892 test: Fix broken test. 2017-01-24 14:25:50 +01:00
a8a673c20d Merge #5964 from equalsraf/windows-clipboard
Windows clipboard support
2017-01-24 00:24:26 +01:00
a3a241d313 ci: XXX: Disable "throttle" test on Travis macOS. 2017-01-23 22:17:16 +01:00
5892aab1b5 Merge #5996 from justinmk/coverity-133845
xstrlcat() + coverity fixes
2017-01-23 21:50:41 +01:00
b70a5cdd49 clint.py: Suggest xstrlcat instead of strcat. 2017-01-23 15:49:37 +01:00
7e799b6e91 refactor: Replace vim_strcat() with xstrlcat(). 2017-01-23 15:49:37 +01:00
6c467f3f7e coverity/133853: Out-of-bounds access 2017-01-23 15:49:37 +01:00
d97d66e173 coverity/155512: Pass correct length to strncat()
References 8bc2bffda9
2017-01-23 15:49:37 +01:00
6be8ea0787 coverity/133845: Negative array index read. (FP)
`find_command(s->ca.cmdchar) >= 0` was established near the start of
normal_execute(). And `unshift_special(&s->ca);` "should" not ever
result in s->ca.cmdchar containing a multibyte char.

So only an assert() is needed here.
2017-01-23 15:49:37 +01:00
73da522d73 errors: Introduce "E856: Filename too long" 2017-01-23 15:49:37 +01:00
7c7c5a80a4 add_pathsep(): Return false if filename is too long.
References #3042
2017-01-23 15:49:36 +01:00
6e75bb5cbb refactor: strlcat instead of str{n}cat.
Add xstrlcat function.

Closes #3042
References #988
References #1069

coverity: 71530, 71531, 71532
2017-01-23 15:49:36 +01:00
d4b931deac Merge #5995 from ZyX-I/coverity-fixes
coverity fixes
2017-01-23 01:30:50 +01:00
ZyX
5ac5c7971c coverity/133898: Fix sizeof argument 2017-01-23 02:16:16 +03:00
ZyX
61e04cae75 ex_cmds: Also pass correct length in windows code 2017-01-23 02:09:59 +03:00
ZyX
5369b0c7ea coverity/155511: Pass correct length argument to strncat() 2017-01-23 02:05:17 +03:00
ZyX
8bc2bffda9 coverity/155512: Pass correct length to strncat() 2017-01-23 02:03:48 +03:00
ZyX
47a7d32563 coverity/155513: Do not assume xcalloc can return NULL 2017-01-23 02:02:35 +03:00
e0e4825897 Don't set b_u_curhead in ex_undojoin()
vim-patch:8.0.0205
This provides no benefit, and introduces some bugs.
2017-01-22 21:19:46 +00:00
7255f00818 version.c: update
1914: signal
2074: HIKEY2UF()

Closes #5953
2017-01-22 15:10:51 +01:00
be09274287 test: Avoid Lua closure limit.
Fixes Lua error:
> function at line 543 has more than 60 upvalues
2017-01-22 14:13:53 +01:00
043d8ba422 Merge #5782 'Visual-mode put from @. register' 2017-01-22 11:10:24 +01:00
c86caf7e41 readfile(): Fix read-after-free.
References https://github.com/neovim/neovim/pull/5956#pullrequestreview-17812620

Helped-by: oni-link <knil.ino@gmail.com>
2017-01-21 21:57:44 +01:00
497db001df test: expand_env_esc()
Test expand_env_esc() using the same parameters reported in #3725.

Closes #3725
2017-01-21 18:17:44 +01:00
bd16e116eb win: test: Enable jobstart() 'shell' test. (#5983) 2017-01-21 17:04:39 +01:00
10864cd939 Merge #5977 from justinmk/tui-cursor-shape
tui: enable NVIM_TUI_ENABLE_CURSOR_SHAPE by default
2017-01-21 12:21:56 +01:00
a27fcf38fd Windows: Install runtime dependencies with Neovim binary
Look for runtime dependencies diff.exe and win32yank.exe (and
recursively for DLL dependencies) and install them with nvim.exe. If a
dependency is missing a warning will be issued.
2017-01-20 18:29:18 +00:00
1cb52309f1 Enable clipboard provider tests in Windows 2017-01-20 18:29:18 +00:00
f59bb4be6c third-party: Add helper to fetch binary dependencies
Add cmake script with recipes to download binary dependencies, currently
the only dependency is win32yank.
2017-01-20 18:29:17 +00:00
33cd06dfb7 Windows: Clipboard provider win32yank 2017-01-20 18:29:17 +00:00
ef753a76b9 tui: Enable mode-sensitive cursor by default.
Also give NVIM_TUI_ENABLE_CURSOR_SHAPE more granularity:
0 = do not change cursor shape
1 = non-blinking ("steady") cursor with mode-sensitive shape
2 = blinking cursor with mode-sensitive shape

Note: blink state is not changed for Konsole, instead user's terminal
preference makes the decision. (Can't do that for xterm-likes, DECSCUSR
forces us to choose blink-state.)

This is a temporary step until the TUI respects 'guicursor'
Ref: https://github.com/neovim/neovim/issues/2583#issuecomment-272988384
2017-01-20 15:48:41 +01:00
030349d852 input_enqueue(): Fix length calculation. (#5981)
Ref: https://github.com/neovim/neovim/issues/5885#issuecomment-273614373
2017-01-20 13:49:38 +01:00
4b2759b6da vim-patch:7.4.2049,7.4.2050,7.4.2064,7.4.2067,7.4.2081 (#5969)
vim-patch:7.4.2049,7.4.2050,7.4.2064,7.4.2067,7.4.2081
2017-01-20 13:11:26 +01:00
8684fdda3b tui: Do not decide cursor blinking.
"CSI ? 12 l" stops cursor blinking. `unibi_cursor_normal` need only
_show_ the cursor, not make any pronouncement about cursor blinking.
User's terminal setting (or NVIM_TUI_ENABLE_CURSOR_SHAPE) takes
precedence.
2017-01-20 01:59:29 +01:00
e7de3b5f84 test/timer_spec.lua: Relax expected count.
Test sometimes fails on AppVeyor (Windows). 300/50=6, but there could be
environment factors that miss the timer interval on the "edges".
timer_start() does not have such a hard requirement.
2017-01-19 14:46:29 +01:00
3a574af3c4 ci: Disable "CTRL-C interrupts :global" test
This test is low-value, high-cost. It's slow, and sometimes crashes
luajit. It's still enabled on local runs, that's good enough.
2017-01-19 14:22:01 +01:00
b7b82f8c71 Merge #5937 from justinmk/win32-test
Windows: test: enable job_spec.lua
2017-01-19 11:10:58 +01:00
5db30dcc19 Merge #5865 from lonerover/vim-7.4.2036
vim-patch:7.4.2036
2017-01-19 10:56:19 +01:00
7637df4b59 win: test: XXX: Disable some tests. 2017-01-19 09:55:57 +01:00
32c7971b2a win: fix warnings 2017-01-19 09:55:57 +01:00
e40946a5be win: test: enable job_spec.lua
- Default to powershell.
- Avoid hardcoded "-c".
- Remove ^M character from received lines.
- pending_win32(): clear() is unnecessary and it pollutes the tests.

Closes #3973
Helped-by: Rui Abreu Ferreira <raf-ep@gmx.com>
2017-01-19 09:55:57 +01:00
d204cbc0ce buffer.c: use a map instead of hashtab 2017-01-19 12:08:08 +08:00
0060974b2b vim-patch:7.4.2081
Problem:    Line numbers in the error list are not always adjusted.
Solution:   Set b_has_qf_entry properly. (Yegappan Lakshmanan)

c1542744e7
2017-01-19 10:51:58 +08:00
86f76108f7 vim-patch:7.4.2067
Problem:    Compiler warning for char/char_u conversion. (Tony Mechelynck)
            Inefficient code.
Solution:   Use more lines to fill with spaces. (Nikolai Pavlov) Add type cast.

16ec3c9be3
2017-01-19 10:51:39 +08:00
480b02fdb2 vim-patch:7.4.2064
Problem:    Coverity warns for possible buffer overflow.
Solution:   Use vim_strcat() instead of strcat().

4f5c5f2980
2017-01-19 10:11:53 +08:00
827f2f9f6b vim-patch:7.4.2050
Problem:    When using ":vimgrep" may end up with duplicate buffers.
Solution:   When adding an error list entry pass the buffer number if possible.

015102e91e
2017-01-19 10:11:53 +08:00
1a06a39488 vim-patch:7.4.2049
Problem:    There is no way to get a list of the error lists.
Solution:   Add ":chistory" and ":lhistory".

f6acffbe83
2017-01-19 10:11:53 +08:00
75e6af44e0 Merge pull request #5963 from jamessan/screen-expect-clarity
test: screen: Assert expected row count matches configured screen height
2017-01-18 15:16:07 -05:00
2ee60e5b28 test: nvim_ui_attach() with huge dimensions. (#5974)
Also:
- Attempt to constrain wall-of-text in screen.lua.
- Windows: Enable screen_basic_spec.lua

Closes #2180
2017-01-18 20:28:35 +01:00
e2b031a342 test: screen_basic: Re-enable min width/height test 2017-01-18 11:24:39 -05:00
4322021bae test: screen: Assert expected row count matches configured screen height
When there is a difference in expected vs. actual row count, the user
gets a confusing message about being unable to string concat a nil value
from screen:expect.

This assert makes it clear what the problem is rather than requiring
people to dig through the code of screen:expect to determine what
happened.
2017-01-18 11:24:34 -05:00
b7ee8fbc81 put fixup, esp. ". register close #5709 #5781
Note some bugs were judged to have too ugly a fix to solve, tests to
demonstrate these problems, and the explanation behind not fixing them
are below.

describe('register . problems', function()
  before_each(reset)

  -- The difficulty here is: The basic requirement is that the text
  -- inserted is treated as if it were typed in insert mode. This is why
  -- the paste method is to enter insert mode and enter the ". register
  -- into readbuf1.
  -- We can't add a count into the readbuf here because the insert mode
  -- count is implemented with readbuf2 which is checked for characters
  -- after readbuf1.
  -- Hence, the ".gp command (which adds extra characters into readbuf1
  -- to emulate leaving the cursor after the text by moving the cursor
  -- after inserting the text) would insert the motion characters into
  -- the buffer instead of using them to move after the insert has been
  -- done.
  -- I could probably get this working properly with a special flag put
  -- into start_redo_ins() and set in do_put(), but I think this adds
  -- much more complexity than fixing this bug justifies.
  pending('should not change the ". register with ".2p', function()
    local orig_register = funcs.getreg('.')
    feed('2".p')
    eq(orig_register, funcs.getreg('.'))
  end)

  describe("cursor positioning after undo and redo with '.'", function()
    before_each(reset)
    local function make_cursor_test(macro_string)
      return function()
        feed(macro_string)
        local afterpos = funcs.getcurpos()
        local orig_string = curbuf_contents()
        feed('u.')
        eq(afterpos, funcs.getcurpos())
        expect(orig_string)
      end
    end
    -- The difficulty here is: setting the cursor after the end of the
    -- pasted text is done by adding a motion command to the
    -- stuffbuffer after the insert.
    -- Modifying 'redobuff' is done in the code that handles inserting
    -- text and moving around.
    -- I could add a special case in ins_esc() that checks for a flag
    -- set in do_put() to add the motion character to the redo buffer,
    -- but I think that is starting to get way too convoluted for the
    -- benefit.
    pending('should be the same after ".gp and ".gpu.',
            make_cursor_test('".gp'))
    -- The difficulty here is: putting forwards is implemented by using
    -- 'a' instead of 'i' to start insert.
    -- Undoing with 'u' an insert that began with 'a' leaves the cursor
    -- where the first character was inserted, not where the cursor was
    -- when the 'a' was pressed.
    -- We account for this the first time by saving the cursor position
    -- in do_put(), but this isn't stored in redobuff for a second time
    -- around.
    -- We can't change how such a fundamental action as undo after
    -- inserting with 'a' behaves, we could add in a special case
    -- whereby we set a flag in do_put() and read it when entering
    -- insert mode but this seems like way too much to fix such a minor
    -- bug.
    pending('should be the same after ".pu. and ".pu.u.',
            make_cursor_test('".pu.'))
  end)
end)
2017-01-18 12:28:10 +00:00
d3b4764dc1 win: Define USE_FNAME_CASE (#5962) 2017-01-17 16:32:41 +01:00
be4c896845 DirChanged: set <amatch> (#5961)
Also:
- test that DirChanged is not recursive
- fix 'not trigger if :cd fails' test on Windows
2017-01-17 10:47:20 +01:00
a062cd4ce5 vim-patch:7.4.2062 (#5954)
Problem:    Using dummy variable to compute struct member offset.
Solution:   Use offsetof().

840268400d
2017-01-16 23:18:19 +01:00
340f79b4b8 Merge #5928 'New event: DirChanged' 2017-01-16 13:36:16 +01:00
fa94c4c2d9 vim-patch:7.4.2031 (#5955)
Problem:    The list_lbr_utf8 test fails if ~/.vim/syntax/c.vim sets
            'textwidth' to a non-zero value. (Oyvind A. Holm)
Solution:   Add a setup.vim file that sets 'runtimepath' and $HOME to a safe
            value. (partly by Christian Brabandt, closes vim/vim#912)

89b10421ca
2017-01-16 12:50:43 +01:00
95a4244587 readfile(): Avoid file message when reading from stdin. #5956
Closes #5921
2017-01-16 01:23:48 +01:00
3ba5e43d2e Merge #5918 'vim-patch: 7.4.2006, 7.4.2075, 7.4.2077, 7.4.2117, 7.4.2300, 7.4.2313, 7.4.2314'. 2017-01-16 00:59:50 +01:00
3fd7be6d3e vim-patch:7.4.2099 (#5951)
Problem:    When a keymap is active only "(lang)" is displayed. (Ilya
            Dogolazky)
Solution:   Show the keymap name. (Dmitri Vereshchagin, closes vim/vim#933)

73ac0c4281
2017-01-15 22:24:12 +01:00
b5560a69b1 setpos(): Set lowercase mark in other buffers (#5753)
Also make setpos("'A", [999, 1, 1, 0]) fail, i.e. return -1 (assuming there is no buffer 999).

Fixes #5713

Background:

`:help setpos()` mentions an argument `"bufnum"` that determines the buffer a mark should be put in.
This argument is respected for uppercase marks, but not for lowercase marks.
This is reasonable (though I personally would like `setpos()` to be able to set marks in other buffers), but the help doesn't mention this anywhere.

It's also strange that attempting to change buffers with `setpos('.', [bufnr('#'), 1, 1, 0])` alerts the user that having a different buffer is an error, while attempting to set a mark with `setpos("'d", [bufnr('#'), 1, 1, 0])` doesn't tell the user that the `"bufnum"` argument is an error.
2017-01-15 21:36:29 +01:00
a3a5090ba4 win: ci/AppVeyor: Rearrange PATH setup for python. (#5946)
This was an attempt to enable test/functional/provider/python3_spec.lua
It actually *does* appear to work if we do this:

    mingw32-make functionaltest VERBOSE=1 PATH=C:\Python35;C:\Python27;%PATH%

Note that %PATH% *already* has C:\Python35 at its start by then, so
PATH=C:\Python35;C:\Python27;%PATH% is _redundant_.
python3_spec.lua *does* find python3.exe in that case, and succeeds.
But it causes weird failures in unrelated tests:

    [----------] Running tests from C:/projects/neovim/test/functional\core\job_partial_spec.lua
    [ RUN      ] ...rojects/neovim/test/functional\core\job_partial_spec.lua @ 17: jobs with partials works correctly
    .\test\functional\helpers.lua:89: Vim(call):E903: Process for command "powershell" could not be spawned
    stack traceback:
        .\test\functional\helpers.lua:89: in function 'request'
        .\test\functional\helpers.lua:147: in function 'nvim_command'
        .\test\functional\helpers.lua:344: in function 'source'
        ...rojects/neovim/test/functional\core\job_partial_spec.lua:18: in function <...rojects/neovim/test/functional\core\job_partial_spec.lua:17>
    [  ERROR   ] ...rojects/neovim/test/functional\core\job_partial_spec.lua @ 17: jobs with partials works correctly (0.00 ms)

    [ RUN      ] C:/projects/neovim/test/functional\eval\execute_spec.lua @ 73: execute() does not capture shell-command output
    C:/projects/neovim/test/functional\eval\execute_spec.lua:74: Expected objects to be the same.
    Passed in:
    (string) '
    :!echo "foo"
    Cannot execute cmd.exe
    shell returned -1
    '
    Expected:
    (string) '
    :!echo "foo"
    '
    stack traceback:
        C:/projects/neovim/test/functional\eval\execute_spec.lua:74: in function <C:/projects/neovim/test/functional\eval\execute_spec.lua:73>
    [  FAILED  ] C:/projects/neovim/test/functional\eval\execute_spec.lua @ 73: execute() does not capture shell-command output (15.60 ms)

    [ RUN      ] C:/projects/neovim/test/functional\ex_cmds\arg_spec.lua @ 11: :argument does not restart :terminal buffer
    C:/projects/neovim/test/functional\ex_cmds\arg_spec.lua:18: Expected objects to be the same.
    Passed in:
    (boolean) false
    Expected:
    (boolean) true
    stack traceback:
        C:/projects/neovim/test/functional\ex_cmds\arg_spec.lua:18: in function <C:/projects/neovim/test/functional\ex_cmds\arg_spec.lua:11>
    [  FAILED  ] C:/projects/neovim/test/functional\ex_cmds\arg_spec.lua @ 11: :argument does not restart :terminal buffer (0.00 ms)

    [ RUN      ] C:/projects/neovim/test/functional\ex_cmds\edit_spec.lua @ 11: :edit without arguments does not restart :terminal buffer
    C:/projects/neovim/test/functional\ex_cmds\edit_spec.lua:16: Expected objects to be the same.
    Passed in:
    (boolean) false
    Expected:
    (boolean) true
    stack traceback:
        C:/projects/neovim/test/functional\ex_cmds\edit_spec.lua:16: in function <C:/projects/neovim/test/functional\ex_cmds\edit_spec.lua:11>
    [  FAILED  ] C:/projects/neovim/test/functional\ex_cmds\edit_spec.lua @ 11: :edit without arguments does not restart :terminal buffer (15.60 ms)

    [ RUN      ] ...s/neovim/test/functional\eval\msgpack_functions_spec.lua @ 457: msgpackparse() function msgpackparse(systemlist(...)) does not segfault. #3135
    .\test\functional\helpers.lua:89: Failed to evaluate expression
    stack traceback:
        .\test\functional\helpers.lua:89: in function 'eval'
        ...s/neovim/test/functional\eval\msgpack_functions_spec.lua:460: in function <...s/neovim/test/functional\eval\msgpack_functions_spec.lua:457>
    [  ERROR   ] ...s/neovim/test/functional\eval\msgpack_functions_spec.lua @ 457: msgpackparse() function msgpackparse(systemlist(...)) does not segfault. #3135 (15.63 ms)

    [  FAILED  ] 3 tests, listed below:
    [  FAILED  ] C:/projects/neovim/test/functional\eval\execute_spec.lua @ 73: execute() does not capture shell-command output
    [  FAILED  ] C:/projects/neovim/test/functional\ex_cmds\arg_spec.lua @ 11: :argument does not restart :terminal buffer
    [  FAILED  ] C:/projects/neovim/test/functional\ex_cmds\edit_spec.lua @ 11: :edit without arguments does not restart :terminal buffer
    [  ERROR   ] 2 errors, listed below:
    [  ERROR   ] ...rojects/neovim/test/functional\core\job_partial_spec.lua @ 17: jobs with partials works correctly
    [  ERROR   ] ...s/neovim/test/functional\eval\msgpack_functions_spec.lua @ 457: msgpackparse() function msgpackparse(systemlist(...)) does not segfault. #3135
     64 SKIPPED TESTS
     3 FAILED TESTS
     2 ERRORS
    -- Output to stderr:
    The system cannot find the path specified.
    CMake Error at C:/projects/neovim/cmake/RunTests.cmake:46 (message):
      Running functional tests failed with error: 1.
2017-01-15 14:45:14 +01:00
cecaaa84cd vim-patch:7.4.2065 (#5950)
Problem:    Compiler warns for uninitialzed variable. (John Marriott)
Solution:   Set lnum to the right value.

69aa099641
2017-01-15 13:09:39 +01:00
192243492d test: fix syntax error
Also re-arrange the test to match Vim upstream.
2017-01-15 05:31:37 +01:00
a6be6df5d6 vim-patch:7.4.2160 (#5952)
Problem:    setmatches() mixes up values. (Nikolai Pavlov)
Solution:   Save the string instead of reusing a shared buffer.

7dc5e2e486
2017-01-15 02:38:57 +01:00
c88e4a270d vim-patch:7.4.1968 (#5949)
Problem:    Invalid memory access with "\<C-">.
Solution:   Do not recognize this as a special character. (Dominique Pelle)

1d90a5a5af
2017-01-15 01:08:27 +01:00
b98da8de98 vim-patch:7.4.1910 (#5948)
Problem:    Tests using external command to delete directory.
Solution:   Use delete().

abc70bbf36
2017-01-15 00:44:16 +01:00
1474304224 vim-patch:7.4.1851 (#5947)
Problem:    test_syn_attr failes when using the GUI. (Dominique Pelle)
Solution:   Escape the font name properly.

180fc2d418
2017-01-15 00:41:43 +01:00
a265ff448e Merge pull request #5940 from jamessan/master
job: Consume content from rbuffer before invoking the callback again
2017-01-14 07:49:51 -05:00
bde9bedb0b job: Consume content from rbuffer before invoking the callback again
While a job callback is active, it may be invoked again.  Since the
data handled by the first invocation of the callback hasn't been marked
as consumed, the subsequent invocation will see the same data.

Reported-by: Daniel Hahler
Patch-by: oni-link
Closes #5889
2017-01-14 07:49:07 -05:00
58ba3bcbef Merge #5936 from blueyed/vim-8.0.0121
vim-patch:8.0.0121
2017-01-14 12:29:46 +01:00
947f1ebcb9 Merge pull request #5941 from blueyed/better-clint-note
src/clint.py: improve "Ignoring" message
2017-01-13 20:47:41 -05:00
980bf1e548 Linting 2017-01-13 23:41:00 +01:00
a0b33b333e vim-patch:8.0.0121
Problem:    Setting 'cursorline' changes the curswant column. (Daniel Hahler)
Solution:   Add the P_RWINONLY flag. (closes vim/vim#1297)

a2477fd349
2017-01-13 23:40:59 +01:00
0aa1cff604 src/clint.py: improve "Ignoring" message
It was a bit confusing for me when seeing it myself the first time.

[ci skip]
2017-01-13 22:19:47 +01:00
1f7a119f5e Rename yank_do_autocmd() to do_autocmd_textyankpost() 2017-01-13 15:30:02 +01:00
20867e6319 Document DirChanged 2017-01-13 15:30:01 +01:00
a05779aa1c Move apply_autocmd_dirchanged() to vim_chdir() 2017-01-13 15:29:59 +01:00
a2f8adad4c Add autocmd/dirchanged_spec.lua 2017-01-13 15:29:05 +01:00
197f50bf9a Trigger DirChanged on 'autochdir' 2017-01-13 15:29:04 +01:00
30f775f8a6 Don't expand filenames during autocmd 2017-01-13 15:29:04 +01:00
bd8025727c New event: DirChanged 2017-01-13 15:29:00 +01:00
f686635420 Merge #5933 from justinmk/dir-bufenter
open_buffer(): Raise `BufEnter` for directories.
2017-01-13 04:09:37 +01:00
82edcb593b Windows: enable more tests 2017-01-13 01:17:12 +01:00
cc7f1aba46 test: BufEnter 2017-01-13 01:17:11 +01:00
b5e8e2f20d lint 2017-01-13 01:17:11 +01:00
802b49ee80 Merge pull request #5935 from jamessan/dictwatcher-crash
eval: Remove dictwatcher from watchers queue before freeing it
2017-01-12 18:24:19 -05:00
42c922b32c open_buffer(): Do BufEnter for directories.
Abuse NOTDONE to give some nuance to the return value of readfile(), so
that open_buffer() can distinguish between "failed, lol" and "failed
because the path is a directory".

Before this change, Vim *already* creates a new buffer when a directory
is edited. So there is no reason it should not raise BufEnter, that was
an implementation detail of ye olde readfile().

Most of the changes in this commit merely preserve the old semantics.
The "implicit" change that we actually are interested in, is this line
in `open_buffer()`, where `retval` being non-FAIL allows EVENT_BUFENTER
to be applied:

    apply_autocmds_retval(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf, &retval);

References https://github.com/vim/vim/issues/1353
2017-01-12 23:10:38 +01:00
674db4b01f eval: Remove dictwatcher from watchers queue before freeing it
This fixes a use-after-free noticed by ASAN which would occur when a
dictwatcher was still active on a dictionary when the dictionary was
freed.

    fun! MakeWatch()
      let d = {'foo': 'bar'}
      call dictwatcheradd(d, 'foo', function('...'))
    endfun

Patch-by: oni-link
Closes #5930
2017-01-12 14:47:43 -05:00
50d0d89129 Merge pull request #5932 from jamessan/icm-fixes
inccommand: Ignore errors during preview and make cmd_can_preview stricter
2017-01-12 06:45:03 -05:00
f2dff86493 inccommand: Preview :sub commands only after the delimiter is present
Closes #5888
2017-01-11 21:05:02 -05:00
dcd77c64ef inccommand: Suppress error reporting when previewing commands
Closes #5912
2017-01-11 21:05:02 -05:00
207ba359b0 Windows: vim_getenv(): Find runtime relative to nvim. #3303 (#5929)
In Windows we cannot rely on absolute install paths to point to the
location of the runtime. Vim uses the path of the current binary as
a possible location for the runtime folder. In Neovim the install
location places the runtime folder in ../share/nvim/runtime.

In Vim this logic is guarded by USE_EXE_NAME, which is defined for win32
and macOS.

TODO: We may need to incorporate similar logic for macOS:
0cdb72aa38/src/misc1.c (L4287-L4308)
2017-01-11 06:00:55 +01:00
a08d2f54a0 Merge #5910 from justinmk/win32-jobstart
Windows: fix jobstart()
2017-01-11 02:19:11 +01:00
9ecdce1d53 test: system([...]): v:shell_error 2017-01-11 01:05:56 +01:00
1e079fa987 system([...]): Set v:shell_error=-1 if not executable.
Do _not_ set v:shell_error on parameter validation error.

system([...]) does not invoke a shell, so this change is somewhat
questionable. But `:help v:shell_error` is sufficiently vague to allow
-1 in this case.
2017-01-11 01:05:55 +01:00
4178e865d5 Windows: ci/AppVeyor: Enable Python provider tests
Setup python2/3 and install the Neovim client in Appveyor to
enable the python tests.

- Use the Python installation provided by Appveyor, because dependencies
  pyuv, greenlet have issues compiling with MinGW-w64. And this way we
  avoid building those too.
- Copy python.exe => python3.exe so that the python provider can find
  python3.
2017-01-11 01:05:55 +01:00
ac44d0ed54 test: system([...]) 2017-01-11 01:05:55 +01:00
15c85d8462 clipboard: only check for pbcopy on macOS (#5927)
Fixes #5926.
2017-01-11 00:50:07 +01:00
a1d545f8e5 terminal.c: label fallthrough on big switch 2017-01-10 18:30:14 -05:00
5ffa01c8b7 terminal.c: handle ctrl+space and ctrl+@ 2017-01-10 18:30:14 -05:00
4fd4f66514 terminal.c: add more arrow key support 2017-01-10 18:30:14 -05:00
d23403a1df terminal.c: move mod logic into convert_modifiers 2017-01-10 18:30:14 -05:00
ade51c1d89 terminal.c: Handle more special keys 2017-01-10 18:30:14 -05:00
a05ebf4a2d Windows: libuv_process_spawn(): Allow libuv argument quoting/escaping.
Closes #5360
References #3305
Reverts commit dc9652e68d.

Disabling the quoting was does not solve the problem in general, and
we would end up having to handle the quoting ourselves.

See: https://github.com/JuliaLang/julia/issues/13776
2017-01-10 23:34:04 +01:00
8a5962023f Merge pull request #5924 from jamessan/vim-7.4.2100
vim-patch:7.4.2100
2017-01-10 15:32:29 -05:00
fc47bd92df lint 2017-01-10 13:05:41 -05:00
4c3204097c vim-patch:7.4.2100
Problem:    "cgn" and "dgn" do not work correctly with a single character
            match and the replacement includes the searched pattern. (John
            Beckett)
Solution:   If the match is found in the wrong column try in the next column.
            Turn the test into new style. (Christian Brabandt)

6835dc61ae

Closes #5796
2017-01-10 13:05:41 -05:00
6095c5df45 Merge pull request #5863 from ZyX-I/more-clint-checks
More clint brace checks
2017-01-10 11:43:14 -05:00
77de73c7c8 Merge pull request #5919 from jamessan/vim-7.4.2008
vim-patch:7.4.2008,7.4.2009
2017-01-10 09:56:53 -05:00
f3c93fbefe lint 2017-01-10 07:14:24 -05:00
9b47115d53 vim-patch:7.4.2009
Problem:    Messages test fails.
Solution:   Don't set redir_execute before returning.

ed59aa60d3
2017-01-10 07:14:24 -05:00
6520517e22 vim-patch:7.4.2008
Problem:    evalcmd() has a confusing name.
Solution:   Rename to execute().  Make silent optional.  Support a list of
            commands.

79815f1ec7
2017-01-10 07:14:12 -05:00
9fcf6d577f Merge pull request #5862 from jamessan/vim-aa3b15d
vim-patch:aa3b15d,82af871,7.4.1925,c95a302
2017-01-09 22:31:45 -05:00
8f32c04df4 vim-patch:c95a302
Updated runtime files.

c95a302a4c
2017-01-09 20:24:08 -05:00
492f2cfeff vim-patch:7.4.1925
Problem:    Viminfo does not merge file marks properly.
Solution:   Use a timestamp.  Add the :clearjumps command.

2d35899721
2017-01-09 20:23:41 -05:00
282109c51b vim-patch:82af871
Updated runtime files.

82af8710bf
2017-01-09 20:23:41 -05:00
60e306368d vim-patch:aa3b15d
Updated runtime files.

aa3b15dbeb
2017-01-09 20:23:41 -05:00
b260004d65 Merge pull request #5860 from jamessan/vim-7.4.1889
vim-patch:7.4.1889
2017-01-09 20:20:03 -05:00
2b56cf099a fix test failure 2017-01-09 13:06:24 +08:00
a584375e9f vim-patch:7.4.2314
Problem:    No error when deleting an augroup while it's the current one.
Solution:   Disallow deleting an augroup when it's the current one.

de653f0880
2017-01-09 12:23:25 +08:00
f8f04350bd vim-patch:7.4.2313
Problem:    Crash when deleting an augroup and listing an autocommand.
            (Dominique Pelle)
Solution:   Make sure deleted_augroup is valid.

b62cc36a60
2017-01-09 12:12:42 +08:00
6f285226a9 vim-patch:7.4.2300
Problem:    Get warning for deleting autocommand group when the autocommand
            using the group is scheduled for deletion. (Pavol Juhas)
Solution:   Check for deleted autocommand.

5c80908ced
2017-01-09 11:06:11 +08:00
7486e7586d vim-patch:7.4.2117
Problem:    Deleting an augroup that still has autocmds does not give a
            warning.  The next defined augroup takes its place.
Solution:   Give a warning and prevent the index being used for another group
            name.

f2c4c39119
2017-01-09 10:58:05 +08:00
94101987a5 process_wait(): Avoid dereference after LOOP_PROCESS_EVENTS. (#5917) 2017-01-09 01:42:58 +01:00
1420e10474 Merge #5519 from blueyed/improve-python-health-check
Improve Python health check
2017-01-09 00:07:13 +01:00
370379a486 health: completion for :CheckHealth 2017-01-08 23:49:11 +01:00
35988b93e1 healthcheck: s:download: do not report curl errors (twice)
Since `curl -s` is used, the actual error (e.g. "curl: (6) Could not
resolve host: pypi.python.org") gets not reported anyway, and s:download
returns an error message with `s:shell_error` already.
This changes `s:download` to also include `a:url` in the error message
now.

It removes

> ERROR: Command error (7) curl -sL https://pypi.python.org/pypi/neovim/json:

And changes

> ERROR: HTTP request failed: error: curl error with https://pypi.python.org/pypi/neovim/json: 6
2017-01-08 23:26:47 +01:00
7db0017f4e healthcheck: s:check_python: only report latest with good response 2017-01-08 23:26:47 +01:00
adf32e1403 healthcheck: python: prefer neovim.VERSION 2017-01-08 23:26:46 +01:00
5ce50504f9 healthcheck: python: include nvim path for unknown/outdated version
This helps to identify where the `neovim` module is coming from, e.g.

    - INFO: python3-neovim version: 0.1.10 (outdated; from ~/Vcs/neovim-python-client/neovim)
    - WARNING: Latest python3-neovim is NOT installed: 0.1.12
2017-01-08 23:26:46 +01:00
0583ca63a5 Improve error reporting for Python health check
- s:version_info: return errors from the `import`
 - skip report_ok for latest version, in case the current version was
   not found.  status contains the error that has been reported in that
   case already.
2017-01-08 23:26:42 +01:00
339dd4b1fb s:check_python: handle 'pip install --user -e' 2017-01-08 23:25:45 +01:00
e7b1b5d6ed health: Windows: Handle backslash path separators. (#5914)
* health: Handle backslash path separators.
* health: brevity, consistency
* health: Do not set bufhidden=wipe.
  In the context of CheckHealth, bufhidden=wipe loses data for no reason.
2017-01-08 21:26:00 +01:00
f5d06c52a2 vim-patch:7.4.2077
Problem:    Cannot update 'tabline' when a tab was closed.
Solution:   Add the TabClosed autocmd event. (partly by Felipe Morales)

12c11d5530
2017-01-08 23:16:39 +08:00
c2344f3d31 vim-patch:7.4.2075
Problem:    No autocommand event to initialize a window or tab page.
Solution:   Add WinNew and TabNew events. (partly by Felipe Morales)

c917da4b3e
2017-01-08 22:46:08 +08:00
888cdce3aa vim-patch:7.4.2006
Problem:    Crash when using tabnext in BufUnload autocmd. (Norio Takagi)
Solution:   First check that the current buffer is the right one. (Hirohito
            Higashi)

30445cb6e9
2017-01-08 21:00:48 +08:00
2a366b674a Merge #5909 from justinmk/win32-xdg
Windows: fix XDG fallback paths
2017-01-08 03:57:54 +01:00
ae1ba2b2fb test: Windows: Re-enable shada functional tests
One of the tests remains disabled until we figure out the expected
behaviour of mkdir() on Windows when `prot` is passed.
2017-01-08 03:23:15 +01:00
32156f06f7 XDG: Windows: resolve $LOCALAPPDATA, $TEMP (#5278)
After #4964 environment variables in the XDG "fallback" table are no
longer expanded.

Fallback to correctly expanded $LOCALAPPDATA, $TEMP. If that fails
(unlikely), fallback to hard-coded paths (e.g. ~/AppData/Local).

Closes #5255
2017-01-08 03:18:00 +01:00
ca7a5c0ce7 ruby: old versions don't know gem list -e 2017-01-08 00:44:48 +01:00
d2f16d534f Merge #5079 from ZyX-I/shada-save-current-pos
shada: Save current cursor position before saving jumps
2017-01-07 23:15:50 +01:00
50af8e0255 Merge #5903 from ZyX-I/fix-5901
Reset copyID also when dictionary is referenced
2017-01-07 23:13:57 +01:00
ZyX
3967618fa5 unittest: Fix linter errors 2017-01-07 19:12:18 +03:00
ZyX
dea4bb33dc unittest,memory: Fix tests 2017-01-07 19:07:32 +03:00
40c76741c1 health: refactor s:check_ruby()
I gone through every single line, renamed the variables to be more consistent
and reordered many lines. Information is now printed as soon as it's available
and errors lead to early returns.

I altered the suggestions for each condition to be more precise and checked that
they fail properly.

This also prevents invalid arguments getting passed to s:version_cmp().
2017-01-07 16:56:38 +01:00
ZyX
6f267b3968 memory: Document new additions to memory.h 2017-01-07 17:58:29 +03:00
ZyX
35416e89bc memory: Restore entered_free_all_mem functionality 2017-01-07 17:52:53 +03:00
ZyX
9a09ffa883 eval: Fix failing test 2017-01-07 15:54:55 +03:00
ZyX
88a4820cc9 unittest: Add failing test for freeing dictionaries in a list 2017-01-07 15:54:55 +03:00
ZyX
728367a196 unittest: Add dict_items function 2017-01-07 15:54:55 +03:00
ZyX
a970c1a957 eval: Make sure that copyID is reset when needed
Works by making value pushed on stack represent the exhausted list.

Fixes #5901, except for dictionaries which need similar adjustment.
2017-01-07 15:15:14 +03:00
ZyX
7d0a892b37 eval/typval_encode.h: Use only a single macros with _INNER[_2] hack 2017-01-07 14:59:42 +03:00
ZyX
41cbb7891d unittest: Add failing test of freeing lists 2017-01-07 14:48:21 +03:00
ZyX
8fd3d31329 unittest: Allow mocking allocator calls 2017-01-07 14:48:21 +03:00
b4c0c61f5c Merge pull request #5826 from ZyX-I/fix-typval_encode
Refactor eval/typval_encode.h
2017-01-06 21:11:33 -05:00
ZyX
dd48d7b94b eval: Fix typo 2017-01-07 00:17:31 +03:00
ZyX
527636f158 functests: Add tests for new fixes 2017-01-06 23:52:31 +03:00
ZyX
1052009b37 eval/typval_encode: Dump empty dictionary before checking for refcycle
Otherwise copyID will stay forever on empty dictionaries.
2017-01-06 23:32:04 +03:00
ZyX
10c6e68db6 eval: Work with reference cycles in partials (self) properly 2017-01-06 22:57:34 +03:00
ZyX
6584fb723a eval/typval_encode: Use TYPVAL_ENCODE_CONV_EMPTY_DICT for partials 2017-01-06 22:48:50 +03:00
ZyX
7f11ec00fd eval/typval_encode.h: Remove documentation that is located in *.c.h 2017-01-06 22:38:46 +03:00
1fee9a7151 eval.c: filter_map(): avoid maybe-uninitialized warning (#5897)
maybe-uninitialized warning observed with -Ofast.
2017-01-06 18:23:52 +01:00
ffdf1904d6 Merge pull request #5893 from lonerover/vim-7.4.2127
vim-patch:7.4.2127
2017-01-06 09:54:40 -05:00
f82f27ccec Merge pull request #5892 from lonerover/vim-7.4.2103
vim-patch: 7.4.2103
2017-01-06 09:47:30 -05:00
6c69bc9788 fix lint error 2017-01-06 09:25:15 +08:00
23b39ebb24 time.c: os_microdelay(): Let input cancel the delay. #5830
Closes #5397
2017-01-06 00:57:31 +01:00
afa7f42f77 man.vim: Avoid empty argument when MANWIDTH is set. (#5882) 2017-01-06 00:20:22 +01:00
ZyX
a1cce83d3c clint: Add more exceptions to “space after a cast” rule
Python does not allow branching here, complaining that look-behind is not 
fixed-width.
2017-01-06 01:52:36 +03:00
ZyX
10d9c6d813 shada: Mark ALWAYS_INLINE function as inline 2017-01-06 01:47:07 +03:00
1fbee630a8 provider: add Python 3.6 (#5886) 2017-01-05 21:29:31 +01:00
7a344c795f path.c: vim_FullName(): Fix heap overflow #5737
- Clarify documentation.
- Return `FAIL` and truncate if `fname` is too long.
- Add tests.
2017-01-05 15:17:34 +01:00
9da9e1c417 vim-patch:7.4.2127
Problem:    The short form of ":noswapfile" is ":noswap" instead of ":now".
            (Kent Sibilev)
Solution:   Only require three characters.  Add a test for the short forms.

3bcfca3ab4
2017-01-05 21:12:02 +08:00
12b50b116f vim-patch:7.4.2110 (#5880)
Problem:    When there is an CmdUndefined autocmd then the error for a missing
            command is E464 instead of E492. (Manuel Ortega)
Solution:   Don't let the pointer be NULL.

eac784eced
2017-01-05 13:55:32 +01:00
bef645e5e4 vim-patch:7.4.2103
Problem:    Can't have "augroup END" right after ":au!".
Solution:   Check for the bar character before the command argument.

e99e84497b
2017-01-05 13:33:56 +08:00
e21aef1e10 Merge #5874 from ZyX-I/fix-5482
Fix plugin which opens ShaDa files
2017-01-04 17:34:17 +01:00
ZyX
c93ce07628 *: Remove // fname() comments near typval_encode includes 2017-01-04 19:04:15 +03:00
ZyX
358097ac5f eval/encode: Always check the return value of encode_vim_to_\* 2017-01-04 19:02:39 +03:00
695703ca97 provider/clipboard.vim: fallback if xsel is broken (#5868)
Old versions of `xsel` do not support some required features.
Fall back to `xclip` then.

Closes #5853
2017-01-04 15:10:31 +01:00
ZyX
ac50971f87 shada: Move setpcmark()/cleanup_jumplist() out of the cycle 2017-01-04 16:55:28 +03:00
ZyX
ec975a74ad shada: Fix offset saving 2017-01-04 16:42:43 +03:00
ZyX
40cedfd0f5 shada: Silence linter 2017-01-04 16:37:31 +03:00
ZyX
81ef9f55ae shada: Save current cursor position before saving jumps 2017-01-04 16:34:06 +03:00
1dc67f4dc8 version.c: update (#5876) 2017-01-04 14:31:23 +01:00
0ce77a744a Merge #5749 from justinmk/test-ctrl-c 2017-01-04 13:32:39 +01:00
ZyX
24b3b938e8 plugin/shada: Handle NUL characters with intchar correctly
Fixes #5482
2017-01-04 15:06:33 +03:00
d8a97d7b79 man.vim: do not set ft=man on files with extension man (#5831)
Closes #5806
2017-01-04 13:01:03 +01:00
ZyX
d82f5d1ba2 plugin/msgpack: Support character constants like '\0' 2017-01-04 14:53:02 +03:00
ZyX
a934144e04 doc: Document that character constants are supported 2017-01-04 14:52:13 +03:00
6f9be2464c Merge #5872 justinmk/test_autochdir 2017-01-04 08:24:36 +01:00
af828f2257 Merge #5864 from ZyX-I/fix-5857
unittest: Allow multiple indirect includes
2017-01-04 11:54:11 +01:00
a63675c384 test/helpers.rmdir(): Windows: Change to top-level dir on failure.
On Windows, if the nvim process has a directory open the lua process
cannot remove it. After failing once, it's safe to force `nvim` to the
top-level directory. Then try again.
2017-01-04 07:23:13 +01:00
e43f7425ee refactor: Remove VimL function test()
vim-patch:7.4.1838
2017-01-04 07:23:13 +01:00
097c8dccca refactor: Remove VimL function test_autochdir()
- Eliminate global test_autochdir.
- Eliminate VimL function test_autochdir()
- Use a lua test instead. Fails correctly after reverting
  0c43479979 / vim-patch:7.4.2015.
2017-01-04 07:23:13 +01:00
c56411ed87 vim-patch:7.4.2043 (#5871)
Problem:    setbuvfar() causes a screen redraw.
Solution:   Only use aucmd_prepbuf() for options.

93431df9eb
2017-01-04 06:16:21 +01:00
e03b43bd07 test: skip_fragile(), TEST_SKIP_FRAGILE
Let build systems define TEST_SKIP_FRAGILE to skip tests that are known to be
resource-intensive (unreliable on slow systems).

References https://github.com/neovim/neovim/pull/5488#issuecomment-265622113
2017-01-04 04:24:18 +01:00
f4d326cf10 test: ctrl_c_spec
- Improve test reliability by only checking for a line with the string
  we are interested in ("Interrupt").
- Try to avoid OOM by loading an existing big file instead of looping to
  create one.
2017-01-04 03:18:30 +01:00
1984e784fb fix lint error 2017-01-04 08:53:38 +08:00
15259c4b84 clipboard: show error message only once and put in history (#5870) 2017-01-04 00:45:31 +01:00
9cb31ecdb0 syntax/ruby.vim, perl.vim: Preserve 'foldmethod'. (#5858) 2017-01-03 23:53:59 +01:00
ZyX
3c64b814d2 unittests: Fix linter errors 2017-01-03 23:58:12 +03:00
ZyX
937b6fac8f unittest: Fix linter errors 2017-01-03 22:54:55 +03:00
ZyX
b38e725428 unittest: Refactor preprocess.lua
Keeps arguments separated and not joined as a single string as long as possible. 
Abstracts away additional arguments so that Gcc:preprocess should work for 
compilers with different conventions should they be supported.
2017-01-03 22:54:55 +03:00
ZyX
2151ddbd73 unittest: Move nil checks to Gcc:preprocess 2017-01-03 22:54:54 +03:00
ZyX
0d7b779cab unittest: Record previous defines in another place
Previous commit made preprocess.lua know how its output will be used. This moves 
state to cimport, making only it know which is cleaner.
2017-01-03 22:54:54 +03:00
ZyX
410d18ef5c unittest: Allow multiple indirect includes
Works by saving all preprocessor defines and reusing them on each run. This also
saves NVIM_HEADER_H defines. Saving other defines is needed for defines like
`Map(foo, bar)` which are sometimes used to declare types or functions. Saving
types or function declarations is not needed because they are recorded as luajit
state.

Fixes #5857
2017-01-03 22:54:54 +03:00
ZyX
136b382e64 tests: Add tests for partials dumping
Also fixed dumping of partials by encode_vim_to_object and added code which is 
able to work with partials and dictionaries to test/unit/eval/helpers.lua 
(mostly copied from #5119, except for partials handling).
2017-01-03 22:51:29 +03:00
3b793d0453 Merge pull request #5835 from lonerover/vim-7.4.1847
vim-patch:7.4.1847
2017-01-03 11:36:56 -05:00
17dc20369e fix lint error 2017-01-03 10:42:44 -05:00
1bea73a21e vim-patch:7.4.1847
Problem:    Getting an item from a NULL dict crashes.  Setting a register to a
            NULL list crashes. (Nikolai Pavlov, issue vim/vim#768)  Comparing a NULL
            dict with a NULL dict fails.
Solution:   Properly check for NULL.

13ddc5c359
2017-01-03 10:38:56 -05:00
ZyX
efc624c2fe eval: Fix errorneous early exit when converting lists and dictionaries 2017-01-03 17:28:57 +03:00
ZyX
f21725946c eval/encode: Fail when stringifying NULL functions 2017-01-03 16:13:21 +03:00
fd9cc8b0b2 automation: Generate API documentation (#5798)
runtime: Add underscore to {} helpSpecial syntax pattern

docs: Added generated api-funcs.txt
2017-01-03 13:11:19 +01:00
a5f36e24bb vim-patch:7.4.2036
Problem:    Looking up a buffer by number is slow if there are many.
Solution:   Use a hashtab.

480778b805
2017-01-03 15:26:32 +08:00
ZyX
06cca5dc59 eval/typval_encode: Handle NULL partials properly 2017-01-03 07:44:54 +03:00
ZyX
9c84f3ba3e eval/typval_encode: Provide proper values as dict argument 2017-01-03 07:41:05 +03:00
ZyX
a5bdd64a5e eval: Fix unused variable error in release builds 2017-01-03 07:14:54 +03:00
ZyX
492c439c54 clint: Check for misplaced brace at function start 2017-01-03 07:11:43 +03:00
ZyX
287c69dd32 clint: Enable check for { positioned at the start of the line correctly
For some reason that was incorrectly hidden by “file is *not* \*.c or \*.h file” 
check.
2017-01-03 07:11:43 +03:00
ZyX
a52238707c eval/encode: Fix 4 new linter failures 2017-01-03 06:39:23 +03:00
ZyX
ff8944105d eval/typval_encode: Refactor arguments to argument macroses
Fixed local test failures somewhere in process.
2017-01-03 06:39:23 +03:00
ZyX
5ba24318e2 eval: Do not free partial contents if partial is still referenced
Should fix some tests, including core/job_partial tests.
2017-01-03 06:39:23 +03:00
ZyX
67b53361ba eval/typval_encode: Rename some \*tv variables
Renames `tv` function argument to `top_tv` and `cur_tv` variable to `tv`, so 
`tv` will mean something more or less the same in both 
_TYPVAL_ENCODE_CONVERT_ONE_VALUE and _TYPVAL_ENCODE_ENCODE functions.
2017-01-03 06:39:23 +03:00
ZyX
e2d81cc479 eval: Do not free partial lists as lists 2017-01-03 06:39:23 +03:00
ZyX
901e7805ee eval: Fix case when cur_mpsv is NULL
Should only happen when clearing VAR_FUNC typval which is not placed inside 
a container.
2017-01-03 06:39:23 +03:00
ZyX
759e736b0a eval/typval_encode: Fix infinite loop
Occurs when trying to dump a partial with attached self dictionary which
references that partial. “Infinite” loop should normally result in Neovim killed
by OOM killer.

Also moved the place when partials are unreferenced by clear_tv: from
…FUNC_START to …FUNC_END.
2017-01-03 06:39:23 +03:00
ZyX
affa3c2baa api/helpers: Fix unused variable error in release build 2017-01-03 06:39:23 +03:00
ZyX
dd27fcfda5 eval/typval_encode: Fix linter errors 2017-01-03 06:39:23 +03:00
ZyX
38ab553eb2 clint: Allow including .c.h files multiple times
Except when they are system just in case. There should be no .c.h system files 
though, but if there will be it is unlikely that they inherit the same 
convention.
2017-01-03 06:39:23 +03:00
ZyX
27343bc5b2 eval/typval_encode: Fix crashes 2017-01-03 06:39:23 +03:00
ZyX
b3163d06b3 eval/typval_encode: Refactor big-big macros into .c.h file
This makes gdb backtraces much more meaningful: specifically I now know at which 
line it crashes in place of seeing that it crashes at 
TYPVAL_ENCODE_DEFINE_CONV_FUNCTIONS macros invocation.
2017-01-03 06:39:23 +03:00
ZyX
c5c75513b8 eval/typval_encode: Make partial conversions not recursive
Is known to crash in the current state.

Ref #5825.
2017-01-03 06:39:23 +03:00
bfb5180627 vim-patch:7.4.1889
Problem:    When umask is set to 0177 Vim can't create temp files. (Lcd)
Solution:   Also correct umask when using mkdtemp().

35d88f4e2f
2017-01-02 20:12:47 -05:00
efe1476d42 Merge pull request #5743 from jamessan/na-vim-patches
version.c: Mark NA patches
2017-01-02 13:57:26 -05:00
af2b5abcd6 lint 2017-01-02 07:18:18 -05:00
9264f4cbbb Mark 'execute()' patches applied
vim-patch:7.4.1996

Problem:    Capturing the output of a command takes a few commands.
Solution:   Add evalcmd().

1e5e1231ac

vim-patch:7.4.1999

Problem:    evalcmd() doesn't work recursively.
Solution:   Use redir_evalcmd instead of redir_vname.

bc5d6dd1dd

vim-patch:7.4.2000

Problem:    Evalcmd test fails.
Solution:   Add missing piece.

245a7cb6d3

vim-patch:7.4.2005

Problem:    After using evalcmd() message output is in the wrong position.
            (Christian Brabandt)
Solution:   Reset msg_col.

ee1deb4a00
2017-01-02 07:11:02 -05:00
5b8bdca564 vim-patch:7.4.1861
Problem:    Compiler warnings with 64 bit compiler.
Solution:   Change int to size_t. (Mike William)

b055066a1d

Functional changes had already been made when package feature was
initially merged.
2017-01-02 07:11:02 -05:00
94a08e8186 vim-patch:7.4.1839
Problem:    Cannot get the items stored in a partial.
Solution:   Support using get() on a partial.

2bbf8eff6f

The content of this was already applied in the partials PR, but no
commit mentioned the upstream patch.
2017-01-02 07:11:02 -05:00
be177bce8f vim-patch:7.4.1781
Problem:    synIDattr() does not respect 'guicolors'.
Solution:   Change the conditition for the mode. (Christian Brabandt)

da5b3dcf06
2017-01-02 07:11:02 -05:00
27b5fa59f5 vim-patch:7.4.1656
Problem:    Crash when using partial with a timer.
Solution:   Increment partial reference count. (Hirohito Higashi)

92e35efaf6

The content of this was already applied in the partials PR, but no
commit mentioned the upstream patch.
2017-01-02 07:11:01 -05:00
67d57f6917 version.c: Mark NA patches
- 1727: garbagecollect_for_testing()
- 1761,1762: NA Coverity issue
- 1769: Adding attributes to if_pyth's sys.stdout
- 1812: Athena/Motif GUI fixes
- 1838: Rename of test functions (e.g., garbagecollect_for_testing()) to start with "test_"
- 1844: More test function renames
- 1888: Calculating sleep time for RealWaitForChar
- 1903,1904,1905,1907,1911,1936: viminfo merging
- 1955: Fix for 64-bit Vim linking against 32-bit Perl due to differing time_t
- 1971: settmode() change for Solaris
- 2073: Reading rgb.txt
- 2093: Netbeans test
- 2094: GUI color allocation changes
- 2132, 2198: job tests
2017-01-02 07:10:49 -05:00
f7639e2490 Merge pull request #5859 from jamessan/vim-7.4.1866
vim-patch:7.4.1866,7.4.1868
2017-01-02 06:39:47 -05:00
945540b782 vim-patch:7.4.1868
Problem:    Setting really_exiting causes memory leaks to be reported.
Solution:   Add the in_free_all_mem flag.

b89a25f17e
2017-01-01 23:20:31 -05:00
1feaa450cb vim-patch:7.4.1866
Problem:    Invalid memory access when exiting with EXITFREE defined.
            (Dominique Pelle)
Solution:   Set "really_exiting" and skip error messages.

a96732150c

This fails to build, due to a00c2e0ecb
removing really_exiting from globals.h, but the next commit fixes the
build failure.
2017-01-01 23:20:24 -05:00
6ba3b85382 vim-patch:6f1d9a
Updated runtime files.

6f1d9a096b
2017-01-02 10:45:10 +09:00
0c43479979 vim-patch:7.4.2015
Problem:    When a file gets a name when writing it 'acd' is not effective.
            (Dan Church)
Solution:   Invoke DO_AUTOCHDIR after writing the file. (Allen Haim, closes
            vim/vim#777, closes vim/vim#803)  Add test_autochdir() to enable 'acd' before
            "starting" is reset.

5c71994f4e
2017-01-02 10:43:45 +09:00
c5f4b92ff9 Merge pull request #5613 from jamessan/vim-7.4.2183
vim-patch:7.4.2183,7.4.2194,7.4.2201,7.4.2204,0952131,7.4.2215,7.4.2225,7.4.2226,7.4.2272,7.4.2273,7.4.2277,7.4.2294
2017-01-01 15:12:33 -05:00
57ce8b5648 Merge #5855 from lonerover/vim-7.4.2019
vim-patch:7.4.2019,7.4.2028
2017-01-01 16:30:21 +01:00
13e2e22073 vim-patch:7.4.2028
Problem:    cppcheck warns for using index before limits check.
Solution:   Swap the expressions. (Dominique Pelle)

5498a41f5a
2017-01-01 23:18:30 +08:00
3d3545bbc1 vim-patch:7.4.1834 (#5854)
Problem:    Possible crash when conceal is active.
Solution:   Check for the screen to be valid when redrawing a line.

908be43879
2017-01-01 16:07:49 +01:00
f6c4e0961d man.vim: remove newline from man errors (#5852) 2017-01-01 15:09:27 +01:00
6705652928 vim-patch:7.4.2019
Problem:    When ignoring case utf_fold() may consume a lot of time.
Solution:   Optimize for ASCII.

c4a927ca8d
2017-01-01 21:15:50 +08:00
61d4ca214f Merge #5804 from brcolow/vim-7.4.1793
vim-patch:7.4.17[83,85,93]
2016-12-31 23:43:49 +01:00
137dfdcc4e vim-patch:7.4.1785
Problem:    Regexp test fails on windows.
Solution:   set 'isprint' to the right value for testing.

490465bda6
2016-12-31 14:38:27 -07:00
e8ccaa7a52 vim-patch:7.4.1783
Problem:    The old regexp engine doesn't handle character classes correctly.
            (Manuel Ortega)
Solution:   Use regmbc() instead of regc().  Add a test.

af98a49dd0
2016-12-31 14:38:27 -07:00
415495273c vim-patch:7.4.1793
Problem:    Some character classes may differ between systems.  On OS/X the
            regexp test fails.
Solution:   Make this less dependent on the system. (idea by Kazunobu Kuriyama)

e8aee7dcf9
2016-12-31 14:38:27 -07:00
5366242789 vim-patch:7.4.1970 (#5850)
Problem:    Using ":insert" in an empty buffer sets the jump mark. (Ingo
            Karkat)
Solution:   Don't adjust marks when replacing the empty line in an empty
            buffer. (closes vim/vim#892)

70e136e1d8
2016-12-31 17:32:50 +01:00
b37da9c664 vim-patch:7.4.1940 (#5849)
Problem:    "gd" hangs in some situations. (Eric Biggers)
Solution:   Remove the SEARCH_START flag when looping.  Add a test.

23c60f21b0
2016-12-31 17:30:04 +01:00
aa35cd9af0 vim-patch:7.4.1876 (#5848)
Problem:    Typing "k" at the hit-enter prompt has no effect.
Solution:   Don't assume recursive use of the prompt if a character was typed.
            (Hirohito Higashi)

a0055ad3a7
2016-12-31 17:27:11 +01:00
c6a50ca82c test: jobclose(): Avoid indeterminism. (#5851)
stdout activity may reach the queue before `exit`; just discard it.

Observed on Travis CI, ubuntu "trusty" beta image:

    [ RUN      ] ...is/build/neovim/neovim/test/functional/core/job_spec.lua @ 509: jobs running tty-test program jobclose() sends SIGHUP
    ...is/build/neovim/neovim/test/functional/core/job_spec.lua:511: Expected objects to be the same.
    Passed in:
    (table) {
      [1] = 'notification'
     *[2] = 'stdout'
      [3] = {
        [1] = 0
        [2] = {
          [1] = '
    '
          [2] = '' } } }
    Expected:
    (table) {
      [1] = 'notification'
     *[2] = 'exit'
      [3] = {
        [1] = 0
        [2] = 42 } }
    stack traceback:
    	...is/build/neovim/neovim/test/functional/core/job_spec.lua:511: in function <...is/build/neovim/neovim/test/functional/core/job_spec.lua:509>
    [  FAILED  ] ...is/build/neovim/neovim/test/functional/core/job_spec.lua @ 509: jobs running tty-test program jobclose() sends SIGHUP (2.81 ms)
2016-12-31 08:59:44 -05:00
d2998a0a49 Tests: make unit tests work on macOS Sierra
Fixes #5455.
2016-12-29 02:58:21 +01:00
46235a30ed lint 2016-12-28 14:57:40 -05:00
552cc4d0b3 vim-patch:7.4.2294
Problem:    Sign test fails on MS-Windows when using the distributed zip
            archives.
Solution:   Create dummy files instead of relying on files in the pixmaps
            directory.

64cefedfc8
2016-12-28 14:57:39 -05:00
de025d6dd0 vim-patch:7.4.2277
Problem:    Memory leak in getbufinfo() when there is a sign. (Dominique
            Pelle)
Solution:   Remove extra vim_strsave().

6a402edbeb
2016-12-28 14:57:39 -05:00
fe03ce23bf vim-patch:7.4.2273
Problem:    getwininfo() and getbufinfo() are inefficient.
Solution:   Do not make a copy of all window/buffer-local options.  Make it
            possible to get them with gettabwinvar() or getbufvar().

3056735ae8
2016-12-28 14:57:39 -05:00
03ed7e1eba vim-patch:7.4.2272
Problem:    getbufinfo(), getwininfo() and gettabinfo() are inefficient.
Solution:   Instead of making a copy of the variables dictionary, use a
            reference.

9f8187c335
2016-12-28 14:57:39 -05:00
c4c894b2fa vim-patch:7.4.2226
Problem:    The field names used by getbufinfo(), gettabinfo() and
            getwininfo() are not consistent.
Solution:   Use bufnr, winnr and tabnr. (Yegappan Lakshmanan)

3392883770
2016-12-28 14:57:39 -05:00
486e968bb6 vim-patch:7.4.2225
Problem:    Crash when placing a sign in a deleted buffer.
Solution:   Check for missing buffer name. (Dominique Pelle). Add a test.

bfd096d020
2016-12-28 14:57:39 -05:00
4453aa0d29 vim-patch:7.4.2215
Problem:    It's not easy to find out if a window is a quickfix or location
            list window.
Solution:   Add "loclist" and "quickfix" entries to the dict returnec by
            getwininfo(). (Yegappan Lakshmanan)

386600f0cb
2016-12-28 14:57:38 -05:00
6205846cd9 vim-patch:0952131
Updated runtime files.

0952131376
2016-12-28 14:57:38 -05:00
0046641070 vim-patch:7.4.2204
Problem:    It is not easy to get information about buffers, windows and
            tabpages.
Solution:   Add getbufinfo(), getwininfo() and gettabinfo(). (Yegappan
            Lakshmanan)

b5ae48e9ff
2016-12-28 14:57:38 -05:00
99a8cd3be0 vim-patch:7.4.2201
Problem:    The sign column disappears when the last sign is deleted.
Solution:   Add the 'signcolumn' option. (Christian Brabandt)

95ec9d6a6a
2016-12-28 14:57:38 -05:00
d467104816 vim-patch:7.4.2194
Problem:    Sign tests don't cover enough.
Solution:   Add more test cases. (Dominique Pelle)

446a973ce3
2016-12-28 14:57:38 -05:00
92c7c42f7c vim-patch:7.4.2183
Problem:    Sign tests are old style.
Solution:   Turn them into new style tests. (Dominique Pelle)

09de17536d
2016-12-28 14:57:37 -05:00
e00b024295 vim-patch:7.4.2149
Problem:    If a test leaves a window open a following test may fail.
Solution:   Always close extra windows after running a test.

7cba71d7e3

Apply the runtest.vim changes that were missing from
4431975210
2016-12-28 14:57:22 -05:00
9009c20edb Merge pull request #5827 from justinmk/travisupdate
ci: Install cscope, remove deadsnakes PPA
2016-12-27 23:25:24 -05:00
c8b30307b7 Merge pull request #5838 from mhinz/travis/allowed-failure
CI: allow GCOV build to fail
2016-12-27 23:24:05 -05:00
c72f4d4d05 man.vim: revert "completion now respects 'wildignorecase'" (#5839)
Instead, a note was added to `:h man.vim` on how 'fileignorecase'
controls the case sensitivity of completion.
2016-12-27 19:01:04 -05:00
10d7a45e00 CI: allow GCOV build to fail 2016-12-28 00:54:52 +01:00
068399b13b ci: Upgrade pip3 (instead of install) 2016-12-28 00:18:01 +01:00
f2be05d6a3 ci: Install cscope, remove deadsnakes PPA
The travis ubuntu "trusty" image already pre-installs python 3.5.
https://docs.travis-ci.com/user/trusty-ci-environment
2016-12-27 23:41:49 +01:00
8950beeb04 ci: Upgrade to ubuntu 14.04 "trusty" 2016-12-27 23:41:49 +01:00
1928b79e0c vim-patch:7.4.1837 (#5834)
Problem:    The BufUnload event is triggered twice, when :bunload is used with
             set to  or .
Solution:   Do not trigger the event when ml_mfp is NULL. (Hirohito Higashi)

c67e892134
2016-12-27 17:39:21 -05:00
9066e23562 man.vim, provider.vim: Avoid shell syntax. #5734
- Improves compatibility with shell=tcsh.
- man.vim: split read_page into get_page, put_page. Do not split the
  window until we know there is going to be output.
2016-12-27 23:26:06 +01:00
fa42495d87 Merge #5832 from nhooyr/man-complete 2016-12-27 22:46:29 +01:00
49983a2270 man.vim: properly handle manpage names with spaces 2016-12-27 16:18:03 -05:00
e59147d1ba man.vim: completion now respects 'wildignorecase' 2016-12-27 16:17:58 -05:00
fb2d1cea3f Merge pull request #5761 from jamessan/vim-7.4.1752
Catchup with upstream quickfix patches
2016-12-27 14:37:30 -05:00
3224ade9c3 lint 2016-12-27 14:10:28 -05:00
7565b48e9c vim-patch:8.0.0006
Problem:    ":lb" is interpreted as ":lbottom" while the documentation says it
            means ":lbuffer".
Solution:   Adjust the order of the commands. (haya14busa, closes vim/vim#1093)

ebdd90ac28
2016-12-27 14:10:28 -05:00
2c59277ca8 vim-patch:7.4.2010
Problem:    There is a :cbottom command but no :lbottom command.
Solution:   Add :lbottom. (Yegappan Lakshmanan)

537ef08408
2016-12-27 14:10:28 -05:00
f224f3fbf1 vim-patch:7.4.1997
Problem:    Cannot easily scroll the quickfix window.
Solution:   Add ":cbottom".

dcb1700186
2016-12-27 14:10:27 -05:00
f613c61dae vim-patch:7.4.1984
Problem:    Not all quickfix features are tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan)

0fcc7c6dd1
2016-12-27 14:10:27 -05:00
5f6eb62a31 vim-patch:7.4.1980
Problem:    'errorformat' is parsed for every call to ":caddexpr".  Can't add
            to two location lists asynchronously.
Solution:   Keep the previously parsed data when appropriate. (mostly by
            Yegappan Lakshmanan)

361c8f0e51
2016-12-27 14:10:27 -05:00
fd94e6313b vim-patch:7.4.1966
Problem:    Coverity reports a resource leak.
Solution:   Close "fd" also when bailing out.

bcf7772a23
2016-12-27 14:10:27 -05:00
82f54c0a5e vim-patch:7.4.1964
Problem:    The quickfix init function is too big.
Solution:   Factor out parsing 'errorformat' to a separate function. (Yegappan
            Lakshmanan)

688e3d1fd9
2016-12-27 14:10:27 -05:00
8f0bf810ff vim-patch:7.4.1953
Problem:    Not all parts of the quickfix code are tested.
Solution:   Add more tests. (Yegappan Lakshmanan)

049cba9e97
2016-12-27 14:10:27 -05:00
d091faf284 vim-patch:7.4.1950
Problem:    Quickfix long lines test not executed for buffer.
Solution:   Call the function to test long lines. (Yegappan Lakshmanan)

f50df3925b
2016-12-27 14:10:27 -05:00
63d4ac7b25 vim-patch:7.4.1949
Problem:    Minor problems with the quickfix code.
Solution:   Fix the problems. (Yegappan Lakshmanan)

38df43bd13
2016-12-27 14:10:27 -05:00
2244253c14 vim-patch:7.4.1941
Problem:    Not all quickfix tests are also done  with the location lists.
Solution:   Test more quickfix code.  Use user commands instead of "exe".
            (Yegappan Lakshmanan)

3ef5bf7d45
2016-12-27 14:10:26 -05:00
4ac88c4faa vim-patch:7.4.1937
Problem:    No test for directory stack in quickfix.
Solution:   Add a test. (Yegappan Lakshmanan)

ab47c61f46
2016-12-27 14:10:26 -05:00
fbcc854d49 vim-patch:7.4.1912
Problem:    No test for using setqflist() on an older quickfix list.
Solution:   Add a couple of tests.

1cee693b31
2016-12-27 14:10:26 -05:00
ab43303df7 vim-patch:7.4.1884
Problem:    Updating marks in a quickfix list is very slow when the list is
            long.
Solution:   Only update marks if the buffer has a quickfix entry.

2f095a4bc4
2016-12-27 14:10:26 -05:00
a86d8b4088 vim-patch:7.4.1882
Problem:    Check for line break at end of line wrong. (Dominique Pelle)
Solution:   Correct the logic.

b37662a0fb
2016-12-27 14:10:26 -05:00
1e49cf6f23 vim-patch:7.4.1881
Problem:    Appending to a long quickfix list is slow.
Solution:   Add qf_last.

83e6d7ac6a
2016-12-27 14:10:26 -05:00
d244068f4f vim-patch:7.4.1871
Problem:    Appending to the quickfix list while the quickfix window is open
            is very slow.
Solution:   Do not delete all the lines, only append the new ones.  Avoid
            using a window while updating the list. (closes vim/vim#841)

864293abb7
2016-12-27 14:10:26 -05:00
9df9cf4ecc vim-patch:7.4.1841
Problem:    The code to reallocate the buffer used for quickfix is repeated.
Solution:   Move the code to a function. (Yegappan Lakshmanan, closes vim/vim#831)

2b2b8ae5ab
2016-12-27 14:10:26 -05:00
e2b081ed0c vim-patch:7.4.1823
Problem:    Warning from 64 bit compiler.
Solution:   Add type cast. (Mike Williams)

d9db8b448c

Already silenced in earlier commits by using size_t.
2016-12-27 14:10:26 -05:00
b9c5ca21e6 vim-patch:7.4.1815
Problem:    Compiler warnings for unused variables. (Ajit Thakkar)
Solution:   Add a dummy initialization. (Yasuhiro Matsumoto)

9a3b3311d2
2016-12-27 14:10:25 -05:00
48b5d0f1ba vim-patch:7.4.1813
Problem:    Memory access error when running test_quickfix.
Solution:   Allocate one more byte. (Yegappan Lakshmanan)

9b4ebc692d
2016-12-27 14:10:01 -05:00
39faa56bce vim-patch:7.4.1802
Problem:    Quickfix doesn't handle long lines well, they are split.
Solution:   Drop characters after a limit. (Anton Lindqvist)

6be8c8e165
2016-12-27 14:10:01 -05:00
29d7a59711 vim-patch:7.4.1768
Problem:    Arguments of setqflist() are not checked properly.
Solution:   Add better checks, add a test. (Nikolai Pavlov, Hirohito Higashi,
            closes vim/vim#661)

d106e5ba7f
2016-12-27 14:10:01 -05:00
e89efe75f9 vim-patch:7.4.1752
Problem:    When adding to the quickfix list the current position is reset.
Solution:   Do not reset the position when not needed. (Yegappan Lakshmanan)

c1808d5822
2016-12-27 14:10:00 -05:00
9ef371fd54 test: quickfix: Move upstream vim quickfix test to src/nvim/testdir
Massaging the upstream patches for this test into the lua tests are too
cumbersome and slow down patching.
2016-12-27 14:09:53 -05:00
21708d22ce Clipboard: improve error messages 2016-12-27 15:34:23 +01:00
a6b14dbb0b vim-patch:7.4.1816 (#5833)
Problem:    Looping over a null list throws an error.
Solution:   Skip over the for loop.

d8585eded6
2016-12-26 22:15:44 -05:00
7f9a95e5ea man.vim: when completing a fpage, always show section 2016-12-26 18:27:16 -05:00
4431975210 vim-patch:0 completion-related patches #5745 #5829
vim-patch:8.0.0058

Problem:    Positioning of the popup menu is not good.
Solution:   Position it better. (Hirohito Higashi)

91e44a3305

vim-patch:8.0.0099

Problem:    Popup menu always appears above the cursor when it is in the lower
            half of the screen. (Matt Gardner)
Solution:   Compute the available space better. (Hirohito Higashi,
            closes vim/vim#1241)

73095288da

vim-patch:8.0.0127

Problem:    Cancelling completion still inserts text when formatting is done
            for 'textwidth'. (lacygoill)
Solution:   Don't format when CTRL-E was typed. (Hirohito Higashi,
            closes vim/vim#1312)

73fd498886

vim-patch:7.4.2188

Problem:    Completion does not work properly with some plugins.
Solution:   Revert the part related to typing CTRL-E. (closes vim/vim#972)

c9fb77c692

vim-patch:7.4.2146

Problem:    Not enough testing for popup menu.  CTRL-E does not always work
            properly.
Solution:   Add more tests.  When using CTRL-E check if the popup menu is
            visible. (Christian Brabandt)

472472898a

vim-patch:7.4.2147

Problem:    test_alot fails.
Solution:   Close window.

abb71fbd39

vim-patch:7.4.2149

Problem:    If a test leaves a window open a following test may fail.
Solution:   Always close extra windows after running a test.

7cba71d7e3

vim-patch:7.4.2321

Problem:    When a test is commented out we forget about it.
Solution:   Let a test throw an exception with "Skipped" and list skipped test
            functions. (Christian Brabandt)

dac1947bb3

vim-patch:7.4.2331

Problem:    Using CTRL-X CTRL-V to complete a command line from Insert mode
            does not work after entering an expression on the command line.
Solution:   Don't use "ccline" when not actually using a command line. (test
            by Hirohito Higashi)

33a80eeb85

vim-patch:8.0.0008

Problem:    Popup complete test is disabled.
Solution:   Enable the test and change the assert. (Hirohito Higashi)

9e02cfa226

vim-patch:8.0.0047

Problem:    Crash when using the preview window from an unnamed buffer.
            (lifepillar)
Solution:   Do not clear the wrong buffer. (closes vim/vim#1200)

50e5376926

vim-patch:8.0.0053

Problem:    No test for what 8.0.0047 fixes.
Solution:   Add a test. (Hirohito Higashi)

60ef3e81f4
2016-12-26 22:21:14 +01:00
e9a2f77bff Merge #5815 from lonerover/vim-7.4.2124
vim-patch: 7.4.2124, 7.4.2126
2016-12-26 11:31:10 -05:00
18cb09e095 vim-patch:7.4.1780 (#5828)
Problem:    Warnings reported by cppcheck.
Solution:   Fix the warnings. (Dominique Pelle)

dc633cf827
2016-12-26 11:25:59 -05:00
c1d1493eb2 Merge pull request #5818 from jamessan/typval-encode-partial
eval: encode: Fix NULL check for partial's name
2016-12-24 13:26:10 -05:00
432e9e5a2e build: Do not check for obsolete <termio.h> 2016-12-24 17:41:06 +01:00
cdcf5d2039 build: Support old libtermkey.
Check TERMKEY_VERSION_* before referencing `TermKey_Terminfo_Getstr_Hook`.
2016-12-24 17:32:30 +01:00
a083c85ae4 eval: encode: Fix NULL check for partial's name 2016-12-23 22:35:18 -05:00
a3b58cd60a Merge #5758 from justinmk/fixkbs
tui: check stty/termios for kbs
2016-12-23 14:00:32 -05:00
657369bb68 CheckHealth: terminfo: remove "kbs" advice 2016-12-23 18:28:54 +01:00
0b244de384 test: job_spec: Avoid unreliable screen test. 2016-12-23 18:28:54 +01:00
af2e629be4 tui: check stty/termios for kbs
Requires libtermkey 0.19+

Closes #2048
Closes #5693

See a9b61424aa%5E...c0eb4e4a05f49ad8fee0195c77f2c29d09cc36af
See https://bugzilla.redhat.com/show_bug.cgi?id=142659
See fe4e9470bb/tty-keys.c (L625-L632)
2016-12-23 18:28:54 +01:00
308836d5ce vim-patch:7.4.2126
Problem:    No tests for :diffget and :diffput
Solution:   Add tests.

90d121fa36
2016-12-23 10:42:36 +08:00
4682129449 vim-patch:7.4.2124
Problem:    diffmode test leaves files behind, breaking another test.
Solution:   Delete the files.

623cf88f9c
2016-12-23 09:13:05 +08:00
f1bfd055a7 Merge pull request #5810 from lonerover/vim-7.4.2123
vim-patch:7.4.2123
2016-12-22 10:41:21 -05:00
98a9bedb62 Merge pull request #5809 from lonerover/vim-7.4.2335
vim-patch:7.4.2335
2016-12-22 10:38:58 -05:00
81fcba90a7 Merge pull request #5807 from mhinz/fix/vim-patch
vim-patch: fix default answers
2016-12-22 10:37:54 -05:00
5dea033443 vim-patch:7.4.2123
Problem:    No new style test for diff mode.
Solution:   Add a test.  Check that folds are in sync.

42093c0ec5
2016-12-22 15:00:58 +08:00
66936d7866 vim-patch: fix default answers 2016-12-22 03:17:01 +01:00
3e7f78b6cf vim-patch:7.4.2335
Problem:    taglist() is slow. (Luc Hermitte)
Solution:   Check for CTRL-C less often when doing a linear search. (closes
            vim/vim#1044)

72b4b870fc
2016-12-19 12:38:12 +08:00
33319b1bf0 syntax/vim.vim: Remove external interface checks (#5785) 2016-12-18 17:39:58 -05:00
aa4ef8966c Merge pull request #5779 from lonerover/vim-7.4.2337
vim-patch:7.4.2337
2016-12-16 10:08:26 -05:00
c22a147026 vim-patch:7.4.2337
Problem:    taglist() is still slow. (Luc Hermitte)
Solution:   Check for CTRL-C less often when finding duplicates.

77b642501a
2016-12-16 10:07:56 -05:00
a26188b58d Merge pull request #5775 from jamessan/vim-patch-review
vim-patch: Allow skipping non-"vim-patch" commits during review
2016-12-16 10:03:40 -05:00
c8c296557b Man: use non-recursive mappings for :Man (#5777)
This is a regression introduced by:

  https://github.com/neovim/neovim/pull/5290/files#diff-8691c83194ea5f1342ecc9f17b4c51d8R46

When the <plug> mappings were changed to using :Man, they should have changed to
use `nnoremap` as well.

Fixes #5776.
2016-12-15 17:36:55 +01:00
412d87698f vim-patch: Allow skipping non-"vim-patch" commits during review
It's not atypical to have extra, non-"vim-patch" commits in a PR merging
a bigger or set of related patches from Vim.  Rather than immediately
aborting, display the patch header to the user and let them decide
whether to continue reviewing.
2016-12-15 09:09:52 -05:00
02a9824438 Merge #5772 from justinmk/fixsegfault
eval.c: set_selfdict(): Fix invalid memory access.
2016-12-15 06:40:55 +01:00
f089d299e3 Merge pull request #5770 from jamessan/shada-lint
shada: Move '%' handling from shada_write to its own function
2016-12-14 15:23:19 -05:00
b29c5dd384 doc: job_control.txt
References #5529
2016-12-14 20:52:18 +01:00
43ba7f4d98 eval.c: set_selfdict(): Fix invalid memory access. 2016-12-14 20:52:18 +01:00
966be42a2b shada: Move '%' handling from shada_write to its own function
shada_get_buflist finds all the relevant buffers and generates the
kSDItemBufferList ShadaEntry.
2016-12-14 06:56:48 -05:00
8c9cccbcb6 Merge pull request #5760 from jamessan/shada-percent-count
shada: Respect the optional buffer count for shada-%
2016-12-13 22:35:25 -05:00
5855f30cb1 Make VimL code compatible with merged Partial support (#5765)
Closes #5763.
2016-12-13 14:48:42 +01:00
dbe41fe310 Merge pull request #5764 from jamessan/get-vim-patch
vim-patch: Add -g switch to download/preprocess patch
2016-12-13 08:39:47 -05:00
c6bd9f525c vim-patch: Add -g switch to download/preprocess patch 2016-12-12 20:55:25 -05:00
7eb91c781b shada: Respect the optional buffer count for shada-%
Closes #5759
2016-12-12 14:35:09 -05:00
988ab5804a Merge pull request #5529 from brcolow/vim-7.4.1559
Port partial patches from vim
2016-12-12 10:53:32 -05:00
5e4eb18eb0 Add some tests and cleanup. 2016-12-12 10:17:35 -05:00
0f681c80e1 Make partials work with jobs, timers, and dictwatchers. 2016-12-12 10:17:35 -05:00
a21c687661 Fixes. 2016-12-12 10:17:35 -05:00
2c4e92abea vim-patch:7.4.1731 Mark as NA
Leave a note in vim_diff.txt about it.
2016-12-12 10:17:35 -05:00
6c5dd6827f vim-patch:7.4.1875
Problem:    Comparing functions and partials doesn't work well.
Solution:   Add tests. (Nikolai Pavlov)  Compare the dict and arguments in the
            partial.

8e759ba865
2016-12-12 10:17:35 -05:00
b42347da45 vim-patch:7.4.1862 Mark as NA 2016-12-12 10:17:35 -05:00
537cee4883 vim-patch:7.4.1860
Problem:    Using a partial for timer_start() may cause a crash.
Solution:   Set the copyID in timer objects. (Ozaki Kiichi)

e3188e2615
2016-12-12 10:17:35 -05:00
c52856af2c vim-patch:7.4.1842
Problem:    get() works for Partial but not for Funcref.
Solution:   Accept Funcref.  Also return the function itself. (Nikolai Pavlov)

03e19a04ac
2016-12-12 10:17:35 -05:00
02c58d8a07 vim-patch:7.4.1839
Problem:    Cannot get the items stored in a partial.
Solution:   Support using get() on a partial.

2bbf8eff6f
2016-12-12 10:17:35 -05:00
c82dc7a6fd vim-patch:7.4.1836
Problem:    When using a partial on a dictionary it always gets bound to that
            dictionary.
Solution:   Make a difference between binding a function to a dictionary
            explicitly or automatically.

1d429610bf
2016-12-12 10:17:35 -05:00
eb337c9949 vim-patch:7.4.1720 Mark as NA 2016-12-12 10:17:35 -05:00
25438f149f vim-patch:7.4.1719
Problem:    Leaking memory when there is a cycle involving a job and a
            partial.
Solution:   Add a copyID to job and channel.  Set references in items referred
            by them.  Go through all jobs and channels to find unreferenced
            items.  Also, decrement reference counts when garbage collecting.

107e1eef1d
2016-12-12 10:17:35 -05:00
e97e24c77e vim-patch:7.4.1718
Problem:    Coverity: not using return value of set_ref_in_item().
Solution:   Use the return value.

d56374e25d
2016-12-12 10:17:35 -05:00
0645787741 vim-patch:7.4.1715
Problem:    Double free when a partial is in a cycle with a list or dict.
            (Nikolai Pavlov)
Solution:   Do not free a nested list or dict used by the partial.

ddecc25947
2016-12-12 10:17:35 -05:00
c6bc1e7bab vim-patch:7.4.1645
Problem:    When a dict contains a partial it can't be redefined as a
            function. (Nikolai Pavlov)
Solution:   Remove the partial when overwriting with a function.

c5fbe8af4c
2016-12-12 10:17:35 -05:00
04f328f1ae vim-patch:7.4.1644 Mark as NA 2016-12-12 10:17:35 -05:00
9d91218213 vim-patch:7.4.1639
Problem:    Invoking garbage collection may cause a double free.
Solution:   Don't free the dict in a partial when recursive is FALSE.

5f436fcf99
2016-12-12 10:17:35 -05:00
1945013eb7 vim-patch:7.4.1638
Problem:    When binding a function to a dict the reference count is wrong.
Solution:   Decrement dict reference count, only reference the function when
            actually making a copy. (Ken Takata)

e4eb6ff089
2016-12-12 10:17:35 -05:00
bae31b764a vim-patch:7.4.1608
Problem:    string() doesn't handle a partial.
Solution:   Make a string from a partial.

5c29154b52
2016-12-12 10:17:35 -05:00
3213b28c01 vim-patch:7.4.1607
Problem:    Comparing a function that exists on two dicts is not backwards
            compatible. (Thinca)
Solution:   Only compare the function, not what the partial adds.

f0e86a0dbd
2016-12-12 10:17:35 -05:00
5241ca7d7a vim-patch:7.4.1606
Problem:    Having type() handle a Funcref that is or isn't a partial
            differently causes problems for existing scripts.
Solution:   Make type() return the same value. (Thinca)

953cc7fb13
2016-12-12 10:17:35 -05:00
34a7814219 vim-patch:7.4.1605
Problem:    Catching exception that won't be thrown.
Solution:   Remove try/catch.

3905e291fe
2016-12-12 10:17:35 -05:00
86706011a6 vim-patch:7.4.1590
Problem:    Warning for shadowed variable. (Christian Brabandt)
Solution:   Move the variable into a local block.

3f242a844e
2016-12-12 10:17:35 -05:00
531249a4ac vim-patch:7.4.1589
Problem:    Combining dict and args with partial doesn't always work.
Solution:   Use the arguments from the partial.

9e63f61cb0
2016-12-12 10:17:35 -05:00
cf2701b269 vim-patch:7.4.1586
Problem:    Nesting partials doesn't work.
Solution:   Append arguments. (Ken Takata)

8a1bb04637
2016-12-12 10:17:35 -05:00
27b2fb944a vim-patch:7.4.1585
Problem:    Partial is not recognized everywhere.
Solution:   Check for partial in trans_function_name(). (Yasuhiro Matsumoto)
            Add a test.

d22a18928e
2016-12-12 10:17:35 -05:00
e2258598ca vim-patch:7.4.1582
Problem:    Get E923 when using function(dict.func, [], dict). (Kent Sibilev)
            Storing a function with a dict in a variable drops the dict if the
            function is script-local.
Solution:   Translate the function name.  Use dict arg if present.

6f2e4b36c9
2016-12-12 10:17:35 -05:00
5cf0c99755 vim-patch:7.4.1581
Problem:    Using ":call dict.func()" where the function is a partial does
            not work.  Using "dict.func()" where the function does not take a
            Dictionary does not work.
Solution:   Handle partial properly in ":call". (Yasuhiro Matsumoto)

65639032bb
2016-12-12 10:17:35 -05:00
2c1b4c7f3c vim-patch:7.4.1580
Problem:    Crash when using function reference. (Luchr)
Solution:   Set initial refcount. (Ken Takata)

7a5c46a9df
2016-12-12 10:17:35 -05:00
529482d684 vim-patch:7.4.1577
Problem:    Cannot pass "dict.Myfunc" around as a partial.
Solution:   Create a partial when expected.

ab1fa3955f
2016-12-12 10:17:35 -05:00
f90551b0e6 vim-patch:7.4.1564
Problem:    An empty list in function() causes an error.
Solution:   Handle an empty list like there is no list of arguments.

346418c624
2016-12-12 10:17:35 -05:00
66922d89cc vim-patch:7.4.1563
Problem:    Partial test fails on windows.
Solution:   Return 1 or -1 from compare function.

790500a8e6
2016-12-12 10:17:34 -05:00
521e45f2a8 vim-patch:7.4.1559
Problem:    Passing cookie to a callback is clumsy.
Solution:   Change function() to take arguments and return a partial.

1735bc988c
2016-12-12 10:17:34 -05:00
75c18b6aaa Merge pull request #5756 from jamessan/viminfo-leak
option.c: Update free_oldval after adjusting opt_idx for shada/viminfo
2016-12-12 06:55:23 -05:00
8995a15b20 Merge pull request #5757 from jamessan/vim-7.4.1867
vim-patch:7.4.1867
2016-12-12 06:55:11 -05:00
2d3c835534 vim-patch:7.4.1867
Problem:    Memory leak in test_matchstrpos.
Solution:   Free the string before overwriting. (Yegappan Lakshmanan)

3c809343c7
2016-12-11 23:21:51 -05:00
79c711670c option.c: Update free_oldval after adjusting opt_idx for shada/viminfo
Previously, free_oldval was set immediately on entering
did_set_string_option.  However, opt_idx hadn't been adjusted to account
for diverting 'viminfo' manipulation to 'shada'.

Therefore, the code which determines whether to free the old value was
looking at the flags for 'viminfo' while the code which sets whether a
value was allocated was modifying the flags for 'shada'.  This led to a
leak of any values set for 'viminfo'.

Updating free_oldval once opt_idx has been adjusted for the
'viminfo'/'shada' handling ensures the check/set values are consistent.

Closes #5698
2016-12-11 23:17:50 -05:00
29e651515f Merge #5752 from justinmk/doc
doc: api_info(), typval_encode.h
2016-12-11 02:04:33 +01:00
0fe89fc9d7 Merge #5750 from justinmk/jobstart
jobstart(): Return -1 if cmd is non-executable
2016-12-11 01:38:17 +01:00
19848dce50 doc: README.md: update appveyor URL 2016-12-11 01:32:28 +01:00
100a8d40db CheckHealth: more precise check for sensible.vim
Closes #5751
2016-12-11 01:26:49 +01:00
cc7c42ed5d po: Remove E902 message 2016-12-11 01:14:22 +01:00
d32888073f test: jobstart() 2016-12-11 01:14:22 +01:00
c8d5e9230e jobstart(): Return -1 if cmd is not executable. #5671
Closes #5465
2016-12-10 16:01:27 +01:00
f344e40699 ex_docmd.c: Save/restore winminheight/winminwidth. #5717
Fix session load with winminheight/winminwidth >1.

Problem:  Vim temporarily sets winheight/winwidth to 1 while loading
          session. If user has his minimum window size set higher, this
          causes an error.
Solution: Temporarily set winminheight/winminwidth, and restore the
          original values (in the right order) when finishing session read.
          The order of the compound 'set' command is important, if it is
          wrong there will be an error.
2016-12-10 04:05:07 +01:00
2380747ff2 vim-patch:7.4.1909 (#5748)
Problem:    Doubled semicolons.
Solution:   Reduce to one. (Dominique Pelle)

945ec093cd
2016-12-10 13:40:29 +01:00
26f8cdedc3 vim-patch:7.4.1897 (#5747)
Problem:    Various typos, long lines and style mistakes.
Solution:   Fix the typos, wrap lines, improve style.

fd89d7ea81
2016-12-10 13:39:28 +01:00
7c513d646d Merge #5396 from justinmk/tui-throttle
throttle shell output to maintain responsiveness
2016-12-10 02:18:15 +01:00
4abe9afbf6 out_data_decide_throttle(): timeout instead of hard limit.
Instead of managing max_visits, check the time every N visits. This avoids edge
cases where max_visits is large but the chunk frequency slowed down, which would
causing the "..." pulse to show for a very long time. It's more important to
show output at reasonable intervals than to avoid calling os_hrtime().
2016-12-10 01:26:34 +01:00
ea154dfdb2 out_data_decide_throttle(): Avoid too-small final chunk. 2016-12-10 01:26:34 +01:00
cb58999007 os/shell: do_os_system(): Always show last chunk.
This ameliorates use-cases like:
    :!cat foo.txt
    :make
where the user is interested in the last few lines of output.

Try these shell-based ex-commands before/after this commit:
    :grep -r '' *
    :make
    :!yes
    :!grep -r '' *
    :!git grep ''
    :!cat foo
    :!echo foo
    :!while true; do date; done
    :!for i in `seq 1 20000`; do echo XXXXXXXXXX $i; done

In all cases the last few lines of the command should always be shown,
regardless of where throttling was triggered.
2016-12-10 01:26:34 +01:00
5082af415f Health: rework syntax (#5744)
- By re-enabling code blocks (every line that doesn't begin with a "-" and is
  indented by at least 4 spaces), we prevent the Markdown syntax to evaluate "_"
  as beginning for italic text.

  That's the case for `:CheckHealth deoplete` for instance. It would output:

    $ cat /tmp/log_{PID}

  Since the deoplete check gets run first, almost all of the following
  `:CheckHealth` output would be italic.

- Since we re-enable code blocks, we now have to tell our custom syntax that it
  can be part of markdownCodeBlock as well. Otherwise there would be no
  highlithing for our keywords ERROR, INFO, etc. after 4 spaces of indent.

- Since we do the above anyway, we make it work for mkdListItemLine as well.
  That's a highlight group from `plasticboy/vim-markdown` opposed to the shipped
  markdown syntax (which essentially is `tpope/vim-markdown`). Before this patch
  there was no highlighting at all in the `:CheckHealth` output.
2016-12-09 19:54:24 +01:00
97204e1cef os/shell: Throttle :! output, pulse "..." message.
Periodically skip :! spam. This is a "cheat" that works for all UIs and greatly
improves responsiveness when :! spams MB or GB of output:
    :!yes
    :!while true; do date; done
    :!git grep ''
    :grep -r '' *

After ~10KB of data is seen from a single :! invocation, output will be skipped
for ~1s and three dots "..." will pulse in the bottom-left. Thereafter the
behavior alternates at every:
    * 10KB received
    * ~1s throttled

This also avoids out-of-memory which could happen with large :! outputs.

Note: This commit does not change the behavior of execute(':!foo').
      execute(':!foo') returns the string ':!foo^M', it captures *only* Vim
      messages, *not* shell command output. Vim behaves the same way.
      Use system('foo') for capturing shell command output.

Closes #1234

Helped-by: oni-link <knil.ino@gmail.com>
2016-12-09 18:51:17 +01:00
043f85210a tui: "backpressure": Drop messages to avoid flooding.
Closes #1234

multiqueue:
- Implement multiqueue_size()
- Rename MultiQueueItem.parent to MultiQueueItem.parent_item, to avoid confusion
  with MultiQueue.parent.
2016-12-09 18:51:17 +01:00
7da7ff7c5c vim-patch:7.4.1758, 7.4.1759, 7.4.1692 #5640
vim-patch:7.4.1758

Problem:    Triggering CursorHoldI when in CTRL-X mode causes problems.
Solution:   Do not trigger CursorHoldI in CTRL-X mode. Add "!" flag to
            feedkeys() (test with that didn't work though).

245c41070c

vim-patch:7.4.1759

Problem:    When using feedkeys() in a timer the inserted characters are not
            used right away.
Solution:   Break the wait loop when characters have been added to typebuf.
            use this for testing CursorHoldI.

40b1b5443c

vim-patch:7.4.1692
Problem:    feedkeys('i', 'x') gets stuck, waits for a character to be typed.
Solution:   Behave like ":normal". (Yasuhiro Matsumoto)
2016-12-09 17:46:14 +01:00
880ce887ed ci: Update appveyor artifact path. 2016-12-09 17:09:17 +01:00
ae9f1938ea Health: match syntax keyword case exactly (#5741)
This prevents the string "error" within error messages to be highlighted as
healthError.
2016-12-09 16:47:29 +01:00
4a2d2248e8 Merge pull request #5736 from jamessan/vim-7.4.1754
vim-patch:7.4.1754
2016-12-09 09:42:23 -05:00
20995c7960 Remove g:python{,3}_host_skip_check (#5738)
This option simplifies the configuration options:

1) `g:python{,3}_host_prog` is not set.

    Neovim tries its best to find a suitable interpreter. This means calling
    exepath(), potentially multiple times, and a system('python -c ...') with
    the first found interpreter, to get the Python version.

2) `g:python{,3}_host_prog` is set.

    Avoids everything of the above. No safety checks, no training wheels. Fast
    host startup time!
2016-12-09 15:08:18 +01:00
ddfac951ea Merge pull request #5705 from brcolow/vim-7.4.1835
vim-patch:7.4.[1835,1956]
2016-12-08 10:43:17 -05:00
7775fb7dff lint 2016-12-08 10:36:24 -05:00
d1473880bc vim-patch:7.4.1754
Problem:    When 'filetype' was set and reloading a buffer which does not
            cause it to be set, the syntax isn't loaded. (KillTheMule)
Solution:   Remember whether the FileType event was fired and fire it if not.
            (Anton Lindqvist, closes vim/vim#747)

c3691332f7
2016-12-08 10:27:32 -05:00
49d2952658 Merge pull request #5659 from brcolow/vim-7.4.1685
vim-patch:7.4.[1685,2163,2217,2269],8.0.00[33,40]
2016-12-08 09:18:51 -05:00
adf29cef72 syntax.c: Update color names. (#5733)
Closes #5178
2016-12-08 01:01:12 +01:00
ff99cbfc02 Merge #5488 from justinmk/test-fix-mouse-drag
test: Disable unreliable test on travis+ASAN_UBSAN
2016-12-07 23:55:18 +01:00
8da23cb919 Merge #5729 from jamessan/vim-7.4.1751
vim-patch:7.4.1751,8d8aa0a
2016-12-07 18:47:10 +01:00
933c873cae test: Handle SIGHUP in tty-test fixture.
Closes #5727
2016-12-07 17:22:37 +01:00
a1b0f594ea test: Disable unreliable tests on travis+ASAN_UBSAN 2016-12-07 17:22:23 +01:00
f7a49532b1 lint 2016-12-07 11:04:33 -05:00
1a4f13ba8f test: helpers.retry() 2016-12-07 17:03:52 +01:00
035eb27575 vim-patch:8d8aa0a
Add missing test file.

8d8aa0a367
2016-12-07 10:44:35 -05:00
4f3c9ad4d7 vim-patch:7.4.1751
Problem:    Crash when 'tagstack' is off. (Dominique Pelle)
Solution:   Fix it. (Hirohito Higashi)

def5abe0a2
2016-12-07 10:44:31 -05:00
e6b7dade4f Merge pull request #5712 from bfredl/utf8charset
clean up charset.c for assumed &encoding=utf-8
2016-12-07 15:42:06 +01:00
ff35d4c987 doc: 'shelltemp'
Closes #5706
2016-12-07 13:37:44 +01:00
2eeabf9a43 mbyte: clean up charset.c for assumed encoding=utf-8 2016-12-07 08:59:08 +01:00
63c46c1106 vim-patch:8.0.0040
Problem:    Whole line highlighting with matchaddpos() does not work.
Solution:   Check for zero length. (Hirohito Higashi)

8507747600
2016-12-07 00:37:29 -07:00
0e99d29169 vim-patch:8.0.0033
Problem:    Cannot use overlapping positions with matchaddpos().
Solution:   Check end of match. (Ozaki Kiichi) Add a test (Hirohito Higashi)

a6c27ee6db
2016-12-06 22:57:30 -07:00
652f15aaa5 Add vim defaults to runtest.vim. 2016-12-06 22:42:14 -07:00
c5d2e442a3 vim-patch:7.4.2269
Problem:    Using 'hlsearch' highlighting instead of matchpos if there is no
            search match.
Solution:   Pass NULL as last item to next_search_hl() when searching for
            'hlsearch' match. (Shane Harper, closes vim/vim#1013)

e17bdffff7
2016-12-06 17:15:49 -07:00
0064e9738a vim-patch:7.4.2217
Problem:    When using matchaddpos() a character after the end of the line can
            be highlighted.
Solution:   Only highlight existing characters. (Hirohito Higashi)

4f416e4124
2016-12-06 17:12:08 -07:00
629e788b36 vim-patch:7.4.2163
Problem:    match() and related functions tested with old style test.
Solution:   Convert to new style test. (Hirohito Higashi)

d76a0c15f8
2016-12-06 17:02:13 -07:00
6fea2dfd26 vim-patch:7.4.1685
Problem:    There is no easy way to get all the information about a match.
Solution:   Add matchstrpos(). (Ozaki Kiichi)

7fed5c18f8
2016-12-06 15:52:48 -07:00
6115029496 Merge pull request #5721 from jamessan/vim-7.4.1708
vim-patch:7.4.1708
2016-12-06 15:47:59 -05:00
e085f7c5f1 vim-patch:7.4.1708
Problem:    New regexp engine does not work properly with EBCDIC.
Solution:   Define equivalence class characters. (Owen Leibman)

2a6fa564a3

Although nvim doesn't support EBCDIC systems, this keeps us inline with
upstream code so its easier to merge future patches in this area and
improves the readability of the code.
2016-12-06 11:16:33 -05:00
7666b4950e Health: show :help + tags (#5719) 2016-12-05 13:01:47 +01:00
8089292472 Merge pull request #5715 from equal-l2/change-lua-url
Update Lua's download URL
2016-12-03 23:59:38 -05:00
0165de0228 Merge pull request #5707 from jamessan/moar-cleaning
build: Make clean targets more thorough
2016-12-03 23:33:13 -05:00
cc33aebd8e Merge pull request #5716 from jamessan/fix-man-plugin
ftplugin/man: Finish early if &filetype is not man
2016-12-03 23:32:07 -05:00
9337e98b16 ftplugin/man: Finish early if &filetype is not man
Many people have `runtime ftplugin/man.vim` in their init file, as was
required in Vim to have the `:Man` command generally available.
7a4d069b removed the &filetype check, which caused these setups to
always create a blank `man://` buffer.
2016-12-03 21:27:43 -05:00
3143d7cce3 Change Lua's download URL 2016-12-04 09:42:32 +09:00
b025474258 vim-patch:8.0.0110 (#5700)
Closes #5616

Problem:    Drop command doesn't use existing window.
Solution:   Check the window width properly. (Hirohito Higashi)

5a030a540f
2016-12-03 22:38:13 +01:00
e29a4ceede Merge #5704 from jamessan/vim-7.4.1748
vim-patch:7.4.1748
vim-patch:f9660b5
2016-12-03 18:09:42 +01:00
d98ebd6ab9 build: Make clean targets more thorough 2016-12-02 20:38:55 -05:00
d9dffeb486 lint 2016-12-02 20:30:08 -05:00
a4f646dde8 vim-patch:f9660b5
Add missing test file.

f9660b59b2
2016-12-02 20:30:06 -05:00
fa9cd8b878 vim-patch:7.4.1748
Problem:    "gD" does not find match in first column of first line. (Gary
            Johnson)
Solution:   Accept match at the cursor.

1538fc34fa
2016-12-02 20:30:03 -05:00
34efe443ac vim-patch:7.4.1956
Problem:    When using CTRL-W f and pressing "q" at the ATTENTION dialog the
            newly opened window is not closed.
Solution:   Close the window and go back to the original one. (Norio Takagi,
            Hirohito Higashi)

5d2ca04029
2016-12-02 17:28:54 -07:00
9af8cd768d vim-patch:7.4.1835
Problem:    When splitting and closing a window the status height changes.
Solution:   Compute the frame height correctly. (Hirohito Higashi)

991dea3ab1
2016-12-02 16:04:47 -07:00
3607e0b8ff doc: Remove obsolete reference to rgb_file.
Closes #5695
2016-12-01 16:00:28 +01:00
77dceaaeb7 Merge pull request #5675 from brcolow/vim-7.4.1738
vim-patch:7.4.17[35,38,39]
2016-12-01 13:32:12 -05:00
6c1d81aef2 Merge pull request #5663 from brcolow/vim-7.4.1702
vim-patch:7.4.1702
2016-12-01 12:51:10 -05:00
4f3bb5262c vim-patch:7.4.1702
Problem:    Using freed memory when parsing 'printoptions' fails.
Solution:   Save the old options and restore them in case of an error.
            (Dominique)

4afc7c5d4a
2016-12-01 09:20:23 -05:00
909b7d9dea vim-patch:7.4.1739
Problem:    Messages test fails on MS-Windows.
Solution:   Adjust the asserts.  Skip the "messages maintainer" line if not
            showing all messages

bea1ede1c5
2016-12-01 09:15:47 -05:00
85f9f9f46d Merge pull request #5674 from brcolow/vim-7.4.1723
vim-patch:7.4.1723
2016-12-01 09:07:33 -05:00
e1cdf04f2d Merge pull request #5665 from brcolow/vim-7.4.1711
vim-patch:7.4.1711
2016-12-01 09:01:55 -05:00
d2e8c76dc2 Merge PR #5651 from mhinz/vv/exitval 2016-12-01 15:00:58 +01:00
df2ffe48ce Tests: add tests for v:exiting 2016-12-01 14:57:27 +01:00
147b03e7d0 Add v:exiting
Contains the exit value nvim will use.

Before exiting, it is v:null. That way jobs or autocmds (in VimLeavePre or
VimLeave) can check if Neovim is about to quit and with what exit value.

Closes #4666.
2016-12-01 14:57:22 +01:00
5194e3bc45 Merge pull request #5664 from brcolow/vim-7.4.1707
vim-patch:7.4.1707
2016-12-01 08:46:18 -05:00
1f8a3da796 Merge pull request #5669 from chemzqm/add-cmdline-mode-rpc
Add cmdline mode to ui_mode_change
2016-12-01 08:05:44 +01:00
0e1c406df4 Merge pull request #5662 from brcolow/vim-7.4.1701
vim-patch:7.4.1701
2016-12-01 00:14:16 -05:00
5679ceb3a8 Merge pull request #5648 from brcolow/vim-7.4.2071
vim-patch:7.4.2071
2016-11-30 20:58:11 -05:00
3cf4b14e96 add cmdline mode to modechange of RPC and tests
use set_cursor_shape_bar for cmdline mode

fix test of screen_basic_spec.lua & screen.lua

comment fix
2016-11-30 22:20:06 +08:00
f94740097b vim-patch:7.4.1738
Problem:    Count for ":messages" depends on number of lines.
Solution:   Add ADDR_OTHER address type.

5d91646599
2016-11-29 16:32:43 -07:00
d2be11fbf2 vim-patch:7.4.1735
Problem:    It is not possible to only see part of the message history.  It is
            not possible to clear messages.
Solution:   Add a count to ":messages" and a clear argument. (Yasuhiro
            Matsumoto)

451f849fd6
2016-11-29 16:32:43 -07:00
f2c6cc2d09 version.c: mark NA patches (#5657)
1710: external command
2311: Appveyor
2016-11-29 23:43:25 +01:00
78cbed5138 Merge #5643 from Shougo/vim-7.4.1686
vim-patch:7.4.1686, 7.4.2007
2016-11-29 23:40:29 +01:00
783c9aac8e vim-patch:7.4.1699 (#5660)
Problem:    :packadd does not work the same when used early or late.
Solution:   Always load plugins matching "plugin/**/*.vim".

71fb0c146b
2016-11-29 23:19:25 +01:00
5efcefee87 vim-patch:7.4.2071
Problem:    The return value of type() is difficult to use.
Solution:   Define v:t_ constants. (Ken Takata)

f562e72df7
2016-11-29 15:02:24 -07:00
3979c6cbed Merge pull request #5687 from jamessan/if_py-crash
msgpack_rpc: Allocate empty string in msgpack_rpc_to_object
2016-11-29 09:40:53 -05:00
b37d062459 msgpack_rpc: Allocate empty string in msgpack_rpc_to_object
STR_CASE previously used a NULL data pointer for the String object, but
this pushes the NULL checks to the rest of the code.  Instead,
allocating an empty string solves the same issue of there not being any
data but ensures that we're not passing NULL to functions that don't
expect it.

Closes #5627
2016-11-29 08:19:48 -05:00
9e56278d0b Merge pull request #5684 from jamessan/initialize-terminput-buf
rbuffer: Use xcalloc to ensure memory is initialized
2016-11-29 06:54:56 -05:00
80b808dbfe rbuffer: Use xcalloc to ensure memory is initialized
Since the rbuffer contents are used by string functions (like sscan,
strlen, etc.), it is not safe to use uninitialized memory.  Using
xcalloc ensures the string-based functions do not run past the end of
the buffer.

Closes #5676
2016-11-28 19:32:39 -05:00
39bb43c530 startup: Initialize v:count1 (#5656)
The man plugin uses `v:count == v:count1` to detect if a count was explicitly
given. Unfortunately v:count1 does _not_ default to 1 but 0 during startup.

Now we set v:count1 to 1 early.

Fixes https://github.com/neovim/neovim/issues/5655
2016-11-28 20:44:29 +01:00
9956beee24 version bump 2016-11-27 20:03:35 +01:00
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
68271a6d19 vim-patch:7.4.1723
Problem:    When using try/catch in 'tabline' it is still considered an
            error and the tabline will be disabled.
Solution:   Check did_emsg instead of called_emsg. (haya14busa, closes #746)

f73d3bc253
2016-11-26 16:17:39 -07:00
7be113d795 shell_write_cb: Schedule error message. (#5670)
Closes #5558
2016-11-26 13:08:42 +01:00
22c7dbd5f8 vim-patch:7.4.1711
Problem:    When using try/catch in 'statusline' it is still considered an
            error and the status line will be disabled.
Solution:   Check did_emsg instead of called_emsg. (haya14busa, closes vim/vim#729)

a742e084b6
2016-11-25 18:23:36 -07:00
8f84c1da83 vim-patch:7.4.1707
Problem:    Cannot use empty dictionary key, even though it can be useful.
Solution:   Allow using an empty dictionary key.

0921ecff1c
2016-11-25 18:23:11 -07: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
783220e427 vim-patch:7.4.1701
Problem:    Equivalence classes still tested in old style tests.
Solution:   Remove the duplicate.

f9f22dbe4f
2016-11-24 23:30:30 -07:00
d24222cea8 vim-patch:7.4.2007
Problem:    Running the tests leaves a viminfo file behind.
Solution:   Make the viminfo option empty.

fc4ad61607
2016-11-25 06:43:36 +09: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
071a7d3d78 vim-patch:7.4.1686
Problem:    When running tests $HOME/.viminfo is written. (James McCoy)
Solution:   Add 'nviminfo' to the 'viminfo' option. (closes vim/vim#722)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

 - Style changes
 - Variable renames
 - Changes in variable scope

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

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

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

fa7353428f

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

---

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

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

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

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

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

cb00f03933

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

79c2c881bb

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

e3303cb081

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

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

b4f6a46b01

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

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

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

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

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

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

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

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

cc7ff3fcd8

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

256972a984

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

2c5e8e80ea

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

d042dc825c

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

e392eb41f8

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

b4ff518d95

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

d7464be974

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

a0f849ee40

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

b5971141df

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

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

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

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

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

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

74b738d414

Mark 7.4.889 as merged

Done in

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

5f1fea28f5

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

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

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

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

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

885f24fbca

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

f068dcafcf

Applied manually.

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

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

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

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

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

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

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

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

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

96c664af27

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

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

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

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

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

2ab375e54e

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

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

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

7.4.733:

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

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

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

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

cde8854730

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

7b256fe744

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

901e58c243

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

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

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

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

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

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

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

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

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

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

fc39ecf8de

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

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

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

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

List of failures:

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

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

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

---

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

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

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

---

[Build][5] error:

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

---

Build [4949][7]:

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

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

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

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

Original patch by Rui Abreu Ferreira (@equalsraf)

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

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

dc94a26a64

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

a2cce86307

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

f49e240c2d

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

c06624661a

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

768ce2435a

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

New feature: `vterm_state_set_unrecognised_fallbacks`
  acf7f19713

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

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

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

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

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

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

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

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

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

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

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

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

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

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

e1a61991d9

---

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

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

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

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

  905: (if_py_both)
       d424747d58

  909: (src/Makefile)
       de59ba33aa

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

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

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

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

  969: (cast) HAVE_AVAIL_MEM was removed.
       35be4534c0

  993: (if_py_both)
       52f6ae1366

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

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

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

  E685: Internal error: get_tv_string_buf()

It's reproducable with:

  :call setloclist(0, [''])

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

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

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

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

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

Prefer sizeof(NameBuff)

Add braces for Travis lint

Break long line

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

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

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

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

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

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

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

294a7e55b0

---

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

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

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

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

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

be83b73ddb

---

To reproduce:

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

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

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

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

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

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

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

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

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

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

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

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

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

6040256d8b

---

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

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

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

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

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

1c2836e268

---

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

e7d1376b63

---

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

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

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

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

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

c2b717ebd6

---

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

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

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

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

684: vim_tempfile() was refactored
     e5c421cfd7

725: str_to_reg() was refactored
     659c94d483

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

767: (clientserver)
     fafeee6b9e

804: (xxd)
     43fe32900c

812: ml_add_stack() was refactored by e53dda90bd
     fbd302ff38

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

827: (src/Makefile)
     8cba8ba3e0

838: (crypt, ifdef)
     8060687905

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

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

865: (uninitializing) handled by 7f99d210fd
     ed84b76021

866: (netbeans)
     93c88e0f6a

873: (netbeans, unused) related to 866
     b8603882b1

897: (clientserver)
     4e86150ec5

---

NA runtime patch:

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

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

b341dda575

---

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

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

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

670acbc70f

---

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

To reproduce:

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

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

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

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

cfcd1ddd10

---

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

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

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

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

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

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

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

e2e4b98622

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

6e8d3b0d41

---

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

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

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

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

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

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

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

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

0: 52692d3cd3
1: 1560d07045

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

d87c36ea5e

---

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

695baeefe1

---

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

What I did for testing:

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

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

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

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

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

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

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

478c46e50f

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

included patches:
 697 Already included e4975f8
1013
1149 Revert 7.4.1013

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

83d1b19015

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

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

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

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

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

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

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

    Updated runtime files.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

651863c94a

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

4649ded287
2016-01-10 09:01:30 +09:00
588b09277b vim-patch:7.4.946
Problem:    Missing changes in source file.
Solution:   Include changes to the eval.c file.

bbfbaf9741
2016-01-10 09:01:30 +09:00
008c014cbe vim-patch:7.4.945
Problem:    New style testing is incomplete.
Solution:   Add the runtest script to the list of distributed files.
            Add the new functions to the function overview.
            Rename the functions to match Vim function style.
            Move undolevels testing into a new style test script.

683fa185a4
2016-01-10 09:01:30 +09:00
593df501b3 vim-patch:7.4.944
Problem:    Writing tests for Vim script is hard.
Solution:   Add assertEqual(), assertFalse() and assertTrue() functions.  Add
            the v:errors variable.  Add the runtest script. Add a first new
            style test script.

43345546ae
2016-01-10 09:01:30 +09:00
50db0312f9 build: ensure static jemalloc. #3970
Otherwise the dynamic library is built also and find_library will prefer
that over the static one. That results in linking against the dynamic
library which will not be found after install.

This code:
  8b3c399b6d/third-party/CMakeLists.txt (L130)
should prevent the above problem, but it doesn't hurt to be explicit.
2016-01-09 12:23:02 -05:00
c15446222b Merge pull request #3962 from sethjackson/windows-98
[RFC] doc: Remove references to Windows 98
2016-01-09 00:20:49 -05:00
665bd8de59 doc: Remove references to Windows 98. 2016-01-08 22:13:32 -05:00
36f17ce87e vim-patch.sh: fix regression 2016-01-08 19:12:36 -05:00
3706701d9b Merge pull request #3965 from jusga/vim-e3faf44
vim-patch:e3faf44
2016-01-08 19:01:07 -05:00
a42800ba45 Merge pull request #3963 from Pyrohh/contrib
[RFC] CONTRIBUTING.md: Remove outdated info
2016-01-08 18:28:59 -05:00
94fabe4d59 CONTRIBUTING.md: Remove outdated info
- Remove mention of "build-issues" and "runtime-issues" sections from
  the "Troubleshooting" page; they're already mentioned at the top of
  the section: "Before reporting an issue, see the ...".

- As of [1], clint-ignored-files.txt isn't used anymore.

[1]: 57eaefbb23
2016-01-08 17:47:09 -05:00
4bc3bcab22 vim-patch:e3faf44
Updated runtime files.

e3faf44bef
2016-01-08 23:14:47 +01:00
d51a27b7e5 Remove 'restorescreen' option
The relevant code was never actually in Neovim, most likely due to being
unifdef(1)'d out during the initial import.

see `:h hidden-options'
2016-01-08 14:59:18 -05:00
3b23d733dd Merge pull request #3943 from ZyX-I/better-fref-error
eval: Use better error messages when failing to dump values
2016-01-08 09:29:37 -05:00
af5c34f8a5 Merge pull request #3839 from justinmk/reprobuilds
semver (semantic versioning) compliance
2016-01-08 02:10:19 -05:00
b4b4536339 version: semver.org compliance
We use `git describe` to stamp pre-release versions (dev builds). But
`git describe` uses the result of the most-recent tag (the current
_release_ version)--so we must munge it with the _next_ (i.e.
unreleased) version.

Also fix non-git builds: do not invoke git_describe(NVIM_VERSION_MEDIUM)
if we're not in a git tree, else it gets the dummy value
"HEAD-HASH-NOTFOUND".

Example :version output in non-git build:
  NVIM 0.1.2-dev

Example :version output in git build:
  NVIM v0.1.2-176-g9c3c2b5
2016-01-08 01:09:22 -05:00
7643245470 BuildLibuv.cmake: make case consistent 2016-01-08 01:09:22 -05:00
fec35dc976 screen.c: Remove out of date comment
This was forgotten in 10b2a0e529
2016-01-07 15:29:33 -05:00
e57e303c6b Merge pull request #3956 from oni-link/cov.62611
coverity/62611: Nesting level does not match indentation
2016-01-07 10:11:21 -05:00
23669bd7df coverity/62611: Nesting level does not match indentation
The nested line was the else-branch of an if-then-else block that dealt
with cryptography, but after commit
85338fe1d5 (Remove cryptography) removed
the if-then part, the indentation of this line was not adjusted.
2016-01-07 12:31:05 +01:00
2d39eea9f0 Merge pull request #3952 from Pyrohh/repro-builds
build: Stop using __{DATE,TIME}__
2016-01-06 17:57:44 -05:00
c6aa71605f build: Stop using __{DATE,TIME}__
Recording the compilation time modifies the source for dubious gain, and
interferes with reproducible builds [1].

[1] https://reproducible-builds.org/
2016-01-06 17:24:21 -05:00
ZyX
c6f6033482 eval: Do not use msgpack#string for error messages 2016-01-07 00:54:58 +03:00
ZyX
bd4ca22cf0 documentation: Update documentation 2016-01-07 00:54:57 +03:00
ZyX
efaf76e623 functests: Update tests 2016-01-07 00:54:57 +03:00
ec580da5f4 doc: Clarify Windows feature tests for eval(). 2016-01-06 15:46:25 -05:00
0298b004f8 Merge pull request #3945 from sethjackson/win32-winnt
MinGW: libuv needs -D_WIN32_WINNT=0x0600
2016-01-06 02:45:07 -05:00
bd529ea3f3 MinGW: libuv needs -D_WIN32_WINNT=0x0600
Without this compilation fails due to a missing symbol: SRWLOCK in libuv
headers. _WIN32_WINNT defines the Windows header version that is to be used,
and it seems libuv requires this version. See

    b471b33da8
2016-01-04 19:51:09 -05:00
ZyX
d26b01d4bd eval: Use better error messages when failing to dump values
Examples:

    let g:SR = [[]]
    call add(g:SR[0], g:SR)
    wshada
    " E952: Unable to dump variable g:SR: container references itself in index 0, index 0

    let g:F = {'_TYPE': v:msgpack_types.map, '_VAL': [[{'abc': 1}, function("tr")]]}
    wshada
    " E951: Error while dumping variable g:F, key {'abc': 1} at index 0 from special map, key '': attempt to dump function reference
    " (no msgpack#string available)
    " E951: Error while dumping variable g:F, key {="abc": 1} at index 0 from special map, key '': attempt to dump function reference
    " (msgpack#string available)

    let g:F = {'_TYPE': v:msgpack_types.map, '_VAL': [[g:SR, function("tr")]]}
    wshada
    " E951: Error while dumping variable g:F, key [[[[{E724@0}]]]] at index 0 from special map, index 1: attempt to dump function reference

    call msgpackdump([g:SR])
    " E952: Unable to dump msgpackdump() argument, index 0: container references itself in index 0, index 0

Not tested yet.
2016-01-04 17:20:16 +03:00
074d3dc1f3 Merge pull request #3938 from sethjackson/s-islnk
Fix S_ISLNK definition in os_defs.h
2016-01-03 14:11:09 -05:00
3ce8de7c8f Fix S_ISLNK definition in os_defs.h. 2016-01-03 13:51:58 -05:00
59eaba2894 Merge pull request #3655 from bfredl/enc_default
Default to encoding=utf-8
2016-01-02 18:05:52 -05:00
70f6e2ce52 encoding: update tests 2016-01-02 23:22:13 +01:00
5a6633bc34 encoding: Update documentation 2016-01-02 23:21:57 +01:00
04bdeeb8b2 encoding: cleanup defaults of iskeyword, isprint and fileencodings 2016-01-02 23:21:51 +01:00
49b06a8f2a encoding: Always use "utf-8" as default for &encoding
Preverve the locale-depedency for fileencodings=default
2016-01-02 23:15:53 +01:00
cb62594042 Merge pull request #3927 from sethjackson/if-cscope
Windows: Bring back code branch for if_cscope
2016-01-02 12:35:21 -05:00
c9df429887 Merge pull request #3928 from justinmk/fix_ci_target
test: change CI_TARGET reference to CI
2016-01-02 01:21:42 -05:00
22a928aeac test: change CI_TARGET reference to CI
Travis defines[1] $CI for its builds, whereas $CI_TARGET is
a Neovim-specific env var from 6483a198e4
that lost prominence in d2eb4a9346.

[1] https://docs.travis-ci.com/user/environment-variables/
2016-01-01 23:58:42 -05:00
6f25ba0550 CI/travis: enable gcov for one build only. #3926 2016-01-01 22:20:16 -05:00
b2f9bfbff0 Windows: Bring back code branch for if_cscope.
The Vim code for windows in if_cscope.c/.h was removed during the refactor,
added missing code for error_closing().
2016-01-01 20:58:04 -05:00
4d27bd6bfe Merge pull request #3920 from sethjackson/vim-spec
Windows: Fix api/vim_spec.lua functional test
2016-01-01 17:22:40 -05:00
adf11f3478 Merge pull request #3925 from sethjackson/uv-uid-t
Windows: Make the os_get_uname argument portable
2016-01-01 14:56:11 -05:00
f1344bc219 Merge pull request #3903 from justinmk/vim-7.4.605
vim-patch:7.4.605
2016-01-01 14:38:17 -05:00
3fd62f9612 file_pat_to_reg_pat, buflist_findpat: const params
file_pat_to_reg_pat() and buflist_findpat() do not modify the data of
these parameters.
2016-01-01 14:26:32 -05:00
ff0253127e Windows: Make the os_get_uname argument portable.
Since uid_t is not defined on Windows use uv_uid_t instead.
We now use uv_uid_t everywhere except one place in src/nvim/main.c
which is wrapped in a #ifdef UNIX check.
2016-01-01 14:13:56 -05:00
df4ac79761 Merge pull request #3911 from sethjackson/have-fsync-guard
os_fsync
2016-01-01 12:13:40 -05:00
a79ebeeea4 Merge pull request #3707 from bfredl/oapblock
[use oap->motion_type also to represent block motion type
2016-01-01 08:17:05 -05:00
303ac3f283 normal: use oap->motion_type also to represent block motion type
Previously oap->motion_type == MCHAR would be blockwise if
oap->block_mode was set.
2016-01-01 12:56:51 +01:00
648aebb8b6 Port fsync() to libuv. 2016-01-01 00:12:28 -05:00
a48508de0d test/functional: Fix api/vim_spec.lua.
On Windows the default file format is DOS i.e. newlines are \r\n
instead of \n.
2015-12-31 23:28:55 -05:00
04cd3eef24 Merge pull request #3918 from sethjackson/servertest
Windows: fix serverstart functional test
2015-12-31 17:12:57 -05:00
6d5a5b02f6 Merge pull request #3304 from sethjackson/wildignorecase
Windows: Ignore EW_ICASE in do_path_expand
2015-12-31 17:02:57 -05:00
568ee1e3c2 Windows: Ignore EW_ICASE in do_path_expand
The do_path_expand() function is still using the unix_expandpath
variant from Vim. For Windows it should behave as the old
dos_expandpath() function. This commit adds an ifdef to ignore
EW_ICASE flag in this function, otherwise all matches fail on Windows
if wildignorecase is set.
2015-12-31 16:14:12 -05:00
091e885d44 Windows: fix serverstart functional test 2015-12-31 16:07:43 -05:00
68fb815bf1 Merge pull request #3881 from sethjackson/msvc-ui-call
MSVC: Fix UI_CALL for MSVC
2015-12-31 00:16:07 -05:00
8b3c399b6d build: use our mirror of LuaJIT-2.0.4.tar.gz
Point to new location.
2015-12-30 23:40:04 -05:00
bd39e2354f Merge pull request #3910 from Shougo/version
Update version.c to 7.4.1000
2015-12-30 20:24:21 -05:00
6a7535cd84 Update version.c to 7.4.1000
NA patches list:
607 Compiler warning
620 Compiler warning
624 result check for realloc
628 volatile add, but no code in neovim
641 tabnew fix, but no code in neovim
661 no K_CURSORHOLD in neovim
841 add ifdef
842 Windows GUI
854 CONTRIBUTION.md
863 FEAT_DIFF
864 Tiny build
923 add ifdef
924 configure changes
927 if_ruby
928 client server
930 Windows GUI
934 Appveyor
938 X11 and GTK GUI fix
940 term
948 ifdef
954 if_lua
959 term
960 Windows build
962 Makefile fix
965 ifdef fix
966 configure fix
967 Makefile fix
976 configure fix
979 crypt feature
985 if_ruby
986 test fix in Windows
987 if_ruby
988 build rule
990 Appveyor
992 build fix in Windows
994 tests for Windows
995 GTK GUI
996 GTK GUI
997 Travis CI
999 Makefile change
2015-12-31 10:05:37 +09:00
76bf21de26 vim-patch:7.4.605
Problem:    The # register is not writable, it cannot be restored after
            jumping around.
Solution:   Make the # register writable. (Marcin Szamotulski)

3b3a9498d1
2015-12-30 01:16:32 -05:00
d8a2007d47 Merge pull request #3869 from oni-link/fix.issue.3844
helpers.c: Handle msgpack str/bin objects with length 0 correctly
2015-12-30 01:01:23 -05:00
930ee40ad3 build: use our mirror of LuaJIT-2.0.4.tar.gz
The luajit.org download URL:
  http://luajit.org/download/LuaJIT-2.0.4.tar.gz
is breaking our travis builds because of connection problems.
2015-12-30 00:41:52 -05:00
541ba61ac9 Merge pull request #3874 from sethjackson/win-defs
MSVC: Define STDOUT_FILENO and STDERR_FILENO
2015-12-29 12:59:55 -05:00
6ee58e67cb Merge pull request #3879 from sethjackson/open-osfhandle
Windows: Fix cast in if_cscope.c
2015-12-26 17:42:50 +01:00
9040d7aed7 Merge pull request #3849 from Shougo/vim-7.4.675
vim-patch:7.4.675
2015-12-26 17:39:38 +01:00
f4e3c13bcc Merge pull request #3868 from Shougo/vim-7.4.608
vim-patch:7.4.608, 7.4.612
2015-12-26 17:27:40 +01:00
f0538639c0 Merge #2927 'vim-patch:7.4.858' 2015-12-25 08:34:40 -05:00
39555dc8c4 test: Makefile: add legacy cdo test 2015-12-25 08:34:07 -05:00
7f99d210fd vim-patch:7.4.858
Problem:    It's a bit clumsy to execute a command on a list of matches.
Solution:   Add the ":ldo", ":lfdo", ":cdo" and ":cfdo" commands. (Yegappan
            Lakshmanan)

aa23b37942
2015-12-24 08:08:50 +01:00
25eaacd10f doc: os_dos.txt: Remove more references to MS-DOS/Windows 95 #3889 2015-12-23 15:13:05 -05:00
91b8ab3d21 doc: Remove references to neXtaw GUI support #3892
We never supported it.
2015-12-22 19:14:11 -05:00
b654a2b324 doc: Fix invalid reference
found with `make -C runtime/doc html`
2015-12-22 18:50:10 -05:00
9649537f4c doc: mbyte.txt: Remove some low-hanging fruit
- Nvim has no concept of "huge" or "normal" features: the overwhelming
  majority of features are compiled in by default
- Nvim does not link to X (X11), so doesn't support setting things via
  ~/.Xresources, among many other things
2015-12-22 18:44:26 -05:00
47b9ac9013 doc: Remove references to Athena GUI support #3891
We don't support Athena anymore.
2015-12-22 18:39:51 -05:00
b9d1a7f810 doc: vi_diff: Update supported OS list #3890
We do not support every Unix flavor in existence so note
that here.

We do not support Windows 95 or NT. Update the list to
the Windows versions we do support.

We only support OS X not classic Mac OS so note that too.
2015-12-22 18:20:46 -05:00
944658e2e1 doc: Remove a reference to Windows ME #3888
We don't support Windows 95, Windows ME, or Windows 2000 anymore.
2015-12-22 15:52:27 -05:00
fbfe564b3c gitignore: Ignore errors.json
It's generated by `make lint`.
2015-12-22 15:22:21 -05:00
aa0af927da doc: os_win32: More cleanup #3884
Follow-up to ee1f8ea

Roger Knobbe is still mentioned in intro.txt, for anyone wondering.
2015-12-22 14:33:16 -05:00
5403924f7c doc: Remove some references to MS-DOS #3886
We don't support MS-DOS.
2015-12-22 14:14:28 -05:00
efb30a0068 Windows: Remove unused function #3878
The only call site was removed in 902ad8d.
2015-12-22 13:50:59 -05:00
c5d0c280d3 MSVC: Fix UI_CALL macro for MSVC.
The UI_CALL macro uses variadic macros and relies on the non standard
GCC extension. MSVC already applies similar behavior for the regular
__VA_ARGS__ removing the comma.
In MSVC UI_CALL can be implemented by calling UI_CALL_MORE directly.
2015-12-22 09:35:34 -05:00
ee1f8eab0c doc: Remove references to Windows 3.1 #3883 2015-12-21 22:48:57 -05:00
53a1db1a10 Windows: Fix cast in if_cscope.c. 2015-12-21 15:21:21 -05:00
eb53ec5ba2 MSVC: Define STDOUT_FILENO and STDERR_FILENO. 2015-12-21 00:01:16 -05:00
8373aaf44e helpers.c: Handle msgpack str/bin objects with length 0 correctly
When converting a msgpack object to a String object, strings (and byte
arrays) with length 0 are handled as errors. This is fixed by
always using the msgpack data pointer as a valid pointer. For a NULL
pointer there is nothing to copy.

Test by @snoe

Fixes #3844
2015-12-21 00:23:53 +01:00
376b973a0a Tests: fix according to lualint 2015-12-20 22:41:40 +01:00
e9161799bf Merge pull request #3867 from Shougo/vim-7.4.604
vim-patch:7.4.604
2015-12-20 15:31:45 -05:00
90537ae970 vim-patch:7.4.604
Problem:    Running tests changes viminfo.
Solution:   Disable viminfo.

6bf7c523ad
2015-12-19 12:58:01 +09:00
884c124130 vim-patch:7.4.608, 7.4.612
Problem:    test_eval fails when the clipboard feature is missing.
Solution:   Skip part of the test. Reduce the text used.

4ac163ae5f

Problem:    test_eval fails on Mac.
Solution:   Use the * register instead of the + register. (Jun Takimoto)

e08dd4e49e
2015-12-19 11:07:45 +09:00
e123675bcc Merge pull request #3722 from ZyX-I/fix-3721
shada: Continue dumping when variables failed to dump
2015-12-18 11:55:15 -05:00
ZyX
5c112c0cb9 shada: Free wms->hms in shada_write_exit
Otherwise there should be memory leak.
2015-12-18 19:29:49 +03:00
ZyX
ea67bf808b shada: Continue dumping when variables failed to dump
Closes #3721
2015-12-18 19:29:49 +03:00
f638572164 Merge pull request #3863 from justinmk/vim-8a94d87
vim-patch:8a94d87
2015-12-18 10:51:37 -05:00
65f11d0a00 vim-patch:8a94d87
Update runtime files.

8a94d873aa
2015-12-17 21:56:41 -05:00
1e7a553ed7 vim-patch.sh: force LC_ALL=C for preprocessing
Any patch may contain mixed encodings, so we must process them as byte
arrays. E.g. with stock `sed` on OS X patch
8a94d873aa8c753a8522ea86a049bdf2abd0c507 causes this error:
    sed: RE error: illegal byte sequence
To avoid that, set LC_ALL=C.

Also remove redundant *.patch creation from review_pr().
2015-12-17 21:28:54 -05:00
ecdf18edbb Merge pull request #3860 from justinmk/vim-0122c40
vim-patch:0122c40
2015-12-17 15:23:35 -05:00
cb0b89f8ba vim-patch:0122c40
Update runtime files.

0122c4070f
2015-12-17 05:14:40 -05:00
5b30ba7b99 Merge pull request #3859 from justinmk/vim-83caecf
vim-patch:83caecf
2015-12-17 05:06:07 -05:00
7581046b60 Merge pull request #3858 from justinmk/vim-9da7ff7
vim-patch:9da7ff7
2015-12-17 04:57:53 -05:00
1f27ccb77f vim-patch:83caecf
Updated runtime files.

83caecf314
2015-12-17 04:52:20 -05:00
aa4cc17bb0 vim-patch:9da7ff7
Updated runtime files.

9da7ff70cc
2015-12-17 04:40:15 -05:00
9d64d75031 vim-patch.sh: fix order of non-tagged patches
Sort non-tagged patches in descending order, like tagged patches.
2015-12-17 04:07:03 -05:00
b051f33814 Merge pull request #3851 from brcolow/vim-7.4.682
vim-patch:7.4.682
2015-12-16 23:44:02 -05:00
67f03f33a7 vim-patch:7.4.682
Problem: The search highlighting and match highlighting replaces the
cursorline highlighting, this doesn't look good.
Solution: Combine the highlighting. (Yasuhiro Matsumoto)

09deeb7c94
2015-12-16 13:13:04 -07:00
f9647d99b4 Merge pull request #3842 from sethjackson/cross-compile
Fix CMakeLists.txt search paths for cross compile
2015-12-16 10:18:15 -05:00
c42cb49a96 Merge pull request #3846 from sethjackson/win-defs
MSVC: Define S_IXUSR.
2015-12-16 10:12:49 -05:00
aa36af214a MSVC: Define S_IXUSR. 2015-12-16 05:46:49 -05:00
75cfd3c0ca Merge pull request #3848 from Shougo/vim-7.4.665
vim-patch:7.4.665
vim-patch:7.4.671
2015-12-15 21:54:22 -05:00
5cb01bafa8 Merge pull request #3847 from Pyrohh/move-uncrustify
Move uncrustify.cfg to contrib/
2015-12-15 21:24:37 -05:00
243b492c0d contrib: Move uncrustify.cfg to contrib/
It hasn't been used in quite a while, so it's probably safe to move it
out of the repository root.
2015-12-15 15:34:49 -05:00
e1abbe6b67 vim-patch:7.4.675
Problem:    When a FileReadPost autocommand moves the cursor inside a line it
            gets moved back.
Solution:   When checking whether an autocommand moved the cursor store the
            column as well. (Christian Brabandt)

eab316bdf9
2015-12-16 05:24:38 +09:00
4cc38e04c7 vim-patch:7.4.665, 671
Problem:    'linebreak' does not work properly with multi-byte characters.
Solution:   Compute the pointer offset with mb_head_off().  (Yasuhiro
            Matsumoto)

76feaf1bfe

Problem:    Warning for shadowing a variable.
Solution:   Rename off to mb_off. (Kazunobu Kuriyama)

4df702999d
2015-12-16 05:18:25 +09:00
8be2ab11de Fix CMakeLists.txt search paths for cross compile 2015-12-15 13:53:46 -05:00
1946f96a16 Merge pull request #3841 from sethjackson/fname-illegal
Windows: define FNAME_ILLEGAL
2015-12-14 23:27:27 -05:00
e117544d72 Windows: define FNAME_ILLEGAL. 2015-12-14 17:45:35 -05:00
77c0f9a62b Merge #3623 'vim-patch:7.4.{670,723,803}' 2015-12-13 14:18:05 -05:00
ad34a376eb Fix linting errors. 2015-12-13 13:06:48 +01:00
c3ac16cfeb Solve warnings. 2015-12-13 13:06:48 +01:00
3b472e55b3 vim-patch:7.4.803
Problem:    C indent does not support C11 raw strings. (Mark Lodato)
Solution:   Do not change indent inside the raw string.

f7bb86dc59
2015-12-13 13:06:48 +01:00
b079622716 Appease clint. 2015-12-13 13:06:48 +01:00
238a8d33fa vim-patch:7.4.723
Problem:    For indenting, finding the C++ baseclass can be slow.
Solution:   Cache the result. (Hirohito Higashi)

4032cfdf17
2015-12-13 13:06:39 +01:00
123361f187 vim-patch:7.4.670
Problem:    Using 'cindent' for Javascript is less than perfect.
Solution:   Improve indenting of continuation lines. (Hirohito Higashi)

dcefba9934
2015-12-13 11:55:37 +01:00
8a34d21b0d Merge pull request #3706 from Pyrohh/version_commit
Remove "Commit:" field from `--version` output
2015-12-13 03:00:09 -05:00
7387816dcb Merge pull request #3481 from fabiopozzi/improve-it-translation
l10n: it translation
2015-12-13 02:14:26 -05:00
f406ae412e Merge pull request #3838 from Shougo/vim-7.4.658
vim-patch:7.4.658
2015-12-13 01:47:34 -05:00
c3e4e0e383 Merge pull request #3837 from Shougo/vim-7.4.645
vim-patch:7.4.645
2015-12-13 01:45:17 -05:00
cd1be8350d Merge pull request #3834 from Shougo/vim-7.4.635
vim-patch:7.4.635
2015-12-13 01:42:34 -05:00
0488fea0de vim-patch:7.4.635
Problem:    If no NL or CR is found in the first block of a file then the
            'fileformat' may be set to "mac". (Issue 77)
Solution:   Check if a CR was found. (eswald)

05eb612ff3
2015-12-13 15:06:35 +09:00
3c9d8ac99e Merge #3718 'vim-patch:7.4.655' 2015-12-13 00:35:09 -05:00
014d692013 Merge pull request #3835 from Shougo/vim-7.4.640
vim-patch:7.4.640
2015-12-13 00:31:30 -05:00
28821397f6 Merge pull request #3836 from sethjackson/set-init-3
Windows: Remove broken check for WIN3264
2015-12-13 00:24:44 -05:00
1b6e7f9e39 test: fixeol_spec: setup/teardown
Without this cleanup, test will fail if run multiple times.
2015-12-13 00:21:11 -05:00
aca51f3d93 Merge #3443 'vim-patch:7.4.{785,795,898}' 2015-12-13 00:09:07 -05:00
a9b4cedb08 Windows: Remove broken check for WIN3264.
We do not define WIN3264 so this check was broken.

Futher since UNIX is defined on all Unix platforms
we support we can simply remove this #ifdef.
2015-12-12 23:30:43 -05:00
815fe24604 vim-patch:7.4.658
Problem:    'formatexpr' is evaluated too often.
Solution:   Only invoke it when beyond the 'textwidth' column, as it is
            documented. (James McCoy)

0f8dd840fc
2015-12-13 13:10:31 +09:00
d1ec3f661a vim-patch:7.4.645
Problem:    When splitting the window in a BufAdd autocommand while still in
            the first, empty buffer the window count is wrong.
Solution:   Do not reset b_nwindows to zero and don't increment it.

8da9bbfd02
2015-12-13 13:01:46 +09:00
ebdb802bf5 Merge pull request #3816 from sethjackson/win-setenv
Windows: Implement os_setenv()
2015-12-12 22:57:02 -05:00
f1b9a59ed6 vim-patch:7.4.640
Problem:    After deleting characters in Insert mode such that lines are
            joined undo does not work properly. (issue 324)
Solution:   Use Insstart instead of Insstart_orig. (Christian Brabandt)

c3bbad085c
2015-12-13 12:53:30 +09:00
810d31a430 Windows: Implement os_setenv() using _putenv_s()
Windows does not have setenv(), instead the _putenv_s() function is used - added
a function check and fatal errors. Implemented os_setenv() for Windows.

Vim supports the original putenv() function if no alternative is available.
Neovim only supports systems where safer alternatives exist, so the check for
putenv() was removed from config/CMakeLists.txt.
2015-12-12 22:33:10 -05:00
f183cc14de doc: nvim_python: mention --upgrade. #3832 2015-12-12 20:56:17 -05:00
5c4a5d0677 Merge pull request #3589 from ZyX-I/remove-internal_refcount
eval: Replace internal_refcount hack with proper copyID setting
2015-12-12 20:41:00 -05:00
291a43e1dd Fix indenting nested elseifs
Currently,
```
if bool then
  --stuff
elseif bool2 then
  --morestuff
elseif bool3 then
  --more stuff
else
  --fail
end
```

Would get indented out strangely when using =. Now it behaves correctly.
2015-12-12 17:07:25 -08:00
ZyX
5b96d370df eval: Use list_unref in place of decrementing refcount directly 2015-12-13 03:44:54 +03:00
ZyX
1cf7de074b eval: Replace internal_refcount hack with proper copyID setting 2015-12-13 03:44:53 +03:00
cc203e4b93 Merge pull request #3753 from watiko/vim-7.4.790
Vim 7.4.{786,787,789,790}
2015-12-12 17:43:23 -05:00
f37ad6af36 Merge pull request #3807 from ZyX-I/improve-clint
Make clint.py better follow our style guide
2015-12-12 17:32:05 -05:00
ZyX
a35c45732c shada: Fix all linter errors in src/nvim/shada.*
This commit is an example of fixing incorrect code which previously passed
through linter.
2015-12-13 00:47:46 +03:00
2b12406f2e Merge pull request #3824 from sethjackson/pstrcmp
Windows: Remove UNIX guard for pstrcmp()
2015-12-12 14:45:46 -05:00
3b74ee1ce9 Merge pull request #3825 from sethjackson/modname
Windows: Remove unnecessary codepath from modname
2015-12-12 14:32:46 -05:00
158dc2b7a7 Merge pull request #3826 from sethjackson/remove-getscript
Remove getscript.vim
2015-12-12 11:38:23 -05:00
5262cf2f19 Remove getscript.vim. 2015-12-12 09:18:51 -05:00
7f8365e302 Windows: Remove unnecessary codepath from modname.
File names starting with periods are perfectly acceptable on Windows
file systems. The only place where this is not acceptable is on
MS-DOS FAT file systems which only support 8.3 file names.

See here:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx

Since Neovim does not support MS-DOS or 8.3 file names (#605)
we can drop this codepath.

It was not compiling anyways since we do not define WIN3264.
2015-12-11 20:26:38 -05:00
fe143ac439 Windows: Remove UNIX guard for pstrcmp()
@equalsraf: I took a look at the Vim source pstrcmp() is actually used in the
dos_expandpath(misc1.c). The only difference between the UNIX and WIN32 version
of the functions is the _cdecl call convention annotation - the body of the
function is identical. Neovim kept the comment from the Unix function but not
from the Windows variant. Seems to me its safe to use the same function for
both - and just correct the comment.
2015-12-11 19:10:06 -05:00
1b56425662 Make clint status valid 2015-12-12 08:15:34 +09:00
74341ca5ca Fix the memory leaking 2015-12-12 05:28:27 +09:00
8c684b2fdb Revert char to char_u 2015-12-12 04:26:22 +09:00
a3a8df8359 tests: Improve legacy autocmd_option.
* Compare tables instead of strings
 * Add neovim specific test
2015-12-12 03:34:17 +09:00
ZyX
e796632240 clint: Check indentation and alignment inside expressions 2015-12-11 19:08:46 +03:00
81960df9f5 statusline: Check width before advancing pointer. #3818
Closes #3763

Helped-by: oni-link <knil.ino@gmail.com>
2015-12-10 03:19:02 -05:00
fcf829963e Merge pull request #3813 from Shougo/remote
Fix UpdateRemotePlugins fails problem
2015-12-09 23:26:19 -05:00
bf65b3ab45 Merge pull request #3804 from sethjackson/signal-guards
Add guards for SIGPIPE and SIGQUIT
2015-12-09 23:17:07 -05:00
87abe073d9 Merge pull request #3783 from sethjackson/log-file-def
Update USR_LOG_FILE definition.
2015-12-09 21:29:49 -05:00
ZyX
74c960007f clint: Check for spaces after { and before } 2015-12-09 19:55:34 +03:00
ZyX
4c0ac1ca26 clint: Do not special-case for() semicolons 2015-12-09 18:37:13 +03:00
f338fee482 Fix UpdateRemotePlugins fails problem 2015-12-10 00:09:55 +09:00
f40c8c4c23 Merge pull request #3805 from sethjackson/windows-home
Windows: Define HOME environment variable
2015-12-09 09:52:48 -05:00
3abbdb2f41 Windows: Define HOME environment variable
- Bring back Vim code for settings $HOME in Windows from
  $HOMEDRIVE$HOMEPATH
- vim-patch:0
2015-12-08 22:55:40 -05:00
ZyX
86c0bd14ec clint: Disallow old style comments everywhere, except for macros 2015-12-08 13:54:20 +03:00
ZyX
77836ff01b clint: Make sure that braces are always used for if and other clauses 2015-12-08 13:22:31 +03:00
67a7b1785c Add guards for SIGPIPE and SIGQUIT
In some systems the signals SIGPIPE and SIGQUIT are not available.
2015-12-08 00:17:34 -05:00
0ab4f2f18f Update USR_LOG_FILE definition. 2015-12-07 19:26:26 -05:00
6d583f8587 Merge pull request #3780 from sethjackson/header-guards
Add missing guard for HAVE_UNISTD_H
2015-12-07 03:16:03 -05:00
f838755fc0 Merge pull request #3782 from sethjackson/mingw-luajit
MinGW: Add libluajit-5.1 lib name to FindLuaJit
2015-12-07 03:14:54 -05:00
618c8d0e82 Merge pull request #3793 from mhinz/docs/remove-shell-cmd
Docs: remove references to removed :shell command
2015-12-06 10:15:13 -05:00
b6b84cb94f Docs: remove reference to removed :shell command
References #3791.
2015-12-06 14:21:22 +01:00
3a60f927b8 Improve coding style 2015-12-06 07:41:09 +09:00
7be12edd38 Remove "Commit:" field from --version output
If nvim is built from a non-tagged commit, the truncated commit hash is
already appended to the main version string (e.g., "NVIM v0.1.0-83-g959f260 ..."),
making the "Commit:" field redundant.

Regarding the truncated hash length: we don't have nearly enough commits
to worry about collisions, and probably won't ever, so the default
length should be fine.
2015-12-05 16:15:32 -05:00
655f1b7513 MinGW: Add libluajit-5.1 lib name to FindLuaJit 2015-12-02 23:07:22 -05:00
07eaff7c26 Add missing guard for HAVE_UNISTD_H 2015-12-02 19:54:33 -05:00
8c00c34b91 tests: Keep each autocmd_option's test in isolation. 2015-11-28 20:15:28 +09:00
597547e797 Use vim_snprintf instead of sprintf 2015-11-28 20:15:28 +09:00
972b43459b Improve coding style 2015-11-28 19:48:17 +09:00
cf673f60c6 Improve coding style 2015-11-28 18:24:57 +09:00
d9c0293824 tests: Improve legacy test autocmd_option. 2015-11-28 17:22:53 +09:00
21956adb6e tests: Migrate legacy test autocmd_option. 2015-11-28 17:22:53 +09:00
fe9d91ceb6 vim-patch:7.4.790
Problem:    Test fails when the autochdir feature is not available.  Test
            output contains the test script.
Solution:   Check for the autochdir feature. (Kazunobu Kuriyama)  Only write
            the relevant test output.

d113a80c77
2015-11-28 17:22:53 +09:00
09f6066bb4 vim-patch:7.4.789
Problem:    Using freed memory and crash. (Dominique Pellej)
Solution:   Correct use of pointers. (Hirohito Higashi)

9cac424d05
2015-11-28 17:22:52 +09:00
789041c282 vim-patch:7.4.787
Problem:    snprintf() isn't available everywhere.
Solution:   Use vim_snprintf(). (Ken Takata)

fb9bc4829a
2015-11-28 17:22:52 +09:00
119545190c vim-patch:7.4.786
Problem:    It is not possible for a plugin to adjust to a changed setting.
Solution:   Add the OptionSet autocommand event. (Christian Brabandt)

537443018d
2015-11-28 17:22:28 +09:00
98f9ff730b vim-patch:7.4.898
Problem:    The 'fixendofline' option is set on with ":edit".
Solution:   Don't set the option when clearing a buffer. (Yasuhiro Matsumoto)

04dfd51229
2015-11-22 20:06:07 +01:00
8d07058097 vim-patch:7.4.795
Problem:    The 'fixeol' option is not copied to a new window.
Solution:   Copy the option value. (Yasuhiro Matsumoto)

b388be0abf
2015-11-22 20:03:41 +01:00
b1d7b5294a Convert legacy test for fixeol to lua test. 2015-11-22 20:03:41 +01:00
a86d4b323e vim-patch:7.4.785
Problem:    On some systems automatically adding the missing EOL causes
            problems. Setting 'binary' has too many side effects.
Solution:   Add the 'fixeol' option, default on. (Pavel Samarkin)

34d72d4b6c
2015-11-22 20:03:41 +01:00
cfa2107e33 vim-patch:7.4.655
Problem:    Text deleted by "dit" depends on indent of closing tag.
            (Jan Parthey)
Solution:   Do not adjust oap->end in do_pending_operator(). (Christian
            Brabandt)

b6c2735c56
2015-11-22 02:52:50 +01:00
c9067dbe8a build: fix '-fno-sanitize-recover' warning in Clang 3.7 2015-11-03 14:19:04 +08:00
36af4af27a Improved it translation: make check-po-it now OK.
Fixed some fuzzy translation matches.
Fixed all make check-po-it errors, now it builds OK.
2015-10-20 22:01:58 +02:00
2144 changed files with 354645 additions and 219121 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

@ -1,10 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
if [[ -n "${CI_TARGET}" ]]; then
exit
fi
coveralls --gcov "$(which "${GCOV}")" --encoding iso-8859-1 || echo 'coveralls upload failed.'

View File

@ -1,22 +0,0 @@
#!/usr/bin/env bash
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"
# 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"
touch "${CACHE_MARKER}"
echo "Updated third-party dependencies (timestamp: $(stat -c '%y' "${CACHE_MARKER}"))."
fi

View File

@ -1,28 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
if [[ -n "${CI_TARGET}" ]]; then
exit
fi
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
brew update
fi
echo "Upgrade Python 2's pip."
pip2.7 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
else
# TODO: Replace with upgrade when Travis gets python3-pip package.
echo "Install pip for Python 3."
curl -sSL https://bootstrap.pypa.io/get-pip.py -o "${HOME}/get-pip.py"
# After this, pip in PATH will refer to Python 3's pip.
python3.3 "${HOME}/get-pip.py" --user --upgrade
fi

View File

@ -1,87 +0,0 @@
build_deps() {
if [[ "${BUILD_32BIT}" == ON ]]; then
if [[ "${BUILD_MINGW}" == ON ]]; then
>&2 echo "32-bit MinGW builds not supported."
exit 1
fi
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
fi
if [[ "${BUILD_MINGW}" == ON ]]; then
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_MINGW}"
fi
rm -rf "${DEPS_BUILD_DIR}"
# 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}"))."
mkdir -p "$(dirname "${DEPS_BUILD_DIR}")"
mv -T "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}"
else
mkdir -p "${DEPS_BUILD_DIR}"
fi
# Even if we're using cached dependencies, run CMake and make to
# 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/"
if ! ${MAKE_CMD}; then
exit 1
fi
cd "${TRAVIS_BUILD_DIR}"
}
build_nvim() {
if [[ -n "${CLANG_SANITIZER}" ]]; then
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
fi
if [[ "${BUILD_32BIT}" == ON ]]; then
if [[ "${BUILD_MINGW}" == ON ]]; then
>&2 echo "32-bit MinGW builds not supported."
exit 1
fi
CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
fi
if [[ "${BUILD_MINGW}" == ON ]]; then
CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_MINGW}"
fi
mkdir -p "${BUILD_DIR}"
cd "${BUILD_DIR}"
echo "Configuring with '${CMAKE_FLAGS}'."
cmake ${CMAKE_FLAGS} "${TRAVIS_BUILD_DIR}"
echo "Building nvim."
if ! ${MAKE_CMD} nvim; then
exit 1
fi
if [ "$CLANG_SANITIZER" != "TSAN" ]; then
echo "Building libnvim."
if ! ${MAKE_CMD} libnvim; then
exit 1
fi
echo "Building nvim-test."
if ! ${MAKE_CMD} nvim-test; then
exit 1
fi
fi
# Invoke nvim to trigger *San early.
if ! (bin/nvim --version && bin/nvim -u NONE -e -c ':qall'); then
asan_check "${LOG_DIR}"
exit 1
fi
asan_check "${LOG_DIR}"
cd "${TRAVIS_BUILD_DIR}"
}

View File

@ -1,104 +0,0 @@
check_core_dumps() {
sleep 2
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
local cores="$(find /cores/ -type f -print)"
local dbg_cmd="lldb -Q -o bt -f ${BUILD_DIR}/bin/nvim -c"
else
# FIXME (fwalch): Will trigger if a file named core.* exists outside of $DEPS_BUILD_DIR.
local cores="$(find ./ -type f -not -path "*${DEPS_BUILD_DIR}*" -name 'core.*' -print)"
local dbg_cmd="gdb -n -batch -ex bt ${BUILD_DIR}/bin/nvim"
fi
if [ -z "${cores}" ]; then
return
fi
for core in $cores; do
${dbg_cmd} "${core}"
done
exit 1
}
check_logs() {
# Iterate through each log to remove an useless warning.
for log in $(find "${1}" -type f -name "${2}"); do
sed -i "${log}" \
-e '/Warning: noted but unhandled ioctl/d' \
-e '/could cause spurious value errors to appear/d' \
-e '/See README_MISSING_SYSCALL_OR_IOCTL for guidance/d'
done
# Now do it again, but only consider files with size > 0.
local err=""
for log in $(find "${1}" -type f -name "${2}" -size +0); do
cat "${log}"
err=1
done
if [[ -n "${err}" ]]; then
echo "Runtime errors detected."
exit 1
fi
}
valgrind_check() {
check_logs "${1}" "valgrind-*"
}
asan_check() {
check_logs "${1}" "*san.*"
}
run_unittests() {
${MAKE_CMD} -C "${BUILD_DIR}" unittest
}
run_functionaltests() {
if ! ${MAKE_CMD} -C "${BUILD_DIR}" functionaltest; then
asan_check "${LOG_DIR}"
valgrind_check "${LOG_DIR}"
exit 1
fi
asan_check "${LOG_DIR}"
valgrind_check "${LOG_DIR}"
}
run_oldtests() {
if ! make -C "${TRAVIS_BUILD_DIR}/src/nvim/testdir"; then
reset
asan_check "${LOG_DIR}"
valgrind_check "${LOG_DIR}"
exit 1
fi
asan_check "${LOG_DIR}"
valgrind_check "${LOG_DIR}"
}
install_nvim() {
${MAKE_CMD} -C "${BUILD_DIR}" install
"${INSTALL_PREFIX}/bin/nvim" --version
"${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' || {
echo "Running ':help' in the installed nvim failed."
echo "Maybe the helptags have not been generated properly."
exit 1
}
# Check that all runtime files were installed
for file in doc/tags syntax/vim/generated.vim $(
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
echo "It appears that $file is not installed."
exit 1
fi
done
for file in $(
cd runtime ; git ls-files | grep -e '.awk$' -e '.sh$' -e '.bat$'
) ; do
if ! test -x "${INSTALL_PREFIX}/share/nvim/runtime/$file" ; then
echo "It appears that $file is not installed or is not executable."
exit 1
fi
done
}

View File

@ -1,30 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
if [[ -n "${CI_TARGET}" ]]; then
exit
fi
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
brew install gettext
elif [[ "${BUILD_MINGW}" == ON ]]; then
# TODO: When Travis gets a recent version of Mingw-w64 use packages:
# binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-dev mingw-w64-tools
echo "Downloading MinGW..."
curl -sSL "http://downloads.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/gcc-4.8-release/i686-w64-mingw32-gcc-4.8.0-linux64_rubenvb.tar.xz" | tar xJf - -C "${HOME}/.local"
fi
# Set CC to default 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
echo "Install neovim module for Python 3."
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
CC=cc pip3 install --user --upgrade neovim
else
CC=cc pip3.3 install --user --upgrade neovim
fi

View File

@ -1,30 +0,0 @@
#!/usr/bin/env bash
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"
build_nvim
if [ "$CLANG_SANITIZER" != "TSAN" ]; then
# Additional threads are only created when the builtin UI starts, which
# doesn't happen in the unit/functional tests
run_unittests
run_functionaltests
fi
run_oldtests
install_nvim
touch "${SUCCESS_MARKER}"

20
.clang-format Normal file
View File

@ -0,0 +1,20 @@
BasedOnStyle: Google
Language: Cpp
ColumnLimit: 80
IndentWidth: 2
TabWidth: 2
UseTab: Never
IndentCaseLabels: true
BreakBeforeBraces: Linux
AlignEscapedNewlinesLeft: false
AllowShortFunctionsOnASingleLine: false
AlignTrailingComments: true
SpacesBeforeTrailingComments: 2
PenaltyReturnTypeOnItsOwnLine: 200
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
BinPackParameters: false
BreakBeforeBinaryOperators: true
BreakBeforeTernaryOperators: true
ContinuationIndentWidth: 4

12
.editorconfig Normal file
View File

@ -0,0 +1,12 @@
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
charset = utf-8
[{Makefile,**/Makefile,runtime/doc/*.txt}]
indent_style = tab
indent_size = 8

43
.gitignore vendored
View File

@ -1,11 +1,15 @@
# Tools
.ropeproject/
# Visual Studio
/.vs/
# Build/deps dir
/build/
/cmake-build-debug/
/dist/
/.deps/
/tmp/
*.rej
*.orig
*.mo
.*.sw?
*~
@ -18,16 +22,18 @@ tags
/src/nvim/po/vim.pot
/src/nvim/po/*.ck
# Files generated by scripts/vim-patch.sh
# Generated by tests with $NVIM_LOG_FILE set.
/.nvimlog
# Generated by scripts/vim-patch.sh
/.vim-src/
# Files generated by the tests
# Generated by old (Vim) 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
@ -35,35 +41,16 @@ tags
/src/nvim/testdir/valgrind.*
/src/nvim/testdir/.gdbinit
# Folder generated by the unit tests
# Generated by unit tests.
/test/includes/post/
# generated by luacheck during `make testlint'
# Generated by luacheck during `make testlint'
/test/.luacheckcache
# 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

View File

@ -1,19 +1,11 @@
sudo: false
dist: xenial
language: c
env:
global:
# To force rebuilding of third-party dependencies, set this to 'true'.
- BUILD_NVIM_DEPS=false
# 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)"
# Force verification of DLOG macros.
- CFLAGS="-DMIN_LOG_LEVEL=0"
# Set "false" to force rebuild of third-party dependencies.
- CACHE_ENABLE=true
# Build directory for Neovim.
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
# Build directory for third-party dependencies.
@ -24,116 +16,126 @@ env:
- INSTALL_PREFIX="$HOME/nvim-install"
# Log directory for Clang sanitizers and Valgrind.
- LOG_DIR="$BUILD_DIR/log"
# Nvim log file.
- NVIM_LOG_FILE="$BUILD_DIR/.nvimlog"
# Default CMake flags.
- CMAKE_FLAGS="-DTRAVIS_CI_BUILD=ON
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
-DUSE_GCOV=ON
-DBUSTED_OUTPUT_TYPE=gtest
-DDEPS_PREFIX=$DEPS_BUILD_DIR/usr"
- DEPS_CMAKE_FLAGS="-DDEPS_DOWNLOAD_DIR:PATH=$DEPS_DOWNLOAD_DIR"
-DBUSTED_OUTPUT_TYPE=nvim
-DDEPS_PREFIX=$DEPS_BUILD_DIR/usr
-DMIN_LOG_LEVEL=3"
- DEPS_CMAKE_FLAGS="-DDEPS_DOWNLOAD_DIR:PATH=$DEPS_DOWNLOAD_DIR -DUSE_BUNDLED_GPERF=OFF"
# Additional CMake flags for 32-bit builds.
- CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32
-DCMAKE_IGNORE_PATH=/lib:/usr/lib:/usr/local/lib
-DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
# Additional CMake flags for MinGW builds.
- CMAKE_FLAGS_MINGW="-DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/mingw32-w64-cross-travis.toolchain.cmake"
# Environment variables for Clang sanitizers.
- ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:log_path=$LOG_DIR/asan"
- ASAN_SYMBOLIZER_PATH="$LLVM_SYMBOLIZER"
- MSAN_SYMBOLIZER_PATH="$LLVM_SYMBOLIZER"
- TSAN_OPTIONS="external_symbolizer_path=$LLVM_SYMBOLIZER log_path=$LOG_DIR/tsan"
- UBSAN_OPTIONS="log_path=$LOG_DIR/ubsan"
- TSAN_OPTIONS="log_path=$LOG_DIR/tsan"
- UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan"
- ASAN_SYMBOLIZE=asan_symbolize
# Environment variables for Valgrind.
- VALGRIND_LOG="$LOG_DIR/valgrind-%p.log"
# Cache marker for third-party dependencies cache.
# If this file exists, we know that the cache contains compiled
# dependencies and we can use it.
# If this file exists, the cache is valid (compile was successful).
- CACHE_MARKER="$HOME/.cache/nvim-deps/.travis_cache_marker"
# Test success marker. If this file exists, we know that all tests
# were successful. Required because we only want to update the cache
# if the tests were successful, but don't have this information
# available in before_cache (which is run before after_success).
- SUCCESS_MARKER="$BUILD_DIR/.tests_successful"
# default target name for functional tests
- FUNCTIONALTEST=functionaltest
- CI_TARGET=tests
# Environment variables for ccache
- CCACHE_COMPRESS=1
- CCACHE_SLOPPINESS=time_macros,file_macro
- CCACHE_BASEDIR="$TRAVIS_BUILD_DIR"
matrix:
jobs:
include:
- stage: normal builds
os: linux
compiler: clang-4.0
# Use Lua so that ASAN can test our embedded Lua support. 8fec4d53d0f6
env: >
CLANG_SANITIZER=ASAN_UBSAN
CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
ASAN_SYMBOLIZE=asan_symbolize-4.0
- os: linux
env: CI_TARGET=clint
compiler: gcc
env: >
FUNCTIONALTEST=functionaltest-lua
CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
- os: linux
compiler: gcc-5
env: GCOV=gcov-5
- os: linux
# Travis creates a cache per compiler.
# Set a different value here to store 32-bit
# dependencies in a separate cache.
compiler: gcc-5 -m32
env: GCOV=gcov-5 BUILD_32BIT=ON
- os: linux
compiler: clang-3.6
env: GCOV=llvm-cov-3.6 CLANG_SANITIZER=ASAN_UBSAN
- os: linux
compiler: clang-3.6
env: GCOV=llvm-cov-3.6 CLANG_SANITIZER=MSAN
- os: linux
compiler: clang-3.6
env: CLANG_SANITIZER=TSAN
# Travis creates a cache per compiler. Set a different value here to
# store 32-bit dependencies in a separate cache.
compiler: gcc
env: BUILD_32BIT=ON
- os: osx
compiler: clang
env: GCOV=gcov
osx_image: xcode9.4 # macOS 10.13
- os: osx
compiler: gcc-4.9
env: GCOV=gcov-4.9
compiler: gcc
osx_image: xcode9.4 # macOS 10.13
- if: branch = master
os: linux
env: CI_TARGET=lint
- stage: Flaky builds
os: linux
compiler: gcc
env: GCOV=gcov CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
- os: linux
env: BUILD_MINGW=ON
fast_finish: true
compiler: clang
env: CLANG_SANITIZER=TSAN
allow_failures:
# TODO: Remove when all MSan errors have been fixed.
- env: GCOV=llvm-cov-3.6 CLANG_SANITIZER=MSAN
- env: GCOV=gcov CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
- env: CLANG_SANITIZER=TSAN
fast_finish: true
before_install: .ci/before_install.sh
install: .ci/install.sh
before_script: .ci/before_script.sh
script: .ci/script.sh
before_cache: .ci/before_cache.sh
after_success: .ci/after_success.sh
before_install: ci/before_install.sh
install: ci/install.sh
before_script: ci/before_script.sh
script: ci/script.sh
before_cache: ci/before_cache.sh
addons:
apt:
sources:
# TODO: Remove PPA when Travis gets Python >=3.3.
- deadsnakes
- llvm-toolchain-precise-3.6
- ubuntu-toolchain-r-test
packages:
- apport
- autoconf
- automake
- build-essential
- clang-3.6
- clang-4.0
- cmake
- g++-5-multilib
- cscope
- g++-multilib
- gcc-5-multilib
- gcc-multilib
- gdb
- gperf
- language-pack-tr
- libc6-dev-i386
- libtool
- llvm-3.6-dev
- libtool-bin
- locales
- ninja-build
- pkg-config
- python3.3-dev
- unzip
- valgrind
- xclip
homebrew:
update: true
packages:
- ccache
- ninja
branches:
except:
- nightly
only:
- master
- /^release-\d+\.\d+$/
cache:
apt: true
ccache: true
directories:
- "$HOME/.cache/pip"
- "$HOME/.cache/nvim-deps"
- "$HOME/.cache/nvim-deps-downloads"
notifications:
webhooks:

4
BSDmakefile Normal file
View File

@ -0,0 +1,4 @@
.DONE:
@echo "Please use GNU Make (gmake) to build neovim"
.DEFAULT:
@echo "Please use GNU Make (gmake) to build neovim"

View File

@ -1,13 +1,65 @@
cmake_minimum_required(VERSION 2.8.7)
project(NEOVIM)
# CMAKE REFERENCE
# intro: https://codingnest.com/basic-cmake/
# best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1
cmake_minimum_required(VERSION 2.8.12)
project(nvim C)
if(POLICY CMP0059)
# Needed for use of DEFINITIONS variable, which is used to collect the
# compilation flags for reporting in "nvim --version"
# https://github.com/neovim/neovim/pull/8558#issuecomment-398033140
cmake_policy(SET CMP0059 OLD)
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)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Prefer our bundled versions of dependencies.
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding dependencies")
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
if(DEFINED ENV{DEPS_BUILD_DIR})
set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/usr" CACHE PATH "Path prefix for finding dependencies")
else()
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding dependencies")
# When running from within CLion or Visual Studio,
# build bundled dependencies automatically.
if(NOT EXISTS ${DEPS_PREFIX}
AND (DEFINED ENV{CLION_IDE}
OR DEFINED ENV{VisualStudioEdition}))
message(STATUS "Building dependencies...")
set(DEPS_BUILD_DIR ${PROJECT_BINARY_DIR}/.deps)
file(MAKE_DIRECTORY ${DEPS_BUILD_DIR})
execute_process(
COMMAND ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG}
-DCMAKE_C_FLAGS_MINSIZEREL=${CMAKE_C_FLAGS_MINSIZEREL}
-DCMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO}
-DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
${PROJECT_SOURCE_DIR}/third-party
WORKING_DIRECTORY ${DEPS_BUILD_DIR})
execute_process(
COMMAND ${CMAKE_COMMAND} --build ${DEPS_BUILD_DIR}
--config ${CMAKE_BUILD_TYPE})
set(DEPS_PREFIX ${DEPS_BUILD_DIR}/usr)
endif()
endif()
if(CMAKE_CROSSCOMPILING AND NOT UNIX)
list(INSERT CMAKE_FIND_ROOT_PATH 0 ${DEPS_PREFIX})
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX}/../host/bin)
else()
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
endif()
# used for check_c_compiler_flag
include(CheckCCompilerFlag)
@ -27,45 +79,58 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
endif()
endif()
# Enable fixing case-insensitive filenames for Mac.
if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# Enable fixing case-insensitive filenames for Windows and Mac.
set(USE_FNAME_CASE TRUE)
endif()
option(ENABLE_LIBINTL "enable libintl" ON)
option(ENABLE_LIBICONV "enable libiconv" ON)
if (MINGW)
# Disable LTO by default as it may not compile
# See https://github.com/Alexpux/MINGW-packages/issues/3516
# and https://github.com/neovim/neovim/pull/8654#issuecomment-402316672
option(ENABLE_LTO "enable link time optimization" OFF)
else()
option(ENABLE_LTO "enable link time optimization" ON)
endif()
# Set default build type.
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "CMAKE_BUILD_TYPE not given, defaulting to 'Debug'")
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build" FORCE)
endif()
# Set available build types for CMake GUIs.
# A different build type can still be set by -DCMAKE_BUILD_TYPE=...
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
STRINGS "Debug" "Dev" "Release" "MinSizeRel" "RelWithDebInfo")
STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
# Set default build type.
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "CMAKE_BUILD_TYPE not given, defaulting to 'Dev'.")
set(CMAKE_BUILD_TYPE "Dev" CACHE STRING "Choose the type of build." FORCE)
endif()
# Version tokens
# - In a git repo, these tokens are _ignored_.
# - If the current HEAD is tagged, the tag name is used.
# - Otherwise the result of `git describe` is used.
# - If not in a git repo (e.g. a tarball) these tokens set the version string.
# If not in a git repo (e.g., a tarball) these tokens define the complete
# version string, else they are combined with the result of `git describe`.
set(NVIM_VERSION_MAJOR 0)
set(NVIM_VERSION_MINOR 1)
set(NVIM_VERSION_PATCH 1)
set(NVIM_VERSION_MINOR 3)
set(NVIM_VERSION_PATCH 6)
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
# API level
set(NVIM_API_LEVEL 5) # Bump this after any API change.
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
set(NVIM_API_PRERELEASE false)
file(TO_CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR}/.git FORCED_GIT_DIR)
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT)
if(NVIM_VERSION_COMMIT) # is a git repo
git_get_exact_tag(NVIM_VERSION_MEDIUM)
if(NVIM_VERSION_MEDIUM) # is a tagged release
unset(NVIM_VERSION_COMMIT)
else() # is a dev build
git_describe(NVIM_VERSION_MEDIUM)
get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT)
endif()
if(NVIM_VERSION_COMMIT) # is a git repo
git_describe(NVIM_VERSION_MEDIUM)
# `git describe` annotates the most recent tagged release; for pre-release
# builds we must replace that with the unreleased version.
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+"
"v${NVIM_VERSION_MAJOR}.${NVIM_VERSION_MINOR}.${NVIM_VERSION_PATCH}"
NVIM_VERSION_MEDIUM
${NVIM_VERSION_MEDIUM})
endif()
set(NVIM_VERSION_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
@ -75,69 +140,46 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Default to -O2 on release builds.
if(CMAKE_C_FLAGS_RELEASE MATCHES "-O3")
message(STATUS "Replacing -O3 in CMAKE_C_FLAGS_RELEASE with -O2.")
message(STATUS "Replacing -O3 in CMAKE_C_FLAGS_RELEASE with -O2")
string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
endif()
# Disable logging for release-type builds.
if(NOT CMAKE_C_FLAGS_RELEASE MATCHES DDISABLE_LOG)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DDISABLE_LOG")
# Minimize logging for release-type builds.
if(NOT CMAKE_C_FLAGS_RELEASE MATCHES DMIN_LOG_LEVEL)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DMIN_LOG_LEVEL=3")
endif()
if(NOT CMAKE_C_FLAGS_MINSIZEREL MATCHES DDISABLE_LOG)
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DDISABLE_LOG")
if(NOT CMAKE_C_FLAGS_MINSIZEREL MATCHES DMIN_LOG_LEVEL)
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DMIN_LOG_LEVEL=3")
endif()
if(NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DDISABLE_LOG)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDISABLE_LOG")
if(NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DMIN_LOG_LEVEL)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DMIN_LOG_LEVEL=3")
endif()
# Enable assertions for RelWithDebInfo.
if(CMAKE_COMPILER_IS_GNUCC)
check_c_compiler_flag(-Og HAS_OG_FLAG)
else()
set(HAS_OG_FLAG 0)
endif()
#
# Build-type: RelWithDebInfo
#
if(HAS_OG_FLAG)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -Og -g")
endif()
# We _want_ assertions in RelWithDebInfo build-type.
if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG)
string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
endif()
# Set build flags for custom Dev build type.
# -DNDEBUG purposely omitted because we want assertions.
if(MSVC)
SET(CMAKE_C_FLAGS_DEV ""
CACHE STRING "Flags used by the compiler during development (optimized, but with debug info and logging) builds."
FORCE)
else()
if(CMAKE_COMPILER_IS_GNUCC)
check_c_compiler_flag(-Og HAS_OG_FLAG)
else()
set(HAS_OG_FLAG 0)
endif()
if(HAS_OG_FLAG)
set(CMAKE_C_FLAGS_DEV "-Og -g"
CACHE STRING "Flags used by the compiler during development (optimized, but with debug info and logging) builds."
FORCE)
else()
set(CMAKE_C_FLAGS_DEV "-O2 -g"
CACHE STRING "Flags used by the compiler during development (optimized, but with debug info and logging) builds."
FORCE)
endif()
endif()
SET(CMAKE_EXE_LINKER_FLAGS_DEV ""
CACHE STRING "Flags used for linking binaries during development (optimized, but with debug info and logging) builds."
FORCE)
SET(CMAKE_SHARED_LINKER_FLAGS_DEV ""
CACHE STRING "Flags used by the shared libraries linker during development (optimized, but with debug info and logging) builds."
FORCE)
MARK_AS_ADVANCED(
CMAKE_C_FLAGS_DEV
CMAKE_EXE_LINKER_FLAGS_DEV
CMAKE_SHARED_LINKER_FLAGS_DEV)
# Enable -Wconversion.
if(NOT MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion")
endif()
# gcc 4.0 and better turn on _FORTIFY_SOURCE=2 automatically. This currently
# gcc 4.0+ sets _FORTIFY_SOURCE=2 automatically. This currently
# does not work with Neovim due to some uses of dynamically-sized structures.
# See https://github.com/neovim/neovim/issues/223 for details.
# https://github.com/neovim/neovim/issues/223
include(CheckCSourceCompiles)
# Include the build type's default flags in the check for _FORTIFY_SOURCE,
@ -150,7 +192,11 @@ if(${INIT_FLAGS_NAME})
set(CMAKE_REQUIRED_FLAGS "${${INIT_FLAGS_NAME}}")
endif()
# Include <string.h> because some toolchains define _FORTIFY_SOURCE=2 in
# internal header files, which should in turn be #included by <string.h>.
check_c_source_compiles("
#include <string.h>
#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 1
#error \"_FORTIFY_SOURCE > 1\"
#endif
@ -162,17 +208,16 @@ main(void)
" HAS_ACCEPTABLE_FORTIFY)
if(NOT HAS_ACCEPTABLE_FORTIFY)
message(STATUS "Unsupported _FORTIFY_SOURCE found, forcing _FORTIFY_SOURCE=1.")
message(STATUS "Unsupported _FORTIFY_SOURCE found, forcing _FORTIFY_SOURCE=1")
# Extract possible prefix to _FORTIFY_SOURCE (e.g. -Wp,-D_FORTIFY_SOURCE).
STRING(REGEX MATCH "[^\ ]+-D_FORTIFY_SOURCE" _FORTIFY_SOURCE_PREFIX "${CMAKE_C_FLAGS}")
STRING(REPLACE "-D_FORTIFY_SOURCE" "" _FORTIFY_SOURCE_PREFIX "${_FORTIFY_SOURCE_PREFIX}" )
if(NOT _FORTIFY_SOURCE_PREFIX STREQUAL "")
message(STATUS "Detected _FORTIFY_SOURCE Prefix=${_FORTIFY_SOURCE_PREFIX}.")
message(STATUS "Detected _FORTIFY_SOURCE Prefix=${_FORTIFY_SOURCE_PREFIX}")
endif()
# -U in add_definitions doesn't end up in the correct spot, so we add it to
# the flags variable instead.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_FORTIFY_SOURCE_PREFIX}-U_FORTIFY_SOURCE ${_FORTIFY_SOURCE_PREFIX}-D_FORTIFY_SOURCE=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_FORTIFY_SOURCE_PREFIX}-U_FORTIFY_SOURCE ${_FORTIFY_SOURCE_PREFIX}-D_FORTIFY_SOURCE=1")
endif()
# Remove --sort-common from linker flags, as this seems to cause bugs (see #2641, #3374).
@ -180,7 +225,7 @@ endif()
if(CMAKE_EXE_LINKER_FLAGS MATCHES "--sort-common" OR
CMAKE_SHARED_LINKER_FLAGS MATCHES "--sort-common" OR
CMAKE_MODULE_LINKER_FLAGS MATCHES "--sort-common")
message(STATUS "Removing --sort-common from linker flags.")
message(STATUS "Removing --sort-common from linker flags")
string(REGEX REPLACE ",--sort-common(=[^,]+)?" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
string(REGEX REPLACE ",--sort-common(=[^,]+)?" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
string(REGEX REPLACE ",--sort-common(=[^,]+)?" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
@ -193,18 +238,44 @@ if(CMAKE_EXE_LINKER_FLAGS MATCHES "--sort-common" OR
string(REGEX REPLACE "-Wl($| )" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
endif()
check_c_source_compiles("
#include <execinfo.h>
int main(void)
{
void *trace[1];
int trace_size = backtrace(trace, 1);
return 0;
}
" HAVE_EXECINFO_BACKTRACE)
if(MSVC)
# XXX: /W4 gives too many warnings. #3241
add_definitions(/W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
add_definitions(-DWIN32)
else()
add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter
-Wstrict-prototypes -std=gnu99)
check_c_compiler_flag(-Wimplicit-fallthrough HAS_WIMPLICIT_FALLTHROUGH_FLAG)
if(HAS_WIMPLICIT_FALLTHROUGH_FLAG)
add_definitions(-Wimplicit-fallthrough)
endif()
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
# 3.4.1 used there.
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND CMAKE_C_COMPILER_ID MATCHES "Clang")
add_definitions(-Wno-c11-extensions)
endif()
endif()
if(MINGW)
# Use POSIX compatible stdio in Mingw
add_definitions(-D__USE_MINGW_ANSI_STDIO)
endif()
if(WIN32)
# Windows Vista is the minimum supported version
add_definitions(-D_WIN32_WINNT=0x0600)
endif()
# OpenBSD's GCC (4.2.1) doesn't have -Wvla
check_c_compiler_flag(-Wvla HAS_WVLA_FLAG)
@ -212,12 +283,16 @@ if(HAS_WVLA_FLAG)
add_definitions(-Wvla)
endif()
check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG)
check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG)
if(HAS_FSTACK_PROTECTOR_STRONG_FLAG)
add_definitions(-fstack-protector-strong)
elseif(HAS_FSTACK_PROTECTOR_FLAG)
add_definitions(-fstack-protector --param ssp-buffer-size=4)
if(UNIX)
# -fstack-protector breaks non Unix builds even in Mingw-w64
check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG)
check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG)
if(HAS_FSTACK_PROTECTOR_STRONG_FLAG)
add_definitions(-fstack-protector-strong)
elseif(HAS_FSTACK_PROTECTOR_FLAG)
add_definitions(-fstack-protector --param ssp-buffer-size=4)
endif()
endif()
check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG)
@ -225,12 +300,27 @@ if(HAS_DIAG_COLOR_FLAG)
add_definitions(-fdiagnostics-color=auto)
endif()
option(
TRAVIS_CI_BUILD "Travis CI build. Extra compilation flags will be set." OFF)
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
# 1. Array-bounds testing is broken in some GCC versions before 4.8.5.
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
# 2. But _Pragma("...ignored") is broken (unresolved) in GCC 5+:
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66099
# So we must disable -Warray-bounds globally for GCC (for kbtree.h, #7083).
check_c_compiler_flag(-Wno-array-bounds HAS_NO_ARRAY_BOUNDS_FLAG)
if(HAS_NO_ARRAY_BOUNDS_FLAG)
add_definitions(-Wno-array-bounds)
endif()
endif()
option(TRAVIS_CI_BUILD "Travis/QuickBuild CI, extra flags will be set" OFF)
if(TRAVIS_CI_BUILD)
message(STATUS "Travis CI build enabled.")
message(STATUS "Travis/QuickBuild 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)
@ -239,17 +329,23 @@ else()
set(DEBUG 0)
endif()
option(LOG_LIST_ACTIONS "Add list actions logging" OFF)
add_definitions(-DINCLUDE_GENERATED_DECLARATIONS)
add_definitions(-DHAVE_CONFIG_H)
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
set(NO_UNDEFINED "-Wl,--no-undefined -lsocket")
elseif(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(NO_UNDEFINED "-Wl,--no-undefined")
endif()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${NO_UNDEFINED}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${NO_UNDEFINED}")
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_NAME STREQUAL "SunOS")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined -lsocket")
# For O_CLOEXEC, O_DIRECTORY, and O_NOFOLLOW flags on older systems
# (pre POSIX.1-2008: glibc 2.11 and earlier). #4042
# For ptsname(). #6743
add_definitions(-D_GNU_SOURCE)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
@ -265,27 +361,77 @@ endif()
include_directories("${PROJECT_BINARY_DIR}/config")
include_directories("${PROJECT_SOURCE_DIR}/src")
# Modules used by platform auto-detection
include(CheckLibraryExists)
find_package(LibUV REQUIRED)
include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
find_package(Msgpack REQUIRED)
find_package(Msgpack 1.0.0 REQUIRED)
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
find_package(LuaJit REQUIRED)
include_directories(SYSTEM ${LUAJIT_INCLUDE_DIRS})
# Note: The test lib requires LuaJIT; it will be skipped if LuaJIT is missing.
option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF)
find_package(Unibilium REQUIRED)
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
if(PREFER_LUA)
find_package(Lua 5.1 REQUIRED)
set(LUA_PREFERRED_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
set(LUA_PREFERRED_LIBRARIES ${LUA_LIBRARIES})
# Passive (not REQUIRED): if LUAJIT_FOUND is not set, nvim-test is skipped.
find_package(LuaJit)
else()
find_package(LuaJit REQUIRED)
set(LUA_PREFERRED_INCLUDE_DIRS ${LUAJIT_INCLUDE_DIRS})
set(LUA_PREFERRED_LIBRARIES ${LUAJIT_LIBRARIES})
endif()
find_package(LibTermkey REQUIRED)
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
list(APPEND CMAKE_REQUIRED_INCLUDES "${MSGPACK_INCLUDE_DIRS}")
check_c_source_compiles("
#include <msgpack.h>
int
main(void)
{
return MSGPACK_OBJECT_FLOAT32;
}
" MSGPACK_HAS_FLOAT32)
unset(CMAKE_REQUIRED_LIBRARIES)
if(MSGPACK_HAS_FLOAT32)
add_definitions(-DNVIM_MSGPACK_HAS_FLOAT32)
endif()
option(FEAT_TUI "Enable the Terminal UI" ON)
if(FEAT_TUI)
find_package(Unibilium REQUIRED)
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
list(APPEND CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}")
list(APPEND CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARIES}")
check_c_source_compiles("
#include <unibilium.h>
int
main(void)
{
return unibi_num_from_var(unibi_var_from_num(0));
}
" UNIBI_HAS_VAR_FROM)
unset(CMAKE_REQUIRED_INCLUDES)
unset(CMAKE_REQUIRED_LIBRARIES)
if(UNIBI_HAS_VAR_FROM)
add_definitions(-DNVIM_UNIBI_HAS_VAR_FROM)
endif()
find_package(LibTermkey 0.18 REQUIRED)
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
endif()
find_package(LibVterm REQUIRED)
include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS})
if(WIN32)
find_package(Winpty 0.4.3 REQUIRED)
include_directories(SYSTEM ${WINPTY_INCLUDE_DIRS})
endif()
option(CLANG_ASAN_UBSAN "Enable Clang address & undefined behavior sanitizer for nvim binary." OFF)
option(CLANG_MSAN "Enable Clang memory sanitizer for nvim binary." OFF)
option(CLANG_TSAN "Enable Clang thread sanitizer for nvim binary." OFF)
@ -293,33 +439,37 @@ option(CLANG_TSAN "Enable Clang thread sanitizer for nvim binary." OFF)
if((CLANG_ASAN_UBSAN AND CLANG_MSAN)
OR (CLANG_ASAN_UBSAN AND CLANG_TSAN)
OR (CLANG_MSAN AND CLANG_TSAN))
message(FATAL_ERROR "Sanitizers cannot be enabled simultaneously.")
message(FATAL_ERROR "Sanitizers cannot be enabled simultaneously")
endif()
if((CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN) AND NOT CMAKE_C_COMPILER_ID MATCHES "Clang")
message(FATAL_ERROR "Sanitizers are only supported for Clang.")
message(FATAL_ERROR "Sanitizers are only supported for Clang")
endif()
option(ENABLE_JEMALLOC "enable jemalloc" ON)
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD|FreeBSD|Windows") # see #5318
message(STATUS "skipping jemalloc on this system: ${CMAKE_SYSTEM_NAME}")
option(ENABLE_JEMALLOC "enable jemalloc" OFF)
else()
option(ENABLE_JEMALLOC "enable jemalloc" ON)
endif()
if (ENABLE_JEMALLOC)
if(ENABLE_JEMALLOC)
if(CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN)
message(STATUS "Sanitizers have been enabled; don't use jemalloc.")
message(STATUS "Sanitizers enabled; disabling jemalloc")
else()
find_package(JeMalloc)
if(JEMALLOC_FOUND)
include_directories(SYSTEM ${JEMALLOC_INCLUDE_DIRS})
endif()
find_package(JeMalloc REQUIRED)
include_directories(SYSTEM ${JEMALLOC_INCLUDE_DIRS})
endif()
endif()
find_package(LibIntl)
if(LibIntl_FOUND)
if(ENABLE_LIBINTL)
# LibIntl (not Intl) selects our FindLibIntl.cmake script. #8464
find_package(LibIntl REQUIRED)
include_directories(SYSTEM ${LibIntl_INCLUDE_DIRS})
endif()
find_package(Iconv)
if(Iconv_FOUND)
if(ENABLE_LIBICONV)
find_package(Iconv REQUIRED)
include_directories(SYSTEM ${Iconv_INCLUDE_DIRS})
endif()
@ -328,15 +478,22 @@ endif()
set(CMAKE_THREAD_PREFER_PTHREAD ON)
find_package(Threads REQUIRED)
# Place targets in bin/ or lib/ for all build configurations
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
foreach(CFGNAME ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${CFGNAME} CFGNAME)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/lib)
endforeach()
# Find Lua interpreter
include(LuaHelpers)
set(LUA_DEPENDENCIES lpeg MessagePack bit)
set(LUA_DEPENDENCIES lpeg mpack bit)
if(NOT LUA_PRG)
foreach(CURRENT_LUA_PRG luajit lua)
foreach(CURRENT_LUA_PRG luajit lua5.1 lua5.2 lua)
# If LUA_PRG is set find_program() will not search
unset(LUA_PRG CACHE)
unset(LUA_PRG_WORKS)
@ -354,41 +511,56 @@ else()
endif()
if(NOT LUA_PRG_WORKS)
message(FATAL_ERROR "A suitable Lua interpreter was not found.")
message(FATAL_ERROR "Failed to find a Lua 5.1-compatible interpreter")
endif()
message(STATUS "Using the Lua interpreter ${LUA_PRG}.")
message(STATUS "Using Lua interpreter: ${LUA_PRG}")
# Setup busted.
find_program(BUSTED_PRG busted)
find_program(BUSTED_PRG NAMES busted busted.bat)
find_program(BUSTED_LUA_PRG busted-lua)
if(NOT BUSTED_OUTPUT_TYPE)
set(BUSTED_OUTPUT_TYPE "utfTerminal")
set(BUSTED_OUTPUT_TYPE "nvim")
endif()
find_program(LUACHECK_PRG luacheck)
find_program(GPERF_PRG gperf)
include(InstallHelpers)
file(GLOB MANPAGES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
man/nvim.1)
install_helper(
FILES ${MANPAGES}
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
# MIN_LOG_LEVEL for log.h
if("${MIN_LOG_LEVEL}" MATCHES "^$")
message(STATUS "MIN_LOG_LEVEL not specified")
else()
if(NOT MIN_LOG_LEVEL MATCHES "^[0-3]$")
message(FATAL_ERROR "invalid MIN_LOG_LEVEL: " ${MIN_LOG_LEVEL})
endif()
message(STATUS "MIN_LOG_LEVEL set to ${MIN_LOG_LEVEL}")
endif()
# Go down the tree.
add_subdirectory(src/nvim)
# Read compilation flags from src/nvim,
# used in config subdirectory below.
# Read compilation flags from src/nvim, used in config subdirectory below.
include(GetCompileFlags)
get_compile_flags(NVIM_VERSION_CFLAGS)
add_subdirectory(test/includes)
add_subdirectory(config)
add_subdirectory(test/functional/fixtures) # compile pty/shell test programs
add_subdirectory(test/functional/fixtures) # compile test programs
add_subdirectory(runtime)
if(WIN32)
install_helper(
FILES ${DEPS_PREFIX}/share/nvim-qt/runtime/plugin/nvim_gui_shim.vim
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim-qt/runtime/plugin)
endif()
# Setup some test-related bits. We do this after going down the tree because we
# need some of the targets.
@ -396,24 +568,25 @@ if(BUSTED_PRG)
get_property(TEST_INCLUDE_DIRS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
PROPERTY INCLUDE_DIRECTORIES)
# Set policy CMP0026 to OLD so we avoid CMake warnings on newer
# versions of cmake.
if(POLICY CMP0026)
cmake_policy(SET CMP0026 OLD)
# 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()
get_target_property(TEST_LIBNVIM_PATH nvim-test LOCATION)
configure_file(
test/config/paths.lua.in
${CMAKE_BINARY_DIR}/test/config/paths.lua)
set(UNITTEST_PREREQS nvim-test unittest-headers)
set(FUNCTIONALTEST_PREREQS nvim tty-test shell-test)
set(FUNCTIONALTEST_PREREQS nvim printargs-test shell-test)
if(NOT WIN32)
list(APPEND FUNCTIONALTEST_PREREQS tty-test)
endif()
set(BENCHMARK_PREREQS nvim tty-test)
# Useful for automated build systems, if they want to manually run the tests.
add_custom_target(unittest-prereqs
DEPENDS ${UNITTEST_PREREQS})
set_target_properties(unittest-prereqs PROPERTIES FOLDER test)
add_custom_target(functionaltest-prereqs
DEPENDS ${FUNCTIONALTEST_PREREQS})
@ -421,47 +594,135 @@ if(BUSTED_PRG)
add_custom_target(benchmark-prereqs
DEPENDS ${BENCHMARK_PREREQS})
add_custom_target(unittest
COMMAND ${CMAKE_COMMAND}
-DBUSTED_PRG=${BUSTED_PRG}
-DLUA_PRG=${LUA_PRG}
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
-DBUILD_DIR=${CMAKE_BINARY_DIR}
-DTEST_TYPE=unit
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${UNITTEST_PREREQS})
check_lua_module(${LUA_PRG} "ffi" LUA_HAS_FFI)
if(LUA_HAS_FFI)
add_custom_target(unittest
COMMAND ${CMAKE_COMMAND}
-DBUSTED_PRG=${BUSTED_PRG}
-DLUA_PRG=${LUA_PRG}
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
-DBUILD_DIR=${CMAKE_BINARY_DIR}
-DTEST_TYPE=unit
-DSYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${UNITTEST_PREREQS}
${TEST_TARGET_ARGS})
set_target_properties(unittest PROPERTIES FOLDER test)
else()
message(WARNING "disabling unit tests: no Luajit FFI in ${LUA_PRG}")
endif()
if(LUA_HAS_FFI)
set(TEST_LIBNVIM_PATH $<TARGET_FILE:nvim-test>)
else()
set(TEST_LIBNVIM_PATH "")
endif()
configure_file(
${CMAKE_SOURCE_DIR}/test/config/paths.lua.in
${CMAKE_BINARY_DIR}/test/config/paths.lua.gen)
file(GENERATE
OUTPUT ${CMAKE_BINARY_DIR}/test/config/paths.lua
INPUT ${CMAKE_BINARY_DIR}/test/config/paths.lua.gen)
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})
set_target_properties(functionaltest functionaltest-prereqs
PROPERTIES FOLDER test)
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})
set_target_properties(benchmark benchmark-prereqs PROPERTIES FOLDER test)
endif()
if(BUSTED_LUA_PRG)
add_custom_target(functionaltest-lua
COMMAND ${CMAKE_COMMAND}
-DBUSTED_PRG=${BUSTED_LUA_PRG}
-DLUA_PRG=${LUA_PRG}
-DNVIM_PRG=$<TARGET_FILE:nvim>
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
-DBUILD_DIR=${CMAKE_BINARY_DIR}
-DTEST_TYPE=functional
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${FUNCTIONALTEST_PREREQS}
${TEST_TARGET_ARGS})
set_target_properties(functionaltest-lua PROPERTIES FOLDER test)
endif()
if(LUACHECK_PRG)
add_custom_target(testlint
COMMAND ${CMAKE_COMMAND}
-DLUACHECK_PRG=${LUACHECK_PRG}
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
-P ${PROJECT_SOURCE_DIR}/cmake/RunTestsLint.cmake)
-DLUAFILES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
-DIGNORE_PATTERN="*/preload.lua"
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-P ${PROJECT_SOURCE_DIR}/cmake/RunLuacheck.cmake)
add_custom_target(
lintbuiltinlua
COMMAND
${CMAKE_COMMAND}
-DLUACHECK_PRG=${LUACHECK_PRG}
-DLUAFILES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/src/nvim/lua
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-DREAD_GLOBALS=vim
-P ${PROJECT_SOURCE_DIR}/cmake/RunLuacheck.cmake
)
add_custom_target(
lintruntimelua
COMMAND
${CMAKE_COMMAND}
-DLUACHECK_PRG=${LUACHECK_PRG}
-DLUAFILES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/runtime/lua
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-DREAD_GLOBALS=vim
-P ${PROJECT_SOURCE_DIR}/cmake/RunLuacheck.cmake
)
# TODO(ZyX-I): Run linter for all lua code in src
add_custom_target(
lualint
DEPENDS lintruntimelua
DEPENDS lintbuiltinlua
)
endif()
set(CPACK_PACKAGE_NAME "Neovim")
set(CPACK_PACKAGE_VENDOR "neovim.io")
set(CPACK_PACKAGE_VERSION ${NVIM_VERSION_MEDIUM})
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Neovim")
# Set toplevel directory/installer name as Neovim
set(CPACK_PACKAGE_FILE_NAME "Neovim")
set(CPACK_TOPLEVEL_TAG "Neovim")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set(CPACK_NSIS_MODIFY_PATH ON)
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
include(CPack)

View File

@ -1,168 +1,160 @@
# 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
- [Merge a Vim patch].
- Try a [complexity:low] issue.
- Fix bugs found by [clang scan-build](#clang-scan-build),
[coverity](#coverity), and [PVS](#pvs-studio).
Before reporting an issue, see the following wiki articles:
Developer guidelines
--------------------
- [Troubleshooting][wiki-troubleshooting]
- [Frequently asked questions][wiki-faq]
- Nvim contributors should read `:help dev` (especially `:help dev-api`).
- External UI developers should read `:help dev-ui`.
- API client developers should read `:help dev-api-client`.
- Nvim developers are _strongly encouraged_ to install `ninja` for faster builds.
```
sudo apt-get install ninja-build
make distclean
make # Nvim build system uses ninja automatically, if available.
```
If your issue isn't mentioned there:
Reporting problems
------------------
- Verify that it hasn't already been reported.
- If not already running the latest version of Neovim, update to it to see if
your problem persists.
- If you're experiencing compile or runtime warnings/failures, try searching for
the error message(s) you received (if any) on [Neovim's issue tracker][github-issues].
- For build issues, see
[Troubleshooting#build-issues][wiki-troubleshooting-build-issues].
- For runtime issues, see
[Troubleshooting#runtime-issues][wiki-troubleshooting-runtime-issues].
If your issue isn't mentioned there, try reproducing it using `nvim`
with the smallest possible `vimrc` (or none at all via `nvim -u NONE`),
to rule out bugs in plugins you're using.
If you're using a plugin manager, comment out your plugins, then add
them back in one by one.
- Check the [**FAQ**][wiki-faq].
- Search [existing issues][github-issues] (including closed!)
- Update Neovim to the latest version to see if your problem persists.
- Disable plugins incrementally, to narrow down the cause of the issue.
- When reporting a crash, [include a stacktrace](https://github.com/neovim/neovim/wiki/Development-tips#backtrace-linux).
- [Bisect][git-bisect] to the cause of a regression, if you are able. This is _extremely_ helpful.
- Check `$NVIM_LOG_FILE`, if it exists.
- Include `cmake --system-information` for **build** issues.
Include as much detail as possible; we generally need to know:
Pull requests ("PRs")
---------------------
- 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.
- To avoid duplicate work, create a `[WIP]` pull request as soon as possible.
- Avoid cosmetic changes to unrelated files in the same commit.
- Use a [feature branch][git-feature-branch] instead of the master branch.
- Use a **rebase workflow** for small PRs.
- After addressing review comments, it's fine to rebase and force-push.
- Use a **merge workflow** for big, high-risk PRs.
- Merge `master` into your PR when there are conflicts or when master
introduces breaking changes.
- Use the `ri` git alias:
```
[alias]
ri = "!sh -c 't=\"${1:-master}\"; s=\"${2:-HEAD}\"; mb=\"$(git merge-base \"$t\" \"$s\")\"; if test \"x$mb\" = x ; then o=\"$t\"; else lm=\"$(git log -n1 --merges \"$t..$s\" --pretty=%H)\"; if test \"x$lm\" = x ; then o=\"$mb\"; else o=\"$lm\"; fi; fi; test $# -gt 0 && shift; test $# -gt 0 && shift; git rebase --interactive \"$o\" \"$@\"'"
```
This avoids unnecessary rebases yet still allows you to combine related
commits, separate monolithic commits, etc.
- Do not edit commits that come before the merge commit.
- During a squash/fixup, use `exec make -C build unittest` between each
pick/edit/reword.
## Submitting contributions
### Stages: WIP, RFC, RDY
- 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.
Pull requests have three stages: `[WIP]` (Work In Progress), `[RFC]` (Request
For Comment) and `[RDY]` (Ready).
### Tagging in the issue tracker
- 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.
When submitting pull requests (commonly referred to as "PRs"), include one of
the following tags prepended to the title:
For example, a typical workflow is:
- `[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.
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]`.
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.
### Commit messages
### 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
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.
### For code pull requests
#### Testing
We are unlikely to merge your PR if the Travis build fails:
- 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`
#### Coding style
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`.
Weigh those costs when making cosmetic changes. In general, avoid pull
requests dominated by style changes, but feel free to fix up lines that you
happen to be modifying anyway. Fix anything that looks outright
[barbarous](http://www.orwell.ru/library/essays/politics/english/e_polit), but
otherwise prefer to leave things as they are.
For new code, run `make lint` (which runs [clint.py][clint]) to detect style
errors. Make sure that the file(s) you intend to be linted are not in
`clint-ignored-files.txt`. It's not perfect, so some warnings may be false
positives/negatives. To have `clint.py` ignore certain cases, put `// NOLINT`
at the end of the line.
We also provide a configuration file for [`clang-format`][clang-format], which
can be used to format code according to the style guidelines. Be aware that
this formatting method might need user supervision. To have `clang-format`
ignore certain line ranges, use the following special comments:
```c
int formatted_code;
// clang-format off
void unformatted_code ;
// clang-format on
void formatted_code_again;
```
### Commit guidelines
The purpose of these guidelines is to *make reviews easier* and make the
[VCS][vcs] logs more valuable.
Follow [commit message hygiene][hygiene] to *make reviews easier* and to make
the VCS/git logs more valuable.
- Try to keep the first line under 72 characters.
- If necessary, include further description after a blank line.
- Don't make the description too verbose by including obvious things, but
don't spare clarifications for anything that may be not so obvious.
Some commit messages are pages long, and that's fine if there's no
better place for those comments to live.
- **Recommended:** Prefix logically-related commits with a consistent
identifier in each commit message. For already used identifiers, see the
commit history for the respective file(s) you're editing.
[For example](https://github.com/neovim/neovim/commits?author=elmart),
the following commits are related by task (*Introduce nvim namespace*) and
sub-task (*Contrib YCM*).
<br/> `Introduce nvim namespace: Contrib YCM: Fix style issues`
<br/> `Introduce nvim namespace: Contrib YCM: Fix build dir calculation`
- Sub-tasks can be *activity-oriented* (doing different things on the same area)
or *scope-oriented* (doing the same thing in different areas).
- Granularity helps, but it's conceptual size that matters, not extent size.
- Use the [imperative voice][imperative]: "Fix bug" rather than "Fixed bug" or "Fixes bug."
- **Prefix the commit subject with a _scope_:** `doc:`, `test:`, `foo.c:`,
`runtime:`, ...
- For commits that contain only style/lint changes, a single-word subject
line is preferred: `style` or `lint`.
- A blank line must separate the subject from the description.
- Use the _imperative voice_: "Fix bug" rather than "Fixed bug" or "Fixes bug."
### Reviewing pull requests
### Automated builds (CI)
Using a checklist during reviews is highly recommended, so we [provide one at
the wiki][wiki-review-checklist]. If you think it could be improved, feel free
to edit it.
Each pull request must pass the automated builds on [travis CI], [quickbuild]
and [AppVeyor].
- CI builds are compiled with [`-Werror`][gcc-warnings], so compiler warnings
will fail the build.
- If any tests fail, the build will fail.
See [test/README.md#running-tests][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`
- To run Clang ASan/UBSan locally: `CC=clang make CMAKE_FLAGS="-DCLANG_ASAN_UBSAN=ON"`
- 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)
QuickBuild uses this invocation:
mkdir -p build/${params.get("buildType")} \
&& cd build/${params.get("buildType")} \
&& cmake -G "Unix Makefiles" -DBUSTED_OUTPUT_TYPE=TAP -DCMAKE_BUILD_TYPE=${params.get("buildType")}
-DTRAVIS_CI_BUILD=ON ../.. && ${node.getAttribute("make", "make")}
VERBOSE=1 nvim unittest-prereqs functionaltest-prereqs
### Clang scan-build
The auto-generated [clang-scan] report presents walk-throughs of bugs found by
Clang's [scan-build](https://clang-analyzer.llvm.org/scan-build.html) static
analyzer. To verify a fix locally, run `scan-build` like this:
rm -rf build/
scan-build --use-analyzer=/usr/bin/clang make
### Coverity
[Coverity](https://scan.coverity.com/projects/neovim-neovim) runs against the
master build. To view the defects, just request access; you will be approved.
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).
### PVS-Studio
View the [PVS analysis report](https://neovim.io/doc/reports/pvs/) to see bugs
found by [PVS Studio](https://www.viva64.com/en/pvs-studio/).
You can run `scripts/pvscheck.sh` locally to run PVS on your machine.
Reviewing
---------
To help review pull requests, start with [this checklist][review-checklist].
Reviewing can be done on GitHub, but you may find it easier to do locally.
Using [`hub`][hub], you can do the following to create a new branch with the
contents of a pull request, such as [#1820][github-pr-1820]:
Using [`hub`][hub], you can create a new branch with the contents of a pull
request, e.g. [#1820][1820]:
hub checkout https://github.com/neovim/neovim/pull/1820
@ -171,31 +163,25 @@ 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-bisect]: http://git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git
[git-feature-branch]: https://www.atlassian.com/git/tutorials/comparing-workflows
[git-history-filtering]: https://www.atlassian.com/git/tutorials/git-log/filtering-the-commit-history
[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
[run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ
[wiki-review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
[wiki-troubleshooting-build-issues]: https://github.com/neovim/neovim/wiki/Troubleshooting#build-issues
[wiki-troubleshooting-runtime-issues]: https://github.com/neovim/neovim/wiki/Troubleshooting#runtime-issues
[wiki-troubleshooting]: https://github.com/neovim/neovim/wiki/Troubleshooting
[review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
[3174]: https://github.com/neovim/neovim/issues/3174
[travis CI]: https://travis-ci.org/neovim/neovim
[quickbuild]: http://neovim-qb.szakmeister.net/dashboard
[AppVeyor]: https://ci.appveyor.com/project/neovim/neovim
[Merge a 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

19
ISSUE_TEMPLATE.md Normal file
View File

@ -0,0 +1,19 @@
<!-- Before reporting: search existing issues and check the FAQ. -->
- `nvim --version`:
- Vim (version: ) behaves differently?
- Operating system/version:
- Terminal name/version:
- `$TERM`:
### Steps to reproduce using `nvim -u NORC`
```
nvim -u NORC
```
### Actual behaviour
### Expected behaviour

48
MAINTAIN.md Normal file
View File

@ -0,0 +1,48 @@
Maintaining the Neovim project
==============================
Notes on maintaining the Neovim project.
See also: https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt
Ticket Triage
-------------
In practice we haven't found a meaningful way to forecast more precisely than
"next" and "after next". That means there are usually one or two (at most)
planned milestones:
- Next bugfix-release (1.0.x)
- Next feature-release (1.x.0)
The forecasting problem might be solved with an explicit priority system (like
Bram's todo.txt). Meanwhile the Neovim priority system is defined by:
- PRs nearing completion (RDY).
- Issue labels. E.g. the +plan label increases the ticket's priority merely for
having a plan written down: it is _closer to completion_ than tickets without
a plan.
- Comment activity or new information.
Anything that isn't in the next milestone, and doesn't have a RDY PR ... is
just not something you care very much about, by construction. Post-release you
can review open issues, but chances are your next milestone is already getting
full :)
Release Policy
--------------
The goal is "early and often".
Up to now we use only one branch, the `master` branch.
- If `master` is unstable we don't release.
- If the last release has a major bug, we:
1. Fix the bug on `master`.
2. Disable or remove any known risks present on `master`.
3. Cut a release from `master`.
This is a bit silly, but it works ok. And it keeps `master` from biting off
more feature-creep than it can chew.
See also: https://github.com/neovim/neovim/issues/862

View File

@ -1,21 +1,26 @@
THIS_DIR = $(shell pwd)
filter-false = $(strip $(filter-out 0 off OFF false FALSE,$1))
filter-true = $(strip $(filter-out 1 on ON true TRUE,$1))
# See contrib/local.mk.example
-include local.mk
CMAKE_PRG ?= $(shell (command -v cmake3 || echo cmake))
CMAKE_BUILD_TYPE ?= Debug
CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
DOC_DOWNLOAD_URL_BASE := https://raw.githubusercontent.com/neovim/doc/gh-pages
CLINT_ERRORS_FILE_PATH := /reports/clint/errors.json
BUILD_TYPE ?= $(shell (type ninja > /dev/null 2>&1 && echo "Ninja") || \
echo "Unix Makefiles")
DEPS_BUILD_DIR ?= .deps
ifneq (1,$(words [$(DEPS_BUILD_DIR)]))
$(error DEPS_BUILD_DIR must not contain whitespace)
endif
ifeq (,$(BUILD_TOOL))
ifeq (Ninja,$(BUILD_TYPE))
ifneq ($(shell cmake --help 2>/dev/null | grep Ninja),)
ifneq ($(shell $(CMAKE_PRG) --help 2>/dev/null | grep Ninja),)
BUILD_TOOL := ninja
else
# User's version of CMake doesn't support Ninja
@ -39,10 +44,16 @@ BUILD_CMD = $(BUILD_TOOL) $(VERBOSE_FLAG)
# Extra CMake flags which extend the default set
CMAKE_EXTRA_FLAGS ?=
DEPS_CMAKE_FLAGS ?=
USE_BUNDLED_DEPS ?=
# Back-compat: USE_BUNDLED_DEPS was the old name.
USE_BUNDLED ?= $(USE_BUNDLED_DEPS)
ifneq (,$(USE_BUNDLED_DEPS))
BUNDLED_CMAKE_FLAG := -DUSE_BUNDLED=$(USE_BUNDLED_DEPS)
ifneq (,$(USE_BUNDLED))
BUNDLED_CMAKE_FLAG := -DUSE_BUNDLED=$(USE_BUNDLED)
endif
ifneq (,$(findstring functionaltest-lua,$(MAKECMDGOALS)))
BUNDLED_LUA_CMAKE_FLAG := -DUSE_BUNDLED_LUA=ON
$(shell [ -x $(DEPS_BUILD_DIR)/usr/bin/lua ] || rm build/.ran-*)
endif
# For use where we want to make sure only a single job is run. This does issue
@ -62,33 +73,52 @@ cmake:
$(MAKE) build/.ran-cmake
build/.ran-cmake: | deps
cd build && cmake -G '$(BUILD_TYPE)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) ..
cd build && $(CMAKE_PRG) -G '$(BUILD_TYPE)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(THIS_DIR)
touch $@
deps: | build/.ran-third-party-cmake
ifeq ($(call filter-true,$(USE_BUNDLED_DEPS)),)
+$(BUILD_CMD) -C .deps
ifeq ($(call filter-true,$(USE_BUNDLED)),)
+$(BUILD_CMD) -C $(DEPS_BUILD_DIR)
endif
build/.ran-third-party-cmake:
ifeq ($(call filter-true,$(USE_BUNDLED_DEPS)),)
mkdir -p .deps
cd .deps && \
cmake -G '$(BUILD_TYPE)' $(BUNDLED_CMAKE_FLAG) \
$(DEPS_CMAKE_FLAGS) ../third-party
ifeq ($(call filter-true,$(USE_BUNDLED)),)
mkdir -p $(DEPS_BUILD_DIR)
cd $(DEPS_BUILD_DIR) && \
$(CMAKE_PRG) -G '$(BUILD_TYPE)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
$(DEPS_CMAKE_FLAGS) $(THIS_DIR)/third-party
endif
mkdir -p build
touch $@
oldtest: | nvim
+$(SINGLE_MAKE) -C src/nvim/testdir $(MAKEOVERRIDES)
# TODO: cmake 3.2+ add_custom_target() has a USES_TERMINAL flag.
oldtest: | nvim helptags
+$(SINGLE_MAKE) -C src/nvim/testdir clean
ifeq ($(strip $(TEST_FILE)),)
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" $(MAKEOVERRIDES)
else
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" NEW_TESTS=$(TEST_FILE) SCRIPTS= $(MAKEOVERRIDES)
endif
helptags: | nvim
+$(BUILD_CMD) -C build helptags
# Builds help HTML _and_ checks for invalid help tags.
helphtml: | nvim helptags
+$(BUILD_CMD) -C build doc_html
functionaltest: | nvim
+$(BUILD_CMD) -C build functionaltest
testlint: | nvim
functionaltest-lua: | nvim
+$(BUILD_CMD) -C build functionaltest-lua
testlint: | build/.ran-cmake deps
$(BUILD_CMD) -C build testlint
lualint: | build/.ran-cmake deps
$(BUILD_CMD) -C build lualint
unittest: | nvim
+$(BUILD_CMD) -C build unittest
@ -100,17 +130,34 @@ test: functionaltest unittest
clean:
+test -d build && $(BUILD_CMD) -C build clean || true
$(MAKE) -C src/nvim/testdir clean
$(MAKE) -C runtime/doc clean
distclean: clean
rm -rf .deps build
rm -rf $(DEPS_BUILD_DIR) build
install: | nvim
+$(BUILD_CMD) -C build install
lint:
cmake -DLINT_PRG=./clint.py \
-DLINT_DIR=src \
-DLINT_SUPPRESS_URL="$(DOC_DOWNLOAD_URL_BASE)$(CLINT_ERRORS_FILE_PATH)" \
-P cmake/RunLint.cmake
clint: build/.ran-cmake
+$(BUILD_CMD) -C build clint
.PHONY: test testlint functionaltest unittest lint clean distclean nvim libnvim cmake deps install
clint-full: build/.ran-cmake
+$(BUILD_CMD) -C build clint-full
check-single-includes: build/.ran-cmake
+$(BUILD_CMD) -C build check-single-includes
generated-sources: build/.ran-cmake
+$(BUILD_CMD) -C build generated-sources
appimage:
bash scripts/genappimage.sh
# Build an appimage with embedded update information appimage-nightly for
# nightly builds or appimage-latest for a release
appimage-%:
bash scripts/genappimage.sh $*
lint: check-single-includes clint testlint lualint
.PHONY: test testlint lualint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage

155
README.md
View File

@ -1,61 +1,125 @@
![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-600x173.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)
[![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/urdqjrik5u521fac/branch/master?svg=true)](https://ci.appveyor.com/project/neovim/neovim/branch/master)
[![Codecov coverage](https://img.shields.io/codecov/c/github/neovim/neovim.svg)](https://codecov.io/gh/neovim/neovim)
[![Coverity Scan analysis](https://scan.coverity.com/projects/2227/badge.svg)](https://scan.coverity.com/projects/2227)
[![Clang analysis](https://neovim.io/doc/reports/clang/badge.svg)](https://neovim.io/doc/reports/clang)
[![PVS-Studio analysis](https://neovim.io/doc/reports/pvs/badge.svg)](https://neovim.io/doc/reports/pvs/PVS-studio.html.d)
[![Packages](https://repology.org/badge/tiny-repos/neovim.svg)](https://repology.org/metapackage/neovim)
[![Debian CI](https://badges.debian.net/badges/debian/testing/neovim/version.svg)](https://buildd.debian.org/neovim)
[![Downloads](https://img.shields.io/github/downloads/neovim/neovim/total.svg?maxAge=2592001)](https://github.com/neovim/neovim/releases/)
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
- Improve extensibility with a new [plugin architecture](https://github.com/neovim/neovim/wiki/Plugin-UI-architecture)
- Enable [advanced UIs] without modifications to the core
- Maximize [extensibility](https://github.com/neovim/neovim/wiki/Plugin-UI-architecture)
For lots 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.
See the [Introduction](https://github.com/neovim/neovim/wiki/Introduction) wiki page and [Roadmap]
for more information.
[![Throughput Graph](https://graphs.waffle.io/neovim/neovim/throughput.svg)](https://waffle.io/neovim/neovim/metrics)
### What's being worked on now
Features
--------
- Port all IO to [libuv](https://github.com/libuv/libuv/blob/master/README.md)
- Convert legacy tests to Lua tests
- VimL => Lua translator
- Modern [GUIs](https://github.com/neovim/neovim/wiki/Related-projects#gui)
- [API](https://github.com/neovim/neovim/wiki/Related-projects#api-clients)
access from any language including Clojure, Lisp, Go, Haskell, Lua,
JavaScript, Perl, Python, Ruby, and Rust
- Embedded, scriptable [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
- Compatible with most Vim plugins, including Ruby and Python plugins
### How do I get it?
See [`:help nvim-features`][nvim-features] for the full list!
There is a formula for OSX/homebrew, a PKGBUILD for Arch Linux, RPM, deb, and
more. See [the wiki](https://github.com/neovim/neovim/wiki/Installing-Neovim)!
Install from package
--------------------
### Contributing
Pre-built packages for Windows, macOS, and Linux are found on the
[Releases](https://github.com/neovim/neovim/releases/) page.
...would be awesome! See [the wiki](https://github.com/neovim/neovim/wiki/Contributing) for more details.
Managed packages are in [Homebrew], [Debian], [Ubuntu], [Fedora], [Arch Linux], [Gentoo],
and [more](https://github.com/neovim/neovim/wiki/Installing-Neovim)!
### License
Install from source
-------------------
make CMAKE_BUILD_TYPE=RelWithDebInfo
sudo make install
To install to a non-default location, set `CMAKE_INSTALL_PREFIX`:
make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=/full/path/"
make install
To skip bundled (`third-party/*`) dependencies:
1. Install the dependencies using a package manager.
```
sudo apt install gperf luajit luarocks libuv1-dev libluajit-5.1-dev libunibilium-dev libmsgpack-dev libtermkey-dev libvterm-dev libjemalloc-dev
sudo luarocks build mpack
sudo luarocks build lpeg
sudo luarocks build inspect
```
2. Build with `USE_BUNDLED=OFF`:
```
make CMAKE_BUILD_TYPE=RelWithDebInfo USE_BUNDLED=OFF
sudo make install
```
CMake features:
- List all build targets:
```
cmake --build build --target help
```
- Print all variable definitions:
```
cmake -LAH
```
- `build/CMakeCache.txt` contains the resolved values of all CMake variables.
- `build/compile_commands.json` shows the full compiler invocations for each translation unit.
See the [Building Neovim](https://github.com/neovim/neovim/wiki/Building-Neovim) wiki page for details.
Transitioning from Vim
--------------------
See [`:help nvim-from-vim`](https://neovim.io/doc/user/nvim.html#nvim-from-vim) for instructions.
Project layout
--------------
├─ ci/ build automation
├─ cmake/ build scripts
├─ runtime/ user plugins/docs
├─ src/nvim/ application source code (see src/nvim/README.md)
│ ├─ api/ API subsystem
│ ├─ eval/ VimL subsystem
│ ├─ event/ event-loop subsystem
│ ├─ generators/ code generation (pre-compilation)
│ ├─ lib/ generic data structures
│ ├─ lua/ Lua subsystem
│ ├─ msgpack_rpc/ RPC subsystem
│ ├─ os/ low-level platform code
│ └─ tui/ built-in UI
├─ third-party/ CMake subproject to build dependencies
└─ test/ tests (see test/README.md)
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 +145,14 @@ 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/
[advanced UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui
[Homebrew]: https://github.com/neovim/homebrew-neovim#installation
[Debian]: https://packages.debian.org/testing/neovim
[Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim
[Fedora]: https://apps.fedoraproject.org/packages/neovim
[Arch Linux]: https://www.archlinux.org/packages/?q=neovim
[Gentoo]: https://packages.gentoo.org/packages/app-editors/neovim
<!-- vim: set tw=80: -->

View File

@ -1,23 +1,25 @@
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
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: "-t7z -m0=lzma -mx=9"
image: Visual Studio 2017
configuration:
- MSVC_64
- MSVC_32
- MINGW_64
- MINGW_32
- MINGW_64-gcov
matrix:
# Allow builds to fail
allow_failures:
- os: Windows Server 2012 R2
- configuration: MINGW_64-gcov
install: []
before_build:
- ps: Install-Product node 8
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 ..
- powershell ci\build.ps1
cache:
- C:\msys64\var\cache\pacman\pkg -> ci\build.ps1
- .deps -> ci\build.ps1
- .deps -> third-party\**
artifacts:
- path: build/Neovim.zip
- path: build/bin/nvim.exe

View File

@ -0,0 +1,94 @@
-- TODO(jkeyes): Use the upstream version when busted releases it. (But how to
-- inject our call to global_helpers.read_nvim_log() ?)
local pretty = require 'pl.pretty'
local global_helpers = require('test.helpers')
return function(options)
local busted = require 'busted'
local handler = require 'busted.outputHandlers.base'()
local success = 'ok %u - %s'
local failure = 'not ' .. success
local skip = 'ok %u - # SKIP %s'
local counter = 0
handler.suiteReset = function()
counter = 0
return nil, true
end
handler.suiteEnd = function()
io.write(global_helpers.read_nvim_log())
print('1..' .. counter)
io.flush()
return nil, true
end
local function showFailure(t)
local message = t.message
local trace = t.trace or {}
if message == nil then
message = 'Nil error'
elseif type(message) ~= 'string' then
message = pretty.write(message)
end
print(failure:format(counter, t.name))
print('# ' .. t.element.trace.short_src .. ' @ ' .. t.element.trace.currentline)
if t.randomseed then print('# Random seed: ' .. t.randomseed) end
print('# Failure message: ' .. message:gsub('\n', '\n# '))
if options.verbose and trace.traceback then
print('# ' .. trace.traceback:gsub('^\n', '', 1):gsub('\n', '\n# '))
end
end
handler.testStart = function(element, parent)
local trace = element.trace
if options.verbose and trace and trace.short_src then
local fileline = trace.short_src .. ' @ ' .. trace.currentline .. ': '
local testName = fileline .. handler.getFullName(element)
print('# ' .. testName)
end
io.flush()
return nil, true
end
handler.testEnd = function(element, parent, status, trace)
counter = counter + 1
if status == 'success' then
local t = handler.successes[#handler.successes]
print(success:format(counter, t.name))
elseif status == 'pending' then
local t = handler.pendings[#handler.pendings]
print(skip:format(counter, (t.message or t.name)))
elseif status == 'failure' then
showFailure(handler.failures[#handler.failures])
elseif status == 'error' then
showFailure(handler.errors[#handler.errors])
end
io.flush()
return nil, true
end
handler.error = function(element, parent, message, debug)
if element.descriptor ~= 'it' then
counter = counter + 1
showFailure(handler.errors[#handler.errors])
end
io.flush()
return nil, true
end
busted.subscribe({ 'suite', 'reset' }, handler.suiteReset)
busted.subscribe({ 'suite', 'end' }, handler.suiteEnd)
busted.subscribe({ 'test', 'start' }, handler.testStart, { predicate = handler.cancelOnPending })
busted.subscribe({ 'test', 'end' }, handler.testEnd, { predicate = handler.cancelOnPending })
busted.subscribe({ 'error' }, handler.error)
return handler
end

View File

@ -0,0 +1,307 @@
local s = require 'say'
local pretty = require 'pl.pretty'
local term = require 'term'
local global_helpers = require('test.helpers')
local colors
local isWindows = package.config:sub(1,1) == '\\'
if isWindows then
colors = setmetatable({}, {__index = function() return function(s) return s end end})
else
colors = require 'term.colors'
end
return function(options)
local busted = require 'busted'
local handler = require 'busted.outputHandlers.base'()
local c = {
succ = function(s) return colors.bright(colors.green(s)) end,
skip = function(s) return colors.bright(colors.yellow(s)) end,
fail = function(s) return colors.bright(colors.magenta(s)) end,
errr = function(s) return colors.bright(colors.red(s)) end,
test = tostring,
file = colors.cyan,
time = colors.dim,
note = colors.yellow,
sect = function(s) return colors.green(colors.dim(s)) end,
nmbr = colors.bright,
}
local repeatSuiteString = '\nRepeating all tests (run %d of %d) . . .\n\n'
local randomizeString = c.note('Note: Randomizing test order with a seed of %d.\n')
local globalSetup = c.sect('[----------]') .. ' Global test environment setup.\n'
local fileStartString = c.sect('[----------]') .. ' Running tests from ' .. c.file('%s') .. '\n'
local runString = c.sect('[ RUN ]') .. ' ' .. c.test('%s') .. ': '
local successString = c.succ('OK') .. '\n'
local skippedString = c.skip('SKIP') .. '\n'
local failureString = c.fail('FAIL') .. '\n'
local errorString = c.errr('ERR') .. '\n'
local fileEndString = c.sect('[----------]') .. ' '.. c.nmbr('%d') .. ' %s from ' .. c.file('%s') .. ' ' .. c.time('(%.2f ms total)') .. '\n\n'
local globalTeardown = c.sect('[----------]') .. ' Global test environment teardown.\n'
local suiteEndString = c.sect('[==========]') .. ' ' .. c.nmbr('%d') .. ' %s from ' .. c.nmbr('%d') .. ' test %s ran. ' .. c.time('(%.2f ms total)') .. '\n'
local successStatus = c.succ('[ PASSED ]') .. ' ' .. c.nmbr('%d') .. ' %s.\n'
local timeString = c.time('%.2f ms')
local summaryStrings = {
skipped = {
header = c.skip('[ SKIPPED ]') .. ' ' .. c.nmbr('%d') .. ' %s, listed below:\n',
test = c.skip('[ SKIPPED ]') .. ' %s\n',
footer = ' ' .. c.nmbr('%d') .. ' SKIPPED %s\n',
},
failure = {
header = c.fail('[ FAILED ]') .. ' ' .. c.nmbr('%d') .. ' %s, listed below:\n',
test = c.fail('[ FAILED ]') .. ' %s\n',
footer = ' ' .. c.nmbr('%d') .. ' FAILED %s\n',
},
error = {
header = c.errr('[ ERROR ]') .. ' ' .. c.nmbr('%d') .. ' %s, listed below:\n',
test = c.errr('[ ERROR ]') .. ' %s\n',
footer = ' ' .. c.nmbr('%d') .. ' %s\n',
},
}
c = nil
local fileCount = 0
local fileTestCount = 0
local testCount = 0
local successCount = 0
local skippedCount = 0
local failureCount = 0
local errorCount = 0
local pendingDescription = function(pending)
local name = pending.name
local string = ''
if type(pending.message) == 'string' then
string = string .. pending.message .. '\n'
elseif pending.message ~= nil then
string = string .. pretty.write(pending.message) .. '\n'
end
return string
end
local failureDescription = function(failure)
local string = failure.randomseed and ('Random seed: ' .. failure.randomseed .. '\n') or ''
if type(failure.message) == 'string' then
string = string .. failure.message
elseif failure.message == nil then
string = string .. 'Nil error'
else
string = string .. pretty.write(failure.message)
end
string = string .. '\n'
if options.verbose and failure.trace and failure.trace.traceback then
string = string .. failure.trace.traceback .. '\n'
end
return string
end
local getFileLine = function(element)
local fileline = ''
if element.trace or element.trace.short_src then
fileline = colors.cyan(element.trace.short_src) .. ' @ ' ..
colors.cyan(element.trace.currentline) .. ': '
end
return fileline
end
local getTestList = function(status, count, list, getDescription)
local string = ''
local header = summaryStrings[status].header
if count > 0 and header then
local tests = (count == 1 and 'test' or 'tests')
local errors = (count == 1 and 'error' or 'errors')
string = header:format(count, status == 'error' and errors or tests)
local testString = summaryStrings[status].test
if testString then
for _, t in ipairs(list) do
local fullname = getFileLine(t.element) .. colors.bright(t.name)
string = string .. testString:format(fullname)
string = string .. getDescription(t)
end
end
end
return string
end
local getSummary = function(status, count)
local string = ''
local footer = summaryStrings[status].footer
if count > 0 and footer then
local tests = (count == 1 and 'TEST' or 'TESTS')
local errors = (count == 1 and 'ERROR' or 'ERRORS')
string = footer:format(count, status == 'error' and errors or tests)
end
return string
end
local getSummaryString = function()
local tests = (successCount == 1 and 'test' or 'tests')
local string = successStatus:format(successCount, tests)
string = string .. getTestList('skipped', skippedCount, handler.pendings, pendingDescription)
string = string .. getTestList('failure', failureCount, handler.failures, failureDescription)
string = string .. getTestList('error', errorCount, handler.errors, failureDescription)
string = string .. ((skippedCount + failureCount + errorCount) > 0 and '\n' or '')
string = string .. getSummary('skipped', skippedCount)
string = string .. getSummary('failure', failureCount)
string = string .. getSummary('error', errorCount)
return string
end
handler.suiteReset = function()
fileCount = 0
fileTestCount = 0
testCount = 0
successCount = 0
skippedCount = 0
failureCount = 0
errorCount = 0
return nil, true
end
handler.suiteStart = function(suite, count, total, randomseed)
if total > 1 then
io.write(repeatSuiteString:format(count, total))
end
if randomseed then
io.write(randomizeString:format(randomseed))
end
io.write(globalSetup)
io.flush()
return nil, true
end
local function getElapsedTime(tbl)
if tbl.duration then
return tbl.duration * 1000
else
return tonumber('nan')
end
end
handler.suiteEnd = function(suite, count, total)
local elapsedTime_ms = getElapsedTime(suite)
local tests = (testCount == 1 and 'test' or 'tests')
local files = (fileCount == 1 and 'file' or 'files')
io.write(globalTeardown)
io.write(global_helpers.read_nvim_log())
io.write(suiteEndString:format(testCount, tests, fileCount, files, elapsedTime_ms))
io.write(getSummaryString())
io.flush()
return nil, true
end
handler.fileStart = function(file)
fileTestCount = 0
io.write(fileStartString:format(file.name))
io.flush()
return nil, true
end
handler.fileEnd = function(file)
local elapsedTime_ms = getElapsedTime(file)
local tests = (fileTestCount == 1 and 'test' or 'tests')
fileCount = fileCount + 1
io.write(fileEndString:format(fileTestCount, tests, file.name, elapsedTime_ms))
io.flush()
return nil, true
end
handler.testStart = function(element, parent)
io.write(runString:format(handler.getFullName(element)))
io.flush()
return nil, true
end
handler.testEnd = function(element, parent, status, debug)
local elapsedTime_ms = getElapsedTime(element)
local string
fileTestCount = fileTestCount + 1
testCount = testCount + 1
if status == 'success' then
successCount = successCount + 1
string = successString
elseif status == 'pending' then
skippedCount = skippedCount + 1
string = skippedString
elseif status == 'failure' then
failureCount = failureCount + 1
string = nil
elseif status == 'error' then
errorCount = errorCount + 1
string = nil
end
if string ~= nil then
if elapsedTime_ms == elapsedTime_ms then
string = timeString:format(elapsedTime_ms) .. ' ' .. string
end
io.write(string)
io.flush()
end
return nil, true
end
handler.testFailure = function(element, parent, message, debug)
io.write(failureString)
io.flush()
io.write(failureDescription(handler.failures[#handler.failures]))
io.flush()
return nil, true
end
handler.testError = function(element, parent, message, debug)
io.write(errorString)
io.flush()
io.write(failureDescription(handler.errors[#handler.errors]))
io.flush()
return nil, true
end
handler.error = function(element, parent, message, debug)
if element.descriptor ~= 'it' then
io.write(failureDescription(handler.errors[#handler.errors]))
io.flush()
errorCount = errorCount + 1
end
return nil, true
end
busted.subscribe({ 'suite', 'reset' }, handler.suiteReset)
busted.subscribe({ 'suite', 'start' }, handler.suiteStart)
busted.subscribe({ 'suite', 'end' }, handler.suiteEnd)
busted.subscribe({ 'file', 'start' }, handler.fileStart)
busted.subscribe({ 'file', 'end' }, handler.fileEnd)
busted.subscribe({ 'test', 'start' }, handler.testStart, { predicate = handler.cancelOnPending })
busted.subscribe({ 'test', 'end' }, handler.testEnd, { predicate = handler.cancelOnPending })
busted.subscribe({ 'failure', 'it' }, handler.testFailure)
busted.subscribe({ 'error', 'it' }, handler.testError)
busted.subscribe({ 'failure' }, handler.error)
busted.subscribe({ 'error' }, handler.error)
return handler
end

30
ci/before_cache.sh Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -e
set -o pipefail
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${CI_DIR}/common/build.sh"
source "${CI_DIR}/common/suite.sh"
# Don't cache pip's log and selfcheck.
rm -rf "${HOME}/.cache/pip/log"
rm -f "${HOME}/.cache/pip/selfcheck.json"
echo "before_cache.sh: cache size"
du -d 2 "${HOME}/.cache" | sort -n
echo "before_cache.sh: ccache stats"
ccache -s 2>/dev/null || true
# Update the third-party dependency cache only if the build was successful.
if ended_successfully; then
rm -rf "${HOME}/.cache/nvim-deps"
mv "${DEPS_BUILD_DIR}" "${HOME}/.cache/nvim-deps"
rm -rf "${HOME}/.cache/nvim-deps-downloads"
mv "${DEPS_DOWNLOAD_DIR}" "${HOME}/.cache/nvim-deps-downloads"
touch "${CACHE_MARKER}"
echo "Updated third-party dependencies (timestamp: $(_stat "${CACHE_MARKER}"))."
fi

42
ci/before_install.sh Executable file
View File

@ -0,0 +1,42 @@
#!/usr/bin/env bash
set -e
set -o pipefail
if [[ "${CI_TARGET}" == lint ]]; then
exit
fi
echo 'python info:'
(
2>&1 python --version || true
2>&1 python2 --version || true
2>&1 python3 --version || true
2>&1 pip --version || true
2>&1 pip2 --version || true
2>&1 pip3 --version || true
echo 'pyenv versions:'
2>&1 pyenv versions || true
) | sed 's/^/ /'
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
echo "Upgrade Python 3 pip"
python3 -m pip -q install --user --upgrade pip
else
echo "Upgrade Python 2 pip"
python2.7 -m pip -q install --user --upgrade pip
echo "Upgrade Python 3 pip"
# Allow failure. pyenv pip3 on travis is broken:
# https://github.com/travis-ci/travis-ci/issues/8363
python3 -m pip -q install --user --upgrade pip || true
fi
echo "Install node (LTS)"
if [[ "${TRAVIS_OS_NAME}" == osx ]] || [ ! -f ~/.nvm/nvm.sh ]; then
curl -o ~/.nvm/nvm.sh https://raw.githubusercontent.com/creationix/nvm/master/nvm.sh
fi
source ~/.nvm/nvm.sh
nvm install --lts
nvm use --lts

View File

@ -3,7 +3,7 @@
set -e
set -o pipefail
if [[ -n "${CI_TARGET}" ]]; then
if [[ "${CI_TARGET}" == lint ]]; then
exit
fi
@ -20,15 +20,18 @@ if [[ -n "${LLVM_SYMBOLIZER}" ]] && [[ ! $(type -P "${LLVM_SYMBOLIZER}") ]]; the
exit 1
fi
# Show ccache stats so we can compare in before_cache
ccache -s 2>/dev/null || true
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
# Compile dependencies.
build_deps
fi
# Compile dependencies.
build_deps
rm -rf "${LOG_DIR}"
mkdir -p "${LOG_DIR}"

137
ci/build.ps1 Normal file
View File

@ -0,0 +1,137 @@
$ErrorActionPreference = 'stop'
Set-PSDebug -Strict -Trace 1
$env:CONFIGURATION -match '^(?<compiler>\w+)_(?<bits>32|64)(?:-(?<option>\w+))?$'
$compiler = $Matches.compiler
$compileOption = $Matches.option
$bits = $Matches.bits
$cmakeBuildType = 'RelWithDebInfo'
$depsCmakeVars = @{
CMAKE_BUILD_TYPE = $cmakeBuildType;
}
$nvimCmakeVars = @{
CMAKE_BUILD_TYPE = $cmakeBuildType;
BUSTED_OUTPUT_TYPE = 'nvim';
}
$uploadToCodeCov = $false
# For pull requests, skip some build configurations to save time.
if ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -and $env:CONFIGURATION -match '^(MSVC_64|MINGW_32|MINGW_64-gcov)$') {
exit 0
}
function exitIfFailed() {
if ($LastExitCode -ne 0) {
Set-PSDebug -Off
exit $LastExitCode
}
}
if ($compiler -eq 'MINGW') {
if ($bits -eq 32) {
$arch = 'i686'
}
elseif ($bits -eq 64) {
$arch = 'x86_64'
}
if ($compileOption -eq 'gcov') {
$nvimCmakeVars['USE_GCOV'] = 'ON'
$uploadToCodecov = $true
}
# 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.
$cmakeGenerator = 'Ninja'
$cmakeGeneratorArgs = '-v'
$mingwPackages = @('ninja', 'cmake', 'perl', 'diffutils', 'unibilium').ForEach({
"mingw-w64-$arch-$_"
})
# Add MinGW to the PATH
$env:PATH = "C:\msys64\mingw$bits\bin;$env:PATH"
# Avoid pacman "warning" which causes non-zero return code. https://github.com/open62541/open62541/issues/2068
& C:\msys64\usr\bin\mkdir -p /var/cache/pacman/pkg
# Build third-party dependencies
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Su" ; exitIfFailed
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S $mingwPackages" ; exitIfFailed
}
elseif ($compiler -eq 'MSVC') {
$cmakeGeneratorArgs = '/verbosity:normal'
if ($bits -eq 32) {
$cmakeGenerator = 'Visual Studio 15 2017'
}
elseif ($bits -eq 64) {
$cmakeGenerator = 'Visual Studio 15 2017 Win64'
}
}
# Setup python (use AppVeyor system python)
C:\Python27\python.exe -m pip install pynvim ; exitIfFailed
C:\Python35\python.exe -m pip install pynvim ; exitIfFailed
# Disambiguate python3
move c:\Python35\python.exe c:\Python35\python3.exe
$env:PATH = "C:\Python35;C:\Python27;$env:PATH"
# Sanity check
python -c "import pynvim; print(str(pynvim))" ; exitIfFailed
python3 -c "import pynvim; print(str(pynvim))" ; exitIfFailed
$env:PATH = "C:\Ruby24\bin;$env:PATH"
gem.cmd install neovim
Get-Command -CommandType Application neovim-ruby-host.bat
npm.cmd install -g neovim
Get-Command -CommandType Application neovim-node-host.cmd
npm.cmd link neovim
function convertToCmakeArgs($vars) {
return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" }
}
if (-Not (Test-Path -PathType container .deps)) {
mkdir .deps
}
cd .deps
cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) ..\third-party\ ; exitIfFailed
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
cd ..
# Build Neovim
mkdir build
cd build
cmake -G $cmakeGenerator $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
bin\nvim --version ; exitIfFailed
# Functional tests
# The $LastExitCode from MSBuild can't be trusted
$failed = $false
# Temporarily turn off tracing to reduce log file output
Set-PSDebug -Off
cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs 2>&1 |
foreach { $failed = $failed -or
$_ -match 'functional tests failed with error'; $_ }
if ($failed) {
exit $LastExitCode
}
Set-PSDebug -Strict -Trace 1
if ($uploadToCodecov) {
C:\msys64\usr\bin\bash -lc "cd /c/projects/neovim; bash <(curl -s https://codecov.io/bash) -c -F functionaltest || echo 'codecov upload failed.'"
}
# Old tests
$env:PATH = "C:\msys64\usr\bin;$env:PATH"
& "C:\msys64\mingw$bits\bin\mingw32-make.exe" -C $(Convert-Path ..\src\nvim\testdir) VERBOSE=1
if ($uploadToCodecov) {
C:\msys64\usr\bin\bash -lc "cd /c/projects/neovim; bash <(curl -s https://codecov.io/bash) -c -F oldtest || echo 'codecov upload failed.'"
}
# Build artifacts
cpack -G ZIP -C RelWithDebInfo
if ($env:APPVEYOR_REPO_TAG_NAME -ne $null) {
cpack -G NSIS -C RelWithDebInfo
}

106
ci/common/build.sh Normal file
View File

@ -0,0 +1,106 @@
_stat() {
if test "${TRAVIS_OS_NAME}" = osx ; then
stat -f %Sm "${@}"
else
stat -c %y "${@}"
fi
}
top_make() {
printf '%78s\n' | tr ' ' '='
# Travis has 1.5 virtual cores according to:
# http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
ninja "$@"
}
build_make() {
top_make -C "${BUILD_DIR}" "$@"
}
build_deps() {
if test "${BUILD_32BIT}" = ON ; then
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
fi
if test "${FUNCTIONALTEST}" = "functionaltest-lua" \
|| test "${CLANG_SANITIZER}" = "ASAN_UBSAN" ; then
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
fi
mkdir -p "${DEPS_BUILD_DIR}"
mkdir -p "${DEPS_DOWNLOAD_DIR}"
# Use cached dependencies if $CACHE_MARKER exists.
if test "${CACHE_ENABLE}" = "false" ; then
export CCACHE_RECACHE=1
elif test -f "${CACHE_MARKER}" ; then
echo "Using third-party dependencies from Travis cache (last update: $(_stat "${CACHE_MARKER}"))."
cp -r "${HOME}/.cache/nvim-deps"/. "${DEPS_BUILD_DIR}"
cp -r "${HOME}/.cache/nvim-deps-downloads"/. "${DEPS_DOWNLOAD_DIR}"
fi
# Even if we're using cached dependencies, run CMake and make to
# update CMake configuration and update to newer deps versions.
cd "${DEPS_BUILD_DIR}"
echo "Configuring with '${DEPS_CMAKE_FLAGS}'."
CC= cmake -G Ninja ${DEPS_CMAKE_FLAGS} "${TRAVIS_BUILD_DIR}/third-party/"
if ! top_make; then
exit 1
fi
cd "${TRAVIS_BUILD_DIR}"
}
prepare_build() {
if test -n "${CLANG_SANITIZER}" ; then
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
fi
if test "${BUILD_32BIT}" = ON ; then
CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
fi
mkdir -p "${BUILD_DIR}"
cd "${BUILD_DIR}"
echo "Configuring with '${CMAKE_FLAGS} $@'."
cmake -G Ninja ${CMAKE_FLAGS} "$@" "${TRAVIS_BUILD_DIR}"
}
build_nvim() {
echo "Building nvim."
if ! top_make nvim ; then
exit 1
fi
if test "$CLANG_SANITIZER" != "TSAN" ; then
echo "Building libnvim."
if ! top_make libnvim ; then
exit 1
fi
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
echo "Building nvim-test."
if ! top_make nvim-test ; then
exit 1
fi
fi
fi
# Invoke nvim to trigger *San early.
if ! (bin/nvim --version && bin/nvim -u NONE -e -c ':qall') ; then
asan_check "${LOG_DIR}"
exit 1
fi
asan_check "${LOG_DIR}"
cd "${TRAVIS_BUILD_DIR}"
}
macos_rvm_dance() {
# neovim-ruby gem requires a ruby newer than the macOS default.
source ~/.rvm/scripts/rvm
rvm get stable --auto-dotfiles
rvm reload
rvm use 2.2.5
rvm use
}

192
ci/common/suite.sh Normal file
View File

@ -0,0 +1,192 @@
# HACK: get newline for use in strings given that "\n" and $'' do not work.
NL="$(printf '\nE')"
NL="${NL%E}"
FAIL_SUMMARY=""
# Test success marker. If END_MARKER file exists, we know that all tests
# finished. If FAIL_SUMMARY_FILE exists we know that some tests failed, this
# file will contain information about failed tests. Build is considered
# successful if tests ended without any of them failing.
END_MARKER="$BUILD_DIR/.tests_finished"
FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors"
ANSI_CLEAR="\033[0K"
travis_fold() {
local action="$1"
local name="$2"
name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')"
name="$(echo -n "$name" | sed 's/-$//')"
echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}"
}
if test "$TRAVIS" != "true" ; then
travis_fold() {
return 0
}
fi
enter_suite() {
set +x
FAILED=0
rm -f "${END_MARKER}"
local suite_name="$1"
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE}/$suite_name"
travis_fold start "${NVIM_TEST_CURRENT_SUITE}"
set -x
}
exit_suite() {
set +x
travis_fold end "${NVIM_TEST_CURRENT_SUITE}"
if test $FAILED -ne 0 ; then
echo "Suite ${NVIM_TEST_CURRENT_SUITE} failed, summary:"
echo "${FAIL_SUMMARY}"
fi
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}"
if test "$1" != "--continue" ; then
exit $FAILED
else
local saved_failed=$FAILED
FAILED=0
return $saved_failed
fi
}
fail() {
local test_name="$1"
local fail_char="$2"
local message="$3"
: ${fail_char:=F}
: ${message:=Test $test_name failed}
local full_msg="$fail_char $NVIM_TEST_CURRENT_SUITE|$test_name :: $message"
FAIL_SUMMARY="${FAIL_SUMMARY}${NL}${full_msg}"
echo "${full_msg}" >> "${FAIL_SUMMARY_FILE}"
echo "Failed: $full_msg"
FAILED=1
}
run_test() {
local cmd="$1"
test $# -gt 0 && shift
local test_name="$1"
: ${test_name:=$cmd}
test $# -gt 0 && shift
if ! eval "$cmd" ; then
fail "${test_name}" "$@"
fi
}
run_test_wd() {
local hang_ok=
if test "$1" = "--allow-hang" ; then
hang_ok=1
shift
fi
local timeout="$1"
test $# -gt 0 && shift
local cmd="$1"
test $# -gt 0 && shift
local restart_cmd="$1"
: ${restart_cmd:=true}
test $# -gt 0 && shift
local test_name="$1"
: ${test_name:=$cmd}
test $# -gt 0 && shift
local output_file="$(mktemp)"
local status_file="$(mktemp)"
local sid_file="$(mktemp)"
local restarts=5
local prev_tmpsize=-1
while test $restarts -gt 0 ; do
: > "$status_file"
: > "$sid_file"
setsid \
env \
output_file="$output_file" \
status_file="$status_file" \
sid_file="$sid_file" \
cmd="$cmd" \
CI_DIR="$CI_DIR" \
sh -c '
. "${CI_DIR}/common/test.sh"
ps -o sid= > "$sid_file"
(
ret=0
if ! eval "$cmd" 2>&1 ; then
ret=1
fi
echo "$ret" > "$status_file"
) | tee -a "$output_file"
'
while test "$(stat -c "%s" "$status_file")" -eq 0 ; do
prev_tmpsize=$tmpsize
sleep $timeout
tmpsize="$(stat -c "%s" "$output_file")"
if test $tempsize -eq $prev_temsize ; then
# no output, assuming either hang or exit
break
fi
done
restarts=$(( restarts - 1 ))
if test "$(stat -c "%s" "$status_file")" -eq 0 ; then
# Status file not updated, assuming hang
# SID not known, this should not ever happen
if test "$(stat -c "%s" "$sid_file")" -eq 0 ; then
fail "$test_name" E "Shell did not run"
break
fi
# Kill all processes which belong to one session: should get rid of test
# processes as well as sh itself.
pkill -KILL -s$(cat "$sid_file")
if test $restarts -eq 0 ; then
if test -z "$hang_ok" ; then
fail "$test_name" E "Test hang up"
fi
else
echo "Test ${test_name} hang up, restarting"
eval "$restart_cmd"
fi
else
local new_failed="$(cat "$status_file")"
if test "$new_failed" != "0" ; then
fail "$test_name" F "Test failed in run_test_wd"
fi
break
fi
done
rm -f "$output_file"
rm -f "$status_file"
rm -f "$sid_file"
}
ended_successfully() {
if test -f "${FAIL_SUMMARY_FILE}" ; then
echo 'Test failed, complete summary:'
cat "${FAIL_SUMMARY_FILE}"
return 1
fi
if ! test -f "${END_MARKER}" ; then
echo 'ended_successfully called before end marker was touched'
return 1
fi
return 0
}
end_tests() {
touch "${END_MARKER}"
ended_successfully
}

190
ci/common/test.sh Normal file
View File

@ -0,0 +1,190 @@
. "${CI_DIR}/common/build.sh"
. "${CI_DIR}/common/suite.sh"
submit_coverage() {
if [ -n "${GCOV}" ]; then
if curl --fail --output codecov.bash --silent https://codecov.io/bash; then
bash codecov.bash -c -F "$1" || echo "codecov upload failed."
rm -f codecov.bash
fi
fi
}
print_core() {
local app="$1"
local core="$2"
if test "$app" = quiet ; then
echo "Found core $core"
return 0
fi
echo "======= Core file $core ======="
if test "${TRAVIS_OS_NAME}" = osx ; then
lldb -Q -o "bt all" -f "${app}" -c "${core}"
else
gdb -n -batch -ex 'thread apply all bt full' "${app}" -c "${core}"
fi
}
check_core_dumps() {
local del=
if test "$1" = "--delete" ; then
del=1
shift
fi
local app="${1:-${BUILD_DIR}/bin/nvim}"
if test "${TRAVIS_OS_NAME}" = osx ; then
local cores="$(find /cores/ -type f -print)"
local _sudo='sudo'
else
local cores="$(find ./ -type f -name 'core.*' -print)"
local _sudo=
fi
if test -z "${cores}" ; then
return
fi
local core
for core in $cores; do
if test "$del" = "1" ; then
print_core "$app" "$core" >&2
"$_sudo" rm "$core"
else
print_core "$app" "$core"
fi
done
if test "$app" != quiet ; then
fail 'cores' E 'Core dumps found'
fi
}
check_logs() {
# Iterate through each log to remove an useless warning.
for log in $(find "${1}" -type f -name "${2}"); do
sed -i "${log}" \
-e '/Warning: noted but unhandled ioctl/d' \
-e '/could cause spurious value errors to appear/d' \
-e '/See README_MISSING_SYSCALL_OR_IOCTL for guidance/d'
done
# Now do it again, but only consider files with size > 0.
local err=""
for log in $(find "${1}" -type f -name "${2}" -size +0); do
cat "${log}"
err=1
done
if test -n "${err}" ; then
fail 'logs' E 'Runtime errors detected.'
fi
}
valgrind_check() {
check_logs "${1}" "valgrind-*"
}
asan_check() {
if test "${CLANG_SANITIZER}" = "ASAN_UBSAN" ; then
check_logs "${1}" "*san.*" | $ASAN_SYMBOLIZE
fi
}
run_unittests() {(
enter_suite unittests
ulimit -c unlimited || true
if ! build_make unittest ; then
fail 'unittests' F 'Unit tests failed'
fi
submit_coverage unittest
check_core_dumps "$(which luajit)"
exit_suite
)}
run_functionaltests() {(
enter_suite functionaltests
ulimit -c unlimited || true
if ! build_make ${FUNCTIONALTEST}; then
fail 'functionaltests' F 'Functional tests failed'
fi
submit_coverage functionaltest
asan_check "${LOG_DIR}"
valgrind_check "${LOG_DIR}"
check_core_dumps
exit_suite
)}
run_oldtests() {(
enter_suite oldtests
ulimit -c unlimited || true
if ! make -C "${TRAVIS_BUILD_DIR}/src/nvim/testdir"; then
reset
fail 'oldtests' F 'Legacy tests failed'
fi
submit_coverage oldtest
asan_check "${LOG_DIR}"
valgrind_check "${LOG_DIR}"
check_core_dumps
exit_suite
)}
check_runtime_files() {(
set +x
local test_name="$1" ; shift
local message="$1" ; shift
local tst="$1" ; shift
cd runtime
for file in $(git ls-files "$@") ; do
# Check that test is not trying to work with files with spaces/etc
# Prefer failing the build over using more robust construct because files
# with IFS are not welcome.
if ! test -e "$file" ; then
fail "$test_name" E \
"It appears that $file is only a part of the file name"
fi
if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file" ; then
fail "$test_name" F "$(printf "$message" "$file")"
fi
done
)}
install_nvim() {(
enter_suite 'install_nvim'
if ! build_make install ; then
fail 'install' E 'make install failed'
exit_suite
fi
"${INSTALL_PREFIX}/bin/nvim" --version
if ! "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' ; then
echo "Running ':help' in the installed nvim failed."
echo "Maybe the helptags have not been generated properly."
fail 'help' F 'Failed running :help'
fi
# Check that all runtime files were installed
check_runtime_files \
'runtime-install' \
'It appears that %s is not installed.' \
-e \
'*.vim' '*.ps' '*.dict' '*.py' '*.tutor'
# Check that some runtime files are installed and are executables
check_runtime_files \
'not-exe' \
'It appears that %s is not installed or is not executable.' \
-x \
'*.awk' '*.sh' '*.bat'
# Check that generated syntax file has function names, #5060.
local genvimsynf=syntax/vim/generated.vim
local gpat='syn keyword vimFuncName .*eval'
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then
fail 'funcnames' F "It appears that $genvimsynf does not contain $gpat."
fi
exit_suite
)}
csi_clean() {
find "${BUILD_DIR}/bin" -name 'test-includes-*' -delete
find "${BUILD_DIR}" -name '*test-include*.o' -delete
}

32
ci/install.sh Executable file
View File

@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -e
set -o pipefail
if [[ "${CI_TARGET}" == lint ]]; then
exit
fi
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
export PATH="/usr/local/opt/ccache/libexec:$PATH"
fi
echo "Install neovim module for Python 3."
# Allow failure. pyenv pip3 on travis is broken:
# https://github.com/travis-ci/travis-ci/issues/8363
CC=cc python3 -m pip -q install --user --upgrade neovim || true
if ! [ "${TRAVIS_OS_NAME}" = osx ] ; then
# Update PATH for pip.
export PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:$PATH"
# Use default CC to avoid compilation problems when installing Python modules.
echo "Install neovim module for Python 2."
CC=cc python2.7 -m pip -q install --user --upgrade neovim
fi
echo "Install neovim RubyGem."
gem install --no-document --version ">= 0.8.0" neovim
echo "Install neovim npm package"
npm install -g neovim
npm link neovim

40
ci/run_lint.sh Executable file
View File

@ -0,0 +1,40 @@
#!/usr/bin/env bash
set -e
set -o pipefail
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${CI_DIR}/common/build.sh"
source "${CI_DIR}/common/suite.sh"
enter_suite 'clint'
run_test 'make clint-full' clint
exit_suite --continue
enter_suite 'testlint'
run_test 'make testlint' testlint
exit_suite --continue
enter_suite 'lualint'
run_test 'make lualint' lualint
exit_suite --continue
enter_suite single-includes
CLICOLOR_FORCE=1 run_test_wd \
--allow-hang \
10s \
'make check-single-includes' \
'csi_clean' \
single-includes
exit_suite --continue
end_tests

36
ci/run_tests.sh Executable file
View File

@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -e
set -o pipefail
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${CI_DIR}/common/build.sh"
source "${CI_DIR}/common/test.sh"
source "${CI_DIR}/common/suite.sh"
enter_suite build
check_core_dumps --delete quiet
prepare_build
build_nvim
exit_suite --continue
enter_suite tests
if test "$CLANG_SANITIZER" != "TSAN" ; then
# Additional threads are only created when the builtin UI starts, which
# doesn't happen in the unit/functional tests
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
run_test run_unittests
fi
run_test run_functionaltests
fi
run_test run_oldtests
run_test install_nvim
exit_suite --continue
end_tests

View File

@ -3,19 +3,11 @@
set -e
set -o pipefail
if [[ -n "${CI_TARGET}" ]]; then
make lint
exit 0
fi
# This will pass the environment variables down to a bash process which runs
# 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"
sudo -E su "${USER}" -c "ci/run_${CI_TARGET}.sh"
else
.ci/run_tests.sh
ci/run_${CI_TARGET}.sh
fi

18
cmake/Download.cmake Normal file
View File

@ -0,0 +1,18 @@
file(
DOWNLOAD "${URL}" "${FILE}"
STATUS status
LOG log
)
list(GET status 0 status_code)
list(GET status 1 status_string)
if(NOT status_code EQUAL 0)
if(NOT ALLOW_FAILURE)
message(FATAL_ERROR "error: downloading '${URL}' failed
status_code: ${status_code}
status_string: ${status_string}
log: ${log}
")
endif()
endif()

View File

@ -8,7 +8,7 @@
include(LibFindMacros)
find_path(ICONV_INCLUDE_DIR NAMES iconv.h)
find_library(ICONV_LIBRARY NAMES iconv)
find_library(ICONV_LIBRARY NAMES iconv libiconv)
set(Iconv_PROCESS_INCLUDES ICONV_INCLUDE_DIR)
if(ICONV_LIBRARY)

View File

@ -4,7 +4,7 @@
# JEMALLOC_INCLUDE_DIRS - The jemalloc include directories
# JEMALLOC_LIBRARIES - The libraries needed to use jemalloc
if(NOT JEMALLOC_USE_BUNDLED)
if(NOT USE_BUNDLED_JEMALLOC)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_JEMALLOC QUIET jemalloc)
@ -27,6 +27,9 @@ find_path(JEMALLOC_INCLUDE_DIR jemalloc/jemalloc.h
if(JEMALLOC_USE_STATIC)
list(APPEND JEMALLOC_NAMES
"${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
list(INSERT JEMALLOC_NAMES 0
"${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()
list(APPEND JEMALLOC_NAMES jemalloc)

View File

@ -27,16 +27,15 @@ find_path(LibIntl_INCLUDE_DIR
)
find_library(LibIntl_LIBRARY
NAMES intl libintl.a
NAMES intl libintl
)
if (LibIntl_INCLUDE_DIR)
set(CMAKE_REQUIRED_INCLUDES "${LibIntl_INCLUDE_DIR}")
endif()
# This is required because some operating systems don't have a separate
# libintl--it is built into glibc. So we only need to specify the library
# if one was actually found.
# On some systems (linux+glibc) libintl is passively available.
# So only specify the library if one was found.
if (LibIntl_LIBRARY)
set(CMAKE_REQUIRED_LIBRARIES "${LibIntl_LIBRARY}")
endif()
@ -46,12 +45,20 @@ check_c_source_compiles("
int main(int argc, char** argv) {
gettext(\"foo\");
ngettext(\"foo\", \"bar\", 1);
bindtextdomain(\"foo\", \"bar\");
bind_textdomain_codeset(\"foo\", \"bar\");
textdomain(\"foo\");
}" HAVE_WORKING_LIBINTL)
if (HAVE_WORKING_LIBINTL)
# On some systems (linux+glibc) libintl is passively available.
# If HAVE_WORKING_LIBINTL then we consider the requirement satisfied.
# Unset REQUIRED so that libfind_process(LibIntl) can proceed.
if(LibIntl_FIND_REQUIRED)
unset(LibIntl_FIND_REQUIRED)
endif()
check_variable_exists(_nl_msg_cat_cntr HAVE_NL_MSG_CAT_CNTR)
endif()

View File

@ -4,7 +4,7 @@
# LIBTERMKEY_INCLUDE_DIRS - The libtermkey include directories
# LIBTERMKEY_LIBRARIES - The libraries needed to use libtermkey
if(NOT LIBTERMKEY_USE_BUNDLED)
if(NOT USE_BUNDLED_LIBTERMKEY)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_LIBTERMKEY QUIET termkey)

View File

@ -8,7 +8,7 @@
# Set the LIBUV_USE_STATIC variable to specify if static libraries should
# be preferred to shared ones.
if(NOT LIBUV_USE_BUNDLED)
if(NOT USE_BUNDLED_LIBUV)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_LIBUV QUIET libuv)
@ -31,11 +31,7 @@ if(LIBUV_USE_STATIC)
"${CMAKE_STATIC_LIBRARY_PREFIX}uv${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif(LIBUV_USE_STATIC)
if(MSVC)
list(APPEND LIBUV_NAMES libuv)
else()
list(APPEND LIBUV_NAMES uv)
endif()
list(APPEND LIBUV_NAMES uv)
find_library(LIBUV_LIBRARY NAMES ${LIBUV_NAMES}
HINTS ${PC_LIBUV_LIBDIR} ${PC_LIBUV_LIBRARY_DIRS}
@ -65,7 +61,7 @@ if(HAVE_LIBKSTAT)
endif()
check_library_exists(kvm kvm_open "kvm.h" HAVE_LIBKVM)
if(HAVE_LIBKVM)
if(HAVE_LIBKVM AND NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
list(APPEND LIBUV_LIBRARIES kvm)
endif()

View File

@ -4,7 +4,7 @@
# LIBVTERM_INCLUDE_DIRS - The libvterm include directories
# LIBVTERM_LIBRARIES - The libraries needed to use libvterm
if(NOT LIBVTERM_USE_BUNDLED)
if(NOT USE_BUNDLED_LIBVTERM)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_LIBVTERM QUIET vterm)

197
cmake/FindLua.cmake Normal file
View File

@ -0,0 +1,197 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindLua
# -------
#
#
#
# Locate Lua library This module defines
#
# ::
#
# LUA_FOUND - if false, do not try to link to Lua
# LUA_LIBRARIES - both lua and lualib
# LUA_INCLUDE_DIR - where to find lua.h
# LUA_VERSION_STRING - the version of Lua found
# LUA_VERSION_MAJOR - the major version of Lua
# LUA_VERSION_MINOR - the minor version of Lua
# LUA_VERSION_PATCH - the patch version of Lua
#
#
#
# Note that the expected include convention is
#
# ::
#
# #include "lua.h"
#
# and not
#
# ::
#
# #include <lua/lua.h>
#
# This is because, the lua location is not standardized and may exist in
# locations other than lua/
unset(_lua_include_subdirs)
unset(_lua_library_names)
unset(_lua_append_versions)
# this is a function only to have all the variables inside go away automatically
function(_lua_set_version_vars)
set(LUA_VERSIONS5 5.3 5.2 5.1 5.0)
if (Lua_FIND_VERSION_EXACT)
if (Lua_FIND_VERSION_COUNT GREATER 1)
set(_lua_append_versions ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR})
endif ()
elseif (Lua_FIND_VERSION)
# once there is a different major version supported this should become a loop
if (NOT Lua_FIND_VERSION_MAJOR GREATER 5)
if (Lua_FIND_VERSION_COUNT EQUAL 1)
set(_lua_append_versions ${LUA_VERSIONS5})
else ()
foreach (subver IN LISTS LUA_VERSIONS5)
if (NOT subver VERSION_LESS ${Lua_FIND_VERSION})
list(APPEND _lua_append_versions ${subver})
endif ()
endforeach ()
endif ()
endif ()
else ()
# once there is a different major version supported this should become a loop
set(_lua_append_versions ${LUA_VERSIONS5})
endif ()
list(APPEND _lua_include_subdirs "include/lua" "include")
foreach (ver IN LISTS _lua_append_versions)
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _ver "${ver}")
list(APPEND _lua_include_subdirs
include/lua${CMAKE_MATCH_1}${CMAKE_MATCH_2}
include/lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
include/lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
)
endforeach ()
set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE)
set(_lua_append_versions "${_lua_append_versions}" PARENT_SCOPE)
endfunction(_lua_set_version_vars)
function(_lua_check_header_version _hdr_file)
# At least 5.[012] have different ways to express the version
# so all of them need to be tested. Lua 5.2 defines LUA_VERSION
# and LUA_RELEASE as joined by the C preprocessor, so avoid those.
file(STRINGS "${_hdr_file}" lua_version_strings
REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*")
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};")
if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$")
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};")
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};")
set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}")
else ()
string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
if (NOT LUA_VERSION_STRING MATCHES "^[0-9.]+$")
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
endif ()
string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" LUA_VERSION_MAJOR "${LUA_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}")
endif ()
foreach (ver IN LISTS _lua_append_versions)
if (ver STREQUAL "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
set(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR} PARENT_SCOPE)
set(LUA_VERSION_MINOR ${LUA_VERSION_MINOR} PARENT_SCOPE)
set(LUA_VERSION_PATCH ${LUA_VERSION_PATCH} PARENT_SCOPE)
set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE)
return()
endif ()
endforeach ()
endfunction(_lua_check_header_version)
_lua_set_version_vars()
if (LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
_lua_check_header_version("${LUA_INCLUDE_DIR}/lua.h")
endif ()
if (NOT LUA_VERSION_STRING)
foreach (subdir IN LISTS _lua_include_subdirs)
unset(LUA_INCLUDE_PREFIX CACHE)
find_path(LUA_INCLUDE_PREFIX ${subdir}/lua.h
HINTS
ENV LUA_DIR
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
)
if (LUA_INCLUDE_PREFIX)
_lua_check_header_version("${LUA_INCLUDE_PREFIX}/${subdir}/lua.h")
if (LUA_VERSION_STRING)
set(LUA_INCLUDE_DIR "${LUA_INCLUDE_PREFIX}/${subdir}")
break()
endif ()
endif ()
endforeach ()
endif ()
unset(_lua_include_subdirs)
unset(_lua_append_versions)
if (LUA_VERSION_STRING)
set(_lua_library_names
lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}
lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
lua.${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
)
endif ()
find_library(LUA_LIBRARY
NAMES ${_lua_library_names} lua
HINTS
ENV LUA_DIR
PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw
/opt/local
/opt/csw
/opt
)
unset(_lua_library_names)
if (LUA_LIBRARY)
# include the math library for Unix
if (UNIX AND NOT APPLE AND NOT BEOS)
find_library(LUA_MATH_LIBRARY m)
set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}")
# include dl library for statically-linked Lua library
get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT)
if(LUA_LIB_EXT STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX)
list(APPEND LUA_LIBRARIES ${CMAKE_DL_LIBS})
endif()
# For Windows and Mac, don't need to explicitly include the math library
else ()
set(LUA_LIBRARIES "${LUA_LIBRARY}")
endif ()
endif ()
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
VERSION_VAR LUA_VERSION_STRING)
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARY LUA_MATH_LIBRARY)

View File

@ -4,7 +4,7 @@
# LUAJIT_INCLUDE_DIRS - The luajit include directories
# LUAJIT_LIBRARIES - The libraries needed to use luajit
if(NOT LUAJIT_USE_BUNDLED)
if(NOT USE_BUNDLED_LUAJIT)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_LUAJIT QUIET luajit)
@ -34,7 +34,7 @@ endif()
if(MSVC)
list(APPEND LUAJIT_NAMES lua51)
elseif(MINGW)
list(APPEND LUAJIT_NAMES libluajit)
list(APPEND LUAJIT_NAMES libluajit libluajit-5.1)
else()
list(APPEND LUAJIT_NAMES luajit-5.1)
endif()

View File

@ -4,10 +4,12 @@
# MSGPACK_INCLUDE_DIRS - The msgpack include directories
# MSGPACK_LIBRARIES - The libraries needed to use msgpack
if(NOT MSGPACK_USE_BUNDLED)
if(NOT USE_BUNDLED_MSGPACK)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_MSGPACK QUIET msgpack)
pkg_search_module(PC_MSGPACK QUIET
msgpackc>=${Msgpack_FIND_VERSION}
msgpack>=${Msgpack_FIND_VERSION})
endif()
else()
set(PC_MSGPACK_INCLUDEDIR)
@ -19,19 +21,38 @@ endif()
set(MSGPACK_DEFINITIONS ${PC_MSGPACK_CFLAGS_OTHER})
find_path(MSGPACK_INCLUDE_DIR msgpack.h
find_path(MSGPACK_INCLUDE_DIR msgpack/version_master.h
HINTS ${PC_MSGPACK_INCLUDEDIR} ${PC_MSGPACK_INCLUDE_DIRS}
${LIMIT_SEARCH})
# If we're asked to use static linkage, add libmsgpack.a as a preferred library name.
if(MSGPACK_INCLUDE_DIR)
file(READ ${MSGPACK_INCLUDE_DIR}/msgpack/version_master.h msgpack_version_h)
string(REGEX REPLACE ".*MSGPACK_VERSION_MAJOR +([0-9]+).*" "\\1" MSGPACK_VERSION_MAJOR "${msgpack_version_h}")
string(REGEX REPLACE ".*MSGPACK_VERSION_MINOR +([0-9]+).*" "\\1" MSGPACK_VERSION_MINOR "${msgpack_version_h}")
string(REGEX REPLACE ".*MSGPACK_VERSION_REVISION +([0-9]+).*" "\\1" MSGPACK_VERSION_REVISION "${msgpack_version_h}")
set(MSGPACK_VERSION_STRING "${MSGPACK_VERSION_MAJOR}.${MSGPACK_VERSION_MINOR}.${MSGPACK_VERSION_REVISION}")
else()
set(MSGPACK_VERSION_STRING)
endif()
# If we're asked to use static linkage, add libmsgpack{,c}.a as a preferred library name.
if(MSGPACK_USE_STATIC)
list(APPEND MSGPACK_NAMES
"${CMAKE_STATIC_LIBRARY_PREFIX}msgpackc${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${CMAKE_STATIC_LIBRARY_PREFIX}msgpack${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()
list(APPEND MSGPACK_NAMES msgpack)
if(MSVC)
# The import library for the msgpack DLL has a different name
list(APPEND MSGPACK_NAMES msgpackc_import)
else()
list(APPEND MSGPACK_NAMES msgpackc msgpack)
endif()
find_library(MSGPACK_LIBRARY NAMES ${MSGPACK_NAMES}
# Check each directory for all names to avoid using headers/libraries from
# different places.
NAMES_PER_DIR
HINTS ${PC_MSGPACK_LIBDIR} ${PC_MSGPACK_LIBRARY_DIRS}
${LIMIT_SEARCH})
@ -43,6 +64,7 @@ set(MSGPACK_INCLUDE_DIRS ${MSGPACK_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set MSGPACK_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(Msgpack DEFAULT_MSG
MSGPACK_LIBRARY MSGPACK_INCLUDE_DIR)
find_package_handle_standard_args(Msgpack
REQUIRED_VARS MSGPACK_LIBRARY MSGPACK_INCLUDE_DIR
VERSION_VAR MSGPACK_VERSION_STRING)

View File

@ -4,7 +4,7 @@
# UNIBILIUM_INCLUDE_DIRS - The unibilium include directories
# UNIBILIUM_LIBRARIES - The libraries needed to use unibilium
if(NOT UNIBILIUM_USE_BUNDLED)
if(NOT USE_BUNDLED_UNIBILIUM)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_UNIBILIUM QUIET unibilium)

10
cmake/FindWinpty.cmake Normal file
View File

@ -0,0 +1,10 @@
include(LibFindMacros)
find_path(WINPTY_INCLUDE_DIR winpty.h)
set(WINPTY_INCLUDE_DIRS ${WINPTY_INCLUDE_DIR})
find_library(WINPTY_LIBRARY winpty)
find_program(WINPTY_AGENT_EXE winpty-agent.exe)
set(WINPTY_LIBRARIES ${WINPTY_LIBRARY})
find_package_handle_standard_args(Winpty DEFAULT_MSG WINPTY_LIBRARY WINPTY_INCLUDE_DIR)

View File

@ -8,7 +8,7 @@ else()
HELPTAGS_WORKING_DIRECTORY)
endif()
message(STATUS "Generating helptags in ${HELPTAGS_WORKING_DIRECTORY}.")
message(STATUS "Generating helptags in ${HELPTAGS_WORKING_DIRECTORY}")
if(EXISTS ${HELPTAGS_WORKING_DIRECTORY}/)
message(STATUS "${HELPTAGS_WORKING_DIRECTORY} already exists")
# If the doc directory already exists, helptags could fail due to duplicate

View File

@ -38,6 +38,7 @@ function(get_compile_flags _compile_flags)
get_directory_property(include_directories_list
DIRECTORY "src/nvim"
INCLUDE_DIRECTORIES)
list(REMOVE_DUPLICATES include_directories_list)
foreach(include_directory ${include_directories_list})
set(include_directories "${include_directories} -I${include_directory}")
endforeach()

View File

@ -0,0 +1,2 @@
file(GLOB_RECURSE JSON_FILES *.json)
file(COPY ${JSON_FILES} DESTINATION "${TARGET}")

View File

@ -1,3 +1,12 @@
# Fix CMAKE_INSTALL_MANDIR on BSD before including GNUInstallDirs. #6771
if(CMAKE_SYSTEM_NAME MATCHES "BSD" AND NOT DEFINED CMAKE_INSTALL_MANDIR)
if(DEFINED ENV{MANPREFIX})
set(CMAKE_INSTALL_MANDIR "$ENV{MANPREFIX}/man")
elseif(CMAKE_INSTALL_PREFIX MATCHES "^/usr/local$")
set(CMAKE_INSTALL_MANDIR "man")
endif()
endif()
# For $CMAKE_INSTALL_{DATAROOT,MAN, ...}DIR
include(GNUInstallDirs)

View File

@ -4,12 +4,9 @@
# Check if a module is available in Lua
function(check_lua_module LUA_PRG_PATH MODULE RESULT_VAR)
execute_process(COMMAND ${LUA_PRG_PATH} -e "require('${MODULE}')"
RESULT_VARIABLE module_missing
ERROR_QUIET)
execute_process(COMMAND ${LUA_PRG_PATH} -l "${MODULE}" -e ""
RESULT_VARIABLE module_missing)
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)
@ -20,7 +17,7 @@ endfunction()
function(check_lua_deps LUA_PRG_PATH MODULES RESULT_VAR)
# Check if the lua interpreter at the given path
# satisfies all Neovim dependencies
message(STATUS "Checking Lua interpreter ${LUA_PRG_PATH}")
message(STATUS "Checking Lua interpreter: ${LUA_PRG_PATH}")
if(NOT EXISTS ${LUA_PRG_PATH})
message(STATUS
"[${LUA_PRG_PATH}] file not found")
@ -29,6 +26,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

@ -1,28 +0,0 @@
get_filename_component(LINT_DIR ${LINT_DIR} ABSOLUTE)
get_filename_component(LINT_PREFIX ${LINT_DIR} PATH)
set(LINT_SUPPRESS_FILE "${LINT_PREFIX}/errors.json")
file(GLOB_RECURSE LINT_FILES ${LINT_DIR}/*.c ${LINT_DIR}/*.h)
set(LINT_ARGS)
if(LINT_SUPPRESS_URL)
file(DOWNLOAD ${LINT_SUPPRESS_URL} ${LINT_SUPPRESS_FILE})
list(APPEND LINT_ARGS "--suppress-errors=${LINT_SUPPRESS_FILE}")
endif()
foreach(lint_file ${LINT_FILES})
file(RELATIVE_PATH lint_file "${LINT_PREFIX}" "${lint_file}")
list(APPEND LINT_ARGS "${lint_file}")
endforeach()
execute_process(
COMMAND ${LINT_PRG} ${LINT_ARGS}
RESULT_VARIABLE res
WORKING_DIRECTORY "${LINT_PREFIX}")
file(REMOVE ${LINT_SUPPRESS_FILE})
if(NOT res EQUAL 0)
message(FATAL_ERROR "Linting failed: ${res}.")
endif()

22
cmake/RunLuacheck.cmake Normal file
View File

@ -0,0 +1,22 @@
set(LUACHECK_ARGS -q "${LUAFILES_DIR}")
if(DEFINED IGNORE_PATTERN)
list(APPEND LUACHECK_ARGS --exclude-files "${LUAFILES_DIR}/${IGNORE_PATTERN}")
endif()
if(DEFINED CHECK_PATTERN)
list(APPEND LUACHECK_ARGS --include-files "${LUAFILES_DIR}/${CHECK_PATTERN}")
endif()
if(DEFINED READ_GLOBALS)
list(APPEND LUACHECK_ARGS --read-globals "${READ_GLOBALS}")
endif()
execute_process(
COMMAND "${LUACHECK_PRG}" ${LUACHECK_ARGS}
WORKING_DIRECTORY "${LUAFILES_DIR}"
ERROR_VARIABLE err
RESULT_VARIABLE res
)
if(NOT res EQUAL 0)
message(STATUS "Output to stderr:\n${err}")
message(FATAL_ERROR "Linting tests failed with error: ${res}")
endif()

View File

@ -1,10 +1,17 @@
get_filename_component(BUSTED_DIR ${BUSTED_PRG} PATH)
set(ENV{PATH} "${BUSTED_DIR}:$ENV{PATH}")
# Set LC_ALL to meet expectations of some locale-sensitive tests.
set(ENV{LC_ALL} "en_US.UTF-8")
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(NOT DEFINED ENV{NVIM_LOG_FILE})
set(ENV{NVIM_LOG_FILE} ${WORKING_DIR}/.nvimlog)
endif()
if(NVIM_PRG)
set(ENV{NVIM_PROG} "${NVIM_PRG}")
set(ENV{NVIM_PRG} "${NVIM_PRG}")
endif()
if(DEFINED ENV{TEST_FILE})
@ -17,24 +24,34 @@ if(BUSTED_OUTPUT_TYPE STREQUAL junit)
set(EXTRA_ARGS OUTPUT_FILE ${BUILD_DIR}/${TEST_TYPE}test-junit.xml)
endif()
if(DEFINED ENV{TEST_TAG})
if(DEFINED ENV{TEST_TAG} AND NOT "$ENV{TEST_TAG}" STREQUAL "")
set(TEST_TAG "--tags=$ENV{TEST_TAG}")
endif()
if(DEFINED ENV{TEST_FILTER})
set(TEST_TAG "--filter=$ENV{TEST_FILTER}")
if(DEFINED ENV{TEST_FILTER} AND NOT "$ENV{TEST_FILTER}" STREQUAL "")
set(TEST_FILTER "--filter=$ENV{TEST_FILTER}")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${WORKING_DIR}/Xtest-tmpdir)
set(ENV{TMPDIR} ${WORKING_DIR}/Xtest-tmpdir)
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
--lpath=${BUILD_DIR}/?.lua ${TEST_PATH}
--lua=${LUA_PRG} --lazy --helper=${TEST_DIR}/${TEST_TYPE}/preload.lua
--lpath=${BUILD_DIR}/?.lua
--lpath=${WORKING_DIR}/runtime/lua/?.lua
--lpath=?.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)
file(REMOVE_RECURSE ${WORKING_DIR}/Xtest-tmpdir)
if(NOT res EQUAL 0)
message(STATUS "Output to stderr:\n${err}")
message(FATAL_ERROR "Running ${TEST_TYPE} tests failed with error: ${res}.")
message(FATAL_ERROR "${TEST_TYPE} tests failed with error: ${res}")
endif()

View File

@ -1,11 +0,0 @@
execute_process(
COMMAND ${LUACHECK_PRG} -q ${TEST_DIR}
WORKING_DIRECTORY ${TEST_DIR}
ERROR_VARIABLE err
RESULT_VARIABLE res
${EXTRA_ARGS})
if(NOT res EQUAL 0)
message(STATUS "Output to stderr:\n${err}")
message(FATAL_ERROR "Linting tests failed with error: ${res}.")
endif()

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()

29
codecov.yml Normal file
View File

@ -0,0 +1,29 @@
codecov:
notify:
require_ci_to_pass: no
ci:
- appveyor
- travis
- !neovim-qb.szakmeister.net
coverage:
precision: 2
round: down
range: "70...100"
status:
project: yes
patch:
default:
threshold: 1
changes: no
parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no
comment: off

View File

@ -8,40 +8,40 @@ include(CheckCSourceCompiles)
check_type_size("int" SIZEOF_INT)
check_type_size("long" SIZEOF_LONG)
check_type_size("intmax_t" SIZEOF_INTMAX_T)
check_type_size("off_t" SIZEOF_OFF_T)
check_type_size("size_t" SIZEOF_SIZE_T)
check_type_size("long long" SIZEOF_LONG_LONG)
check_type_size("void *" SIZEOF_VOID_PTR)
if (CMAKE_HOST_SYSTEM_VERSION MATCHES ".*-Microsoft")
# Windows Subsystem for Linux
set(HAVE_WSL 1)
endif()
check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON)
# Headers
check_include_files(dirent.h HAVE_DIRENT_H)
check_include_files(fcntl.h HAVE_FCNTL_H)
check_include_files(iconv.h HAVE_ICONV_H)
check_include_files(langinfo.h HAVE_LANGINFO_H)
check_include_files(libgen.h HAVE_LIBGEN_H)
check_include_files(locale.h HAVE_LOCALE_H)
check_include_files(pwd.h HAVE_PWD_H)
check_include_files(strings.h HAVE_STRINGS_H)
check_include_files(stropts.h HAVE_STROPTS_H)
check_include_files(sys/param.h HAVE_SYS_PARAM_H)
check_include_files(sys/wait.h HAVE_SYS_WAIT_H)
if(NOT HAVE_SYS_WAIT_H AND UNIX)
# See if_cscope.c
message(SEND_ERROR "header sys/wait.h is required for UNIX")
message(SEND_ERROR "header sys/wait.h is required for Unix")
endif()
check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
check_include_files(termios.h HAVE_TERMIOS_H)
check_include_files(utime.h HAVE_UTIME_H)
check_include_files(unistd.h HAVE_UNISTD_H)
check_include_files(utime.h HAVE_UTIME_H)
check_include_files(sys/uio.h HAVE_SYS_UIO_H)
# Functions
check_function_exists(fseeko HAVE_FSEEKO)
check_function_exists(fsync HAVE_FSYNC)
check_function_exists(getpwent HAVE_GETPWENT)
check_function_exists(getpwnam HAVE_GETPWNAM)
check_function_exists(getpwuid HAVE_GETPWUID)
check_function_exists(uv_translate_sys_error HAVE_UV_TRANSLATE_SYS_ERROR)
check_function_exists(readv HAVE_READV)
if(Iconv_FOUND)
set(HAVE_ICONV 1)
@ -51,7 +51,10 @@ if(JEMALLOC_FOUND)
set(HAVE_JEMALLOC 1)
endif()
check_function_exists(putenv HAVE_PUTENV)
check_function_exists(_putenv_s HAVE_PUTENV_S)
if(WIN32 AND NOT HAVE_PUTENV_S)
message(SEND_ERROR "_putenv_s() function not found on your system.")
endif()
check_function_exists(opendir HAVE_OPENDIR)
check_function_exists(readlink HAVE_READLINK)
check_function_exists(setenv HAVE_SETENV)
@ -73,6 +76,14 @@ if(HAVE_LANGINFO_H)
check_symbol_exists(CODESET "langinfo.h" HAVE_NL_LANGINFO_CODESET)
endif()
check_include_files("endian.h" HAVE_ENDIAN_H)
check_include_files("sys/endian.h" HAVE_SYS_ENDIAN_H)
set(ENDIAN_INCLUDE_FILE "endian.h")
if(HAVE_SYS_ENDIAN_H AND NOT HAVE_ENDIAN_H)
set(ENDIAN_INCLUDE_FILE "sys/endian.h")
endif()
set(SI "#include <stdint.h>\n")
set(MS "int main(int argc,char**argv)\n{\n uint64_t i=0x0102030405060708ULL;")
set(ME "}")
@ -80,7 +91,7 @@ check_c_source_compiles("
#define _BSD_SOURCE 1
#define _DEFAULT_SOURCE 1
${SI}
#include <endian.h>
#include <${ENDIAN_INCLUDE_FILE}>
#ifndef be64toh
# error No be64toh macros
#endif
@ -98,10 +109,10 @@ endif()
if (NOT "${HAVE_BE64TOH}")
if (NOT "${CMAKE_CROSSCOMPILING}")
# It is safe to make ORDER_BIG_ENDIAN not defined if
# - HAVE_BE64TOH is true. In this case be64toh will be used unconditionally in
# - HAVE_BE64TOH is true. In this case be64toh will be used unconditionally in
# any case and ORDER_BIG_ENDIAN will not be examined.
# - CMAKE_CROSSCOMPILING *and* HAVE_BE64TOH are both false. In this case
# be64toh function which uses cycle and arithmetic operations is used which
# - CMAKE_CROSSCOMPILING *and* HAVE_BE64TOH are both false. In this case
# be64toh function which uses cycle and arithmetic operations is used which
# will work regardless of endianess. Function is sub-optimal though.
check_c_source_runs("
${SI}
@ -137,12 +148,16 @@ configure_file (
find_program(WHOAMI_PROG whoami)
find_program(HOSTNAME_PROG hostname)
if (NOT DEFINED USERNAME AND EXISTS ${WHOAMI_PROG})
if (DEFINED ENV{USERNAME})
set(USERNAME $ENV{USERNAME})
elseif (NOT DEFINED USERNAME AND EXISTS ${WHOAMI_PROG})
execute_process(COMMAND ${WHOAMI_PROG}
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE USERNAME)
endif()
if (EXISTS ${HOSTNAME_PROG})
if (DEFINED ENV{HOSTNAME})
set(HOSTNAME $ENV{HOSTNAME})
elseif (EXISTS ${HOSTNAME_PROG})
execute_process(COMMAND ${HOSTNAME_PROG}
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE HOSTNAME)

View File

@ -5,7 +5,6 @@
#define SIZEOF_INT @SIZEOF_INT@
#define SIZEOF_LONG @SIZEOF_LONG@
#define SIZEOF_OFF_T @SIZEOF_OFF_T@
#if @SIZEOF_VOID_PTR@ == 8
#define ARCH_64
@ -13,25 +12,25 @@
#define ARCH_32
#endif
#define PROJECT_NAME "@PROJECT_NAME@"
#define LOCALE_INSTALL_DIR "@CMAKE_INSTALL_FULL_LOCALEDIR@"
#cmakedefine HAVE__NSGETENVIRON
#cmakedefine HAVE_CRT_EXTERNS_H
#cmakedefine HAVE_FCNTL_H
#cmakedefine HAVE_FD_CLOEXEC
#cmakedefine HAVE_FSEEKO
#cmakedefine HAVE_FSYNC
#cmakedefine HAVE_GETPWENT
#cmakedefine HAVE_GETPWNAM
#cmakedefine HAVE_GETPWUID
#cmakedefine HAVE_ICONV
#cmakedefine HAVE_ICONV_H
#cmakedefine HAVE_LANGINFO_H
#cmakedefine HAVE_LIBGEN_H
#cmakedefine HAVE_LOCALE_H
#cmakedefine HAVE_NL_LANGINFO_CODESET
#cmakedefine HAVE_NL_MSG_CAT_CNTR
#cmakedefine HAVE_PUTENV
#cmakedefine HAVE_PUTENV_S
#cmakedefine HAVE_PWD_H
#cmakedefine HAVE_READLINK
#cmakedefine HAVE_UV_TRANSLATE_SYS_ERROR
// TODO: add proper cmake check
// #define HAVE_SELINUX 1
#cmakedefine HAVE_SETENV
@ -42,25 +41,35 @@
#cmakedefine HAVE_STRCASECMP
#cmakedefine HAVE_STRINGS_H
#cmakedefine HAVE_STRNCASECMP
#cmakedefine HAVE_STROPTS_H
#cmakedefine HAVE_SYS_PARAM_H
#cmakedefine HAVE_SYS_UTSNAME_H
#cmakedefine HAVE_SYS_WAIT_H
#cmakedefine HAVE_UNISTD_H
#cmakedefine HAVE_TERMIOS_H
#cmakedefine HAVE_UTIME
#cmakedefine HAVE_UTIME_H
#cmakedefine HAVE_UTIMES
#cmakedefine HAVE_WORKING_LIBINTL
#cmakedefine HAVE_WSL
#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
#cmakedefine LOG_LIST_ACTIONS
#endif
#cmakedefine HAVE_BE64TOH
#cmakedefine ORDER_BIG_ENDIAN
#define ENDIAN_INCLUDE_FILE <@ENDIAN_INCLUDE_FILE@>
#cmakedefine HAVE_EXECINFO_BACKTRACE
#endif // AUTO_CONFIG_H

View File

@ -1,3 +1,5 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
#include "${PROJECT_SOURCE_DIR}/src/nvim/vim.h"
char *default_vim_dir = "${CMAKE_INSTALL_FULL_DATAROOTDIR}/nvim";
char *default_vimruntime_dir = "";

View File

@ -5,9 +5,12 @@
#define NVIM_VERSION_MINOR @NVIM_VERSION_MINOR@
#define NVIM_VERSION_PATCH @NVIM_VERSION_PATCH@
#define NVIM_VERSION_PRERELEASE "@NVIM_VERSION_PRERELEASE@"
#cmakedefine NVIM_VERSION_COMMIT "@NVIM_VERSION_COMMIT@"
#cmakedefine NVIM_VERSION_MEDIUM "@NVIM_VERSION_MEDIUM@"
#define NVIM_API_LEVEL @NVIM_API_LEVEL@
#define NVIM_API_LEVEL_COMPAT @NVIM_API_LEVEL_COMPAT@
#define NVIM_API_PRERELEASE @NVIM_API_PRERELEASE@
#define NVIM_VERSION_CFLAGS "@NVIM_VERSION_CFLAGS@"
#define NVIM_VERSION_BUILD_TYPE "@NVIM_VERSION_BUILD_TYPE@"

View File

@ -2,7 +2,9 @@
## What is this?
This provides the code necessary to configure vim's YCM plugin to provide C semantic support (completion, go-to-definition, etc) for developers working on the Neovim project.
This provides the code necessary to configure vim's YCM plugin to provide C
semantic support (completion, go-to-definition, etc) for developers working on
the Neovim project.
## Installation
@ -13,10 +15,17 @@ Install [YouCompleteMe](https://github.com/Valloric/YouCompleteMe).
### Step 2
```bash
cp contrib/YouCompleteMe/ycm_extra_conf.py src/.ycm_extra_conf.py
cp contrib/YouCompleteMe/ycm_extra_conf.py .ycm_extra_conf.py
echo .ycm_extra_conf.py >> .git/info/exclude
make
(Add the following somewhere in your vimrc)
autocmd FileType c nnoremap <buffer> <silent> <C-]> :YcmCompleter GoTo<cr>
```
Tip: to improve source code navigation, add something like this to your nvim
configuration:
```vim
au FileType c,cpp nnoremap <buffer> <c-]> :YcmCompleter GoTo<CR>
```
And use `ctrl+]` when the cursor is positioned in a symbol to quickly jump to a
definition or declaration.

View File

@ -9,47 +9,57 @@ def DirectoryOfThisScript():
def GetDatabase():
compilation_database_folder = os.path.join(DirectoryOfThisScript(),
'..', '..', 'build')
'build')
if os.path.exists(compilation_database_folder):
return ycm_core.CompilationDatabase(compilation_database_folder)
return None
def IsHeaderFile(filename):
extension = os.path.splitext(filename)[1]
return extension == '.h'
def GetCompilationInfoForFile(filename):
database = GetDatabase()
if not database:
return None
if IsHeaderFile(filename):
basename = os.path.splitext(filename)[0]
c_file = basename + '.c'
# for pure headers (no c file), default to main.c
if not os.path.exists(c_file):
c_file = os.path.join(DirectoryOfThisScript(), 'nvim', 'main.c')
if os.path.exists(c_file):
compilation_info = database.GetCompilationInfoForFile(c_file)
if compilation_info.compiler_flags_:
return compilation_info
return None
return database.GetCompilationInfoForFile(filename)
# It seems YCM does not resolve directories correctly. This function will
# adjust paths in the compiler flags to be absolute
def FixDirectories(args, compiler_working_dir):
def adjust_path(path):
return os.path.abspath(os.path.join(compiler_working_dir, path))
adjust_next_arg = False
new_args = []
for arg in args:
if adjust_next_arg:
arg = adjust_path(arg)
adjust_next_arg = False
else:
for dir_flag in ['-I', '-isystem', '-o', '-c']:
if arg.startswith(dir_flag):
if arg != dir_flag:
# flag and path are concatenated in same arg
path = arg[len(dir_flag):]
new_path = adjust_path(path)
arg = '{0}{1}'.format(dir_flag, new_path)
else:
# path is specified in next argument
adjust_next_arg = True
new_args.append(arg)
return new_args
def FlagsForFile(filename):
compilation_info = GetCompilationInfoForFile(filename)
if not compilation_info:
return None
# Add flags not needed for clang-the-binary,
# but needed for libclang-the-library (YCM uses this last one).
flags = (list(compilation_info.compiler_flags_)
if compilation_info.compiler_flags_
else [])
flags = FixDirectories((list(compilation_info.compiler_flags_)
if compilation_info.compiler_flags_
else []), compilation_info.compiler_working_dir_)
extra_flags = ['-Wno-newline-eof']
final_flags = flags + extra_flags
return {
'flags': final_flags,
'flags': flags + extra_flags,
'do_cache': True
}

View File

@ -13,31 +13,29 @@
# Sets the build type; defaults to Debug. Valid values:
#
# - Debug: Disables optimizations (-O0), enables debug information and logging.
# - Debug: Disables optimizations (-O0), enables debug information.
#
# - Dev: Enables all optimizations that do not interfere with
# debugging (-Og if available, -O2 and -g if not).
# Enables debug information and logging.
#
# - RelWithDebInfo: Enables optimizations (-O2) and debug information.
# Disables logging.
# - RelWithDebInfo: Enables optimizations (-Og or -O2) with debug information.
#
# - MinSizeRel: Enables all -O2 optimization that do not typically
# increase code size, and performs further optimizations
# designed to reduce code size (-Os).
# Disables debug information and logging.
# Disables debug information.
#
# - Release: Same as RelWithDebInfo, but disables debug information.
#
# CMAKE_BUILD_TYPE := Debug
# Log levels: 0 (DEBUG), 1 (INFO), 2 (WARNING), 3 (ERROR)
# Default is 1 (INFO) unless CMAKE_BUILD_TYPE is Release or RelWithDebInfo.
# CMAKE_EXTRA_FLAGS += -DMIN_LOG_LEVEL=1
# By default, nvim uses bundled versions of its required third-party
# dependencies.
# Uncomment these entries to instead use system-wide installations of
# them.
#
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_BUSTED=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_DEPS=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_JEMALLOC=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LIBTERMKEY=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LIBUV=OFF
@ -46,6 +44,10 @@
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LUAROCKS=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_MSGPACK=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_UNIBILIUM=OFF
#
# Or disable all bundled dependencies at once.
#
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED=OFF
# By default, bundled libraries are statically linked to nvim.
# This has no effect for non-bundled deps, which are always dynamically linked.
@ -57,3 +59,12 @@
# CMAKE_EXTRA_FLAGS += -DLIBVTERM_USE_STATIC=OFF
# CMAKE_EXTRA_FLAGS += -DLUAJIT_USE_STATIC=OFF
# CMAKE_EXTRA_FLAGS += -DMSGPACK_USE_STATIC=OFF
#
#
# .DEFAULT_GOAL := nvim
#
# Run doxygen over the source code.
# Output will be in build/doxygen
#
# doxygen:
# doxygen src/Doxyfile

View File

@ -1,4 +1,4 @@
.Dd November 11, 2015
.Dd December 17, 2017
.Dt NVIM 1
.Os
.Sh NAME
@ -20,41 +20,51 @@
.Sh DESCRIPTION
.Nm
is a text editor based on Vim.
To enter commands in
.Nm ,
type a colon
.Pq Sq \&:
which is also used in this manual to denote commands.
For more information, consult the on-line help system with the
.Ic :help
command.
Start
.Nm
followed by any number of options and/or files:
.Pp
.Dl nvim [options] [file ...]
.Pp
Commands in
.Nm
begin with colon
.Pq Sq \&: .
Type ":help subject" to get help on a specific subject.
Use <Tab> and CTRL-D to complete subjects (":help cmdline\-completion").
.Pp
The "quickref" help section is a condensed reference of editor features:
.Dl :help quickref
.Pp
If you are new to Vim/Nvim, start with the 30-minute tutorial:
.Dl :Tutor
.Pp
After installing/updating Nvim, it's a good idea to run the self-check:
.Dl :checkhealth
.Pp
.Bl -tag -width Fl
.It Ar file ...
File(s) to edit.
If none are specified, open an empty buffer.
If multiple files are specified, open one buffer for each file.
Opens one buffer per file.
To switch between buffers, use the
.Ic :next
and
.Ic :previous
commands.
.It Fl
Read text from standard input until
Reads text from standard input until
.Dv EOF ,
then open a buffer with that text.
Commands are read from standard error, which should be a terminal.
then opens a buffer with that text.
User input is read from standard error, which should be a terminal.
.Sh OPTIONS
.Bl -tag -width Fl
.It Fl t Ar tag
The file to edit and the initial cursor position depends on a
tag, a sort of goto label.
Finds
.Ar tag
is looked up in the tags file, the associated file becomes the current
in the tags file, the associated file becomes the current
file and the associated command is executed.
If
.Ar tag
is a function name, the file containing that function is opened
with the cursor positioned at the start of the function.
See
.Ic :help tag-commands .
Cursor is positioned at the tag location in the file.
.Ic ":help tag-commands"
.It Fl q Op Ar errorfile
QuickFix mode.
Display the first error in
@ -66,96 +76,80 @@ is omitted, the value of the 'errorfile' option is used (defaults to
Further errors can be jumped to with the
.Ic :cnext
command.
See
.Ic :help quickfix .
.It There are a number of other options:
.Ic ":help quickfix"
.It Fl -
Interpret all further arguments as files.
Can be used to edit files starting with a hyphen
End of options.
Remaining arguments are treated as literal file names, including filenames starting with hyphen
.Pq Sq - .
.It Fl -literal
Interpret filenames literally, that is, do not expand wildcards.
Has no effect on UNIX-like systems, where the shell expands wildcards.
.It Fl e
Ex mode.
See
.Ic :help Ex-mode .
Ex mode, reading stdin as Ex commands.
.Ic ":help Ex-mode"
.It Fl E
Improved Ex mode.
See
.Ic :help gQ .
.It Fl s
Silent mode.
Only takes effect if
.Fl e
or
.Fl E
is specified before it.
Ex mode, reading stdin as text.
.Ic :help Ex-mode
.It Fl es
Silent/batch mode, reading stdin as Ex commands.
.Ic :help silent-mode
.It Fl \&Es
Silent/batch mode, reading stdin as text.
.Ic :help silent-mode
.It Fl d
Diff mode.
Show the difference between two to four files, similar to
.Xr sdiff 1 .
See
.Ic :help diff .
.Ic ":help diff"
.It Fl R
Read-only mode.
Sets the option 'readonly'.
Sets the 'readonly' option.
Implies
.Fl n .
Buffers can still be edited, but cannot be written to disk if already
associated with a file.
To overwrite a file, add an exclamation mark to the needed Ex command, such as
To overwrite a file, add an exclamation mark to the relevant Ex command, such as
.Ic :w! .
See
.Ic :help 'readonly' .
.Ic ":help 'readonly'"
.It Fl Z
Restricted mode.
Disable commands that make use of an external shell.
.It Fl m
Disable file modifications.
Unsets the option 'write'.
Resets the 'write' option, to disable file modifications.
Writing to a file is disabled, but buffers can still be modified.
.It Fl M
Disable file and buffer modifications.
Unsets the options 'write' and 'modifiable'.
Note that these options can be set to re-enable making modifications.
Resets the 'write' and 'modifiable' options, to disable file and buffer
modifications.
.It Fl b
Binary mode.
See
.Ic :help edit-binary .
.Ic ":help edit-binary"
.It Fl l
Lisp mode.
Sets the options 'lisp' and 'showmatch'.
Sets the 'lisp' and 'showmatch' options.
.It Fl A
Arabic mode.
Sets the option 'arabic'.
.It Fl F
Farsi mode.
Sets the options 'fkmap' and 'rightleft'.
Sets the 'arabic' option.
.It Fl H
Hebrew mode.
Sets the options 'hkmap' and 'rightleft'.
Sets the 'hkmap' and 'rightleft' options.
.It Fl V Ns Oo Ar N Oc Ns Op Ar file
Verbose mode.
Print messages about which files are being sourced and for reading and
writing a ShaDa file.
Prints debug messages.
.Ar N
is the value for the 'verbose' option; defaults to
.Cm 10
if omitted.
is the 'verbose' level, defaults to
.Cm 10 .
If
.Ar file
is specified, append messages to
.Ar file
instead of printing them.
.Ic ":help 'verbose'"
.It Fl D
Debugging mode.
Debug mode for VimL (Vim script).
Started when executing the first command from a script.
:help debug-mode
.It Fl n
Disable the use of swap files.
Sets the option 'updatecount' to
Sets the 'updatecount' option to
.Cm 0 .
Can be useful for editing file(s) on a slow medium.
Can be useful for editing files on a slow medium.
.It Fl r Op Ar file
Recovery mode.
If
@ -168,41 +162,38 @@ is used to recover a crashed session.
The swap file has the same name as the file it's associated with, but with
.Sq .swp
appended.
See
.Ic :help recovery .
.Ic ":help recovery"
.It Fl L Op Ar file
Alias for
.Fl r .
.It Fl u Ar vimrc
Use
.Ar vimrc
instead of the default of
instead of the default
.Pa ~/.config/nvim/init.vim .
If
.Ar vimrc
is
.Cm NORC ,
do not load any initialization files (excluding plugins),
do not load any initialization files (except plugins),
and do not attempt to parse environment variables.
If
.Ar vimrc
is
.Cm NONE ,
loading plugins is also skipped.
See
.Ic :help initialization .
.Ic ":help initialization"
.It Fl i Ar shada
Use
.Ar shada
instead of the default of
instead of the default
.Pa ~/.local/share/nvim/shada/main.shada .
If
.Ar shada
is
.Cm NONE ,
do not read or write a ShaDa file.
See
.Ic :help shada .
.Ic ":help shada"
.It Fl -noplugin
Skip loading plugins.
Implied by
@ -233,7 +224,6 @@ For the first file, position the cursor on line
If
.Ar linenum
is omitted, position the cursor on the last line of the file.
Note that
.Cm +5
and
.Cm -c 5
@ -246,8 +236,7 @@ For the first file, position the cursor on the first occurrence of
.Ar pattern .
If
.Ar pattern
is omitted, the most recently used search pattern is used (if there is one).
Note that
is omitted, the most recent search pattern is used (if any).
.Cm +/foo
and
.Cm -c /foo
@ -257,21 +246,15 @@ and
.Ic :/foo
inside
.Nm .
See
.Ic :help search-pattern .
.It Fl c Ar command
.Ic ":help search-pattern"
.It \fB\+\fR\fI\,command\/\fR , Fl c Ar command
Execute
.Ar command
after reading the first file.
Up to 10 instances of
.Fl c
or
.Cm +
can be used.
Note that
.Qq Cm +set si
Up to 10 instances allowed.
.Qq Cm +foo
and
.Cm -c \(dqset si\(dq
.Cm -c \(dqfoo\(dq
are equivalent.
.It Fl -cmd Ar command
Like
@ -292,16 +275,15 @@ cannot start with a hyphen
.Pq Sq - .
If
.Ar session
is omitted, then
.Pa Session.vim ,
if found, is used.
See
.Ic :help session-file .
is omitted then
.Pa Session.vim
is used, if found.
.Ic ":help session-file"
.It Fl s Ar scriptin
Read normal mode commands from
.Ar scriptin .
The same can be done with the command
.Ic :source! scriptin .
.Ic ":source! scriptin" .
If the end of the file is reached before
.Nm
exits, further characters are read from the keyboard.
@ -325,10 +307,14 @@ Can be used to diagnose slow startup times.
Dump API metadata serialized to msgpack and exit.
.It Fl -embed
Use standard input and standard output as a msgpack-rpc channel.
Implies
.Fl -headless .
:help --embed
.It Fl -headless
Do not start a user interface.
Do not start a UI.
When supplied with --embed this implies that the embedding application does not intend to (immediately) start a UI.
Also useful for "scraping" messages in a pipe.
:help --headless
.It Fl -listen Ar address
Start RPC server on this pipe or TCP socket.
.It Fl h , -help
Print usage information and exit.
.It Fl v , -version
@ -336,89 +322,69 @@ Print version information and exit.
.El
.Sh ENVIRONMENT
.Bl -tag -width Fl
.It Ev NVIM_LOG_FILE
Low-level log file, usually found at ~/.local/share/nvim/log.
:help $NVIM_LOG_FILE
.It Ev VIM
Used to locate various user files, such as the user's init.vim.
Used to locate user files, such as init.vim.
System-dependent.
:help $VIM
.It Ev VIMRUNTIME
Used to locate run time files, such as on-line documentation and
syntax highlighting definitions.
Used to locate runtime files (documentation, syntax highlighting, etc.).
.It Ev XDG_CONFIG_HOME
Path to use for the user-local configuration directory, see
Path to the user-local configuration directory, see
.Sx FILES .
Defaults to
.Pa ~/.config
if not set.
.Pa ~/.config .
:help xdg
.It Ev XDG_DATA_HOME
Like
.Ev XDG_CONFIG_HOME ,
but used to store data not generally edited by the user,
namely swap, backup, and ShaDa files.
Defaults to
.Pa ~/.local/share/nvim
if not set.
.Pa ~/.local/share .
:help xdg
.It Ev VIMINIT
A string of Ex commands to be executed at startup.
For example, the command to quit is
.Ic :q ,
so to have
.Nm
quit immediately after starting, set
.Ev VIMINIT
to
.Cm q .
See
.Ic :help VIMINIT .
Ex commands to be executed at startup.
.Ic ":help VIMINIT"
.It Ev SHELL
Used to set the 'shell' option, which determines the shell used by the
.Ic :terminal
command.
.It Ev NVIM_TUI_ENABLE_CURSOR_SHAPE
If defined, change the cursor shape to a vertical bar while in insert mode.
Requires that the host terminal support the DECSCUSR CSI escape sequence.
Has no effect in GUIs.
.It Ev NVIM_TUI_ENABLE_TRUE_COLOR
If defined, assume the host terminal supports 24 bit colors.
Has no effect in GUIs.
Used to initialize the 'shell' option, which decides the default shell used by
features like
.Ic :terminal ,
.Ic :! , and
.Ic system() .
.El
.Sh FILES
.Bl -tag -width "~/.config/nvim/init.vim"
.It Pa ~/.config/nvim/init.vim
The user-local
User-local
.Nm
configuration file.
See
.Ev XDG_CONFIG_HOME
above.
.It Pa ~/.config/nvim
The user-local
User-local
.Nm
configuration directory.
See
.Ev XDG_CONFIG_HOME
above.
See also
.Ev XDG_CONFIG_HOME .
.It Pa $VIM/sysinit.vim
The system-global
System-global
.Nm
configuration file.
.It Pa /usr/local/share/nvim
The system-global
System-global
.Nm
runtime directory.
.El
.Sh AUTHORS
.Nm
was started by
.An Thiago de Arruda ,
with a lot of help from others.
.Pp
Nvim was started by
.An Thiago de Arruda .
Most of Vim was written by
.An -nosplit
.An Bram Moolenaar ,
with a lot of help from others.
See
.Ic :help credits .
.Pp
.An Bram Moolenaar .
Vim is based on Stevie, worked on by
.An Tim Thompson ,
.An Tony Andrews ,
and
.An G.R. (Fred) Walter .
.Ic ":help credits"

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,54 @@ 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}
)
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_dependencies(${PACKNAME}-tags nvim_runtime_deps)
add_custom_command(OUTPUT "${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/tags"
DEPENDS
"${PACKNAME}-tags"
)
set("${PACKNAME}_DOC_NAMES")
foreach(DF "${${PACKNAME}_DOC_FILES}")
get_filename_component(F ${DF} NAME)
list(APPEND "${PACKNAME}_DOC_NAMES" ${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/${F})
endforeach()
install_helper(
FILES ${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/tags "${${PACKNAME}_DOC_NAMES}"
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/pack/dist/opt/${PACKNAME}/doc)
list(APPEND GENERATED_PACKAGE_TAGS "${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/tags")
endif()
endforeach()
file(GLOB DOCFILES ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt)
set(BUILDDOCFILES)
@ -26,25 +67,27 @@ foreach(DF ${DOCFILES})
list(APPEND BUILDDOCFILES ${GENERATED_RUNTIME_DIR}/doc/${F})
endforeach()
add_custom_command(OUTPUT ${BUILDDOCFILES}
add_custom_target(helptags
COMMAND ${CMAKE_COMMAND} -E remove doc/*
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/runtime/doc ${GENERATED_RUNTIME_DIR}/doc
${PROJECT_SOURCE_DIR}/runtime/doc doc
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
-u NONE -i NONE -e --headless -c "helptags ++t doc" -c quit
DEPENDS
${DOCFILES})
nvim
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}"
)
add_dependencies(helptags nvim_runtime_deps)
add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/runtime/doc ${GENERATED_RUNTIME_DIR}/doc
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
-u NONE
-i NONE
-es
--headless
-c "helptags ++t ."
-c quit
DEPENDS
${BUILDDOCFILES}
nvim
helptags
)
add_custom_target(doc_html
COMMAND make html
DEPENDS
helptags
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}/doc"
)
@ -53,6 +96,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
@ -69,6 +113,16 @@ install_helper(
FILES ${GENERATED_SYN_VIM}
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/syntax/vim)
if(NOT APPLE)
install_helper(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/nvim.desktop
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
install_helper(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/nvim.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps)
endif()
file(GLOB_RECURSE RUNTIME_PROGRAMS
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
*.awk *.sh *.bat)
@ -81,7 +135,8 @@ endforeach()
file(GLOB_RECURSE RUNTIME_FILES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
*.vim *.dict *.py *.ps *.tutor)
rgb.txt
*.vim *.lua *.dict *.py *.rb *.ps *.spl *.tutor *.tutor.json)
foreach(F ${RUNTIME_FILES})
get_filename_component(BASEDIR ${F} PATH)

View File

@ -0,0 +1,48 @@
" Author: Antony Lee <anntzer.lee@gmail.com>
" Description: Helper functions for reStructuredText syntax folding
" Last Modified: 2018-01-07
function s:CacheRstFold()
let closure = {'header_types': {}, 'max_level': 0, 'levels': {}}
function closure.Process(match) dict
let curline = getcurpos()[1]
if has_key(self.levels, curline - 1)
" For over+under-lined headers, the regex will match both at the
" overline and at the title itself; in that case, skip the second match.
return
endif
let lines = split(a:match, '\n')
let key = repeat(lines[-1][0], len(lines))
if !has_key(self.header_types, key)
let self.max_level += 1
let self.header_types[key] = self.max_level
endif
let self.levels[curline] = self.header_types[key]
endfunction
let save_cursor = getcurpos()
silent keeppatterns %s/\v^%(%(([=`:.'"~^_*+#-])\1+\n)?.{1,2}\n([=`:.'"~^_*+#-])\2+)|%(%(([=`:.''"~^_*+#-])\3{2,}\n)?.{3,}\n([=`:.''"~^_*+#-])\4{2,})$/\=closure.Process(submatch(0))/gn
call setpos('.', save_cursor)
let b:RstFoldCache = closure.levels
endfunction
function RstFold#GetRstFold()
if !has_key(b:, 'RstFoldCache')
call s:CacheRstFold()
endif
if has_key(b:RstFoldCache, v:lnum)
return '>' . b:RstFoldCache[v:lnum]
else
return '='
endif
endfunction
function RstFold#GetRstFoldText()
if !has_key(b:, 'RstFoldCache')
call s:CacheRstFold()
endif
let indent = repeat(' ', b:RstFoldCache[v:foldstart] - 1)
let thisline = getline(v:foldstart)
" For over+under-lined headers, skip the overline.
let text = thisline =~ '^\([=`:.''"~^_*+#-]\)\1\+$' ? getline(v:foldstart + 1) : thisline
return indent . text
endfunction

View File

@ -2,12 +2,13 @@
" Description: Perform Ada specific completion & tagging.
" Language: Ada (2005)
" $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $
" Maintainer: Martin Krischik <krischik@users.sourceforge.net>
" Maintainer: Mathias Brousset <mathiasb17@gmail.com>
" Martin Krischik <krischik@users.sourceforge.net>
" Taylor Venable <taylor@metasyntax.net>
" Neil Bird <neil@fnxweb.com>
" Ned Okie <nokie@radford.edu>
" $Author: krischik $
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
" $Date: 2017-01-31 20:20:05 +0200 (Mon, 01 Jan 2017) $
" Version: 4.6
" $Revision: 887 $
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/ada.vim $
@ -23,6 +24,7 @@
" 09.05.2007 MK Session just won't work no matter how much
" tweaking is done
" 19.09.2007 NO still some mapleader problems
" 31.01.2017 MB fix more mapleader problems
" Help Page: ft-ada-functions
"------------------------------------------------------------------------------
@ -585,11 +587,11 @@ function ada#Map_Menu (Text, Keys, Command)
\ " :" . a:Command . "<CR>"
execute
\ "nnoremap <buffer>" .
\ escape(l:leader . "a" . a:Keys , '\') .
\ " <Leader>a" . a:Keys .
\" :" . a:Command
execute
\ "inoremap <buffer>" .
\ escape(l:leader . "a" . a:Keys , '\') .
\ " <Leader>a" . a:Keys .
\" <C-O>:" . a:Command
endif
return

View File

@ -1,7 +1,7 @@
" Vim completion script
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2012 Jun 20
" Last Change: 2018 Aug 20
let s:cpo_save = &cpo
set cpo&vim
@ -72,8 +72,10 @@ function! ccomplete#Complete(findstart, base)
" Split item in words, keep empty word after "." or "->".
" "aa" -> ['aa'], "aa." -> ['aa', ''], "aa.bb" -> ['aa', 'bb'], etc.
" We can't use split, because we need to skip nested [...].
" "aa[...]" -> ['aa', '[...]'], "aa.bb[...]" -> ['aa', 'bb', '[...]'], etc.
let items = []
let s = 0
let arrays = 0
while 1
let e = match(base, '\.\|->\|\[', s)
if e < 0
@ -107,6 +109,7 @@ function! ccomplete#Complete(findstart, base)
endwhile
let e += 1
call add(items, strpart(base, s, e - s))
let arrays += 1
let s = e
endif
endwhile
@ -161,15 +164,26 @@ function! ccomplete#Complete(findstart, base)
endif
endif
let res = [{'match': match, 'tagline' : '', 'kind' : kind, 'info' : line}]
elseif len(items) == arrays + 1
" Completing one word and it's a local array variable: build tagline
" from declaration line
let match = items[0]
let kind = 'v'
let tagline = "\t/^" . line . '$/'
let res = [{'match': match, 'tagline' : tagline, 'kind' : kind, 'info' : line}]
else
" Completing "var.", "var.something", etc.
let res = s:Nextitem(strpart(line, 0, col), items[1:], 0, 1)
endif
endif
if len(items) == 1
if len(items) == 1 || len(items) == arrays + 1
" Only one part, no "." or "->": complete from tags file.
let tags = taglist('^' . base)
if len(items) == 1
let tags = taglist('^' . base)
else
let tags = taglist('^' . items[0] . '$')
endif
" Remove members, these can't appear without something in front.
call filter(tags, 'has_key(v:val, "kind") ? v:val["kind"] != "m" : 1')
@ -516,11 +530,24 @@ function! s:StructMembers(typename, items, all)
endif
endif
" Skip over [...] items
let idx = 0
while 1
if idx >= len(a:items)
let target = '' " No further items, matching all members
break
endif
if a:items[idx][0] != '['
let target = a:items[idx]
break
endif
let idx += 1
endwhile
" Put matching members in matches[].
let matches = []
for l in qflist
let memb = matchstr(l['text'], '[^\t]*')
if memb =~ '^' . a:items[0]
if memb =~ '^' . target
" Skip matches local to another file.
if match(l['text'], "\tfile:") < 0 || bufnr('%') == bufnr(matchstr(l['text'], '\t\zs[^\t]*'))
let item = {'match': memb, 'tagline': l['text']}
@ -540,8 +567,8 @@ function! s:StructMembers(typename, items, all)
endfor
if len(matches) > 0
" Skip over [...] items
let idx = 1
" Skip over next [...] items
let idx += 1
while 1
if idx >= len(a:items)
return matches " No further items, return the result.

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,184 @@
" Language: ConTeXt typesetting engine
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
" Latest Revision: 2016 Oct 21
let s:keepcpo= &cpo
set cpo&vim
" Helper functions {{{
function! s:context_echo(message, mode)
redraw
echo "\r"
execute 'echohl' a:mode
echomsg '[ConTeXt]' a:message
echohl None
endf
function! s:sh()
return has('win32') || has('win64') || has('win16') || has('win95')
\ ? ['cmd.exe', '/C']
\ : ['/bin/sh', '-c']
endfunction
" For backward compatibility
if exists('*win_getid')
function! s:win_getid()
return win_getid()
endf
function! s:win_id2win(winid)
return win_id2win(a:winid)
endf
else
function! s:win_getid()
return winnr()
endf
function! s:win_id2win(winnr)
return a:winnr
endf
endif
" }}}
" ConTeXt jobs {{{
if has('job')
let g:context_jobs = []
" Print the status of ConTeXt jobs
function! context#job_status()
let l:jobs = filter(g:context_jobs, 'job_status(v:val) == "run"')
let l:n = len(l:jobs)
call s:context_echo(
\ 'There '.(l:n == 1 ? 'is' : 'are').' '.(l:n == 0 ? 'no' : l:n)
\ .' job'.(l:n == 1 ? '' : 's').' running'
\ .(l:n == 0 ? '.' : ' (' . join(l:jobs, ', ').').'),
\ 'ModeMsg')
endfunction
" Stop all ConTeXt jobs
function! context#stop_jobs()
let l:jobs = filter(g:context_jobs, 'job_status(v:val) == "run"')
for job in l:jobs
call job_stop(job)
endfor
sleep 1
let l:tmp = []
for job in l:jobs
if job_status(job) == "run"
call add(l:tmp, job)
endif
endfor
let g:context_jobs = l:tmp
if empty(g:context_jobs)
call s:context_echo('Done. No jobs running.', 'ModeMsg')
else
call s:context_echo('There are still some jobs running. Please try again.', 'WarningMsg')
endif
endfunction
function! context#callback(path, job, status)
if index(g:context_jobs, a:job) != -1 && job_status(a:job) != 'run' " just in case
call remove(g:context_jobs, index(g:context_jobs, a:job))
endif
call s:callback(a:path, a:job, a:status)
endfunction
function! context#close_cb(channel)
call job_status(ch_getjob(a:channel)) " Trigger exit_cb's callback for faster feedback
endfunction
function! s:typeset(path)
call add(g:context_jobs,
\ job_start(add(s:sh(), context#command() . ' ' . shellescape(fnamemodify(a:path, ":t"))), {
\ 'close_cb' : 'context#close_cb',
\ 'exit_cb' : function(get(b:, 'context_callback', get(g:, 'context_callback', 'context#callback')),
\ [a:path]),
\ 'in_io' : 'null'
\ }))
endfunction
else " No jobs
function! context#job_status()
call s:context_echo('Not implemented', 'WarningMsg')
endfunction!
function! context#stop_jobs()
call s:context_echo('Not implemented', 'WarningMsg')
endfunction
function! context#callback(path, job, status)
call s:callback(a:path, a:job, a:status)
endfunction
function! s:typeset(path)
execute '!' . context#command() . ' ' . shellescape(fnamemodify(a:path, ":t"))
call call(get(b:, 'context_callback', get(g:, 'context_callback', 'context#callback')),
\ [a:path, 0, v:shell_error])
endfunction
endif " has('job')
function! s:callback(path, job, status) abort
if a:status < 0 " Assume the job was terminated
return
endif
" Get info about the current window
let l:winid = s:win_getid() " Save window id
let l:efm = &l:errorformat " Save local errorformat
let l:cwd = fnamemodify(getcwd(), ":p") " Save local working directory
" Set errorformat to parse ConTeXt errors
execute 'setl efm=' . escape(b:context_errorformat, ' ')
try " Set cwd to expand error file correctly
execute 'lcd' fnameescape(fnamemodify(a:path, ':h'))
catch /.*/
execute 'setl efm=' . escape(l:efm, ' ')
throw v:exception
endtry
try
execute 'cgetfile' fnameescape(fnamemodify(a:path, ':r') . '.log')
botright cwindow
finally " Restore cwd and errorformat
execute s:win_id2win(l:winid) . 'wincmd w'
execute 'lcd ' . fnameescape(l:cwd)
execute 'setl efm=' . escape(l:efm, ' ')
endtry
if a:status == 0
call s:context_echo('Success!', 'ModeMsg')
else
call s:context_echo('There are errors. ', 'ErrorMsg')
endif
endfunction
function! context#command()
return get(b:, 'context_mtxrun', get(g:, 'context_mtxrun', 'mtxrun'))
\ . ' --script context --autogenerate --nonstopmode'
\ . ' --synctex=' . (get(b:, 'context_synctex', get(g:, 'context_synctex', 0)) ? '1' : '0')
\ . ' ' . get(b:, 'context_extra_options', get(g:, 'context_extra_options', ''))
endfunction
" Accepts an optional path (useful for big projects, when the file you are
" editing is not the project's root document). If no argument is given, uses
" the path of the current buffer.
function! context#typeset(...) abort
let l:path = fnamemodify(strlen(a:000[0]) > 0 ? a:1 : expand("%"), ":p")
let l:cwd = fnamemodify(getcwd(), ":p") " Save local working directory
call s:context_echo('Typesetting...', 'ModeMsg')
execute 'lcd' fnameescape(fnamemodify(l:path, ":h"))
try
call s:typeset(l:path)
finally " Restore local working directory
execute 'lcd ' . fnameescape(l:cwd)
endtry
endfunction!
"}}}
let &cpo = s:keepcpo
unlet s:keepcpo
" vim: sw=2 fdm=marker

View File

@ -0,0 +1,25 @@
" Language: ConTeXt typesetting engine
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
" Latest Revision: 2016 Oct 15
let s:keepcpo= &cpo
set cpo&vim
" Complete keywords in MetaPost blocks
function! contextcomplete#Complete(findstart, base)
if a:findstart == 1
if len(synstack(line('.'), 1)) > 0 &&
\ synIDattr(synstack(line('.'), 1)[0], "name") ==# 'contextMPGraphic'
return syntaxcomplete#Complete(a:findstart, a:base)
else
return -3
endif
else
return syntaxcomplete#Complete(a:findstart, a:base)
endif
endfunction
let &cpo = s:keepcpo
unlet s:keepcpo
" vim: sw=2 fdm=marker

File diff suppressed because it is too large Load Diff

745
runtime/autoload/dist/ft.vim vendored Normal file
View File

@ -0,0 +1,745 @@
" Vim functions for file type detection
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2017 Dec 05
" These functions are moved here from runtime/filetype.vim to make startup
" faster.
" Line continuation is used here, remove 'C' from 'cpoptions'
let s:cpo_save = &cpo
set cpo&vim
func dist#ft#Check_inp()
if getline(1) =~ '^\*'
setf abaqus
else
let n = 1
if line("$") > 500
let nmax = 500
else
let nmax = line("$")
endif
while n <= nmax
if getline(n) =~? "^header surface data"
setf trasys
break
endif
let n = n + 1
endwhile
endif
endfunc
" This function checks for the kind of assembly that is wanted by the user, or
" can be detected from the first five lines of the file.
func dist#ft#FTasm()
" make sure b:asmsyntax exists
if !exists("b:asmsyntax")
let b:asmsyntax = ""
endif
if b:asmsyntax == ""
call dist#ft#FTasmsyntax()
endif
" if b:asmsyntax still isn't set, default to asmsyntax or GNU
if b:asmsyntax == ""
if exists("g:asmsyntax")
let b:asmsyntax = g:asmsyntax
else
let b:asmsyntax = "asm"
endif
endif
exe "setf " . fnameescape(b:asmsyntax)
endfunc
func dist#ft#FTasmsyntax()
" see if file contains any asmsyntax=foo overrides. If so, change
" b:asmsyntax appropriately
let head = " ".getline(1)." ".getline(2)." ".getline(3)." ".getline(4).
\" ".getline(5)." "
let match = matchstr(head, '\sasmsyntax=\zs[a-zA-Z0-9]\+\ze\s')
if match != ''
let b:asmsyntax = match
elseif ((head =~? '\.title') || (head =~? '\.ident') || (head =~? '\.macro') || (head =~? '\.subtitle') || (head =~? '\.library'))
let b:asmsyntax = "vmasm"
endif
endfunc
" Check if one of the first five lines contains "VB_Name". In that case it is
" probably a Visual Basic file. Otherwise it's assumed to be "alt" filetype.
func dist#ft#FTVB(alt)
if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'VB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)'
setf vb
else
exe "setf " . a:alt
endif
endfunc
func dist#ft#FTbtm()
if exists("g:dosbatch_syntax_for_btm") && g:dosbatch_syntax_for_btm
setf dosbatch
else
setf btm
endif
endfunc
func dist#ft#BindzoneCheck(default)
if getline(1).getline(2).getline(3).getline(4) =~ '^; <<>> DiG [0-9.]\+.* <<>>\|$ORIGIN\|$TTL\|IN\s\+SOA'
setf bindzone
elseif a:default != ''
exe 'setf ' . a:default
endif
endfunc
func dist#ft#FTlpc()
if exists("g:lpc_syntax_for_c")
let lnum = 1
while lnum <= 12
if getline(lnum) =~# '^\(//\|inherit\|private\|protected\|nosave\|string\|object\|mapping\|mixed\)'
setf lpc
return
endif
let lnum = lnum + 1
endwhile
endif
setf c
endfunc
func dist#ft#FTheader()
if match(getline(1, min([line("$"), 200])), '^@\(interface\|end\|class\)') > -1
if exists("g:c_syntax_for_h")
setf objc
else
setf objcpp
endif
elseif exists("g:c_syntax_for_h")
setf c
elseif exists("g:ch_syntax_for_h")
setf ch
else
setf cpp
endif
endfunc
" This function checks if one of the first ten lines start with a '@'. In
" that case it is probably a change file.
" If the first line starts with # or ! it's probably a ch file.
" If a line has "main", "include", "//" ir "/*" it's probably ch.
" Otherwise CHILL is assumed.
func dist#ft#FTchange()
let lnum = 1
while lnum <= 10
if getline(lnum)[0] == '@'
setf change
return
endif
if lnum == 1 && (getline(1)[0] == '#' || getline(1)[0] == '!')
setf ch
return
endif
if getline(lnum) =~ "MODULE"
setf chill
return
endif
if getline(lnum) =~ 'main\s*(\|#\s*include\|//'
setf ch
return
endif
let lnum = lnum + 1
endwhile
setf chill
endfunc
func dist#ft#FTent()
" This function checks for valid cl syntax in the first five lines.
" Look for either an opening comment, '#', or a block start, '{".
" If not found, assume SGML.
let lnum = 1
while lnum < 6
let line = getline(lnum)
if line =~ '^\s*[#{]'
setf cl
return
elseif line !~ '^\s*$'
" Not a blank line, not a comment, and not a block start,
" so doesn't look like valid cl code.
break
endif
let lnum = lnum + 1
endw
setf dtd
endfunc
func dist#ft#EuphoriaCheck()
if exists('g:filetype_euphoria')
exe 'setf ' . g:filetype_euphoria
else
setf euphoria3
endif
endfunc
func dist#ft#DtraceCheck()
let lines = getline(1, min([line("$"), 100]))
if match(lines, '^module\>\|^import\>') > -1
" D files often start with a module and/or import statement.
setf d
elseif match(lines, '^#!\S\+dtrace\|#pragma\s\+D\s\+option\|:\S\{-}:\S\{-}:') > -1
setf dtrace
else
setf d
endif
endfunc
func dist#ft#FTe()
if exists('g:filetype_euphoria')
exe 'setf ' . g:filetype_euphoria
else
let n = 1
while n < 100 && n < line("$")
if getline(n) =~ "^\\s*\\(<'\\|'>\\)\\s*$"
setf specman
return
endif
let n = n + 1
endwhile
setf eiffel
endif
endfunc
" Distinguish between HTML, XHTML and Django
func dist#ft#FThtml()
let n = 1
while n < 10 && n < line("$")
if getline(n) =~ '\<DTD\s\+XHTML\s'
setf xhtml
return
endif
if getline(n) =~ '{%\s*\(extends\|block\|load\)\>\|{#\s\+'
setf htmldjango
return
endif
let n = n + 1
endwhile
setf html
endfunc
" Distinguish between standard IDL and MS-IDL
func dist#ft#FTidl()
let n = 1
while n < 50 && n < line("$")
if getline(n) =~ '^\s*import\s\+"\(unknwn\|objidl\)\.idl"'
setf msidl
return
endif
let n = n + 1
endwhile
setf idl
endfunc
" Distinguish between "default" and Cproto prototype file. */
func dist#ft#ProtoCheck(default)
" Cproto files have a comment in the first line and a function prototype in
" the second line, it always ends in ";". Indent files may also have
" comments, thus we can't match comments to see the difference.
" IDL files can have a single ';' in the second line, require at least one
" chacter before the ';'.
if getline(2) =~ '.;$'
setf cpp
else
exe 'setf ' . a:default
endif
endfunc
func dist#ft#FTm()
let n = 1
let saw_comment = 0 " Whether we've seen a multiline comment leader.
while n < 100
let line = getline(n)
if line =~ '^\s*/\*'
" /* ... */ is a comment in Objective C and Murphi, so we can't conclude
" it's either of them yet, but track this as a hint in case we don't see
" anything more definitive.
let saw_comment = 1
endif
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|//\)'
setf objc
return
endif
if line =~ '^\s*%'
setf matlab
return
endif
if line =~ '^\s*(\*'
setf mma
return
endif
if line =~ '^\c\s*\(\(type\|var\)\>\|--\)'
setf murphi
return
endif
let n = n + 1
endwhile
if saw_comment
" We didn't see anything definitive, but this looks like either Objective C
" or Murphi based on the comment leader. Assume the former as it is more
" common.
setf objc
elseif exists("g:filetype_m")
" Use user specified default filetype for .m
exe "setf " . g:filetype_m
else
" Default is matlab
setf matlab
endif
endfunc
func dist#ft#FTmms()
let n = 1
while n < 10
let line = getline(n)
if line =~ '^\s*\(%\|//\)' || line =~ '^\*'
setf mmix
return
endif
if line =~ '^\s*#'
setf make
return
endif
let n = n + 1
endwhile
setf mmix
endfunc
" This function checks if one of the first five lines start with a dot. In
" that case it is probably an nroff file: 'filetype' is set and 1 is returned.
func dist#ft#FTnroff()
if getline(1)[0] . getline(2)[0] . getline(3)[0] . getline(4)[0] . getline(5)[0] =~ '\.'
setf nroff
return 1
endif
return 0
endfunc
func dist#ft#FTmm()
let n = 1
while n < 10
let line = getline(n)
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)'
setf objcpp
return
endif
let n = n + 1
endwhile
setf nroff
endfunc
func dist#ft#FTpl()
if exists("g:filetype_pl")
exe "setf " . g:filetype_pl
else
" recognize Prolog by specific text in the first non-empty line
" require a blank after the '%' because Perl uses "%list" and "%translate"
let l = getline(nextnonblank(1))
if l =~ '\<prolog\>' || l =~ '^\s*\(%\+\(\s\|$\)\|/\*\)' || l =~ ':-'
setf prolog
else
setf perl
endif
endif
endfunc
func dist#ft#FTinc()
if exists("g:filetype_inc")
exe "setf " . g:filetype_inc
else
let lines = getline(1).getline(2).getline(3)
if lines =~? "perlscript"
setf aspperl
elseif lines =~ "<%"
setf aspvbs
elseif lines =~ "<?"
setf php
else
call dist#ft#FTasmsyntax()
if exists("b:asmsyntax")
exe "setf " . fnameescape(b:asmsyntax)
else
setf pov
endif
endif
endif
endfunc
func dist#ft#FTprogress_cweb()
if exists("g:filetype_w")
exe "setf " . g:filetype_w
return
endif
if getline(1) =~ '&ANALYZE' || getline(3) =~ '&GLOBAL-DEFINE'
setf progress
else
setf cweb
endif
endfunc
func dist#ft#FTprogress_asm()
if exists("g:filetype_i")
exe "setf " . g:filetype_i
return
endif
" This function checks for an assembly comment the first ten lines.
" If not found, assume Progress.
let lnum = 1
while lnum <= 10 && lnum < line('$')
let line = getline(lnum)
if line =~ '^\s*;' || line =~ '^\*'
call dist#ft#FTasm()
return
elseif line !~ '^\s*$' || line =~ '^/\*'
" Not an empty line: Doesn't look like valid assembly code.
" Or it looks like a Progress /* comment
break
endif
let lnum = lnum + 1
endw
setf progress
endfunc
func dist#ft#FTprogress_pascal()
if exists("g:filetype_p")
exe "setf " . g:filetype_p
return
endif
" This function checks for valid Pascal syntax in the first ten lines.
" Look for either an opening comment or a program start.
" If not found, assume Progress.
let lnum = 1
while lnum <= 10 && lnum < line('$')
let line = getline(lnum)
if line =~ '^\s*\(program\|unit\|procedure\|function\|const\|type\|var\)\>'
\ || line =~ '^\s*{' || line =~ '^\s*(\*'
setf pascal
return
elseif line !~ '^\s*$' || line =~ '^/\*'
" Not an empty line: Doesn't look like valid Pascal code.
" Or it looks like a Progress /* comment
break
endif
let lnum = lnum + 1
endw
setf progress
endfunc
func dist#ft#FTr()
let max = line("$") > 50 ? 50 : line("$")
for n in range(1, max)
" Rebol is easy to recognize, check for that first
if getline(n) =~? '\<REBOL\>'
setf rebol
return
endif
endfor
for n in range(1, max)
" R has # comments
if getline(n) =~ '^\s*#'
setf r
return
endif
" Rexx has /* comments */
if getline(n) =~ '^\s*/\*'
setf rexx
return
endif
endfor
" Nothing recognized, use user default or assume Rexx
if exists("g:filetype_r")
exe "setf " . g:filetype_r
else
" Rexx used to be the default, but R appears to be much more popular.
setf r
endif
endfunc
func dist#ft#McSetf()
" Rely on the file to start with a comment.
" MS message text files use ';', Sendmail files use '#' or 'dnl'
for lnum in range(1, min([line("$"), 20]))
let line = getline(lnum)
if line =~ '^\s*\(#\|dnl\)'
setf m4 " Sendmail .mc file
return
elseif line =~ '^\s*;'
setf msmessages " MS Message text file
return
endif
endfor
setf m4 " Default: Sendmail .mc file
endfunc
" Called from filetype.vim and scripts.vim.
func dist#ft#SetFileTypeSH(name)
if expand("<amatch>") =~ g:ft_ignore_pat
return
endif
if a:name =~ '\<csh\>'
" Some .sh scripts contain #!/bin/csh.
call dist#ft#SetFileTypeShell("csh")
return
elseif a:name =~ '\<tcsh\>'
" Some .sh scripts contain #!/bin/tcsh.
call dist#ft#SetFileTypeShell("tcsh")
return
elseif a:name =~ '\<zsh\>'
" Some .sh scripts contain #!/bin/zsh.
call dist#ft#SetFileTypeShell("zsh")
return
elseif a:name =~ '\<ksh\>'
let b:is_kornshell = 1
if exists("b:is_bash")
unlet b:is_bash
endif
if exists("b:is_sh")
unlet b:is_sh
endif
elseif exists("g:bash_is_sh") || a:name =~ '\<bash\>' || a:name =~ '\<bash2\>'
let b:is_bash = 1
if exists("b:is_kornshell")
unlet b:is_kornshell
endif
if exists("b:is_sh")
unlet b:is_sh
endif
elseif a:name =~ '\<sh\>'
let b:is_sh = 1
if exists("b:is_kornshell")
unlet b:is_kornshell
endif
if exists("b:is_bash")
unlet b:is_bash
endif
endif
call dist#ft#SetFileTypeShell("sh")
endfunc
" For shell-like file types, check for an "exec" command hidden in a comment,
" as used for Tcl.
" Also called from scripts.vim, thus can't be local to this script.
func dist#ft#SetFileTypeShell(name)
if expand("<amatch>") =~ g:ft_ignore_pat
return
endif
let l = 2
while l < 20 && l < line("$") && getline(l) =~ '^\s*\(#\|$\)'
" Skip empty and comment lines.
let l = l + 1
endwhile
if l < line("$") && getline(l) =~ '\s*exec\s' && getline(l - 1) =~ '^\s*#.*\\$'
" Found an "exec" line after a comment with continuation
let n = substitute(getline(l),'\s*exec\s\+\([^ ]*/\)\=', '', '')
if n =~ '\<tclsh\|\<wish'
setf tcl
return
endif
endif
exe "setf " . a:name
endfunc
func dist#ft#CSH()
if exists("g:filetype_csh")
call dist#ft#SetFileTypeShell(g:filetype_csh)
elseif &shell =~ "tcsh"
call dist#ft#SetFileTypeShell("tcsh")
else
call dist#ft#SetFileTypeShell("csh")
endif
endfunc
let s:ft_rules_udev_rules_pattern = '^\s*\cudev_rules\s*=\s*"\([^"]\{-1,}\)/*".*'
func dist#ft#FTRules()
let path = expand('<amatch>:p')
if path =~ '^/\(etc/udev/\%(rules\.d/\)\=.*\.rules\|lib/udev/\%(rules\.d/\)\=.*\.rules\)$'
setf udevrules
return
endif
if path =~ '^/etc/ufw/'
setf conf " Better than hog
return
endif
if path =~ '^/\(etc\|usr/share\)/polkit-1/rules\.d'
setf javascript
return
endif
try
let config_lines = readfile('/etc/udev/udev.conf')
catch /^Vim\%((\a\+)\)\=:E484/
setf hog
return
endtry
let dir = expand('<amatch>:p:h')
for line in config_lines
if line =~ s:ft_rules_udev_rules_pattern
let udev_rules = substitute(line, s:ft_rules_udev_rules_pattern, '\1', "")
if dir == udev_rules
setf udevrules
endif
break
endif
endfor
setf hog
endfunc
func dist#ft#SQL()
if exists("g:filetype_sql")
exe "setf " . g:filetype_sql
else
setf sql
endif
endfunc
" If the file has an extension of 't' and is in a directory 't' or 'xt' then
" it is almost certainly a Perl test file.
" If the first line starts with '#' and contains 'perl' it's probably a Perl
" file.
" (Slow test) If a file contains a 'use' statement then it is almost certainly
" a Perl file.
func dist#ft#FTperl()
let dirname = expand("%:p:h:t")
if expand("%:e") == 't' && (dirname == 't' || dirname == 'xt')
setf perl
return 1
endif
if getline(1)[0] == '#' && getline(1) =~ 'perl'
setf perl
return 1
endif
let save_cursor = getpos('.')
call cursor(1,1)
let has_use = search('^use\s\s*\k', 'c', 30)
call setpos('.', save_cursor)
if has_use
setf perl
return 1
endif
return 0
endfunc
" Choose context, plaintex, or tex (LaTeX) based on these rules:
" 1. Check the first line of the file for "%&<format>".
" 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords.
" 3. Default to "plain" or to g:tex_flavor, can be set in user's vimrc.
func dist#ft#FTtex()
let firstline = getline(1)
if firstline =~ '^%&\s*\a\+'
let format = tolower(matchstr(firstline, '\a\+'))
let format = substitute(format, 'pdf', '', '')
if format == 'tex'
let format = 'latex'
elseif format == 'plaintex'
let format = 'plain'
endif
elseif expand('%') =~ 'tex/context/.*/.*.tex'
let format = 'context'
else
" Default value, may be changed later:
let format = exists("g:tex_flavor") ? g:tex_flavor : 'plain'
" Save position, go to the top of the file, find first non-comment line.
let save_cursor = getpos('.')
call cursor(1,1)
let firstNC = search('^\s*[^[:space:]%]', 'c', 1000)
if firstNC " Check the next thousand lines for a LaTeX or ConTeXt keyword.
let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>'
let cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>'
let kwline = search('^\s*\\\%(' . lpat . '\)\|^\s*\\\(' . cpat . '\)',
\ 'cnp', firstNC + 1000)
if kwline == 1 " lpat matched
let format = 'latex'
elseif kwline == 2 " cpat matched
let format = 'context'
endif " If neither matched, keep default set above.
" let lline = search('^\s*\\\%(' . lpat . '\)', 'cn', firstNC + 1000)
" let cline = search('^\s*\\\%(' . cpat . '\)', 'cn', firstNC + 1000)
" if cline > 0
" let format = 'context'
" endif
" if lline > 0 && (cline == 0 || cline > lline)
" let format = 'tex'
" endif
endif " firstNC
call setpos('.', save_cursor)
endif " firstline =~ '^%&\s*\a\+'
" Translation from formats to file types. TODO: add AMSTeX, RevTex, others?
if format == 'plain'
setf plaintex
elseif format == 'context'
setf context
else " probably LaTeX
setf tex
endif
return
endfunc
func dist#ft#FTxml()
let n = 1
while n < 100 && n < line("$")
let line = getline(n)
" DocBook 4 or DocBook 5.
let is_docbook4 = line =~ '<!DOCTYPE.*DocBook'
let is_docbook5 = line =~ ' xmlns="http://docbook.org/ns/docbook"'
if is_docbook4 || is_docbook5
let b:docbk_type = "xml"
if is_docbook5
let b:docbk_ver = 5
else
let b:docbk_ver = 4
endif
setf docbk
return
endif
if line =~ 'xmlns:xbl="http://www.mozilla.org/xbl"'
setf xbl
return
endif
let n += 1
endwhile
setf xml
endfunc
func dist#ft#FTy()
let n = 1
while n < 100 && n < line("$")
let line = getline(n)
if line =~ '^\s*%'
setf yacc
return
endif
if getline(n) =~ '^\s*\(#\|class\>\)' && getline(n) !~ '^\s*#\s*include'
setf racc
return
endif
let n = n + 1
endwhile
setf yacc
endfunc
func dist#ft#Redif()
let lnum = 1
while lnum <= 5 && lnum < line('$')
if getline(lnum) =~ "^\ctemplate-type:"
setf redif
return
endif
let lnum = lnum + 1
endwhile
endfunc
" Restore 'cpoptions'
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -1,667 +0,0 @@
" ---------------------------------------------------------------------
" getscript.vim
" Author: Charles E. Campbell
" Date: Jan 21, 2014
" Version: 36
" Installing: :help glvs-install
" Usage: :help glvs
"
" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
"redraw!|call inputsave()|call input("Press <cr> to continue")|call inputrestore()
" ---------------------------------------------------------------------
" Initialization: {{{1
" if you're sourcing this file, surely you can't be
" expecting vim to be in its vi-compatible mode!
if exists("g:loaded_getscript")
finish
endif
let g:loaded_getscript= "v36"
if &cp
echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
finish
endif
if v:version < 702
echohl WarningMsg
echo "***warning*** this version of getscript needs vim 7.2"
echohl Normal
finish
endif
let s:keepcpo = &cpo
set cpo&vim
"DechoTabOn
" ---------------------------
" Global Variables: {{{1
" ---------------------------
" Cygwin Detection ------- {{{2
if !exists("g:getscript_cygwin")
if has("win32") || has("win95") || has("win64") || has("win16")
if &shell =~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$'
let g:getscript_cygwin= 1
else
let g:getscript_cygwin= 0
endif
else
let g:getscript_cygwin= 0
endif
endif
" wget vs curl {{{2
if !exists("g:GetLatestVimScripts_wget")
if executable("wget")
let g:GetLatestVimScripts_wget= "wget"
elseif executable("curl")
let g:GetLatestVimScripts_wget= "curl"
else
let g:GetLatestVimScripts_wget = 'echo "GetLatestVimScripts needs wget or curl"'
let g:GetLatestVimScripts_options = ""
endif
endif
" options that wget and curl require:
if !exists("g:GetLatestVimScripts_options")
if g:GetLatestVimScripts_wget == "wget"
let g:GetLatestVimScripts_options= "-q -O"
elseif g:GetLatestVimScripts_wget == "curl"
let g:GetLatestVimScripts_options= "-s -O"
else
let g:GetLatestVimScripts_options= ""
endif
endif
" by default, allow autoinstall lines to work
if !exists("g:GetLatestVimScripts_allowautoinstall")
let g:GetLatestVimScripts_allowautoinstall= 1
endif
" set up default scriptaddr address
if !exists("g:GetLatestVimScripts_scriptaddr")
let g:GetLatestVimScripts_scriptaddr = 'http://vim.sourceforge.net/script.php?script_id='
endif
"" For debugging:
"let g:GetLatestVimScripts_wget = "echo"
"let g:GetLatestVimScripts_options = "options"
" ---------------------------------------------------------------------
" Check If AutoInstall Capable: {{{1
let s:autoinstall= ""
if g:GetLatestVimScripts_allowautoinstall
if (has("win32") || has("gui_win32") || has("gui_win32s") || has("win16") || has("win64") || has("win32unix") || has("win95")) && &shell != "bash"
" windows (but not cygwin/bash)
let s:dotvim= "vimfiles"
if !exists("g:GetLatestVimScripts_mv")
let g:GetLatestVimScripts_mv= "ren"
endif
else
" unix
let s:dotvim= ".vim"
if !exists("g:GetLatestVimScripts_mv")
let g:GetLatestVimScripts_mv= "mv"
endif
endif
if exists("g:GetLatestVimScripts_autoinstalldir") && isdirectory(g:GetLatestVimScripts_autoinstalldir)
let s:autoinstall= g:GetLatestVimScripts_autoinstalldir"
elseif exists('$HOME') && isdirectory(expand("$HOME")."/".s:dotvim)
let s:autoinstall= $HOME."/".s:dotvim
endif
" call Decho("s:autoinstall<".s:autoinstall.">")
"else "Decho
" call Decho("g:GetLatestVimScripts_allowautoinstall=".g:GetLatestVimScripts_allowautoinstall.": :AutoInstall: disabled")
endif
" ---------------------------------------------------------------------
" Public Interface: {{{1
com! -nargs=0 GetLatestVimScripts call getscript#GetLatestVimScripts()
com! -nargs=0 GetScript call getscript#GetLatestVimScripts()
silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts()
" ---------------------------------------------------------------------
" GetLatestVimScripts: this function gets the latest versions of {{{1
" scripts based on the list in
" (first dir in runtimepath)/GetLatest/GetLatestVimScripts.dat
fun! getscript#GetLatestVimScripts()
" call Dfunc("GetLatestVimScripts() autoinstall<".s:autoinstall.">")
" insure that wget is executable
if executable(g:GetLatestVimScripts_wget) != 1
echoerr "GetLatestVimScripts needs ".g:GetLatestVimScripts_wget." which apparently is not available on your system"
" call Dret("GetLatestVimScripts : wget not executable/availble")
return
endif
" insure that fnameescape() is available
if !exists("*fnameescape")
echoerr "GetLatestVimScripts needs fnameescape() (provided by 7.1.299 or later)"
return
endif
" Find the .../GetLatest subdirectory under the runtimepath
for datadir in split(&rtp,',') + ['']
if isdirectory(datadir."/GetLatest")
" call Decho("found directory<".datadir.">")
let datadir= datadir . "/GetLatest"
break
endif
if filereadable(datadir."GetLatestVimScripts.dat")
" call Decho("found ".datadir."/GetLatestVimScripts.dat")
break
endif
endfor
" Sanity checks: readability and writability
if datadir == ""
echoerr 'Missing "GetLatest/" on your runtimepath - see :help glvs-dist-install'
" call Dret("GetLatestVimScripts : unable to find a GetLatest subdirectory")
return
endif
if filewritable(datadir) != 2
echoerr "(getLatestVimScripts) Your ".datadir." isn't writable"
" call Dret("GetLatestVimScripts : non-writable directory<".datadir.">")
return
endif
let datafile= datadir."/GetLatestVimScripts.dat"
if !filereadable(datafile)
echoerr "Your data file<".datafile."> isn't readable"
" call Dret("GetLatestVimScripts : non-readable datafile<".datafile.">")
return
endif
if !filewritable(datafile)
echoerr "Your data file<".datafile."> isn't writable"
" call Dret("GetLatestVimScripts : non-writable datafile<".datafile.">")
return
endif
" --------------------
" Passed sanity checks
" --------------------
" call Decho("datadir <".datadir.">")
" call Decho("datafile <".datafile.">")
" don't let any event handlers interfere (like winmanager's, taglist's, etc)
let eikeep = &ei
let hlskeep = &hls
let acdkeep = &acd
set ei=all hls&vim noacd
" Edit the datafile (ie. GetLatestVimScripts.dat):
" 1. record current directory (origdir),
" 2. change directory to datadir,
" 3. split window
" 4. edit datafile
let origdir= getcwd()
" call Decho("exe cd ".fnameescape(substitute(datadir,'\','/','ge')))
exe "cd ".fnameescape(substitute(datadir,'\','/','ge'))
split
" call Decho("exe e ".fnameescape(substitute(datafile,'\','/','ge')))
exe "e ".fnameescape(substitute(datafile,'\','/','ge'))
res 1000
let s:downloads = 0
let s:downerrors= 0
" Check on dependencies mentioned in plugins
" call Decho(" ")
" call Decho("searching plugins for GetLatestVimScripts dependencies")
let lastline = line("$")
" call Decho("lastline#".lastline)
let firstdir = substitute(&rtp,',.*$','','')
let plugins = split(globpath(firstdir,"plugin/**/*.vim"),'\n')
let plugins = plugins + split(globpath(firstdir,"AsNeeded/**/*.vim"),'\n')
let foundscript = 0
" this loop updates the GetLatestVimScripts.dat file
" with dependencies explicitly mentioned in the plugins
" via GetLatestVimScripts: ... lines
" It reads the plugin script at the end of the GetLatestVimScripts.dat
" file, examines it, and then removes it.
for plugin in plugins
" call Decho(" ")
" call Decho("plugin<".plugin.">")
" read plugin in
" evidently a :r creates a new buffer (the "#" buffer) that is subsequently unused -- bwiping it
$
" call Decho(".dependency checking<".plugin."> line$=".line("$"))
" call Decho("..exe silent r ".fnameescape(plugin))
exe "silent r ".fnameescape(plugin)
exe "silent bwipe ".bufnr("#")
while search('^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+','W') != 0
let depscript = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+\s\+\(.*\)$','\1','e')
let depscriptid = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\(\d\+\)\s\+.*$','\1','')
let llp1 = lastline+1
" call Decho("..depscript<".depscript.">")
" found a "GetLatestVimScripts: # #" line in the script;
" check if its already in the datafile by searching backwards from llp1,
" the (prior to reading in the plugin script) last line plus one of the GetLatestVimScripts.dat file,
" for the script-id with no wrapping allowed.
let curline = line(".")
let noai_script = substitute(depscript,'\s*:AutoInstall:\s*','','e')
exe llp1
let srchline = search('^\s*'.depscriptid.'\s\+\d\+\s\+.*$','bW')
if srchline == 0
" this second search is taken when, for example, a 0 0 scriptname is to be skipped over
let srchline= search('\<'.noai_script.'\>','bW')
endif
" call Decho("..noai_script<".noai_script."> depscriptid#".depscriptid." srchline#".srchline." curline#".line(".")." lastline#".lastline)
if srchline == 0
" found a new script to permanently include in the datafile
let keep_rega = @a
let @a = substitute(getline(curline),'^"\s\+GetLatestVimScripts:\s\+','','')
echomsg "Appending <".@a."> to ".datafile." for ".depscript
" call Decho("..Appending <".@a."> to ".datafile." for ".depscript)
exe lastline."put a"
let @a = keep_rega
let lastline = llp1
let curline = curline + 1
let foundscript = foundscript + 1
" else " Decho
" call Decho("..found <".noai_script."> (already in datafile at line#".srchline.")")
endif
let curline = curline + 1
exe curline
endwhile
" llp1: last line plus one
let llp1= lastline + 1
" call Decho(".deleting lines: ".llp1.",$d")
exe "silent! ".llp1.",$d"
endfor
" call Decho("--- end dependency checking loop --- foundscript=".foundscript)
" call Decho(" ")
" call Dredir("BUFFER TEST (GetLatestVimScripts 1)","ls!")
if foundscript == 0
setlocal nomod
endif
" --------------------------------------------------------------------
" Check on out-of-date scripts using GetLatest/GetLatestVimScripts.dat
" --------------------------------------------------------------------
" call Decho("begin: checking out-of-date scripts using datafile<".datafile.">")
setlocal lz
1
" /^-----/,$g/^\s*\d/call Decho(getline("."))
1
/^-----/,$g/^\s*\d/call s:GetOneScript()
" call Decho("--- end out-of-date checking --- ")
" Final report (an echomsg)
try
silent! ?^-------?
catch /^Vim\%((\a\+)\)\=:E114/
" call Dret("GetLatestVimScripts : nothing done!")
return
endtry
exe "norm! kz\<CR>"
redraw!
let s:msg = ""
if s:downloads == 1
let s:msg = "Downloaded one updated script to <".datadir.">"
elseif s:downloads == 2
let s:msg= "Downloaded two updated scripts to <".datadir.">"
elseif s:downloads > 1
let s:msg= "Downloaded ".s:downloads." updated scripts to <".datadir.">"
else
let s:msg= "Everything was already current"
endif
if s:downerrors > 0
let s:msg= s:msg." (".s:downerrors." downloading errors)"
endif
echomsg s:msg
" save the file
if &mod
silent! w!
endif
q!
" restore events and current directory
exe "cd ".fnameescape(substitute(origdir,'\','/','ge'))
let &ei = eikeep
let &hls = hlskeep
let &acd = acdkeep
setlocal nolz
" call Dredir("BUFFER TEST (GetLatestVimScripts 2)","ls!")
" call Dret("GetLatestVimScripts : did ".s:downloads." downloads")
endfun
" ---------------------------------------------------------------------
" GetOneScript: (Get Latest Vim Script) this function operates {{{1
" on the current line, interpreting two numbers and text as
" ScriptID, SourceID, and Filename.
" It downloads any scripts that have newer versions from vim.sourceforge.net.
fun! s:GetOneScript(...)
" call Dfunc("GetOneScript()")
" set options to allow progress to be shown on screen
let rega= @a
let t_ti= &t_ti
let t_te= &t_te
let rs = &rs
set t_ti= t_te= nors
" put current line on top-of-screen and interpret it into
" a script identifer : used to obtain webpage
" source identifier : used to identify current version
" and an associated comment: used to report on what's being considered
if a:0 >= 3
let scriptid = a:1
let srcid = a:2
let fname = a:3
let cmmnt = ""
" call Decho("scriptid<".scriptid.">")
" call Decho("srcid <".srcid.">")
" call Decho("fname <".fname.">")
else
let curline = getline(".")
if curline =~ '^\s*#'
let @a= rega
" call Dret("GetOneScript : skipping a pure comment line")
return
endif
let parsepat = '^\s*\(\d\+\)\s\+\(\d\+\)\s\+\(.\{-}\)\(\s*#.*\)\=$'
try
let scriptid = substitute(curline,parsepat,'\1','e')
catch /^Vim\%((\a\+)\)\=:E486/
let scriptid= 0
endtry
try
let srcid = substitute(curline,parsepat,'\2','e')
catch /^Vim\%((\a\+)\)\=:E486/
let srcid= 0
endtry
try
let fname= substitute(curline,parsepat,'\3','e')
catch /^Vim\%((\a\+)\)\=:E486/
let fname= ""
endtry
try
let cmmnt= substitute(curline,parsepat,'\4','e')
catch /^Vim\%((\a\+)\)\=:E486/
let cmmnt= ""
endtry
" call Decho("curline <".curline.">")
" call Decho("parsepat<".parsepat.">")
" call Decho("scriptid<".scriptid.">")
" call Decho("srcid <".srcid.">")
" call Decho("fname <".fname.">")
endif
" plugin author protection from downloading his/her own scripts atop their latest work
if scriptid == 0 || srcid == 0
" When looking for :AutoInstall: lines, skip scripts that have 0 0 scriptname
let @a= rega
" call Dret("GetOneScript : skipping a scriptid==srcid==0 line")
return
endif
let doautoinstall= 0
if fname =~ ":AutoInstall:"
" call Decho("case AutoInstall: fname<".fname.">")
let aicmmnt= substitute(fname,'\s\+:AutoInstall:\s\+',' ','')
" call Decho("aicmmnt<".aicmmnt."> s:autoinstall=".s:autoinstall)
if s:autoinstall != ""
let doautoinstall = g:GetLatestVimScripts_allowautoinstall
endif
else
let aicmmnt= fname
endif
" call Decho("aicmmnt<".aicmmnt.">: doautoinstall=".doautoinstall)
exe "norm z\<CR>"
redraw!
" call Decho('considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid)
echo 'considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid
" grab a copy of the plugin's vim.sourceforge.net webpage
let scriptaddr = g:GetLatestVimScripts_scriptaddr.scriptid
let tmpfile = tempname()
let v:errmsg = ""
" make up to three tries at downloading the description
let itry= 1
while itry <= 3
" call Decho(".try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr)
if has("win32") || has("win16") || has("win95")
" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)."|bw!")
new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)|bw!
else
" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr))
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr)
endif
if itry == 1
exe "silent vsplit ".fnameescape(tmpfile)
else
silent! e %
endif
setlocal bh=wipe
" find the latest source-id in the plugin's webpage
silent! 1
let findpkg= search('Click on the package to download','W')
if findpkg > 0
break
endif
let itry= itry + 1
endwhile
" call Decho(" --- end downloading tries while loop --- itry=".itry)
" testing: did finding "Click on the package..." fail?
if findpkg == 0 || itry >= 4
silent q!
call delete(tmpfile)
" restore options
let &t_ti = t_ti
let &t_te = t_te
let &rs = rs
let s:downerrors = s:downerrors + 1
" call Decho("***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">")
echomsg "***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">"
" call Dret("GetOneScript : srch for /Click on the package/ failed")
let @a= rega
return
endif
" call Decho('found "Click on the package to download"')
let findsrcid= search('src_id=','W')
if findsrcid == 0
silent q!
call delete(tmpfile)
" restore options
let &t_ti = t_ti
let &t_te = t_te
let &rs = rs
let s:downerrors = s:downerrors + 1
" call Decho("***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">")
echomsg "***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">"
let @a= rega
" call Dret("GetOneScript : srch for /src_id/ failed")
return
endif
" call Decho('found "src_id=" in description page')
let srcidpat = '^\s*<td class.*src_id=\(\d\+\)">\([^<]\+\)<.*$'
let latestsrcid= substitute(getline("."),srcidpat,'\1','')
let sname = substitute(getline("."),srcidpat,'\2','') " script name actually downloaded
" call Decho("srcidpat<".srcidpat."> latestsrcid<".latestsrcid."> sname<".sname.">")
silent q!
call delete(tmpfile)
" convert the strings-of-numbers into numbers
let srcid = srcid + 0
let latestsrcid = latestsrcid + 0
" call Decho("srcid=".srcid." latestsrcid=".latestsrcid." sname<".sname.">")
" has the plugin's most-recent srcid increased, which indicates that it has been updated
if latestsrcid > srcid
" call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."]: need to update <".sname.">")
let s:downloads= s:downloads + 1
if sname == bufname("%")
" GetLatestVimScript has to be careful about downloading itself
let sname= "NEW_".sname
endif
" -----------------------------------------------------------------------------
" the plugin has been updated since we last obtained it, so download a new copy
" -----------------------------------------------------------------------------
" call Decho(".downloading new <".sname.">")
echomsg ".downloading new <".sname.">"
if has("win32") || has("win16") || has("win95")
" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='.latestsrcid)."|q")
new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='.latestsrcid)|q
else
" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='))
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id=').latestsrcid
endif
" --------------------------------------------------------------------------
" AutoInstall: only if doautoinstall has been requested by the plugin itself
" --------------------------------------------------------------------------
" call Decho("checking if plugin requested autoinstall: doautoinstall=".doautoinstall)
if doautoinstall
" call Decho(" ")
" call Decho("Autoinstall: getcwd<".getcwd()."> filereadable(".sname.")=".filereadable(sname))
if filereadable(sname)
" call Decho("<".sname."> is readable")
" call Decho("exe silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall))
exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall)
let curdir = fnameescape(substitute(getcwd(),'\','/','ge'))
let installdir= curdir."/Installed"
if !isdirectory(installdir)
call mkdir(installdir)
endif
" call Decho("curdir<".curdir."> installdir<".installdir.">")
" call Decho("exe cd ".fnameescape(s:autoinstall))
exe "cd ".fnameescape(s:autoinstall)
" determine target directory for moves
let firstdir= substitute(&rtp,',.*$','','')
let pname = substitute(sname,'\..*','.vim','')
" call Decho("determine tgtdir: is <".firstdir.'/AsNeeded/'.pname." readable?")
if filereadable(firstdir.'/AsNeeded/'.pname)
let tgtdir= "AsNeeded"
else
let tgtdir= "plugin"
endif
" call Decho("tgtdir<".tgtdir."> pname<".pname.">")
" decompress
if sname =~ '\.bz2$'
" call Decho("decompress: attempt to bunzip2 ".sname)
exe "sil !bunzip2 ".shellescape(sname)
let sname= substitute(sname,'\.bz2$','','')
" call Decho("decompress: new sname<".sname."> after bunzip2")
elseif sname =~ '\.gz$'
" call Decho("decompress: attempt to gunzip ".sname)
exe "sil !gunzip ".shellescape(sname)
let sname= substitute(sname,'\.gz$','','')
" call Decho("decompress: new sname<".sname."> after gunzip")
elseif sname =~ '\.xz$'
" call Decho("decompress: attempt to unxz ".sname)
exe "sil !unxz ".shellescape(sname)
let sname= substitute(sname,'\.xz$','','')
" call Decho("decompress: new sname<".sname."> after unxz")
else
" call Decho("no decompression needed")
endif
" distribute archive(.zip, .tar, .vba, ...) contents
if sname =~ '\.zip$'
" call Decho("dearchive: attempt to unzip ".sname)
exe "silent !unzip -o ".shellescape(sname)
elseif sname =~ '\.tar$'
" call Decho("dearchive: attempt to untar ".sname)
exe "silent !tar -xvf ".shellescape(sname)
elseif sname =~ '\.tgz$'
" call Decho("dearchive: attempt to untar+gunzip ".sname)
exe "silent !tar -zxvf ".shellescape(sname)
elseif sname =~ '\.taz$'
" call Decho("dearchive: attempt to untar+uncompress ".sname)
exe "silent !tar -Zxvf ".shellescape(sname)
elseif sname =~ '\.tbz$'
" call Decho("dearchive: attempt to untar+bunzip2 ".sname)
exe "silent !tar -jxvf ".shellescape(sname)
elseif sname =~ '\.txz$'
" call Decho("dearchive: attempt to untar+xz ".sname)
exe "silent !tar -Jxvf ".shellescape(sname)
elseif sname =~ '\.vba$'
" call Decho("dearchive: attempt to handle a vimball: ".sname)
silent 1split
if exists("g:vimball_home")
let oldvimballhome= g:vimball_home
endif
let g:vimball_home= s:autoinstall
exe "silent e ".fnameescape(sname)
silent so %
silent q
if exists("oldvimballhome")
let g:vimball_home= oldvimballhome
else
unlet g:vimball_home
endif
else
" call Decho("no dearchiving needed")
endif
" ---------------------------------------------
" move plugin to plugin/ or AsNeeded/ directory
" ---------------------------------------------
if sname =~ '.vim$'
" call Decho("dearchive: attempt to simply move ".sname." to ".tgtdir)
exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".tgtdir
else
" call Decho("dearchive: move <".sname."> to installdir<".installdir.">")
exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".installdir
endif
if tgtdir != "plugin"
" call Decho("exe silent !".g:GetLatestVimScripts_mv." plugin/".shellescape(pname)." ".tgtdir)
exe "silent !".g:GetLatestVimScripts_mv." plugin/".shellescape(pname)." ".tgtdir
endif
" helptags step
let docdir= substitute(&rtp,',.*','','e')."/doc"
" call Decho("helptags: docdir<".docdir.">")
exe "helptags ".fnameescape(docdir)
exe "cd ".fnameescape(curdir)
endif
if fname !~ ':AutoInstall:'
let modline=scriptid." ".latestsrcid." :AutoInstall: ".fname.cmmnt
else
let modline=scriptid." ".latestsrcid." ".fname.cmmnt
endif
else
let modline=scriptid." ".latestsrcid." ".fname.cmmnt
endif
" update the data in the <GetLatestVimScripts.dat> file
call setline(line("."),modline)
" call Decho("update data in ".expand("%")."#".line(".").": modline<".modline.">")
" else " Decho
" call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."], no need to update")
endif
" restore options
let &t_ti = t_ti
let &t_te = t_te
let &rs = rs
let @a = rega
" call Dredir("BUFFER TEST (GetOneScript)","ls!")
" call Dret("GetOneScript")
endfun
" ---------------------------------------------------------------------
" Restore Options: {{{1
let &cpo= s:keepcpo
unlet s:keepcpo
" ---------------------------------------------------------------------
" Modelines: {{{1
" vim: ts=8 sts=2 fdm=marker nowrap

View File

@ -1,6 +1,6 @@
" Vim autoload file for editing compressed files.
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2014 Nov 05
" Last Change: 2016 Sep 28
" These functions are used by the gzip plugin.
@ -63,6 +63,9 @@ fun gzip#read(cmd)
" set 'modifiable'
let ma_save = &ma
setlocal ma
" set 'write'
let write_save = &write
set write
" Reset 'foldenable', otherwise line numbers get adjusted.
if has("folding")
let fen_save = &fen
@ -127,6 +130,7 @@ fun gzip#read(cmd)
let &pm = pm_save
let &cpo = cpo_save
let &l:ma = ma_save
let &write = write_save
if has("folding")
let &l:fen = fen_save
endif

File diff suppressed because it is too large Load Diff

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

@ -0,0 +1,177 @@
function! s:enhance_syntax() abort
syntax case match
syntax keyword healthError ERROR[:]
\ containedin=markdownCodeBlock,mkdListItemLine
highlight default link healthError Error
syntax keyword healthWarning WARNING[:]
\ containedin=markdownCodeBlock,mkdListItemLine
highlight default link healthWarning WarningMsg
syntax keyword healthSuccess OK[:]
\ containedin=markdownCodeBlock,mkdListItemLine
highlight default healthSuccess guibg=#5fff00 guifg=#080808 ctermbg=82 ctermfg=232
syntax match healthHelp "|.\{-}|" contains=healthBar
\ containedin=markdownCodeBlock,mkdListItemLine
syntax match healthBar "|" contained conceal
highlight default link healthHelp Identifier
" We do not care about markdown syntax errors in :checkhealth output.
highlight! link markdownError Normal
endfunction
" Runs the specified healthchecks.
" Runs all discovered healthchecks if a:plugin_names is empty.
function! health#check(plugin_names) abort
let healthchecks = empty(a:plugin_names)
\ ? s:discover_health_checks()
\ : s:to_fn_names(a:plugin_names)
tabnew
setlocal wrap breakindent
setlocal filetype=markdown
setlocal conceallevel=2 concealcursor=nc
setlocal keywordprg=:help
let &l:iskeyword='!-~,^*,^|,^",192-255'
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
" needed for plasticboy/vim-markdown, because it uses fdm=expr
normal! zR
setlocal nomodified
setlocal bufhidden=hide
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 ':h clipboard' to ':help |clipboard|'.
function! s:help_to_link(s) abort
return substitute(a:s, '\v:h%[elp] ([^|][^"\r\n ]+)', ':help |\1|', 'g')
endfunction
" Format a message for a specific report item.
" a:1: Optional advice (string or list)
function! s:format_report_message(status, msg, ...) abort " {{{
let output = ' - ' . a:status . ': ' . s:indent_after_line1(a:msg, 4)
" Optional parameters
if a:0 > 0
let advice = type(a:1) == type('') ? [a:1] : a:1
if type(advice) != type([])
throw 'a:1: expected String or List'
endif
" Report each suggestion
if !empty(advice)
let output .= "\n - ADVICE:"
for suggestion in advice
let output .= "\n - " . s:indent_after_line1(suggestion, 10)
endfor
endif
endif
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('OK', a:msg)
endfunction " }}}
" Reports a health warning.
" a:1: Optional advice (string or list)
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.
" a:1: Optional advice (string or list)
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 = []
let plugin_names = type('') ==# type(a:plugin_names)
\ ? split(a:plugin_names, '', v:false)
\ : a:plugin_names
for p in 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,197 @@
let s:suggest_faq = 'https://github.com/neovim/neovim/wiki/FAQ'
function! s:check_config() abort
let ok = v:true
call health#report_start('Configuration')
let vimrc = empty($MYVIMRC) ? stdpath('config').'/init.vim' : $MYVIMRC
if !filereadable(vimrc)
let ok = v:false
let has_vim = filereadable(expand('~/.vimrc'))
call health#report_warn('Missing user config file: '.vimrc,
\[ has_vim ? ':help nvim-from-vim' : ':help init.vim' ])
endif
" If $VIM is empty we don't care. Else make sure it is valid.
if !empty($VIM) && !filereadable($VIM.'/runtime/doc/nvim.txt')
let ok = v:false
call health#report_error('$VIM is invalid: '.$VIM)
endif
if exists('$NVIM_TUI_ENABLE_CURSOR_SHAPE')
let ok = v:false
call health#report_warn('$NVIM_TUI_ENABLE_CURSOR_SHAPE is ignored in Nvim 0.2+',
\ [ "Use the 'guicursor' option to configure cursor shape. :help 'guicursor'",
\ 'https://github.com/neovim/neovim/wiki/Following-HEAD#20170402' ])
endif
if &paste
let ok = v:false
call health#report_error("'paste' is enabled. This option is only for pasting text.\nIt should not be set in your config.",
\ [ 'Remove `set paste` from your init.vim, if applicable.',
\ 'Check `:verbose set paste?` to see if a plugin or script set the option.', ])
endif
if ok
call health#report_ok('no issues found')
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 = tr(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 default-terminal and $TERM
call health#report_info('$TERM: '.$TERM)
let cmd = 'tmux show-option -qvg default-terminal'
let out = system(cmd)
let tmux_default_term = substitute(out, '\v(\s|\r|\n)', '', 'g')
if empty(tmux_default_term)
let cmd = 'tmux show-option -qvgs default-terminal'
let out = system(cmd)
let tmux_default_term = substitute(out, '\v(\s|\r|\n)', '', 'g')
endif
if v:shell_error
call health#report_error('command failed: '.cmd."\n".out)
elseif tmux_default_term !=# $TERM
call health#report_info('default-terminal: '.tmux_default_term)
call health#report_error(
\ '$TERM differs from the tmux `default-terminal` setting. Colors might look wrong.',
\ ['$TERM may have been set by some rc (.bashrc, .zshrc, ...).'])
elseif $TERM !~# '\v(tmux-256color|screen-256color)'
call health#report_error(
\ '$TERM should be "screen-256color" or "tmux-256color" in tmux. Colors might look wrong.',
\ ["Set default-terminal in ~/.tmux.conf:\nset-option -g default-terminal \"screen-256color\"",
\ s:suggest_faq])
endif
endfunction
function! s:check_terminal() abort
if !executable('infocmp')
return
endif
call health#report_start('terminal')
let cmd = 'infocmp -L'
let out = system(cmd)
let kbs_entry = matchstr(out, 'key_backspace=[^,[:space:]]*')
let kdch1_entry = matchstr(out, 'key_dc=[^,[:space:]]*')
if v:shell_error
call health#report_error('command failed: '.cmd."\n".out)
else
call health#report_info('key_backspace (kbs) terminfo entry: '
\ .(empty(kbs_entry) ? '? (not found)' : kbs_entry))
call health#report_info('key_dc (kdch1) terminfo entry: '
\ .(empty(kbs_entry) ? '? (not found)' : kdch1_entry))
endif
for env_var in ['XTERM_VERSION', 'VTE_VERSION', 'TERM_PROGRAM', 'COLORTERM', 'SSH_TTY']
if exists('$'.env_var)
call health#report_info(printf("$%s='%s'", env_var, eval('$'.env_var)))
endif
endfor
endfunction
function! health#nvim#check() abort
call s:check_config()
call s:check_performance()
call s:check_rplugin_manifest()
call s:check_terminal()
call s:check_tmux()
endfunction

View File

@ -0,0 +1,605 @@
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
" Convert '\' to '/'. Collapse '//' and '/./'.
function! s:normalize_path(s) abort
return substitute(substitute(a:s, '\', '/', 'g'), '/\./\|/\+', '/', 'g')
endfunction
" Returns TRUE if `cmd` exits with success, else FALSE.
function! s:cmd_ok(cmd) abort
call system(a:cmd)
return v:shell_error == 0
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) dict abort
if a:event ==# 'stderr'
let self.stderr .= join(a:data, '')
if !self.ignore_stderr
let self.output .= join(a:data, '')
endif
elseif a:event ==# 'stdout'
let self.output .= join(a:data, '')
elseif a:event ==# 'exit'
let s:shell_error = a:data
endif
endfunction
" Attempts to construct a shell command from an args list.
" Only for display, to help users debug a failed command.
function! s:shellify(cmd) abort
if type(a:cmd) != type([])
return a:cmd
endif
return join(map(copy(a:cmd),
\'v:val =~# ''\m[^\-.a-zA-Z_/]'' ? shellescape(v:val) : v:val'), ' ')
endfunction
" Run a system command and timeout after 30 seconds.
function! s:system(cmd, ...) abort
let stdin = a:0 ? a:1 : ''
let ignore_error = a:0 > 2 ? a:3 : 0
let opts = {
\ 'ignore_stderr': a:0 > 1 ? a:2 : 0,
\ 'output': '',
\ 'stderr': '',
\ '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 (job=%d): `%s` (in %s)',
\ jobid, s:shellify(a:cmd), string(getcwd())))
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', s:shellify(a:cmd)))
call jobstop(jobid)
elseif s:shell_error != 0 && !ignore_error
call health#report_error(printf("Command error (job=%d, exit code %d): `%s` (in %s)\nOutput: %s\nStderr: %s",
\ jobid, s:shell_error, s:shellify(a:cmd), string(getcwd()), opts.output, opts.stderr))
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], '', 1, 1)
return s:shell_error ? 'curl error with '.a:url.': '.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 (optional)')
if !empty($TMUX) && executable('tmux') && executable('pbpaste') && !s:cmd_ok('pbpaste')
let tmux_version = matchstr(system('tmux -V'), '\d\+\.\d\+')
call health#report_error('pbcopy does not work with tmux version: '.tmux_version,
\ ['Install tmux 2.6+. https://superuser.com/q/231130',
\ 'or use tmux with reattach-to-user-namespace. https://superuser.com/a/413233'])
endif
let clipboard_tool = provider#clipboard#Executable()
if exists('g:clipboard') && empty(clipboard_tool)
call health#report_error(
\ provider#clipboard#Error(),
\ ["Use the example in :help g:clipboard as a template, or don't set g:clipboard at all."])
elseif empty(clipboard_tool)
call health#report_warn(
\ 'No clipboard tool found. Clipboard registers (`"+` and `"*`) will not work.',
\ [':help clipboard'])
else
call health#report_ok('Clipboard tool found: '. clipboard_tool)
endif
endfunction
" Get the latest Neovim Python client (pynvim) 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/pynvim/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 '.a:python.' response'
endif
let nvim_path = s:trim(s:system([
\ a:python, '-c',
\ 'import sys; sys.path.remove(""); ' .
\ 'import neovim; print(neovim.__file__)']))
if s:shell_error || empty(nvim_path)
return [python_version, 'unable to load neovim Python module', pypi_version,
\ nvim_path]
endif
" Assuming that multiple versions of a package are installed, sort them
" numerically in descending order.
function! s:compare(metapath1, metapath2) abort
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
" Try to get neovim.VERSION (added in 0.1.11dev).
let nvim_version = s:system([a:python, '-c',
\ 'from neovim import VERSION as v; '.
\ 'print("{}.{}.{}{}".format(v.major, v.minor, v.patch, v.prerelease))'],
\ '', 1, 1)
if empty(nvim_version)
let nvim_version = 'unable to find neovim Python module version'
let base = fnamemodify(nvim_path, ':h')
let metas = glob(base.'-*/METADATA', 1, 1)
\ + glob(base.'-*/PKG-INFO', 1, 1)
\ + glob(base.'.egg-info/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
endif
let nvim_path_base = fnamemodify(nvim_path, ':~:h')
let version_status = 'unknown; '.nvim_path_base
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; from '.nvim_path_base
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) && (!has('win32') || !filereadable(a:bin.'.exe'))
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 (optional)')
let pyname = 'python'.(a:version == 2 ? '' : '3')
let python_exe = ''
let venv = exists('$VIRTUAL_ENV') ? resolve($VIRTUAL_ENV) : ''
let host_prog_var = pyname.'_host_prog'
let loaded_var = 'g:loaded_'.pyname.'_provider'
let python_multiple = []
if exists(loaded_var) && !exists('*provider#'.pyname.'#Call')
call health#report_info('Disabled ('.loaded_var.'='.eval(loaded_var).'). This might be due to some previous error.')
endif
let [pyenv, pyenv_root] = s:check_for_pyenv()
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 [pyname, pythonx_errors] = provider#pythonx#Detect(a:version)
if empty(pyname)
call health#report_warn('No Python executable found that can `import neovim`. '
\ . 'Using the first available executable for diagnostics.')
elseif exists('g:'.host_prog_var)
let python_exe = pyname
endif
" No Python executable could `import neovim`.
if !empty(pythonx_errors)
call health#report_error('Python provider error:', pythonx_errors)
elseif !empty(pyname) && empty(python_exe)
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, pyname))
endif
if !empty(pyenv)
let python_exe = s:trim(s:system([pyenv, 'which', pyname], '', 1))
if empty(python_exe)
call health#report_warn(printf('pyenv could not find %s.', pyname))
endif
endif
if empty(python_exe)
let python_exe = exepath(pyname)
if exists('$PATH')
for path in split($PATH, has('win32') ? ';' : ':')
let path_bin = s:normalize_path(path.'/'.pyname)
if path_bin != s:normalize_path(python_exe)
\ && 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('Multiple %s executables found. '
\ . 'Set `g:%s` to avoid surprises.', pyname, host_prog_var))
endif
if python_exe =~# '\<shims\>'
call health#report_warn(printf('`%s` appears to be a pyenv shim.', python_exe), [
\ '`pyenv` is not in $PATH, your pyenv installation is broken. '
\ .'Set `g:'.host_prog_var.'` to avoid surprises.',
\ ])
endif
endif
endif
endif
if !empty(python_exe) && !exists('g:'.host_prog_var)
if empty(venv) && !empty(pyenv)
\ && !empty(pyenv_root) && resolve(python_exe) !~# '^'.pyenv_root.'/'
call health#report_warn('pyenv is not set up optimally.', [
\ printf('Create a virtualenv specifically '
\ . 'for Neovim using pyenv, and set `g:%s`. This will avoid '
\ . 'the need to install the pynvim module in each '
\ . 'version/virtualenv.', host_prog_var)
\ ])
elseif !empty(venv)
if !empty(pyenv_root)
let venv_root = pyenv_root
else
let venv_root = fnamemodify(venv, ':h')
endif
if resolve(python_exe) !~# '^'.venv_root.'/'
call health#report_warn('Your virtualenv is not set up optimally.', [
\ printf('Create a virtualenv specifically '
\ . 'for Neovim and use `g:%s`. This will avoid '
\ . 'the need to install the pynvim module in each '
\ . 'virtualenv.', host_prog_var)
\ ])
endif
endif
endif
if empty(python_exe) && !empty(pyname)
" An error message should have already printed.
call health#report_error(printf('`%s` was not found.', pyname))
elseif !empty(python_exe) && !s:check_bin(python_exe)
let python_exe = ''
endif
" Check if $VIRTUAL_ENV is valid.
if exists('$VIRTUAL_ENV') && !empty(python_exe)
if $VIRTUAL_ENV ==# matchstr(python_exe, '^\V'.$VIRTUAL_ENV)
call health#report_info('$VIRTUAL_ENV matches executable')
else
call health#report_warn(
\ '$VIRTUAL_ENV exists but appears to be inactive. '
\ . 'This could lead to unexpected results.',
\ [ 'If you are using Zsh, see: http://vi.stackexchange.com/a/7654' ])
endif
endif
" Diagnostic output
call health#report_info('Executable: ' . (empty(python_exe) ? 'Not found' : python_exe))
if len(python_multiple)
for path_bin in python_multiple
call health#report_info('Other python executable: ' . path_bin)
endfor
endif
let pip = 'pip' . (a:version == 2 ? '' : '3')
if empty(python_exe)
" No Python executable can import 'neovim'. Check if any Python executable
" can import 'pynvim'. If so, that Python failed to import 'neovim' as
" well, which is most probably due to a failed pip upgrade:
" https://github.com/neovim/neovim/wiki/Following-HEAD#20181118
let [pynvim_exe, errors] = provider#pythonx#DetectByModule('pynvim', a:version)
if !empty(pynvim_exe)
call health#report_error(
\ 'Detected pip upgrade failure: Python executable can import "pynvim" but '
\ . 'not "neovim": '. pynvim_exe,
\ "Use that Python version to reinstall \"pynvim\" and optionally \"neovim\".\n"
\ . pip ." uninstall pynvim neovim\n"
\ . pip ." install pynvim\n"
\ . pip ." install neovim # only if needed by third-party software")
endif
else
let [pyversion, current, latest, status] = s:version_info(python_exe)
if a:version != str2nr(pyversion)
call health#report_warn('Unexpected Python version.' .
\ ' 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 version: ' . pyversion)
if s:is_bad_response(status)
call health#report_info(printf('pynvim version: %s (%s)', current, status))
else
call health#report_info(printf('pynvim version: %s', current))
endif
if s:is_bad_response(current)
call health#report_error(
\ "pynvim is not installed.\nError: ".current,
\ ['Run in shell: '. pip .' install pynvim'])
endif
if s:is_bad_response(latest)
call health#report_warn('Could not contact PyPI to get latest version.')
call health#report_error('HTTP request failed: '.latest)
elseif s:is_bad_response(status)
call health#report_warn(printf('Latest pynvim is NOT installed: %s', latest))
elseif !s:is_bad_response(current)
call health#report_ok(printf('Latest pynvim is installed.'))
endif
endif
endfunction
" Check if pyenv is available and a valid pyenv root can be found, then return
" their respective paths. If either of those is invalid, return two empty
" strings, effectivly ignoring pyenv.
function! s:check_for_pyenv() abort
let pyenv_path = resolve(exepath('pyenv'))
if empty(pyenv_path)
return ['', '']
endif
call health#report_info('pyenv: Path: '. pyenv_path)
let pyenv_root = exists('$PYENV_ROOT') ? resolve($PYENV_ROOT) : ''
if empty(pyenv_root)
let pyenv_root = s:trim(s:system([pyenv_path, 'root']))
call health#report_info('pyenv: $PYENV_ROOT is not set. Infer from `pyenv root`.')
endif
if !isdirectory(pyenv_root)
call health#report_warn(
\ printf('pyenv: Root does not exist: %s. '
\ . 'Ignoring pyenv for all following checks.', pyenv_root))
return ['', '']
endif
call health#report_info('pyenv: Root: '.pyenv_root)
return [pyenv_path, pyenv_root]
endfunction
function! s:check_ruby() abort
call health#report_start('Ruby provider (optional)')
let loaded_var = 'g:loaded_ruby_provider'
if exists(loaded_var) && !exists('*provider#ruby#Call')
call health#report_info('Disabled. '.loaded_var.'='.eval(loaded_var))
return
endif
if !executable('ruby') || !executable('gem')
call health#report_warn(
\ '`ruby` and `gem` must be in $PATH.',
\ ['Install Ruby and verify that `ruby` and `gem` commands work.'])
return
endif
call health#report_info('Ruby: '. s:system('ruby -v'))
let host = provider#ruby#Detect()
if empty(host)
call health#report_warn('`neovim-ruby-host` not found.',
\ ['Run `gem install neovim` to ensure the neovim RubyGem is installed.',
\ 'Run `gem environment` to ensure the gem bin directory is in $PATH.',
\ 'If you are using rvm/rbenv/chruby, try "rehashing".',
\ 'See :help g:ruby_host_prog for non-standard gem installations.'])
return
endif
call health#report_info('Host: '. host)
let latest_gem_cmd = has('win32') ? 'cmd /c gem list -ra ^^neovim$' : 'gem list -ra ^neovim$'
let latest_gem = s:system(split(latest_gem_cmd))
if s:shell_error || empty(latest_gem)
call health#report_error('Failed to run: '. latest_gem_cmd,
\ ["Make sure you're connected to the internet.",
\ 'Are you behind a firewall or proxy?'])
return
endif
let latest_gem = get(split(latest_gem, 'neovim (\|, \|)$' ), 1, 'not found')
let current_gem_cmd = host .' --version'
let current_gem = s:system(current_gem_cmd)
if s:shell_error
call health#report_error('Failed to run: '. current_gem_cmd,
\ ['Report this issue with the output of: ', current_gem_cmd])
return
endif
if s:version_cmp(current_gem, latest_gem) == -1
call health#report_warn(
\ printf('Gem "neovim" is out-of-date. Installed: %s, latest: %s',
\ current_gem, latest_gem),
\ ['Run in shell: gem update neovim'])
else
call health#report_ok('Latest "neovim" gem is installed: '. current_gem)
endif
endfunction
function! s:check_node() abort
call health#report_start('Node.js provider (optional)')
let loaded_var = 'g:loaded_node_provider'
if exists(loaded_var) && !exists('*provider#node#Call')
call health#report_info('Disabled. '.loaded_var.'='.eval(loaded_var))
return
endif
if !executable('node') || (!executable('npm') && !executable('yarn'))
call health#report_warn(
\ '`node` and `npm` (or `yarn`) must be in $PATH.',
\ ['Install Node.js and verify that `node` and `npm` (or `yarn`) commands work.'])
return
endif
let node_v = get(split(s:system('node -v'), "\n"), 0, '')
call health#report_info('Node.js: '. node_v)
if !s:shell_error && s:version_cmp(node_v[1:], '6.0.0') < 0
call health#report_warn('Neovim node.js host does not support '.node_v)
" Skip further checks, they are nonsense if nodejs is too old.
return
endif
if !provider#node#can_inspect()
call health#report_warn('node.js on this system does not support --inspect-brk so $NVIM_NODE_HOST_DEBUG is ignored.')
endif
let host = provider#node#Detect()
if empty(host)
call health#report_warn('Missing "neovim" npm (or yarn) package.',
\ ['Run in shell: npm install -g neovim',
\ 'Run in shell (if you use yarn): yarn global add neovim'])
return
endif
call health#report_info('Neovim node.js host: '. host)
let latest_npm_cmd = has('win32') ? 'cmd /c npm info neovim --json' : 'npm info neovim --json'
let latest_npm = s:system(split(latest_npm_cmd))
if s:shell_error || empty(latest_npm)
call health#report_error('Failed to run: '. latest_npm_cmd,
\ ["Make sure you're connected to the internet.",
\ 'Are you behind a firewall or proxy?'])
return
endif
if !empty(latest_npm)
try
let pkg_data = json_decode(latest_npm)
catch /E474/
return 'error: '.latest_npm
endtry
let latest_npm = get(get(pkg_data, 'dist-tags', {}), 'latest', 'unable to parse')
endif
let current_npm_cmd = ['node', host, '--version']
let current_npm = s:system(current_npm_cmd)
if s:shell_error
call health#report_error('Failed to run: '. string(current_npm_cmd),
\ ['Report this issue with the output of: ', string(current_npm_cmd)])
return
endif
if s:version_cmp(current_npm, latest_npm) == -1
call health#report_warn(
\ printf('Package "neovim" is out-of-date. Installed: %s, latest: %s',
\ current_npm, latest_npm),
\ ['Run in shell: npm install -g neovim'])
else
call health#report_ok('Latest "neovim" npm/yarn package is installed: '. current_npm)
endif
endfunction
function! health#provider#check() abort
call s:check_clipboard()
call s:check_python(2)
call s:check_python(3)
call s:check_ruby()
call s:check_node()
endfunction

View File

@ -1,7 +1,7 @@
" Vim completion script
" Language: Java Script
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2006 Apr 30
" Last Change: 2017 Mar 04
function! javascriptcomplete#CompleteJS(findstart, base)
if a:findstart
@ -563,7 +563,7 @@ function! javascriptcomplete#CompleteJS(findstart, base)
for i in arguments
let g:ia = i
let f_elements = matchlist(i, 'function\s\+\(\k\+\)\s*(\(.\{-}\))')
if len(f_elements) == 3
if len(f_elements) >= 3
let b:js_menuinfo[f_elements[1].'('] = f_elements[2]
endif
endfor

View File

@ -1,149 +1,408 @@
let s:man_tag_depth = 0
let s:man_sect_arg = ''
let s:man_find_arg = '-w'
" Maintainer: Anmol Sethi <anmol@aubble.com>
try
if !has('win32') && $OSTYPE !~? 'cygwin\|linux' && system('uname -s') =~? 'SunOS' && system('uname -r') =~? '^5'
let s:man_sect_arg = '-s'
let s:man_find_arg = '-l'
endif
catch /E145:/
" Ignore the error in restricted mode
endtry
if exists('s:loaded_man')
finish
endif
let s:loaded_man = 1
function man#get_page(...) abort
let invoked_from_man = (&filetype ==# 'man')
let s:find_arg = '-w'
let s:localfile_arg = v:true " Always use -l if possible. #6683
let s:section_arg = '-s'
if a:0 == 0
echoerr 'argument required'
return
elseif a:0 > 2
echoerr 'too many arguments'
return
elseif a:0 == 2
let [page, sect] = [a:2, 0 + a:1]
elseif type(1) == type(a:1)
let [page, sect] = ['<cword>', a:1]
else
let [page, sect] = [a:1, '']
endif
if page == '<cword>'
let page = expand('<cword>')
endif
let [page, sect] = s:parse_page_and_section(sect, page)
if 0 + sect > 0 && s:find_page(sect, page) == 0
let sect = ''
endif
if s:find_page(sect, page) == 0
echo 'No manual entry for '.page
return
endif
exec 'let s:man_tag_buf_'.s:man_tag_depth.' = '.bufnr('%')
exec 'let s:man_tag_lin_'.s:man_tag_depth.' = '.line('.')
exec 'let s:man_tag_col_'.s:man_tag_depth.' = '.col('.')
let s:man_tag_depth = s:man_tag_depth + 1
let editcmd = 'edit'
" Use an existing 'man' window, else open a new one.
if &filetype !=# 'man'
let thiswin = winnr()
wincmd b
if winnr() > 1
exe "norm! " . thiswin . "\<C-W>w"
while 1
if &filetype == 'man'
break
endif
wincmd w
if thiswin == winnr()
break
endif
endwhile
endif
if &filetype !=# 'man'
let editcmd = 'tabnew'
endif
endif
silent exec editcmd.' man://'.page.(empty(sect)?'':'('.sect.')')
setlocal modifiable
silent keepjumps norm! 1G"_dG
let $MANWIDTH = winwidth(0)
silent exec 'r!/usr/bin/man '.s:cmd(sect, page).' | col -b'
" Remove blank lines from top and bottom.
while getline(1) =~ '^\s*$'
silent keepjumps norm! gg"_dd
endwhile
while getline('$') =~ '^\s*$'
silent keepjumps norm! G"_dd
endwhile
setlocal nomodified
setlocal filetype=man
if invoked_from_man || editcmd ==# 'tabnew'
call s:set_window_local_options()
function! s:init_section_flag()
call system(['env', 'MANPAGER=cat', 'man', s:section_arg, '1', 'man'])
if v:shell_error
let s:section_arg = '-S'
endif
endfunction
function s:set_window_local_options() abort
setlocal colorcolumn=0 foldcolumn=0 nonumber
setlocal nolist norelativenumber nofoldenable
endfunction
function man#pop_page() abort
if s:man_tag_depth > 0
let s:man_tag_depth = s:man_tag_depth - 1
exec "let s:man_tag_buf=s:man_tag_buf_".s:man_tag_depth
exec "let s:man_tag_lin=s:man_tag_lin_".s:man_tag_depth
exec "let s:man_tag_col=s:man_tag_col_".s:man_tag_depth
exec s:man_tag_buf."b"
exec s:man_tag_lin
exec "norm! ".s:man_tag_col."|"
exec "unlet s:man_tag_buf_".s:man_tag_depth
exec "unlet s:man_tag_lin_".s:man_tag_depth
exec "unlet s:man_tag_col_".s:man_tag_depth
unlet s:man_tag_buf s:man_tag_lin s:man_tag_col
endif
endfunction
" Expects a string like 'access' or 'access(2)'.
function s:parse_page_and_section(sect, str) abort
function! s:init() abort
call s:init_section_flag()
" TODO(nhooyr): Does `man -l` on SunOS list searched directories?
try
let save_isk = &iskeyword
setlocal iskeyword-=(,)
let page = substitute(a:str, '(*\(\k\+\).*', '\1', '')
let sect = substitute(a:str, '\(\k\+\)(\([^()]*\)).*', '\2', '')
if sect == page || -1 == match(sect, '^[0-9 ]\+$')
let sect = a:sect
if !has('win32') && $OSTYPE !~? 'cygwin\|linux' && system('uname -s') =~? 'SunOS' && system('uname -r') =~# '^5'
let s:find_arg = '-l'
endif
" Check for -l support.
call s:get_page(s:get_path('', 'man'))
catch /E145:/
" Ignore the error in restricted mode
catch /command error .*/
let s:localfile_arg = v:false
endtry
endfunction
function! man#open_page(count, count1, mods, ...) abort
if a:0 > 2
call s:error('too many arguments')
return
elseif a:0 == 0
let ref = &filetype ==# 'man' ? expand('<cWORD>') : expand('<cword>')
if empty(ref)
call s:error('no identifier under cursor')
return
endif
elseif a:0 ==# 1
let ref = a:1
else
" 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
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
let &l:iskeyword = save_isk
echoerr 'man.vim: failed to parse: "'.a:str.'"'
call s:error(v:exception)
return
endtry
return [page, sect]
call s:push_tag()
let bufname = 'man://'.name.(empty(sect)?'':'('.sect.')')
try
set eventignore+=BufReadCmd
if a:mods !~# 'tab' && s:find_man()
execute 'silent keepalt edit' fnameescape(bufname)
else
execute 'silent keepalt' a:mods 'split' fnameescape(bufname)
endif
finally
set eventignore-=BufReadCmd
endtry
try
let page = s:get_page(path)
catch
if a:mods =~# 'tab' || !s:find_man()
" a new window was opened
close
endif
call s:error(v:exception)
return
endtry
let b:man_sect = sect
call s:put_page(page)
endfunction
function s:cmd(sect, page) abort
if 0 + a:sect > 0
return s:man_sect_arg.' '.a:sect.' '.a:page
function! man#read_page(ref) abort
try
let [sect, name] = man#extract_sect_and_name_ref(a:ref)
let [sect, name, path] = s:verify_exists(sect, name)
let page = s:get_page(path)
catch
call s:error(v:exception)
return
endtry
let b:man_sect = sect
call s:put_page(page)
endfunction
" Handler for s:system() function.
function! s:system_handler(jobid, data, event) dict abort
if a:event is# 'stdout' || a:event is# 'stderr'
let self[a:event] .= join(a:data, "\n")
else
let self.exit_code = a:data
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))
if where !~ "^/"
if matchstr(where, " [^ ]*$") !~ "^ /"
" Run a system command and timeout after 30 seconds.
function! s:system(cmd, ...) abort
let opts = {
\ 'stdout': '',
\ 'stderr': '',
\ 'exit_code': 0,
\ '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
throw printf('command error %d: %s', jobid, join(a:cmd))
endif
let res = jobwait([jobid], 30000)
if res[0] == -1
try
call jobstop(jobid)
throw printf('command timed out: %s', join(a:cmd))
catch /^Vim(call):E900:/
endtry
elseif res[0] == -2
throw printf('command interrupted: %s', join(a:cmd))
endif
if opts.exit_code != 0
throw printf("command error (%d) %s: %s", jobid, join(a:cmd), substitute(opts.stderr, '\_s\+$', '', &gdefault ? '' : 'g'))
endif
return opts.stdout
endfunction
function! s:get_page(path) abort
" Disable hard-wrap by using a big $MANWIDTH (max 1000 on some systems #9065).
" We use soft wrap: ftplugin/man.vim sets wrap/breakindent/….
let manwidth = 999
" Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db).
" http://comments.gmane.org/gmane.editors.vim.devel/29085
" Set MAN_KEEP_FORMATTING so Debian man doesn't discard backspaces.
let cmd = ['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'MAN_KEEP_FORMATTING=1', 'man']
return s:system(cmd + (s:localfile_arg ? ['-l', a:path] : [a:path]))
endfunction
function! s:put_page(page) abort
setlocal modifiable
setlocal noreadonly
silent keepjumps %delete _
silent put =a:page
while getline(1) =~# '^\s*$'
silent keepjumps 1delete _
endwhile
" XXX: nroff justifies text by filling it with whitespace. That interacts
" badly with our use of $MANWIDTH=999. Hack around this by using a fixed
" size for those whitespace regions.
silent! keeppatterns keepjumps %s/\s\{199,}/\=repeat(' ', 10)/g
1
lua require("man").highlight_man_page()
setlocal filetype=man
endfunction
function! man#show_toc() abort
let bufname = bufname('%')
let info = getloclist(0, {'winid': 1})
if !empty(info) && getwinvar(info.winid, 'qf_toc') ==# bufname
lopen
return
endif
let toc = []
let lnum = 2
let last_line = line('$') - 1
while lnum && lnum < last_line
let text = getline(lnum)
if text =~# '^\%( \{3\}\)\=\S.*$'
call add(toc, {'bufnr': bufnr('%'), 'lnum': lnum, 'text': text})
endif
let lnum = nextnonblank(lnum + 1)
endwhile
call setloclist(0, toc, ' ')
call setloclist(0, [], 'a', {'title': 'Man TOC'})
lopen
let w:qf_toc = bufname
endfunction
" attempt to extract the name and sect out of 'name(sect)'
" otherwise just return the largest string of valid characters in ref
function! man#extract_sect_and_name_ref(ref) abort
if a:ref[0] ==# '-' " try ':Man -pandoc' with this disabled.
throw 'manpage name cannot start with ''-'''
endif
let ref = matchstr(a:ref, '[^()]\+([^()]\+)')
if empty(ref)
let name = matchstr(a:ref, '[^()]\+')
if empty(name)
throw 'manpage reference cannot contain only parentheses'
endif
return [get(b:, 'man_default_sects', ''), name]
endif
let left = split(ref, '(')
" see ':Man 3X curses' on why tolower.
" TODO(nhooyr) Not sure if this is portable across OSs
" but I have not seen a single uppercase section.
return [tolower(split(left[1], ')')[0]), left[0]]
endfunction
function! s:get_path(sect, name) abort
" Some man implementations (OpenBSD) return all available paths from the
" search command, so we get() the first one. #8341
if empty(a:sect)
return substitute(get(split(s:system(['man', s:find_arg, a:name])), 0, ''), '\n\+$', '', '')
endif
" '-s' flag handles:
" - tokens like 'printf(echo)'
" - sections starting with '-'
" - 3pcap section (found on macOS)
" - commas between sections (for section priority)
return substitute(get(split(s:system(['man', s:find_arg, s:section_arg, a:sect, a:name])), 0, ''), '\n\+$', '', '')
endfunction
function! s:verify_exists(sect, name) abort
try
let path = s:get_path(a:sect, a:name)
catch /^command error (/
try
let path = s:get_path(get(b:, 'man_default_sects', ''), a:name)
catch /^command error (/
let path = s:get_path('', a:name)
endtry
endtry
" Extract the section from the path, because sometimes the actual section is
" more specific than what we provided to `man` (try `:Man 3 App::CLI`).
" Also on linux, name seems to be case-insensitive. So for `:Man PRIntf`, we
" still want the name of the buffer to be 'printf'.
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
" extracts the name and sect out of 'path/name.sect'
function! s:extract_sect_and_name_path(path) abort
let tail = fnamemodify(a:path, ':t')
if a:path =~# '\.\%([glx]z\|bz2\|lzma\|Z\)$' " valid extensions
let tail = fnamemodify(tail, ':r')
endif
let sect = matchstr(tail, '\.\zs[^.]\+$')
let name = matchstr(tail, '^.\+\ze\.')
return [sect, name]
endfunction
function! s:find_man() abort
if &filetype ==# 'man'
return 1
elseif winnr('$') ==# 1
return 0
endif
let thiswin = winnr()
while 1
wincmd w
if &filetype ==# 'man'
return 1
elseif thiswin ==# winnr()
return 0
endif
endif
return 1
endwhile
endfunction
function! s:error(msg) abort
redraw
echohl ErrorMsg
echon 'man.vim: ' a:msg
echohl None
endfunction
" 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 cmd_offset = index(args, 'Man')
if cmd_offset > 0
" Prune all arguments up to :Man itself. Otherwise modifier commands like
" :tab, :vertical, etc. would lead to a wrong length.
let args = args[cmd_offset:]
endif
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, ''))
return s:complete(sect, '', name)
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
return s:complete(sect, sect, name)
endfunction
function! s:complete(sect, psect, name) abort
try
let mandirs = join(split(s:system(['man', s:find_arg]), ':\|\n'), ',')
catch
call s:error(v:exception)
return
endtry
let pages = globpath(mandirs,'man?/'.a:name.'*.'.a:sect.'*', 0, 1)
" We remove duplicates in case the same manpage in different languages was found.
return uniq(sort(map(pages, 's:format_candidate(v:val, a:psect)'), 'i'))
endfunction
function! s:format_candidate(path, psect) abort
if a:path =~# '\.\%(pdf\|in\)$' " invalid extensions
return
endif
let [sect, name] = s:extract_sect_and_name_path(a:path)
if sect ==# a:psect
return name
elseif sect =~# a:psect.'.\+$'
" We include the section if the user provided section is a prefix
" of the actual section.
return name.'('.sect.')'
endif
endfunction
function! man#init_pager() abort
if getline(1) =~# '^\s*$'
silent keepjumps 1delete _
else
keepjumps 1
endif
lua require("man").highlight_man_page()
" Guess the ref from the heading (which is usually uppercase, so we cannot
" know the correct casing, cf. `man glDrawArraysInstanced`).
let ref = substitute(matchstr(getline(1), '^[^)]\+)'), ' ', '_', 'g')
try
let b:man_sect = man#extract_sect_and_name_ref(ref)[0]
catch
let b:man_sect = ''
endtry
if -1 == match(bufname('%'), 'man:\/\/') " Avoid duplicate buffers, E95.
execute 'silent file man://'.tolower(fnameescape(ref))
endif
endfunction
call s:init()

View File

@ -40,9 +40,10 @@ function s:msgpack_init_python() abort
return s:msgpack_python_type
endif
let s:msgpack_python_initialized = 1
for suf in ['', '3']
for suf in (has('win32') ? ['3'] : ['', '3'])
try
execute 'python' . suf
\. "\n"
\. "def shada_dict_strftime():\n"
\. " import datetime\n"
\. " import vim\n"
@ -60,12 +61,15 @@ function s:msgpack_init_python() abort
\. " fmt = vim.eval('a:format')\n"
\. " timestr = vim.eval('a:string')\n"
\. " timestamp = datetime.datetime.strptime(timestr, fmt)\n"
\. " timestamp = int(timestamp.timestamp())\n"
\. " try:\n"
\. " timestamp = int(timestamp.timestamp())\n"
\. " except:\n"
\. " timestamp = int(timestamp.strftime('%s'))\n"
\. " if timestamp > 2 ** 31:\n"
\. " tsabs = abs(timestamp)"
\. " tsabs = abs(timestamp)\n"
\. " return ('{\"_TYPE\": v:msgpack_types.integer,'\n"
\. " + '\"_VAL\": [{sign},{v1},{v2},{v3}]}').format(\n"
\. " sign=1 if timestamp >= 0 else -1,\n"
\. " sign=(1 if timestamp >= 0 else -1),\n"
\. " v1=((tsabs >> 62) & 0x3),\n"
\. " v2=((tsabs >> 31) & (2 ** 31 - 1)),\n"
\. " v3=(tsabs & (2 ** 31 - 1)))\n"
@ -356,6 +360,8 @@ let s:MSGPACK_STANDARD_TYPES = {
\type(''): 'binary',
\type([]): 'array',
\type({}): 'map',
\type(v:true): 'boolean',
\type(v:null): 'nil',
\}
""
@ -379,7 +385,7 @@ endfunction
""
" Dump boolean value.
function s:msgpack_dump_boolean(v) abort
return a:v._VAL ? 'TRUE' : 'FALSE'
return (a:v is v:true || (a:v isnot v:false && a:v._VAL)) ? 'TRUE' : 'FALSE'
endfunction
""
@ -395,7 +401,8 @@ endfunction
""
" Dump floating-point value.
function s:msgpack_dump_float(v) abort
return string(type(a:v) == type({}) ? a:v._VAL : a:v)
return substitute(string(type(a:v) == type({}) ? a:v._VAL : a:v),
\'\V\^\(-\)\?str2float(''\(inf\|nan\)'')\$', '\1\2', '')
endfunction
""
@ -598,13 +605,10 @@ function msgpack#eval(s, special_objs) abort
call add(expr, dec)
endif
endif
elseif s =~# '-\?\%(inf\|nan\)'
if s[0] is# '-'
call add(expr, '-')
let s = s[1:]
endif
call add(expr, s:MSGPACK_SPECIAL_OBJECTS[s[0:2]])
let s = s[3:]
elseif s =~# '\v^\-%(inf|nan)'
call add(expr, '-')
call add(expr, s:MSGPACK_SPECIAL_OBJECTS[s[1:3]])
let s = s[4:]
elseif stridx('="+', s[0]) != -1
let match = matchlist(s, '\v\C^(\=|\+\((\-?\d+)\)|)(\"%(\\.|[^\\"]+)*\")')
if empty(match)
@ -662,11 +666,15 @@ function msgpack#eval(s, special_objs) abort
call add(expr, ']}')
let s = s[1:]
elseif s[0] is# ''''
let char = matchstr(s, '\m\C^''\zs.\ze''')
let char = matchstr(s, '\v\C^\''\zs%(\\\d+|.)\ze\''')
if empty(char)
throw 'char-invalid:Invalid integer character literal format: ' . s
endif
call add(expr, char2nr(char))
if char[0] is# '\'
call add(expr, +char[1:])
else
call add(expr, char2nr(char))
endif
let s = s[len(char) + 2:]
else
throw 'unknown:Invalid non-space character: ' . s

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
" Vim support file to help with paste mappings and menus
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2006 Jun 23
" Last Change: 2017 Aug 30
" Define the string to use for items that are present both in Edit, Popup and
" Toolbar menu. Also used in mswin.vim and macmap.vim.
@ -12,7 +12,7 @@
if has("virtualedit")
let paste#paste_cmd = {'n': ":call paste#Paste()<CR>"}
let paste#paste_cmd['v'] = '"-c<Esc>' . paste#paste_cmd['n']
let paste#paste_cmd['i'] = 'x<BS><Esc>' . paste#paste_cmd['n'] . 'gi'
let paste#paste_cmd['i'] = "\<c-\>\<c-o>\"+gP"
func! paste#Paste()
let ove = &ve

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,21 @@
" Common functions for providers
" Start the provider and perform a 'poll' request
"
" Returns a valid channel on success
function! provider#Poll(argv, orig_name, log_env) abort
let job = {'rpc': v:true, 'stderr_buffered': v:true}
try
let channel_id = jobstart(a:argv, job)
if channel_id > 0 && rpcrequest(channel_id, 'poll') ==# 'ok'
return channel_id
endif
catch
echomsg v:throwpoint
echomsg v:exception
for row in get(job, 'stderr', [])
echomsg row
endfor
endtry
throw remote#host#LoadErrorForHost(a:orig_name, a:log_env)
endfunction

View File

@ -3,66 +3,140 @@
" available.
let s:copy = {}
let s:paste = {}
let s:clipboard = {}
" When caching is enabled, store the jobid of the xclip/xsel process keeping
" ownership of the selection, so we know how long the cache is valid.
let s:selection = { 'owner': 0, 'data': [] }
let s:selection = { 'owner': 0, 'data': [], 'stderr_buffered': v:true }
function! s:selection.on_exit(jobid, data, event)
function! s:selection.on_exit(jobid, data, event) abort
" At this point this nvim instance might already have launched
" a new provider instance. Don't drop ownership in this case.
if self.owner == a:jobid
let self.owner = 0
endif
if a:data != 0
echohl WarningMsg
echomsg 'clipboard: error invoking '.get(self.argv, 0, '?').': '.join(self.stderr)
echohl None
endif
endfunction
let s:selections = { '*': s:selection, '+': copy(s:selection)}
let s:selections = { '*': s:selection, '+': copy(s:selection) }
function! s:try_cmd(cmd, ...)
function! s:try_cmd(cmd, ...) abort
let argv = split(a:cmd, " ")
let out = a:0 ? systemlist(argv, a:1, 1) : systemlist(argv, [''], 1)
let out = systemlist(argv, (a:0 ? a:1 : ['']), 1)
if v:shell_error
echohl WarningMsg
echo "clipboard: error: ".(len(out) ? out[0] : '')
echohl None
if !exists('s:did_error_try_cmd')
echohl WarningMsg
echomsg "clipboard: error: ".(len(out) ? out[0] : v:shell_error)
echohl None
let s:did_error_try_cmd = 1
endif
return 0
endif
return out
endfunction
" Returns TRUE if `cmd` exits with success, else FALSE.
function! s:cmd_ok(cmd) abort
call system(a:cmd)
return v:shell_error == 0
endfunction
let s:cache_enabled = 1
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
elseif executable('xclip')
let s:copy['+'] = 'xclip -quiet -i -selection clipboard'
let s:paste['+'] = 'xclip -o -selection clipboard'
let s:copy['*'] = 'xclip -quiet -i -selection primary'
let s:paste['*'] = 'xclip -o -selection primary'
elseif executable('xsel')
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'
else
echom 'clipboard: No clipboard tool available. See :help nvim-clipboard'
let s:err = ''
function! provider#clipboard#Error() abort
return s:err
endfunction
function! provider#clipboard#Executable() abort
if exists('g:clipboard')
if type({}) isnot# type(g:clipboard)
\ || type({}) isnot# type(get(g:clipboard, 'copy', v:null))
\ || type({}) isnot# type(get(g:clipboard, 'paste', v:null))
let s:err = 'clipboard: invalid g:clipboard'
return ''
endif
let s:copy = get(g:clipboard, 'copy', { '+': v:null, '*': v:null })
let s:paste = get(g:clipboard, 'paste', { '+': v:null, '*': v:null })
let s:cache_enabled = get(g:clipboard, 'cache_enabled', 0)
return get(g:clipboard, 'name', 'g:clipboard')
elseif has('mac') && executable('pbpaste') && s:cmd_ok('pbpaste')
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('$WAYLAND_DISPLAY') && executable('wl-copy') && executable('wl-paste')
let s:copy['+'] = 'wl-copy --foreground'
let s:paste['+'] = 'wl-paste --no-newline'
let s:copy['*'] = 'wl-copy --foreground --primary'
let s:paste['*'] = 'wl-paste --no-newline --primary'
return 'wl-copy'
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'
return 'xclip'
elseif exists('$DISPLAY') && executable('xsel') && s:cmd_ok('xsel -o -b')
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 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'
elseif executable('win32yank.exe')
let s:copy['+'] = 'win32yank.exe -i --crlf'
let s:paste['+'] = 'win32yank.exe -o --lf'
let s:copy['*'] = s:copy['+']
let s:paste['*'] = s:paste['+']
return 'win32yank'
elseif exists('$TMUX') && executable('tmux')
let s:copy['+'] = 'tmux load-buffer -'
let s:paste['+'] = 'tmux save-buffer -'
let s:copy['*'] = s:copy['+']
let s:paste['*'] = s:paste['+']
return 'tmux'
endif
let s:err = 'clipboard: No clipboard tool. :help clipboard'
return ''
endfunction
if empty(provider#clipboard#Executable())
" provider#clipboard#Call() *must not* be defined if the provider is broken.
" Otherwise eval_has_provider() thinks the clipboard provider is
" functioning, and eval_call_provider() will happily call it.
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
function! s:clipboard.get(reg) abort
if type(s:paste[a:reg]) == v:t_func
return s:paste[a:reg]()
elseif 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)
function! s:clipboard.set(lines, regtype, reg) abort
if a:reg == '"'
call s:clipboard.set(a:lines,a:regtype,'+')
if s:copy['*'] != s:copy['+']
@ -70,31 +144,51 @@ function! s:clipboard.set(lines, regtype, reg)
end
return 0
end
if type(s:copy[a:reg]) == v:t_func
call s:copy[a:reg](a:lines, a:regtype)
return 0
end
if s:cache_enabled == 0
call s:try_cmd(s:copy[a:reg], a:lines)
return 0
end
let selection = s:selections[a:reg]
if selection.owner > 0
if s:selections[a:reg].owner > 0
" The previous provider instance should exit when the new one takes
" ownership, but kill it to be sure we don't fill up the job table.
call jobstop(selection.owner)
call jobstop(s:selections[a:reg].owner)
end
let s:selections[a:reg] = copy(s:selection)
let selection = s:selections[a:reg]
let selection.data = [a:lines, a:regtype]
let argv = split(s:copy[a:reg], " ")
let selection.argv = argv
let selection.detach = s:cache_enabled
let selection.cwd = "/"
let jobid = jobstart(argv, selection)
if jobid <= 0
if jobid > 0
call jobsend(jobid, a:lines)
call jobclose(jobid, 'stdin')
let selection.owner = jobid
else
echohl WarningMsg
echo "clipboard: error when invoking provider"
echomsg 'clipboard: failed to execute: '.(s:copy[a:reg])
echohl None
return 0
endif
call jobsend(jobid, a:lines)
call jobclose(jobid, 'stdin')
let selection.owner = jobid
return 1
endfunction
function! provider#clipboard#Call(method, args)
return call(s:clipboard[a:method],a:args,s:clipboard)
function! provider#clipboard#Call(method, args) abort
if get(s:, 'here', v:false) " Clipboard provider must not recurse. #7184
return 0
endif
let s:here = v:true
try
return call(s:clipboard[a:method],a:args,s:clipboard)
finally
let s:here = v:false
endtry
endfunction

View File

@ -0,0 +1,148 @@
if exists('g:loaded_node_provider')
finish
endif
let g:loaded_node_provider = 1
function! s:is_minimum_version(version, min_major, min_minor) abort
if empty(a:version)
let nodejs_version = get(split(system(['node', '-v']), "\n"), 0, '')
if v:shell_error || nodejs_version[0] !=# 'v'
return 0
endif
else
let nodejs_version = a:version
endif
" Remove surrounding junk. Example: 'v4.12.0' => '4.12.0'
let nodejs_version = matchstr(nodejs_version, '\(\d\.\?\)\+')
" [major, minor, patch]
let v_list = split(nodejs_version, '\.')
return len(v_list) == 3
\ && ((str2nr(v_list[0]) > str2nr(a:min_major))
\ || (str2nr(v_list[0]) == str2nr(a:min_major)
\ && str2nr(v_list[1]) >= str2nr(a:min_minor)))
endfunction
let s:NodeHandler = {
\ 'stdout_buffered': v:true,
\ 'result': ''
\ }
function! s:NodeHandler.on_exit(job_id, data, event) abort
let bin_dir = join(get(self, 'stdout', []), '')
let entry_point = bin_dir . self.entry_point
let self.result = filereadable(entry_point) ? entry_point : ''
endfunction
" Support for --inspect-brk requires node 6.12+ or 7.6+ or 8+
" Return 1 if it is supported
" Return 0 otherwise
function! provider#node#can_inspect() abort
if !executable('node')
return 0
endif
let ver = get(split(system(['node', '-v']), "\n"), 0, '')
if v:shell_error || ver[0] !=# 'v'
return 0
endif
return (ver[1] ==# '6' && s:is_minimum_version(ver, 6, 12))
\ || s:is_minimum_version(ver, 7, 6)
endfunction
function! provider#node#Detect() abort
if exists('g:node_host_prog')
return expand(g:node_host_prog)
endif
if !s:is_minimum_version(v:null, 6, 0)
return ''
endif
let npm_opts = {}
if executable('npm')
let npm_opts = deepcopy(s:NodeHandler)
let npm_opts.entry_point = '/neovim/bin/cli.js'
let npm_opts.job_id = jobstart('npm --loglevel silent root -g', npm_opts)
endif
let yarn_opts = {}
if executable('yarn')
let yarn_opts = deepcopy(s:NodeHandler)
let yarn_opts.entry_point = '/node_modules/neovim/bin/cli.js'
" `yarn global dir` is slow (> 250ms), try the default path first
" XXX: The following code is not portable
" https://github.com/yarnpkg/yarn/issues/2049#issuecomment-263183768
if has('unix')
let yarn_default_path = $HOME . '/.config/yarn/global/' . yarn_opts.entry_point
if filereadable(yarn_default_path)
return yarn_default_path
endif
endif
let yarn_opts.job_id = jobstart('yarn global dir', yarn_opts)
endif
" npm returns the directory faster, so let's check that first
if !empty(npm_opts)
let result = jobwait([npm_opts.job_id])
if result[0] == 0 && npm_opts.result != ''
return npm_opts.result
endif
endif
if !empty(yarn_opts)
let result = jobwait([yarn_opts.job_id])
if result[0] == 0 && yarn_opts.result != ''
return yarn_opts.result
endif
endif
return ''
endfunction
function! provider#node#Prog() abort
return s:prog
endfunction
function! provider#node#Require(host) abort
if s:err != ''
echoerr s:err
return
endif
let args = ['node']
if !empty($NVIM_NODE_HOST_DEBUG) && provider#node#can_inspect()
call add(args, '--inspect-brk')
endif
call add(args, provider#node#Prog())
return provider#Poll(args, a:host.orig_name, '$NVIM_NODE_LOG_FILE')
endfunction
function! provider#node#Call(method, args) abort
if s:err != ''
echoerr s:err
return
endif
if !exists('s:host')
try
let s:host = remote#host#Require('node')
catch
let s:err = v:exception
echohl WarningMsg
echomsg v:exception
echohl None
return
endtry
endif
return call('rpcrequest', insert(insert(a:args, 'node_'.a:method), s:host))
endfunction
let s:err = ''
let s:prog = provider#node#Detect()
if empty(s:prog)
let s:err = 'Cannot find the "neovim" node package. Try :checkhealth'
endif
call remote#host#RegisterPlugin('node-provider', 'node', [])

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. :help provider
"
" Associating the plugin with the Python host is the first step because plugins
" will be passed as command-line arguments
@ -11,11 +11,11 @@ let g:loaded_python_provider = 1
let [s:prog, s:err] = provider#pythonx#Detect(2)
function! provider#python#Prog()
function! provider#python#Prog() abort
return s:prog
endfunction
function! provider#python#Error()
function! provider#python#Error() abort
return s:err
endfunction
@ -24,14 +24,12 @@ if s:prog == ''
finish
endif
let s:plugin_path = expand('<sfile>:p:h').'/script_host.py'
" The Python provider plugin will run in a separate instance of the Python
" host.
call remote#host#RegisterClone('legacy-python-provider', 'python')
call remote#host#RegisterPlugin('legacy-python-provider', s:plugin_path, [])
call remote#host#RegisterPlugin('legacy-python-provider', 'script_host.py', [])
function! provider#python#Call(method, args)
function! provider#python#Call(method, args) abort
if s:err != ''
return
endif

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. :help provider
"
" Associating the plugin with the Python3 host is the first step because
" plugins will be passed as command-line arguments
@ -11,11 +11,11 @@ let g:loaded_python3_provider = 1
let [s:prog, s:err] = provider#pythonx#Detect(3)
function! provider#python3#Prog()
function! provider#python3#Prog() abort
return s:prog
endfunction
function! provider#python3#Error()
function! provider#python3#Error() abort
return s:err
endfunction
@ -24,14 +24,12 @@ if s:prog == ''
finish
endif
let s:plugin_path = expand('<sfile>:p:h').'/script_host.py'
" The Python3 provider plugin will run in a separate instance of the Python3
" host.
call remote#host#RegisterClone('legacy-python3-provider', 'python3')
call remote#host#RegisterPlugin('legacy-python3-provider', s:plugin_path, [])
call remote#host#RegisterPlugin('legacy-python3-provider', 'script_host.py', [])
function! provider#python3#Call(method, args)
function! provider#python3#Call(method, args) abort
if s:err != ''
return
endif

View File

@ -5,84 +5,111 @@ endif
let s:loaded_pythonx_provider = 1
function! provider#pythonx#Detect(major_ver) abort
let host_var = (a:major_ver == 2) ?
\ 'g:python_host_prog' : 'g:python3_host_prog'
let skip_var = (a:major_ver == 2) ?
\ 'g:python_host_skip_check' : 'g:python3_host_skip_check'
let skip = exists(skip_var) ? {skip_var} : 0
if exists(host_var)
" Disable auto detection.
let [result, err] = s:check_interpreter({host_var}, a:major_ver, skip)
if result
return [{host_var}, err]
endif
return ['', 'provider/pythonx: Could not load Python ' . a:major_ver
\ . ' from ' . host_var . ': ' . err]
endif
function! provider#pythonx#Require(host) abort
let ver = (a:host.orig_name ==# 'python') ? 2 : 3
let prog_suffixes = (a:major_ver == 2) ?
\ ['2', '2.7', '2.6', '']
\ : ['3', '3.5', '3.4', '3.3', '']
" Python host arguments
let prog = (ver == '2' ? provider#python#Prog() : provider#python3#Prog())
let args = [prog, '-c', 'import sys; sys.path.remove(""); import neovim; neovim.start_host()']
let errors = []
for prog in map(prog_suffixes, "'python' . v:val")
let [result, err] = s:check_interpreter(prog, a:major_ver, skip)
if result
return [prog, err]
endif
" Accumulate errors in case we don't find
" any suitable Python interpreter.
call add(errors, err)
" Collect registered Python plugins into args
let python_plugins = remote#host#PluginsForHost(a:host.name)
for plugin in python_plugins
call add(args, plugin.path)
endfor
" No suitable Python interpreter found.
return ['', 'provider/pythonx: Could not load Python ' . a:major_ver
\ . ":\n" . join(errors, "\n")]
return provider#Poll(args, a:host.orig_name, '$NVIM_PYTHON_LOG_FILE')
endfunction
function! s:check_interpreter(prog, major_ver, skip) abort
let prog_path = exepath(a:prog)
if prog_path == ''
return [0, a:prog . ' not found in search path or not executable.']
function! s:get_python_executable_from_host_var(major_version) abort
return expand(get(g:, 'python'.(a:major_version == 3 ? '3' : '').'_host_prog', ''))
endfunction
function! s:get_python_candidates(major_version) abort
return {
\ 2: ['python2', 'python2.7', 'python2.6', 'python'],
\ 3: ['python3', 'python3.7', 'python3.6', 'python3.5', 'python3.4', 'python3.3',
\ 'python']
\ }[a:major_version]
endfunction
" Returns [path_to_python_executable, error_message]
function! provider#pythonx#Detect(major_version) abort
return provider#pythonx#DetectByModule('neovim', a:major_version)
endfunction
" Returns [path_to_python_executable, error_message]
function! provider#pythonx#DetectByModule(module, major_version) abort
let python_exe = s:get_python_executable_from_host_var(a:major_version)
if !empty(python_exe)
return [python_exe, '']
endif
if a:skip
return [1, '']
endif
let candidates = s:get_python_candidates(a:major_version)
let errors = []
let min_version = (a:major_ver == 2) ? '2.6' : '3.3'
for exe in candidates
let [result, error] = provider#pythonx#CheckForModule(exe, a:module, a:major_version)
if result
return [exe, error]
endif
" Accumulate errors in case we don't find any suitable Python executable.
call add(errors, error)
endfor
" 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.
let prog_ver = system([ a:prog , '-c' ,
" No suitable Python executable found.
return ['', 'provider/pythonx: Could not load Python '.a:major_version.":\n".join(errors, "\n")]
endfunction
" Returns array: [prog_exitcode, prog_version]
function! s:import_module(prog, module) abort
let prog_version = system([a:prog, '-c' , printf(
\ 'import sys; ' .
\ 'sys.path.remove(""); ' .
\ 'sys.stdout.write(str(sys.version_info[0]) + "." + str(sys.version_info[1])); ' .
\ 'import pkgutil; ' .
\ 'exit(2*int(pkgutil.get_loader("neovim") is None))'
\ ])
\ 'exit(2*int(pkgutil.get_loader("%s") is None))',
\ a:module)])
return [v:shell_error, prog_version]
endfunction
if prog_ver
if prog_ver !~ '^' . a:major_ver
return [0, prog_path . ' is Python ' . prog_ver . ' and cannot provide Python '
\ . a:major_ver . '.']
elseif prog_ver =~ '^' . a:major_ver && prog_ver < min_version
return [0, prog_path . ' is Python ' . prog_ver . ' and cannot provide Python >= '
" Returns array: [was_success, error_message]
function! provider#pythonx#CheckForModule(prog, module, major_version) abort
let prog_path = exepath(a:prog)
if prog_path ==# ''
return [0, a:prog . ' not found in search path or not executable.']
endif
let min_version = (a:major_version == 2) ? '2.6' : '3.3'
" Try to load module, and output Python version.
" Exit codes:
" 0 module can be loaded.
" 2 module cannot be loaded.
" Otherwise something else went wrong (e.g. 1 or 127).
let [prog_exitcode, prog_version] = s:import_module(a:prog, a:module)
if prog_exitcode == 2 || prog_exitcode == 0
" Check version only for expected return codes.
if prog_version !~ '^' . a:major_version
return [0, prog_path . ' is Python ' . prog_version . ' and cannot provide Python '
\ . a:major_version . '.']
elseif prog_version =~ '^' . a:major_version && prog_version < min_version
return [0, prog_path . ' is Python ' . prog_version . ' and cannot provide Python >= '
\ . min_version . '.']
endif
endif
if v:shell_error == 1
if prog_exitcode == 2
return [0, prog_path.' does not have the "' . a:module . '" module. :help provider-python']
elseif prog_exitcode == 127
" This can happen with pyenv's shims.
return [0, prog_path . ' does not exist: ' . prog_version]
elseif prog_exitcode
return [0, 'Checking ' . prog_path . ' caused an unknown error. '
\ . 'Please report this at github.com/neovim/neovim.']
elseif v:shell_error == 2
return [0, prog_path . ' does have not have the neovim module installed. '
\ . 'See ":help nvim-python".']
\ . '(' . prog_exitcode . ', output: ' . prog_version . ')'
\ . ' Report this at https://github.com/neovim/neovim']
endif
return [1, '']

View File

@ -0,0 +1,71 @@
" The Ruby provider helper
if exists('g:loaded_ruby_provider')
finish
endif
let g:loaded_ruby_provider = 1
function! provider#ruby#Detect() abort
return s:prog
endfunction
function! provider#ruby#Prog() abort
return s:prog
endfunction
function! provider#ruby#Require(host) abort
let prog = provider#ruby#Prog()
let ruby_plugins = remote#host#PluginsForHost(a:host.name)
for plugin in ruby_plugins
let prog .= " " . shellescape(plugin.path)
endfor
return provider#Poll(prog, a:host.orig_name, '$NVIM_RUBY_LOG_FILE')
endfunction
function! provider#ruby#Call(method, args) abort
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
function! s:detect()
if exists("g:ruby_host_prog")
return expand(g:ruby_host_prog)
elseif has('win32')
return exepath('neovim-ruby-host.bat')
else
let p = exepath('neovim-ruby-host')
if empty(p)
return ''
endif
" neovim-ruby-host could be an rbenv shim for another Ruby version.
call system(p)
return v:shell_error ? '' : p
end
endfunction
let s:err = ''
let s:prog = s:detect()
let s:plugin_path = expand('<sfile>:p:h') . '/script_host.rb'
if empty(s:prog)
let s:err = 'Cannot find the neovim RubyGem. Try :checkhealth'
endif
call remote#host#RegisterClone('legacy-ruby-provider', 'ruby')
call remote#host#RegisterPlugin('legacy-ruby-provider', s:plugin_path, [])

View File

@ -1,249 +0,0 @@
"""Legacy python/python3-vim emulation."""
import imp
import logging
import os
import sys
import neovim
__all__ = ('ScriptHost',)
logger = logging.getLogger(__name__)
debug, info, warn = (logger.debug, logger.info, logger.warn,)
IS_PYTHON3 = sys.version_info >= (3, 0)
if IS_PYTHON3:
basestring = str
if sys.version_info >= (3, 4):
from importlib.machinery import PathFinder
@neovim.plugin
class ScriptHost(object):
"""Provides an environment for running python plugins created for Vim."""
def __init__(self, nvim):
"""Initialize the legacy python-vim environment."""
self.setup(nvim)
# context where all code will run
self.module = imp.new_module('__main__')
nvim.script_context = self.module
# it seems some plugins assume 'sys' is already imported, so do it now
exec('import sys', self.module.__dict__)
self.legacy_vim = nvim.with_hook(LegacyEvalHook())
sys.modules['vim'] = self.legacy_vim
def setup(self, nvim):
"""Setup import hooks and global streams.
This will add import hooks for importing modules from runtime
directories and patch the sys module so 'print' calls will be
forwarded to Nvim.
"""
self.nvim = nvim
info('install import hook/path')
self.hook = path_hook(nvim)
sys.path_hooks.append(self.hook)
nvim.VIM_SPECIAL_PATH = '_vim_path_'
sys.path.append(nvim.VIM_SPECIAL_PATH)
info('redirect sys.stdout and sys.stderr')
self.saved_stdout = sys.stdout
self.saved_stderr = sys.stderr
sys.stdout = RedirectStream(lambda data: nvim.out_write(data))
sys.stderr = RedirectStream(lambda data: nvim.err_write(data))
def teardown(self):
"""Restore state modified from the `setup` call."""
for plugin in self.installed_plugins:
if hasattr(plugin, 'on_teardown'):
plugin.teardown()
nvim = self.nvim
info('uninstall import hook/path')
sys.path.remove(nvim.VIM_SPECIAL_PATH)
sys.path_hooks.remove(self.hook)
info('restore sys.stdout and sys.stderr')
sys.stdout = self.saved_stdout
sys.stderr = self.saved_stderr
@neovim.rpc_export('python_execute', sync=True)
def python_execute(self, script, range_start, range_stop):
"""Handle the `python` ex command."""
self._set_current_range(range_start, range_stop)
exec(script, self.module.__dict__)
@neovim.rpc_export('python_execute_file', sync=True)
def python_execute_file(self, file_path, range_start, range_stop):
"""Handle the `pyfile` ex command."""
self._set_current_range(range_start, range_stop)
with open(file_path) as f:
script = compile(f.read(), file_path, 'exec')
exec(script, self.module.__dict__)
@neovim.rpc_export('python_do_range', sync=True)
def python_do_range(self, start, stop, code):
"""Handle the `pydo` ex command."""
self._set_current_range(start, stop)
nvim = self.nvim
start -= 1
stop -= 1
fname = '_vim_pydo'
# define the function
function_def = 'def %s(line, linenr):\n %s' % (fname, code,)
exec(function_def, self.module.__dict__)
# get the function
function = self.module.__dict__[fname]
while start <= stop:
# Process batches of 5000 to avoid the overhead of making multiple
# API calls for every line. Assuming an average line length of 100
# bytes, approximately 488 kilobytes will be transferred per batch,
# which can be done very quickly in a single API call.
sstart = start
sstop = min(start + 5000, stop)
lines = nvim.current.buffer.get_line_slice(sstart, sstop, True,
True)
exception = None
newlines = []
linenr = sstart + 1
for i, line in enumerate(lines):
result = function(line, linenr)
if result is None:
# Update earlier lines, and skip to the next
if newlines:
end = sstart + len(newlines) - 1
nvim.current.buffer.set_line_slice(sstart, end,
True, True,
newlines)
sstart += len(newlines) + 1
newlines = []
pass
elif isinstance(result, basestring):
newlines.append(result)
else:
exception = TypeError('pydo should return a string ' +
'or None, found %s instead'
% result.__class__.__name__)
break
linenr += 1
start = sstop + 1
if newlines:
end = sstart + len(newlines) - 1
nvim.current.buffer.set_line_slice(sstart, end, True, True,
newlines)
if exception:
raise exception
# delete the function
del self.module.__dict__[fname]
@neovim.rpc_export('python_eval', sync=True)
def python_eval(self, expr):
"""Handle the `pyeval` vim function."""
return eval(expr, self.module.__dict__)
def _set_current_range(self, start, stop):
current = self.legacy_vim.current
current.range = current.buffer.range(start, stop)
class RedirectStream(object):
def __init__(self, redirect_handler):
self.redirect_handler = redirect_handler
def write(self, data):
self.redirect_handler(data)
def writelines(self, seq):
self.redirect_handler('\n'.join(seq))
def flush(self):
pass
class LegacyEvalHook(neovim.SessionHook):
"""Injects legacy `vim.eval` behavior to a Nvim instance."""
def __init__(self):
super(LegacyEvalHook, self).__init__(from_nvim=self._string_eval)
def _string_eval(self, obj, session, method, kind):
if method == 'vim_eval':
if IS_PYTHON3:
if isinstance(obj, (int, float)):
return str(obj)
elif isinstance(obj, (int, long, float)):
return str(obj)
return obj
# This was copied/adapted from nvim-python help
def path_hook(nvim):
def _get_paths():
return discover_runtime_directories(nvim)
def _find_module(fullname, oldtail, path):
idx = oldtail.find('.')
if idx > 0:
name = oldtail[:idx]
tail = oldtail[idx+1:]
fmr = imp.find_module(name, path)
module = imp.find_module(fullname[:-len(oldtail)] + name, *fmr)
return _find_module(fullname, tail, module.__path__)
else:
return imp.find_module(fullname, path)
class VimModuleLoader(object):
def __init__(self, module):
self.module = module
def load_module(self, fullname, path=None):
# Check sys.modules, required for reload (see PEP302).
if fullname in sys.modules:
return sys.modules[fullname]
return imp.load_module(fullname, *self.module)
class VimPathFinder(object):
@staticmethod
def find_module(fullname, path=None):
"Method for Python 2.7 and 3.3."
try:
return VimModuleLoader(
_find_module(fullname, fullname, path or _get_paths()))
except ImportError:
return None
@staticmethod
def find_spec(fullname, path=None, target=None):
"Method for Python 3.4+."
return PathFinder.find_spec(fullname, path or _get_paths(), target)
def hook(path):
if path == nvim.VIM_SPECIAL_PATH:
return VimPathFinder
else:
raise ImportError
return hook
def discover_runtime_directories(nvim):
rv = []
for path in nvim.list_runtime_paths():
if not os.path.exists(path):
continue
path1 = os.path.join(path, 'pythonx')
if IS_PYTHON3:
path2 = os.path.join(path, 'python3')
else:
path2 = os.path.join(path, 'python2')
if os.path.exists(path1):
rv.append(path1)
if os.path.exists(path2):
rv.append(path2)
return rv

View File

@ -0,0 +1,6 @@
begin
require 'neovim/ruby_provider'
rescue LoadError
warn('Your neovim RubyGem is missing or out of date.',
'Install the latest version using `gem install neovim`.')
end

View File

@ -1,7 +1,7 @@
"python3complete.vim - Omni Completion for python
" Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
" Version: 0.9
" Last Updated: 18 Jun 2009
" Last Updated: 18 Jun 2009 (small fix 2015 Sep 14 from Debian)
"
" Roland Puntaier: this file contains adaptations for python3 and is parallel to pythoncomplete.vim
"
@ -359,6 +359,7 @@ class PyParser:
def __init__(self):
self.top = Scope('global',0)
self.scope = self.top
self.parserline = 0
def _parsedotname(self,pre=None):
#returns (dottedname, nexttoken)

View File

@ -377,6 +377,7 @@ class PyParser:
def __init__(self):
self.top = Scope('global',0)
self.scope = self.top
self.parserline = 0
def _parsedotname(self,pre=None):
#returns (dottedname, nexttoken)

View File

@ -1,7 +1,7 @@
function! remote#define#CommandOnHost(host, method, sync, name, opts)
let prefix = ''
if has_key(a:opts, 'range')
if has_key(a:opts, 'range')
if a:opts.range == '' || a:opts.range == '%'
" -range or -range=%, pass the line range in a list
let prefix = '<line1>,<line2>'
@ -30,7 +30,7 @@ function! remote#define#CommandOnHost(host, method, sync, name, opts)
exe s:GetCommandPrefix(a:name, a:opts)
\ .' call remote#define#CommandBootstrap("'.a:host.'"'
\ . ', "'.a:method.'"'
\ . ', "'.a:sync.'"'
\ . ', '.string(a:sync)
\ . ', "'.a:name.'"'
\ . ', '.string(a:opts).''
\ . ', "'.join(forward_args, '').'"'
@ -89,12 +89,13 @@ endfunction
function! remote#define#AutocmdOnHost(host, method, sync, name, opts)
let group = s:GetNextAutocmdGroup()
let forward = '"doau '.group.' '.a:name.' ".'.'expand("<amatch>")'
let forward = '"doau '.group.' '.a:name.' ".'
\ . 'fnameescape(expand("<amatch>"))'
let a:opts.group = group
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 +134,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 +158,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)
@ -165,14 +169,40 @@ function! remote#define#FunctionOnChannel(channel, method, sync, name, opts)
exe function_def
endfunction
let s:busy = {}
let s:pending_notifications = {}
function! s:GetRpcFunction(sync)
if a:sync
return 'rpcrequest'
if a:sync ==# 'urgent'
return 'rpcnotify'
elseif a:sync
return 'remote#define#request'
endif
return 'rpcnotify'
return 'remote#define#notify'
endfunction
function! remote#define#notify(chan, ...)
if get(s:busy, a:chan, 0) > 0
let pending = get(s:pending_notifications, a:chan, [])
call add(pending, deepcopy(a:000))
let s:pending_notifications[a:chan] = pending
else
call call('rpcnotify', [a:chan] + a:000)
endif
endfunction
function! remote#define#request(chan, ...)
let s:busy[a:chan] = get(s:busy, a:chan, 0)+1
let val = call('rpcrequest', [a:chan]+a:000)
let s:busy[a:chan] -= 1
if s:busy[a:chan] == 0
for msg in get(s:pending_notifications, a:chan, [])
call call('rpcnotify', [a:chan] + msg)
endfor
let s:pending_notifications[a:chan] = []
endif
return val
endfunction
function! s:GetCommandPrefix(name, opts)
return 'command!'.s:StringifyOpts(a:opts, ['nargs', 'complete', 'range',
@ -187,7 +217,7 @@ let s:next_gid = 1
function! s:GetNextAutocmdGroup()
let gid = s:next_gid
let s:next_gid += 1
let group_name = 'RPC_DEFINE_AUTOCMD_GROUP_'.gid
" Ensure the group is defined
exe 'augroup '.group_name.' | augroup END'
@ -218,7 +248,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

Some files were not shown because too many files have changed in this diff Show More