Compare commits

...

6079 Commits

Author SHA1 Message Date
b99dad7b4c NVIM v0.4.3
Maintenance release for the v0.4.x series.

FIXES:

599ad5d3b8 Windows: nvim-qt v0.2.15 (fix "invalid font" error on startup)
1def94597b #11332 autocmd: Fix event name casing
b678d33dd3 #11315 test: delete duplicate highlight group
924fa143cc #11225 ex_echo: fix check for got_int
327e8ddb18 #11138 deps: pass LDFLAGS+=-static
a1f557690f #11222 mac: fix "tags file not sorted" bug on Catalina
f2f37712a4 #11187 recovery mode (-r/-L): use headless_mode
4f452a6744 #11190 Remove "highbright bold" conversion.
9571a87d3d #11177 third-party: upgrade libvterm to 0.1.2
3817518ab4 #11074 terminfo_start: flush buffer
56d9412999 win_line: update `w_last_cursorline` always
ddd3363a42 #11132 patch_terminfo_bugs: TERM=xterm with non-xterm: ignore smglr
d453d2c484 Fix redraw regression with w_p_cole in visual mode
e0622b4c65 screen: missing redraw/highlight for ruler in message area
b781f2b072 cmdline: wildmenumode() should be true with wildoptions+=pum
eef3809067 #11027 win_update: fix redraw regression
43f4955f70 #11069 Merge pull request from bfredl/virtualcol
6f693be1ee #11050 env: use putenv_s for LC_ALL, LANG, etc.
36e2846b49 #11094 paste: fix handling of "<" in cmdline
60b56ed458 #11126 Merge pull request from bfredl/invalidcell-0.4
8250d6795b screen: don't crash on invalid grid cells being recomposed
2019-11-06 01:54:45 -08:00
1def94597b autocmd: Fix event name casing #11332
Affects getcompletion()
2019-11-04 00:25:20 -08:00
b678d33dd3 Merge pull request #11315 from bfredl/termtestfix
[release-0.4] test: delete duplicate highlight group
2019-10-29 21:49:56 +01:00
a012387074 [release-0.4] test: delete duplicate highlight group
Depending on the lua version, 6 might get used instead of
2 here, which causes test failures in upstream builds.
This was fixed as part of #11206 on master
2019-10-29 19:44:47 +01:00
599ad5d3b8 win/dist: nvim-qt v0.2.15 2019-10-26 13:18:59 -07:00
924fa143cc [release-0.4] ex_echo: fix check for got_int #11225
It needs to return to not output any remaining parts.

Followup to https://github.com/neovim/neovim/pull/10926
Ref: https://github.com/neovim/neovim/issues/10923

(cherry picked from commit 93fe30593b)
2019-10-20 00:54:07 +02:00
327e8ddb18 [release-0.4] deps: pass LDFLAGS+=-static (#11138)
This is required when `build_old_libs=no` is used in `libtool`.

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

(cherry picked from commit 2e14dffbb4)
2019-10-14 15:17:47 +02:00
a1f557690f [release-0.4] mac: fix "tags file not sorted" bug on Catalina (#11222)
I/O in Catalina is currently known to be broken. This commit works
around a pesky bug and also makes the code more consistent by removing
the mix of C file and standard I/O.

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

(cherry picked from commit d0efc1c906)
2019-10-14 14:05:58 +02:00
f2f37712a4 [release-0.4] recovery mode (-r/-L): use headless_mode (#11187)
Fixes https://github.com/neovim/neovim/issues/11181.

(cherry picked from commit 9af0fe529d)
2019-10-11 19:17:29 +02:00
4f452a6744 Remove "highbright bold" conversion. Fixes #11190
When using TUI host terminal should take care of this (regardless
if 'termguicolors' is active or not). For GUI the behavior doesn't make
sense (GUI should display bold attr as bold always).

(cherry picked from commit b772b86d2b)
2019-10-11 00:00:26 +02:00
9571a87d3d [release-0.4] third-party: upgrade libvterm to 0.1.2 (#11177)
(cherry picked from commit f2ad93168b)
2019-10-09 19:58:14 +02:00
3817518ab4 [release-0.4] terminfo_start: flush buffer #11074
This aligns with `terminfo_stop`, which also flushes the buffer
after disabling things.

This ensures Neovim gets the response to the terminal background query
before exiting (`nvim -u NONE -cq` with e.g. urxvt or kitty).

Caveats:
* With kitty this causes some "flickering", likely since the alternate
  screen is being setup with `nvim -u NONE -cq`, whereas it would not be
  processed otherwise before quitting (as with the background query).
* tmux after this patch may print ^[[I (CSI I / FocusGained) after
  `nvim -u NONE -cq`.

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

Ref: https://github.com/neovim/neovim/issues/11181
2019-10-08 19:18:07 +02:00
56d9412999 [release-0.4] win_line: update w_last_cursorline always
Vim patch 8.1.0856 (54d9ea6) caused a performance regression in Neovim,
when `set conceallevel=1 nocursorline` was used, since then due to
refactoring in 23c71d5 `w_last_cursorline` would never get updated
anymore.

Adds/uses `redrawdebug+=nodelta` for testing this.

Fixes https://github.com/neovim/neovim/issues/11100.
Closes https://github.com/neovim/neovim/pull/11101.
2019-10-04 08:54:02 +02:00
ddd3363a42 [release-0.4] patch_terminfo_bugs: TERM=xterm with non-xterm: ignore smglr (#11132)
"smglr" was added for TERM=xterm recently to the terminfo database,
which causes display issues with terminals that use `TERM=xterm` by
default for themselves, although not supporting it.

This patch makes "smglr" to be ignored then.

Fixes https://github.com/neovim/neovim/issues/10562
2019-10-03 07:47:47 +02:00
d453d2c484 [release-0.4] Fix redraw regression with w_p_cole in visual mode
Fixes https://github.com/neovim/neovim/issues/11024, regressed in 23c71d51.
Closes https://github.com/neovim/neovim/pull/11120.
2019-10-03 07:47:40 +02:00
c5d1b0f3da Merge pull request #11142 from bfredl/backports
[release-0.4] Backport fixes for ruler drawing and wildmenumode()
2019-10-02 22:39:10 -07:00
e0622b4c65 [release-0.4] screen: missing redraw/highlight for ruler in message area 2019-10-02 22:30:40 +02:00
b781f2b072 [release-0.4] cmdline: wildmenumode() should be true with wildoptions+=pum 2019-10-02 22:29:42 +02:00
e63fdf63ba Merge pull request #11133 from blueyed/backports
[release-0.4] backports
2019-10-02 03:43:39 +02:00
eef3809067 [release-0.4] win_update: fix redraw regression (#11027)
Before 6e9ea5adc `win_ins_lines` would return `FAIL` for `i/line_count == 0`.

Handle this by checking it in the outer `if`.

Ref: https://github.com/neovim/neovim/commit/6e9ea5ad#commitcomment-35084669
2019-10-01 02:16:14 +02:00
43f4955f70 [release-0.4] Merge pull request #11069 from bfredl/virtualcol
screen: fix vcol counting with virtual text.
2019-10-01 02:15:24 +02:00
6f693be1ee [release-0.4] env: use putenv_s for LC_ALL, LANG, etc. #11050
Problem:  ":lang messages en_US.UTF-8" no longer overrides the language
          detected from the environment (at startup).
Solution: In os_setenv, special-case "LC_ALL", "LANG", et al. to use
          putenv_s instead of uv_os_setenv.

fixes #11045
2019-10-01 02:13:13 +02:00
36e2846b49 [release-0.4] paste: fix handling of "<" in cmdline (#11094)
Fixes https://github.com/neovim/neovim/issues/11088.
2019-10-01 02:11:40 +02:00
60b56ed458 Merge pull request #11126 from bfredl/invalidcell-0.4
[release-0.4] screen: don't crash on invalid grid cells being recomposed
2019-09-30 22:44:38 +02:00
8250d6795b screen: don't crash on invalid grid cells being recomposed 2019-09-30 20:33:09 +02:00
38d02d58b2 version bump 2019-09-15 19:40:58 -07:00
7d6aa82b69 NVIM v0.4.2
This is a "stub" release to fix release automation.

Release notes: e2cc5fe09d

FIXES:

6c65f8f182 CI/AppVeyor: revert whitelist
2019-09-15 19:36:35 -07:00
6c65f8f182 CI/AppVeyor: revert whitelist
revert 6b028ec5f2 #10746

This seems to skip tags also, which breaks our release automation.
From the AppVeyor logs:

    2019-09-15 17:25:00.232 Warning Commit "1f76c4af" of branch "master" skipped as commit message contains either "[skip ci]" or "[ci skip]" or "[skip appveyor]"
    2019-09-15 17:20:24.152 Warning Commit "baa5263b" skipped as branch "stable" is not in white-list
    2019-09-15 17:20:03.163 Warning Commit "6cb5ffc0" skipped as branch "release-0.4" is not in white-list
    2019-09-15 17:20:02.977 Warning Commit "baa5263b" skipped as branch "v0.4.1" is not in white-list
    2019-09-15 16:35:38.810 Warning Commit "31956372" of branch "master" skipped as commit message contains either "[skip ci]" or "[ci skip]" or "[skip appveyor]"
    2019-09-15 16:28:35.237 Warning Commit "e2cc5fe0" skipped as branch "stable" is not in white-list
    2019-09-15 16:28:17.814 Information Build version 31489 created
    2019-09-15 16:28:16.364 Warning Commit "e2cc5fe0" skipped as branch "v0.4.0" is not in white-list
2019-09-15 17:39:07 -07:00
6cb5ffc075 version bump 2019-09-15 17:12:50 -07:00
baa5263b56 NVIM v0.4.1
FIXES:

2abdb89522 fix failed release: regenerate the *.mpack file
2019-09-15 17:11:39 -07:00
2abdb89522 fix failed release: regenerate the *.mpack file
Set NVIM_API_PRERELEASE=true to regenerate the *.mpack file, because it
was generated from an old binary accidentally, which caused the release
to fail:

    test/functional\api\version_spec.lua:133: Expected objects to be the same.
    Passed in:
    (table: 0x0c6175a8) {
      [method] = false
      [name] = 'nvim_get_context'
     *[parameters] = {
       *[1] = {
         *[1] = 'Dictionary'
          [2] = '' } }
      [return_type] = 'Dictionary'
      [since] = 6 }
    Expected:
    (table: 0x0c6cd2d0) {
      [method] = false
      [name] = 'nvim_get_context'
     *[parameters] = {
       *[1] = {
         *[1] = 'Array'
          [2] = '' } }
      [return_type] = 'Dictionary'
      [since] = 6 }
    stack traceback:
        test/functional\api\version_spec.lua:133: in function <test/functional\api\version_spec.lua:122>
2019-09-15 17:10:16 -07:00
e2cc5fe09d NVIM v0.4.0
This release represents ~2700 commits since v0.3.4, the previous
non-maintenance release.  Besides the highlights listed below, this
release features vast improvements to documentation, internal subsystems
and test/CI infrastructure, and 700+ patches merged from Vim.

FEATURES:

New API functions:
  nvim_create_buf: create various kinds of buffers
  nvim_get_context, nvim_load_context
    8e6b0a73c9 #10619 API: Context: save/restore/inspect editor state
  nvim_input_mouse: perform mouse actions
  nvim_open_win: create floating windows (and external, for supporting UIs)
  nvim_paste: paste text at cursor
  nvim_put: put text at cursor
  nvim_select_popupmenu_item: perform popupmenu actions
  nvim_set_keymap: create/delete mappings
  nvim_set_vvar: set v: variables
  nvim_ui_pum_set_height
  nvim_ui_try_resize_grid
  nvim_win_close: close windows
  nvim_win_get_config: get window configuration
  nvim_win_set_config: reconfigure windows

New UI events:
  redraw.grid_destroy
  redraw.hl_group_set
    8a3f8589a3 #10504 UI/highlight: expose builtin highlight groups using hl_group_set event
  redraw.msg_clear
  redraw.msg_history_show
  redraw.msg_ruler
  redraw.msg_set_pos
  redraw.msg_show
  redraw.msg_showcmd
  redraw.msg_showmode
  redraw.win_close
  redraw.win_external_pos
  redraw.win_float_pos
  redraw.win_hide
  redraw.win_pos

API
f5c56f03bb #9170 API/Lua: nvim_buf_attach: support Lua callback
82d48c0dab #9896 API: emit nvim_error_event on failed async request
b9ad12e6c2 #9992 UI/nvim_ui_attach(): add `override` option
3d1ed7c959 #9993 UI/ext_messages: learn more message kinds
8ed54bbec3 #9547 proper multiline error message for rpcrequest, API wrappers

Lua
This release introduces "Nvim-Lua standard library". See ":help lua-stdlib".
89d7e24891 #9463 Lua stdlib: vim.inspect, string functions
8e941c59ec #9740 Lua: generate documentation from docstrings
1cbe014569 #9301 lua/stdlib: Introduce vim.shared
c83926cd0a #10123 Lua: introduce vim.loop (expose libuv event-loop)
81e1dbca99 #10120 Lua: vim.schedule(cb)
1f54f68732 #10688 Lua: minimal UTF-16 support needed for LSP
6fb0020df4 #10513 Lua encoding support
    c0993ed343 Lua: support getting UTF-32 and UTF-16 sizes of replaced text
    b0e26199ec Lua: add {old_byte_size} to on_lines buffer change event

UI:
- The Nvim 0.3.4 UI protocol introduced line-based updates instead of
  legacy char-based updates. Nvim 0.4 continues to evolve the UI
  protocol. See ":help ui". Legacy UI clients are supported. See
  ":help api-contract".
9a1675b065 #6619 Floating windows
  - Can be (re)positioned, anchored, external.
  - Are real windows showing real buffers. No shortcuts, hacks, or compromises.
  - Support all features and API of normal windows, plus more.
6427894d89 #8455 Multigrid: "windows drawn on separate grids"
  - Windows are logically isolated internally.
  - Windows are sent to UIs as distinct objects, so that UIs can control
    layout instead of being stuck with the classic TUI layout.
  - Per-window font-size, dimenions, line-spacing.
  - Compositor: Internal subsystem for composing grids.
3855204f58 #6917 UIEnter, UILeave
788bcbba24 #9923 ui: ":syn blend=", 'winblend'
7cf7c0a0b8 #9575 ui: 'redrawdebug' option for flexible debugging of redrawing
5c836d2ef8 #9607 wildoptions=pum (enabled by default)
37f8df8824 #9571 UI: 'pumblend' option for semi-transparent popupmenu
c403a95a52 #9446 Visual: highlight char-at-cursor
  - Traditionally Vim's visual selection does "reverse mode", which
    perhaps conflicts with the non-blinking block cursor. But
    'guicursor' defaults to a vertical bar for selection=exclusive, and
    this confuses users who expect to see the text highlighted.

:terminal
fc27dc98d7 #8550 autocmds: TermEnter, TermLeave
d13803f64f #9810 keymap, terminal: more keycodes
3b56f59532 #9535 :terminal : Fix F1-F4 key codes
2d4a37ebab #10370 :ls : show "R", "F" for terminal-jobs
fd0fd752c8 #9966 terminal: swap priority of terminal, editor highlights
7bb858c39c #9494 libvterm 0.1

TUI
3afb397407 syntax, TUI: support "strikethrough"
ccbcd390d4 #9408 TUI: "title stacking" unconditionally
298608f88c #9509 TUI: detect background color, set bg=dark/light
42f492ac99 #9097 TUI: handle Smulx extension capability (extended underline)
424ddd01f5 #10205 TUI: support rgba background detection
9b4383261a #9601 TUI: italics in tmux, Terminal.app
f6fb370b1b #9793 keymap: support more (keypad) keycodes
3340e08bec #9423 TUI: Konsole DECSCUSR fixup

:checkhealth
d0fd66ba82 health/provider.vim: check curl HTTPS support
c38862acea #10490 checkhealth: try yarn if npm is missing
43356a43d0 #9929 health: check if tmux enabled true colors
ec5a4d862d #9548 checkhealth: validate locale

providers (clipboard, python, etc.):
96be8a2c4d #10161 Allow reloading providers (useful for UIs/clients)
db3c797c6b #9487 provider: improve error message if provider is missing

Various:
36762a00a8 #9295 signs: support multiple columns
801fe799ff #10382 eval: wait() (wait for any condition)
9df3a676e7 #10400 MsgArea highlight; message grid
a9bea8c104 #10790 keymap: allow modifiers to multibyte chars, like <m-ä>
25e0a449bb #10878 #4448 paste: redesign (10x+ faster pasting; extensible vim.paste Lua hook)
ef5037e7f6 #9706 autocmd: introduce "++once" feature
175398f216 #9616 add CompleteChanged autocmd
7fcf2f926f #9717 TextYankPost: add v:event["inclusive"]
3a699a790c #8364 termdebug.vim plugin
ca1ce59025 #9709 performance: use os_copy to create backups
ed0e96cd28 man.vim: set 'linebreak'
70f6939fd4 #9564 events: add "Signal" event
f89d0d8230 #9568 inccommand: auto-disable if folding is slow

FIXES:

41bb68b8e8 #10584 process_stop: uv: do not close stdin first/explicitly
e50aa2a6c6 #10117 normal: Don't exit CTRL-O mode after processing K_EVENT
95fa71c6d2 #9504 :recover : Fix crash on non-existent *.swp
5a836d4767 #9507 screen: don't unconditionally clear messages on window scroll
149dcbf2c7 #10021 channel: refactor events, prevent recursive invocation of events
d19ff73b39 #10107 Fix multiple c_CTRL-D showing statusline
b65a7b7f66 #10103 Fix wildmode=list,full and display+=msgsep interaction
0be6d3c86f #9634 fsync: Ignore ENOTSUP. Fix writing to SMB.
b247c6fd22 #10025 kbtree: pointer UB and unitialized value fixes
018e0d5a19 #9643 API/buffer-updates: always detach on buf-reload
400ee59247 #9961 API: fix cursor position when lines are added
769f44e918 #9911 win/defaults: Use "…/nvim-data/site" in 'runtimepath'
83d571653b #9911 spellfile.vim: store files in stdpath('data')
8dbf23181a #9887 RPC: conform message-id type to msgpack-RPC spec
5f996e36d1 #9894 options: properly reset directories on 'autochdir'
4c4a570156 #9807 various CursorMoved fixes
943bedfc86 #9853 event-loop: do not set CA_COMMAND_BUSY
9d207fd876 #9693 dictwatcheradd(): support b:changedtick
2d50bf3498 #9789 mac: fix locale detection
c5631338b1 #9754 :mksession : restore tab-local working directories
092e7e6c60 #9703 #9703 executable(): return false if user is not owner
11a481f711 #9686 env var fixes/improvements
8e54847fdf #9666 #7920 os/env: Fix completion of multibyte env var names
519382646b #10468 Fix is_executable_in_path() on Windows
8eaa452073 #9516 win: exepath(), executable() fixes
f55c1e4233 #10544 reltimefloat(): allow negative result
b08dc3ec19 #10561 win: jobstart(), system(): $PATHEXT-resolve exe
7cc2b723d4 #10392 TextYankPost: spurious/too-early dispatch during delete
6e01ed6a4c OpenBSD: stop jobs/processes properly
58dd5fcc01 #10522 jobstop(): close channel before process_stop()
83632022f8 #10959 improved resize behavior (all UIs)
c6eb1f42be #10830 API: fix nvim_command_output buffer overflow
cbfd18c85a #10763 startup: handle 'guicursor' after user config
b8f2436feb #10915 jobwait(): fix race if job exits quickly
2fafed6bb8 #10765 clipboard: handle/avoid SIGTERM with previous owner
8aca932aa0 #9954 clipboard: setreg("*") with clipboard=unnamed
3f10c5b533 #9480 performance: clipboard/macOS: assume that pbcopy works
48efafc81c #10398 screen: disable redrawing inside VimResized
5e4b93a38f #10389 API/Lua: make nvim_execute_lua use native lua floats, not special tables
8c6f5b7f92 #9934 Spurious quote mark in command line when typing <C-R>
a8a38f3465 Lua 5.2/5.3 compat

:terminal
47b7b471fa #10700 :terminal : update buffer when switching tabpage
5225c1ec30 #9605 terminal: Fix potential invalid local 'scrollback'
894f6bee54 #8325 :terminal : set topline based on window height
8171e96b96 #9551 Improve :terminal resize
d928b036dc #9856 :stopinsert should leave terminal-mode
3f71218505 #9926 :terminal : fix: Using `:stopinsert` while in normal mode
5020daa6e5 #9883 ui/terminal: make terminal state redraw like any other state

TUI:
9f19e8d29d #9443 TUI: Do not disable BCE for builtin terminfos
a4076e5dcf #9474 win/TUI: fix text overrides line numbers
533d4a36ec #9645 TUI: do not resize host-terminal on startup
b51e5d8b8d #9688 tui_tk_ti_getstr: handle weird value
1f5eac1115 #10785 TUI: fix data-race during resize

CHANGES:

9697c7f56a #8194 fix menu_get()
7f2e43c637 #9520 improve Lua error messages
c2343180d7 #9526 Remove jemalloc
baf93d9606 #9581 UI: always use concrete colors for default_colors_set
91688b4883 #9563 defaults: set 'scrollback' to -1 by default
bb24fec333 #10136 defaults: exclude "S" from 'shortmess'
ddd0eb6f51 #8540 startup: -es/-Es (silent/batch mode): skip swapfile
35362495c9 #9805 jumplist: avoid extra tail entry
939d9053bd #10573 channels: reflect exit due to signals in exit status code
45c34bd84a #10689 :doautocmd : Never show "No matching autocommands"
fb19aeeb33 #9110 API: make nvim_win_set_option() set window-global, not buffer-local
abfc8b3257 #10778 emsg_multiline: log Vim errors
06d9cc734b #10657 exists("$FOO"): return false for empty env var
6616d1d3e5 #10743 win/env: Vim-compat: Empty string deletes env var
7d664837e1 #10662 win: expand nested env var in $HOME
2816bc8620 #8349 edit.c: Disable indent during completion
58f505dc74 #9829 startup: remove TUI init special-case
    Historically Vim/Nvim does backflips to handle input and show messages
    before a UI is available. This logical contradiction was already fixed
    for remote UIs (#9024 c236e80cf3). Fixing it also for the TUI avoids
    problems on Windows, simplifies the logic, and avoids races like #9959.
2019-09-15 12:38:40 -07:00
45f23ef9d6 Merge pull request #11025 from bfredl/doublescroll
compositor: avoid transmitting invalid lines on double scroll
2019-09-15 16:53:43 +02:00
b9d035a39c Merge pull request #11026 from janlazo/vim-8.1.0220
vim-patch:8.1.0220
2019-09-15 15:55:50 +02:00
a0f13095aa compositor: avoid transmitting invalid lines on double scroll
This happens in an operation which both increases topline and also
inserts new lines somewhere in the remaining are. So before drawing any
line, win_update() is performing two grid_scroll operations.

===
A
B
C
D
E^
F
===

Consider that new line will be inserted after line E and screen also
scrolled up to line C. First the topline will be adjusted (x is the
scrolling region, ! invalid/empty space created by the scroll):

===
C   x
D   x
E^  x
F   x
!   x
!   x
===

and then space is inserted for the new line

===
C
D
E^
!   x
F   x
!   x
===

The problem is that we are now assuming that any invalid area ! created
by a scroll is filled with actual contents (by win_line etc) before it
is scrolled again. But in this case the last invalid line ! gets
scrolled. Ideally we should make win_update smarter and just scroll
valid lines for the later scroll (it is just wasteful to scroll the
larger area anyway), but for the 0.4 releasejust make
the compositor ignore such an invalid line (as it will get overdrawn
anyway later).
2019-09-15 15:30:48 +02:00
36a1670151 test/old: detect user modules for python,ruby
Set the environment variables before changing $HOME
so that python,ruby can find user modules not in $HOME.

Reference:
- 7be7ec98a2
- https://github.com/neovim/neovim/issues/10270#issuecomment-531516948
2019-09-15 08:26:54 -04:00
c65dd2d114 vim-patch:8.1.0220: Ruby converts v:true and v:false to a number
Problem:    Ruby converts v:true and v:false to a number.
Solution:   Use Qtrue and Qfalse instead. (Masataka Pocke Kuwabara,
            closes vim/vim#3259)
d84b26a03b

nvim does not support v:none.
2019-09-15 07:41:08 -04:00
86e819d492 Merge #11021 from justinmk/ctx-rename-buflist
API: Context: "opts" param, et al.
2019-09-14 19:53:33 -07:00
ffdf8c4c12 Context: rename "buflist" => "bufs"
Given the other type names "jumps", "vars", etc., the name "buflist"
is somewhat unintuitive.
2019-09-14 18:57:35 -07:00
f2c75ef9b4 API: nvim_get_context: "opts" param
Since the parameter is already non-primitive, make it an `opts` map
instead of just a list, in case we want to extend it later.
2019-09-14 18:57:35 -07:00
2e0e592ea2 release.sh: bump nvim.appdata.xml 2019-09-14 17:54:16 -07:00
db550ac995 Merge #11020 from janlazo/vim-8.1.0289
vim-patch:8.0.{1134,1148},8.1.{212,289,2028}
fix #10270
2019-09-14 16:02:15 -07:00
fc27dc98d7 autocmds: TermEnter, TermLeave #8550
fix #8428
2019-09-14 15:54:19 -07:00
cccfc1b603 test/old: skip python-bindeval tests 2019-09-14 17:53:52 -04:00
ce3d9503b2 vim-patch:8.1.0212: preferred cursor column not set in interfaces
Problem:    Preferred cursor column not set in interfaces.
Solution:   Set w_set_curswant when setting the cursor. (David Hotham,
            closes vim/vim#3060)
53901442f3

This contains test_ruby changes only.
test_python changes were ported before.
2019-09-14 17:46:07 -04:00
7be7ec98a2 ci/travis: install pynvim outside of $HOME
This runs the python tests on Travis.
WIP: skip failing python tests
2019-09-14 17:30:22 -04:00
67bede0b27 test/old: skip failing ruby tests
These tests didn't pass in https://github.com/neovim/neovim/pull/9245
2019-09-14 17:05:04 -04:00
232cce9abe vim-patch:8.0.1448: segfault with exception inside :rubyfile command
Problem:    Segmentation fault when Ruby throws an exception inside :rubyfile
            command.
Solution:   Use rb_protect() instead of rb_load_protect(). (ujihisa,
            closes vim/vim#2147, greywolf, closes vim/vim#2512, vim/vim#2511)
37badc898b
2019-09-14 16:34:16 -04:00
c971a231e2 vim-patch:8.0.1134: superfluous call to syn_get_final_id()
Problem:    Superfluous call to syn_get_final_id().
Solution:   Remove it. (Ken Takata)
76301956f0
2019-09-14 16:12:38 -04:00
1a718f4fae vim-patch:8.1.2028: options test script does not work
Problem:    Options test script does not work.
Solution:   Use optiondefs.h for input.
d9b0d83b13
2019-09-14 13:07:58 -04:00
27fd4f31fd vim-patch:8.1.0289: cursor moves to wrong column after quickfix jump
Problem:    Cursor moves to wrong column after quickfix jump.
Solution:   Set the curswant flag. (Andy Massimino, closes vim/vim#3331)
2dfcef4c08
2019-09-14 12:31:47 -04:00
8c88d98df9 vim-patch:8.1.2023: no test for synIDattr() returning "strikethrough" (#11018)
Problem:    No test for synIDattr() returning "strikethrough".
Solution:   Extend the synIDattr() test. (Jaskaran Singh, closes vim/vim#4929)
dcb2b9cb08
2019-09-14 16:32:38 +02:00
9cf8cf605d Merge #11015 from justinmk/getdigits
getdigits: introduce `strict`, `def` parameters
2019-09-13 19:32:06 -07:00
6aae0e7c94 lint 2019-09-13 19:29:25 -07:00
3344cffe7b getdigits: introduce strict, def parameters
Problem:
During a refactor long ago, we changed the `getdigits_*` familiy of
functions to abort on overflow.  But this is often wrong, because many
of these codepaths are handling user input.

Solution:
Decide at each call-site whether to use "strict" mode.

fix #5555
2019-09-13 19:29:25 -07:00
0a24a2c314 rename: getdigits_safe => try_getdigits 2019-09-13 19:13:00 -07:00
427cf16e44 vim-patch:8.1.0719: too many #ifdefs [ci skip] #11016
Problem:    Too many #ifdefs.
Solution:   Always build with the +visualextra feature.
870ba5f6dc
2019-09-13 18:30:23 -07:00
4cee0e0731 vim-patch:8.1.2026: possibly using uninitialized memory #11013
Problem:    Possibly using uninitialized memory.
Solution:   Check if "dict" is NULL. (closes vim/vim#4925)
dbec74907e
2019-09-13 16:31:56 -07:00
5a3c86205f test: fix failure on Windows (allow ".exe")
ref 77594d55f7
2019-09-13 16:31:21 -07:00
4b7d8e6b87 win/dist: nvim-qt v0.2.14 #11008 2019-09-13 15:56:02 -07:00
77594d55f7 startup: fail if --embed with -es/-Es #10753
Closes https://github.com/neovim/neovim/issues/10031
2019-09-13 15:15:59 -07:00
3afb397407 syntax, TUI: support "strikethrough"
fix #3436

Includes:
vim-patch:8.0.1038: strike-through text not supported
2019-09-13 14:46:19 -07:00
35341b34b8 Merge #11007 from janlazo/vim-8.0.1772
vim-patch:8.0.1772,8.1.{248,259,261,267}
2019-09-13 14:38:16 -07:00
5f95b35c7a vim-patch:8.1.0267: no good check if restoring quickfix list worked
Problem:    No good check if restoring quickfix list worked.
Solution:   Let qf_restore_list() return OK/FAIL. (Yegappan Lakshmanan)
90f1e2b7bc
2019-09-13 02:15:33 -04:00
47357270ae vim-patch:8.1.0261: Coverity complains about a negative array index
Problem:    Coverity complains about a negative array index.
Solution:   When qf_id2nr() cannot find the list then don't set qf_curlist.
38efd1d17a
2019-09-13 01:41:01 -04:00
fba9c72495 vim-patch:8.1.0259: no test for fixed quickfix issue
Problem:    No test for fixed quickfix issue.
Solution:   Add a test.  Clean up the code a bit. (Yegappan Lakshmanan)
3f347e4716
2019-09-13 00:47:30 -04:00
4ef9ad0514 vim-patch:8.1.0248: duplicated quickfix code
Problem:    duplicated quickfix code.
Solution:   Move the code to a function.
8d8a65e389
2019-09-13 00:35:14 -04:00
8ba492e4e2 vim-patch:8.0.1772: quickfix: mixup of FALSE and FAIL, returning -1
Problem:    Quickfix: mixup of FALSE and FAIL, returning -1.
Solution:   Use FAIL and INVALID_QFIDX. (Yegappan Lakshmanan)
29ce409bfc
2019-09-13 00:14:04 -04:00
3855204f58 Merge #6917 'UIEnter, UILeave' 2019-09-12 17:45:33 -07:00
492ac04f7e UIEnter/UILeave: fire for embedder UI, builtin TUI
Before this, --embed UIs (without --headless) would not trigger UIEnter.

For TUI, maybe UIEnter isn't useful, but:
- It is less "surprising"/special.
- Makes documentation simpler.
- When TUI becomes a coprocess, it will happen anyway.
2019-09-12 17:04:05 -07:00
589f612adf rename: UIAttach/UIDetach => UIEnter/UILeave
"enter"/"leave" is more conventional for Vim events, and
"attach"/"detach" distinction does not gain much.
2019-09-12 17:04:05 -07:00
44d45e29ea API/nvim_list_uis(): include "chan" field for TUI
Even though it's always zero currently, it's less confusing if all UIs
have the same fields.
2019-09-12 17:04:05 -07:00
6dd56d0902 UIAttach, UIDetach
doc: ginit.vim, gvimrc
fix #3656
2019-09-12 17:04:05 -07:00
e9cf515888 UIAttach, UIDetach 2019-09-12 15:52:54 -07:00
426399c2c4 Merge #10999 from janlazo/clang_pvs2 2019-09-12 14:56:50 -07:00
500c344790 lint 2019-09-12 01:47:56 -04:00
e3c67755b8 fixup! cursor_shape: check if modep is nonnull 2019-09-11 22:29:50 -04:00
6508215b5c Remove excess <stdint.h> 2019-09-11 22:27:45 -04:00
11fe132dd9 tests: fix system_spec when run with clipboard manager (#10956)
* tests: move os_kill to functional helpers

* tests: fix system_spec when run with clipboard manager

Replaces "xclip" with a dedicated helper program.

Fixes: https://github.com/neovim/neovim/issues/4900#issuecomment-501866842
2019-09-12 03:26:35 +02:00
108763171f build: dependencies: specify minimum libvterm (#10997)
libvterm now advertises a version number, so we can specify the minimum
required version.  And this is necessary because there were breaking
changes in its API.

ref 2a590e2293
ref https://github.com/neovim/neovim/issues/10991
2019-09-12 03:25:25 +02:00
b78be5bd08 rename: SplitEvent => MulticastEvent #10989
"Multicast" is perhaps a more conventional name for the concept.
"One-shot" is the conventional name for how the event is (currently)
scheduled.
2019-09-11 15:39:23 -07:00
7652904f79 eval: wait(): always spin up dummy-timer #10990
This avoids getting "stuck".  If user actually _wants_ to get stuck
forever, they could use `:sleep` or specify a really big `interval`.
2019-09-11 12:56:46 -07:00
c8223e1618 Merge #10995 'paste: fix paste in terminal mode' 2019-09-11 12:45:28 -07:00
ffa029ad1c paste: fix paste in terminal mode 2019-09-11 20:12:29 +02:00
6aed19b2bb Merge #10986 'doc' 2019-09-11 00:17:31 -07:00
06bfb07e35 doc
fix #10127
fix #5972
2019-09-11 00:10:27 -07:00
1adbdb397d doc: nvim_ui_pum_set_height [ci skip] 2019-09-10 23:27:00 -07:00
b735583377 Merge #10969 from janlazo/clang_pvs 2019-09-10 20:15:44 -07:00
2ed7cda8cd spell: assert nonull pointers 2019-09-10 22:19:49 -04:00
b8a338ee6a cursor_shape: check if modep is nonnull 2019-09-10 22:19:49 -04:00
f81619aafe regexp: assert nonnull pointer for regnext() 2019-09-10 21:54:05 -04:00
4a6ab3494a quickfix: fix pvs/v547 warning 2019-09-10 21:54:04 -04:00
7bb858c39c Merge pull request #9494 from leonerd/leonerd/vterm-color-struct
Changes for new VTermColor struct (libvterm 0.1)
2019-09-10 21:25:47 +02:00
e11dd1110f terminal: fix rgb rendering of palette colors
simplify handling of default colors

nvim is always true color internally, remove ui_rgb_attached() check.

Fix "runtime termguicolors" test. The test actually reflected broken behavior
in (parent) nvim: nvim_ui_set_option("rgb", true) was not respected by existing
:terminal instances, so all 16-palette colors became dark blue.
2019-09-10 20:12:01 +02:00
0bb466f0fc lint / test grouping 2019-09-10 20:09:38 +02:00
d57250ae64 Changes for new VTermColor struct 2019-09-10 20:09:38 +02:00
2a590e2293 bump libvterm to 0.1 + memleak patch 2019-09-10 20:09:37 +02:00
477113d1ae vim-patch:8.0.1309: cannot use 'balloonexpr' in a terminal #10983
(Port some refactoring, but ignore "balloon" changes.)

Problem:    Cannot use 'balloonexpr' in a terminal.
Solution:   Add 'balloonevalterm' and add code to handle mouse movements in a
            terminal. Initial implementation for Unix with GUI.
51b0f3701e
2019-09-09 21:23:44 -07:00
a2c98a2938 Merge #10982 from janlazo/vim-8.0.0937
vim-patch:8.0.{937,941}
2019-09-09 18:24:47 -07:00
a84366439f vim-patch:8.0.0941: existing color schemes don't like StatusLineTerm
Problem:    Existing color schemes don't work well with StatusLineTerm.
Solution:   Don't use "reverse", use fg and bg colors.  Also add
            StatusLineTermNC.
05fbfdcda4
2019-09-09 20:33:18 -04:00
66e7a6c9fd vim-patch:8.0.0937: user highlight groups not adjusted for terminal
Problem:    User highlight groups are not adjusted for StatusLineTerm.
Solution:   Combine attributes like for StatusLineNC.
bce4f62d30
2019-09-09 20:28:01 -04:00
0809533b88 Merge #10546 'doc' 2019-09-09 14:42:20 -07:00
853683e72a provider: has("python3_dynamic") et al. #10980
Vim added more flags for testing yet more dimensions of its Python
situation.  Handle those in eval_has_provider().

vim-patch:8.0.1436: not enough information about what Python version may work
Problem:    Not enough information about what Python version may work.
Solution:   Add "python_compiled", "python3_compiled", "python_dynamic" and
            "python3_dynamic" values for has().

ref: https://github.com/neovim/neovim/pull/10942#issuecomment-529479500
2019-09-09 10:54:07 -07:00
e5d5fc0857 doc/API/lua: detaching Lua buffer callbacks 2019-09-09 10:52:12 -07:00
a3849abc31 doc: StatusLineTerm, StatusLineTermNC
N/A:
vim-patch:8.0.0941: existing color schemes don't like StatusLineTerm
vim-patch:8.0.0937: user highlight groups not adjusted for terminal
vim-patch:8.0.0825: not easy to see that a window is a terminal window
2019-09-09 10:52:12 -07:00
456f1d4bdd doc: |api-fast| [ci skip] 2019-09-09 10:52:12 -07:00
225941ddd0 version.c: update [ci skip] #10961
vim-patch:8.1.1680: the command table is not well aligned
vim-patch:8.1.1994: MS-Windows: cannot build with eval but without cscope
vim-patch:8.1.2002: version number 2000 missing
vim-patch:8.1.2003: MS-Windows: code page 65001 is not recognized
vim-patch:8.1.2006: build failure with huge features but without channel feature
vim-patch:8.1.2015: terminal altscreen test still fails sometimes
vim-patch:8.1.2016: terminal altscreen test now fails on MS-Windows

`beval` patches are N/A now. See https://github.com/neovim/neovim/pull/10942#issuecomment-528029830
vim-patch:8.0.1366: 1ad022a9b8
vim-patch:8.1.0444: unnecessary check for NULL pointer
vim-patch:8.1.0652: freeing memory for balloon eval too early
vim-patch:8.1.1302: v:beval_text is not tested in Visual mode
vim-patch:8.1.1648: MS-Windows: build error with normal feaures
vim-patch:8.1.1650: warning for using uninitialized variable
vim-patch:8.1.1654: GUI: screen updates from 'balloonexpr' are not displayed
vim-patch:8.1.1708: Coverity warns for using uninitialized variable
2019-09-09 10:03:59 -07:00
4b2a2c332c doc: eliminate msgpack_rpc.txt [ci skip]
- Migrate msgpack_rpc.txt into api.txt, develop.txt.
- fix #10740: Remove warning about "avoid hardcoding the type codes".
2019-09-09 09:53:19 -07:00
81c3fa6c9d doc 2019-09-09 09:53:19 -07:00
05c668f684 paste: fix normal-mode paste by different approach #10976
Forcing insert-mode after the first paste-chunk seems to work, as an
alternative to a9e2bae0eb (insert-before-cursor).

NB: Dot-repeat needs to match the original action.  Since a9e2bae0eb
changed paste to insert-before-cursor, dot-repeat must also. But that
makes dot-repeat unpleasant/unusual.
2019-09-09 08:29:49 -07:00
9e0ce1a158 Merge #10973 'vim-patch:8.1.1197' 2019-09-08 20:58:36 -07:00
8dde9b58e5 vim-patch:8.1.1197: when starting with multiple tabs file messages is confusing
Problem:    When starting with multiple tabs file messages is confusing.
Solution:   Set 'shortmess' when loading the other tabs. (Christian Brabandt)
c75e812623
2019-09-08 23:16:54 -04:00
74c362cec0 Merge #10975 'paste: fix various bugs' 2019-09-08 18:40:46 -07:00
a9e2bae0eb paste: insert before cursor always
Inserting "after" the cursor in Normal-mode, for big paste-streams, is
not reliable: sometimes the text "after" the cursor ends up in the
middle of the pasted text.  Maybe the cursor position is not updated?

To avoid weird behavior, always paste "before".  Maybe nvim_put() or
vim.paste() can be fixed more properly later.
2019-09-08 16:42:11 -07:00
acd2729573 paste: do not clobber msg area for small pastes 2019-09-08 15:37:32 -07:00
0dea44f93c paste/cmdline: discard all chunks after first line
Problem:  If multiple paste "chunks" are streamed, chunks after the
          first line are pasted into the buffer.
Solution: Check for cmdline-mode for all chunks in a paste-stream.
2019-09-08 15:37:32 -07:00
ccd947ca4a vim-patch:8.0.0970: passing invalid highlight id #10972
(We don't implement StatusLineTerm{NC}, but this patch seems generally relevant.)

Problem:    if there is no StatusLine highlighting and there is StatusLineNC
            or StatusLineTermNC highlighting then an invalid highlight id is
            passed to combine_stl_hlt(). (Coverity)
Solution:   Check id_S to be -1 instead of zero.
d6a7b3e6bb
2019-09-08 15:10:18 -07:00
d91f4cd7d0 paste: reset 'paste' option immediately #10974
- Workaround #10966: 'paste' option is not always reset.
- In any case there's not much reason to wait until phase=3, because
  pasting in cmdline-mode skips lines after the first line (thus the
  `:set paste .. :set nopaste` dance happens only ~once).
2019-09-08 14:58:47 -07:00
77a93957d3 Merge pull request #10777 from glacambre/fix_10042
ex_getln.c: fix <S-Tab> not triggering Pmenu when wildoptions=pum
2019-09-08 22:42:24 +02:00
554566ccea vim-patch:8.1.2007: no test for what 8.1.1926 fixes #10970
Problem:    No test for what 8.1.1926 fixes.
Solution:   Add a test case.
fca068b977
2019-09-08 12:22:55 -07:00
958ca938b4 ex_getln.c: fix <S-Tab> not triggering pum when wildoptions=pum (#10042)
Some of the logic that was present for <Tab> was missing from <S-Tab>.

Closes https://github.com/neovim/neovim/issues/10042.
2019-09-08 20:47:22 +02:00
288526ae73 Merge pull request #10475 from erw7/fix-ext-popupmenu
Fix some keys not working in ext_popupmenu
2019-09-08 20:42:32 +02:00
83632022f8 Merge pull request #10959 from bfredl/resizequeue
fix crash on :!tmux split, redraw after resize in pager
2019-09-08 16:50:45 +02:00
c705e3fb0b update tests for new resize behavior (resize at pager, but not at :!cmd) 2019-09-08 15:24:14 +02:00
19993bca4a rpc: allow handling of nvim_ui_try_resize at the pager
This makes external UI behave consistenly with TUI w.r.t resizes.
Which will be needed anyway as TUI will use the external UI protocol
soon.
2019-09-08 15:24:14 +02:00
bf9ff5148a messages: redraw after resize in pager
note: does not "return" space at the bottom to the caller
2019-09-08 15:24:14 +02:00
f72c7b0b3a messages: batch draw :map 2019-09-08 15:24:14 +02:00
e6b7613e89 refactor: allow us to process a child queue only while waiting on input 2019-09-08 15:24:14 +02:00
fa90f6cdaa tests: fix flaky "TUI FocusGained/FocusLost in terminal-mode" #10754
* longer timeout with first expect
* Wait for :term to be ready

Failure seen on quickbuild (note the "retry() attempts: 1"):

    09:41:07,627  INFO  - # test/functional/terminal/tui_spec.lua @ 437: TUI FocusGained/FocusLost in terminal-mode
    09:41:07,627  INFO  - not ok 2976 - TUI FocusGained/FocusLost in terminal-mode
    09:41:07,627  INFO  - # test/functional/terminal/tui_spec.lua @ 437
    09:41:07,627  INFO  - # Failure message: ./test/functional/helpers.lua:403:
    09:41:07,627  INFO  - # retry() attempts: 1
    09:41:07,627  INFO  - # ./test/functional/ui/screen.lua:579: Row 1 did not match.
    09:41:07,627  INFO  - # Expected:
    09:41:07,627  INFO  - # |*{1:r}eady $ |
    09:41:07,627  INFO  - # |[Process exited 0] |
    09:41:07,627  INFO  - # | |
    09:41:07,627  INFO  - # | |
    09:41:07,627  INFO  - # | |
    09:41:07,627  INFO  - # |gained |
    09:41:07,628  INFO  - # |{3:-- TERMINAL --} |
    09:41:07,628  INFO  - # Actual:
    09:41:07,628  INFO  - # |*{1: } |
    09:41:07,628  INFO  - # |{4:~ }|
    09:41:07,628  INFO  - # |{4:~ }|
    09:41:07,628  INFO  - # |{4:~ }|
    09:41:07,628  INFO  - # |{5:[No Name] }|
    09:41:07,628  INFO  - # | |
    09:41:07,628  INFO  - # |{3:-- TERMINAL --} |
    09:41:07,628  INFO  - #
    09:41:07,628  INFO  - # To print the expect() call that would assert the current screen state, use
    09:41:07,628  INFO  - # screen:snapshot_util(). In case of non-deterministic failures, use
    09:41:07,628  INFO  - # screen:redraw_debug() to show all intermediate screen states.
    09:41:07,628  INFO  - # stack traceback:
    09:41:07,628  INFO  - #     ./test/functional/helpers.lua:403: in function 'retry'
    09:41:07,628  INFO  - #     test/functional/terminal/tui_spec.lua:441: in function <test/functional/terminal/tui_spec.lua:437>
2019-09-07 22:40:38 -07:00
55b1126a22 Add nvim_ui_pum_set_height to api 2019-09-08 12:25:49 +09:00
3dbd94dafa Merge #10963 from janlazo/vim-8.1.1988
vim-patch:8.0.1550,8.1.{1716,1988}
2019-09-07 19:28:15 -07:00
dd7355358e Merge #10962 from justinmk/vim-088e8e344352
vim-patch: runtime updates
2019-09-07 19:22:33 -07:00
6692c0958f shada: initialize jumplist before search pattern (#10964)
Since 8b8ecf4, the shada module loads files in the jumplist to properly
clear duplicates. This can trigger some autocommands, which in turn
saves and restores search and substitute patterns, freeing the previous
strings in "spats" which are held in "wms" as well (heap-use-after-free).
To avoid this, initialize the jumplist in "wms" before search patterns.
2019-09-07 18:02:29 -07:00
15459f9255 vim-patch:8.1.1716: old style comments are wasting space
Problem:    Old style comments are wasting space
Solution:   Use new style comments in option header file.
ab0a789808
2019-09-07 13:09:15 -04:00
4add2f4f89 vim-patch:8.0.1550: various small problems in source files
Problem:    Various small problems in source files.
Solution:   Fix the problems.
792f0e3659
2019-09-07 10:35:09 -04:00
a96b3677c6 vim-patch:8.1.1988: :startinsert! does not work the same way as "A"
Problem:    :startinsert! does not work the same way as "A".
Solution:   Use the same code to move the cursor. (closes vim/vim#4896)
8d3b51084a
2019-09-06 23:27:14 -04:00
8f2557ad19 vim-patch:06fe74aef726
Runtime files update.
06fe74aef7
2019-09-06 18:44:52 -07:00
0430a1ba88 vim-patch:56c860c315c5
Update runtime files.
56c860c315
2019-09-06 18:35:06 -07:00
c044ea0909 vim-patch:088e8e344352
Update runtime files.
088e8e3443
2019-09-06 18:30:35 -07:00
158b78062e Merge #10932 'test: Eliminate expect_err' 2019-09-06 18:16:57 -07:00
7e1c959861 test: Eliminate expect_err
Eliminate `expect_err` in favor of `pcall_err` + `eq` or `matches`.
2019-09-06 17:19:07 -07:00
af946046b9 test: Rename meth_pcall to pcall_err
- Rename `meth_pcall`.
- Make `pcall_err` raise an error if the function does not fail.
- Add `vim.pesc()` to treat a string as literal where a Lua pattern is
  expected.
2019-09-06 17:19:07 -07:00
638f2b6dee termdebug.vim: use style=minimal in popups #10904
- line numbers weren't hidden (which means the variable is cut off, as the number column isn't considered when calculating the width of the float).
- spurious duplicate line to disable signcolumn, and nonumber was indeed missed when porting the original implementation to Neovim.
2019-09-06 14:48:03 -07:00
1f119d4153 version.c: update [ci skip] #10942
vim-patch:8.0.0396: 'balloonexpr' only works synchronously
vim-patch:8.0.0932: terminal may not use right characters for BS and Enter
vim-patch-8.0.0934: change to struts.h missing in patch
vim-patch:8.0.0956: scrolling in a terminal window has flicker
vim-patch:8.0.0976: cannot send lines to a terminal job
vim-patch:8.0.1002: unnecessarily updating screen after timer callback
vim-patch:8.0.1096: terminal window in Normal mode has wrong background
vim-patch:8.0.1097: background color wrong if job changes background color
vim-patch:8.0.1102: terminal window does not use Normal colors
vim-patch:8.0.1293: setting a breakpoint in the terminal debugger sometimes fails
vim-patch:8.0.1309: cannot use 'balloonexpr' in a terminal
vim-patch:8.0.1312: balloon_show() only works in terminal when compiled with GUI
vim-patch:8.0.1318: terminal balloon only shows one line
vim-patch:8.0.1320: popup test fails on GUI-only build
vim-patch:8.0.1321: can't build huge version with Athena
# VIM_SERVERNAME is NA because we will have NVIM env var:
vim-patch:8.0.1330: MS-Windows: job in terminal can't get back to Vim
vim-patch:8.0.1346: crash when passing 50 char string to balloon_split()
vim-patch:8.0.1810: buffer of a terminal only updated in Terminal-Normal mode
vim-patch:8.0.1815: crash with terminal window and with 'lazyredraw' set
vim-patch:8.0.1842: popup menu inside terminal window isn't cleared

vim-patch:8.1.1973: cannot build without the quickfix feature
vim-patch:8.1.1974: Coverity warns for using pointer as array
vim-patch:8.1.1975: MS-Windows GUI responds slowly to timer
vim-patch:8.1.1976: Travis log always shows test output
vim-patch:8.1.1990: cannot build with eval but without cscope
vim-patch:8.1.1991: still cannot build with eval but without cscope
2019-09-06 14:42:31 -07:00
16b64c339e build: rename CMake find modules for LibFindMacros #10928
We are using "LIBFOO" prefixes for `LIBFOO_INCLUDE_DIRS` etc, and
therefore need to use this for the PREFIX with LibFindMacros also, so
that `"${${PREFIX}_FIND_VERSION}"` gets handled there properly.

The alternative would be to either manually handle/set the upper/mixed case
variants of those variable additionally, which is not as easy.

Keeping the existing names is useful for packagers.

Before this the version requirements with
`find_package(Unibilium 2.0 REQUIRED)` was not handled (a49cf5126), and
it prepares for using a required version with libvterm
(initially/wrongly ported in 1896c72a5).
2019-09-06 14:39:41 -07:00
754ea8d27e runtime: :TOhtml workaround for missing 'vts' option #10960
Hot fix for 0.4
This commit should be reverted when &vts option is added.

close #10831
2019-09-06 12:10:46 -07:00
8db62ac57d build: cmake: GetCompileFlags: include CMAKE_C_FLAGS (#10957)
Calls `GetCompileFlags` from `src/nvim` directory, to include
`--coverage` (and any others).
2019-09-06 20:36:05 +02:00
fd4636f1b9 Merge pull request #10930 from bfredl/pagerthrottle
fixes for pager glitches and crashes
2019-09-06 20:28:26 +02:00
837f31c0b4 test: properly test missing clears after scroll
NB: happened to be irrelevant to the present failure, which
only occured with the compositor and not exteral UI for some reason
2019-09-06 19:39:26 +02:00
1fc6489f30 test: add tests for pager glitches and crashes 2019-09-06 19:38:27 +02:00
5c8a57da81 messages: fix crashes with scrollback 2019-09-06 19:38:07 +02:00
72d7099abd messages: fix missing MsgArea highlighting on/after "-- more --" message 2019-09-06 19:38:07 +02:00
d04a43fcaf messages: fix cut lines in scrollback upon overflow 2019-09-06 19:12:41 +02:00
fd8b00bacd tests: do_rmdir(): improve error handling #10955 2019-09-06 09:19:57 -07:00
1dab52f878 vim-patch:8.0.1332: enhance quickfix highlighting #10259
Problem:    Highlighting in quickfix window could be better. (Axel Bender)
Solution:   Use the qfSeparator highlight item. (Yegappan Lakshmanan)
93a32e2ec4

This adds `syn_name2attr` already (from previous patch 8.0.1123,
vim/vim@1b9645de3).
2019-09-06 09:17:24 -07:00
64caeb13e6 stdpaths_get_xdg_var: consider empty env vars #10953
Without this "sysinit uses VIM if XDG_CONFIG_DIRS unset" fails with an
existing `/etc/xdg/nvim/sysinit.vim` file, because `XDG_CONFIG_DIRS=` is
not considered, but the default ("/etc/xdg") used then.
2019-09-06 09:05:30 -07:00
fecbafb29e build: fail with CLANG_TSAN + USE_GCOV #10958
This is better than skipping it silently.
2019-09-06 08:41:04 -07:00
1a783b5ad6 screen: redrawdebug=nothrottle 2019-09-06 09:48:57 +02:00
8b06231612 Merge #10869 'vim-patch:8.1.{0309,0362,0365,0515,1946}' 2019-09-05 14:10:32 -07:00
096212d52c test/wildmode_spec: fix flaky test (#10947)
* test/wildmode_spec: fix flaky test

a00eb23c27 fixed one race, but not this one:

    [  ERROR   ] test/functional/ui/wildmode_spec.lua @ 84: 'wildmenu' is preserved during :terminal activity
    test/functional/ui/screen.lua:587: Row 1 did not match.
    Expected:
      |*                         |
      |                         |
      |                         |
      |define  jump  list  >    |
      |:sign define^             |
    Actual:
      |*0: !terminal_output!     |
      |                         |
      |                         |
      |define  jump  list  >    |
      |:sign define^             |
    To print the expect() call that would assert the current screen state, use
    screen:snapshot_util(). In case of non-deterministic failures, use
    screen:redraw_debug() to show all intermediate screen states.
    stack traceback:
            test/functional/ui/screen.lua:587: in function '_wait'
            test/functional/ui/screen.lua:370: in function 'expect'
            test/functional/ui/wildmode_spec.lua:22: in function 'expect_stay_unchanged'
            test/functional/ui/wildmode_spec.lua:92: in function <test/functional/ui/wildmode_spec.lua:84>

* fixup! test/wildmode_spec: fix flaky test
2019-09-05 10:22:27 -07:00
81eb0d3644 vim-patch:8.1.0561: MSCV error format has changed #10952
This was marked as NA, but maybe we want the Windows-specific
default 'errorformat'?

9719568533
2019-09-05 10:20:46 -07:00
607d610d06 test/shada_spec: avoid exit_event race #10951
Doing clear() multiple times in quick succession provokes the
`exit_event` race described in #8813.

- Avoid it by removing unnecessary reset() call.
- Replace unnecessary nested describe() blocks with it() blocks.

ref d4a0b6c4e1
2019-09-05 09:48:34 -07:00
79ea47d478 Merge pull request #10451 from bfredl/floatbuf
anchor float to buffer position
2019-09-05 12:50:38 +02:00
dd18cc4b40 fixup! test/wildmode_spec: fix flaky test 2019-09-04 19:03:01 -07:00
93deb1a062 test/wildmode_spec: fix flaky test
a00eb23c27 fixed one race, but not this one:

    [  ERROR   ] test/functional/ui/wildmode_spec.lua @ 84: 'wildmenu' is preserved during :terminal activity
    test/functional/ui/screen.lua:587: Row 1 did not match.
    Expected:
      |*                         |
      |                         |
      |                         |
      |define  jump  list  >    |
      |:sign define^             |
    Actual:
      |*0: !terminal_output!     |
      |                         |
      |                         |
      |define  jump  list  >    |
      |:sign define^             |
    To print the expect() call that would assert the current screen state, use
    screen:snapshot_util(). In case of non-deterministic failures, use
    screen:redraw_debug() to show all intermediate screen states.
    stack traceback:
            test/functional/ui/screen.lua:587: in function '_wait'
            test/functional/ui/screen.lua:370: in function 'expect'
            test/functional/ui/wildmode_spec.lua:22: in function 'expect_stay_unchanged'
            test/functional/ui/wildmode_spec.lua:92: in function <test/functional/ui/wildmode_spec.lua:84>
2019-09-04 17:26:40 -07:00
632ee8d2ed Merge #10946 from justinmk/vim-patchhhh
vim-patch:8.1.1498,8.1.1501: b:changedtick
2019-09-04 17:03:57 -07:00
d5162afa2a anchor float to buffer position
vim-patch:8.1.1645: cannot use a popup window for a balloon
2019-09-04 23:57:02 +02:00
d401539012 vim-patch:8.1.1501: new behavior of b:changedtick not tested
Problem:    New behavior of b:changedtick not tested.
Solution:   Add a few test cases. (Daniel Hahler)
260addf795
2019-09-04 21:21:28 +02:00
83c5701fe6 vim-patch:8.1.1498: ":write" increments b:changedtick even though nothing changed
Problem:    ":write" increments b:changedtick even though nothing changed.
            (Daniel Hahler)
Solution:   Only increment b:changedtick if the modified flag is reset.
c024b46678
2019-09-04 21:21:28 +02:00
d7aea13fee tests: scrollback_spec: use shell-test instead of awk (#10914)
Ref: #10804
Ref: b64af88
2019-09-04 20:01:38 +02:00
bd1158f3ab version.c: update [ci skip] #10308
vim-patch:8.0.1671: crash when passing non-dict argument as env to job_start()
vim-patch 8.1.1669: Travis: test results section is closed even when failed
vim-patch:8.1.0424: test output is very verbose, loading CI log is slow (vim/vim@e76d7a6)
N/A: only for sign icons (gvim, ref: #10834)
vim-patch:8.1.1587: redraw problem when sign icons in the number column
vim-patch:8.1.1910: redrawing too much when toggling 'relativenumber'
vim-patch:8.0.0910: cannot create a terminal in the current window
vim-patch:8.0.0912: cannot run a job in a hidden terminal
vim-patch:8.0.0916: cannot specify properties of window for terminal open
vim-patch:8.0.0917: MS-Windows:CTRL-C handling in terminal window is wrong
vim-patch:8.0.0918: cannot get terminal window cursor shape or attributes
vim-patch:8.0.0960: job in terminal does not get CTRL-C
vim-patch:8.0.1000: cannot open a terminal without running a job in it
vim-patch:8.0.1035: sending buffer lines to terminal doesn't work on MS-Windows
vim-patch:8.0.1051: cannot run terminal with spaces in argument
vim-patch:8.0.1060: when imstyle is one, mapping <Left> breaks preediting
vim-patch:8.0.1074: ":term NONE" does not work on MS-Windows
vim-patch:8.0.1113: can go to Insert mode from Terminal-Normal mode
vim-patch:8.0.1170: using termdebug results in 100% CPU time
vim-patch:8.0.1174: Mac Terminal.app has wrong color for white
vim-patch:8.0.1194: actual fg and bg colors of terminal are unknown
vim-patch:8.0.1203: terminal window mistreats composing characters
vim-patch:8.0.1240: MS-Windows: term_start() does not support environment
vim-patch:8.0.1244: search test does not work correctly on MS-Windows
vim-patch:8.0.1264: terminal debugger gets stuck in small window
vim-patch:8.0.1276: key lost when window closed in exit callback
vim-patch:8.0.1295: cannot automatically get a server name in a terminal
vim-patch:8.0.1297: +autoservername does not show enabled on MS-Windows
vim-patch:8.0.1319: can't build GUI on MS-Windows
vim-patch:8.0.1341: 'imactivatefunc' test fails on MS-Windows
vim-patch:8.0.1344: using 'imactivatefunc' in the GUI does not work
vim-patch:8.0.1349: options test fails when using Motif or GTK GUI
vim-patch:8.0.1436: not enough information about what Python version may work
vim-patch:8.0.1440: terminal window: some vterm responses are delayed
vim-patch:8.0.1452: terminal test fails on some systems
vim-patch:8.0.1453: terminal test fails on some slow terminals
vim-patch:8.0.1527: screen dump test fails on MS-Windows
vim-patch:8.0.1551: on Mac 'maxmemtot' is set to a weird value
vim-patch:8.0.1568: can't build on older Mac, header file is missing
vim-patch:8.0.1572: Mac: getting memory size doesn't work everywhere
vim-patch:8.0.1596: no autocommand specifically for opening a terminal window
vim-patch:8.0.1599: no error message when gdb does not support debugger
vim-patch:8.0.1604: paste test may fail if $DISPLAY is not set
vim-patch:8.0.1612: need to close terminal after shell stopped
vim-patch:8.0.1641: job in terminal can't communicate with Vim
vim-patch:8.0.1647: terminal API may call any user function
vim-patch:8.0.1655: outdated gdb message in terminal debugger unclear
vim-patch:8.0.1671: crash when passing non-dict argument as env to job_start()
vim-patch:8.0.1713: terminal debugger doesn't handle arguments
vim-patch:8.0.1759: memory leak from duplicate options
vim-patch:8.0.1797: terminal window is redrawn too often
vim-patch:8.0.1850: todo items in source code not visible for users

vim-patch:8.1.0055: complete test has wrong order of arguments
vim-patch:8.1.0081: the terminal debugger doesn't adjust to changed 'background'
vim-patch:8.1.0100: terminal debugger: error when setting a watch point
vim-patch:8.1.0195: terminal debugger commands don't always work
vim-patch:8.1.0196: terminal debugger error with .gdbinit file
vim-patch:8.1.0359: no clue what test failed when using a screendump twice
vim-patch:8.1.0371: argument types for select() may be wrong
vim-patch:8.1.0382: some make programs can't handle "xdiff/../"
vim-patch:8.1.0423: MS-Windows: using dup-close for flushing a file
vim-patch:8.1.0445: setting 'term' does not store location for termcap options
vim-patch:8.1.0451: Win32 console: keypad keys don't work
vim-patch:8.1.0457: win32 console: key mappings don't work
vim-patch:8.1.0462: when using ConPTY Vim can be a child process
vim-patch:8.1.0465: client-server test fails
vim-patch:8.1.0481: when "Terminal" highlight is reverted cursor doesn't show
vim-patch:8.1.0486: can't build in MS-Windows
vim-patch:8.1.0491: if a terminal dump has CR it is considered corrupt
vim-patch:8.1.0525: terminal test skips part on Windows
vim-patch:8.1.0526: running out of signal stack in RealWaitForChar
vim-patch:8.1.0561: MSCV error format has changed
vim-patch:8.1.0580: invalid memory access when using text properties
vim-patch:8.1.0590: when a job ends the closed channels are not handled
vim-patch:8.1.0591: channel sort test is flaky
vim-patch:8.1.0603: the :stop command is not tested
vim-patch:8.1.0611: crash when using terminal with long composing characters
vim-patch:8.1.0618: term_getjob() does not return v:null as documented
vim-patch:8.1.0625: MS-Windows: terminal test fails in white console
vim-patch:8.1.0631: test for :stop fails on Arch
vim-patch:8.1.0647: MS-Windows: balloon_show() does not handle wide characters
vim-patch:8.1.0657: get error for using regexp recursively
vim-patch:8.1.0659: build failure without the sign feature
vim-patch:8.1.0666: text property test fails
vim-patch:8.1.0692: if a buffer was deleted a channel can't write to it
vim-patch:8.1.0693: channel test fails sometimes
vim-patch:8.1.0705: :colorscheme isn't tested enough
vim-patch:8.1.0708: third argument for redrawWinline() is always FALSE
vim-patch:8.1.0724: build for MinGW fails
vim-patch:8.1.0731: JS encoding does not handle negative infinity
vim-patch:8.1.0760: no proper test for using 'termencoding'
vim-patch:8.1.0774: VMS build is missing the blob file
vim-patch:8.1.0778: terminal test fails on MS-Windows
vim-patch:8.1.0780: terminal test fails on Mac
vim-patch:8.1.0781: build error when using if_xcmdsrv.c
vim-patch:8.1.0782: Win32: cursor blinks when Vim is not active
vim-patch:8.1.0795: cannot build without popup menu
vim-patch:8.1.0796: MS-Windows 7: problem with named pipe on channel
vim-patch:8.1.0799: calling deleted function; test doesn't work on Mac
vim-patch:8.1.0812: Unicode 16 feature is not useful
vim-patch:8.1.0823: not sufficient testing of xxd
vim-patch:8.1.0827: missing dependency in Makefile
vim-patch:8.1.0831: xxd test fails if man page has dos fileformat
vim-patch:8.1.0835: GUI build fails on MS-Windows
vim-patch:8.1.0847: may use terminal after it was cleaned up
vim-patch:8.1.0848: cannot build with Ruby 1.8
vim-patch:8.1.0860: debug lines left in the code
vim-patch:8.1.0861: building with MinGW and static libc doesn't work
vim-patch:8.1.0866: build file dependencies are outdated
vim-patch:8.1.0867: cannot build Python interface with Python 2.4
vim-patch:8.1.0871: build error when building with Ruby 2.6.0
vim-patch:8.1.0872: confusing condition
vim-patch:8.1.0889: MS-Windows: a channel write may hang
vim-patch:8.1.0898: a messed up rgb.txt can crash Vim
vim-patch:8.1.0900: ConPTY many crash with 32-bit build
vim-patch:8.1.0904: USE_LONG_FNAME never defined
vim-patch:8.1.0915: fsync() may not work properly on Mac
vim-patch:8.1.0919: compiler warnings
vim-patch:8.1.0920: in Terminal-Normal mode job output messes up the window
vim-patch:8.1.0921: terminal test sometimes fails; using memory after free
vim-patch:8.1.0922: terminal scrollback test is flaky
vim-patch:8.1.0923: terminal dump diff swap does not update file names
vim-patch:8.1.0924: terminal scrollback test still flaky
vim-patch:8.1.0925: terminal scrollback test still still flaky
vim-patch:8.1.0931: vtp_working included in GUI build but unused
vim-patch:8.1.0960: when using ConPTY garbage collection has undefined behavior
vim-patch:8.1.0961: Mac: fsync may fail sometimes
vim-patch:8.1.0964: cannot see in CI why a screenshot test failed
vim-patch:8.1.0981: pasting in terminal insufficiently tested
vim-patch:8.1.0982: update_cursor() called twice in :shell
vim-patch:8.1.0993: ch_read() may return garbage if terminating NL is missing
vim-patch:8.1.1018: window cleared when entering Terminal-Normal twice
vim-patch:8.1.1024: stray log calls in terminal code
vim-patch:8.1.1051: not all ways to switch terminal mode are tested
vim-patch:8.1.1080: when a screendump test fails, moving the file is a hassle
vim-patch:8.1.1102: Win32 exe file contains unused code
vim-patch:8.1.1121: test for term_gettitle() was disabled
vim-patch:8.1.1128: getwinpos() test does not work on MS-Windows
vim-patch:8.1.1129: when making a new screendump test have to create the file
vim-patch:8.1.1132: getwinpos() test fails on MS-Windows
vim-patch:8.1.1141: terminal winpos test fails with very large terminal
vim-patch:8.1.1162: incorrect coverage information; typo in color name
vim-patch:8.1.1168: not all screen update code of terminal is executed in tests
vim-patch:8.1.1170: terminal ANSI color test does not cover all colors
vim-patch:8.1.1172: cursor properties were not fully tested
vim-patch:8.1.1330: using bold attribute in terminal changes the color
vim-patch:8.1.1505: running "make clean" twice gives errors
vim-patch:8.1.1572: compiler warnings with tiny build
vim-patch:8.1.1576: compiler warning for unused argument
vim-patch:8.1.1592: may start file dialog while exiting
vim-patch:8.1.1594: may still start file dialog while exiting
vim-patch:8.1.1595: MS-Windows with VIMDLL: colors wrong in console
vim-patch:8.1.1605: Vim may delay processing messages on a json channel
vim-patch:8.1.1616: build failure with gcc on Amiga
vim-patch:8.1.1618: Amiga-like systems quickly run out of stack
vim-patch:8.1.1621: Amiga: time.h included twice
vim-patch:8.1.1627: header file contains mixed comment style
vim-patch:8.1.1633: cannot generate prototypes with X11 but without GUI
vim-patch:8.1.1635: warnings for unused variables in small version
vim-patch:8.1.1643: sign placement is wrong when 'foldcolumn' is set
vim-patch:8.1.1644: sound test does not work on Travis
vim-patch:8.1.1647: build error with GTK and hangulinput feature
vim-patch:8.1.1653: ubsan warns for possibly passing NULL pointer
vim-patch:8.1.1658: debug statements included in patch
vim-patch:8.1.1661: cannot build with +textprop but without +balloon_eval
vim-patch:8.1.1662: cannot build uninstal.exe with some version of MinGW
vim-patch:8.1.1664: GUI resize may cause changing Rows at a bad time
vim-patch:8.1.1669: Travis: test results section is closed even when failed
vim-patch:8.1.1670: sign column not always properly aligned
vim-patch:8.1.1685: missing file in distributed file list
vim-patch:8.1.1688: old makefiles are no longer useful
vim-patch:8.1.1691: diff test fails on some systems
vim-patch:8.1.1696: MSVC: link command line is too long
vim-patch:8.1.1697: cannot build with MSVC
vim-patch:8.1.1698: Appveyor build with MSVC fails
vim-patch:8.1.1701: Appveyor build with MSVC fails puts progress bar in log
vim-patch:8.1.1702: compiler warning for uninitialized variable
vim-patch:8.1.1706: typo in #ifdef
vim-patch:8.1.1721: build failure with normal features without netbeans interface
vim-patch:8.1.1735: can't build with tiny features
vim-patch:8.1.1744: build error without the conceal feature
vim-patch:8.1.1777: useless checks for job feature in channel test
vim-patch:8.1.1781: Amiga: no builtin OS readable version info
vim-patch:8.1.1788: missing changes in proto file
vim-patch:8.1.1792: the vgetorpeek() function is too long
vim-patch:8.1.1794: tests are flaky
vim-patch:8.1.1815: duplicating info for internal functions
vim-patch:8.1.1817: github contribution text is incomplete
vim-patch:8.1.1825: allocating more memory than needed for extended structs
vim-patch:8.1.1830: Travis does not report error when tests fail
vim-patch:8.1.1836: inaccurate memory estimate for Amiga-like OS
vim-patch:8.1.1847: suspend test is failing
vim-patch:8.1.1848: 'langmap' is not used for CTRL-W command in terminal
vim-patch:8.1.1873: cannot build tiny version
vim-patch:8.1.1876: proto file missing from distribution
vim-patch:8.1.1885: comments in libvterm are inconsistent
vim-patch:8.1.1889: Coverity warns for using a NULL pointer
vim-patch:8.1.1894: not checking for out-of-memory of autoload_name()
vim-patch:8.1.1896: compiler warning for unused variable
vim-patch:8.1.1898: crash when out of memory during startup
vim-patch:8.1.1916: trying to allocate negative amount of memory closing popup
vim-patch:8.1.1942: shadow directory gets outdated when files are added
vim-patch:8.1.1948: mouse doesn't work in Linux console

The following is N/A because of https://github.com/neovim/neovim/pull/10565:
vim-patch:8.1.0537: ui_breakcheck() may be called recursively

vim-patch:8.1.1833
This was merged in Neovim before Vim.

vim-patch:8.1.1479: change included for debugging only
This is N/A iff vim-patch:8.1.0424 is N/A. https://github.com/neovim/neovim/pull/10308#issuecomment-504716053

82d52b229d makes `src/testdir/test_paste.vim` patches N/A.
vim-patch:8.0.0233: paste test fails in the GUI
vim-patch:8.1.1307: cannot reconnect to the X server after it restarted

`bufIsChangedNotTerm` is N/A because of neovim/neovim@2929dbf223
vim-patch:8.0.1382: get "no write since last change" message if terminal is open

vim-patch:8.1.1483 was merged without merging the older patches first so I assume that the following patches are N/A:
vim-patch:8.0.1578: no test for :popup in terminal
2019-09-04 08:37:24 -07:00
7023131223 Log signals handled in deadly_signal (#10939) 2019-09-04 16:44:06 +02:00
3468a466ed Merge #10934 from janlazo/vim-8.0.1752
vim-patch:8.0.{1752,1844},8.1.0145
2019-09-04 07:19:17 -07:00
fe60013fb9 test/mode_spec: increase 'matchtime' to fix flaky
fix #10941
regressed by 7ed2122622
2019-09-04 07:06:12 -07:00
540360a775 test: is_os() #10933
- Move os_name() up to "global helpers".
- Rename it to is_os().
- Make it depend on uname() instead of a running Nvim instance.
2019-09-04 06:58:04 -07:00
9cc8064864 netrw.vim: workaround gx bug #10938
ref vim/vim#4738
2019-09-04 06:51:01 -07:00
e7e2c8d7ff Merge pull request #10926 from blueyed/fix-echon-q
Check got_int in msg_multiline_attr with ex_echo
2019-09-04 15:31:56 +02:00
ac6fd11fa1 only check got_int with ex_echo
Ref: https://github.com/neovim/neovim/pull/10926#discussion_r320706446
2019-09-04 13:30:11 +02:00
4556bb90fa move test 2019-09-04 13:13:39 +02:00
e867ac3e52 Check got_int in msg_multiline_attr
Fixes quitting the pager using `q`.

Fixes https://github.com/neovim/neovim/issues/10923.
2019-09-04 10:50:26 +02:00
1838f6ba76 vim-patch:8.1.0145: test with grep is failing on MS-Windows
Problem:    Test with grep is failing on MS-Windows.
Solution:   Skip the test.
851332ea9c
2019-09-04 02:45:57 -04:00
9d50d033bc vim-patch:8.0.1844: superfluous quickfix code, missing examples
Problem:    Superfluous quickfix code, missing examples.
Solution:   Remove unneeded code.  Add a few examples.  Add a bit more
            testing. (Yegappan Lakshmanan, closes vim/vim#2916)
78ddc06bdd
2019-09-04 02:05:25 -04:00
d3f1eb3024 vim-patch:8.1.1946: memory error when profiling a function without a script ID
Problem:    Memory error when profiling a function without a script ID.
Solution:   Check for missing script ID.  (closes vim/vim#4877)
163588005d
2019-09-04 14:48:21 +09:00
7876f4f218 vim-patch:8.0.1752: qf_set_properties() is to long
Problem:    qf_set_properties() is to long.
Solution:   Refactor the function.  Define INVALID_QFIDX. (Yegappan
            Lakshmanan, closes vim/vim#2812)
a2aa8a2b22
2019-09-04 01:34:18 -04:00
9db60b06a1 vim-patch:8.1.0515: reloading a script gives errors for existing functions
Problem:    Reloading a script gives errors for existing functions.
Solution:   Allow redefining a function once when reloading a script.
ded5f1bed7
2019-09-04 13:40:05 +09:00
e4a4786241 vim-patch:8.1.0365: function profile doesn't specify where it was defined
Problem:    Function profile doesn't specify where it was defined.
Solution:   Show the script name and line number.
4c7b08f640
2019-09-04 13:40:05 +09:00
0e11a106c5 vim-patch:8.1.0309: profiling does not show a count for condition lines
Problem:    Profiling does not show a count for condition lines.  (Daniel
            Hahler)
Solution:   Count lines when not skipping. (Ozaki Kiichi, closes #2499)
7feb35e778
2019-09-04 13:40:05 +09:00
2926a36d91 [squash] Fix errors when porting 2019-09-04 13:40:05 +09:00
4f6df65f02 Change test because maparg was changed to also return lnum 2019-09-04 13:40:04 +09:00
a2e48b556b vim-patch:8.1.0362: cannot get the script line number when executing a function
Problem:    Cannot get the script line number when executing a function.
Solution:   Store the line number besides the script ID. (Ozaki Kiichi,
            closes vim/vim#3362)  Also display the line number with ":verbose set".
f29c1c6aa3
2019-09-04 13:40:04 +09:00
38806f23ed test: enable "exit event follows stdout, stderr" [ci skip] #10929
- Update the test to work with changes since it was originally written.
- Keep the test pending() because it still fails:

      Expected objects to be the same.
      Passed in:
      (table: 0x50ce9e38) {
        [1] = {
          [1] = 'notification'
          [2] = 'stderr'
          [3] = {
            [1] = 0
            [2] = {
              [1] = '' } } }
       *[2] = {
          [1] = 'notification'
          [2] = 'stdout'
         *[3] = {
            [1] = 0
           *[2] = {
             *[1] = '' } } }
        [3] = {
          [1] = 'notification'
          [2] = 'exit'
          [3] = {
            [1] = 0
            [2] = 143 } } }
      Expected:
      (table: 0x50ce9870) {
        [1] = {
          [1] = 'notification'
          [2] = 'stderr'
          [3] = {
            [1] = 0
            [2] = {
              [1] = '' } } }
       *[2] = {
          [1] = 'notification'
          [2] = 'stdout'
         *[3] = {
            [1] = 0
           *[2] = {
             *[1] = 'abcdef' } } }
        [3] = {
          [1] = 'notification'
          [2] = 'stdout'
          [3] = {
            [1] = 0
            [2] = {
              [1] = '' } } } }
2019-09-03 10:25:27 -07:00
8b8ecf44f2 shada/context: fully remove jumplist duplicates #10898
- Always load files when cleaning up jumplist.
  - For Shada: avoids writing duplicate entries, which happens when you read
    from a shada file with duplicate entries (merging the jumplist while
    writing sometimes produces duplicate entries, bug?) and then write right
    away (i.e.: without any `:jumps`, `getjumplist()`, or any jump movement,
    that is: nothing that calls `cleanup_jumplist` with `loadfiles == true`).
  - For Context: avoids non-idempotent behavior for the same reason (i.e.:
    first call to `shada_encode_jumps` does not remove duplicate entries).

- Do not set pcmark when dumping jumplist for Context.
  - Retrieving current Context shouldn't add an entry to the jumplist
    (which will be removed by a subsequent `cleanup_jumplist` anyway, i.e.:
    tail entry matching current position), just act like `getjumplist` for
    instance.
2019-09-03 10:18:24 -07:00
b8f2436feb Merge #10915 'jobwait(): fix race if job exits quickly' 2019-09-03 08:40:54 -07:00
6242bac904 f_jobwait: cleanup 2019-09-03 16:14:29 +02:00
58318af718 jobwait(): fix race if job exits before waiting on it
Problem:  If a job exits while waiting on another job, the on_exit
          handler is queued but f_jobwait() skips it.
Solution: Always do process_wait(), so that handlers are run during
          f_jobwait().

fix #8302

Test case:
    $ BUSTED_ARGS="--repeat=2000 --no-keep-going" TEST_FILE=test/functional/core/job_spec.lua TEST_FILTER=waiting make functionaltest

Failure example (macOS CI):
    FAILED  test/functional/core/job_spec.lua: jobs jobwait will run callbacks while waiting
    test/functional/core/job_spec.lua:606: Expected objects to be the same.
    Passed in:
    (table: 0x1be77c80) {
      [1] = 'notification'
      [2] = 'wait'
     *[3] = {
       *[1] = 3 } }
    Expected:
    (table: 0x1be77d10) {
      [1] = 'notification'
      [2] = 'wait'
     *[3] = {
       *[1] = 4 } }
    stack traceback:
      test/functional/core/job_spec.lua:606: in function <test/functional/core/job_spec.lua:583
2019-09-03 16:14:29 +02:00
a00eb23c27 test/wildmode_spec: fix flaky test
[  ERROR   ] test/functional\ui\wildmode_spec.lua @ 84: 'wildmenu' is preserved during :terminal activity
    test\functional\ui\screen.lua:587: Row 1 did not match.
    Expected:
      |*:sign                    |
      |*define    place          |
      |*jump      undefine       |
      |*list      unplace        |
      |*:sign ^                   |
    Actual:
      |*0: !terminal             |
      |*                         |
      |*^                         |
      |*~                        |
      |*                         |
    stack traceback:
        test\functional\ui\screen.lua:587: in function '_wait'
        test\functional\ui\screen.lua:370: in function 'expect'
        test/functional\ui\wildmode_spec.lua:22: in function 'expect_stay_unchanged'
        test/functional\ui\wildmode_spec.lua:103: in function <test/functional\ui\wildmode_spec.lua:84>
2019-09-03 16:14:29 +02:00
7233433f65 test/job_spec: improve visibility of flaky test
Test sometimes fails on macOS CI:

    FAILED  test/functional/core/job_spec.lua: jobs jobwait will run callbacks while waiting
    test/functional/core/job_spec.lua:606: Expected objects to be the same.
    Passed in:
    (table: 0x1be77c80) {
      [1] = 'notification'
      [2] = 'wait'
     *[3] = {
       *[1] = 3 } }
    Expected:
    (table: 0x1be77d10) {
      [1] = 'notification'
      [2] = 'wait'
     *[3] = {
       *[1] = 4 } }
    stack traceback:
      test/functional/core/job_spec.lua:606: in function <test/functional/core/job_spec.lua:583

Change the test to check if all jobs are starting, not only exiting.
2019-09-03 16:14:29 +02:00
03be64ce2a Merge #10921 from janlazo/vim-8.0.1768
vim-patch:8.0.{1768,1806},8.1.{46,1063}
2019-09-03 04:49:30 -07:00
dcc8fcf0b9 tests: assert:set_parameter('TableFormatLevel', 100) #10925
luassert uses 3 by default, which is often not enough.

Instead of documenting how to increase it, let's use a more fitting
(sane) default of 100 levels.
2019-09-03 04:29:49 -07:00
d000f02bc0 vim-patch.sh: fix "unbound variable" error with Bash < 4.4 [ci skip] (#10917)
Ref: https://github.com/neovim/neovim/pull/10888#issuecomment-526774032
2019-09-03 10:12:02 +02:00
7199f0b3b3 vim-patch:8.1.1063: insufficient testing for wildmenu completion
Problem:    Insufficient testing for wildmenu completion.
Solution:   Extend the test case. (Dominique Pelle, closes vim/vim#4182)
37db642083
2019-09-03 00:07:23 -04:00
c0cb7585cc vim-patch:8.1.0046: loading a session file fails if 'winheight' is big
Problem:    Loading a session file fails if 'winheight' is a big number.
Solution:   Set 'minwinheight' to zero at first.  Don't give an error when
            setting 'minwinheight' while 'winheight' is a big number.
            Fix using vertical splits. Fix setting 'minwinwidth'.
            (closes vim/vim#2970)
1c3c10492a
2019-09-02 19:54:06 -04:00
02f126a275 vim-patch:8.0.1806: InsertCharPre causes problems for autocomplete
Problem:    InsertCharPre causes problems for autocomplete. (Lifepillar)
Solution:   Check for InsertCharPre before calling vpeekc(). (Christian
            Brabandt, closes vim/vim#2876)
39de952577
2019-09-02 18:40:56 -04:00
07b209b1fe vim-patch:8.0.1768: SET_NO_HLSEARCH() used in a wrong way
Problem:    SET_NO_HLSEARCH() used in a wrong way.
Solution:   Make it a function. (suggested by Dominique Pelle,
            closes vim/vim#2850)
451fc7b954
2019-09-02 18:40:56 -04:00
6434a0bf99 Merge pull request #10920 from bfredl/asyncfail
api: make try_end clean-up after an exception properly.
2019-09-02 23:02:58 +02:00
7e07efaff4 api: make try_end clean-up after an exception properly. Fixes #10809
Otherwise `force_abort` will cause an emsg() higher on the stack
to be converted to an exception, even though it is outside any
try/catch.
2019-09-02 23:01:16 +02:00
d3c17d50d8 Merge #10918 from janlazo/vim-8.0.1697
vim-patch:8.0.{1697,1729}
2019-09-02 11:28:12 -07:00
4a60818071 vim-patch:8.0.1729: no comma after last enum item
Problem:    No comma after last enum item.
Solution:   Add a few commas to check if this works for all compilers.  Also
            add a few // comments.
ea3ece405a
2019-09-02 12:19:10 -04:00
55c66d6c19 vim-patch:8.0.1697: various tests are still a bit flaky
Problem:    Various tests are still a bit flaky.
Solution:   Increase the default wait time to five seconds.
769e9d21ac
2019-09-02 12:00:33 -04:00
cb339ca0fb Merge pull request #10913 from bfredl/nomsgsep
screen: fixes for `set display-=msgsep`, fixes #10912
2019-09-02 13:32:25 +02:00
66f4e8aee0 screen: initialize screen properly with early set display-=msgsep
Currently `nvim -u NORC --cmd "set display-=msgsep"` will still allocate the
message grid and remove it just afterwards. While inefficient, we must
make sure update_screen() re-validates the default_grid completely when
this happens.

Fix some invalid logic: don't reallocate msg_grid on resize when the grid is not
used.

Elide a too early ui_flush() on startup, which caused an invalid cursor
position to be used.
2019-09-02 12:39:03 +02:00
099445cc07 Merge #10804 'CI/OpenBSD: functional tests' 2019-09-01 22:56:41 -07:00
7bb029eeef vim-patch:8.0.0858: check if job terminal is running #10908
Problem:    Can exit while a terminal is still running a job.
Solution:   Consider a buffer with a running job like a changed file.
eb44a68b42
2019-09-01 22:54:49 -07:00
ead39d6ce6 test/uname(): always lowercase 2019-09-01 22:49:33 -07:00
7d20907724 test/OpenBSD: skip some tests
Temporary workaround to unblock CI for OpenBSD.
2019-09-01 22:49:33 -07:00
605f05f635 test: shell-test.c: flush all streams 2019-09-01 22:49:33 -07:00
78ec7981c8 screen.lua: dump payload on handler failure
For debugging failures like:

    test/functional/helpers.lua:240: test/functional/ui/screen.lua:898:
    bad argument #1 to 'unpack' (table expected, got number)

    test/functional/helpers.lua:240: test/functional/ui/screen.lua:708:
    attempt to index local 'item' (a number value)

ref #10804
2019-09-01 22:49:33 -07:00
c062149d5b test: "can have two timers": retry()
ref #10768
2019-09-01 22:49:33 -07:00
b64af88c84 CI/OpenBSD: run functional tests
Adapt some tests for OpenBSD:

- scrollback_spec:
  - seq(1) is not available on OpenBSD: we'd use jot(1).
  - Instead use a (hopefully) portable awk(1) snippet.
- channels_spec
- job_spec
- tui_spec
2019-09-01 22:49:33 -07:00
299331490e API: nvim_buf_set_lines: handle 'nomodifiable' #10910 2019-09-01 22:04:20 -07:00
5f23a3dbcf vim-patch:8.0.1653: screen dump is made too soon (#10911)
Problem:    Screen dump is made too soon.
Solution:   Wait until the ruler is displayed. (Ozaki Kiichi, closes vim/vim#2755)
1834d37396
2019-09-02 06:24:34 +02:00
d1bed81ad8 PVS/V547: Expression is always false
ll_get_or_alloc_list() never fails because OOM is an abort condition.
2019-09-02 04:50:22 +02:00
fb19aeeb33 API: make nvim_win_set_option() set window-global, not buffer-local #9110
NB: the `!(flags & SOPT_GLOBAL)` exception is for 'statusline'.
Because `:set statusline=...` sets the global value for _all_ windows,
`:setlocal` is the best we can do there. This is a one-of-a-kind option
that doesn't work like any other option.
2019-09-01 19:38:50 -07:00
b10d703213 Merge #10896 'paste: one undo-block' 2019-09-01 19:12:13 -07:00
8560bafc6c paste: redraw at end
Attempt to fix test failure since 976c6667e1 removed per-chunk redraw:

  ERROR test/functional/terminal/tui_spec.lua: TUI paste: cmdline-mode inserts 1 line
  test/functional/terminal/tui_spec.lua:367: in function <test/functional/terminal/tui_spec.lua:360
  Expected:
    |*foo                                               |
    |*                                                  |
    |{4:~                                                 }|
    |{4:~                                                 }|
    |{5:[No Name] [+]                                     }|
    |:"line 1{1:"}                                         |
    |{3:-- TERMINAL --}                                    |
  Actual:
    |*                                                  |
    |*{4:~                                                 }|
    |{4:~                                                 }|
    |{4:~                                                 }|
    |{5:[No Name] [+]                                     }|
    |:"line 1{1:"}                                         |
    |{3:-- TERMINAL --}                                    |
2019-09-02 03:34:01 +02:00
976c6667e1 paste: one undo-block per stream
- All "chunks" in a paste-stream should form a single undo-block. Side
  effect of 7a85792884 was to create an undo-block for each chunk.
- Also: remove old :redraw force logic, irrelevant after 7a85792884.
2019-09-02 02:27:13 +02:00
938be1e0ab vim-patch:8.0.1534: C syntax test fails in gvim #10909
Problem:    C syntax test fails when using gvim
Solution:   Force running in a terminal.  Check that 'background' is correct
            even when $COLORFGBG is set.
b7ea7cb8e4
2019-09-01 17:00:50 -07:00
801fe799ff Merge pull request #10382 from abdelhakeem/waituntil
eval: add wait()
2019-09-01 23:27:18 +02:00
b447bdb68c fixup! eval: add wait() test 2019-09-01 21:17:14 +02:00
2d3f39c729 eval: add wait() test 2019-09-01 21:17:14 +02:00
7844501c2b eval: add wait()
closes #10362
2019-09-01 21:17:14 +02:00
9df3a676e7 Merge pull request #10400 from bfredl/msg_grid
Dedicated message grid.
2019-09-01 20:25:36 +02:00
2f37c24348 Merge #10733 from justinmk/test-fixes
test: use shell-test (avoid system shell)
2019-09-01 11:13:29 -07:00
78a2bbaa4b Merge #10906 from janlazo/vim-8.0.1241
vim-patch:8.0.{1241,1246,1260}
2019-09-01 10:11:10 -07:00
14615f7f67 screen: add some documentation of internals of msg_grid implementation 2019-09-01 18:53:55 +02:00
2c1749ce44 test: assert_alive() 2019-09-01 09:03:46 -07:00
f63d952ca2 test: use shell-test (avoid system shell) 2019-09-01 09:03:46 -07:00
641c5b3f08 test/inccommand_spec: avoid indeterminism
- Use shell-test.c to avoid the squishiness of system shells.
- Use screen:expect_unchanged() to avoid hardcoded (brittle) test.

Fails correctly if 5020daa6e5 is reverted (remove terminal_check(),
restore redraw() in refresh_timer_cb()):

    [  ERROR   ] test/functional/ui/inccommand_spec.lua @ 2550: :substitute with inccommand during :terminal activity
    test/functional/helpers.lua:402:
    retry() attempts: 2
    test/functional/ui/screen.lua:579: Row 8 did not match.
    Expected:
      |foo bar baz                   |
      |bar baz fox                   |
      |bar foo baz                   |
      |{15:~                             }|
      |{15:~                             }|
      |{15:~                             }|
      |{11:[No Name] [+]                 }|
      |*26: xxx                       |
      |27: xxx                       |
      |28: xxx                       |
      |29: xxx                       |
      |30: xxx                       |
      |                              |
      |{10:term                          }|
      |:%s/foo/ZZZ^                   |
    Actual:
      |foo bar baz                   |
      |bar baz fox                   |
      |bar foo baz                   |
      |{15:~                             }|
      |{15:~                             }|
      |{15:~                             }|
      |{11:[No Name] [+]                 }|
      |*107: xxx                      |
      |108: xxx                      |
      |109: xxx                      |
      |110: xxx                      |
      |111: xxx                      |
      |                              |
      |{10:term                          }|
      |:%s/foo/ZZZ^                   |
2019-09-01 09:03:46 -07:00
53b7f60805 vim-patch:8.1.0141: :cexpr no longer jumps to the first error #10901
Problem:  :cepxr no longer jumps to the first error.
Solution: Use the quickfix list identifier. (Yegappan Lakshmanan)

Fixes https://github.com/neovim/neovim/issues/10895
2019-09-01 08:46:07 -07:00
57327bb483 vim-patch:8.0.1217: remote eval to inspect vars in :debug #10903
Problem:    Can't use remote eval to inspect vars in debug mode.
Solution:   Don't discard the call stack in debug mode. (closes vim/vim#2237, vim/vim#2247)
d99388ba85
2019-09-01 08:42:47 -07:00
8a187aee8c vim-patch:8.0.1260: using global variables for WaitFor()
Problem:    Using global variables for WaitFor().
Solution:   Use a lambda function instead.  Don't check a condition if
            WaitFor() already checked it.
ab8b1c14a3
2019-09-01 11:33:17 -04:00
8495e50273 vim-patch:8.0.1246: popup test has an arbitrary delay
Problem:    Popup test has an arbitrary delay.
Solution:   Wait for the ruler to show. (James McCoy)
b315876efa
2019-09-01 11:28:48 -04:00
8e1adedb26 vim-patch:8.0.1241: popup test is flaky
Problem:    Popup test is flaky. (James McCoy)
Solution:   Increase the wait time. (Dominique Pelle)
89c394faca
2019-09-01 11:27:51 -04:00
e04b9e7c78 test/ui: update tests for new msg_grid implementation 2019-09-01 15:55:10 +02:00
b51ba122c1 screen: use dedicated message grid
add proper msg_set_pos event, delet win_scroll_over_*

make compositor click through unfocusable grids

add MsgArea attribute for the message/cmdline area, and add docs and tests
2019-09-01 15:55:10 +02:00
9cec097ffa batch draw :ls 2019-09-01 13:21:40 +02:00
27786df6a3 test/ui: make screen:expect() print full state when height does not match 2019-09-01 13:21:40 +02:00
e29b89ca54 vim-patch:8.1.1950: using NULL pointer after an out-of-memory (#10902)
Problem:    Using NULL pointer after an out-of-memory.
Solution:   Check for NULL pointer. (Dominique Pelle, closes vim/vim#4881)
4bbfb0f3cc
2019-08-31 21:34:25 +02:00
25e0a449bb Merge pull request #10878 from bfredl/pastedefer
TUI: defer nvim_paste event properly
2019-08-31 11:18:35 +02:00
2c605d1f22 tui/input: remove "cancel paste" logic which should be redundant 2019-08-31 09:20:24 +02:00
dff06a90e4 api: make nvim_put support "\022{NUM}" regtype as returned by getregtype() 2019-08-31 09:20:24 +02:00
f8b5d6e124 events: loop_schedule() is unclear, rename it loop_schedule_fast() 2019-08-31 09:20:24 +02:00
7a85792884 tui/input: defer nvim_paste properly.
Otherwise cursor and redraw code for normal and insert mode will not run. The
"tickle" workaround was used for this instead, and can now be removed.

The builtin vim.lua got the name
[string "-- Nvim-Lua stdlib: thevimmodule (:help l..."]
in error messages. Fix it to something reasonable.
2019-08-31 09:20:24 +02:00
8a03acb8da vim-patch:8.1.1947: when executing one test the report doesn't show it #10893
Problem:    When executing one test the report doesn't show it.
Solution:   Adjust the regexp. (Daniel Hahler, closes vim/vim#4879)
60b1bcfe92
2019-08-30 22:48:46 +02:00
16c289f217 vim-patch:8.1.1941: getftype() test fails on Mac #10894
Problem:    getftype() test fails on Mac.
Solution:   Skip /dev/fd/.
ad5db44c01
2019-08-30 22:47:28 +02:00
6024fb5267 vim-patch:cb00f0393 (#10892)
Add missing test file.
cb00f03933
2019-08-30 18:47:42 +02:00
ab560739ac vim-patch:8.0.0930: terminal buffers are stored in the viminfo file (#10889)
Problem:    Terminal buffers are stored in the viminfo file while they can't
            be useful.
Solution:   Skip terminal buffers for file marks and buffer list
e62780543f
2019-08-30 18:46:54 +02:00
e03a4f965e scripts/vim-patch.sh: massage args for git-log [ci skip] (#10888)
Replace "src/nvim/" => "src/".
Replace ".*/.vim-src/" => "".

This allows to use tab completion based on existing files in Neovim's
source, or via .vim-src.

Previously you would have to typically remove the "nvim/" part manually
yourself.
2019-08-30 16:46:29 +02:00
dd025a18c1 vim-patch:8.1.0950: using :python sets 'pyxversion' even when not executed (#10891)
Problem:    Using :python sets 'pyxversion' even when not executed.
Solution:   Check the "skip" flag. (Shane Harper, closes vim/vim#3995)
14816ad6e5
2019-08-30 16:43:21 +02:00
1ab442db90 vim-patch:8.1.0212: preferred cursor column not set in interfaces (#10890)
Problem:    Preferred cursor column not set in interfaces.
Solution:   Set w_set_curswant when setting the cursor. (David Hotham,
            closes vim/vim#3060)
53901442f3
2019-08-30 16:42:19 +02:00
06e693cdc9 Merge #10884 'API: nvim_paste: add crlf parameter' 2019-08-30 09:15:43 +02:00
f5fd699c52 test: vim.paste() cancel 2019-08-30 08:33:14 +02:00
b6192a9920 API: nvim_paste: add crlf parameter 2019-08-30 08:33:14 +02:00
4b8a16153e tests: check_logs: improve error message (#10887)
Before:

    [  ERROR   ] test/functional/helpers.lua @ 812: after_each
    test/helpers.lua:156: assertion failed!
    stack traceback:
            test/helpers.lua:156: in function 'check_logs'
            test/functional/helpers.lua:816: in function <test/functional/helpers.lua:812>
2019-08-30 08:26:55 +02:00
7d53887352 Merge pull request #10855 from blueyed/out_data_decide_throttle
Revisit out_data_decide_throttle
2019-08-30 07:46:24 +02:00
56e570f8af Merge #10886 from janlazo/vim-8.1.1938
vim-patch:8.1.{233,1938}
2019-08-30 07:42:57 +02:00
bf85023005 shell-test: remove REP_NODELAY, less delay with REP
REP_NODELAY was added because REP delayed too much.  This changes REP to
only add a delay on every 100th line instead.

This helps to cover the additional pulse steps with
out_data_decide_throttle, which would have required to change
REP_NODELAY anyway.
2019-08-30 07:12:46 +02:00
b3ab7ba1d6 Revisit out_data_decide_throttle
Pulse every 0.1s only.

This makes `!yes` look much better (less busy).
2019-08-30 07:12:46 +02:00
7732976918 tests: fix Test_tagfiles: use Vim's 'tags' (#10883)
When run via `test_alot.vim` `Test_tagfiles` gets run after `set tags&`,
and might therefore pick up "tags" from Neovim's source directory.

This patch makes it use Vim's default always (which is different from
Neovim's).
2019-08-30 07:10:21 +02:00
7ad1d00eaa vim-patch:8.1.1937: errors when using javascriptreact #10885
Problem:    Errors when using javascriptreact.
Solution:   Use ":runtime" instead of ":source". (closes vim/vim#4875)
4fb15c6476
2019-08-30 06:57:44 +02:00
97c1775646 vim-patch:8.1.0233: "safe" argument of call_vim_function() is always FALSE
Problem:    "safe" argument of call_vim_function() is always FALSE.
Solution:   Remove the argument.
ded27a1feb
2019-08-30 00:24:46 -04:00
f575b71449 vim-patch:8.1.1938: may crash when out of memory
Problem:    May crash when out of memory.
Solution:   Initialize v_type to VAR_UNKNOWN. (Dominique Pelle, closes vim/vim#4871)
c507a2d164
2019-08-29 20:48:01 -04:00
9f81acc076 paste: break lines at CR, CRLF #10877
Some terminals helpfully translate \n to \r.

fix #10872
ref #10223
2019-08-29 23:45:02 +02:00
00d46f6328 Fix test/busted/outputHandlers/TAP.lua (#10881)
Extending the original TAP handler was not working as expected.
This adds a new function for displaying the log.

Ref: https://github.com/neovim/neovim/pull/10876
2019-08-29 22:11:51 +02:00
0ec80d5f64 vim-patch:8.1.0193: terminal debugger buttons don't always work (#10874)
Problem:    Terminal debugger buttons don't always work. (Dominique Pelle)
Solution:   Set 'cpo' to its default value.
ca4cc018ad
2019-08-29 02:19:38 +02:00
71a9653194 third-party: remove msvc-compat/unistd.h (#10465)
This was upstreamed into unibilium.
2019-08-29 01:05:47 +02:00
6cc76194b2 tests: use runtime from build for doc/tags with :help (#10479)
This is better practice in general, and allows to remove the "helptags
ALL" hacks.

Ref: https://github.com/neovim/neovim/issues/8824
Ref: https://github.com/neovim/neovim/commit/f1b67c3453c

* Makefile: fix dependencies with regard to helptags

- use the file as the main target to avoid unnecessary triggering
- use "make oldtest" on Travis to ensure it gets built
2019-08-28 22:47:54 +02:00
1d59575450 vim-patch:8.0.0303: shift_delete_registers() #10868
Problem:    Bracketed paste does not work in Visual mode.
Solution:   Delete the text before pasting
a1891848d9
2019-08-28 11:37:18 +02:00
82d52b229d Merge #4448 'paste: redesign'
fix #3447
fix #3566
fix #7066
fix #7212
fix #7273
fix #7455
fix #10415

NA vim-patches:
vim-patch:8.1.1198
vim-patch:8.1.0224
vim-patch:8.0.1299
vim-patch:8.0.0569
vim-patch:8.0.0303
vim-patch:8.0.0296
vim-patch:8.0.0244
vim-patch:8.0.0238
vim-patch:8.0.0232
vim-patch:8.0.0231
vim-patch:8.0.0230
vim-patch:8.0.0210
2019-08-28 01:56:02 +02:00
3c9c64d9dd doc: man.vim #10817
ref #10808
2019-08-28 01:38:58 +02:00
3157baed83 API: TRY_WRAP() for "abort-causing non-exception errors"
- Introduce TRY_WRAP() until we have an *architectural* solution.
  - TODO: bfredl idea: prepare error-handling at "top level" (nv_event).
- nvim_paste(): Revert luaeval() hack (see parent commit).
  - With TRY_WRAP() in nvim_put(), 'nomodifiable' error now correctly
    "bubbles up".
2019-08-28 00:55:13 +02:00
09cbd6769b vim-patch:8.1.1932: ml_get errors after append() #10866
Problem:  Ml_get errors after using append(). (Alex Genco)
Solution: Do not update the cursor twice.

d20070274c

fix #10847
2019-08-27 23:50:55 +02:00
46aa254bf3 paste: handle 'nomodifiable'
- nvim_paste(): Marshal through luaeval() instead of nvim_execute_lua()
  because the latter seems to hide some errors.
- Handle 'nomodifiable' in `nvim_put()` explicitly.
- Require explicit `false` from `vim.paste()` in order to "cancel",
  otherwise assume true ("continue").
2019-08-27 23:37:15 +02:00
17f768ee9e clang/"null pointer dereference" #10864 2019-08-27 22:28:42 +02:00
87389c6a57 paste: make vim.paste() "public" 2019-08-27 22:14:52 +02:00
ed60015266 paste: handle vim.paste() failure
- Show error only once per "paste stream".
- Drain remaining chunks until phase=3.
- Lay groundwork for "cancel".
- Constrain semantics of "cancel" to mean "client must stop"; it is
  unrelated to presence of error(s).
2019-08-27 22:13:45 +02:00
4344ac1111 paste: tickle cursor
HACK: The cursor does not get repositioned after the paste completes.
Scheduling a dummy event seems to fix it.

Test case:
0. Revert this commit.
1. Paste some text in Normal-mode.
2. Notice the cursor is still in the cmdline area.
2019-08-27 22:13:45 +02:00
5b41070c63 paste: implement redo (AKA dot-repeat)
- Normal-mode redo idiom(?): prepend "i" and append ESC.
- Insert-mode only needs AppendToRedobuffLit().
- Cmdline-mode: only paste the first line.
2019-08-27 22:13:45 +02:00
bfc5a18f4b paste: insert text "before" cursor in Insert-mode 2019-08-27 22:13:45 +02:00
eacc70fb3e API: nvim_paste 2019-08-27 22:13:45 +02:00
c95f5d166f paste: workaround typeahead race
Workaround this failure:

    [  ERROR   ] test/functional/terminal/tui_spec.lua @ 192: TUI paste: exactly 64 bytes
    test/functional/helpers.lua:403:
    retry() attempts: 478
    test/functional/terminal/tui_spec.lua:201: Expected objects to be the same.
    Passed in:
    (table: 0x47cd77e8) {
     *[1] = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz endz' }
    Expected:
    (table: 0x47cd7830) {
     *[1] = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz end' }

This happens because `curwin->w_cursor.col` is sometimes decremented at
the end of `do_put`... because the editor is in Normal-mode instead of
the expected Insert-mode.

Caused by "typeahead race" (#10826): there may be queued input in the
main thread not yet processed, thus the editor mode (`State` global)
will be "wrong" during paste. Example: input "i" followed immediately by
a paste sequence:

    i<start-paste>...<stop-paste>
    ^
     "i" does not get processed in time, so the editor is in
     Normal-mode instead of Insert-mode while handling the paste.

Attempted workarounds:
- vim.api.nvim_feedkeys('','x',false) in vim._paste()
- exec_normal() in tinput_wait_enqueue()
- LOOP_PROCESS_EVENTS(&main_loop,…,0) in tinput_wait_enqueue()

ref #10826
2019-08-27 21:19:10 +02:00
5ae6849517 paste: phases, dots
- Send `phase` parameter to the paste handler.
- Redraw at intervals and when paste terminates.
- Show "..." throbber during paste to indicate activity.
2019-08-27 21:19:10 +02:00
93e5f0235b API: nvim_put: "follow" parameter 2019-08-27 21:19:10 +02:00
613296936b API: nvim_put: always PUT_CURSEND
Fixes strange behavior where sometimes the buffer contents of a series
of paste chunks (vim._paste) would be out-of-order.

Now the tui_spec.lua screen-tests are much more reliable. But they still
sometimes fail because of off-by-one cursor (caused by "typeahead race"
resulting in wrong mode; fixed later in this patch-series).
2019-08-27 21:19:10 +02:00
1fdae25b2b test/tui_spec: connect to child session 2019-08-27 21:19:10 +02:00
517bf99ddb API: nvim_put: Avoid "N more lines" message 2019-08-27 21:19:10 +02:00
0221a9220a paste: edge-case: handle EOL at end-of-buffer
This is "readfile()-style", see also ":help channel-lines".
2019-08-27 21:19:10 +02:00
d303790ee7 paste: test 2019-08-27 21:19:10 +02:00
5a2894d677 paste: use nvim_put() 2019-08-27 21:19:10 +02:00
e1177be363 API: nvim_put #6819 2019-08-27 21:19:10 +02:00
9e25a36467 API: nvim_put #6819: try to fix Insert, Visual 2019-08-27 21:19:10 +02:00
4cc56905cb API: nvim_put #6819 2019-08-27 21:19:10 +02:00
f99caa755c paste: use chansend() in Terminal-mode 2019-08-27 21:19:10 +02:00
abd55be19a paste: fixup tests 2019-08-27 21:19:10 +02:00
4389401a7c paste: abort paste if handler does not return true 2019-08-27 21:19:10 +02:00
68ea9a7c8a TUI/paste: always flush on paste mode-change
Flush input before entering, not only when leaving, paste mode. Else
there could be pending input which will erroneously be sent to the paste
handler.
2019-08-27 21:19:10 +02:00
6d277f43a2 TUI/paste: define paste function as Lua builtin
- Define in Lua so that it is compiled-in (available with `-u NONE`).

TODO: Eventually we will want a 'pastefunc' option or some other way to
override the default paste handler.
2019-08-27 21:19:10 +02:00
7df566060c lua/stdlib: cleanup 2019-08-27 21:19:10 +02:00
0a4ef38e43 log: log_key() 2019-08-27 21:19:10 +02:00
9a92ba88dd TUI/paste: push bytes directly (avoid libtermkey) 2019-08-27 21:19:10 +02:00
ZyX
75663aaf0f TUI/paste: collect data, invoke user callback #4448 2019-08-27 21:19:10 +02:00
21f0f7bca5 paste: WIP #4448 2019-08-27 21:19:10 +02:00
a851090dec build: third-party: enable CXX language earlier (#10862)
This is required for `CMAKE_CXX_COMPILER` to be set already, not only
after including third-party/cmake/BuildGperf.cmake.

Closes https://github.com/neovim/neovim/pull/10860.
Ref: 31f879983f
2019-08-27 20:55:11 +02:00
4cedc8444e Merge #10858 from janlazo/vim-8.1.1930
vim-patch:8.1.{1930,1931}
2019-08-27 09:27:03 +02:00
41ec296640 vim-patch:8.1.1931: syntax test fails
Problem:    Syntax test fails.
Solution:   Add new javascriptreact type to completions.
ea7a08a53e
2019-08-26 19:51:43 -04:00
f667a0e02a vim-patch:8.1.1930: cannot recognize .jsx and .tsx files
Problem:    Cannot recognize .jsx and .tsx files.
Solution:   Recognize them as javascriptreact and typescriptreact.
            (closes vim/vim#4830)
92852cee3f
2019-08-26 19:51:26 -04:00
f3cb529774 clang/"dereference of null pointer" #10856
In edit.c insert_execute calls ins_compl_addfrommatch
2019-08-26 20:22:39 +02:00
7d56c90dff timer_spec: shorter timeout with "doesn't mess up the cmdline" (#10769)
It was increased in dd21cd2a4 to avoid flakiness, but takes 1s then always.

This specifies a shorter timeout again, uisng `load_adjust`.
2019-08-26 14:21:01 +02:00
6a21fe9fd1 vim-patch:8.1.1923: some source files are not in a normal encoding (#10852)
Problem:    Some source files are not in a normal encoding.
Solution:   Convert hangulin.c from euc-kr to utf-8 and digraph.c from latin1
            to utf-8. (Daniel Hahler, closes vim/vim#4731)
4119309d70
2019-08-26 12:22:21 +02:00
b069a20910 runnvim.sh: lint (shellcheck) (#10851) 2019-08-26 12:21:53 +02:00
b12b01a828 Merge pull request #10850 from blueyed/option-alias
findoption_len: treat viminfo/viminfofile as aliases
2019-08-26 10:23:12 +02:00
f790799474 third-party: use neovim/unibilium (#10677)
Ref: https://github.com/neovim/neovim/issues/10302
Fixes https://github.com/neovim/neovim/issues/9071.
2019-08-26 10:21:08 +02:00
233597152a vim-patch:8.1.1790: :mkvimrc is not tested
Problem:    :mkvimrc is not tested.
Solution:   Add a test.
8750026a7f
2019-08-26 09:39:00 +02:00
b2d6a6891e findoption_len: treat viminfo/viminfofile as aliases
Ref: https://github.com/neovim/neovim/pull/10672#issuecomment-524716824
2019-08-26 09:39:00 +02:00
ebc3070b7d vim-patch:8.1.1926: redraw cursorline after putting line above #10849
Problem:    Cursorline not redrawn when putting a line above the cursor.
Solution:   Redraw when the curor line is below a change. (closes vim/vim#4862)
c2b97643a8
2019-08-26 04:17:34 +02:00
e3e0574cb3 Merge pull request #10841 from janlazo/vim-7.4.1407
vim-patch:7.4.1407,8.1.1111
2019-08-25 21:04:17 +02:00
bec2336231 vim-patch:8.1.1913: not easy to compute the space on the command line (#10845)
Problem:    Not easy to compute the space on the command line.
Solution:   Add v:echospace. (Daniel Hahler, closes vim/vim#4732)
37f4cbd46f
2019-08-25 20:53:17 +02:00
c8fc285db6 Merge #10840 from janlazo/vim-8.1.1757
vim-patch:8.1.{1757,1924}
2019-08-25 09:13:49 +02:00
2e621553c0 teardown: fix win_free_all() heap-use-after-free #10839
Fixes #10838
2019-08-25 09:11:22 +02:00
66c06dad62 vim-patch:8.1.1924: using empty string for current buffer is unexpected
Problem:    Using empty string for current buffer is unexpected.
Solution:   Make the argument optional for bufname() and bufnr().
a8eee21e75
2019-08-24 21:18:15 -04:00
1dc088ea7d vim-patch:8.1.1111: it is not easy to check for infinity
Problem:    It is not easy to check for infinity.
Solution:   Add isinf(). (Ozaki Kiichi, closes vim/vim#3787)
fda1bff39f
2019-08-24 17:02:05 -04:00
01b5499eea vim-patch:7.4.1407
Problem:    json_encode() does not handle NaN and inf properly. (David
            Barnett)
Solution:   For JSON turn them into "null".  For JS use "NaN" and "Infinity".
            Add isnan().
f1b6ac7229
2019-08-24 15:56:17 -04:00
4fedef51b0 vim-patch:8.1.1757: text added with appendbufline() isn't displayed
Problem:    Text added with appendbufline() to another buffer isn't displayed.
Solution:   Update topline. (partly by Christian Brabandt, closes vim/vim#4718)
2984666291
2019-08-24 14:04:20 -04:00
34e4166673 vim-patch:8.0.1236: Mac features are confusing #10837
Problem:    Mac features are confusing.
Solution:   Make feature names more consistent, add "osxdarwin". Rename
            feature flags, cleanup Mac code. (Kazunobu Kuriyama, closes vim/vim#2178)
d057301b1f
2019-08-24 09:04:08 +02:00
82aaac5baa Merge #10833 from janlazo/vim-8.1.0037
vim-patch:8.0.1386,8.1.{37,39,187}
2019-08-23 19:39:04 +02:00
2a1887c2df vim-patch:8.1.0187: getwininfo() and win_screenpos() return different numbers
Problem:    getwininfo() and win_screenpos() return different numbers.
Solution:   Add one to "wincol" and "winrow" from getwininfo().
7132ddc101
2019-08-23 07:46:51 -04:00
c58054c231 vim-patch:8.0.1386: cannot select modified buffers with getbufinfo()
Problem:    Cannot select modified buffers with getbufinfo().
Solution:   Add the "bufmodified" flag. (Yegappan Lakshmanan, closes vim/vim#2431)
8e6a31df81
2019-08-23 07:46:51 -04:00
7e6a2f2bed vim-patch:8.1.0039: cannot easily delete lines in another buffer
Problem:    Cannot easily delete lines in another buffer.
Solution:   Add deletebufline().
d79a26219d
2019-08-23 07:46:51 -04:00
9358979d09 vim-patch:8.1.0037: cannot easily append lines to another buffer
Problem:    Cannot easily append lines to another buffer.
Solution:   Add appendbufline().
ca851593a6
2019-08-23 07:46:51 -04:00
79ea7709b7 Merge #9163 'fix crash wiping buffer after getbufinfo()' 2019-08-23 10:31:35 +02:00
c6eb1f42be API: fix nvim_command_output buffer overflow (#10830)
Fixes https://github.com/neovim/neovim/issues/10829.
2019-08-22 10:07:54 +02:00
ed28668392 vim-patch:8.1.1897: may free memory twice when out of memory (#10827)
Problem:    May free memory twice when out of memory.
Solution:   Check that backslash_halve_save() returns a different pointer.
            (Dominique Pelle, closes vim/vim#4847)
f1552d07d7
2019-08-22 06:49:33 +02:00
bb50eadc84 Merge pull request #10815 from blueyed/vim-8.1.1483
vim-patch:8.1.1483: skipped tests are not properly listed
2019-08-22 06:37:05 +02:00
42f492ac99 tui: handle Smulx extension capability (extended underline) (#9097)
This was added to ncurses terminfo for vte and tmux.

Ref: https://github.com/tmux/tmux/issues/1492#issuecomment-427675180

Assumes color support is available when extended underline is supported.

Ref: https://github.com/tmux/tmux/issues/1492#issuecomment-427803984
2019-08-22 06:36:39 +02:00
86d88076ce -u NONE for no syntax highlighting 2019-08-22 05:06:30 +02:00
376d394981 vim-patch:8.1.1893: script to summarize test results can be improved
Problem:    Script to summarize test results can be improved.
Solution:   Use "silent" for substitute to avoid reporting number of matches.
            Remove duplicate "set nocp". (Daniel Hahler, closes vim/vim#4845)
f1e0544d41
2019-08-22 05:06:30 +02:00
356f5fc6e2 vim-patch:8.1.1478: still an error when running tests with the tiny version
Problem:    Still an error when running tests with the tiny version.
Solution:   Do not try reading test.log
18250e291a
2019-08-22 05:06:30 +02:00
6970225af6 vim-patch:8.1.1477: test summary fails in the tiny version
Problem:    Test summary fails in the tiny version.
Solution:   set 'nocompatible'.
c7500f9cb5
2019-08-22 05:06:30 +02:00
542fbb34a1 vim-patch:8.1.1488: summary of tests has incorrect failed count
Problem:    Summary of tests has incorrect failed count.
Solution:   Add to the failed count instead of setting it. (Christian Brabandt)
150f0550f4
2019-08-22 05:06:30 +02:00
72f453d149 vim-patch:8.1.1476: no statistics displayed after running tests
Problem:    No statistics displayed after running tests.
Solution:   Summarize the test results. (Christian Brabandt, closes vim/vim#4391)
            Also make it possible to report a skipped file.
9c0cec65f8

Removes our custom no-inits from `$(RUN_VIMTEST)`, since we have
`$(NO_INITS)` now also.
2019-08-22 05:06:30 +02:00
9e24bbb52f vim-patch:8.1.1483: skipped tests are not properly listed
Problem:    Skipped tests are not properly listed.
Solution:   Throw a "Skipped" exception instead of using ":finish" or ":return".
5d30ff1964

Skips quite some (N/A) tests.

vim-patch:8.1.0503: missing change to diff test (included in cf1ffa916)
2019-08-22 05:06:30 +02:00
77729b0800 vim-patch:8.1.0811: too many #ifdefs
Problem:    Too many #ifdefs.
Solution:   Graduate FEAT_MBYTE, the final chapter.
30276f2beb
2019-08-22 05:06:30 +02:00
3223dedfc3 test: fix problem of breaking user's viminfo (#10824)
Vim turns on 'compatible' as a side effect of using the -u command line
option. As a result, viminfo is not used. But that is not the case with
neovim. neovim requires the -i command line option to avoid breaking
user's viminfo.
2019-08-22 05:06:14 +02:00
86c182c9df Merge #10823 from janlazo/vim-8.1.1124 2019-08-21 23:43:01 +02:00
fc12ada4f1 ci: AppVeyor: exitIfFailed with old tests (#10187) 2019-08-21 21:54:03 +02:00
450a68b7cc vim-patch:8.1.0888: the a: dict is not immutable as documented (#10819)
Problem:    The a: dict is not immutable as documented.
Solution:   Make the a:dict immutable, add a test. (Ozaki Kiichi, Yasuhiro
            Matsumoto, closes vim/vim#3929)
31b816042f
2019-08-21 20:17:09 +02:00
396772c73b edit: add nonnull func attribute 2019-08-21 01:16:32 -04:00
332d844e5e edit: compl_started,compl_used_match are bool 2019-08-21 01:16:32 -04:00
3c28d75652 vim-patch:8.1.1124: insert completion flags are mixed up
Problem:    Insert completion flags are mixed up.
Solution:   Clean up flags use of ins_compl_add() and cp_flags.
d9eefe3155
2019-08-21 01:16:31 -04:00
0e8ee37efd Merge pull request #10821 from blueyed/asan
tests: improve escaping of special chars, forward all sanitizer options
2019-08-21 03:21:50 +02:00
e5b2423fa1 fixup! test/functional/helpers.lua: env: forward also TSAN_OPTIONS/MSAN_OPTIONS 2019-08-21 02:44:27 +02:00
3bf0d54bc1 test/functional/helpers.lua: env: forward also TSAN_OPTIONS/MSAN_OPTIONS 2019-08-21 02:39:10 +02:00
d993ec5db8 src/nvim/testdir/runnvim.vim: improve escaping of non-printables 2019-08-21 02:39:10 +02:00
47e27a4f5b tests: support msg with global_helpers.ok (#10820)
Ref: https://github.com/neovim/neovim/pull/10768#discussion_r315904175

Co-Authored-By: Justin M. Keyes <justinkz@gmail.com>
2019-08-21 02:32:20 +02:00
7adea68c1e oldtest: windows: revert setting shellslash individually (#10189)
* Revert "oldtests: win: shellslash for cdpath,tags,:find"

This reverts commit 6245b4873d.

* Revert "oldtests: set shellslash for ":cd" test"

This reverts commit eba1ebafe5.

* Revert "oldtests: set shellslash in Test_shellescape()"

This reverts commit e428fc4b52.

* Revert "fixup! vim-patch:8.0.1782: no simple way to label quickfix entries"

This reverts commit ac1fbc2860.

* Revert "test/old: pass Test_statusline on Windows"

This reverts commit 6efa3bff09.

* Revert "oldtests: set shellslash for Test_non_zero_arg"

This reverts commit 42e1e2495c.

* Revert "oldtests: set shellslash in Test_true_false_arg()"

This reverts commit 8bd194f98a.

* Remove unnecessary set shellslash

Since #10679 no longer requires individual set shellslash, it is removed.


Co-Authored-By: erw7 <erw7.github@gmail.com>
2019-08-20 22:01:58 +02:00
09397e5d05 Merge pull request #10768 from blueyed/tests-shorter-timers
tests: timer_spec: lower timeout, avoids flakiness
2019-08-20 20:22:55 +02:00
2755403429 Merge pull request #10818 from blueyed/minor
Minor: .gitignore, improve test assertion message
2019-08-20 20:18:10 +02:00
e097e4704b win: stream: reset tty stream on close
This was overlooked in 8072f085d2.

Analogous to 8a782f1699.

fix #10668
ref 8072f085d2 #9884
ref 8a782f1699 #2377
2019-08-20 20:14:13 +02:00
222717c95c tests: screen: notification_cb: improve assertion message 2019-08-20 19:24:57 +02:00
6bb24b45f8 .gitignore: src/nvim/testdir/*.tlog 2019-08-20 19:24:55 +02:00
7ed2122622 test/functional/ui/mode_spec: improve "ui mode_change event" (#10816)
Set a shorter `&matchtime` (instead of asserting the default), and do
not sleep - `screen:expect` will do that (wait for it).
2019-08-20 17:43:13 +02:00
b2c354bb07 tests: screen: notification_cb: improve assertion message 2019-08-20 04:54:29 +02:00
9e04e19574 tests: timer_spec: lower timeout, avoids flakiness
Inspired by quickbuild failure, where `g:val` was increased already:

    20:07:04,227 INFO  - not ok 1164 - timers works with repeat two
    20:07:04,227 INFO  - # test/functional/eval/timer_spec.lua @ 36
    20:07:04,227 INFO  - # Failure message: test/functional/eval/timer_spec.lua:38: Expected objects to be the same.
    20:07:04,227 INFO  - # Passed in:
    20:07:04,227 INFO  - # (number) 1
    20:07:04,227 INFO  - # Expected:
    20:07:04,227 INFO  - # (number) 0
    20:07:04,227 INFO  - # stack traceback:
    20:07:04,227 INFO  - #     test/functional/eval/timer_spec.lua:38: in function <test/functional/eval/timer_spec.lua:36>

Uses a pattern of `eq()`ing `timer_start` and `g:val` in the same `eval`
call, and decreases timeouts in general.

Improves runtime from ~5s to <2s.
2019-08-20 04:54:28 +02:00
57e19ea846 Merge pull request #10814 from janlazo/vim-8.1.1887
vim-patch:8.1.{1887,1890}
2019-08-20 04:52:56 +02:00
ec9b57cb6e vim-patch:8.1.1890: ml_get error when deleting fold marker
Problem:    Ml_get error when deleting fold marker.
Solution:   Check that the line number is not below the last line.  Adjust the
            fold when deleting the empty line.  (Christian Brabandt,
            closes vim/vim#4834)
9a4a8c4d59
2019-08-19 21:32:24 -04:00
419c946f03 vim-patch:8.1.1887: the +cmdline_compl feature is not in the tiny version
Problem:    The +cmdline_compl feature is not in the tiny version.
Solution:   Graduate the +cmdline_compl feature.
0a52df50a0
2019-08-19 20:14:42 -04:00
7fa49627e5 src/nvim/README: revisit sanitizer section [ci skip] (#10780) 2019-08-20 02:05:36 +02:00
46cb85691c Merge pull request #10626 from janlazo/test/enable
Windows: enable more tests
2019-08-19 13:21:17 +02:00
47d679c0c2 tests: win: enable buffer focus test 2019-08-18 21:40:27 -04:00
cb11de18a2 test: win: enable WinEnter terminal test 2019-08-18 21:40:27 -04:00
a5b915e56c test: win: enable output_spec test 2019-08-18 21:40:26 -04:00
2963533fe1 Unreserve :X #10807
closes #10806
2019-08-18 19:28:13 +02:00
ce9367c254 CI/AppVeyor: revert "skip MSVC_32 for non-PR" [skip travis] #10805
Revert commit bfbc1a7872.

The nightly release job is failing:
https://travis-ci.org/neovim/bot-ci/builds/569687794

- We need the MSVC artifact on master so that our nightly job can publish it.
- Saving time on master is low-priority because most CI activity is from PRs.
2019-08-18 17:26:20 +02:00
9bbac874f9 Merge pull request #10798 from bfredl/multifix
multigrid: fixes
2019-08-18 13:52:59 +02:00
628f8f3dfd ui: transmit "blend=" property of highlight attributes 2019-08-18 13:52:32 +02:00
d351f1c871 Merge #10679 from erw7/fix-oldtest-on-windows 2019-08-18 13:31:28 +02:00
c5efa9c352 Merge #10800 from janlazo/vim-8.1.1870
vim-patch:8.1.{1679,1839,1870}
2019-08-18 13:05:17 +02:00
b7ce589cb8 CI/OpenBSD: run oldtest #10797
- Test_libcall_libcallnr: pass libc name to dlopen.
2019-08-18 12:44:05 +02:00
3453a2ccb0 Change to use v:progpath instead of constant [skip ci] 2019-08-18 10:54:48 +09:00
454adf15db vim-patch:8.1.1839: insufficient info when test fails because of screen size
Problem:    Insufficient info when test fails because of screen size.
Solution:   Report the detected screen size.
0b5dc64446
2019-08-17 18:32:40 -04:00
eb3ec78c63 vim-patch:8.1.1679: test using SwapExists autocommand file may fail
Problem:    Test using SwapExists autocommand file may fail.
Solution:   Remove the SwapExists autocommand.
eaa49e40d7
2019-08-17 18:22:56 -04:00
0a1807ea25 vim-patch:8.1.1870: using :pedit from a help file sets help filetype
Problem:    Using :pedit from a help file sets the preview window to help
            filetype. (Wang Shidong)
Solution:   Do not set "keep_help_flag". (closes vim/vim#3536)
026587b35c
2019-08-17 18:11:05 -04:00
6b2d67eb59 test/ui: properly test win_hide by explicitly marking hidden grids 2019-08-17 21:46:11 +02:00
3397b8c51a ui: use Window type in win_pos consistently with win_float_pos
Also check invalid positional arguments to screen:expect()
2019-08-17 20:52:08 +02:00
e2ccf47b5e Merge #10794 from janlazo/vim-8.1.1857
vim-patch:8.1.{1857,1858,1860}
2019-08-17 08:49:05 +02:00
cc903210c9 Fix test failure on Windows [skip travis] 2019-08-17 14:44:52 +09:00
44b3488db2 Change value of cpo [skip travis]
set cpo+=S was added because the test failed because the cpo value
was different from vim(See #10730).
2019-08-17 12:29:42 +09:00
737074c8bf Remove test52
Test52 does nothing on UNIX. And vim on Windows performs mbyte-conversion
between Unicode and code page using Windows API(See :h mbyte-conversion).
Test52 seems to be testing its functionality. In neovim, the conversion
function by Windows API has been removed. Therefore, there is no point
in doing this test.
2019-08-17 12:29:09 +09:00
861a7604d4 Change test execution conditions
Since neovim needs iconv to process cp932, it changes the test execution
condition.
2019-08-17 12:29:09 +09:00
619f136075 Add target fixff to testdir/Makefile
In Windows, since conversion of the line feed code is necessary, porting
fixff target from Make_mingw.mak of vim.
2019-08-17 12:29:09 +09:00
505d5fb960 Fix get_path_cutoff() on Windows
Fix an issue where the result of get_path cutoff() was incorrect when
using set shellslash.
2019-08-17 12:29:09 +09:00
d7b642cadb Remove code that is no longer needed by set shellslash 2019-08-17 12:29:09 +09:00
03bba32565 Change to set shellslash to test under same conditions as vim 2019-08-17 12:29:09 +09:00
ae95a62675 vim-patch:8.1.1860: map timeout test is flaky
Problem:    Map timeout test is flaky.
Solution:   Add test to list of flaky tests.  Increase timeout.
ea94c85516
2019-08-16 21:23:25 -04:00
0455af00e6 vim-patch:8.1.1858: test for multi-byte mapping fails on some systems
Problem:    Test for multi-byte mapping fails on some systems.
Solution:   Test in another way.
2f710afe7f
2019-08-16 21:21:58 -04:00
4aa3473b88 vim-patch:8.1.1857: cannot use modifier with multi-byte character
Problem:    Cannot use modifier with multi-byte character.
Solution:   Allow using a multi-byte character, although it doesn't work
            everywhere.
c8fd33d18b
2019-08-16 21:20:34 -04:00
e56f62e9a7 vim-patch:8.1.1854: now another timer test is flaky #10791
Problem:    Now another timer test is flaky.
Solution:   Add test to list of flaky tests.
973d5304a4
2019-08-16 22:06:58 +02:00
282ffc840d CI/OpenBSD: Initial sourcehut dispatch file #10792
Does only the build step for now, some tests fail currently.
2019-08-16 22:04:49 +02:00
bfbc1a7872 CI/AppVeyor: skip MSVC_32 for non-PR builds [skip travis] #10786
It was run for the PR already, and we can save the ~25min it takes with
merged PRs then - given that there is only one parallel job on AppVeyor
this should help to reduce the queue size.
2019-08-16 20:13:31 +02:00
a9bea8c104 Merge pull request #10790 from bfredl/metamb
keymap: allow modifiers to multibyte chars, like <m-ä>
2019-08-16 19:56:37 +02:00
6fe2d24cef keymap: allow modifiers to multibyte chars, like <m-ä> 2019-08-16 19:54:34 +02:00
1f5eac1115 Merge #10785 from bfredl/tui_start
TUI: do not use "starting" global mutated by main thread
2019-08-16 10:23:05 +02:00
66528f2475 vim-patch:8.1.1852: timers test is flaky #10788
Problem:    Timers test is flaky.
Solution:   Accept a larger count.  Add test to list of flaky tests.
7e6feb9eeb
2019-08-16 10:11:03 +02:00
812ed53724 Merge #10783 from erw7/debug-job-spec
fix #10762 flaky 'jobstop() kills entire process tree #6530'
2019-08-16 10:10:10 +02:00
85edb33fd1 Change to output status on failure 2019-08-16 13:37:44 +09:00
e82fc20f23 windows: ok(#children >= 3 and #chidlen <= 5)
Depending on the version of Windows, conhost.exe may not be included in
the child process.
2019-08-16 13:34:53 +09:00
ae60172106 windows: ok(#children >= 4 and #children <= 5) 2019-08-16 13:24:44 +09:00
1852dfdf9a Merge pull request #10784 from blueyed/improve-version-compile-flags
Improve compile options/definitions with sanitizer builds (for --version).
2019-08-15 22:06:56 +02:00
e79ea696a2 Remove TSan suppression config [skip appveyor] 2019-08-15 21:58:51 +02:00
abfc8b3257 emsg_multiline: log Vim errors (#10778) 2019-08-15 20:18:09 +02:00
8109690530 TUI: do not use "starting" global mutated by main thread 2019-08-15 19:50:13 +02:00
18fb4dcbf9 src/nvim/CMakeLists.txt: use compile options/definitions
This includes `-fsanitize=thread` etc in the output of `--version`.
2019-08-15 19:44:00 +02:00
28219534eb get_compile_flags: also look at target properties 2019-08-15 19:42:46 +02:00
6261d2658f Merge #10761 from justinmk/win-utf-libuv-align
utf8_to_utf16, utf16_to_utf8: align with libuv
2019-08-15 09:32:18 +02:00
eb9f3308bc CI/travis: git clone -q #10781
https://docs.travis-ci.com/user/customizing-the-build/#git-clone-quiet
2019-08-15 08:55:22 +02:00
975be7e5dc build/win: fix warnings
../src/nvim/os/fs.c: In function 'os_can_exe':
  ../src/nvim/os/fs.c:247:27: warning: passing argument 1 of 'is_executable_ext' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    247 |     if (is_executable_ext(name, abspath)) {
        |                           ^~~~
  In file included from ../src/nvim/os/fs.c:36:
  src/nvim/auto/os/fs.c.generated.h:7:38: note: expected 'char *' but argument is of type 'const char *'
      7 | static _Bool is_executable_ext(char *name, char **abspath) FUNC_ATTR_NONNULL_ARG(1);
        |                                ~~~~~~^~~~
  ../src/nvim/os/fs.c: In function 'os_resolve_shortcut':
  ../src/nvim/os/fs.c:1183:56: warning: conversion from 'size_t' {aka 'const long long unsigned int'} to 'int' may change value [-Wconversion]
   1183 |     const int conversion_result = utf8_to_utf16(fname, len, &p);
        |                                                        ^~~
  ../src/nvim/os/fs.c:1211:19: warning: declaration of 'conversion_result' shadows a previous local [-Wshadow]
   1211 |         const int conversion_result = utf16_to_utf8(wsz, -1, &rfname);
        |                   ^~~~~~~~~~~~~~~~~
  ../src/nvim/os/fs.c:1183:15: note: shadowed declaration is here
   1183 |     const int conversion_result = utf8_to_utf16(fname, len, &p);
        |               ^~~~~~~~~~~~~~~~~
2019-08-15 00:28:41 +02:00
c9a0875ea8 os/: remove redundant define 2019-08-15 00:28:41 +02:00
07cc72ad5d utf16_to_utf8: align with libuv
- take a size parameter
- return libuv error code
- handle error in caller only (avoid redundant messages)

53995a3825
4c945f4936
2019-08-15 00:28:41 +02:00
8727f7a6a4 utf8_to_utf16: align with libuv
- take a size parameter
- always NUL-terminate the result
- return libuv error code
- handle error in caller only (avoid redundant messages)

53995a3825
4c945f4936
2019-08-15 00:28:41 +02:00
fc60d92795 tests: skip "API nvim_parse_expression" on MSVC_32 (#10773)
Only "API nvim_parse_expression works with &opt" is flaky, but easier to
skip all of "API nvim_parse_expression".

Ref: https://github.com/neovim/neovim/issues/10241
2019-08-14 23:57:45 +02:00
7d92c391a1 Merge pull request #10774 from bfredl/miminal_fdc
api: nvim_win_open() style="minimal" should disable 'foldcolumn'
2019-08-14 23:54:08 +02:00
9bf3fab60b Merge pull request #10779 from blueyed/ci-homebrew-no-update
ci: fix Travis
2019-08-14 23:21:41 +02:00
ae31de32ee build: TSan: add src/.tsan-suppressions
Uses runtime suppressions instead of a blacklist, which can only ignore
whole files/functions.

Ref: https://github.com/google/sanitizers/wiki/ThreadSanitizerSuppressions
Ref: https://github.com/neovim/neovim/pull/10591#issuecomment-521248233
2019-08-14 23:17:53 +02:00
7c0ae06664 ci: Travis: build.sh: use cat "-vet" for osx
Fixes:

    cat: illegal option -- A
    usage: cat [-benstuv] [file ...]

Broken in 5cc45bb41.

squash! ci: Travis: build.sh: use cat "-vET" for osx  [skip appveyor]

cat -vet
2019-08-14 23:17:42 +02:00
48b43352b0 pyxversion: fix logic error #10759
Do not incorrectly prefer python2 if python3 is working.
fixes #10758
2019-08-14 22:36:43 +02:00
ab842fb8b8 ci: Travis: homebrew: update=false [skip appveyor]
It is disabled by default, and the docs mention that it slows builds
down [1].  It took 165s in https://travis-ci.org/neovim/neovim/jobs/572000615.

1: https://docs.travis-ci.com/user/installing-dependencies/#installing-packages-on-macos
2019-08-14 22:16:34 +02:00
ebcb9adcc4 clang/"null pointer dereference" #10776
assert(curbuf) in ins_compl_get_exp
2019-08-14 20:50:30 +02:00
5cc45bb419 ci: Travis: check logs for TSan also (#10775)
Uses `cat -A` with early "*San" check:
This prints terminal escape sequences as-is (for debugging), and does
not cause (display) issues with the Travis log.

Ref: https://github.com/neovim/neovim/pull/10591#issuecomment-521248233
2019-08-14 18:27:08 +02:00
0c952c1c8b Merge pull request #10757 from bfredl/compfix
compositor: handle invalid screen positions after resize gracefully
2019-08-14 15:52:11 +02:00
f9f238b21a api: nvim_win_open() style="minimal" should disable 'foldcolumn' 2019-08-14 14:49:27 +02:00
ba0aaf012a compositor: handle invalid screen positions after resize gracefully
The screen resize logic needs to be refactored to be simpler and more
deterministic. Until then, we need to handle attempts to draw outside of the
screen size gracefully, just like the old vim code did.

fixes #9989
2019-08-14 13:11:20 +02:00
5ad67af3c1 Merge #10763 from justinmk/startup-guicursor
startup: handle 'guicursor' after user config
2019-08-14 11:28:39 +02:00
2fafed6bb8 clipboard: handle/avoid SIGTERM with previous owner #10765
Fixes regression due to signal being reported with exit status.
ref #10573 939d9053bd
ref https://github.com/neovim/neovim/issues/7054#issuecomment-520282429
2019-08-14 09:58:52 +02:00
8fda095b6d tests: fix/improve "jobwait returns -1 when timed out" #10767
There was a longer timeout for Windows already, but unlike stated in
51d42917f it is not a worst-case, but gets waited for always.

The test is only about "-1" on timeout, so reduce it to this.

Fixes:

    16:33:19,309 INFO  - not ok 627 - jobs jobwait with timeout argument will return -1 if the wait timed out
    16:33:19,309 INFO  - # test/functional/core/job_spec.lua @ 707
    16:33:19,309 INFO  - # Failure message: test/functional/core/job_spec.lua:714: Expected objects to be the same.
    16:33:19,309 INFO  - # Passed in:
    16:33:19,309 INFO  - # (table: 0x0db1a3f0) {
    16:33:19,309 INFO  - #   [1] = 'notification'
    16:33:19,309 INFO  - #   [2] = 'wait'
    16:33:19,309 INFO  - #  *[3] = {
    16:33:19,309 INFO  - #    *[1] = {
    16:33:19,309 INFO  - #      *[1] = -1
    16:33:19,309 INFO  - #       [2] = -1 } } }
    16:33:19,309 INFO  - # Expected:
    16:33:19,309 INFO  - # (table: 0x0db1a480) {
    16:33:19,309 INFO  - #   [1] = 'notification'
    16:33:19,309 INFO  - #   [2] = 'wait'
    16:33:19,309 INFO  - #  *[3] = {
    16:33:19,309 INFO  - #    *[1] = {
    16:33:19,309 INFO  - #      *[1] = 4
    16:33:19,309 INFO  - #       [2] = -1 } } }
    16:33:19,309 INFO  - # stack traceback:
    16:33:19,309 INFO  - # 	test/functional/core/job_spec.lua:714: in function <test/functional/core/job_spec.lua:707>
2019-08-14 09:08:25 +02:00
7668f04392 tests: include timer_start in duration #10772
This should not make much of a difference, but increases the timeout
when `load_factor` is used slightly.
2019-08-14 08:59:06 +02:00
a690bf8116 mksession: use exists(':tcd'), not has('nvim') #10770
Since recent vim versions also support :tcd, check for the actual
availability of the command, rather than has('nvim').
2019-08-14 08:45:54 +02:00
c285ebfa73 vim-patch:8.1.0456: running test hangs when the input file is being edited (#10764)
Problem:    Running test hangs when the input file is being edited.
Solution:   Use a SwapExists autocommand to ignore editing the test script.
d8f27b30d6
2019-08-14 01:56:59 +02:00
f2377e3575 tests: use larger timeout with "timers can be stopped from the handler" (#10760)
Seen on quickbuild:

    23:01:01,289 INFO  - not ok 1172 - timers can be stopped from the handler
    23:01:01,289 INFO  - # test/functional/eval/timer_spec.lua @ 154
    23:01:01,289 INFO  - # Failure message: test/functional/eval/timer_spec.lua:166: Expected objects to be the same.
    23:01:01,289 INFO  - # Passed in:
    23:01:01,289 INFO  - # (number) 3
    23:01:01,289 INFO  - # Expected:
    23:01:01,289 INFO  - # (number) 0
    23:01:01,289 INFO  - # stack traceback:
    23:01:01,289 INFO  - # 	test/functional/eval/timer_spec.lua:166: in function <test/functional/eval/timer_spec.lua:154>

Log: http://neovim-qb.szakmeister.net/build/24288
Ref: https://github.com/neovim/neovim/pull/10364
2019-08-14 00:44:32 +02:00
02c52a18f5 style 2019-08-13 22:22:47 +02:00
cbfd18c85a startup: handle 'guicursor' after user config
If parse_shape_opt() is done before user config, the TUI may cause
unwanted changes to the terminal cursor which cannot later be undone
(see #4396).

fix #10750
2019-08-13 22:19:00 +02:00
c649e18131 Merge pull request #10752 from blueyed/vim-8.0.1179 2019-08-13 22:16:41 +02:00
db41d02e48 vim-patch:8.1.1842: test listed as flaky should no longer be flaky
Problem:    Test listed as flaky should no longer be flaky.
Solution:   Remove Test_popup_and_window_resize from the list of flaky tests.
            (Daniel Hahler, close vim/vim#4807)
9570aacdb8
2019-08-13 22:15:54 +02:00
4e6c596431 vim-patch:8.0.1179: Test_popup_and_window_resize() does not always pass
Problem:    Test_popup_and_window_resize() does not always pass.
Solution:   Do not use $VIMPROG, pass the Vim executable in the vimcmd file.
            (Ozaki Kiichi, closes vim/vim#2186)
631820536e

vim-patch:8.0.1526: no test using a screen dump yet

Problem:    No test using a screen dump yet.
Solution:   Add a test for C syntax highlighting.  Add helper functions.
da65058a9c

NOTE: uses modified `GetVimProg()` (which is used with skipped tests only
(mostly because of `!has('terminal')`)).

Vim uses a 'vimcmd' file, while Nvim uses `$NVIM_TEST_ARGX` environment
variables.

Ref: https://github.com/vim/vim/pull/4806
2019-08-13 22:15:54 +02:00
947bd293c9 clang/"null pointer dereference" #10755 2019-08-13 20:52:25 +02:00
5e1acd412b vim-patch:8.1.1843: might be freeing memory that was not allocated (#10756)
Problem:    Might be freeing memory that was not allocated.
Solution:   Have next_fenc() set the fenc_alloced flag. (closes vim/vim#4804)
f077db2423
2019-08-13 16:46:26 +02:00
90e44ecf11 build: link libraries by full path (for luv.so) (#10661)
Use "luv" as imported library to work around "-lluv" being used due to
missing SONAME.

Fixes https://github.com/neovim/neovim/issues/10407.
Ref: https://gitlab.kitware.com/cmake/cmake/issues/19578
Ref: https://github.com/NixOS/nixpkgs/issues/64400#issuecomment-516557253
2019-08-12 18:22:02 +02:00
a336a05e7e testdir/test_popup.vim: sync/align with Vim (#10751) 2019-08-12 17:10:48 +02:00
2037028b50 ex_getln.c: fix compute_cmdrow() not resetting lines_left (#10749)
Before this commit, when `inccomand` was set to `nosplit`, multi-line
substitutions collapsed the command-line.

This happened because when ex_getln.c:cursorcmd() computed a msg_row, it
was given a cmdline_row one line too high. This happened because
message.c:msg_puts_display() was supposed to decrement cmdline_row but
didn't, because of the `msg_no_more && lines_left == 0` check placed
just before the decrementation part in msg_puts_display's while loop.

Every time msg_puts_display writes a line, it decreases `lines_left` (a
variable used to know how many lines are left for prompts). Since
redrawcommandline() did not reset `lines_left` between calls to
msg_puts_display, every time a character was pressed, `lines_left` was
decremented. This meant that once the user pressed COLUMNS+ROWS numbers
of characters, `lines_left` would reach 0 and prevent msg_row from being
decremented.

It makes sense to fix setting `lines_left` to `cmdline_row` in
`compute_cmdrow` ; after all, computing where the command line row
should be placed is equivalent to computing how many `lines_left` of
output there are left.

Closes #8254.
2019-08-12 14:21:15 +02:00
ad4eb18e43 Merge #10098 'win: fix msg_puts_printf()' 2019-08-12 02:42:13 +02:00
71378a4030 free_buffer: rework b:changedtick handling #9163
- Re-enable Test_BufLeave_Wipe. 66f5e5c7d7

This is my (probably-wrong) application of Zyx's suggestion in #9163:

> free_buffer_stuff() already removes changedtick. It is better to
> make `free_options` a flag variable and avoid calling
> buf_init_changedtick() based on some flag there: current workflow
> looks weird as it first removes `b:changedtick`, then re-adds it
> by calling buf_init_changedtick(), then remove again.

> Also based on my understanding it looks logical to not remove
> `b:changedtick`, but to *replace* it with something allocated if
> needed based on examining reference count before calling
> `unref_var_dict`. Because now you have key disappearing from
> dictionary for no good reason.

Patch-By: Nikolai Aleksandrovich Pavlov <kp-pav@yandex.ru>
2019-08-12 02:17:49 +02:00
feee862064 vim-patch:8.0.1193: crash when wiping buffer after getbufinfo()
Problem:    Crash when wiping out a buffer after using getbufinfo().
            (Yegappan Lakshmanan)
Solution:   Remove b:changedtick from the buffer variables.

(Note: The test changes in vim-patch:8.0.1193 were already included.)
2019-08-12 02:17:49 +02:00
48dc6344d6 Merge pull request #10745 from blueyed/vim-8.1.1461
vim-patch:8.1.1461 / vim-patch:8.1.1462
2019-08-11 20:35:31 +02:00
6b028ec5f2 ci: AppVeyor: branches: only: master (#10746)
Only build PRs for master, and not other branches on the main repo, e.g.
when reverting via GitHub's UI.
2019-08-11 20:30:27 +02:00
ef1c100174 rebuild [skip travis] 2019-08-11 15:36:09 +02:00
6616d1d3e5 win/env: Vim-compat: Empty string deletes env var #10743
- Windows: `set FOO=` deletes environment variable FOO, and there is no
  way to set empty string expect by calling the API.
- Vim-compatible: `:let $FOO=""` deletes the environment variable.
- See also Test_WindowsHome().

ref: https://github.com/neovim/neovim/pull/10657#issuecomment-516368089
2019-08-11 15:32:07 +02:00
2193e68837 vim-patch:8.1.1462: MS-Windows: using special character requires quoting
Problem:    MS-Windows: using special character requires quoting.
Solution:   Add quotes. (Ken Takata)
c974022c31
2019-08-11 13:24:17 +02:00
143b02c573 vim-patch:8.1.1461: tests do not run or are not reliable on some systems
Problem:    Tests do not run or are not reliable on some systems.
Solution:   Use "findstr" instead of "grep" on MS-Windows. Clear
            PROMPT_COMMAND in the terminal test. Delete temp file. Wait for
            output after executing a debug command. (Yegappan Lakshmanan,
            closes vim/vim#4479)
ddd3308782

Ignored changes to testdir/test_terminal.vim.
2019-08-11 13:23:30 +02:00
0a98765b44 test_source.vim: move Test_source_sandbox 2019-08-11 13:23:30 +02:00
7d664837e1 win: expand nested env var #10662
Vim-compatible behavior for a Windows edge case.
2019-08-11 09:51:00 +02:00
e5d388f23a clang/"Argument with 'nonnull' attribute passed null" #10739
Problem:  In screen.c grid_char_needs_redraw clang warns
          that grid->chars could be NULL

Solution: Suggested by bfredl. Add explicit check
          grid->chars != NULL in grid_put_linebuf
          similar to grid_puts_len
2019-08-11 09:47:49 +02:00
c190415dc2 Merge pull request #10738 from bfredl/cmdwinclose
api/window: disallow closing non-current window in cmdwin state
2019-08-10 21:21:13 +02:00
d8d3719941 Merge #10737 from blueyed/vim-8.1.0911
vim-patch:8.1.0911: tag line with Ex command cannot have extra fields
2019-08-10 18:35:00 +02:00
67664c74f8 api/window: disallow closing non-current window in cmdwin state 2019-08-10 17:41:31 +02:00
ac395411cd testdir/test_taglist.vim: move Test_tagsfile_without_trailing_newline
Align with Vim.  Added in a79c0c8f7.
2019-08-10 17:21:47 +02:00
4109ee8ef4 vim-patch:8.1.0911: tag line with Ex command cannot have extra fields
Problem:    Tag line with Ex command cannot have extra fields.
Solution:   Recognize |;" as the end of the command. (closes vim/vim#2402)
943e9639a9
2019-08-10 17:21:18 +02:00
5f243fc68a API: nvim_win_close: Fix closing cmdline-window #10087 2019-08-10 13:41:35 +02:00
278c5d452c win/os_env_exists(): workaround libuv bug #10734
os_env_exists() fails on MSVC build:
    os_env_exists:104: uv_os_getenv(EMPTY_VAR) failed: -4094 UNKNOWN

- Revert 396a3945c4
- HACK: Windows: return TRUE if uv_os_getenv() returns UV_UNKNOWN, until
  libuv bug is fixed: https://github.com/libuv/libuv/issues/2413

ref 396a3945c4 (r34642361)
2019-08-10 11:48:36 +02:00
0062c65ba8 test/cmdline_spec: adjust "no-op"
(<Cmd>0<cr> is not really a no-op, it moves the cursor.)

Attempt to avoid flaky test:

    test/functional/ui/cmdline_spec.lua @ 830
    Failure message: ./test/functional/ui/screen.lua:579: Row 2 did not match.
    Expected:
    |                         |
    |*{1:~                        }|
    |{3:                         }|
    |:012345678901234567890123|
    |456789^                   |
    Actual:
    |                         |
    |*{3:                         }|
    |:012345678901234567890123|
    |:012345678901234567890123|
    |456789^                   |

    ./test/functional/ui/screen.lua:579: in function '_wait'
    ./test/functional/ui/screen.lua:367: in function 'expect'
    test/functional/ui/cmdline_spec.lua:841: in function <test/functional/ui/cmdline_spec.lua:830>

ref https://github.com/neovim/neovim/pull/10171#issuecomment-520134344
ref #10171
2019-08-10 11:46:26 +02:00
396a3945c4 test/environ_spec: Windows treats empty as undefined
ref #10657
2019-08-10 01:43:37 +02:00
43a8242cd5 vim-patch:8.1.1458: crash when using gtags #10704
Problem:    Crash when using gtags. (issue vim/vim#4102)
Solution:   Check for negative row or col in screen_puts_len(). (Christian
            Brabandt)
0b4c9eddb5
2019-08-10 00:21:52 +02:00
06d9cc734b exists(): return false for empty env var #10657
Fixes https://github.com/neovim/neovim/issues/3266
close #10657
2019-08-09 23:42:03 +02:00
5aa97937e7 Merge #10706 from janlazo/vim-8.1.1465
vim-patch:8.1.{1465,1467}
2019-08-09 23:32:23 +02:00
e2d6e67bbc Merge pull request #10171 from blueyed/vim-8.1.1318
vim-patch:8.1.1318: code for text changes is in a "misc" file
2019-08-09 19:25:56 +02:00
939d9053bd channels: reflect exit due to signals in exit status code (#10573)
Uses `128 + term_signal` in case of exit due to a signal.

Fixes https://github.com/neovim/neovim/issues/10571.
2019-08-09 15:34:06 +02:00
fa0c677a63 tests/functional: expect_msg_seq: use load_adjust (#10727)
Regardless of the comment "Big timeout for ASAN/valgrind" it would use
10s by default already.
This changes it to use `load_adjust`, which itself is only computed on
CI now, and outside of any tests - since it has side effects when being
used the first time!

The failure seen on AppVeyor:

    [ RUN      ] jobs can get the pid value using getpid: ERR
    test\functional\helpers.lua:167:
    ==============================================================================
    got 0 messages (ignored 0), expected 1
    stack traceback:
            test\functional\helpers.lua:167: in function 'expect_msg_seq'
            test/functional\core\job_spec.lua:288: in function <test/functional\core\job_spec.lua:281>

Log: https://ci.appveyor.com/project/neovim/neovim/builds/26537324/job/y1io66fbx399q7h6?fullLog=true#L6554
2019-08-09 15:32:38 +02:00
642e7daed5 Merge #9782 from janlazo/vim-8.1.0199
vim-patch:8.1.{199,200}
2019-08-09 12:00:47 +02:00
3c0d637592 clang/"Null passed as a nonnull parameter" #10718 2019-08-09 11:24:30 +02:00
8a56bd944a Merge #10708 'remove DYNAMIC_ICONV'
closes #3457
2019-08-09 11:19:37 +02:00
47b7b471fa :terminal : update buffer when switching tabpage #10700
fix #10696
2019-08-09 10:37:08 +02:00
a48896c6e7 vim-patch:8.1.1540: cannot build without +eval #10729
Problem:    Cannot build without the +eval feature.
Solution:   Define ex_const if needed.
0abb4273f6
2019-08-09 10:28:15 +02:00
4bb728dfa0 test: Minimize shada/helpers.lua #10728 2019-08-09 10:23:57 +02:00
480794146f f_spellbadword: set len=0 for non-found word
`len` is used with `list_append_string` later, and should reflect the
length of `word` (i.e. 0 when not setting word / breaking above).

Ref: neovim/neovim#9782 (comment)
2019-08-08 21:40:29 -04:00
d1ce15f696 vim-patch:8.1.0200: spellbadword() not tested
Problem:    spellbadword() not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3235)
872e451e8c
2019-08-08 21:31:20 -04:00
18888c15fc vim-patch:8.1.0199: spellbadword() does not check for caps error
Problem:    spellbadword() does not check for caps error. (Dominique Pelle)
Solution:   Adjust capcol when advancing.
66ab916935
2019-08-08 21:31:20 -04:00
25fff17d19 Merge pull request #10688 from bfredl/utf16lib
lua: minimal UTF-16 support needed for LSP
2019-08-09 00:00:55 +02:00
1f54f68732 lua: minimal UTF-16 support needed for LSP 2019-08-08 20:10:14 +02:00
ce628e1187 vim-patch:8.1.1824: crash when correctly spelled word is very long (#10725)
Problem:    Crash when correctly spelled word is very long. (Ben Kraft)
Solution:   Check word length before copying. (closes vim/vim#4778)
5bcc5a1ff9
2019-08-08 17:23:25 +02:00
e4bd31dbac tests: use module pattern with test/functional/helpers.lua (#10724) 2019-08-08 16:03:25 +02:00
0288ba6e38 build: Makefile: use _opt_pylint [ci skip] (#10720)
A separate rule it clearer, and allows for `make --keep-going lint` in
general later.

Ref: https://github.com/neovim/neovim/pull/10714
2019-08-08 16:02:59 +02:00
38a3af5dff tests: output_spec: use shell-test REP_NODELAY (#10726)
Fix flaky "shell command :! throttles shell-command output greater than ~10KB:":

    [ RUN      ] shell command :! throttles shell-command output greater than ~10KB:
    warning: Screen changes were received after the expected state. This indicates
    indeterminism in the test. Try adding screen:expect(...) (or wait()) between
    asynchronous (feed(), nvim_input()) and synchronous API calls.
      - Use screen:redraw_debug() to investigate; it may find relevant intermediate
        states that should be added to the test to make it more robust.
      - If the purpose of the test is to assert state after some user input sent
        with feed(), adding screen:expect() before the feed() will help to ensure
        the input is sent when Nvim is in a predictable state. This is preferable
        to wait(), for being closer to real user interaction.
      - wait() can trigger redraws and consequently generate more indeterminism.
        Try removing wait().

    ERR
    test/functional/ui/screen.lua:579: Failed to match any screen lines.
    Expected (anywhere): "
    %."
    Actual:
      |XXXXXXXXXX 591                                    |
      |XXXXXXXXXX 592                                    |
      |XXXXXXXXXX 593                                    |
      |XXXXXXXXXX 594                                    |
      |                                                  |
      |                                                  |
      |{3:-- TERMINAL --}                                    |
    stack traceback:
            test/functional/ui/screen.lua:579: in function '_wait'
            test/functional/ui/screen.lua:367: in function 'expect'
            test/functional/ui/output_spec.lua:63: in function <test/functional/ui/output_spec.lua:53>

Log: https://travis-ci.org/neovim/neovim/jobs/569082705#L5355
(gcc-functionaltest-lua)
2019-08-08 16:02:28 +02:00
2e01e7ce8a build/MSVC: Fix HAVE_ICONV_H #10697
Problem: HAVE_ICONV_H is not true in MSVC
Solution: Since iconv.h does not exist in the standard include directory
in MSVC, CMAKE_REQUIRED_INCLUDES must be set.

Note: This will be unnecessary after #10708.
2019-08-08 12:06:02 +02:00
1896c72a54 build: port FindLibVterm to LibFindMacros (#10395) 2019-08-08 06:39:18 +02:00
6ebe476675 build: clean up / remove X_USE_STATIC (#10713)
This was discouraged (as an option) in 5b5d353151 [1], not enabled/used by
default, and not working according to the comment in local.mk.example.

Taken out of https://github.com/neovim/neovim/pull/10395.

1: https://github.com/neovim/neovim/pull/2465
2019-08-07 22:19:55 +02:00
0167c2e0c9 ci: AppVeyor: fix upload of coverage for oldtest (#10721)
This was not working due to having another `python` in the PATH then.

Ref: https://ci.appveyor.com/project/neovim/neovim/builds/26492761/job/dspm40v5l2v6gn40?fullLog=true#L15955
2019-08-07 22:09:18 +02:00
564838159e lint 2019-08-07 14:21:23 +02:00
e269c1028b remove !has_mbyte branches
Ref: https://github.com/neovim/neovim/pull/10171#discussion_r292437832
2019-08-07 14:21:23 +02:00
0e3b9ea74d includes 2019-08-07 14:21:23 +02:00
aa6aa732e9 move ins_char 2019-08-07 14:21:23 +02:00
dfe8cab0c1 lint 2019-08-07 14:21:23 +02:00
f7fac33a1f move del_lines 2019-08-07 14:21:23 +02:00
41fa6079b2 lint/sync: truncate_line 2019-08-07 14:21:23 +02:00
be08d52e11 move truncate_line 2019-08-07 14:21:23 +02:00
33e6cffb9b lint/sync: open_line 2019-08-07 14:21:23 +02:00
2f225886b0 move open_line 2019-08-07 14:21:23 +02:00
b706b1f049 move copy_indent (from nvim's indent.c) 2019-08-07 14:21:23 +02:00
e454dce5e4 move del_bytes 2019-08-07 14:21:23 +02:00
0b3ee2e8ac move del_char, del_chars 2019-08-07 14:21:23 +02:00
75598927f2 move ins_str 2019-08-07 14:21:23 +02:00
c0f71ef826 move ins_char_bytes 2019-08-07 14:21:23 +02:00
664b6adebe move ins_bytes, ins_bytes_len 2019-08-07 14:21:23 +02:00
1117592f64 move unchanged 2019-08-07 14:21:23 +02:00
f717deea06 move changed_lines 2019-08-07 14:21:23 +02:00
b353d8599b move deleted_lines, deleted_lines_mark, changed_lines_buf 2019-08-07 14:21:23 +02:00
83d35e62f2 move appended_lines_mark 2019-08-07 14:21:23 +02:00
d9f2d53239 move appended_lines 2019-08-07 14:21:23 +02:00
c2cd9178ca remove inserted_bytes (comes via text properties, v8.1.0678) 2019-08-07 14:21:23 +02:00
ac6671946a move changedOneline, changed_bytes 2019-08-07 14:21:23 +02:00
53210c16d1 move changed_common 2019-08-07 14:21:23 +02:00
0e5314f56e move changed_int/changed_internal 2019-08-07 14:21:23 +02:00
a822b3e547 move changed 2019-08-07 14:21:23 +02:00
2a421e52e4 move change_warning 2019-08-07 14:21:23 +02:00
e8cd2bcf37 header 2019-08-07 14:21:23 +02:00
4a8a87c3a9 orig src/nvim/change.c 2019-08-07 14:21:23 +02:00
e4395e8e47 vim-patch:3f86ca0faa29cb862f876a97f87790f3a46a3858
Add missing files from patch 8.1.1318
3f86ca0faa
2019-08-07 14:21:23 +02:00
3a0505f83e vim-patch:8.1.1318: code for text changes is in a "misc" file
Problem:    Code for text changes is in a "misc" file.
Solution:   Move the code to change.c.
ec28d1516e
2019-08-07 14:21:23 +02:00
1d6e368159 Fix lualint: remove unused var 2019-08-07 14:20:23 +02:00
935ae63a48 cmakelists: fixed tests to avoid clang warnings (#10705)
* clang/"dead assignment"
* clang/"Uninitialized argument value"
2019-08-07 12:49:33 +02:00
4f148edd75 tests: more cleanup of plugin/shada_spec
Ref: https://github.com/neovim/neovim/pull/10701/commits/330a6713#r311005754
Closes https://github.com/neovim/neovim/pull/10710.
2019-08-07 12:47:21 +02:00
95e1ce24e8 build: lint: fix exit with optional pylint
Ref: https://github.com/neovim/neovim/pull/10714#issuecomment-518932355
2019-08-07 12:27:59 +02:00
d75fc87dec Merge pull request #10703 from ngortheone/clang_dead2
clang/"dead assignment": suppessed getchar.c

Possibly invalid, read on line 1972:
if (keylen >= 0 && keylen <= typebuf.tb_len) {
2019-08-07 10:27:07 +02:00
6fb0020df4 Merge pull request #10513 from bfredl/bytecount
api/lua: add {byte_count} parameter to line region change event
2019-08-06 20:25:46 +02:00
c0993ed343 lua: support getting UTF-32 and UTF-16 sizes of replaced text 2019-08-06 20:24:36 +02:00
dc1359bf8e Fix list_features to include space after first feature (#10711)
Regressed in e134cc9d4a: the use of list_in_columns was not adding a
space after the first features, because we do not start on a new line:

> Features: -acl+iconv +tui

This moves all the related code to `list_features`, and just joins them
with spaces.
2019-08-06 18:55:14 +02:00
8218d474fa build: move pylint to Makefile, optional with "make lint" (#10714)
This avoids errors when using "make lint", but "flake8" is not
available.  We do not want to install it then via third-party.
On CI "make pylint" is used explicitly.
2019-08-06 18:53:51 +02:00
e85b4e749e tests: unit.helpers: provide string with write errors (#10715)
This might help to have more information in case of errors, like
mentioned in https://github.com/neovim/neovim/commit/eec529cf9e.
2019-08-06 17:42:32 +02:00
b0e26199ec lua: add {old_byte_size} to on_lines buffer change event 2019-08-06 17:01:47 +02:00
d6f15ccc3c remove DYNAMIC_ICONV 2019-08-06 12:44:22 +09:00
11a6dac8c9 vim-patch:8.1.1467: cscope test fails
Problem:    Cscope test fails.
Solution:   Update expected text.
d6ec1730ba
2019-08-05 22:41:51 -04:00
ce7bcdec23 vim-patch:8.1.1465: allocating wrong amount of memory
Problem:    Allocating wrong amount of memory. (Yegappan Lakshmanan)
Solution:   Use sizeof() for right type of struct.
a37833dbd7
2019-08-05 22:40:48 -04:00
067a39ba85 Merge #10701 from justinmk/test-fixes
test: Eliminate plugin/helpers.lua
2019-08-06 01:36:01 +02:00
a29358dc58 Merge #10655 'environ(), getenv(), setenv()'
close #10655
2019-08-06 01:23:49 +02:00
d55b12ea50 f_environ: cleanup/refactor
- use os_getenvname_at_index / os_getenv
- f_getenv: empty (*p == NUL) is not null (undefined)
2019-08-06 01:23:11 +02:00
fd66ad2262 vim-patch:8.1.1305: there is no easy way to manipulate environment variables
Problem:    There is no easy way to manipulate environment variables.
Solution:   Add environ(), getenv() and setenv(). (Yasuhiro Matsumoto,
            closes vim/vim#2875)
691ddeefb5
2019-08-06 01:17:32 +02:00
b09e03c64d clang/"dead assignment": screen.c #10702
Suppress the warning.

mb_c and mb_l describe a char together, they are not independent variables. The
coupled assignments are good practice to avoid future confusion, even if the
current code doesn't use an assigned value.
2019-08-06 00:53:54 +02:00
512f24f71d clang/"dead assignment": suppessed
To ensure consistency and avoid possible errors in the code
the assigment is considered to be legit.
2019-08-05 18:40:31 -04:00
f6c9412436 test/mbyte_spec: skip broken test on QuickBuild
Forgot `return` in eec529cf9e.
2019-08-06 00:28:00 +02:00
330a6713bf test: Eliminate plugin/helpers.lua 2019-08-05 23:55:57 +02:00
7086751c5e vim-patch:8.1.1439: ga_grow(): 1.5x growth rate #10699
Problem:    Json_encode() is very slow for large results.
Solution:   In the growarray use a growth of at least 50%. (Ken Takata,
            closes vim/vim#4461)
c47ed44be7
2019-08-05 23:42:41 +02:00
f5d1e0e7b1 Merge pull request #10690 from bfredl/lua_print
lua: laundry list (crashes and additions)
2019-08-05 13:59:40 +02:00
88938634e7 lua: add vim.in_fast_event() to check if we are in a luv callback 2019-08-05 13:57:24 +02:00
e6d77993d1 lua: do not crash on syntax error in debug.debug() 2019-08-05 13:19:44 +02:00
d3a7bdefb0 lua: immediate-callback safe print() 2019-08-05 13:19:44 +02:00
51440204e7 Merge #10695 from justinmk/test-fixes
test: various fixes
2019-08-05 10:17:37 +02:00
d4a0b6c4e1 test/man_spec: remove plugin_helpers.reset()
The call to plugin_helpers.reset() is redundant with the clear() call
above it.  Probably just a copy-paste mistake.

Avoids exit_event race #8813.

Helped-by: Björn Linse <bjorn.linse@gmail.com>
2019-08-05 04:51:49 +02:00
eec529cf9e test/mbyte_spec: skip broken test on QuickBuild
14:13:04,119 INFO  - # ./test/unit/helpers.lua @ 760: mbyte utf_char2bytes for chars 0xa000 - 0xafff
    14:13:06,307 WARN  - E908: using an invalid value as a String
      /usr/home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/.deps/usr/bin/luajit:
      ./test/unit/helpers.lua:459: write() error: 32: Broken pipe
    14:13:06,308 WARN  - stack traceback:
    14:13:06,308 WARN  - 	[C]: in function 'throw'
    14:13:06,308 WARN  - 	...quests-automated/.deps/usr/share/lua/5.1/busted/core.lua:149: in function 'error'
    14:13:06,308 WARN  - 	...ts-automated/.deps/usr/share/lua/5.1/luassert/assert.lua:171: in function 'assert'
    14:13:06,308 WARN  - 	./test/unit/helpers.lua:459: in function 'write'
    14:13:06,308 WARN  - 	./test/unit/helpers.lua:626: in function 'hook'
    14:13:06,308 WARN  - 	./test/unit/helpers.lua:574: in function <./test/unit/helpers.lua:557>
    14:13:06,308 WARN  - 	[C]: in function 'type'
    14:13:06,308 WARN  - 	...d/.deps/usr/share/lua/5.1/busted/outputHandlers/base.lua:57: in function 'copyElement'
    14:13:06,308 WARN  - 	...d/.deps/usr/share/lua/5.1/busted/outputHandlers/base.lua:66: in function 'format'
    14:13:06,308 WARN  - 	...d/.deps/usr/share/lua/5.1/busted/outputHandlers/base.lua:172: in function 'fn'
    14:13:06,308 WARN  - 	...-requests-automated/.deps/usr/share/lua/5.1/mediator.lua:103: in function 'publish'
    14:13:06,308 WARN  - 	...quests-automated/.deps/usr/share/lua/5.1/busted/core.lua:201: in function 'safe'
    14:13:06,308 WARN  - 	...quests-automated/.deps/usr/share/lua/5.1/busted/core.lua:312: in function 'execute'
    14:13:06,308 WARN  - 	...sts-automated/.deps/usr/share/lua/5.1/busted/execute.lua:58: in function 'execute'
    14:13:06,308 WARN  - 	...ests-automated/.deps/usr/share/lua/5.1/busted/runner.lua:197: in function <...ests-automated/.deps/usr/share/lua/5.1/busted/runner.lua:11>
    14:13:06,308 WARN  - 	./.deps/usr/lib/luarocks/rocks/busted/2.0.0-1/bin/busted:3: in main chunk
    14:13:06,308 WARN  - 	[C]: at 0x004041a0
    14:13:06,323 WARN  - Terminated
    14:13:06,325 INFO  - Executing post-execute action...
    14:13:06,526 INFO  - Checking step execute condition...
    14:13:06,526 INFO  - Step execute condition satisfied, executing...
    14:13:06,706 INFO  - Executing pre-execute action...
    14:13:06,706 INFO  - Running step...
2019-08-05 04:19:36 +02:00
94afc201bc test: isCI(): add "name" parameter 2019-08-05 04:02:41 +02:00
c516586dc3 tests: fix flaky "TermClose … fast-exiting terminal job stops"
This extra retry() was removed (at my suggestion) in 5b94a2977a, but
it is probably needed: jobwait(…, timeout=0) could return while
channel_process_exit_cb() is still queued (so TermClose event didn't
fire yet).

    20:46:21,288 INFO  - not ok 547 - TermClose event triggers when fast-exiting terminal job stops
    20:46:21,288 INFO  - # test/functional/autocmd/termclose_spec.lua @ 20
    20:46:21,288 INFO  - # Failure message: ./test/functional/helpers.lua:98: Vim:E121: Undefined variable: g:test_termclose
    20:46:21,288 INFO  - # stack traceback:
    20:46:21,288 INFO  - # 	./test/functional/helpers.lua:98: in function 'eval'
    20:46:21,288 INFO  - # 	test/functional/autocmd/termclose_spec.lua:25: in function <test/functional/autocmd/termclose_spec.lua:20>
2019-08-05 03:52:17 +02:00
6871445dfe vim-patch:8.1.1383: warning for size_t/int mixup (#10694)
Problem:    Warning for size_t/int mixup.
Solution:   Change type. (Mike Williams)
d33a764123
2019-08-05 03:35:46 +02:00
45c34bd84a :doautocmd : Never show "No matching autocommands" #10689
The message is useless, it doesn't even mention the event name.

vim_dev discussion:
https://groups.google.com/forum/#!msg/vim_dev/RTbq58TMq9w/Xr4rSoUTCgAJ

ref: https://github.com/vim/vim/issues/4300
2019-08-05 03:33:45 +02:00
01ddb39699 vim-patch:8.1.1311: test: abort autocmd with exception #10692
Problem:    Aborting an autocmd with an exception is not tested.
Solution:   Add a test.  Also shows how to abort a command by throwing an
            exception.
23b5139234
2019-08-05 01:54:17 +02:00
a724209b5a vim-patch:8.1.1251: test completion of mapping keys #10691
Problem:    No test for completion of mapping keys.
Solution:   Add a test.  Also clean up the code.
2cb9f02532
2019-08-05 01:12:35 +02:00
4c35e6fe67 Makefile: only use pattern rules with BUILD_TYPE=Ninja (#10687)
While not doing any harm with "Unix Makefiles", they do not work there
as-is.  Therefore just do not use them then.

Followup to #10366 (7f6ff829a).
2019-08-04 17:13:04 +02:00
05712d4b20 runtime/matchit.vim: workaround broken 'packpath'
fix #10680
2019-08-04 16:49:10 +02:00
96be8a2c4d Merge #10161 from equalsraf/tb-clipboard-reload
Support "reload" of providers
2019-08-04 15:52:56 +02:00
2141dc2262 provider: check #Call() if g:loaded_xx_provider=2 2019-08-04 13:23:46 +02:00
e952b7fc2f health.vim: check has("debug") 2019-08-04 13:23:46 +02:00
5e6a08f2e6 provider: skip non-provider has() feature-names
We don't want to retry autoload sourcing (slow) for every random has()
query that finds it way to eval_call_provider().
2019-08-04 13:23:46 +02:00
241956720d provider: g:loaded_xx_provider=2 means "enabled and working"
Value of 1 cannot be used, because users might set that in their vimrc
to _disable_ a provider, which would confuse :checkhealth and has().
2019-08-04 13:23:46 +02:00
66938b928c provider: decide status by g:loaded_xx_provider 2019-08-04 13:23:46 +02:00
2cfe4748e5 provider: let providers decide their status
Instead of deciding provider status in eval_has_provider, move the
decision to the provider Vim scripts.

Previously, provider loading worked as follows:

1. eval_has_provider() verified provider availability by searching for
   the provider#providername#Call function and cached this verificaion as a static
   variable for some providers
2. providers short-circuited on loading to prevent the definition of the
   Call function (with the exception of the node provider that did not)

This commit changes the expected interface between nvim and its
providers to facilitate provider reloading, by splitting the
verification of the provider from the availability of the Call function.

eval_has_provider() now checks for a provider#providername#enabled
variable. It is up to the provider script to set this to 0 or 1
accordingly. eval_call_provider() remains unchanged.

All providers hosting a Call function were updated to respect this.

The clipboard provider now has a Reload function to reload the
provider.
2019-08-04 13:23:46 +02:00
2860453c4f doc: update 'shellredir' advice for powershell #10686
Encoding can be utf8, unicode, utf32.
User can choose to omit '-Encoding' to default to 'unicode'.

'ascii' encoding corrupts the following file:
https://www.w3.org/2001/06/utf-8-test/UTF-8-demo.html

Inspect 'foo.txt' with the following code after downloading the file.

Get-Content -Encoding UTF8 UTF-8-demo.html | Out-File -Encoding ascii foo.txt
2019-08-04 11:32:17 +02:00
0bb1008e7f Merge #10683 from janlazo/vim-8.1.1796
vim-patch:8.1.{1237,1796}
2019-08-03 19:14:47 +02:00
5dd860fd73 vim-patch:8.1.1237: error for using "compl", reserved word in C++
Problem:    Error for using "compl", reserved word in C++.
Solution:   Rename to "complp". (suggestion by Ken Takata)
52111f8231
2019-08-03 12:38:50 -04:00
01b2dac727 vim-patch:8.1.1796: :argdo is not tested
Problem:    :argdo is not tested
Solution:   Add a test.
72e1b39111
2019-08-03 11:38:52 -04:00
a49cf51269 build: require unibilium>=2.0 (#10681)
* build: require unibilium>=2.0

This also ports FindUnibilium to LibFindMacros, which was planned
anyway, and makes the version check easier.

With an older Unibilium our fallback code in `terminfo_from_builtin`
will not work (because it assumes the new data structures from 2.0.0 [1]),
and nvim would crash later because of `ut` being NUL.

1: 42f3cdd284
2019-08-03 15:20:28 +02:00
ae27406db2 ci: Travis: move gcc-functionaltest-lua to 2nd stage (#10682)
Ref: https://github.com/neovim/neovim/pull/10673#issuecomment-517733843
2019-08-03 14:55:27 +02:00
7e8dbb5958 Merge #10678 from janlazo/vim-8.1.1187
vim-patch:8.1.{1187,1761,1762,1775}
2019-08-03 13:59:41 +02:00
620a906406 vim-patch:8.1.1775: error message may be empty in filetype test
Problem:    Error message may be empty in filetype test.
Solution:   Use v:exception instead. (Daniel Hahler, closs vim/vim#4744)
eee9f65b2a
2019-08-02 19:51:04 -04:00
12fe0cf5f9 vim-patch:8.1.1762: some filetype rules are in the wrong place
Problem:    Some filetype rules are in the wrong place.
Solution:   Move to the right place.  Add a few more tests.
c273405188
2019-08-02 19:48:32 -04:00
d827a750f7 vim-patch:8.1.1761: filetype "vuejs" causes problems for some users
Problem:    Filetype "vuejs" causes problems for some users.
Solution:   Rename to "vue".
4248111497
2019-08-02 19:46:34 -04:00
cdd8540a20 vim-patch:8.1.1187: cannot recognize Pipfile
Problem:    Cannot recognize Pipfile.
Solution:   Use existing filetypes. (Charles Ross, closes vim/vim#4280)
3a4c53ba51
2019-08-02 19:44:37 -04:00
24fb7eefaa terminfo_start: use unibi_from_term, skip without TERM (#10670)
This is clearer/more explicit and avoids potential mismatch between what unibilium thinks vs what Nvim thinks.

For reference: e3b16d6219/uniutil.c (L203-L211)
2019-08-02 19:39:29 +02:00
a270c33b3a Merge #10675 from justinmk/vim-runtime
fix #10572
2019-08-02 19:22:23 +02:00
e2e220256e runtime/optwin.vim: missing 'previewpopup' feature
test_options.vim fails, so we need to disable this until the feature is
implemented.
2019-08-02 16:41:18 +02:00
df636003bf doc: remove "{not available ...}" noise 2019-08-02 16:36:42 +02:00
9bc4f275b3 vim-patch:5477506a9f01
Update runtime files.
5477506a9f

NA:
vim-patch:2a9c9f6d89f1 "undo extra changes in src/Makefile"
2a9c9f6d89
2019-08-02 16:20:23 +02:00
7c19a4e518 vim-patch:85850f3a5ef9
Update runtime files
85850f3a5e
2019-08-02 16:20:22 +02:00
1e4e890a76 vim-patch:396e829fa355
Update runtime files
396e829fa3
2019-08-02 16:20:22 +02:00
0d852bdc69 vim-patch:6c1e1570b134
Update runtime files
6c1e1570b1
2019-08-02 16:20:22 +02:00
bd23fefb39 vim-patch:12ee7ff00b91
Update runtime files
12ee7ff00b
2019-08-02 16:20:22 +02:00
ad9b781bba vim-patch:773a97c254d0
Update runtime files - Add typescript syntax and indent.
773a97c254
2019-08-02 16:20:22 +02:00
0414a33868 vim-patch:61da1bfa6c6b
Update runtime files.
61da1bfa6c
2019-08-02 16:20:22 +02:00
c6e4a29ad2 vim-patch:7dd64a3e57d2
Update runtime files.
7dd64a3e57
2019-08-02 16:20:22 +02:00
4ea8323667 vim-patch:68e6560b84f1
Update runtime files.
68e6560b84
2019-08-02 16:20:22 +02:00
bf6919f26b cleanup 2019-08-02 16:20:22 +02:00
1aedb9ed00 ci: Travis: move coverage job to first stage (#10673)
This swaps it with "gcc-32bit".
It is better to have the "coverage" job run than "gcc-32bit" in case of
flaky build failures - especially on master, since otherwise no base
coverage is available for future PRs.
2019-08-02 15:48:32 +02:00
7cf0119c68 Merge #10666 from justinmk/vim-runtime
vim-patch: runtime updates
2019-08-02 15:10:04 +02:00
b92a5bc3c4 Merge #10664 from janlazo/vim-8.1.1780
vim-patch:8.1.{1374,1780}
2019-08-02 06:01:46 +02:00
532ee54a42 vim-patch:a6c27c47ddf0
Update runtime files
a6c27c47dd
2019-08-01 23:27:26 +02:00
f379eac1ef vim-patch:911ead126903
Update runtime files
911ead1269

NA: vim-patch:602abeb20fb7
2019-08-01 23:12:33 +02:00
4d830ca31b vim-patch:62e1bb4a111e
Update runtime files.
62e1bb4a11

NA: vim-patch:496555fd1821
2019-08-01 22:58:20 +02:00
7f5402899b vim-patch:62e1bb4a111e
Update runtime files.
62e1bb4a11
2019-08-01 22:52:56 +02:00
31a5ec23eb vim-patch:723dd946f948
Update runtime files.
723dd946f9
2019-08-01 22:52:42 +02:00
2cdbbe50a4 vim-patch:63b74a8362b1
Update runtime files.
63b74a8362
2019-08-01 22:48:28 +02:00
41fe644124 vim-patch:26967617a30e
Update runtime files.
26967617a3

NA: vim-patch:55d81cd2a15d
2019-08-01 22:44:59 +02:00
a14fc7b159 vim-patch:f6b401090e81
Update runtime files
f6b401090e
2019-08-01 22:26:04 +02:00
47b4eb110d vim-patch:4c92e75dd4dd
Update runtime files.
4c92e75dd4

vim-patch:c854898881c0
Revert change accidentally included in runtime file updates.  Closes vim/vim#3998.
c854898881
2019-08-01 16:51:53 +02:00
87140f234a Merge #10646 'vim-patch: runtime patches' 2019-08-01 16:43:14 +02:00
5342342426 runtime: move matchit.vim to /pack/dist/opt/
Align matchit.vim with upstream Vim. We don't want to maintain a fork of
matchit.vim; our small changes should be sent to
https://github.com/chrisbra/matchit
2019-08-01 15:43:53 +02:00
1f6c9fd822 stream: log unwritten bytes, if any #10663 2019-08-01 15:26:22 +02:00
41bb68b8e8 process_stop: uv: do not close stdin first/explicitly #10584
- process_stop: do not close stdin explicitly. The "close stdin" step was from
  aa9cb48, before we fixed/reworked the SIGTERM timing logic. So it's probably
  outdated / no longer needed.
- win: jobstop: exit_code 15
   GetExitCodeProcess appears to return the used signal.
   https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getexitcodeprocess

ref #10573
2019-08-01 13:55:06 +02:00
c708567262 fileio: port hotfix from patch 8.1.1379
Patch 8.1.1379 includes a change to a test, added in Patch 8.1.0815.
Patch 8.1.0815 includes runtime doc changes to Blob.
Neovim does not support Blobs yet.
2019-08-01 04:35:23 -04:00
7995a5e964 vim-patch:8.1.1374: check for file changed triggers too often
Problem:    Check for file changed triggers too often.
Solution:   Don't use "b_p_ar" when it is negative.
c97582b029
2019-08-01 04:29:39 -04:00
28946c285b lint 2019-08-01 04:20:35 -04:00
309296545c vim-patch:8.1.1780: warning for file no longer available is repeated
Problem:    Warning for file no longer available is repeated every time Vim is
            focused. (Brian Armstrong)
Solution:   Only give the message once. (closes vim/vim#4748)
674e2bde6e
2019-07-31 21:49:36 -04:00
65578693b2 Merge #10654 from ngortheone/clang/npd_helptags_one
clang/"null pointer dereference": ex_cmds.c
2019-07-31 07:22:12 +02:00
208f56d3b9 ci: Travis: improve/revisit caching (#10358)
- use CACHE_NVIM_DEPS_DIR

- do not cache pip
  This is handled through http caches in general/better, and it is not
  used much anyway.

- do not cache DEPS_DOWNLOAD_DIR
  Built deps are cached, downloads are not needed then.

- display ccache stats before clearing

- do not cache ccache stats

- improve output of `du` (do not list pages of output for "/home/travis/.cache/go-build")
2019-07-30 23:21:12 +02:00
6fc0a9f557 lint: helptags_one 2019-07-30 16:58:28 -04:00
6e01ed6a4c vim-patch:8.1.0572: stopping a job does not work properly on OpenBSD
Problem:    Stopping a job does not work properly on OpenBSD.
Solution:   Do not use getpgid() to check the process group of the job
            processs ID, always pass the negative process ID to kill().
            (George Koehler, closes vim/vim#3656)
76ab4fd619

Ref: https://github.com/neovim/neovim/issues/9704
Ref: https://github.com/neovim/neovim/issues/10182#issuecomment-514450069
Closes https://github.com/neovim/neovim/pull/10660
2019-07-30 18:41:38 +02:00
da87b67812 tests: runnvim.vim: do not call jobstop() (#10659)
It should be done for timeouts only (-1, not != -1), but the job is
stopped via `:bwipeout!` already also in that case.

Fixes E900 with timing out tests:

    "test_xxx.tlog" "test_xxx.tlog" [New] 183L, 13375C written
    Error detected while processing function Main:
    line   37:
    E900: Invalid channel id================================================================================
2019-07-30 15:08:05 +02:00
7f6ff829aa Makefile: use pattern rules for build/.deps [ci skip] (#10366)
This allows for `make build/bin/nvim`,
`make build/src/nvim/auto/funcs.generated.h` etc.
2019-07-30 13:53:33 +02:00
be6bf75d79 Merge pull request #10656 from blueyed/minor
Minor: align test, fix comment/usage
2019-07-30 11:45:41 +02:00
b117754a8b gen_eval.lua: use correct name in usage 2019-07-30 10:37:41 +02:00
08ed3d6523 tests: use Vim's version for patch 8.1.0005
Not sure what happened in daca22f5b / #8821, but Vim used assert_match /
no expand in vim/vim@d19b23415 (8.1.0005) already.
2019-07-30 10:35:44 +02:00
213b6b5c28 vim-patch: handle tags, pass through git-log options (#10140)
* scripts/vim-patch.sh: fall back to "origin" for remote

Without this, it would fail e.g. with a locally cloned repo of Neovim.

* scripts/vim-patch.sh: assign_commit_details: handle tags  [ci skip]

- Handle "v" prefix from Vim tags.
- Exit in case of error therein already.

* -l/-L: pass through git-log options  [ci skip]

This allows for only listing missing patches for a given Vim file:

> scripts/vim-patch.sh -L src/edit.c
2019-07-30 07:45:59 +02:00
35ec60f73a Merge pull request #10648 from blueyed/autopep8
ci: py: flake8 fixes
2019-07-30 07:32:47 +02:00
11ed7377f9 clang/"null pointer dereference": ex_cmds.c 2019-07-29 22:56:59 -04:00
d651710de1 ci: pylint target via flake8
Ref: https://github.com/neovim/neovim/pull/10631#issuecomment-515756591
2019-07-29 22:14:23 +02:00
d7b04ae7a7 py: flake8 fixes 2019-07-29 22:14:23 +02:00
97ce776e7b scripts: autopep8 2019-07-29 22:14:23 +02:00
bae02eb396 Merge #10645 from janlazo/vim-8.1.0999
vim-patch:8.1.{1005,1041,1049,1052,1053,1086,1394}
2019-07-29 20:59:38 +02:00
62b5f25b6b vim-patch:94688b8a2a1f
Add missing matchit file.
94688b8a2a
2019-07-29 20:50:07 +02:00
57fa9add79 vim-patch:314dd79cac2a
Update runtime files.
314dd79cac
2019-07-29 20:50:07 +02:00
b5cb6c743a vim-patch:2a953fcf107d
Updated runtime files.
2a953fcf10
2019-07-29 20:50:07 +02:00
6fed505100 vim-patch:d09091d4955c
Update runtime files.
d09091d495
2019-07-29 20:50:07 +02:00
ef1f1907cc vim-patch:4c05fa08c973
Update runtime files
4c05fa08c9
2019-07-29 20:50:07 +02:00
4cab90ad8c vim-patch:c8c884926750
Update runtime files.
c8c8849267
2019-07-29 20:50:07 +02:00
b3d4e2d6dc vim-patch:c33181c44ccb
Ignore output files from indent tests.
c33181c44c
2019-07-29 20:50:07 +02:00
aa680f6acb vim-patch:9d87a37ee9d8
Update runtime files.
9d87a37ee9
2019-07-29 20:50:07 +02:00
c8f34a9a3e vim-patch:d47d52232bf2
Update runtime files.
d47d52232b
2019-07-29 20:50:07 +02:00
ab2cfd24e7 vim-patch:b730f0c7ba36
Update runtime files
b730f0c7ba
2019-07-29 20:50:07 +02:00
28a681d37d vim-patch:f0d58efc9dc4
Update runtime files.
f0d58efc9d
2019-07-29 20:50:07 +02:00
80dda68926 vim-patch:ba3ff539303c
Update runtime files
ba3ff53930
2019-07-29 20:50:07 +02:00
f64486b6b6 vim-patch:790c18bfa5df
Update runtime files
790c18bfa5
2019-07-29 20:50:07 +02:00
6e03f87e09 Merge #10615 'vim-patch:8.1.0053'
fix #10604
2019-07-29 20:43:44 +02:00
454902d663 PVS/V507: suppress false positive #10647
The pointer does not outlive the value in local scope as it gets
reassigned immediately after scope.
2019-07-29 19:57:16 +02:00
ea14d8d493 vim-patch:8.1.0053 use typval_T in the caller of call_vim_function
Problem:	unreliable types for complete function arguments
Solution:	fix argument type for functions w/ unreliable type conversion(Ozaki Kiichi)
vim/vim#2993
2019-07-29 19:56:02 +02:00
696334181f build/macOS: enable fallthrough attribute #10653 2019-07-29 19:51:49 +02:00
d6b31721bf vim-patch:8.1.1086: too many curly braces
Problem:    Too many curly braces.
Solution:   Remove curly braces where they are not needed. (Hirohito Higashi,
            closes vim/vim#3982)
abab0b0fdd

Neovim code style requires the opposite.
Add curly braces to minimize lint errors when applying Vim patches.
2019-07-28 23:44:36 -04:00
b388f46266 buffer: add attributes to pure functions 2019-07-28 22:19:11 -04:00
01e3690ca8 vim-patch:8.1.1049: when user tries to exit with CTRL-C message is confusing
Problem:    When user tries to exit with CTRL-C message is confusing.
Solution:   Only mention ":qa!" when there is a changed buffer. (closes vim/vim#4163)
a84a3dd663

vim-patch:8.1.1052: test for CTRL-C message sometimes fails

Problem:    test for CTRL-C message sometimes fails
Solution:   Make sure there are no changed buffers.
553e5a5c56

vim-patch:8.1.1053: warning for missing return statement

Problem:    Warning for missing return statement. (Dominique Pelle)
Solution:   Add return statement.
d6c3f1fa2b
2019-07-28 22:19:11 -04:00
4c50f0dc76 vim-patch:8.1.1041: test for Arabic no longer needed
Problem:    Test for Arabic no longer needed.
Solution:   Remove the test for something that was intentionally left out.
295e3ba31f
2019-07-28 22:05:51 -04:00
00e882e6f6 vim-patch:8.1.1394: not restoring t_F2 in registers test
Problem:    Not restoring t_F2 in registers test.
Solution:   Assign to &t_F2 instead of t_F2. (Andy Massimino, closes vim/vim#4434)
a5e44600eb
2019-07-28 22:05:51 -04:00
c53e78e125 vim-patch:8.1.1005: test fails because t_F2 is not set
Problem:    Test fails because t_F2 is not set.
Solution:   Add try-catch.
55d81cd2a1
2019-07-28 22:05:51 -04:00
3cf4b0d5e5 Merge #10641 from ngortheone/pvs/V560_6
pvs/V560: part of conditional expression is always false
2019-07-29 03:37:17 +02:00
1c74c7c446 lint: makemap
* if braces
* spaces
* post increments
* comment style
2019-07-28 21:10:49 -04:00
ed5f891e83 pvs/V560: part of conditional expression is always false
makemap: same condition is used to skip outer loop cycle
2019-07-28 20:48:44 -04:00
caa8c06bae vim-patch:8.1.1138: add CompleteChanged #10644
(This was originally a Neovim patch, but this commit merges some changes
from the Vim patch.)

d7f246c68c
2019-07-29 02:36:46 +02:00
505f47403b vim-patch:8.1.0017: shell command completion has duplicates #10616
Problem:    Shell command completion has duplicates. (Yegappan Lakshmanan)
Solution:   Use a hash table to avoid duplicates. (Ozaki Kiichi, closes vim/vim#539, closes vim/vim#2733)
62fe66f251
2019-07-29 01:25:54 +02:00
16727dcf1e clang/"dead assignments" #10620
Also revert possibly-wrong change in f_sign_getplaced() from
652be3cb00.
2019-07-29 00:52:24 +02:00
Jit
7cc2b723d4 TextYankPost: spurious/too-early dispatch during delete #10392
Problem: delete-with-register dispatches TextYankPost before updating yank registers
Solution: Add flag to op_yank().

Fixes #10225
2019-07-29 00:50:11 +02:00
4213492231 Merge #10643 from janlazo/vim-8.1.1765
vim-patch:8.1.{990,992,1765}
2019-07-29 00:34:47 +02:00
00d915d021 PVS/V547: expression is always true/false #10640
Functions marked with FUNC_ATTR_NONNULL_RET do not return NULL.
Remove redundant checks.
2019-07-29 00:11:54 +02:00
b457a58e34 vim-patch:8.1.0990: floating point exception with "%= 0" and "/= 0"
Problem:    Floating point exception with "%= 0" and "/= 0".
Solution:   Avoid dividing by zero. (Dominique Pelle, closes vim/vim#4058)
e21c1580b7
2019-07-28 17:19:20 -04:00
f5b5f60b86 PVS/V512: memcpy overflow/underflow #10642
problem:  bfredl: pvs thinks the type of the pointed
          at item is too small.
solution: refactored address calculation.
2019-07-28 23:05:18 +02:00
98d389ce55 vim-patch:8.1.1765: get(func, dict, def) does not work properly
Problem:    get(func, dict, def) does not work properly.
Solution:   Handle NULL dict better. (Takuya Fujiwara, closes vim/vim#4734)
f91aac5e3e
2019-07-28 16:11:54 -04:00
fe2ada7375 PVS/V560: condition is always false #10638
* shorten_buf_name: condition inside outer if-branch with inverse condition
2019-07-28 21:28:53 +02:00
3b82c075b3 vim-patch:8.0.1753: fix various warnings #10639
vim-patch:8.0.1753: various warnings from a static analyser
Problem:    Various warnings from a static analyser
Solution:   Remove unneeded conditions.
1c17ffa461
2019-07-28 21:26:17 +02:00
6953e151bb context: shada_encode_regs(): init WriteMergerState #10637
- Check shada_pack_xx() result, abort on failure.
- Use xcalloc() to zero-initialize `wms`, fixes below ASAN failure.

ASAN failure (running vim_spec.lua in a loop):

    ../src/nvim/shada.c:1773:13: runtime error: load of value 224, which is not a valid value for type 'bool'
    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/nvim/shada.c:1773:13

Adding an explicit check just before the ASAN failed line:

    case kSDItemRegister: {
      if (*((int *)(void *)&entry.data.reg.is_unnamed) != 1
          && *((int *)(void *)&entry.data.reg.is_unnamed) != 0) {
        abort();

    (gdb) p entry.data.reg
    +p entry.data.reg
    $5 = {name = 49 '1', type = kMTLineWise, contents = 0x60200000c250, is_unnamed = true, contents_size = 1, width = 0, additional_data = 0x0}
    (gdb) p *((uint8_t *)(void *)&entry.data.reg.is_unnamed)
    +p *((uint8_t *)(void *)&entry.data.reg.is_unnamed)
    $7 = 2049
2019-07-28 19:39:03 +02:00
cfa2759df6 PVS/V560: expression is always false/true #10623 2019-07-28 17:58:24 +02:00
10fd5ae277 vim-patch:7.4.2213: runtime parts with EndOfBuffer port #10635
Problem:    Cannot highlight the "~" lines at the end of a window differently.
Solution:   Add the EndOfBuffer highlighting. (Marco Hinz, James McCoy)
58b853460a

Includes minor doc parts from 7.4.1304 for runtime/doc/eval.txt.
2019-07-28 13:27:03 +02:00
48884ac3b3 ci: Travis: no need for asan_symbolize (#10627)
Having llvm-symbolizer in the $PATH is enough.

- check_logs: remove log after displaying it
  Otherwise it would be displayed/symbolized again and again.

E.g. in https://api.travis-ci.org/v3/job/564477704/log.txt.
2019-07-28 11:48:54 +02:00
05fa1cb3f4 src/clint.py: flake8 fixes [ci skip] (#10631) 2019-07-28 11:48:24 +02:00
256608a13b vim-patch:b1c9198af (#10634)
Vim 8.1 release

Update version number and information.  Fix a couple of tests.
b1c9198afb
2019-07-28 11:48:07 +02:00
b5c44b66eb Merge #10628 from notomo/vim-8.1.1759 2019-07-28 11:15:30 +02:00
f4942a63f9 build/tests: remove pre/uv.h #10531
Initially done in 28e59cb22, but does not appear to be necessary
anymore.

Uses UV_EEXIST directly, just like UV_ENOENT.
2019-07-28 11:10:22 +02:00
e0f2c36667 PVS/V560: condition is always true #10630
earlier condition leads to short-circuit of the loop
2019-07-28 11:08:41 +02:00
ce59a70f5b PVS/V560: condition is always true #10624
* before changed line status variable is set to RA_FAIL in 2 places
line 3816 and 3826, both lead to short-circuit of the loop, making
comparing it to RA_FAIL useless

close #10624
2019-07-28 10:59:44 +02:00
5b47ee5b7a pvs/V560: part of conditional expression is always true (#10629)
Since timed_out is pointer to int  condition timed_out != NULL && timed_out makes no sense as both are effectively the same thing. Most likely the first check was meant to guard the dereference of the second.
Wrong import of Vim patch (8.0.0643).
2019-07-28 05:16:14 +02:00
32a6b5601b Fix clint error 2019-07-28 09:22:46 +09:00
08c7e206cc vim-patch:8.1.1759: no mode char for terminal mapping from maparg()
Problem:    No mode char for terminal mapping from maparg().
Solution:   Check for TERMINAL mode. (closes vim/vim#4735)
14371ed697
2019-07-28 08:00:52 +09:00
dedcd3ad1e vim-patch:8.1.0053 use typval_T in the caller of call_vim_function
Problem:	unreliable types for complete function arguments
Solution:	fix argument type for functions w/ unreliable type conversion(Ozaki Kiichi)
vim/vim#2993
2019-07-28 00:19:41 +02:00
7f5a113f65 vim-patch:8.1.1748: :args output is not aligned (#10625)
Problem:    :args output is not aligned.
Solution:   Output a line break after the last item in a row.
74da39373c

vim-patch:8.1.1750: depending on the terminal width :version may miss a line break

Problem:    Depending on the terminal width :version may miss a line break.
Solution:   Add a line break when needed.
8a5c29aee9

vim-patch:8.1.1760: extra line break for wrapping output of :args

Problem:    Extra line break for wrapping output of :args.
Solution:   Avoid the extra line break. (Daniel Hahler, closes vim/vim#4737)
9800bfe0fc
2019-07-27 23:48:32 +02:00
8e6b0a73c9 Merge #10619 'API: context' 2019-07-27 22:56:05 +02:00
b6278bbf12 API: Context: save/restore 2019-07-27 22:14:58 +02:00
0e23ee3cc7 vim-patch:8.1.0956: context:0 in 'diffopt' #10622
Problem:    Using context:0 in 'diffopt' does not work well.
Solution:   Make zero context do the same as one line context. (closes vim/vim#4005)
b9ddda6c2d
2019-07-27 20:33:33 +02:00
691deca2e8 eval: context: add ctx-family functions 2019-07-27 16:36:56 +02:00
a80f691a6a API: Context 2019-07-27 16:36:56 +02:00
411a06c8b6 API: Context 2019-07-27 16:36:57 +02:00
0364e47ccb vim-patch:8.1.53 use typval_T in the caller of call_vim_function
Problem:	unreliable types for complete function arguments
Solution:	fix argument type for functions w/ unreliable type conversion(Ozaki Kiichi)
vim/vim#2993
2019-07-27 16:25:33 +02:00
997601d966 ci: AppVeyor: DEPS_BUILD_DIR is not a CMake variable [ci skip] (#10613)
Fixes:

> CMake Warning:
> Manually-specified variables were not used by the project:
>
>   DEPS_BUILD_DIR
2019-07-27 11:55:17 +02:00
7be85ed0f5 ci: Travis: single osx job [ci skip] (#10614)
The "osx" jobs are the slowest ones, and often still flaky.

I think it is good enough to have a single one there (since they only use
different compilers).
This should improve build times in general (with multiple running
builds, since we're using less jobs per build), and also make flaky job
failures less likely.
2019-07-27 11:50:44 +02:00
0b4123668a ci: Travis: gcc-9: use gcov-9 (#10609) 2019-07-27 02:04:49 +02:00
709e87792f tests: test_arglist.vim: align with Vim [ci skip] (#10612)
This just moves the test to where it is in Vim.
2019-07-27 01:47:12 +02:00
af01b347d8 Merge #10606 'vim-patch:8.1.0404' 2019-07-27 01:33:58 +02:00
e1a5c29b93 ci: Travis: remove clang-tsan from allowed failures [skip ci] (#10591)
While it still might be flaky sometimes, it is far better than the
osx jobs in general, and due to it being allowed to fail, we are not
getting aware of more recent (flaky) issues due to building tags during
make-install, which might indicate a more generic problem.
2019-07-27 01:32:02 +02:00
809613c952 Merge pull request #10580 from blueyed/tests-cat
tests: use "cat" also on Windows
2019-07-27 00:59:27 +02:00
53d1801b49 tests: win: fix "cat" with PowerShell
Ref: https://github.com/neovim/neovim/pull/10580#issuecomment-514884092
2019-07-26 21:45:24 +02:00
2906c702f9 tests: use "cat" also on Windows
Fixes https://github.com/neovim/neovim/issues/10574.

Keeps 'can be called recursively' pending for now, see
https://github.com/neovim/neovim/pull/10580#issuecomment-515295571.
2019-07-26 21:45:00 +02:00
2b731a388a vim-patch:8.1.1747: unused variables #10605
Problem:    Compiler warning for unused variables. (Tony Mechelynck)
Solution:   Add #ifdef.
fbfb757d4c
2019-07-26 11:21:44 +02:00
0fb05b2c7d Revert "vim-patch:8.1.0430: Xargadd file left behind after running test"
This reverts commit ce1b4f95fe.
2019-07-26 05:19:05 -04:00
cbda383efe vim-patch:8.1.0404: accessing invalid memory with long argument name
Problem:    Accessing invalid memory with long argument name.
Solution:   Use item_count instead of checking for a terminating NULL.
            (Dominique Pelle, closes vim/vim#3444)
e961cba3cb
2019-07-26 05:19:05 -04:00
b42bfa599b Merge #10589 'os/fs: introduce os_fopen()' 2019-07-26 11:18:19 +02:00
2731080212 cleanup: remove mch_fopen in favor of os_fopen 2019-07-25 22:32:23 +02:00
bb3a0099c6 os/fs: introduce os_fopen()
Windows: Using fopen() directly may need UTF-16 filepath conversion. To
achieve that, os_fopen() goes through os_open().

fix #10586
2019-07-25 22:32:23 +02:00
8a9c9a9963 PVS/V768: do use enum as bool #10582
Fix win_draw_end invocation, pass HLF symbol explicitly.
2019-07-25 21:57:58 +02:00
36622014c6 Merge #10596 'vim-patch:8.1.{899,903,905,907,908,910,913,1746}'
close #9930
close #10051
2019-07-25 12:00:08 +02:00
0925afcfcf regexp: add function attributes 2019-07-25 03:34:26 -04:00
98fcf66b7a vim-patch:8.1.0913: CI crashes when running out of memory
Problem:    CI crashes when running out of memory.
Solution:   Apply 'maxmempattern' also to new regexp engine.
688b3983d8
2019-07-25 03:02:22 -04:00
52488ea6fb vim-patch:8.1.0910: crash with tricky search pattern
Problem:    Crash with tricky search pattern. (Kuang-che Wu)
Solution:   Check for runnning out of memory. (closes vim/vim#3950)
15bbd6ec87
2019-07-25 02:39:24 -04:00
fb059a1741 vim-patch:8.1.0907: CI tests on AppVeyor are failing
Problem:    CI tests on AppVeyor are failing.
Solution:   Reduce the recursiveness limit for regexp.
5382f12c91
2019-07-25 02:21:32 -04:00
a77e5b3606 vim-patch:8.1.0905: complicated regexp causes a crash
Problem:    Complicated regexp causes a crash. (Kuang-che Wu)
Solution:   Limit the recursiveness of addstate(). (closes vim/vim#3941)
5567ad48b6
2019-07-25 02:04:32 -04:00
8e490b98cc regexp: use fixed types to avoid overflow 2019-07-24 21:50:16 -04:00
33ce6a7f62 Checks for overflow when parsing string to int 2019-07-24 21:43:04 -04:00
43f4e5d5be vim-patch:8.1.0908: can't handle large value for %{nr}v in regexp
Problem:    Can't handle large value for %{nr}v in regexp. (Kuang-che Wu)
Solution:   Give an error if the value is too large. (closes vim/vim#3948)
9403a2168d
2019-07-24 21:43:04 -04:00
9ea449085d vim-patch:8.1.1746: ":dl" is seen as ":dlist" instead of ":delete"
Problem:    ":dl" is seen as ":dlist" instead of ":delete".
Solution:   Do not use cmdidxs2[] if the length is 1. (closes vim/vim#4721)
94f82cbacf
2019-07-24 21:43:04 -04:00
80487b59c9 vim-patch:8.1.0903: struct uses more bytes than needed
Problem:    Struct uses more bytes than needed.
Solution:   Reorder members of regitem_S. (Dominique Pelle, closes vim/vim#3936)
beb7574d6b
2019-07-24 19:46:09 -04:00
2385039623 vim-patch:8.1.0899: no need to check restricted mode for setwinvar()
Problem:    No need to check restricted mode for setwinvar().
Solution:   Remove check_restricted().
e0fb7d1e38
2019-07-24 19:46:09 -04:00
d1faf900b1 coverage: use "cd" with gcovr (#10594)
This makes the invocation compatible for the upcoming gcovr 4.2 release,
and is the correct way of invoking it.

Ref: https://github.com/gcovr/gcovr/commit/a782972#commitcomment-34420728
2019-07-25 01:11:17 +02:00
b8fcf62da9 vim-patch:8.1.1740: exepath() doesn't work for "bin/cat" (#10556)
Problem:    Exepath() doesn't work for "bin/cat".
Solution:   Check for any path separator. (Daniel Hahler, closes vim/vim#4724,
            closes vim/vim#4710)
d08b8c4c04

Fixes https://github.com/neovim/neovim/issues/10554.
2019-07-24 22:23:00 +02:00
3566267e75 vim-patch:8.1.1738: testing lambda with timer is slow (#10590)
Problem:    Testing lambda with timer is slow.
Solution:   Do not test timer accuracy, only that it works. (Daniel Hahler,
            closes vim/vim#4723)
9bc4dde45d
2019-07-24 19:47:41 +02:00
8404e8df20 third-party: download: retry (#10599)
This is meant to handle the common case of failing to download
libtermkey:

    FAILED: cd /home/travis/build/neovim/neovim/deps-downloads/libtermkey && /usr/local/cmake-3.12.4/bin/cmake -DPREFIX=/home/travis/nvim-deps/build -DDOWNLOAD_DIR=/home/travis/build/neovim/neovim/deps-downloads/libtermkey -DURL=http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.21.1.tar.gz -DEXPECTED_SHA256=cecbf737f35d18f433c8d7864f63c0f878af41f8bd0255a3ebb16010dc044d5f -DTARGET=libtermkey -DUSE_EXISTING_SRC_DIR=OFF -P /home/travis/build/neovim/neovim/third-party/cmake/DownloadAndExtractFile.cmake && /usr/local/cmake-3.12.4/bin/cmake -E touch /home/travis/nvim-deps/build/src/libtermkey-stamp/libtermkey-download
    -- file: /home/travis/build/neovim/neovim/deps-downloads/libtermkey/libtermkey-0.21.1.tar.gz
    -- downloading...
         src='http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.21.1.tar.gz'
         dst='/home/travis/build/neovim/neovim/deps-downloads/libtermkey/libtermkey-0.21.1.tar.gz'
         timeout='none'
    CMake Error at /home/travis/build/neovim/neovim/third-party/cmake/DownloadAndExtractFile.cmake:77 (message):
      error: downloading
      'http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.21.1.tar.gz' failed
        status_code: 6
        status_string: "Couldn't resolve host name"
        log: Curl_ipv4_resolve_r failed for www.leonerd.org.uk
      Couldn't resolve host 'www.leonerd.org.uk'
      Closing connection 0

Co-Authored-By: Justin M. Keyes <justinkz@gmail.com>
2019-07-24 19:11:27 +02:00
431cf56e2f ci: RunTests: ensure that the logfile gets displayed (#10597)
This is meant to help with test failures where e.g. `busted` itself might
crash or get killed.

Ref: https://github.com/neovim/neovim/issues/10182#issuecomment-514450069
2019-07-24 18:12:55 +02:00
06547cdfc0 sign: REMOVE FEAT_SIGN_ICONS, dead code #10595 2019-07-24 12:17:53 +02:00
451f6046b0 tests: AppVeyor: fix test/functional/ex_cmds/arg_spec.lua (#10598)
For unknown reasons it does not have the trailing space in `:args`
output there anymore:

    [  FAILED  ] test/functional\ex_cmds\arg_spec.lua @ 11: :argument does not restart :terminal buffer
    test/functional\ex_cmds\arg_spec.lua:25: Expected objects to be the same.
    Passed in:
    (string) '
    [term://.//4552:C:\Windows\system32\cmd.exe]'
    Expected:
    (string) '
    [term://.//4552:C:\Windows\system32\cmd.exe] '
    stack traceback:
            test/functional\ex_cmds\arg_spec.lua:25: in function <test/functional\ex_cmds\arg_spec.lua:11>

The test is not about that though, and this can be made less strict by
using `trim()`.  The new test in `test_arglist.vim` for no trailing
newline is OK, and contains trailing spaces.  So this is likely due to
the length of it exceeding the column width already.
2019-07-24 09:31:46 +02:00
733e1a0e73 vim-patch:8.1.1737: :args command that outputs one line gives more prompt
Problem:    :args command that outputs one line gives more prompt.
Solution:   Only output line break if needed. (Daniel Hahler, closes vim/vim#4715)
949f1989cb

Closes https://github.com/neovim/neovim/pull/10147.
2019-07-24 06:14:12 +02:00
e134cc9d4a vim-patch:8.0.1738: ":args" output is hard to read
Problem:    ":args" output is hard to read.
Solution:   Make columns with the names if the output is more than one line.
5d69da462f

vim-patch:8.0.1740: warning for signed-unsigned incompatibility

Problem:    Warning for signed-unsigned incompatibility.
Solution:   Change type from "char *" to "char_u *". (John Marriott)
405dadb63e

Removes ported legacy test that was re-added later.
Ref: https://github.com/neovim/neovim/pull/10147#issuecomment-512609513
2019-07-24 06:09:28 +02:00
8fc93241d6 tests: fix/improve Screen:expect_unchanged (#10577)
Do not sleep before collecting initial state.

Ref: https://github.com/neovim/neovim/pull/10550#issuecomment-513670205
2019-07-24 02:50:24 +02:00
b59a1f7b52 ci: restore accidentally removed config (#10592) 2019-07-24 02:16:09 +02:00
f08d10a0df tests: re-enable "tab drag in tabline to the left moves tab left" (#10588)
Ref: https://github.com/neovim/neovim/pull/4874
2019-07-24 02:12:19 +02:00
5cccfa7c5a Merge #10558 from erw7/fix-text-overrides-line-number2
Windows: Fix text overrides line number
2019-07-23 19:20:07 +02:00
465a0a3c09 env: invalid pointer after os_setenv() #10558 2019-07-23 11:45:38 +02:00
f6e779d939 win/TUI: workaround libuv LF => CRLF conversion #10558
Replace cud1 with \x1b[B because \n is CRLF on Windows (due to libuv).

fix #9461
2019-07-23 11:45:38 +02:00
0d5f629208 Revert "vim-patch:8.0.1723: using one item array size declaration is misleading" (#10583)
This reverts commit 315076a26d.
2019-07-23 05:37:20 +02:00
4aabe4a0d5 build: GetBinaryDeps: move include, fix doc (#10579) 2019-07-22 20:50:30 +02:00
d7274f2417 shell-test: fix REP for count larger than uint8_t (#10581) 2019-07-22 20:49:45 +02:00
324dc0dbc0 PVS/V1019: "readability" warning #10566 2019-07-22 19:45:59 +02:00
1e2af5e39d tests: make TERM=interix test pending (#10576)
Ref: https://github.com/neovim/neovim/issues/10179
Ref: https://github.com/neovim/neovim/pull/9494
2019-07-22 18:49:37 +02:00
184b87ee31 build: fix gcc warnings #10568
gcc version 8.3.0 (Debian 8.3.0-6)

    ../src/nvim/ex_docmd.c: In function ‘commands_array’:
    ../src/nvim/ex_docmd.c:10192:36: warning: ‘%ld’ directive output may be truncated writing between 1 and 19 bytes into a region of size 10 [-Wformat-truncation=]
             snprintf(str, sizeof(str), "%" PRId64, (int64_t)cmd->uc_def);
                                        ^~~
    ../src/nvim/ex_docmd.c:10192:37: note: format string is defined here
             snprintf(str, sizeof(str), "%" PRId64, (int64_t)cmd->uc_def);
    ../src/nvim/ex_docmd.c:10192:36: note: directive argument in the range [0, 9223372036854775807]
             snprintf(str, sizeof(str), "%" PRId64, (int64_t)cmd->uc_def);
                                        ^~~
    ../src/nvim/ex_docmd.c:10192:9: note: ‘snprintf’ output between 2 and 20 bytes into a destination of size 10
             snprintf(str, sizeof(str), "%" PRId64, (int64_t)cmd->uc_def);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../src/nvim/ex_docmd.c:10205:36: warning: ‘%ld’ directive output may be truncated writing between 1 and 19 bytes into a region of size 10 [-Wformat-truncation=]
             snprintf(str, sizeof(str), "%" PRId64, (int64_t)cmd->uc_def);
                                        ^~~
    ../src/nvim/ex_docmd.c:10205:37: note: format string is defined here
             snprintf(str, sizeof(str), "%" PRId64, (int64_t)cmd->uc_def);
    ../src/nvim/ex_docmd.c:10205:36: note: directive argument in the range [0, 9223372036854775807]
             snprintf(str, sizeof(str), "%" PRId64, (int64_t)cmd->uc_def);
                                        ^~~
    ../src/nvim/ex_docmd.c:10205:9: note: ‘snprintf’ output between 2 and 20 bytes into a destination of size 10
             snprintf(str, sizeof(str), "%" PRId64, (int64_t)cmd->uc_def);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../src/nvim/spell.c: In function ‘did_set_spelllang’:
    ../src/nvim/spell.c:1631:61: warning: ‘%s’ directive output may be truncated writing up to 254 bytes into a region of size 84 [-Wformat-truncation=]
                    "autocmd VimEnter * call spellfile#LoadFile('%s')|set spell",
                                                                 ^~
    ../src/nvim/spell.c:2063:25:
             spell_load_lang(lang);
                             ~~~~                                 
    ../src/nvim/spell.c:1630:7: note: ‘snprintf’ output between 57 and 311 bytes into a destination of size 128
           snprintf(autocmd_buf, sizeof(autocmd_buf),
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                    "autocmd VimEnter * call spellfile#LoadFile('%s')|set spell",
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                    lang);
                    ~~~~~
    ../src/nvim/window.c: In function ‘win_rotate’:
    ../src/nvim/window.c:1780:22: warning: ‘wp2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       wp2->w_pos_changed = true;
                          ^
    ../src/nvim/window.c:1779:22: warning: ‘wp1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       wp1->w_pos_changed = true;
2019-07-22 12:38:14 +02:00
39549159fe vim-patch:8.1.0706: introduce :redrawtabline #10570
Problem:    Tabline is not always redrawn when something that is used in
            'tabline' changes.
Solution:   Add ":redrawtabline" so that a plugin can at least cause the
            redraw when needed.
e12bab3144
2019-07-22 12:25:07 +02:00
f8684bf6b9 build: remove -Wno-array-bounds workaround #10484
Might not be necessary anymore, at least it is fine on gcc 9.1, and
since the bug is still open/unresolved, something else might have fixed
it.

Ref: 4b81f627c
Ref: #7083
2019-07-22 12:22:53 +02:00
66149ecffe test/helpers: improve pattern with module functions (#10421)
Benefits:

- less lines, especially less results when grepping
- makes it clearer what is exported
2019-07-22 01:13:11 +02:00
8d66b6091b vim-patch:8.1.1724: too much overhead checking for CTRL-C #10564
Problem:    Too much overhead checking for CTRL-C while processing text.
Solution:   Increase BREAKCHECK_SKIP.  Remove the difference for when built
            with the GUI. (suggested by Andy Massimino, closes vim/vim#4708)
b4fe0eb4b4
2019-07-21 23:30:56 +02:00
27fb8933f5 Merge #10561 from justinmk/os_can_exe
jobstart(), system(): use $PATHEXT-resolved exe
2019-07-21 22:58:39 +02:00
1fde79eedf os_can_exe: remove char_u 2019-07-21 20:51:37 +02:00
b08dc3ec19 win: jobstart(), system(): $PATHEXT-resolve exe
Windows: In order for jobstart(['foo']), system(['foo']) to find
"foo.cmd", we must replace "foo" with "foo.cmd" before sending `argv` to
process_spawn().

Rationale: jobstart([…]), system([…]) "executable" semantics should be
consistent with the VimL executable() function.

fix #9569
related: #10554
2019-07-21 20:51:37 +02:00
9d0f8224c9 Merge #10555 from janlazo/vim-8.1.1720
vim-patch:8.1.{856,1720}
2019-07-21 14:40:32 +02:00
a63b95b315 move: assert nonnull wp pointer 2019-07-20 19:51:32 -04:00
54d9ea61ab vim-patch:8.1.0856: when scrolling a window the cursorline is not always updated
Problem:    When scrolling a window other than the current one the cursorline
            highlighting is not always updated. (Jason Franklin)
Solution:   Call redraw_for_cursorline() after scrolling.  Only set
            w_last_cursorline when drawing the cursor line.  Reset the lines
            to be redrawn also when redrawing the whole window.
bbb5f8d4c2
2019-07-20 19:34:06 -04:00
526dbcafd1 vim-patch:8.1.1720: crash with very long %[] pattern
Problem:    Crash with very long %[] pattern. (Reza Mirzazade farkhani)
Solution:   Check for reg_toolong. (closes vim/vim#4703)
2a5b52758b
2019-07-20 17:28:45 -04:00
d20bbc8022 vim-patch:8.1.0789: session sets v:errmsg #10553
Problem:    Sourcing a session sets v:errmsg.
Solution:   Use "%argdel" instead of "argdel *". (Jason Franklin)
555de4e3b2
2019-07-20 19:06:17 +02:00
b764120ee7 test: shell-test.c: "REP" command: flush, wait 1ms #10552
Typically most shell output is the result of non-trivial work, so it
would not blast stdout instantaneously.  To more closely simulate that
typical scenario, change `shell-test REP` to wait 1 millisecond between
iterations.
2019-07-20 18:07:04 +02:00
02e7ef4978 Merge #10550 'screen.lua: expect_unchanged()' 2019-07-20 15:49:49 +02:00
d19d9e4d9e screen.lua: always print keyword-args snapshot 2019-07-20 14:25:07 +02:00
6b45e12d67 screen.lua: expect_unchanged(), get_snapshot()
Factor `get_snapshot()` out of `print_snapshot()`, so that callers can
get a table (for use with `expect()`) instead of the string form.

Try to use this to fix indeterminism in `searchhl_spec.lua`.
  - Since the screen state is collected by `screen:expect_unchanged()`,
    we don't need a deterministic initial state (which would then be
    hardcoded into the test). This allows us to check "did anything
    change in the last N ms?" rather than "did anything change compared
    to a hardcoded screen-state?"
  - This may end up fruitless, because `expect_unchanged()` depends on
    timing to wait for an initial "current state".
2019-07-20 14:25:07 +02:00
7935f6ce35 vim-patch:8.1.0754: preferred column when setting 'cursorcolumn' #10549
Problem:    Preferred column is lost when setting 'cursorcolumn'.
Solution:   Change option flag to P_RWINONLY. (Takayuki Kurosawa,
            closes vim/vim#3806)
177ab9e026
2019-07-20 14:12:56 +02:00
643ba06d4d test: shell-test.c: flush stdout for REP #10548
fix #10534
2019-07-20 12:52:33 +02:00
7f66fdb54d [RFC]vim-patch:8.1.{749,1715} #10545
* vim-patch:8.1.1715: emoji characters are seen as word characters for spelling

Problem:    Emoji characters are seen as word characters for spelling. (Gautam
            Iyer)
Solution:   Exclude class 3 from word characters.
06e6377009

* vim-patch:8.1.0749: error message contains garbage

Problem:    Error message contains garbage. (Dominique Pelle)
Solution:   Use correct pointer to failed expression.
6acc79f5d4
2019-07-20 10:48:45 +02:00
f55c1e4233 reltimefloat(): allow negative result #10544
For "backwards" duration, reltimefloat() should return negative value
like its counterpart reltimestr().

ref bab24a88ab
ref 06af88cd72
ref #10521
fix #10452
2019-07-20 10:46:09 +02:00
afef973262 doc [ci skip] #10383
- test/README.md: document luassert `TableFormatLevel`
- CONTRIBUTING.md: absorb parts of the old "Development tips" wiki page
2019-07-19 21:32:04 +02:00
d5f7099be2 Merge pull request #10541 from bfredl/conversion_getln
refactor: enable -Wconversion for ex_getln.c and use int for Rows/Columns
2019-07-19 20:15:03 +02:00
7e4fd045f9 PVS/V1026: possible overflow in a loop #10529
* pvs/V1026: possible overflow in a loop
* refactor: char_u -> uint8_t
* lint
* remove unused if branch: enc_utf8 is always true
2019-07-19 19:41:57 +02:00
1745e59ac1 Merge #10543 'PVS/V560' 2019-07-19 19:39:46 +02:00
f42bb50392 lint 2019-07-19 12:31:34 -04:00
f1127a33f1 pvs/V560: A part of conditional expression is always true
wp->w_p_list is checked earlier in the same composite if condition
2019-07-19 11:06:40 -04:00
91bbd07417 pvs/V560: A part of conditional expression is always true
c == '\000' is always true because of the if branch it is already in
2019-07-19 10:58:31 -04:00
aa28e070e9 refactor: use int for Columns and Rows 2019-07-19 15:57:19 +02:00
75928101f8 refactor: enable -Wconversion for ex_getln.c 2019-07-19 15:56:38 +02:00
a46fe2e615 option_defs.h: fix incorrect definition #10542 2019-07-19 15:17:31 +02:00
6614543316 test: Force $TEST_FILE to relative path [ci skip] #10535
- Always force TEST_PATH to a relative path.
- Eliminate rel_test_path. (The code simplification is worth the extra
  subdirectory below Xtest_tmpdir/.)
2019-07-19 13:51:18 +02:00
d4e93fedf1 vim-patch:8.1.0740: Tcl test fails (#10540)
Problem:    Tcl test fails.
Solution:   When the argument is empty don't give an error, instead rely on
            the error reporting higher up.
8309b0559d
2019-07-19 11:46:22 +02:00
281d422e71 Merge #10368 from janlazo/vim-8.0.1164
vim-patch:8.0.{755,1146,1164}
2019-07-19 00:39:50 +02:00
572ecdfeed Merge #10052 from janlazo/vim-8.1.0729
vim-patch:8.1.{729,732}
2019-07-19 00:36:56 +02:00
a04e0c8db2 Revert "Downgrade to clang-4.0 to avoid false-positive warnings from clang" [skip appveyor] (#10487)
This reverts commit 2cbac719c3.
2019-07-18 08:49:37 +02:00
ba7ec994ae pvs/V1037: two case branches doing the same thing (#10527) 2019-07-18 03:12:45 +02:00
9412dcb6ae PVS/V1037: suppress warning #10526
* Case branches are semantically different.
* Lint
2019-07-18 03:10:45 +02:00
fdfdc0a228 vim-patch:8.1.0732: cannot build without the eval feature
Problem:    Cannot build without the eval feature.
Solution:   Make a copy of the sourced file name.
ea56e167c8
2019-07-17 20:27:08 -04:00
aa681df25f vim-patch:8.1.0729: there is a SourcePre autocommand event but not a SourcePost
Problem:    There is a SourcePre autocommand event but not a SourcePost.
Solution:   Add the SourcePost autocommand event. (closes vim/vim#3739)
2b6185287a
2019-07-17 20:23:05 -04:00
3d356c14df ci: Travis: use gcc9 with gcov job [skip appveyor] (#10480)
* ci: Travis: use gcc-9 in gcov job

* ci: Travis: use CCACHE_CPP2=1

This is required to avoid warnings with newer gcc/clang.

Follow-up to: https://github.com/neovim/neovim/pull/10533
2019-07-18 01:27:05 +02:00
8499e18615 PVS/V1037: suppress warning #10528
Despite the PVS warning, we do not want to conflate these
cases, they are semantically different.
2019-07-18 01:20:59 +02:00
452ec4ed31 PVS/V1037: redundant switch-case branches #10519
Suppress the warning, the branches are semantically different.
2019-07-18 00:20:06 +02:00
4fc91fe365 tests: fix "system() … prints verbose information" (#10532)
It would previously fail with `set shell=sh` (no slash).

For the test itself we can just use a non-existing (fake) shell, because
it is only about the verbose output.

Ref: https://github.com/neovim/neovim/issues/9330
2019-07-17 23:05:04 +02:00
353b3852fd ci: Travis: ccache: use CCACHE_HASHDIR [skip appveyor]
This is the default since ccache 3.3, but Travis has 3.2.4.

This fixes compiler warnings from macros with later clang/gcc.

Using CCACHE_HASHDIR=1 fixes ccache v3.2.4, but CCACHE_NOHASHDIR=1 does
not break v3.7.1. The real issue/fix appears to be
ccache/ccache@284e3a0, and using the hashdir option seems to only work
around this.

Unblocks https://github.com/neovim/neovim/pull/10480, and
https://github.com/neovim/neovim/pull/10487.

Ref: https://github.com/ccache/ccache/commit/6d9cb3dfdd9
Closes https://github.com/neovim/neovim/pull/10533.
2019-07-17 19:41:19 +02:00
b41507927b build: fix handling of install prefix with CMAKE_EXTRA_FLAGS (#10530)
Append `CMAKE_INSTALL_PREFIX` to any given `CMAKE_EXTRA_FLAGS` always.

Regressed in 5031e3298.

Fixes https://github.com/neovim/neovim/issues/10524.
2019-07-17 16:38:11 +02:00
58dd5fcc01 jobstop(): close channel before process_stop() #10522
fix #9799
regression of #7081
Helped-by: Björn Linse <bjorn.linse@gmail.com>

Problem: :UpdateRemotePlugins (which calls rpcstop()) sometimes crashes:

    remote/host: python3 host registered plugins []
    nvim: ../src/nvim/event/wstream.c:78:
      _Bool wstream_write(Stream *, WBuffer *): Assertion `!stream->closed' failed.
    Aborted (core dumped)

  Order of events (channel 163, see logs below):

    1. Channel's in-stream (0x2ba86c0) is **closed** by `f_rpcstop`..`process_stop`.
    2. `receive_msgpack` parses the channel out-stream (0x2ba8860)
    3. Invokes "nvim_command_output" API method.
    4. Writes result to the **closed** in-stream  => **abort**

  - af993da435 (`receive_msgpack`) tried to hack around same/similar issue.
  - Hack was removed in 5215e3205a.

Solution: in jobstop(), close the channel before process_stop().

Log:

    DEBUG 2019-07-16T20:54:12.191 25159 stream_close:96: closing Stream: 0x2b01a90
    DEBUG 2019-07-16T20:54:12.210 25159 process_spawn:124: new: pid=28407 argv=[/usr/bin/python3]
    DEBUG 2019-07-16T20:54:12.210 25159 rpc_start:72: rpc ch 163 in-stream=0x2ba86c0 out-stream=0x2ba8860
    INFO  2019-07-16T20:54:12.210 25159 channel_create_event:199: new channel 163 (function <SNR>61_on_exit[4]..<SNR>60_job_exit_cb[101]..<SNR>60_decrement_job_count[8]..remote#host#UpdateRemotePlugins[6]..<SNR>31_RegistrationCommands[15]..remote#host#Require[10]..provider#pythonx#Require[13]..provider#Poll:3) : {"id": 163, "client": {}, "mode": "rpc", "stream": "job"}
    DEBUG 2019-07-16T20:54:12.211 25159 log_server_msg:729: RPC ->ch 163: [request]  [0, 1, "poll", []]
    DEBUG 2019-07-16T20:54:12.355 25159 receive_msgpack:227: ch 163: parsing 21 bytes from msgpack Stream: 0x2ba8860
    DEBUG 2019-07-16T20:54:12.355 25159 log_client_msg:766: RPC <-ch 163: [request]  [0, 1, "vim_get_api_info", []]
    DEBUG 2019-07-16T20:54:12.355 25159 RPC: <-ch 163: invoke nvim_get_api_info
    DEBUG 2019-07-16T20:54:12.357 25159 log_server_msg:729: RPC ->ch 163: [response] [1, 1, nil, [163, {"version"=>{"major"=>0, "minor"=>4, }, ...
    DEBUG 2019-07-16T20:54:12.377 25159 receive_msgpack:227: ch 163: parsing 85 bytes from msgpack Stream: 0x2ba8860
    DEBUG 2019-07-16T20:54:12.377 25159 log_client_msg:766: RPC <-ch 163: [request]  [0, 2, "nvim_eval", ["((&number||&relativenumber) ? &numberwidth : 0) + &foldcolumn"]]
    DEBUG 2019-07-16T20:54:12.377 25159 handle_request:359: RPC: scheduled nvim_eval
    DEBUG 2019-07-16T20:54:12.377 25159 log_client_msg:766: RPC <-ch 163: [response] [1, 1, nil, "ok"]
    DEBUG 2019-07-16T20:54:12.378 25159 log_server_msg:729: RPC ->ch 163: [request]  [0, 2, "specs", ["/home/vagrant/.config/nvim/rplugin/python3/__pycache__"]]
    DEBUG 2019-07-16T20:54:12.378 25159 RPC: <-ch 163: invoke nvim_eval
    DEBUG 2019-07-16T20:54:12.379 25159 log_server_msg:729: RPC ->ch 163: [response] [1, 2, nil, 0]
    DEBUG 2019-07-16T20:54:12.379 25159 receive_msgpack:227: ch 163: parsing 5 bytes from msgpack Stream: 0x2ba8860
    DEBUG 2019-07-16T20:54:12.379 25159 log_client_msg:766: RPC <-ch 163: [response] [1, 2, nil, 0]
    DEBUG 2019-07-16T20:54:12.380 25159 log_server_msg:729: RPC ->ch 163: [request]  [0, 3, "specs", ["/home/vagrant/.config/nvim/rplugin/python3/foo.py"]]
    DEBUG 2019-07-16T20:54:12.380 25159 receive_msgpack:227: ch 163: parsing 79 bytes from msgpack Stream: 0x2ba8860
    DEBUG 2019-07-16T20:54:12.380 25159 log_client_msg:766: RPC <-ch 163: [request]  [0, 3, "nvim_command", ["redir =>a |exe "sil sign place buffer=".bufnr('')|redir end"]]
    DEBUG 2019-07-16T20:54:12.381 25159 handle_request:359: RPC: scheduled nvim_command
    DEBUG 2019-07-16T20:54:12.381 25159 RPC: <-ch 163: invoke nvim_command
    DEBUG 2019-07-16T20:54:12.381 25159 log_server_msg:729: RPC ->ch 163: [response] [1, 3, nil, nil]
    DEBUG 2019-07-16T20:54:12.381 25159 receive_msgpack:227: ch 163: parsing 5 bytes from msgpack Stream: 0x2ba8860
    DEBUG 2019-07-16T20:54:12.381 25159 log_client_msg:766: RPC <-ch 163: [response] [1, 3, nil, 0]
    DEBUG 2019-07-16T20:54:12.382 25159 stream_close:95: trace:
      log_callstack at /home/vagrant/neovim/build/../src/nvim/log.c:256
      stream_close at /home/vagrant/neovim/build/../src/nvim/event/stream.c:95
      stream_may_close at /home/vagrant/neovim/build/../src/nvim/event/stream.c:111
      process_stop at /home/vagrant/neovim/build/../src/nvim/event/process.c:230
      f_jobstop at /home/vagrant/neovim/build/../src/nvim/eval.c:12231
      f_rpcstop at /home/vagrant/neovim/build/../src/nvim/eval.c:14533
      call_func at /home/vagrant/neovim/build/../src/nvim/eval.c:6564
      get_func_tv at /home/vagrant/neovim/build/../src/nvim/eval.c:6304
      ex_call at /home/vagrant/neovim/build/../src/nvim/eval.c:2903
      do_one_cmd at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2249
      do_cmdline at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:593
      call_user_func at /home/vagrant/neovim/build/../src/nvim/eval.c:22666
      call_func at /home/vagrant/neovim/build/../src/nvim/eval.c:6550
      get_func_tv at /home/vagrant/neovim/build/../src/nvim/eval.c:6304
      eval7 at /home/vagrant/neovim/build/../src/nvim/eval.c:4407
      eval6 at /home/vagrant/neovim/build/../src/nvim/eval.c:4104
      eval5 at /home/vagrant/neovim/build/../src/nvim/eval.c:3985
      eval4 at /home/vagrant/neovim/build/../src/nvim/eval.c:3688
      eval3 at /home/vagrant/neovim/build/../src/nvim/eval.c:3606
      eval2 at /home/vagrant/neovim/build/../src/nvim/eval.c:3537
      eval1 at /home/vagrant/neovim/build/../src/nvim/eval.c:3464
      eval0 at /home/vagrant/neovim/build/../src/nvim/eval.c:3424
      ex_let_const at /home/vagrant/neovim/build/../src/nvim/eval.c:1604
      ex_let at /home/vagrant/neovim/build/../src/nvim/eval.c:1546
      do_one_cmd at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2249
      do_cmdline at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:593
      call_user_func at /home/vagrant/neovim/build/../src/nvim/eval.c:22666
      call_func at /home/vagrant/neovim/build/../src/nvim/eval.c:6550
      get_func_tv at /home/vagrant/neovim/build/../src/nvim/eval.c:6304
      ex_call at /home/vagrant/neovim/build/../src/nvim/eval.c:2903
      do_one_cmd at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2249
      do_cmdline at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:593
      do_ucmd at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:5803
      do_one_cmd at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2243
      do_cmdline at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:593
      call_user_func at /home/vagrant/neovim/build/../src/nvim/eval.c:22666
      call_func at /home/vagrant/neovim/build/../src/nvim/eval.c:6550
      get_func_tv at /home/vagrant/neovim/build/../src/nvim/eval.c:6304
      ex_call at /home/vagrant/neovim/build/../src/nvim/eval.c:2903
      do_one_cmd at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2249
      do_cmdline at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:593
      call_user_func at /home/vagrant/neovim/build/../src/nvim/eval.c:22666
      call_func at /home/vagrant/neovim/build/../src/nvim/eval.c:6550
      get_func_tv at /home/vagrant/neovim/build/../src/nvim/eval.c:6304
      ex_call at /home/vagrant/neovim/build/../src/nvim/eval.c:2903
      do_one_cmd at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2249
      do_cmdline at /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:593
      call_user_func at /home/vagrant/neovim/build/../src/nvim/eval.c:22666
      call_func at /home/vagrant/neovim/build/../src/nvim/eval.c:6550
      callback_call at /home/vagrant/neovim/build/../src/nvim/eval.c:17917
      channel_callback_call at /home/vagrant/neovim/build/../src/nvim/channel.c:675
      on_channel_event at /home/vagrant/neovim/build/../src/nvim/channel.c:581
      multiqueue_process_events at /home/vagrant/neovim/build/../src/nvim/event/multiqueue.c:147
      nv_event at /home/vagrant/neovim/build/../src/nvim/normal.c:7987
      normal_execute at /home/vagrant/neovim/build/../src/nvim/normal.c:1133
      state_enter at /home/vagrant/neovim/build/../src/nvim/state.c:73
      normal_enter at /home/vagrant/neovim/build/../src/nvim/normal.c:462
      main at /home/vagrant/neovim/build/../src/nvim/main.c:570
      ?? ??:0
      _start at ??:?
    DEBUG 2019-07-16T20:54:12.417 25159 stream_close:96: closing Stream: 0x2ba86c0
    INFO  2019-07-16T20:54:12.417 25159 os_proc_tree_kill:96: sending SIGTERM to process group: -28407
    DEBUG 2019-07-16T20:54:12.417 25159 receive_msgpack:227: ch 163: parsing 31 bytes from msgpack Stream: 0x2ba8860
    DEBUG 2019-07-16T20:54:12.417 25159 log_client_msg:766: RPC <-ch 163: [request]  [0, 4, "nvim_command_output", ["echo a"]]
    DEBUG 2019-07-16T20:54:12.417 25159 handle_request:359: RPC: scheduled nvim_command_output
    DEBUG 2019-07-16T20:54:12.424 25159 RPC: <-ch 163: invoke nvim_command_output
    DEBUG 2019-07-16T20:54:12.424 25159 log_server_msg:729: RPC ->ch 163: [response] [1, 4, [0, "Vim(echo):E121: Undefined variable: a"], nil]
    ERROR 2019-07-16T20:54:12.424 25159 wstream_write:78: xxx stream=0x2ba86c0
    DEBUG 2019-07-16T20:54:12.425 25159 wstream_write:79: trace:
      log_callstack at /home/vagrant/neovim/build/../src/nvim/log.c:256
      wstream_write at /home/vagrant/neovim/build/../src/nvim/event/wstream.c:82
      channel_write at /home/vagrant/neovim/build/../src/nvim/msgpack_rpc/channel.c:407
      request_event at /home/vagrant/neovim/build/../src/nvim/msgpack_rpc/channel.c:383
      multiqueue_process_events at /home/vagrant/neovim/build/../src/nvim/event/multiqueue.c:147
      nv_event at /home/vagrant/neovim/build/../src/nvim/normal.c:7987
      normal_execute at /home/vagrant/neovim/build/../src/nvim/normal.c:1133
      state_enter at /home/vagrant/neovim/build/../src/nvim/state.c:73
      normal_enter at /home/vagrant/neovim/build/../src/nvim/normal.c:462
      main at /home/vagrant/neovim/build/../src/nvim/main.c:570
      ?? ??:0
      _start at ??:?
2019-07-17 11:13:57 +02:00
f96dec4a2c vim-patch:8.1.0715: superfluous redraw_win_later() #10523
Problem:    Superfluous call to redraw_win_later().
Solution:   Remove the call.
6f7e555f74
2019-07-17 11:08:44 +02:00
34c6e5beaf tests: move "busted" dir to "test" (#10518)
* tests: move "busted" dir to "test"

It is used for outputHandlers only, and clearly belongs to the tests.
Use the full module name with the `-o` option to `busted` then for
clarity.

* luacheck

* test/busted/outputHandlers/TAP.lua: use/extend upstream
2019-07-16 22:02:50 +02:00
3a1d3e9ef1 tests: shell-test: use count for REP (#10514)
Also fix V576: use width specification

> Incorrect format. Consider checking the third actual argument of the
> 'sscanf' function. It's dangerous to use string specifier without width
> specification. Buffer overflow is possible.
2019-07-16 21:35:53 +02:00
bab24a88ab viml/profile: revert proftime_T to unsigned type #10521
- reltimestr(): Produce negative value by comparing the unsigned
  proftime_T value to INT64_MAX.

https://github.com/neovim/neovim/issues/10452#issuecomment-511155132
1. The interfaces of nearly all platforms return uint64_t. INT64_MAX is
   only half of that.
2. Low-level interfaces like this typically define that there is no
   fixed starting point. The only guarantees are that it's (a)
   monotonically increasing at a rate that (b) matches real time.

ref 06af88cd72
fix #10452
2019-07-16 20:10:08 +02:00
f31f2d0b22 PVS/V1028: cast operands, not the result #10505 2019-07-16 20:03:08 +02:00
1eea2d236f Merge #10500 from ngortheone/pvs/V1028_misc1 2019-07-16 20:01:50 +02:00
56bc0a8bed PVS/V108: cast operands, not the result #10501 2019-07-16 19:58:30 +02:00
b53b3f7dac Merge #10493 from ngortheone/pvs/V1028_getchar_918 2019-07-16 19:56:30 +02:00
b35ad86024 Merge #10391 from janlazo/vim-8.1.0495
vim-patch:8.1.{495,505,531,533,583,623,630,641,686,715,833,1012,1221,1651}
2019-07-16 19:52:23 +02:00
b9a2b3f014 PVS/V1028: cast operands, not the result #10503 2019-07-16 19:50:01 +02:00
96e87c5a63 lint 2019-07-16 08:32:09 -04:00
6262d82d2f pvs/V1028: cast operands, not the result 2019-07-16 08:28:50 -04:00
583c35714c Merge #10520 'PVS/V1037: redundant case-branches' 2019-07-16 11:32:35 +02:00
6316247da3 PVS/V1028: cast operands, not the result #10502 2019-07-16 11:23:58 +02:00
8a3f8589a3 Merge pull request #10504 from bfredl/hl_def
highlight: expose builtin highlight groups using hl_group_set event
2019-07-16 10:17:29 +02:00
6aab5715c5 third-party: busted 2.0.0-0 (#10517) 2019-07-16 09:15:50 +02:00
64f4ee39aa vim-patch:8.1.0715: superfluous call to redraw_win_later()
Problem:    Superfluous call to redraw_win_later().
Solution:   Remove the call.
6f7e555f74
2019-07-15 23:07:41 -04:00
bf919454eb vim-patch:8.1.0686: when 'y' is in 'cpoptions' yanking for the clipboard changes redo
Problem:    When 'y' is in 'cpoptions' yanking for the clipboard changes redo.
Solution:   Do not use the 'y' flag when "gui_yank" is TRUE. (Andy Massimino,
            closes vim/vim#3760)
5823f84dd0
2019-07-15 23:07:29 -04:00
5be40b9aad vim-patch:8.1.0641: no check for out-of-memory when converting regexp
Problem:    No check for out-of-memory when converting regexp.
Solution:   Bail out when lalloc() returns NULL. (John Marriott)
c57463c9c6
2019-07-15 23:07:29 -04:00
eace147bb0 vim-patch:8.1.0630: "wincmd p" does not work after using an autocmd window
Problem:   "wincmd p" does not work after using an autocmd window.
Solution:   Store "prevwin" in aco_save_T. (Christian Brabandt, closes vim/vim#3690)
a42df5934b
2019-07-15 23:07:29 -04:00
e95945a157 vim-patch:8.1.0623: iterating through window frames is repeated
Problem:    Iterating through window frames is repeated.
Solution:   Define FOR_ALL_FRAMES. (Yegappan Lakshmanan)
3d1491ed23
2019-07-15 23:07:29 -04:00
1c2cfdba88 vim-patch:8.1.0583: using illogical name for get_dict_number()/get_dict_string()
Problem:    Using illogical name for get_dict_number()/get_dict_string().
Solution:   Rename to start with dict_.
8f66717a1f
2019-07-15 23:07:29 -04:00
066ef812c2 vim-patch:8.1.1651: suspend test is flaky on some systems
Problem:    Suspend test is flaky on some systems.
Solution:   Wait for the shell prompt to show. (Yee Cheng Chin, closes vim/vim#4632)
9992244226
2019-07-15 23:07:29 -04:00
71018924fc vim-patch:8.1.0533: screendump tests can be flaky
Problem:    Screendump tests can be flaky.
Solution:   Add VerifyScreenDump to the pattern of flaky tests.
447f6ce8bd
2019-07-15 23:07:29 -04:00
5b8d378923 vim-patch:8.1.0531: flaky tests often fail with a common error message
Problem:    Flaky tests often fail with a common error message.
Solution:   Add a pattern to match an error message indicating a flaky test.
dbc0d2163a
2019-07-15 23:07:29 -04:00
9108256ad4 vim-patch:8.1.1012: memory leak with E461
Problem:    Memory leak with E461.
Solution:   Clear the typeval. (Dominique Pelle, closes vim/vim#4111)
ab89d7ab89
2019-07-15 23:07:29 -04:00
df6354c223 vim-patch:8.1.0833: memory leak when jumps output is filtered
Problem:    Memory leak when jumps output is filtered.
Solution:   Free the filtered name. (Dominique Pelle, closes vim/vim#3869)
d93090f41f
2019-07-15 23:07:29 -04:00
d27175aa28 vim-patch:8.1.1221: filtering does not work when listing marks
Problem:    Filtering does not work when listing marks.
Solution:   Implement filtering marks. (Marcin Szamotulski, closes vim/vim#3895)
ad6dc49a75
2019-07-15 23:07:29 -04:00
5d933310c8 vim-patch:8.1.0505: filter command test may fail if helplang is not set
Problem:    Filter command test may fail if helplang is not set.
Solution:   Set 'helplang' for the test. (James McCoy, closes vim/vim#3591)
bd9a0c611c
2019-07-15 23:07:28 -04:00
263d62f628 vim-patch:8.1.0495: :filter only supports some commands
Problem:    :filter only supports some commands.
Solution:   Add :filter support for more commands. (Marcin Szamotulski,
            closes vim/vim#2856)
f86db78fed
2019-07-15 23:07:28 -04:00
9a5183f22d lint 2019-07-15 21:34:15 -04:00
31d256892e pvs/V1037: two case-branches perform the same action 2019-07-15 21:32:53 -04:00
990f99658b viml/profile: cast os_hrtime() result
Temporary measure to avoid QuickBuild CI failure:

    8:42:54,702 INFO  - Executing post-execute action...
    18:42:54,702 ERROR - Step 'master>buildall>build-node?testNode=freebsd-64>build-and-run-tests>build-and-run-tests-parameterized?buildType=Release>configure-neovim-and-build-nvim' is failed: Failed to run command: mkdir -p build/Release && cd build/Release && cmake -G "Unix Makefiles" -DBUSTED_OUTPUT_TYPE=TAP -DMIN_LOG_LEVEL=3 -DCMAKE_BUILD_TYPE=Release -DTRAVIS_CI_BUILD=ON ../.. && gmake VERBOSE=1 nvim unittest-prereqs functionaltest-prereqs
    Command return code: 2
    Command error output: /usr/home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/profile.c:70:27: error: implicit conversion changes signedness: 'proftime_T' (aka 'long') to 'unsigned long' [-Werror,-Wsign-conversion]
    STRICT_ADD(os_hrtime(), nsec, &rv, int64_t);
    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
    /usr/home/quickbuild/buildagent/workspace/root/neovim/pull-requests-automated/src/nvim/assert.h:150:26: note: expanded from macro 'STRICT_ADD'
    do { *(c) = (t)((a) + (b)); } while (0)
    ^
    1 error generated.
    gma...
2019-07-16 02:47:50 +02:00
0156e6b810 PVS/V781: suppress false positive #10516 2019-07-16 02:30:31 +02:00
ec81cfb406 PVS/V1028: cast operands, not the result #10496 2019-07-16 02:27:25 +02:00
8df20ff562 lint 2019-07-15 20:10:35 -04:00
dc0d021d9f pvs/V1028: cast operands, not the result 2019-07-15 19:59:41 -04:00
b06f29318d Fix missing CursorHoldI events (#3758)
Fixes https://github.com/neovim/neovim/issues/3757.
2019-07-16 01:35:43 +02:00
046deeeaa1 PVS/V1028: cast operands, not the result #10507 2019-07-16 01:01:12 +02:00
de3e2f051e PVS/V1028: cast operands, not the result #10498
The + 1 can be removed. It was used for current_screenline, which
now is dedicated linebuf_char buffer.
2019-07-16 00:55:10 +02:00
31f879983f third-party: use CXX only for BuildGperf (#10512)
This allows to build deps without g++ when not using the bundled gperf.

> make deps DEPS_CMAKE_FLAGS='-DUSE_BUNDLED_GPERF=0'
2019-07-15 22:27:29 +02:00
519382646b Fix is_executable_in_path() on Windows (#10468)
* Fix problem that 1byte extra memory was allocated in is_executable_in_path

* Revert "Revert "tests: executable_spec: enable pending test #10443" (#10454)"

This reverts commit 13fbeda0e5.
2019-07-15 17:39:34 +02:00
be949d6c9d build: propagate sysroot to C++ deps (gperf) #10491 2019-07-15 11:34:45 +02:00
63ecfc97ef PVS/V590: redundant condition #10510 2019-07-15 10:52:38 +02:00
5a32db9ad4 PVS/V547: expression is always false #10511 2019-07-15 10:47:35 +02:00
78f36fcf8c PVS/V1028: cast operands, not the result #10508
fix #10508
2019-07-14 22:16:44 +02:00
47d53d66bd PVS/V1028: cast operands, not the result #10508 2019-07-14 21:03:06 +02:00
37e7e7d56d gitignore: ignore idea/clion (#10494) 2019-07-14 20:50:17 +02:00
c38862acea checkhealth: try yarn if npm is missing #10490
fixes #10489
2019-07-14 20:48:53 +02:00
452112ae38 PVS/V1028 ugrid.c:76 (#10495)
* code review
2019-07-14 15:46:07 +02:00
857b29bdd8 highlight: expose builtin highlight groups using hl_group_set event 2019-07-14 13:26:40 +02:00
1e47e3f599 Merge pull request #10497 from bfredl/synlist
messages: fix missing newlines in execute("syn list").
2019-07-14 13:11:56 +02:00
4c6e62d056 syntax: refactor syn_list_header to not use magic value 2019-07-14 09:31:49 +02:00
c2b3cc970c syntax: fix missing newlines in execute("syn list"). fixes #10467 2019-07-14 09:31:45 +02:00
b3140fa594 gitignore: ignore idea/clion 2019-07-13 12:38:16 -04:00
6f944d36cf Merge pull request #10492 from bfredl/blend_doublewidth
floats: fix 'winblend' on top of doublewidth chars.
2019-07-13 16:09:25 +02:00
cb9e0a051f floats: fix 'winblend' on top of doublewidth chars.
The interaction between 'winblend' and doublewidth chars in the background
does not look very good. But check no chars get incorrectly placed
at least.

Also check that hidden EndOfBuffer region (from style="minimal") blends
correctly.
2019-07-13 14:27:06 +02:00
4013f67053 viml/profile: revert gettimeofday() #10488
e2ce5ff9d6 was proven to be bogus, so revert it.

close #10328
ref #10356
ref #10452
2019-07-13 12:37:58 +02:00
e1fae8f1fe Merge #10435 from Shougo/vim-8.1.1610 2019-07-13 12:36:32 +02:00
06826139e1 PVS/V547: dead code #10459 2019-07-13 12:30:52 +02:00
4731027447 tests: use vim.inspect (#10485)
The inspect modules is vendored as `vim.inspect`, and therefore it makes
sense to use this in tests also.

Ref: https://github.com/neovim/neovim/issues/6580
Ref: https://github.com/neovim/neovim/commit/bb3aa824b
2019-07-13 00:50:52 +02:00
108eb4201f vim-patch:8.1.1660: assert_fails() inside try/catch #10472
Problem:    Assert_fails() does not fail inside try/catch.
Solution:   Set trylevel to zero. (Ozaki Kiichi, closes vim/vim#4639)
7780e5c1c5
2019-07-13 00:09:05 +02:00
e682d799fa build: fix check_c_compiler_flag for -Wno-… (#10483)
`check_c_compiler_flag(-Wno-doesnotexist …)` is successful always,
apparently for all "no-" prefixes.

Therefore check for the flag itself (without "no-" prefix).

I am seeing a warning if the source fails to compile:

> cc1: warning: unrecognized command line option ‘-Wno-meh’

Which is turned into an error with `-Werror`:

> cc1: error: unrecognized command line option ‘-Wno-meh’ [-Werror]

But when it compiles successfully, there is no warning/error.

gcc (GCC) 9.1.0.
2019-07-12 22:42:44 +02:00
ec66d2eecd oldtest: more compact output with "clean" target (#10477)
Previously it would be displayed across multiple lines (with the escaped
newlines), while this makes it display in a single line.
2019-07-12 15:15:15 +02:00
dd94165f4e pvscheck.sh: Remove --verbose flag #10473
pvscheck.sh gives error:
    Flag could not be matched: verbose
2019-07-12 11:36:19 +02:00
6eab3b9250 vim-patch:8.1.1173: suspend test has duplicated lines (#10466)
Problem:    Suspend test has duplicated lines.
Solution:   Use a function.
a8356bc173
2019-07-11 12:20:36 +02:00
777cc6f98a ci: AppVeyor: do not install unibilium system-wide (#10464)
Initially added in 685ca180f, but gets built via third-party anyway by now.
2019-07-10 17:28:35 +02:00
564d415d20 build: BuildLuv: set/pass WITH_LUA_ENGINE (#10449)
Ref: https://github.com/neovim/neovim/pull/10438
2019-07-09 21:55:01 +02:00
c515b5c1f1 scripts/stripdecls.py #10458
Remove the `only_static = False` which clobbers the `--static`
CLI argument.
2019-07-09 20:06:52 +02:00
03a0226221 build: LibUV: required version: 1.28.0 (#10456)
For uv_gettimeofday.
2019-07-09 18:55:16 +02:00
7cf7c0a0b8 Merge pull request #9575 from bfredl/redrawdebug
ui: implement better redrawdebug for the compositor
2019-07-09 17:56:30 +02:00
48a5897ec4 bundle: update libuv: v1.29.1 => v1.30.0 (#10365)
- fs: fix uv_fs_copyfile if same src and dst
- build, core, unix: add support for Haiku
- unix: make uv_cwd() report UV_ENOBUFS
- unix: make uv_fs_read() fill all buffers
2019-07-09 15:45:43 +02:00
0da7b67ef9 Merge pull request #10457 from bfredl/dwfloat
compositor: handle float overlapping left half of doublewidth char
2019-07-09 15:42:02 +02:00
2c2f160a27 ui: add 'redrawdebug' option for flexible debugging of redrawing 2019-07-09 15:13:24 +02:00
4af1ada9ef compositor: handle float overlapping left half of doublewidth char 2019-07-09 14:46:58 +02:00
06af88cd72 viml/reltime(): allow negative result #10453
- define proftime_T as signed integer
- profile_sub(): allow negative result

closes #10452
2019-07-09 12:08:54 +02:00
652be3cb00 eval.c: clang/"Dead assignment" #10446 2019-07-09 12:06:14 +02:00
13fbeda0e5 Revert "tests: executable_spec: enable pending test #10443" (#10454)
This reverts commit b53c483a4a.
2019-07-09 11:46:23 +02:00
42bdccdf6c Merge pull request #10234 from bfredl/resizefloat
window: allow resize wincmds for floats
2019-07-08 19:50:43 +02:00
d11a146516 window: allow resize wincmds for floats 2019-07-08 19:45:57 +02:00
c07f266c5b tests: ex_terminal_spec: add test for previous leak (#10450)
Closes https://github.com/neovim/neovim/pull/4766.
2019-07-08 18:42:52 +02:00
44e150bd46 ci: Travis: use minimum supported CMake in one job (#10445) 2019-07-08 12:53:43 +02:00
71e0768e08 make all *.h linguist-language as C file #10442 2019-07-08 10:51:41 +02:00
524fe6205d Merge pull request #10090 from bfredl/floatpopup
api/window: add style="minimal" flag to disable unwanted UI features for simple floats
2019-07-07 21:35:55 +02:00
28a86608a8 CI: improve gcov handling #10404
- Move __gcov_flush to process_spawn, for more reliable coverage
  tracking of subprocesses
- Travis: use GCOV_ERROR_FILE
- codecov: use "-X fix" to skip "fixing" uploaded coverage data; it
  should be handled by codecov's backend instead.
- AppVeyor: no $PATH mangling, which breaks with the improved coverage tracking
  due to missing .dll in PATH.
2019-07-07 21:09:37 +02:00
ef3e32d57e api/window: add style="minimal" flag to nvim_open_win() 2019-07-07 20:52:15 +02:00
38342d75f6 ci: fix/improve Travis cache handling [skip appveyor] (#10412)
This is meant to not fall back to using the cache for the "master"
target branch, for release pull requests (targeting not "master").

(Travis builds the cache key based on all (explicit) job environment
variables)
2019-07-07 18:07:01 +02:00
b53c483a4a tests: executable_spec: enable pending test #10443
Should hopefully work now after efc6d9951b.
2019-07-07 13:05:52 +02:00
eb2509aef9 build: fix GetCompileFlags for CMake #10444
Ref: https://github.com/neovim/neovim/pull/10363#issuecomment-508916959
2019-07-07 13:01:38 +02:00
8c8961d9a2 vim-patch:8.0.1164: changing StatusLine highlight does not always work
Problem:    Changing StatusLine highlight while evaluating 'statusline' may
            not change the status line color.
Solution:   When changing highlighting while redrawing don't cause another
            redraw. (suggested by Ozaki Kiichi, closes vim/vim#2171, closes vim/vim#2120)
65ed136844
2019-07-06 09:34:00 -04:00
6012e4a52c vim-patch:8.0.1146: redraw when highlight is set with same names
Problem:    Redraw when highlight is set with same names. (Ozaki Kiichi)
Solution:   Only free and save a name when it changed. (closes vim/vim#2120)
452030e530
2019-07-06 09:31:39 -04:00
5dc5db1557 vim-patch:8.0.0755: terminal window does not have colors in the GUI
Problem:    Terminal window does not have colors in the GUI.
Solution:   Lookup the GUI color.
26af85d97b
2019-07-06 08:38:21 -04:00
1b99aa8c53 Merge #10394 from janlazo/vim-8.1.1614
vim-patch:8.1.{1614,1632,1634,1639}
2019-07-06 12:33:51 +02:00
b7ca478e10 func_clear_items: use XFREE_CLEAR #10436
Follow-up to https://github.com/neovim/neovim/pull/10428#discussion_r300813498
2019-07-06 12:22:20 +02:00
b9474b0641 Fix lint failed 2019-07-06 17:51:02 +09:00
85164b28cb Fix errors 2019-07-06 17:18:25 +09:00
5f7e0531c1 vim-patch:8.1.1611: bufadd() reuses existing buffer without a name
Problem:    Bufadd() reuses existing buffer without a name.
Solution:   When the name is empty always create a new buffer.
892ae723ab
2019-07-06 17:11:27 +09:00
3f6346b732 vim-patch:8.1.1610: there is no way to add or load a buffer without side effects
Problem:    There is no way to add or load a buffer without side effects.
Solution:   Add the bufadd() and bufload() functions.
15e248e37f
2019-07-06 17:09:56 +09:00
6f924880c7 vim-patch:8.1.1639: changing an autoload name into a file name is inefficient
Problem:    Changing an autoload name into a script file name is inefficient.
Solution:   Remember the last replaced #. (Ozaki Kiichi, closes vim/vim#4618)
28fc247f8d
2019-07-05 22:13:27 -04:00
255d189089 vim-patch:8.1.1634: terminal test fails when term_getansicolors() is missing
Problem:    Terminal test fails when term_getansicolors() is missing.
            Diff test fails without +rightleft.  (Dominique Pelle)
Solution:   Check if term_getansicolors() is supported. (closes vim/vim#4597)
981d9dc8f3
2019-07-05 21:26:47 -04:00
18ce2d3039 vim-patch:8.1.1632: build with EXITFREE but without +arabic fails
Problem:    Build with EXITFREE but without +arabic fails.
Solution:   Rename the function and adjust #ifdefs. (closes vim/vim#4613)
48ac671fe5
2019-07-05 21:26:46 -04:00
8062e6ff88 vim-patch:8.1.1614: 'numberwidth' can only go up to 10
Problem:    'numberwidth' can only go up to 10.
Solution:   Allow up to 20. (Charlie Stanton, closes vim/vim#4584)
f8a0712655
2019-07-05 21:26:46 -04:00
3c860e25e9 vim-patch:8.1.0229: crash when dumping profiling data #10428
Problem:    Crash when dumping profiling data.
Solution:   Reset flag indicating that initialization was done.
79c2ad50b8
2019-07-05 22:00:28 +02:00
7535f843cd termdebug.vim: vertical layout #10424 2019-07-05 20:45:26 +02:00
48efafc81c Merge pull request #10398 from bfredl/resizeautocmd
screen: disable redrawing inside VimResized
2019-07-05 20:27:01 +02:00
e7d49dcfb3 Merge pull request #10293 from bfredl/hi_msg
highlight: show "hi Group" message correctly when not using the screen
2019-07-05 18:08:40 +02:00
51a451570d screen: disable redrawing inside VimResized
Note: test doesn't fail on master. I cannot reproduce the glitches with
-u NONE, probably it requires interfering events. But add some coverage
for these checks at least.
2019-07-05 16:58:53 +02:00
399eb49baf highlight: show "hi Group" message correctly when not using the screen
ext_message doesn't set msg_col. Add a space and let client deal with
wrapping. When using silent redirect show the unwrapped message form.

Removed check is already part of msg_advance()
2019-07-05 15:52:59 +02:00
0d82aaf586 build: FindLibIntl: fix warning about CMP0075 (#10427)
* build: FindLibIntl: fix warning about CMP0075

The common pattern elsewhere to set this only during the check, and here
it was not unset, resulting in a warning later (on Alpine 3.10):

    -- Found Iconv
    -- Looking for pthread.h
    CMake Warning (dev) at /usr/share/cmake/Modules/CheckIncludeFile.cmake:80 (message):
      Policy CMP0075 is not set: Include file check macros honor
      CMAKE_REQUIRED_LIBRARIES.  Run "cmake --help-policy CMP0075" for policy
      details.  Use the cmake_policy command to set the policy and suppress this
      warning.

      CMAKE_REQUIRED_LIBRARIES is set to:

        /usr/lib/libintl.so

      For compatibility with CMake 3.11 and below this check is ignoring it.
    Call Stack (most recent call first):
      /usr/share/cmake/Modules/FindThreads.cmake:105 (CHECK_INCLUDE_FILE)
      CMakeLists.txt:482 (find_package)
    This warning is for project developers.  Use -Wno-dev to suppress it.

    -- Looking for pthread.h - found

* build: remove lists / REMOVE_ITEM around check_c_source_compiles
2019-07-05 12:19:13 +02:00
7836925c3b Merge pull request #10425 from blueyed/luarocks-build
BuildLuarocks.cmake: use ROCKS_DIR
2019-07-05 12:18:23 +02:00
c67315c7b5 BuildLuarocks: improve comments
I found it often irritation to see the same comment about "DEPENDS"
there all the time.  This uses the LuaRocks rock name as a comment
instead (which is hard to parse from the recipe), moves the note about
DEPENDS to the top (extended), and fixes/aligns some whitespace.
2019-07-05 04:10:30 +02:00
8eac3f63a2 BuildLuarocks.cmake: use ROCKS_DIR
With LuaRocks 3 it will include the version, and this will make the
upgrade easier then.
It also makes sense to factor this out in general for clarity already.

Pulled out of https://github.com/neovim/neovim/pull/10292.
2019-07-05 03:55:08 +02:00
84c1d3aede .gitignore 2019-07-04 21:11:29 +02:00
68c594b10c tests: loop_spec: retry (#10413)
Flaky test (osx):

    [  FAILED  ] ...is/build/neovim/neovim/test/functional/lua/loop_spec.lua @ 23: vim.loop timer
    ...is/build/neovim/neovim/test/functional/lua/loop_spec.lua:56: Expected objects to be the same.
    Passed in:
    (number) 0
    Expected:
    (number) 2
    stack traceback:
            ...is/build/neovim/neovim/test/functional/lua/loop_spec.lua:56: in function <...is/build/neovim/neovim/test/functional/lua/loop_spec.lua:23>

It was bumped from sleeping for 20ms to 50ms in d33aaa0f5f already.
2019-07-04 16:42:10 +02:00
0c639e8777 build: use -fdiagnostics-color=always with Ninja (#10419)
"auto" does not work, since Ninja does not appear as a TTY to gcc/clang,
but handles stripping escape codes itself when output is not to a TTY.

Ref: https://github.com/ninja-build/ninja/blob/ca041d88f4d6/src/build.cc#L158-L169
2019-07-04 15:24:33 +02:00
05a17e419a tests: fix flaky ':digraphs displays digraphs' (#10406) 2019-07-04 15:22:59 +02:00
5835398152 Merge pull request #10414 from blueyed/luacheck
Improve luacheck integration, fix more issues.
2019-07-04 15:21:44 +02:00
f668f0afb2 build: FindLuaJit: handle luajit-2.1 include path suffix (#10418) 2019-07-04 15:19:25 +02:00
fd8d26a713 third-party: fix warning with (un)bundled libtermkey/unibilium (#10416)
Fixes warning with:

> cmake -S third-party -B .deps -DUSE_BUNDLED=OFF -DUSE_BUNDLED_UNIBILIUM=0 -DUSE_BUNDLED_LIBTERMKEY=1
> The dependency target "unibilium" of target "libtermkey" does not exist.
2019-07-04 15:17:59 +02:00
efc6d9951b win,fs.c: Fix is_executable_ext #10209
Fix issue that increment expression is executable and pointer ext
pointing out of the buffer, if the pointer ext points to the terminating
NUL.

* Change termination condition judgment to one place
* Change first condition judgment
Change to not evaluate *(ext -1) in the first condition judgment.

* Change to use copy_option_part instead of STRLCPY
2019-07-04 14:45:51 +02:00
32361a1245 Improve luacheck setup [skip appveyor]
- Move .luacheckrc to root, add read_globals=vim
- Simplify lualint target, run it on all lua files
- Lint preload.lua, but ignore W211
- Remove testlint target, included in lualint (and lint)
- Clean up .luacheckrc
2019-07-04 12:29:54 +02:00
571b2c5e7b Fix luacheck errors for all Lua source files 2019-07-04 06:59:44 +02:00
99b870d61c build: bundle: clean binary dir with new downloads (#10411)
This is required to (re)build e.g. libluv when the version changes
(which triggers a new download).

With `make deps`, changing the `LUV_URL`/`LUV_SHA256`, and `make deps` again:

Before:

> Up-to-date: /home/daniel/Vcs/neovim/.deps/usr/lib/libluv.a

After:

> Installing: /home/daniel/Vcs/neovim/.deps/usr/lib/libluv.a

See with https://github.com/neovim/neovim/pull/10358 - where .deps
contained libluv 1.29, the merge updates it to 1.30, but then it failed
to link because `libluv.a` is considered to be up-to-date (after
downloading the new version).

Note that header files get installed, since they have the original time
stamp, but `libluv.a` is being generated (does not use the timestamp
from the archive here, but needs to get rebuild).

It could be argued that the build system of the included project should
catch/handle this, but it seems to be good practice to clean the binary
/ build dir with a new download to start from scratch.

Ref: https://gitlab.kitware.com/cmake/cmake/issues/19452

Also fixes cmake/BuildLuv / luv-static: use name with -DTARGET for
download command, and pass (shared) `SRC_DIR` explicitly instead.
2019-07-04 02:37:29 +02:00
f6298aba82 tests: shell-test: add INTERACT mode (#10405)
Use it to improve ls_spec: it should not use the user's real shell for
performance and other reasons.
2019-07-03 22:49:13 +02:00
0dc73b87f1 tests: executable_spec: keep assertion (#10408)
It was moved to become pending in 18127f64c, but the assertion should be
kept.
2019-07-03 12:56:03 +02:00
e48257e63e tests: fix/improve "TUI background color" tests (#10229)
- Ensure the opposite of the expected bg is active.
- Improves performance: 1.2s instead of 4.5s.
2019-07-03 03:37:19 +02:00
d42bbf363e ci: Travis: do not close fold on failure [skip ci]
This makes it easier to inspect the test failure, without having to open
two folds (typically), and scrolling around.
2019-07-03 00:43:22 +02:00
61790c7b3c build: Fix rule of build/.ran-third-party-cmake #10402
In order that `$(DEPS_BUILD_DIR)/Makefile` exists under parallel make
2019-07-03 00:25:49 +02:00
5b94a2977a tests: fix flaky "TermClose event triggers when fast-exiting terminal job stops" (#10377)
[  ERROR   ]...neovim/neovim/test/functional/autocmd/termclose_spec.lua @ TermClose event triggers when fast-exiting terminal job stops
    test/functional/helpers.lua:96: Vim(call):E900: Invalid channel id

    stack traceback:
            test/functional/helpers.lua:96: in function 'request'
            test/functional/helpers.lua:254: in function 'command'
            ...neovim/neovim/test/functional/autocmd/termclose_spec.lua:23: in function <...neovim/neovim/test/functional/autocmd/termclose_spec.lua:20>
2019-07-02 22:44:11 +02:00
1c45ba462b tests: fix flaky "terminal (with fake shell) with not arguments …" (#10401)
`retry()` would only try it three times (waiting for 20ms in between),
despite the large timeout.

Fixes https://github.com/neovim/neovim/issues/10265.
2019-07-02 19:31:36 +02:00
66f7e8e8e6 Merge pull request #10397 from bfredl/cmdcleanup
cmdline: remove local variables i and j from command_line_state
2019-07-02 18:17:25 +02:00
2afaf175f1 cmdline: remove local variables i and j from command_line_state 2019-07-02 10:19:39 +02:00
097f85ae6c defaults: wildoptions=pum,tagfile #10384
ref #6289
2019-07-01 23:59:24 +02:00
ff95e62ff8 test/old: pass Test_recover_root_dir on Windows (#10207)
* Revert "oldtests: win: keep set dir=/"

This reverts commit 714e0f8bf0.

* test/old: set swap directory to non-existent drive

Appveyor uses Administrator user so it can write anywhere in C:\\.
Neovim creates a directory for the swap file
if the directory does not exist.
D:\\ is the backup/recovery drive so use F:\\ invoke error E303.
2019-07-01 21:51:00 +02:00
5e4b93a38f Merge pull request #10389 from bfredl/luafloat
api/lua: make nvim_execute_lua use native lua floats, not special tables
2019-07-01 20:28:00 +02:00
6c5a6ab92d vim-patch:8.1.0452: MS-Windows: not finding intl.dll #10388
Problem:    MS-Windows: not finding intl.dll.
Solution:   Also find intl.dll next to libintl.dll. (Ken Takata)
7554c548a4
2019-07-01 20:14:00 +02:00
6d2b11d76c Merge pull request #10387 from bfredl/wildpos
cmdline: correct the column position of wildoptions=pum popupmenu
2019-07-01 19:50:17 +02:00
6ee05536ca api/lua: make nvim_execute_lua use native lua floats, not special tables
Rationale: the purpose of nvim_execute_lua is to simply call lua code with lua
values. If a lua function expects a floating point value, it should be enough
to specify a float as argument to nvim_execute_lua.

However, make sure to preserve the existing roundtripping behavior of
API values when using `vim.api` functions. This is covered by existing
lua/api_spec.lua tests.
2019-07-01 18:44:58 +02:00
b98d1cf68b cmdline: correct the column position of wildoptions=pum popupmenu
- position might get invalid with "longest" match
- position might be wrong when completed pattern ends in "/"
2019-07-01 18:24:00 +02:00
740fb337dd build: fix warning with passively available libintl (#10380)
Since 0364f51 it would display a warning.
2019-07-01 03:32:52 +02:00
6e06f4795a build: LibLUV: update required version [ci skip] (#10381)
Required after d33aaa0f5.

Does not really make a difference, since the VERSION is not handled with
our FindLibLUV (due to missing pkg-config information
(https://github.com/luvit/luv/issues/354)).
2019-07-01 03:26:05 +02:00
10a533e9d4 Merge pull request #10316 from bfredl/cb_safety
luv callbacks: throw error on deferred methods instead of crashing
2019-06-30 16:03:58 +02:00
3b504e7c8d fileio.c: eliminate set_file_time() #10357
Introduce os_file_settime(), remove cruft.
2019-06-30 16:00:35 +02:00
fdd8dcae01 man.vim: Handle ANSI escape sequences with ":" #10267
closes #10267
2019-06-30 15:25:49 +02:00
99f24dfbed make vim.loop == require'luv'
This avoids initializing libluv a second time if a plugin invokes
require'luv'. It is probably not an issue, but better to be safe.
2019-06-30 15:16:32 +02:00
d33aaa0f5f libluv: use luv_set_callback to control callback execution
Disable the use of deferred API functions in a fast lua callback
Correctly display error messages from a fast lua callback
2019-06-30 13:13:08 +02:00
7030d7daf1 rename: FUNC_API_ASYNC => FUNC_API_FAST 2019-06-30 11:33:01 +02:00
0480e991d2 :digraphs : check for CTRL-C less often #10376
No need to do this so frequently.
2019-06-30 02:33:50 +02:00
72ae0a6e5e Makefile: CMAKE_INSTALL_PREFIX: skip parsing CMAKE_EXTRA_FLAGS if set (#10374)
Fixes:

>  Recursive variable 'CMAKE_EXTRA_FLAGS' references itself (eventually).  Stop.
2019-06-30 01:29:10 +02:00
0364f517bb build: update cmake/LibFindMacros.cmake (#10355)
Source: d6b5e94625/LibFindMacros.cmake
2019-06-30 01:12:38 +02:00
75be0f0bbb Makefile: move all target to the top [ci skip] #10375
Fixes "make: Nothing to be done for 'checkprefix'." after 5031e3298.
2019-06-30 00:13:53 +02:00
2ef6f28e11 doc [ci skip] #10177
ref #10278 #10279 #10353
2019-06-30 00:09:45 +02:00
52fced6090 build: update some test dependencies (#10339)
* build: update some test dependencies

* luacheck ignores

* BuildLua: add ${BUSTED} to depends for ${BUSTED_LUA}

This is required to rebuild it when busted gets updated.
2019-06-29 22:25:00 +02:00
9875372607 build: FindLibLUV: use PkgConfig (#10359)
Apparently forgotten in c83926cd0.

- Also LIMIT_SEARCH was never used.
- Also add LIBLUV_DEFINITIONS, as used with other Find modules.
2019-06-29 21:49:49 +02:00
5031e32986 Makefile: revisit/improve checkprefix handling (#10348)
Main improvement: do not error out, but re-run CMake in case
CMAKE_INSTALL_PREFIX changed, and only check it for "install".

- only look at CMAKE_EXTRA_FLAGS via shell if not empty
- add CMAKE_INSTALL_PREFIX to CMAKE_EXTRA_FLAGS (not CMAKE_FLAGS), to
  override it being set in CMAKE_EXTRA_FLAGS from local.mk
- use an empty "checkprefix" target if CMAKE_INSTALL_PREFIX is not
  provided
- skip checking of cached value without build/.ran-cmake; it will be run
  then anyway
- only use it with "install" target; it is only relevant there
- do not error, but re-run CMake (by removing the stamp file)
2019-06-29 21:48:40 +02:00
2d4a37ebab :ls : show "R", "F" for terminal-jobs #10370
This matches Vim behavior. From `:help :ls` :

    R    a terminal buffer with a running job
    F    a terminal buffer with a finished job
    ?    a terminal buffer without a job: `:terminal NONE`

TODO: implement `:terminal NONE`.

ref #10349
2019-06-29 21:03:38 +02:00
c207095445 build: CMake: do not set CMP0059 to old (#10363)
Keeps using add_definitions for compatibility with older CMake.

Newer CMake (3.12) would have `add_compile_definitions`, but it is not
required, since `add_defitions` was meant to be used for
compile/preprocessor definitions initially anyway.

Ref: https://github.com/neovim/neovim/pull/4389
2019-06-29 20:37:48 +02:00
39ba35b38d cmake/RunTests.cmake: fix TEST_TAG/TEST_FILTER [ci skip] #10371
Followup to f1f9a2f97.
The mentioned example there did not work after all, likely due to
changing quoting during PR review.
2019-06-29 19:15:48 +02:00
e9f1bdabb8 tests: fix flaky "timers can be stopped from the handler" (#10364)
Seen on Travis (osx):

    [ RUN      ] timers can be stopped from the handler: FAIL
    .../build/neovim/neovim/test/functional/eval/timer_spec.lua:167: Expected objects to be the same.
    Passed in:
    (number) 2
    Expected:
    (number) 3
    stack traceback:
            .../build/neovim/neovim/test/functional/eval/timer_spec.lua:167: in function <.../build/neovim/neovim/test/functional/eval/timer_spec.lua:153>
2019-06-29 17:53:09 +02:00
e2ce5ff9d6 viml/profile: switch to uv_gettimeofday() #10356
Performance of high-resolution time (clock_gettime via uv_hrtime) is
expensive on some systems.  For profiling VimL, syntax, etc., we don't
care about nanosecond-precision and monotonicity edge-cases, so avoid
uv_hrtime().

closes #10328

From the uv__hrtime() source:
0cdb4a5b4b/src/unix/linux-core.c (L442-L462)

    /* Prefer CLOCK_MONOTONIC_COARSE if available but only when it has
     * millisecond granularity or better.  CLOCK_MONOTONIC_COARSE is
     * serviced entirely from the vDSO, whereas CLOCK_MONOTONIC may
     * decide to make a costly system call.
     */

This micro-benchmark (Debug build) shows negligible differences on my
system:

    #include <sys/time.h>
    ...

    proftime_T tm = profile_start();
    int trials = 999999;
    int64_t t = 0;
    struct timeval tv;
    for (int i = 0; i < trials; i++) {
      t += gettimeofday(&tv,NULL);
    }
    tm = profile_end(tm);
    ILOG("%d trials of gettimeofday: %s", trials, profile_msg(tm));
    tm = profile_start();
    for (int i = 0; i < trials; i++) {
      t += os_hrtime();
    }
    tm = profile_end(tm);
    ILOG("%d trials of os_hrtime: %s", trials, profile_msg(tm));
    tm = profile_start();
    for (int i = 0; i < trials; i++) {
      t += os_utime();
    }
    tm = profile_end(tm);
    ILOG("%d trials of os_utime: %s", trials, profile_msg(tm));
    ILOG("%zu", t);
2019-06-29 16:39:22 +02:00
23a9794920 Merge #10369 from janlazo/vim-8.0.1202
vim-patch:8.0.{1202,1259}
2019-06-29 13:51:50 +02:00
489d3b084f vim-patch:8.0.1259: search test can be flaky
Problem:    Search test can be flaky.
Solution:   Use WaitFor() instead of a delay.  Make it possible to pass a
            funcref to WaitFor() to avoid the need for global variables.
            (James McCoy, closes vim/vim#2282)
13deab8d08
2019-06-28 23:53:28 -04:00
bddc4dc0ed vim-patch:8.0.1238: incremental search only shows one match
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
2019-06-28 23:47:16 -04:00
805d6e450a vim-patch:8.0.1202: :wall gives an errof for a terminal window
Problem:    :wall gives an errof for a terminal window. (Marius Gedminas)
Solution:   Don't try writing a buffer that can't be written. (Yasuhiro
            Matsumoto, closes vim/vim#2190)
059db5c29f
2019-06-28 22:22:59 -04:00
c696fcdcaa build: remove patch: luv-Add-missing-definitions-for-MinGW [skip travis] #10360
Added in 4ae7acd15 initially, but seems to not be necessary anymore,
and/or should be send upstream otherwise.
2019-06-28 13:19:47 +02:00
6765bbc651 build: CMake: remove usage of USE_BUNDLED_X in main project (#10354)
The variables are not meant to be defined there really, but only with
the third-party project.

Using them, e.g. with the following, would actually result in libvterm
not being found then:

    make CMAKE_EXTRA_FLAGS="-DUSE_BUNDLED_LIBVTERM=ON" \
      DEPS_CMAKE_FLAGS="-DUSE_BUNDLED=OFF -DUSE_BUNDLED_LIBVTERM=ON"

In https://github.com/neovim/neovim/pull/6357 they were renamed to
`USE_BUNDLED_X` from `X_USE_BUNDLED`, but the above reasoning applies
to the old names, too.

Internally `CMAKE_PREFIX_PATH` is used to add the built/bundled third
party packages for `find_package`, so there is no reason to e.g. query
the values via `load_cache` for example from the third-party project.
2019-06-28 02:02:19 +02:00
9f64e4b73f Merge #10349 from janlazo/vim-8.0.0935
vim-patch:8.0.{935,1013,1100,1119}
2019-06-27 22:31:51 +02:00
35b959c600 CMakeLists: remove/cleanup passing of CMAKE_SYSTEM_NAME (#10351)
Just set it from `${CMAKE_HOST_SYSTEM_NAME}` directly, instead of passing it
from the main CMake file (CMAKE_SYSTEM_NAME defaults to it, but is empty
in script mode).

Initially added in 9ce81f7b2, but then even used with unrelated commands
(that do not use RunTests.cmake, e.g. 221f6fffa).
2019-06-27 20:14:00 +02:00
31dbc6f63e build: BuildLua: fix check for mingw [skip ci] (#10352) 2019-06-27 20:11:45 +02:00
04f559dc05 ci: AppVeyor: GCOV_ERROR_FILE: head/tail [skip ci] (#10335) 2019-06-27 14:38:33 +02:00
d555e44219 vim-patch:8.0.1120: :tm means :tmap instead of :tmenu
Problem:    :tm means :tmap instead of :tmenu. (Taro Muraoka)
Solution:   Move the new entry below the old entry. (closes vim/vim#2102)
63c4e8a198
2019-06-27 07:59:49 -04:00
2b400daca3 vim-patch:8.0.1100: stuck in redraw loop when 'lazyredraw' is set
Problem:    Stuck in redraw loop when 'lazyredraw' is set.
Solution:   Don't loop on update_screen() when not redrawing. (Yasuhiro
            Matsumoto, closes vim/vim#2082)
072412ed45
2019-06-26 21:49:29 -04:00
58cf81914d vim-patch:8.0.1013: terminal window behaves different from a buffer with changes
Problem:    A terminal window with a running job behaves different from a
            window containing a changed buffer.
Solution:   Do not set 'bufhidden' to "hide".  Fix that a buffer where a
            terminal used to run is listed as "[Scratch]".
e561a7e2fa
2019-06-26 20:51:18 -04:00
59b35d6a10 vim-patch:8.0.0935: cannot recognize a terminal buffer in :ls output
Problem:    Cannot recognize a terminal buffer in :ls output.
Solution:   Use R for a running job and F for a finished job.
304b64c9e6
2019-06-26 20:39:24 -04:00
a924650d98 Makefile: fix regression with "make functionaltest-lua" (#10346)
Regressed in 69eb4fa0c.
2019-06-26 22:44:48 +02:00
c62690ccc4 ci: Travis: upgrade OSX images (10.1 => 10.2) (#10319)
* ci: Travis: upgrade OSX images (10.1 => 10.2)

* ci: nvim-deps: use `cp -a`  [skip appveyor]

Symlinks should be preserved.

Ref: https://github.com/neovim/neovim/pull/10319#issuecomment-505410132
2019-06-26 20:06:40 +02:00
ac013d7147 Merge pull request #10342 from bfredl/apisandbox
eval/api: don't allow the API to be called in the sandbox
2019-06-26 11:59:08 +02:00
469726d3c5 Merge #10340 from janlazo/vim-8.1.1593
vim-patch:8.0.1688,8.1.1593
2019-06-26 11:01:10 +02:00
8b263c7a68 Merge pull request #10344 from bfredl/extcmdredraw
cmdline: remove invalid cmdline_show event when aborting mapping
2019-06-26 10:47:18 +02:00
48b4ecc96d Merge pull request #10343 from bfredl/scrollblend
compositor: handle scrolling of blended window
2019-06-26 10:07:54 +02:00
4bf05ba399 cmdline: remove invalid cmdline_show event when aborting mapping 2019-06-26 09:16:17 +02:00
2a2d288228 compositor: handle scrolling of blended window 2019-06-26 08:37:36 +02:00
619a86cb1e eval/api: don't allow the API to be called in the sandbox.
Identifying and maintaining a "secure" subset of the API would be too
much busywork. So just disable the entire thing.
2019-06-26 08:19:57 +02:00
2d6c91ab99 vim-patch:8.0.1688: some macros are used without a semicolon
Problem:    Some macros are used without a semicolon, causing auto-indent to be
            wrong.
Solution:   Use the do-while(0) trick. (Ozaki Kiichi, closes vim/vim#2729)
6f4700233f
2019-06-26 00:05:29 -04:00
62c7fcbdab vim-patch:8.1.1593: filetype not detected for C++ header files without extension
Problem:    Filetype not detected for C++ header files without extension.
Solution:   Recognize the file by the Emacs file mode. (Dmitry Ilyin,
            closes vim/vim#4593)
6a7af8e2db
2019-06-25 21:20:26 -04:00
10c983fabe build: Makefile: fix distclean [ci skip] (#10336)
Do not run CMake in build before deleting it unnecessarily:

    % make distclean
    test -d build && ninja -C build clean || true
    ninja: Entering directory `build'
    [0/1] Re-running CMake...
2019-06-25 19:51:28 +02:00
788bcbba24 Merge pull request #9923 from bfredl/floatblend
blending of floating windows, override individual attributes with ":hi Group blend="
2019-06-25 18:36:07 +02:00
b0c1e2ab5a api: make nvim__inspect_cell support multiple grids 2019-06-25 18:08:21 +02:00
4c4d964eeb ui: add 'winblend' to support blending of floating windows
Also add `hi blend=` attribute to override transparency of indiviual attributes.
2019-06-25 18:08:21 +02:00
3e6f06f5d2 build: use main cmake modules with third-party (#10330)
This is meant to make it possible to use `find_package(LuaJit)` etc with
the third-party CMake project in general.

Followup to https://github.com/neovim/neovim/pull/10297/files#r296439576.
2019-06-25 17:34:28 +02:00
e13ae7cae6 ci: revisit/fix coverage uploading (#10201)
* Add ci/common/submit_coverage.sh, used with Travis and AppVeyor

* use gcovr, with coverage.xml for better branch coverage reporting, and
  easier processing of gcov files in general

* codecov: use flags again, with `uname -s` additionally
  Ref: https://github.com/neovim/neovim/pull/10227#issuecomment-502923543

* remove now unused parsers.gcov config from codecov.yml
2019-06-25 15:35:33 +02:00
027ebb23da Merge #10329 from janlazo/vim-8.1.0437
vim-patch:8.0.1535,8.1.{198,437,1342}
2019-06-25 13:58:48 +02:00
ace7e4e11b vim-patch:8.1.1342: using freed memory when joining line with text property
Problem:    Using freed memory when joining line with text property.
Solution:   Use already computed length.
787880a86d
2019-06-25 00:23:00 -04:00
56a96d8f82 vim-patch:8.0.1535: C syntax test still fails when using gvim
Problem:    C syntax test still fails when using gvim.
Solution:   Clear Normal cterm highlighting instead of setting it.
6acadda8d6
2019-06-24 23:44:54 -04:00
e7901301d3 vim-patch:8.1.0198: there is no hint that syntax is disabled for 'redrawtime'
Problem:    There is no hint that syntax is disabled for 'redrawtime'.
Solution:   Add a message.
0a6efcd27d
2019-06-24 23:40:18 -04:00
dfd050867b vim-patch:8.1.0437: may access freed memory when syntax HL times out
Problem:    May access freed memory when syntax HL times out. (Philipp Gesang)
Solution:   Clear b_sst_first when clearing b_sst_array.
95892c27b2
2019-06-24 23:34:17 -04:00
615fc68263 Merge #10323 from janlazo/vim-8.1.1055
vim-patch:8.0.{1479,1480,1482},8.1.1055
2019-06-25 02:37:50 +02:00
79450f2da9 Merge #10250 from blueyed/vim-8.0.1039
vim-patch:8.0.{10{39,53,55},1274}: cannot change a line in not current buffer
2019-06-25 02:36:07 +02:00
8cd87af8d6 Merge pull request #10290 from janlazo/vim-8.1.0086
vim-patch:8.1.{86,347}
2019-06-25 01:56:10 +02:00
5ae57b7e57 health.vim: check shada file #10327
closes #1202
2019-06-25 01:31:41 +02:00
8c7e41f596 [RFC] vim-patch:8.1.1365,8.1.1366,8.1.1367,8.1.1368,8.1.1382,8… (#10309)
[RFC] vim-patch:8.1.1365,8.1.1366,8.1.1367,8.1.1368,8.1.1382,8.1.1401
2019-06-24 12:08:57 -04:00
8d4a655ace build: CMake: remove LUAROCKS_VERSION (#10317)
This is not necessary and avoids confusion.
2019-06-24 18:04:57 +02:00
f2e3849100 Merge #10313 from rhysd/const-patches
vim-patch:8.1.1539,8.1.1543,8.1.1554 for :const from Vim
2019-06-24 14:27:31 +02:00
6cb4460207 lint 2019-06-24 06:46:01 -04:00
280938d932 vim-patch:8.1.1401: misspelled mkspellmem as makespellmem
Problem:    Misspelled mkspellmem as makespellmem.
Solution:   Drop duplicate help entry, fix test. (Naruhiko Nishino, Ken
            Takata, closes vim/vim#4437)
076073950c
2019-06-24 06:46:01 -04:00
d265054394 vim-patch:8.1.1382: error when editing test file
Problem:    Error when editing test file.
Solution:   Remove part of modeline.
3020a87cb1
2019-06-24 06:46:01 -04:00
f9694de9f1 vim-patch:8.1.1368: modeline test fails with python but without pythonhome
Problem:    Modeline test fails with python but without pythonhome.
Solution:   Correct test argument.
e09244ee35
2019-06-24 06:46:01 -04:00
2db189f57c vim-patch:8.1.1367: can set 'modelineexpr' in modeline
Problem:    can set 'modelineexpr' in modeline.
Solution:   Add P_SECURE flag.
7e800c6047
2019-06-24 06:46:00 -04:00
1e4673d167 vim-patch:8.1.1366: using expressions in a modeline is unsafe
Problem:    Using expressions in a modeline is unsafe.
Solution:   Disallow using expressions in a modeline, unless the
            'modelineexpr' option is set.  Update help, add more tests.
110289e781
2019-06-24 06:45:55 -04:00
45bb1757bf vim-patch:8.1.1365: source command doesn't check for the sandbox
Problem:    Source command doesn't check for the sandbox. (Armin Razmjou)
Solution:   Check for the sandbox when sourcing a file.
5357552140
2019-06-24 06:41:57 -04:00
433c136a8a build: luarocks: fall back to luajit (#10297)
This regressed in 204ec6337.

Currently it would detect/use lua5.3 from the system, but in general
luajit is / should be preferred.

Noticed this due to nvim-client failing to build with Lua 5.3
(https://github.com/neovim/lua-client/pull/43).
2019-06-24 08:48:54 +02:00
93297cfc6f tests: busted: do not use "--lua" (#10303)
The feature is very rudimentary [1], and causes problems when not using
bundled deps, where it might then fail to find `busted.runner` due to
this.

E.g. with "-DUSE_BUNDLED=OFF -DUSE_BUNDLED_LUAROCKS=ON":
`.deps/usr/bin/busted` contains `exec '/usr/bin/luajit' -e …`, i.e. it
run luajit with adjusted lpath etc.
But using `--lua /usr/bin/luajit` then causes this `busted` wrapper to
be replaced with just `/usr/bin/luajit`, i.e. it is missing the adjusted
lpath then.

1: 9eb6c9cf93
2019-06-24 08:47:02 +02:00
ed2d651b50 vim-patch:8.0.1482: using feedkeys() does not work to test completion
Problem:    Using feedkeys() does not work to test Insert mode completion.
            (Lifepillar)
Solution:   Do not check for typed keys when executing :normal or feedkeys().
            Fix thesaurus completion not working when 'complete' is empty.
02ae9b4a93
2019-06-24 00:09:28 -04:00
28456e96f3 os: close library even if uv_dlopen() fails 2019-06-23 23:23:33 -04:00
87d6b1eccb vim-patch:8.1.0347: some tests fail on Solaris
Problem:    Some tests fail on Solaris.
Solution:   Skip writefile test. Fix path to libc.so. Improve test for Turkish
            case change. (Libor Bukata, Bjorn Linse, closes vim/vim#3403)
f1c118be93
2019-06-23 23:20:29 -04:00
d4de2cd7c7 vim-patch:8.1.0086: no tests for libcall() and libcallnr()
Problem:    No tests for libcall() and libcallnr().
Solution:   Add tests. (Dominique Pelle, closes vim/vim#2982)
1ceebb4efc
2019-06-23 23:20:29 -04:00
162bc62f56 vim-patch:8.0.1480: patch missing change
Problem:    Patch missing change.
Solution:   Add missing change.
0562532c2e
2019-06-23 22:23:50 -04:00
287f7a46a4 vim-patch:8.0.1479: insert mode completion state is confusing
Problem:    Insert mode completion state is confusing.
Solution:   Move ctrl_x_mode into edit.c.  Add CTRL_X_NORMAL for zero.
bc0e9adae9
2019-06-23 22:23:50 -04:00
69eb4fa0c5 build: Makefile: handle "rm -rf .deps" (#10305)
- make `build/.ran-third-party-cmake` depend on `$(DEPS_BUILD_DIR)`.
  It still creates `build` there as a side-effect, which does not
  belong there really, but is OK for now.

- add an explicit target for `$(DEPS_BUILD_DIR)` (".deps"), only with
  USE_BUNDLED=1  (the default).

This makes it easier to rebuild deps cleanly, by using `rm -rf .deps; make`.
2019-06-24 04:13:57 +02:00
c4739345fe build: luajit: do not disable jit (#10318)
This was added in 4c92a0bac to help with debugging, but could also have been
just moved there instead of disabling it manually (which was done due to
issues on Travis with OSX).

Since the JIT is the main feature of luajit, we should not disable it,
especially not during compile time.
2019-06-24 04:11:33 +02:00
f96a2dabac bundle: upgrade LuaJIT to latest v2.0 commit (#10320)
Changes: 7dbf0b05f1..61464b0a5b
2019-06-24 04:11:04 +02:00
3dcf2d5c16 vim-patch:8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Problem:    CTRL-G U in Insert mode doesn't work to avoid splitting the undo
            sequence for shift-left and shift-right.
Solution:   Also check dont_sync_undo for shifted cursor keys. (Christian
            Brabandt)
75bf3d22f4
2019-06-23 20:50:37 -04:00
3e8bc4a13f eval.c: Fix clint errors and typo in comment of ex_const() 2019-06-24 09:35:56 +09:00
7d604a1e61 Merge #10294 from janlazo/vim-8.0.1239
vim-patch:8.0.1239,8.1.{112,125,165,166,167,169,181,242,270,272,747,850,853,1519}
2019-06-24 02:35:25 +02:00
3d5a800278 vim-patch:8.1.1554: docs and tests for :const can be improved
Problem:    Docs and tests for :const can be improved.
Solution:   Improve documentation, add a few more tests. (Ryuichi Hayashida,
            closes vim/vim#4551)
1c196e7b17
2019-06-24 09:31:30 +09:00
bd0615590b vim-patch:8.1.1543: const test fails with small features
Problem:    Const test fails with small features.
Solution:   Don't unlet non-existing variables.
b6e3b88ec8
2019-06-24 09:31:12 +09:00
1c90c19f62 vim-patch:8.1.1539: not easy to define a variable and lock it
Problem:    Not easy to define a variable and lock it.
Solution:   Add ":const".
9937a05543
2019-06-24 09:30:51 +09:00
fa3db26f10 eval: assert VAR_LIST branch in filter_map() 2019-06-23 19:11:01 -04:00
9fd4a0b526 getchar: Handle incomplete <Paste> in typeahead buffer #10311
<Paste> is a 3-byte sequence and the beginning one or two bytes can appear at
the very end of the typeahead buffer. When this happens, we were exiting from
`vgetorpeek()` instead of reading more characters to see the complete sequence.

I think this should fix #7994 -- at least partially. Before this change, when I
paste exactly 64 characters into a freshly booted instance, I get what I pasted
plus the literal text "<Paste>" at the end. Nvim also stays in nopaste mode.
The attached test case fails in this manner without the code change.

Fix #7994
2019-06-24 00:28:04 +02:00
4653b5943f vim-patch:8.1.0747: map() with a bad expression doesn't give an error
Problem:    map() with a bad expression doesn't give an error. (Ingo Karkat)
Solution:   Check for giving an error message. (closes vim/vim#3800)
ce9d50df07
2019-06-23 18:17:10 -04:00
2813c83ea1 vim-patch:8.1.1519: 'backupskip' may contain duplicates
Problem:    'backupskip' may contain duplicates.
Solution:   Add the P_NODUP flag. (Tom Ryder)
06e2c81f6d
2019-06-23 18:17:10 -04:00
6558e02b95 vim-patch:8.1.0853: options test fails on Mac
Problem:    Options test fails on Mac.
Solution:   Remove a trailing slash from $TMPDIR.
cbbd0f6578
2019-06-23 18:17:09 -04:00
ca6b42d7fd vim-patch:8.1.0850: test for 'backupskip' is not correct
Problem:    Test for 'backupskip' is not correct.
Solution:   Split the option in parts and use expand(). (Michael Soyka)
98ad1e17c3
2019-06-23 18:17:09 -04:00
25f99dde94 vim-patch:8.1.0272: options test fails if temp var ends in slash
Problem:    Options test fails if temp var ends in slash. (Tom Briden)
Solution:   Check for optional slash. (closes vim/vim#3308)
f53c692240
2019-06-23 18:17:09 -04:00
450d9e6bdf vim-patch:8.1.0270: checking for a Tab in a line could be faster
Problem:    Checking for a Tab in a line could be faster.
Solution:   Use strchr() instead of strrchr(). (closes vim/vim#3312)
b31a3acce1
2019-06-23 18:17:09 -04:00
1935cc2639 vim-patch:8.1.0242: Insert mode completion may use an invalid buffer pointer
Problem:    Insert mode completion may use an invalid buffer pointer.
Solution:   Check for ins_buf to be valid. (closes vim/vim#3290)
02ab97709d
2019-06-23 18:17:09 -04:00
3a49fa8f8b vim-patch:8.1.0169: calling message_filtered() a bit too often
Problem:    Calling message_filtered() a bit too often.
Solution:   Only call message_filtered() when filtering is already false.
a9defadb8f
2019-06-23 18:17:09 -04:00
bb02ca6def vim-patch:8.1.0167: lock flag in new dictitem is reset in many places
Problem:    Lock flag in new dictitem is reset in many places.
Solution:   Always reset the lock flag.
c89d4b3530
2019-06-23 18:17:09 -04:00
98801ec7ae vim-patch:8.1.0166: using dict_add_nr_str() is clumsy
Problem:    Using dict_add_nr_str() is clumsy.
Solution:   Split into two functions. (Ozaki Kiichi, closes vim/vim#3154)
e0be167a80
2019-06-23 18:17:09 -04:00
ff244a1309 vim-patch:8.1.0165: :clist output can be very long
Problem:    :clist output can be very long.
Solution:   Support filtering :clist entries. (Yegappan Lakshmanan)
4cde86c2ef
2019-06-23 18:17:09 -04:00
f99e314da0 ops: refactor swapchar() to return bool 2019-06-23 18:17:09 -04:00
3abffe7015 vim-patch:8.1.0125: virtual edit replace with multi-byte fails at end of line
Problem:    Virtual edit replace with multi-byte fails at end of line. (Lukas
            Werling)
Solution:   use ins_char() to add the character. (Christian Brabandt,
            closes vim/vim#3114)  Rename PCHAR() to PBYTE() to avoid mistakes like
            this.
630afe889a
2019-06-23 18:17:09 -04:00
f0d6695e7c vim-patch:8.1.0181: memory leak with trailing characters in skip expression
Problem:    Memory leak with trailing characters in skip expression.
Solution:   Free the return value.
a43ebe9454
2019-06-23 18:17:08 -04:00
6eae28f090 eval: require nonnull func args to pass ASAN build 2019-06-23 18:17:08 -04:00
efdc0f6a69 vim-patch:8.1.0112: no error when using bad arguments with searchpair()
Problem:    No error when using bad arguments with searchpair().
Solution:   Add error messages.
3dddb09c98
2019-06-23 18:17:08 -04:00
8bc365c886 lint 2019-06-23 18:17:08 -04:00
83ef740e15 vim-patch:8.0.1239: cannot use a lambda for the skip argument to searchpair()
Problem:    Cannot use a lambda for the skip argument to searchpair().
Solution:   Evaluate a partial, funcref and lambda. (LemonBoy, closes vim/vim#1454,
            closes vim/vim#2265)
48570488f1
2019-06-23 18:17:08 -04:00
0bdeec8ef0 screen: Adjust buffer sizes for multiple sign columns #10314
* screen: Fix to draw signs with combining characters.
The buffer size for signs can be too small, because the upper length
limit of a sign can be 56 bytes. If combining characters are only two
bytes in size, this reduces to 32 bytes.

* screen: Adjust buffer size to maximal sign column count
2019-06-24 00:01:01 +02:00
9ce34050e5 Makefile: fix trailing space in BUILD_CMD #10312
Only append flag for verbosity with ninja if non-empty.

Fixes the trailing space with `ninja  -C .deps`.
2019-06-23 15:25:29 +02:00
de2e51439e build: tests: build luv rock also with USE_BUNDLED_LUV=0 (#10307)
Followup to https://github.com/neovim/neovim/pull/10291
Ref: https://github.com/neovim/neovim/issues/10289
2019-06-23 04:17:13 +02:00
098fd36235 version.c: update [ci skip] #10115
vim-patch:8.0.0908: cannot set terminal size with options
vim-patch:8.0.0909: channel test fails
vim-patch:8.0.0920: cursor wrong after switching altscreen in terminal
vim-patch:8.0.0923: crash in GUI when terminal job exits
vim-patch:8.0.0924: terminal window not updated after using term_sendkeys()
vim-patch:8.0.0926: when job in terminal window ends topline is wrong
vim-patch:8.0.0927: if a terminal job sends a blank title "running" is not shown
vim-patch:8.0.0929: :term without argument does not work
vim-patch:8.0.0936: mode() returns wrong value for a terminal window
vim-patch:8.0.0938: scrolling in terminal window is inefficient
vim-patch:8.0.0939: Test_terminal_env is flaky
vim-patch:8.0.0940: Test_terminal_scrape_multibyte is flaky
vim-patch:8.0.0942: using freed memory with ":terminal"
vim-patch:8.0.0943: MS-Windows: Test_terminal_scrape_multibyte may fail
vim-patch:8.0.0957: a terminal job can deadlock when sending many keys
vim-patch:8.0.0958: terminal test fails on Windows when winpty dll is missing
vim-patch:8.0.0959: build failure on MS-Windows
vim-patch:8.0.0963: terminal test fails on MacOS
vim-patch:8.0.0964: channel write buffer does not work with poll()
vim-patch:8.0.0965: not restoring cursor shape after it was set in a terminal
vim-patch:8.0.0968: crash when switching terminal modes
vim-patch:8.0.0973: initial info about blinking cursor is wrong
vim-patch:8.0.0977: cannot send lines to a terminal job on MS-Windows
vim-patch:8.0.0978: writing to terminal job is not tested
vim-patch:8.0.0979: terminal noblock test fails on MS-Windows
vim-patch:8.0.0981: cursor in terminal window blinks by default
vim-patch:8.0.0982: cannot use a terminal when 'encoding' is non-utf8 multi-byte
vim-patch:8.0.0984: terminal blinking cursor not correct in the GUI
vim-patch:8.0.0985: libvterm has its own idea of character width
vim-patch:8.0.0987: terminal: second byte of double-byte char wrong
vim-patch:8.0.0990: with DBCS 'encoding' wrong pasting register into terminal
vim-patch:8.0.0991: using wrong character conversion for DBCS
vim-patch:8.0.0992: terminal title is wrong when 'encoding' is DBCS
vim-patch:8.0.0994: MS-Windows: cursor in terminal blinks undesirably
vim-patch:8.0.0995: terminal tests fail on Mac
vim-patch:8.0.1009: Xterm cursor blinking status may be inverted
vim-patch:8.0.1011: terminal test fails with Athena and Motif
vim-patch:8.0.1015: missing update to terminal test
vim-patch:8.0.1034: sending buffer lines to terminal doesn't work on MS-Windows
vim-patch:8.0.1036: ++eof argument for terminal only available on MS-Windows
vim-patch:8.0.1049: shell on Mac can't handle long text
vim-patch:8.0.1052: term_start() does not allow in_io, out_io and err_io options
vim-patch:8.0.1054: terminal test fails on MS-Windows
vim-patch:8.0.1057: terminal scrape test waits too long
vim-patch:8.0.1058: terminal redirection test is flaky
vim-patch:8.0.1070: terminal test is flaky on Mac
vim-patch:8.0.1075: MS-Windows: mouse does not work in terminal
vim-patch:8.0.1076: term_start() does not take callbacks
vim-patch:8.0.1080: memory leak for eof_chars terminal option and buffer name
vim-patch:8.0.1081: memory leak for the channel write queue
vim-patch:8.0.1083: leaking memory in input part of channel
vim-patch:8.0.1087: Test_terminal_cwd is flaky
vim-patch:8.0.1095: terminal multibyte escrape test is flaky
vim-patch:8.0.1101: channel write fails if writing to log fails
vim-patch:8.0.1103: converting cterm color fails for grey ramp
vim-patch:8.0.1106: terminal colors wrong on an MS-Windows console
vim-patch:8.0.1116: terminal test fails on MS-Windows
vim-patch:8.0.1117: Test_terminal_no_cmd hangs on MS-Windows with GUI
vim-patch:8.0.1126: endless resize when terminal showing in two buffers
vim-patch:8.0.1131: not easy to trigger an autocommand for new terminal window
vim-patch:8.0.1149: libvterm colors differ from xterm
vim-patch:8.0.1167: Motif: typing in terminal window is slow
vim-patch:8.0.1173: terminal window is not redrawn after CTRL-L
vim-patch:8.0.1177: in a terminal window the popup menu is not cleared
vim-patch:8.0.1213: setting 'mzschemedll' has no effect
vim-patch:8.0.1261: program in terminal window gets NL instead of CR
vim-patch:8.0.1277: terminal window CR-NL conversions may cause problems
vim-patch:8.0.1286: occasional crash when using a channel
vim-patch:8.0.1296: checking the same condition twice
vim-patch:8.0.1315: build still fails on Mac
vim-patch:8.0.1316: build still still fails on Mac
vim-patch:8.0.1317: accessing freed memory in term_wait()
vim-patch:8.0.1323: mouse events in a terminal window may cause endless loop
vim-patch:8.0.1328: trouble when using ":term ++close" with autocmd
vim-patch:8.0.1340: MS-Windows: cannot build GUI without IME
vim-patch:8.0.1342: cannot build with Motif and multi-byte
vim-patch:8.0.1347: MS-Windows: build broken by misplaced curly
vim-patch:8.0.1359: libvterm ANSI colors can not always be recognized
vim-patch:8.0.1360: the Terminal highlighting doesn't work in a terminal
vim-patch:8.0.1362: terminal window colors wrong when using Terminal highlighting
vim-patch:8.0.1368: cannot drag status or separator of new terminal window
vim-patch:8.0.1376: cursor in terminal not always updated
vim-patch:8.0.1381: ch_readraw() waits for NL if channel mode is NL
vim-patch:8.0.1429: crash when calling term_start() with empty argument
vim-patch:8.0.1430: crash when term_start() fails
vim-patch:8.0.1462: missing yet another file in patch
vim-patch:8.0.1476: screen isn't always updated right away
vim-patch:8.0.1477: redraw flicker when moving the mouse outside of terminal window
vim-patch:8.0.1484: reduntant conditions
vim-patch:8.0.1515: BufWinEnter event fired when opening hidden terminal
vim-patch:8.0.1521: Shift-Tab does not work in a terminal window
vim-patch:8.0.1533: libterm doesn't support requesting fg and bg color
vim-patch:8.0.1537: xxd does not skip NUL lines when using ebcdic
vim-patch:8.0.1542: terminal screen dump does not include cursor position
vim-patch:8.0.1546: using feedkeys() in a terminal may trigger mappings
vim-patch:8.0.1552: may leak file descriptors when executing job
vim-patch:8.0.1576: Perl VIM::Buffers() does not find every buffer
vim-patch:8.0.1594: :conform qall not tested with active terminal window
vim-patch:8.0.1598: cannot select text in a terminal with the mouse
vim-patch:8.0.1605: terminal test is a bit flaky
vim-patch:8.0.1611: CTRL-W in system terminal does not go to job
vim-patch:8.0.1615: term_dumpload() does not use the right colors
vim-patch:8.0.1623: terminal kill tests are flaky
vim-patch:8.0.1628: channel log doesn't mention exiting
vim-patch:8.0.1629: Mac: getpagesize() is deprecated
vim-patch:8.0.1631: testing with Vim running in terminal is a bit flaky
vim-patch:8.0.1632: in a terminal dump NUL and space are different
vim-patch:8.0.1636: no test for term_dumpload() and term_dumpdiff()
vim-patch:8.0.1637: no test for term_dumpdiff() options argument
vim-patch:8.0.1638: popup test fails depending on environment variable
vim-patch:8.0.1640: Test_cwd() is flaky
vim-patch:8.0.1642: running Vim in terminal fails with two windows
vim-patch:8.0.1643: terminal API tests fail
vim-patch:8.0.1644: terminal API tests still fail
vim-patch:8.0.1645: test for terminal response to escape sequence may fail
vim-patch:8.0.1648: resource fork tool doesn't work on Python 3
vim-patch:8.0.1652: term_dumpwrite() does not output composing characters
vim-patch:8.0.1656: no option to have xxd produce upper case variable names
vim-patch:8.0.1657: crash when reading a channel
vim-patch:8.0.1662: showing dump diff doesn't mention both file names
vim-patch:8.0.1664: test failure because of not allocating enough space
vim-patch:8.0.1667: terminal window tests are flaky
vim-patch:8.0.1670: terminal window tests are still a bit flaky
vim-patch 8.0.1671: crash when passing non-dict argument as env to job_start()
vim-patch:8.0.1673: terminal window tests are still a bit flaky
vim-patch:8.0.1680: memory allocated by libvterm is not profiled
vim-patch:8.0.1681: the format attribute fails with MinGW
vim-patch:8.0.1684: ml_get errors when using terminal window for shell command
vim-patch:8.0.1690: not easy to run one test with gvim instead of vim
vim-patch:8.0.1691: xxd test sometimes fails
vim-patch:8.0.1694: terminal API test is a bit flaky
vim-patch:8.0.1695: xxd test not run on MS-Windows
vim-patch:8.0.1703: in the tutor 'showcmd' is not set
vim-patch:8.0.1709: some non-C89 code may slip through
vim-patch:8.0.1714: term_setsize() does not give an error in a normal buffer
vim-patch:8.0.1715: terminal buffer can be 1 more than 'terminalscroll' lines
vim-patch:8.0.1716: test for term_setsize() does not give a good error message
vim-patch:8.0.1718: terminal scrollback test fails on MS-Windows
vim-patch:8.0.1720: when a timer is running a terminal window may not close
vim-patch:8.0.1721: no test for using the 'termsize' option
vim-patch:8.0.1724: declarations cannot be halfway a block
vim-patch:8.0.1728: condition always false, useless code
vim-patch:8.0.1746: MS-Windows: channel tests fail
vim-patch:8.0.1761: job in terminal window with no output channel is killed
vim-patch:8.0.1762: terminal debug logging is a bit complicated
vim-patch:8.0.1775: MS-Windows: warning for unused variable
vim-patch:8.0.1780: test fails because Vim in a terminal uses wrong 'encoding'
vim-patch:8.0.1795: lose contact with jobs when :gui forks
vim-patch:8.0.1796: GUI: click on tab fails when the focus is in a terminal
vim-patch:8.0.1801: MS-Windows: redirecting terminal output does not work
vim-patch:8.0.1802: MS-Windows: terminal test fails
vim-patch:8.0.1814: crash with terminal window and with 'lazyredraw' set
vim-patch:8.0.1818: lines remove from wrong buffer when using terminal window
vim-patch:8.0.1820: terminal window redirecting stdout does not show stderr
vim-patch:8.0.1821: cursor in terminal window moves when pressing CTRL-W
vim-patch:8.0.1823: test for terminal stdout redirection is flaky
vim-patch:8.0.1830: switching to Terminal-Normal mode does not redraw
vim-patch:8.0.1838: cursor in wrong pos when switching to Terminal-Normal mode
vim-patch:8.0.1841: HP-UX does not have setenv()
vim-patch:8.0.1846: Python interface is incompatible with lldb
vim-patch:8.0.1848: 'termwinscroll' does not work properly

vim-patch:8.1.0013: using freed memory when changing terminal cursor color
vim-patch:8.1.0015: cursor color wrong when closing a terminal window
vim-patch:8.1.0016: possible crash in term_wait()
vim-patch:8.1.0026: terminal test fails with very tall terminal
vim-patch:8.1.0029: terminal test fails on MS-Windows when "wc" exists
vim-patch:8.1.0031: terminal test aucmd_on_close if flaky
vim-patch:8.1.0033: keys to stop Vim in terminal are wrong
vim-patch:8.1.0076: command getting cleared with CTRL-W : in a terminal window
vim-patch:8.1.0082: in terminal window, typing : at more prompt, inserts ':'
vim-patch:8.1.0088: terminal test for stdout and stderr is a bit flaky
vim-patch:8.1.0094: help text "usage:" is not capatalized
vim-patch:8.1.0106: build fails when HAVE_DATE_TIME is undefined
vim-patch:8.1.0171: typing CTRL-W n in a terminal window causes ml_get error
vim-patch:8.1.0182: Unicode standard was updated
vim-patch:8.1.0210: still a few K&R function declarations
vim-patch:8.1.0227: spaces instead of tabs in makefile
vim-patch:8.1.0238: 'buftype' is cleared when using ":term ++hidden cat"
vim-patch:8.1.0243: using :term ++close ++hidden closes a window
vim-patch:8.1.0263: channel log doesn't show part of channel
vim-patch:8.1.0283: missing test dump
vim-patch:8.1.0326: screen dump does not consider NUL and space equal
vim-patch:8.1.0329: using inputlist() during startup results in garbage
vim-patch:8.1.0358: crash when using term_dumpwrite() after the job finished
vim-patch:8.1.0520: screen diff test sometimes fails
vim-patch:8.1.0530: channel and terminal tests that start a server can be flaky
vim-patch:8.1.0600: channel test is flaky
vim-patch:8.1.0626: MS-Windows: no resize to fit parent when using --windowid
vim-patch:8.1.0633: crash when out of memory while opening a terminal window
vim-patch:8.1.0712: MS-Windows build instructions are a bit outdated
vim-patch:8.1.0766: various problems when using Vim on VMS
vim-patch:8.1.0785: depending on the configuration some functions are unused
vim-patch:8.1.0821: xxd "usage" output and other arguments not tested
vim-patch:8.1.0854: xxd does not work with more than 32 bit addresses
vim-patch:8.1.0855: cannot build xxd with MSVC 10
vim-patch:8.1.0893: terminal test is a bit flaky
vim-patch:8.1.0966: one terminal test is flaky
vim-patch:8.1.1125: libvterm does not handle the window position report
vim-patch:8.1.1169: writing coverage info in a separate dir is not needed
vim-patch:8.1.1464: only 4-digit rgb termresponse is recognized
vim-patch:8.1.1468: the generated desktop files may be invalid
vim-patch:8.1.1480: desktop file check doesn't run on CI
vim-patch:8.1.1481: length for two-digit rgb termresponse is off by one
vim-patch:8.1.1482: no test for wincol() depending on the 'number' option
vim-patch:8.1.1487: older msgfmt cannot generate proper .desktop file
vim-patch:8.1.1500: wrong shell command when building with VIMDLL and "! in 'go'
vim-patch:8.1.1503: sound test fails on Travis
vim-patch:8.1.1504: sound test still fails on Travis
vim-patch:8.1.1506: syntax error in Travis config
vim-patch:8.1.1507: sound test still fails on Travis
vim-patch:8.1.1512: ch_evalexpr() hangs when used recursively
vim-patch:8.1.1514: MS-Windows: wrong shell command with ! in 'guioptions'
vim-patch:8.1.1529: libcanberra is linked with even when not used
vim-patch:8.1.1531: clipboard type name is inconsistent
vim-patch:8.1.1532: build fails
vim-patch:8.1.1533: GUI build fails on Mac
vim-patch:8.1.1556: command for failing screenshot does not include directory
vim-patch:8.1.1557: compiler warning for unused variables in tiny version
vim-patch:8.1.1566: error message when terminal closes in another tab
vim-patch:8.1.1578: MS-Windows: pathdef.c should depend on build options
vim-patch:8.1.1582: cannot build with +textprop but without +timers

vim-patch:8.0.0947: entering terminal using C-O C-W C-W goes to Insert mode
vim-patch:8.1.1490: when a single test fails the exit code is not set
vim-patch:8.1.1492: MS-Windows: when "!" is in 'guioptions' ":!start" fails
vim-patch:8.0.1162: shared script for tests cannot be included twice
vim-patch:8.1.1530: Travis config is not optimal
2019-06-23 02:31:19 +02:00
bc10a15ea7 tests: fix "api nvim_get_proc_children returns child process ids" (#10296)
There might be an existing job already - maybe due to some other test,
but in this case there was only one failure in the test run.

```
[----------] Running tests from C:/projects/neovim/test/functional\api\proc_spec.lua
  [ RUN      ] api nvim_get_proc_children returns child process ids: ERR
  test\functional\helpers.lua:392:
  retry() attempts: 450
  C:/projects/neovim/test/functional\api\proc_spec.lua:22: Expected objects to be the same.
  Passed in:
  (number) 2
  Expected:
  (number) 1

  stack traceback:
  	test\functional\helpers.lua:392: in function 'retry'
  	C:/projects/neovim/test/functional\api\proc_spec.lua:21: in function <C:/projects/neovim/test/functional\api\proc_spec.lua:17>
```

https://ci.appveyor.com/project/neovim/neovim/builds/25461215/job/8ns204v6091iy9rs?fullLog=true#L2672
2019-06-22 15:29:39 +02:00
f1f9a2f97b tests: improve RunTests.cmake (#10239)
- allow for passing in BUSTED_ARGS via env
- quote values of TEST_TAG/TEST_FILTER

  Previously TEST_FILTER="'foo bar'" was required.

This allows for:

    make functionaltest TEST_FILE=test/functional/terminal/tui_spec.lua \
      BUSTED_ARGS="--no-keep-going --shuffle" \
      TEST_FILTER="TUI background color handles"

* RunTests.cmake: BUILD_DIR for Xtest files, isolated TMPDIR

Assume relative path for given TEST_PATH.
2019-06-22 06:44:52 +02:00
058a8ed6ec build: USE_BUNDLED_LUV=0 with USE_BUNDLED_LUAROCKS=1 #10291
Fixes https://github.com/neovim/neovim/issues/10289
2019-06-22 03:43:31 +02:00
aa090f9801 cmake: fix usage of find_package_handle_standard_args (#10288)
The package argument is case sensitive, which is important to handle
X_FIND_REQUIRED properly, i.e. error out early if it is not found:

    CMake Error at /usr/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
      Could NOT find Unibilium (missing: UNIBILIUM_LIBRARY UNIBILIUM_INCLUDE_DIR)

Otherwise it would continue until:

    CMake Error: The following variables are used in this project, but they
    are set to NOTFOUND.
    Please set them or make sure they are set and tested correctly in the
    CMake files:
    UNIBILIUM_INCLUDE_DIR (ADVANCED)

Quickly checked via `rg 'find_package_handle_standard|find_package.*REQUIRED' -I | sort`.

Ref: https://gitlab.kitware.com/cmake/cmake/issues/19413
2019-06-21 03:48:46 +02:00
e28a7a366d CI/Travis: restore ASAN build to first stage #10274
* ci: Travis: move ASAN build to first stage again
  Ref: https://github.com/neovim/neovim/pull/10238#issuecomment-503556762
* rename stages
* move gcov to second stage, restore order
2019-06-20 01:51:41 +02:00
954df0ea03 Merge #10245 from janlazo/vim-8.0.1723
vim-patch:8.0.{1723,1726,1735},8.1.{73,74}
2019-06-19 23:46:43 +02:00
487eaf8d45 CI: use -m to invoke pip #10275
Also install "pynvim" instead of "neovim".

Ref: https://github.com/neovim/neovim/pull/10228#discussion_r295266859
2019-06-19 20:28:37 +02:00
3f48b3a92f Update argc(),argv() based on 8.1.0493 2019-06-19 01:36:01 -04:00
516eb9bf9d test/old: run test_arglist
Run failing tests, added in vim-patch:8.1.0493.
2019-06-19 01:36:01 -04:00
5c2feb690e vim-patch:8.1.0074: crash when running quickfix tests
Problem:    Crash when running quickfix tests.
Solution:   Do not alloc a new location list when checking for the reference
            to be still valid.
d6b01a2d38
2019-06-19 01:36:00 -04:00
a6707f5791 vim-patch:8.1.0073: crash when autocommands call setloclist()
Problem:    Crash when autocommands call setloclist(). (Dominique Pelle)
Solution:   If the quickfix list changes then don't jump to the error.
0366c0161e
2019-06-19 01:36:00 -04:00
8bea8d7b47 vim-patch:8.0.1726: older MSVC doesn't support declarations halfway a block
Problem:    Older MSVC doesn't support declarations halfway a block.
Solution:   Move the declaration back to the start of the block.
df2c774ded
2019-06-19 01:36:00 -04:00
315076a26d vim-patch:8.0.1723: using one item array size declaration is misleading
Problem:    Using one item array size declaration is misleading.
Solution:   Instead of using "[1]" and actually using a larger array, use
            "[]".  This is to verify that this C99 feature works for all
            compilers.
f3a411783c

The following patch is N/A because Neovim requires C99.
vim-patch:8.0.1735: flexible array member feature not supported by HP-UX
2019-06-19 01:36:00 -04:00
352d5a9713 ci: Travis: move gcov job to baseline (no allowed failures) (#10238)
* ci: Travis: move gcov job to baseline (no allowed failures)

* ci: Travis: use two stages only

Moves CLANG_SANITIZER=ASAN_UBSAN to second stage.
2019-06-19 01:20:09 +02:00
59b2b1c955 tests: oldtests: mark Test_cursorhold_insert as flaky [ci skip] (#10264)
Fails often on CI (OSX), e.g.:

```
1 FAILED:
Found errors in Test_cursorhold_insert():
function RunTheTest[37]..Test_cursorhold_insert line 9: Expected 1 but got 0
```

> Compiler: clang Xcode: xcode10.1 C

The test could be adjusted to re-try the timer a few times, but I do not
think it's really worth it currently, and that the test should be marked
as flaky instead.
2019-06-19 01:19:20 +02:00
c6ce40bf37 ci: Travis: simplify/improve Python/pip setup (#10228)
* ci/before_install.sh: do not (try to) upgrade pip

  It is not necessary usually (for our use case(s)), and rather good to
  have this (implicitly) pinned.

* Simplify/improve Python info output

* Use pyenv-global to activate/use Python 2.7/7.7

* simplify pip-install of neovim, also for osx
2019-06-18 20:13:47 +02:00
149dcbf2c7 Merge pull request #10021 from bfredl/chanevent
channel: refactor events, prevent recursive invocation of callbacks
2019-06-18 13:58:14 +02:00
d4938743e6 channel: refactor events, prevent recursive invocation of events 2019-06-18 10:49:38 +02:00
25e04c1d98 gcov: use __gcov_flush instead of __gcov_dump (#10260)
This restores missing coverage again.

Move it to process_spawn in os/pty_process_unix.c, since it seems to
break printargs-test on Windows/AppVeyor otherwise (#10248).
2019-06-18 06:31:57 +02:00
d0e1417254 vim-patch:8.0.1274: setbufline() fails when using folding
Problem:    setbufline() fails when using folding.
Solution:   Set "curwin" if needed. (Ozaki Kiichi, closes vim/vim#2293)
0c4dc88a63
2019-06-18 00:51:08 +02:00
d43cf02186 vim-patch:8.0.1055: bufline test hangs on MS-Windows
Problem:    Bufline test hangs on MS-Windows.
Solution:   Avoid message for writing file.  Source shared.vim when running
            test individually.
11aa62f8f9
2019-06-18 00:21:52 +02:00
8db93d0d83 vim-patch:8.0.1053: setline() does not work on startup
Problem:    setline() does not work on startup. (Manuel Ortega)
Solution:   Do not check for ml_mfp to be set for the current buffer.
            (Christian Brabandt)
9d954207e2
2019-06-18 00:18:52 +02:00
9485061baa vim-patch:8.0.1039: cannot change a line in not current buffer
Problem:    Cannot change a line in a buffer other than the current one.
Solution:   Add setbufline(). (Yasuhiro Matsumoto, Ozaki Kiichi, closes vim/vim#1953)
b31cf2bb0b
2019-06-17 23:43:26 +02:00
4946751906 Merge #10224 from blueyed/fix-Test_tagfiles
tests: fix Test_tagfiles: use Vim's 'tags' setting
2019-06-17 12:08:56 -07:00
5edced0a86 Merge pull request #10186 from blueyed/fix-cd
ci: minor improvements
2019-06-17 20:55:02 +02:00
bd3242a70f ci: Travis: skip lint job with "\[skip.lint\]" 2019-06-17 02:00:58 +02:00
185fc775b9 ci: Travis: ccache: use --zero-stats
This makes it display actual results in before_cache then, and it seems
like it is not necessary to keep stats across builds.
2019-06-17 02:00:58 +02:00
755e94801f ci: AppVeyor: use fast_finish=true 2019-06-17 02:00:58 +02:00
3dab5f625f ci/build.ps1: add comment for PATH mangling with old tests 2019-06-17 02:00:58 +02:00
b98b1168d8 ci: Travis: remove obsolete cmake file
Added in f65614fb1, forgot to be removed in 55682710a.
2019-06-17 02:00:58 +02:00
04d03b0cbc ci/common/test.sh: fix some issues reported by shellcheck 2019-06-17 02:00:58 +02:00
c6602df015 vim-patch:8.1.1546: in some tests 'tags' is set but not restored
Problem:    In some tests 'tags' is set but not restored. (Daniel Hahler)
Solution:   Restore 'tags'. (closes vim/vim#4535)
0331faf712
2019-06-16 19:51:12 +02:00
3d8e8cb889 tests: fix Test_tagfiles: use Vim's 'tags' setting
Otherwise it might fail with an existing `tags` file upwards, e.g. in
neovim's source directory (which should be rather common).
2019-06-16 19:51:12 +02:00
d32b92e265 vim-patch:8.0.1845: various comment updates needed, missing white space (#10203)
Problem:    Various comment updates needed, missing white space.
Solution:   Update comments, add white space.
259f26ac2d

Ignored (partly) applied patch for src/nvim/po/it.po.
2019-06-16 19:49:23 +02:00
491a3210a9 vim-patch:8.1.1003: playing back recorded key sequence mistakes key code (#10155)
Problem:    Playing back recorded key sequence mistakes key code.
Solution:   Insert a <Nop> after the <Esc>. (closes vim/vim#4068)
6edbbd8114
2019-06-16 19:48:46 +02:00
d792d4ec06 Merge pull request #10236 from janlazo/vim-8.1.1545
vim-patch:8.0.{1516,1549},8.1.{0044,1545}
2019-06-16 17:52:38 +02:00
3d6e48a941 Merge pull request #10150 from bfredl/extcount
make msg_advance and search_count not crash with ext_messages, fixes #10069
2019-06-16 12:34:27 +02:00
e39d217592 messages: fix crash with msg_advance when using ext_messages 2019-06-16 11:31:35 +02:00
41f31ca90d messages: support shortmess-=S in ext_messages 2019-06-16 11:07:29 +02:00
cb01925eb4 vim-patch:8.0.1549: various small problems in test files
Problem:    Various small problems in test files.
Solution:   Include small changes.
5d7ead3bc8
2019-06-15 22:24:59 -04:00
b837c56576 vim-patch:8.0.1516: errors for job options are not very specific
Problem:    Errors for job options are not very specific.
Solution:   Add more specific error messages.
b3292fa2d3
2019-06-15 22:14:29 -04:00
c6c5754a86 vim-patch:8.1.0044: if a test function exists Vim this may go unnoticed
Problem:    If a test function exists Vim this may go unnoticed.
Solution:   Check for a test funtion quitting Vim.  Fix tests that did exit
            Vim.
8903676d3d

Restore test_assert.vim to run Test_zz_quit_detected().
2019-06-15 21:48:27 -04:00
1abfeff978 vim-patch:8.1.1545: when the screen is to small there is no message about that
Problem:    When the screen is to small there is no message about that.
            (Daniel Hahler)
Solution:   Do not use :cquit. (closes vim/vim#4534)
45aa07d3c1
2019-06-15 21:48:27 -04:00
5a96161e86 ci: AppVeyor: ensure that win32 feature is set (#10216)
[skip travis]

Closes https://github.com/neovim/neovim/pull/10232.

Co-authored-by: Jan Edmund Lazo <jan.lazo@mail.utoronto.ca>
2019-06-16 02:33:47 +02:00
b60c986a49 vim-patch:8.0.1245: when WaitFor() has a wrong expression it just waits a second (#10233)
Problem:    When WaitFor() has a wrong expression it just waits a second,
            which goes unnoticed. (James McCoy)
Solution:   When WaitFor() times out throw an exception.  Fix places where the
            expression was wrong.
3e1c617d49
2019-06-15 18:56:55 +02:00
5d5e16c2ed ci: Travis: add baseline stage [skip appveyor] (#10226)
This moves the 4 fastest jobs there, effectively resulting in a separate
OSX stage then.

Travis typically runs 4/5 jobs in parallel, so this avoids a) running the
slower OSX builds if there are problems already, and b) will start other
builds already earlier (e.g. after the lint job finished).
2019-06-15 18:46:51 +02:00
26a9d2cef1 ci: codecov: do not use flags [ci skip] (#10227)
Using flags results in timeouts on their end when viewing reports, and
is a known issue since months already.
2019-06-15 18:34:00 +02:00
d3d25f957d Dump gcov coverage in process_spawn (#10230)
Fixes https://github.com/neovim/neovim/pull/3926#issuecomment-502343527.
2019-06-15 18:30:04 +02:00
2f1a653a84 Merge pull request #10231 from bfredl/bufcb_end
api/lua: add on_detach to nvim_buf_attach
2019-06-15 15:59:45 +02:00
64cdf9f78a api/lua: add on_detach to nvim_buf_attach 2019-06-15 13:19:12 +02:00
93f8c2793c ci: AppVeyor: fix cov job, remove duplicate non-cov one (#10217)
* ci: AppVeyor: set GCOV_ERROR_FILE

This prevents the warnings/errors to be spilled into test results,
causing them to fail them, e.g.:

    [  FAILED  ] C:/projects/neovim/test/functional\core\main_spec.lua @ 97: Command-line option -s errors out when trying to use nonexistent file with -s
    C:/projects/neovim/test/functional\core\main_spec.lua:98: Expected objects to be the same.
    Passed in:
    (string) 'Cannot open for reading: "Xtest-functional-core-main-s.nonexistent": no such file or directory
    profiling:C:\projects\neovim\build/src/nvim/CMakeFiles/nvim.dir/buffer.c.gcda:Data file mismatch - some data files may have been concurrently updated without locking support
    '
    Expected:
    (string) 'Cannot open for reading: "Xtest-functional-core-main-s.nonexistent": no such file or directory
    '

    stack traceback:
            C:/projects/neovim/test/functional\core\main_spec.lua:98: in function <C:/projects/neovim/test/functional\core\main_spec.lua:97>

For reference, the locking appears to have been reworked for gcc 9.1 [1].

1: https://github.com/gcc-mirror/gcc/commit/56621355b

helpers.clear: keep GCOV_ERROR_FILE in environment

* ci: AppVeyor: remove MINGW_64 config (used with cov now)

Also:

- run MINGW_64-gcov first, and with PRs, since it provides coverage.
2019-06-14 13:39:57 +02:00
fdbb5a8f72 Merge #10208 from janlazo/vim-8.0.0931
vim-patch:8.0.{931,933,953}
2019-06-14 04:38:41 -07:00
18b031ea1d vim-patch:8.0.0953: get "no write since last change" error in terminal window
Problem:    Get "no write since last change" error in terminal window.
Solution:   Use another message when closing a terminal window. Make ":quit!"
            also end the job.
f5be7cd016
2019-06-13 22:40:12 -04:00
6efa3bff09 test/old: pass Test_statusline on Windows 2019-06-13 19:39:55 -04:00
47a5456670 vim-patch:8.0.0933: terminal test tries to start GUI when it's not possible
Problem:    Terminal test tries to start GUI when it's not possible.
Solution:   Check if the GUI can run. (James McCoy, closes vim/vim#1971)
9f0139a2a8
2019-06-13 19:39:55 -04:00
e6a1bea1eb vim-patch:8.0.0931: getwininfo() does not indicate a terminal window
Problem:    getwininfo() does not indicate a terminal window.
Solution:   Add "terminal" to the dictionary.
69905d108b
2019-06-13 19:39:55 -04:00
a0496e3b76 Merge pull request #10221 from bfredl/showcmd_cursor
screen: showcmd should never move the cursor
2019-06-13 22:30:50 +02:00
dd21cd2a4d tests: increase timeout with "timers doesn't mess up the cmdline" (#10212)
This might be required on (slower) CI.

    [ RUN      ] timers doesn't mess up the cmdline: ERR
    test/functional/ui/screen.lua:562: expected intermediate screen state before final screen state
    stack traceback:
            test/functional/ui/screen.lua:562: in function '_wait'
            test/functional/ui/screen.lua:366: in function 'expect'
            .../build/neovim/neovim/test/functional/eval/timer_spec.lua:221: in function <.../build/neovim/neovim/test/functional/eval/timer_spec.lua:199>

Ref: https://travis-ci.org/neovim/neovim/jobs/544974506#L3861
2019-06-13 22:11:33 +02:00
21cf4b0ce6 screen: showcmd should never move the cursor
Also restore the symmetry between grid_puts_line_start and
grid_puts_line_flush.
2019-06-13 20:22:37 +02:00
cc4d463cad Merge pull request #10202 from blueyed/vim-8.0.1704
vim-patch:8.0.1704: 'backupskip' default doesn't work for Mac

Also aligns tests from two previous patched to the ones in upstream.
2019-06-13 14:20:51 +02:00
424ddd01f5 tui: support rgba background detection (#10205)
Fixes https://github.com/neovim/neovim/issues/10159.
2019-06-13 14:14:41 +02:00
66613ace48 vim-patch:8.0.1704: 'backupskip' default doesn't work for Mac
Problem:    'backupskip' default doesn't work for Mac.
Solution:   Use "/private/tmp". (Rainer Müller, closes vim/vim#2793)
b8e22a053b
2019-06-13 00:28:16 +02:00
5db3be092a tests: align tests in test_options to Vim (moved) 2019-06-12 23:08:27 +02:00
6f27f5ef91 main: do event_init before early_init #10183
Fixes https://github.com/neovim/neovim/issues/10172

* move log_init to event_init
* move init_signs to end of early_init
2019-06-12 14:22:42 +02:00
babcf641ef Merge #10192 from janlazo/vim-8.0.1689
vim-patch:8.0.1689,8.1.0213
2019-06-12 08:21:31 +02:00
22d58ab664 vim-patch:8.1.0213: CTRL-W CR does not work properly in a quickfix window
Problem:    CTRL-W CR does not work properly in a quickfix window.
Solution:   Split the window if needed. (Jason Franklin)
0a08c63da1
2019-06-12 00:22:16 -04:00
005316ae41 vim-patch:8.0.1689: no tests for xxd
Problem:    No tests for xxd.
Solution:   Add a test. (Christian Brabandt)
29f9ed20b4
2019-06-11 22:31:21 -04:00
f8d0e41b28 Merge #10163 from blueyed/vim-8.1.1292
vim-patch:8.1.1292: invalid command line arguments not tested
2019-06-11 14:01:09 +02:00
432f69fc09 vim-patch:8.1.1211: test user command code #10162
Problem:    Not all user command code is tested.
Solution:   Add more tests.
e61e548dd6
2019-06-11 13:56:15 +02:00
304861e0ee adjust tests for nvim 2019-06-11 12:52:17 +02:00
76506ca0a3 vim-patch:8.1.1292: invalid command line arguments not tested
Problem:    Invalid command line arguments not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#4346)
ba9ea91beb
2019-06-10 18:10:15 +02:00
6fe430f582 local.mk.example: add example for -Werror [ci skip] #10178 2019-06-10 17:20:41 +02:00
ce90a19abd TUI: set os/input.c:global_fd to input->in_fd #10174
Problem: When we changed startup to wait for the TUI (like a remote UI),
         we forgot to set os/input.c:global_fd.  That used to be done by
         input_start().

Solution: Initialize os/input.c:global_fd before initializing libtermkey
          (termkey_new_abstract) so that tui_get_stty_erase() and
          friends can inspect the correct fd.

fixes #10134
close #10174
2019-06-10 16:43:52 +02:00
04e2ba85b1 doc [ci skip] #10129
- document lua vim.loop #10123
2019-06-10 15:53:42 +02:00
c83926cd0a lua: introduce vim.loop (expose libuv event-loop) #10123
Co-authored-by: Andrey Popp <8mayday@gmail.com>

closes #9546
closes #10084
2019-06-10 14:13:18 +02:00
3e58e60568 vim-patch:8.0.1278: Add the "k" flag in 'guioptions' #10175
Problem:    GUI window always resizes when adding/removing a scrollbar,
            toolbar, etc.
Solution:   Add the 'k' flag in 'guioptions' to keep the GUI window size and
            change the number of lines/columns instead. (Ychin, closes vim/vim#703)
8ac441576f
2019-06-10 12:18:59 +02:00
7612dd3f8a Merge #10173 from janlazo/vim-8.0.1756
vim-patch:8.0.1756,8.1.1509
2019-06-09 22:52:03 +02:00
84ba37fbcb lint 2019-06-09 16:25:10 -04:00
aecbbb0b11 vim-patch:8.1.1509: cmdline_row can become negative, causing a crash
Problem:    Cmdline_row can become negative, causing a crash.
Solution:   Make sure cmdline_row does not become negagive. (closes vim/vim#4102)
954bb06363
2019-06-09 16:12:51 -04:00
1ce28d7d9b vim-patch:8.0.1756: GUI: after prompting for a number the mouse shape is wrong
Problem:    GUI: after prompting for a number the mouse shape is sometimes
            wrong.
Solution:   Call setmouse() after setting "State". (Hirohito Higashi,
            closes vim/vim#2709)
73658317ba
2019-06-09 16:02:35 -04:00
6c96c3b3f5 search_stat: show "??/?" dual in right-to-left case #10170
Co-Authored-By: James McCoy <jamessan@jamessan.com>
2019-06-09 19:59:44 +02:00
b397a3f397 Merge #10142 from blueyed/vim-1fbfe7c48
vim-patch:8.1.013{0,1}
2019-06-09 16:20:09 +02:00
b74da2ff3e vim-patch.sh: git-for-each-ref: use strip [ci skip] #10169
- It is a synonym for lstrip, which works with older Git versions also
  (2.7.4, Ubuntu Xenial).
- exit in case of errors from git-foreach-ref
- msg_err: echo to stderr

Ref: https://github.com/neovim/neovim/pull/10165#issuecomment-500164356
2019-06-09 16:13:06 +02:00
a2bb63c182 vim-patch.sh: improve performance with -l [ci skip] #10165
Down to < 1s now also (without get_vim_sources).
2019-06-09 16:01:18 +02:00
2fbeea8326 Change to not test msg_puts_pirntf() in unix CI 2019-06-09 19:02:52 +09:00
6cbcca775e Change to use VV_PROGPATH instead os_exepath() 2019-06-09 19:01:08 +09:00
da8f7141ce Add msg_puts_printf() test for multibyte characters 2019-06-09 13:29:51 +09:00
1fbc01f4ab Fix problems with message catalog directory
- In appimage, the message catalog is not used because there is no
  message catalog in LOCALE_INSTALL_DIR. Therefore, change to
  exepath/../share/locale instead of LOCALE_INSTALL_DIR.
- The old vim style($runtime/lang) is no longer used. Thus all relevant
  code is removed.
2019-06-09 13:28:10 +09:00
2d6e440877 Remove display_erros()
do_shell() in Nvim uses the Nvim UI, not the tty directly, so
display_errors() is not necessary anymore.
2019-06-09 13:28:10 +09:00
f66ffc64f6 Remove USE_MCH_ERRMSG
USE_MCH_ERRMSG has never been defined, so the dead code has been removed.
2019-06-09 13:28:10 +09:00
6fad1736fb Change mch_errmsg and mch_msg from macro to function 2019-06-09 13:28:10 +09:00
53551d823e Add test for #7967 2019-06-09 13:28:10 +09:00
9609f327da Fix garbled problem with msg_puts_printf on Windows 2019-06-09 13:27:54 +09:00
0b4c53fc23 vim-patch:8.0.1305: writefile() never calls fsync() #10153
Problem:    Writefile() never calls fsync().
Solution:   Follow the 'fsync' option with override to enable or disable.
7567d0b115
2019-06-09 00:12:28 +02:00
93afb34712 vim-patch:8.1.1191: test debug commands #10158
Problem:    Not all debug commands are covered by a test.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#4282)
0fdd943595
2019-06-09 00:10:33 +02:00
bf3e12ac85 vim-patch:8.1.0769: :stop is covered in two tests #10157
Problem:    :stop is covered in two tests.
Solution:   Remove Test_stop_in_terminal().  Make other test exit Vim cleanly.
            (Ozaki Kiichi, closes vim/vim#3814)
3020ccb113
2019-06-09 00:09:35 +02:00
644a725725 Merge #10135 from janlazo/vim-8.1.0406
vim-patch:8.1.{406,409,417,426}

close #10148
2019-06-09 00:08:44 +02:00
3dd31b2b65 vim-patch:8.1.1491: fix skipping after exception #10164
Problem:    When skipping over code after an exception was thrown expression
            evaluation is aborted after a function call. (Ingo Karkat)
Solution:   Do not fail if not executing the expression. (closes vim/vim#4507)
6064073841
2019-06-08 19:57:54 +02:00
7d70166e77 vim-patch:8.1.0131: :profdel is not tested
Problem:    :profdel is not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3123)
1fbfe7c48c
2019-06-08 16:40:32 +02:00
7823b35781 vim-patch:8.1.0130: ":profdel func" does not work if func was called already
Problem:    ":profdel func" does not work if func was called already.
            (Dominique Pelle)
Solution:   Reset uf_profiling and add a flag to indicate initialization was
            done.
ad64809610
2019-06-08 16:40:32 +02:00
0206f279ba vim-patch:8.1.0426: accessing invalid memory in SmcOpenConnection()
Problem:    Accessing invalid memory in SmcOpenConnection().
Solution:   Reduce size of errorstring by one. (Dominique Pelle, closes vim/vim#3469)
4841a7ccae
2019-06-08 10:25:12 -04:00
b868f87310 test/old: ignore defaults.vim assertion 2019-06-08 10:25:12 -04:00
a64e0e6a58 vim-patch:8.1.0417: several command line arguments are not tested
Problem:    Several command line arguments are not tested.
Solution:   Add tests for -m, -M, -R and -Vfile. (Dominique Pelle,
            closes vim/vim#3458)
036b09ca78
2019-06-08 10:25:12 -04:00
a597ea7bcc vim-patch:8.1.0409: startup test fails on MS-Windows
Problem:    Startup test fails on MS-Windows.
Solution:   Do the Arabic test in silent Ex mode.  Loosen the check for -V2.
4b1c9a91b5
2019-06-08 10:25:12 -04:00
de16b6dc7a vim-patch:8.1.0406: several command line arguments are not tested
Problem:    Several command line arguments are not tested.
Solution:   Add tests for -A, -F, -H, -p and -V. (Dominique Pelle,
            closes vim/vim#3446)
9e81db9742
2019-06-08 10:25:12 -04:00
b398b1eedd vim-patch.sh: use --no-backup-if-mismatch [ci skip] #10156 2019-06-08 15:06:16 +02:00
a11fb248ef vim-patch:8.1.0830: test leaves directory behind #10152
Problem:    Test leaves directory behind on MS-Windows.
Solution:   Close buffer before deleting directory.
e3d0654544
2019-06-08 14:57:20 +02:00
d646fe73ac vim-patch:8.1.1199: no test for :abclear #9936
Problem:    No test for :abclear.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#4292)
8485be4e49
2019-06-08 14:53:32 +02:00
d486ea37b2 Merge #10151 from blueyed/vim-8.1.0807
vim-patch:8.1.{0807,0813}
2019-06-08 14:46:16 +02:00
766657320a vim-patch.sh: improve patching [ci skip] #10154
(fuzz, unified, exit)

Fixes https://github.com/neovim/neovim/issues/10143
2019-06-08 14:42:17 +02:00
230e75b63f Merge #10149 from blueyed/vim-8.1.0430
vim-patch:8.1.{0430,0529}
2019-06-08 14:19:35 +02:00
bf16b14f46 vim-patch.sh: improve performance #10137
`vim-patch.sh -L`: down to ~0.5s from ~85s.
`vim-patch.sh -l`: down to ~6s from ~90s.

    % diff old new:
    193c193
    <   • v8.0.1366
    ---
    >   • v8.0.1367
    354d353
    <   • v8.0.1738

This is due to duplicate tags for Vim commits
(https://github.com/vim/vim/issues/4510):

  - vim/vim@1ad022a9b: tagged as v8.0.1367, v8.0.1366
  - vim/vim@5d69da462: tagged as v8.0.1739, v8.0.1738
2019-06-08 14:18:35 +02:00
25ec0c8805 vim-patch.sh: fix shellcheck issues [ci skip] #10138 2019-06-08 14:02:30 +02:00
192460e6b6 vim-patch:8.1.0813: FileChangedShell not sufficiently tested
Problem:    FileChangedShell not sufficiently tested.
Solution:   Add a more comprehensive test case.
0566e891f7
2019-06-08 13:59:19 +02:00
40dee0c82e vim-patch:8.1.0807: session test fails on MS-Windows
Problem:    Session test fails on MS-Windows.
Solution:   Don't try creating file with illegal name.
9e79ccbe9c
2019-06-08 13:55:13 +02:00
7810c7ab76 vim-patch:8.1.0529: flaky test sometimes fails in different ways
Problem:    Flaky test sometimes fails in different ways.
Solution:   When the second run gives a different error, try running the test
            again, up to five times.
f77af0e613
2019-06-08 13:49:56 +02:00
ce1b4f95fe vim-patch:8.1.0430: Xargadd file left behind after running test
Problem:    Xargadd file left behind after running test.
Solution:   Delete the file. (Dominique Pelle)
d339828b4b
2019-06-08 13:46:16 +02:00
faec6fcc6a Merge #10141 from blueyed/vim-8.0.1335
vim-patch:8.0.{1335,1339,1744}
2019-06-08 13:09:35 +02:00
78df9eb51d vim-patch:1ebff3dc9 #10144
patch 8.1.0158: GUI: input() fails if CTRL-C was pressed before

Problem:    GUI: input() fails if CTRL-C was pressed before. (Michael Naumann)
Solution:   call vpeekc() to drop the CTRL-C from the input stream.
1ebff3dc93
2019-06-08 13:02:26 +02:00
7d542b5900 Test_writefile_sync_dev_stdout: use s for sync explicitly 2019-06-08 10:56:06 +02:00
b6eeb40d19 vim-patch:9980b37a80
patch 8.0.1744: on some systems /dev/stdout isn't writable

Problem:    On some systems /dev/stdout isn't writable.
Solution:   Skip test if writing is not possible. (James McCoy, closes vim/vim#2830)
9980b37a80
2019-06-08 10:56:06 +02:00
5972ff0056 vim-patch:83799a7b7
patch 8.0.1339: no test for what 8.0.1335 fixes

Problem:    No test for what 8.0.1335 fixes.
Solution:   Add a test. (Yasuhiro Matsumoto, closes vim/vim#2373)
83799a7b74
2019-06-08 10:53:48 +02:00
17528fff0c vim-patch:291a9d15e
patch 8.0.1335: writefile() using fsync() may give an error.

Problem:    Writefile() using fsync() may give an error for a device.
            (Yasuhiro Matsumoto)
Solution:   Ignore fsync() failing. (closes vim/vim#2373)
291a9d15ed

N/A: Neovim ignores EINVAL already in `file_fsync`
(https://github.com/neovim/neovim/blob/93dc59b1149/src/nvim/os/fileio.c#L232)
2019-06-08 10:52:45 +02:00
bb24fec333 defaults: exclude "S" from 'shortmess' #10136
ref #6289
2019-06-07 23:11:28 +02:00
f6f9e4a231 Merge #10114 from erw7/vim-8.1.1270
vim-patch:8.1.{0629,1270,1271,1283,1288,1289,1350,1375,1390,1475}
2019-06-07 21:28:53 +02:00
d583b7c2fa Merge #10128 from janlazo/vim-8.0.1384
vim-patch:8.0.{1384,1412,1414,1669,1702,1784},8.1.0060
2019-06-07 13:15:48 +02:00
e653f39f4f vim-patch:8.0.1702: leaking memory when autocommands make quickfix list invalid
Problem:    Leaking memory when autocommands make a quickfix list invalid.
Solution:   Call FreeWild(). (Yegappan Lakshmanan)
ee5b94a8ec
2019-06-06 22:43:48 -04:00
bb4e0deaf9 vim-patch:8.1.0060: crash when autocommands delete the current buffer
Problem:    Crash when autocommands delete the current buffer. (Dominique
            Pelle)
Solution:   Check that autocommands don't change the buffer.
600323b4ef
2019-06-06 22:43:48 -04:00
7d345a7294 vim-patch:8.0.1784: gvim test gets stuck in dialog
Problem:    Gvim test gets stuck in dialog.
Solution:   Rename the file used.
bc7845da93
2019-06-06 22:43:47 -04:00
fb2b0fa5ba vim-patch:8.0.1669: :vimgrep may add entries to the wrong quickfix list
Problem:    :vimgrep may add entries to the wrong quickfix list.
Solution:   Use the list identifier. (Yegappan Lakshmanan)
e1bb879f49
2019-06-06 22:43:47 -04:00
0234d579a7 vim-patch:8.0.1414: accessing freed memory in :lfile.
Problem:    Accessing freed memory in :lfile.
Solution:   Get the current window after executing autocommands. (Yegappan
            Lakshmanan, closes vim/vim#2473)
14a4deb064
2019-06-06 22:43:47 -04:00
427140048b vim-patch:8.0.1412: using free memory using setloclist()
Problem:    Using free memory using setloclist(). (Dominique Pelle)
Solution:   Mark location list context as still in use when needed. (Yegappan
            Lakshmanan, closes vim/vim#2462)
1223744849
2019-06-06 22:43:47 -04:00
773c488140 vim-patch:8.0.1384: not enough quickfix help; confusing winid
Problem:    Not enough quickfix help; confusing winid.
Solution:   Add more examples in the help. When the quickfix window is not
            present, return zero for getqflist() with 'winid'. Add more tests
            for jumping to quickfix list entries. (Yegappan Lakshmanan, closes
            vim/vim#2427)
74240d3feb
2019-06-06 22:43:47 -04:00
2a4e8a427e vim-patch:8.1.1475: search string not displayed when 'rightleft' is set
Problem:    Search string not displayed when 'rightleft' is set.
Solution:   Clear the right part of the old text. (closes vim/vim#4488, closes vim/vim#4489)
db294adc65
2019-06-07 09:32:49 +09:00
5263828614 vim-patch:8.1.1375: without "TS" in 'shortmess' get a hit-enter prompt often
Problem:    Without "TS" in 'shortmess' get a hit-enter prompt often.
Solution:   Always truncate the search message.  Also avoid putting it in the
            message history. (closes vim/vim#4413)
984f031fb0
2019-06-07 09:01:38 +09:00
8e8c7d7544 vim-patch:8.1.1470: new doublewidth Unicode character U32FF #10126
Problem:    New Unicode character U32FF missing from double-width table.
Solution:   Add the character.
6d718c4c38
2019-06-06 11:35:23 +02:00
3305769eae Merge pull request #10120 from bfredl/lua_schedule
Add lua function vim.schedule(cb) to defer callbacks to main loop
2019-06-05 11:49:39 +02:00
b684bd05b5 lua: docs and tests for vim.schedule 2019-06-05 10:46:22 +02:00
81e1dbca99 lua: add vim.schedule(cb)
This executes Lua callback on main loop's event queue so that nvim API
is safe to call.
2019-06-05 10:42:23 +02:00
ec671c7048 vim-patch:8.1.1390: search stats are off when using count or offset
Problem:    Search stats are off when using count or offset.
Solution:   Recompute the stats when needed. (Masato Nishihata, closes vim/vim#4410)
8f46e4c4bd
2019-06-05 10:08:45 +09:00
2d567ac47e vim-patch:8.1.1350: "W" for wrapping not shown when more than 99 matches
Problem:    "W" for wrapping not shown when more than 99 matches.
Solution:   Adjust check for length. (Masato Nishihata, closes vim/vim#4388)
dc6855af97
2019-06-05 09:57:38 +09:00
68202520c6 vim-patch:8.1.1289: may not have enough space to add "W" to search stats
Problem:    May not have enough space to add "W" to search stats.
Solution:   Reserve a bit more space. (Christian Brabandt)
b6cb26ffe1
2019-06-05 09:57:37 +09:00
287fc076e1 vim-patch:8.1.1288: search stats don't show for mapped command
Problem:    Search stats don't show for mapped command.
Solution:   Remove SEARCH_PEEK from searchit flags.  Add a test. (Christian
            Brabandt)
9ce3fa828d
2019-06-05 09:57:37 +09:00
e8ca281d3b vim-patch:8.1.1283: delaying half a second after the top-bot message
Problem:    Delaying half a second after the top-bot message.
Solution:   Instead of the delay add "W" to the search count.
c7a10b35de
2019-06-05 09:57:25 +09:00
6cee73195f vim-patch:8.1.1271: compiler warnings for use of STRNCPY()
Problem:    Compiler warnings for use of STRNCPY(). (John Marriott)
Solution:   Use mch_memmove() instead of STRNCPY().
b3de6c4a76
2019-06-05 09:55:09 +09:00
777c2a25ce vim-patch:8.1.1270: cannot see current match position
Problem:    Cannot see current match position.
Solution:   Show "3/44" when using the "n" command and "S" is not in
            'shortmess'. (Christian Brabandt, closes vim/vim#4317)
9dfa313919
2019-06-05 09:54:52 +09:00
16ee24082f Merge pull request #10117 from bfredl/ctrl-o_event
normal: Don't exit CTRL-O mode after processing K_EVENT
2019-06-04 15:23:40 +02:00
3adb8a10b1 Merge pull request #9170 from bfredl/lua_cb
lua callbacks for nvim_buf_attach
2019-06-04 14:54:44 +02:00
e50aa2a6c6 normal: Don't exit CTRL-O mode after processing K_EVENT 2019-06-04 13:59:43 +02:00
f5c56f03bb api: allow nvim_buf_attach from lua using callbacks 2019-06-04 13:45:20 +02:00
db415bde5f version.c: update [ci skip] #10072
vim-patch:8.0.0803
vim-patch:8.0.0816: crash when using invalid buffer number
vim-patch:8.0.0817: cannot get the terminal line at the cursor
vim-patch:8.0.0818: cannot get the cursor position of a terminal
vim-patch:8.0.0821: cannot get the title and status of a terminal window
vim-patch:8.0.0863: a remote command does not work in the terminal window
vim-patch:8.0.0864: cannot specify the name of a terminal
vim-patch:8.0.0867: job and channel in a dict value not quoted
vim-patch:8.0.0869: job output is sometimes not displayed in a terminal
vim-patch:8.0.0870: mouse escape codes sent to terminal unintentionally
vim-patch:8.0.0874: can't build with terminal feature
vim-patch:8.0.0877: using CTRL-\ CTRL-N in terminal is inconsistent
vim-patch:8.0.0882: term_scrape() and term_getline() require two arguments
vim-patch:8.0.0884: can't specify the wait time for term_wait()
vim-patch:8.0.0885: terminal window scrollback is stored inefficiently
vim-patch:8.0.0887: can create a logfile in the sandbox
vim-patch:8.0.0892: when opening a terminal the pty size doesn't always match
vim-patch:8.0.0893: cannot get the scroll count of a terminal window
vim-patch:8.0.0896: cannot close a terminal window when the job ends
vim-patch:8.0.0898: can't use the alternate screen in a terminal window
vim-patch:8.0.0899: function name mch_stop_job() is confusing
vim-patch 8.0.0909: channel test fails
vim-patch:8.0.0913: MS-Windows: CTRL-C kills shell in terminal window

vim-patch:8.1.0216: part of file not indented properly
vim-patch:8.1.0784: messy indent in if statement
vim-patch:8.1.1409: Coverity warns for using uninitialized memory
vim-patch:8.1.1415: build error in MS-Windows GUI
vim-patch:8.1.1454: build failure without the conceal feature
vim-patch:8.1.1457: cannot reuse a buffer when loading a screen dump
2019-06-04 09:25:23 +02:00
2ae5427b3c Merge #10113 from janlazo/vim-8.0.1518
vim-patch:8.0.1518,8.1.{2,804}
2019-06-04 09:20:59 +02:00
58f505dc74 Merge #9829 'startup: remove TUI init special-case'
fixes #7967
fixes #9959

Historically Vim/Nvim does backflips to handle input and show messages
before a UI is available. This logical contradiction was already fixed
for remote UIs (#9024 c236e80cf3). Fixing it also for the TUI avoids
problems on Windows, simplifies the logic, and avoids races like #9959.

- Move ui_builtin_start() to the same position as embedded_mode
  remote_ui_wait_for_attach().
- If stdin is redirected, save the original `stdin` and replace fd
  0 with tty before calling `ui_builtin_start()`.
2019-06-04 09:14:45 +02:00
5f41ca4013 vim-patch:8.1.0002: :stopinsert changes the message position
Problem:    :stopinsert changes the message position.
Solution:   Save and restore msg_col and msg_row in clearmode(). (Jason
            Franklin)
2abad54ced
2019-06-03 23:18:16 -04:00
233a173226 vim-patch:8.1.0804: crash when setting v:errmsg to empty list
Problem:    Crash when setting v:errmsg to empty list. (Jaon Franklin)
Solution:   Separate getting value and assigning result.
4b9e91f0ba
2019-06-03 23:12:23 -04:00
485972dd64 vim-patch:8.1.0629: "gn" selects the wrong text with a multi-line match
Problem:    "gn" selects the wrong text with a multi-line match.
Solution:   Get the end position from searchit() directly. (closes vim/vim#3695)
5d24a2257e
2019-06-04 09:53:55 +09:00
7ad621b6d9 vim-patch:8.0.1518: error messages suppressed after ":silent! try"
Problem:    Error messages suppressed after ":silent! try". (Ben Reilly)
Solution:   Restore emsg_silent before executing :try. (closes vim/vim#2531)
2be5733152
2019-06-03 20:11:29 -04:00
4719fdb3a4 main.c: Change to use redraw_later(VALID) 2019-06-04 08:49:27 +09:00
89c2747eed Fix issue where test fails 2019-06-04 08:49:27 +09:00
e4c85c362d [skip appveyor] Fix clint issue 2019-06-04 08:49:26 +09:00
402b4e8fbe main.c: Change TUI to initialize like GUI 2019-06-04 08:47:52 +09:00
5fced444bb tui/input.c: Fix problem when stdin is not TTY 2019-06-04 08:47:51 +09:00
fcf6bfd360 main.c: fixes #7967 2019-06-04 08:41:11 +09:00
16b1e8f9c0 Merge #9338 from janlazo/vim-8.1.0569
vim-patch:8.1.{569,571}
2019-06-04 00:14:49 +02:00
49733df939 Merge #9338 'vim-patch:8.1.{569,571}' 2019-06-03 22:56:43 +02:00
dc4fa0b24d Merge #10109 from erw7/fix-screenchar-on-headless-mode
ref #9338
2019-06-03 22:45:00 +02:00
c06504687d msg_puts_attr_len: check default_grid.chars if headless
Nvim might call `msg_puts_attr_len` before the screen buffers are allocated.
2019-06-03 22:41:48 +02:00
27b684b83f Fix screenchar() problem in headless mode
In the case of the headless mode, screenchar() does not operate normally
because it is not output to the internal screen. Change output to stderr
and internal screen to fix it.
2019-06-03 22:41:48 +02:00
4841c46e33 Merge pull request #10112 from bfredl/noautobuf
api/buffer: avoid spurios Buf[Win]Enter in nvim_buf_set_lines
2019-06-03 14:36:21 +02:00
7ac3c311ee api/buffer: create new buffers in the "opened" state
Otherwise vim will think that ml_append() needs to "enter" the buffer,
which emits unexpected autocommands.

ref https://github.com/vim-airline/vim-airline/issues/1930
2019-06-03 13:54:03 +02:00
3273e39db6 Merge pull request #10107 from gelguy/c_ctrl_d
Fix multiple <C-D> showing statusline on previous completion list
2019-06-03 12:10:28 +02:00
3d24bb48e7 test: don't detach screen just to change the size 2019-06-03 11:23:10 +02:00
c96aed2ba7 Add test 2019-06-03 11:14:07 +02:00
d19ff73b39 Fix multiple c_CTRL-D showing statusline 2019-06-03 11:14:07 +02:00
559401ebe5 oldtests: set laststatus=1 2019-06-03 00:12:01 -04:00
f0078c26c2 functionaltests: fix new execute() tests 2019-06-03 00:12:01 -04:00
5a4e7af77d update functional test for "places cursor correctly #6035" 2019-06-03 00:12:01 -04:00
73a2922413 UI: Fix wrong msg_col after execute()
closes #6035
closes #9250
2019-06-03 00:12:01 -04:00
7443da6f6e vim-patch:8.1.0571: non-silent execute() resets display column to zero
Problem:    Non-silent execute() resets display column to zero.
Solution:   Keep the display column as-is.
446e7a3cd3
2019-06-03 00:12:01 -04:00
8de5d64169 vim-patch:8.1.0569: execute() always resets display column to zero
Problem:    Execute() always resets display column to zero. (Sha Liu)
Solution:   Don't reset it to zero, restore the previous value. (closes vim/vim#3669)
10ccaa17ec
2019-06-03 00:12:01 -04:00
f046f3a239 build: fix some warnings
../src/nvim/event/rstream.c:119:44: warning: format specifies type 'void *' but the argument has type 'Stream *' (aka 'struct stream *') [-Wformat-pedantic]
          DLOG("Closing Stream (%p): %s (%s)", stream,
                                ~~             ^~~~~~
    ../src/nvim/event/stream.c:95:30: warning: format specifies type 'void *' but the argument has type 'Stream *' (aka 'struct stream *') [-Wformat-pedantic]
      DLOG("closing Stream: %p", stream);
                            ~~   ^~~~~~
    ../src/nvim/msgpack_rpc/channel.c:71:72: warning: format specifies type 'void *' but the argument has type 'Stream *' (aka 'struct stream *') [-Wformat-pedantic]
        DLOG("rpc ch %" PRIu64 " in-stream=%p out-stream=%p", channel->id, in, out);
                                           ~~                              ^~
    ../src/nvim/msgpack_rpc/channel.c:71:76: warning: format specifies type 'void *' but the argument has type 'Stream *' (aka 'struct stream *') [-Wformat-pedantic]
        DLOG("rpc ch %" PRIu64 " in-stream=%p out-stream=%p", channel->id, in, out);
                                                         ~~                    ^~~
    ../src/nvim/msgpack_rpc/channel.c:226:28: warning: format specifies type 'void *' but the argument has type 'Stream *' (aka 'struct stream *') [-Wformat-pedantic]
           channel->id, count, stream);
                               ^~~~~~
2019-06-03 00:21:20 +02:00
c0134660ab test: avoid some boilerplate 2019-06-03 00:08:32 +02:00
40218d1180 Make sure msg_clear is sent after confirm message (#10065) 2019-06-02 23:38:19 +02:00
8a33cb32ba Merge #10086 'vim-patch:8.1.{902,1114}' 2019-06-02 23:32:28 +02:00
Jit
b65a7b7f66 [RDY] Fix wildmode=list,full and display+=msgsep interaction (#10103)
* Fix wildmode=list and display+=msgsep interaction
* Add test to check ext_messages behaviour is unchanged
2019-06-02 21:38:34 +02:00
cbe45a303e Merge #10104 from justinmk/dep-libuv
deps: update to libuv v1.29.1
2019-06-02 16:52:12 +02:00
370ad05229 deps: update to libuv v1.29.1
Fixes #10101
See also 0ac1363599

Notable changes since v1.26.0:

- v1.27.0
  - linux: use statx() to obtain file birth time
- v1.28.0
  - unix,win: add uv_gettimeofday()
  - unix,win: add uv_fs_{open,read,close}dir()
  - unix: fix uv_interface_addresses()
  - fs: remove macOS-specific copyfile(3) fixes neovim/neovim#10101
  - unix: suppress EINTR/EINPROGRESS in uv_fs_close()
- v1.29.0
  - unix: fix race condition in uv_async_send()
  - linux: use O_CLOEXEC instead of EPOLL_CLOEXEC
  - linux: read free/total memory from /proc/meminfo
  - unix: don't assert on UV_PROCESS_WINDOWS_* flags
  - unix,win: add uv_get_constrained_memory()
- v1.29.1
  - linux: fix sscanf() overflows reading from /proc
2019-06-02 15:53:57 +02:00
2e171a6fd1 test: cleanup, reduce verbosity 2019-06-01 21:59:42 +02:00
ed24a297e5 doc [ci skip] #10097
- fix broken links (|buffered| was renamed to |channel-buffered|)
- rewrite `:h channel-lines`
2019-06-01 20:14:29 +02:00
95ece7d046 signs: fix crash in buf_addsign #10091
buf_signcols sorting breaks signlist structure.

Remove sorting in buf_signcols, because signlist is already kept
sorted and it did not correctly update the double linked list.

Fixes #10078
2019-06-01 12:03:59 +02:00
ef33500e17 Merge #10099 from janlazo/vim-8.1.1000
vim-patch:8.1.{1000,1436}
2019-06-01 11:35:41 +02:00
afcfb7bd58 vim-patch:8.1.1436: writefile test fails when run under /tmp
Problem:    Writefile test fails when run under /tmp.
Solution:   Adjust 'backupskip. (Kenta Sato, closes vim/vim#4462)
c28cb5b16d
2019-06-01 01:18:48 -04:00
2d002100b3 lint 2019-06-01 00:37:36 -04:00
a51f24fda3 vim-patch:8.1.1000: indenting is off
Problem:    Indenting is off.
Solution:   Make indenting consistent and update comments. (Ozaki Kiichi,
            closes vim/vim#4079)
fd731b0e31
2019-06-01 00:15:02 -04:00
c6cd6081b8 Merge #10083 from janlazo/vim-8.0.0785
vim-patch:8.0.0785
2019-05-29 10:49:02 +02:00
bfc44a91ac vim-patch:8.1.1114: confusing overloaded operator "." for string concatenation
Problem:    Confusing overloaded operator "." for string concatenation.
Solution:   Add ".." for string concatenation.  Also "let a ..= b".
0f248b006c
2019-05-29 12:54:42 +09:00
f3dc63a6ff lint 2019-05-28 23:17:09 -04:00
d46aaa0746 vim-patch:8.1.0902: incomplete set of assignment operators
Problem:    Incomplete set of assignment operators.
Solution:   Add /=, *= and %=. (Ozaki Kiichi, closes vim/vim#3931)
ff697e6cef
2019-05-29 12:05:56 +09:00
18c2ae7284 vim-patch:8.0.0785: wildcards are not expanded for :terminal
Problem:    Wildcards are not expanded for :terminal.
Solution:   Add FILES to the command flags. (Yasuhiro Matsumoto, closes vim/vim#1883)
            Also complete commands.
67883b4909
2019-05-28 23:03:02 -04:00
f8f63393c1 vim-patch:8.1.1411: fix divide by zero #10073
Problem:    Coverity warns for divide by zero.
Solution:   Make sure width is larger than zero.
7833dab73c
2019-05-28 12:15:38 +02:00
c423ec65dc version.c: update [ci skip] (#9875)
vim-patch:8.0.0514: script for creating cmdidxs can be improved
vim-patch:8.0.0715
vim-patch:8.0.0754: terminal window does not support colors
vim-patch:8.0.0755: terminal window does not have colors in the GUI
vim-patch:8.0.0760: terminal window colors wrong with 'termguicolors'
vim-patch:8.0.0769: build problems with terminal on MS-Windows
vim-patch:8.0.0775: in a terminal the cursor is updated too often
vim-patch:8.0.0777: compiler warnings with 64 bit compiler
vim-patch:8.0.0779: :term without an argument uses empty buffer name
vim-patch:8.0.0781: MS-Windows: memory leak when using :terminal
vim-patch:8.0.0783: job of terminal may be freed too early
vim-patch:8.0.0784: job of terminal may be garbage collected
vim-patch:8.0.0787: cannot send CTRL-W command to terminal job
vim-patch:8.0.0788: MS-Windows: cannot build with terminal feature
vim-patch:8.0.0789: splitting terminal window has resizing problems
vim-patch:8.0.0793: using wrong terminal name for terminal window
vim-patch:8.0.0798: no highlighting in a terminal window with a finished job
vim-patch:8.0.0800
vim-patch:8.0.0801: terminal window title says "running" after job exits
vim-patch:8.0.0807: terminal window can't handle mouse buttons
vim-patch:8.0.0813: cannot use a terminal window while the job is running
vim-patch:8.0.0815: terminal window not correctly updated
vim-patch:8.0.0819: cursor not positioned in terminal window
vim-patch:8.0.0820: GUI: cursor in terminal window lags behind
vim-patch:8.0.0823: cannot paste text into a terminal window
vim-patch:8.0.0824: in Terminal mode the cursor and screen gets redrawn
vim-patch:8.0.0826: cannot use text objects in Terminal mode
vim-patch:8.0.0827: Coverity: could leak pty file descriptor
vim-patch:8.0.0829: job running in terminal can't communicate with Vim
vim-patch:8.0.0832: terminal function arguments are not consistent
vim-patch:8.0.0833: terminal test fails
vim-patch:8.0.0836: can abandon a terminal buffer after making a change
vim-patch:8.0.0838: buffer hangs around whem terminal window is closed
vim-patch:8.0.0839: cannot kill a job in a terminal with CTRL-C
vim-patch:8.0.0841: term_getline() may cause a crash
vim-patch:8.0.0842: using slave pty after closing it
vim-patch:8.0.0845: MS-Windows: missing semicolon in terminal code
vim-patch:8.0.0846: cannot get the name of the pty of a job
vim-patch:8.0.0848: using multiple ch_log functions is clumsy
vim-patch:8.0.0849: crash when job exit callback wipes the terminal
vim-patch:8.0.0850: MS-Windows: error message while starting up may be broken
vim-patch:8.0.0852: MS-Windows: possible crash when giving a message on startup
vim-patch:8.0.0854: no redraw after terminal was closed
vim-patch:8.0.0855: MS-Windows: can't get tty name of terminal
vim-patch:8.0.0856: MS-Windows: terminal job doesn't take options
vim-patch:8.0.0857: terminal test fails on MS-Windows
vim-patch:8.0.0859: NULL pointer access when term_free_vterm called twice
vim-patch:8.0.0860: side effects when channel appends to a buffer
vim-patch:8.0.0868: cannot specify the terminal size on the command line
vim-patch:8.0.0873: in terminal cannot use CTRL-\ CTRL-N to start Visual mode
vim-patch:8.0.0888: compiler warnings with 64 bit build
vim-patch:8.0.0889: gcc gives warnings for uninitialized variables
vim-patch:8.0.0891: uninitialized memory use with empty line in terminal
vim-patch:8.0.0897: wrong error message for invalid term_finish value
vim-patch:8.0.0905: MS-Windows: broken multi-byte characters in the console
vim-patch:8.0.0907: with cp932 font names might be misinterpreted
vim-patch:8.0.0911: terminal test takes too long
vim-patch:8.0.0928: MS-Windows: passing arglist to job has escaping problems
vim-patch:8.0.0945: 64-bit compiler warnings
vim-patch:8.0.0949: winpty.dll name is fixed
vim-patch:8.0.0952: has('terminal') does not check existence of dll file
vim-patch:8.0.1028: MS-Windows: viminfo uses $VIM/_viminfo if $HOME not set
vim-patch:8.0.1061: Coverity: no check for NULL command
vim-patch:8.0.1063: Coverity warns for NULL check and array use
vim-patch:8.0.1064: Coverity warns for leaking resource
vim-patch:8.0.1138: click in window toolbar starts Visual mode
vim-patch:8.0.1266: Test_swap_directory was commented out
vim-patch:8.0.1348: make testclean deletes script file on MS-Windows
vim-patch:8.0.1499: out-of-memory situation not correctly handled
vim-patch:8.0.1501: out-of-memory situation not correctly handled
vim-patch:8.0.1524: compiler warnings for uninitialized variables
vim-patch:8.0.1532: compiler warnings without termguicolors feature
vim-patch:8.0.1607: --clean loads user settings from .gvimrc
vim-patch:8.0.1626: compiler warning for possible loss of data
vim-patch:8.0.1654: warnings for conversion of void to function pointer
vim-patch:8.0.1661: warnings from 64 bit compiler
vim-patch:8.0.1676: no compiler warning for wrong printf format
vim-patch:8.0.1677: no compiler warning for wrong format in vim_snprintf()
vim-patch:8.0.1687: 64 bit compiler warnings
vim-patch:8.0.1773: dialog messages are not translated
vim-patch:8.0.1803: warning for uninitialized variable
vim-patch:8.0.1824: Coverity warns for variable that may be uninitialized
vim-patch:8.0.1827: compiler warning for signed/unsigned char pointers

vim-patch:8.1.0023: gcc 8.1 warns for use of strncpy()
vim-patch:8.1.0054: compiler warning for using %ld for "long long"
vim-patch:8.1.0645: Coverity warns for possible use of NULL pointer
vim-patch:8.1.0704: building with Ruby 2.6 gives compiler warnings
vim-patch:8.1.0721: conceal mode is not sufficiently tested
vim-patch:8.1.0725: conceal mode is not completely tested
vim-patch:8.1.0730: compiler warning for get_buf_arg() unused
vim-patch:8.1.0744: compiler warnings for signed/unsigned strings
vim-patch:8.1.0762: compiler warning
vim-patch:8.1.0763: nobody is using the Sun Workshop support
vim-patch:8.1.0773: not all crypt code is tested
vim-patch:8.1.0787: compiler warning for unused function
vim-patch:8.1.0791: a few compiler warnings on VMS
vim-patch:8.1.0801: MinGW: no hint that tests fail because of small terminal
vim-patch:8.1.0838: compiler warning for type conversion
vim-patch:8.1.0962: building with MinGW and static libs doesn't work
vim-patch:8.1.1145: compiler warning for unused function
vim-patch:8.1.1146: in MS-Windows console colors in a terminal window are wrong
vim-patch:8.1.1147: desktop file translations are requiring manual updates
vim-patch:8.1.1149: building desktop files fails with older msgfmt
vim-patch:8.1.1150: generating desktop files not tested on Travis
vim-patch:8.1.1151: build fails when using shadow directory
vim-patch:8.1.1152: compiler warning with VS2019
vim-patch:8.1.1154: getting a newer msgfmt on Travis is too complicated
vim-patch:8.1.1158: json encoded string is sometimes missing the final NUL
vim-patch:8.1.1159: MS-Windows: with a silent (un)install $VIM/_vimrc is removed
vim-patch:8.1.1161: unreachable code
vim-patch:8.1.1163: codecov does not report all the coverage information
vim-patch:8.1.1174: cannot build with Ruby 1.8
vim-patch:8.1.1182: some function prototypes are outdated
vim-patch:8.1.1183: typos in VisVim comments
vim-patch:8.1.1196: parallel build may fail
vim-patch:8.1.1198: bracketed paste may remain active after Vim exists
vim-patch:8.1.1208: links to repository use wrong file name
vim-patch:8.1.1215: "make clean" does not remove generated src/po files
vim-patch:8.1.1217: MS-Windows: no space reserved for font quality name
vim-patch:8.1.1220: build fails on MS-Windows
vim-patch:8.1.1222: build still fails on MS-Windows
vim-patch:8.1.1225: cannot create a pty to use with :terminal on FreeBSD
vim-patch:8.1.1227: duplicate entries in the generate .desktop files
vim-patch:8.1.1229: warning for posix_openpt() not declared
vim-patch:8.1.1233: cannot build tiny version
vim-patch:8.1.1238: MS-Windows: compiler warning for sprintf() format
vim-patch:8.1.1239: key with byte sequence containing CSI does not work
vim-patch:8.1.1240: runtime desktop files are overwritten by build
vim-patch:8.1.1243: compiler warnings for incomplete switch statement
vim-patch:8.1.1246: cannot handle negative mouse coordinate from urxvt
vim-patch:8.1.1255: building desktop files fails on FreeBSD
vim-patch:8.1.1257: MSVC: name of object directory now always right
vim-patch:8.1.1258: the "N files to edit" message can not be surpressed
vim-patch:8.1.1262: cannot simulate a mouse click in a test
vim-patch:8.0.1270: mismatching file name with Filelist
vim-patch:8.1.1273: compiler warning in direct write code
vim-patch:8.1.1277: missing screenshot update
vim-patch:8.1.1282: running make in src/po leaves LINGUAS file behind
vim-patch:8.1.1287: cannot build with +eval but without +mouse
vim-patch:8.1.1290: .hgignore and .gitignore are either distributed or in git
vim-patch:8.1.1294: MS-Windows: Some fonts return wrong average char width
vim-patch:8.0.1298: missing test file
vim-patch:8.1.1301: when compiled with VIMDLL some messages are not shown
vim-patch:8.1.1304: MS-Windows: compiler warning for unused value
vim-patch:8.1.1314: MSVC makefile is not nicely indented
vim-patch:8.1.1315: there is always a delay if a termrequest is never answered
vim-patch:8.1.1317: output from Travis can be improved
vim-patch:8.1.1322: Cygwin makefile is not nicely indented
vim-patch:8.1.1323: 'mouse' option is reset when using GPM mouse
vim-patch:8.1.1324: stray comma in VMS makefile
vim-patch:8.1.1339: installer needs to product name et al.
vim-patch:8.1.1361: Python setuptools don't work with Python 3
vim-patch:8.1.1369: get E484 when using system() during GUI startup
vim-patch:8.1.1370: not using the new github feature for donations
vim-patch:8.1.1377: MS-Windows GUI uses wrong shell command for bash
vim-patch:8.1.1380: MS-Windows building VIMDLL with MSVC: SUBSYSTEM is not set
vim-patch:8.1.1381: MS-Windows: missing build dependency
vim-patch:8.1.1397: build fails in tiny version
vim-patch:8.1.1398: duplicate line in MSVC build file
vim-patch:8.1.1404: cannot change the patch level when building with NSIS
vim-patch:8.1.1153 does not exist or was suppose to be
                   9a419ffb93
                   which is N/A.
vim-patch:8.0.0732: when updating a buffer modeless selection is lost
vim-patch:8.0.0764: 'termkey' does not work yet (already implemented in #1820)
vim-patch:8.0.0766: option test fails with +terminal feature (also about termkey, #1820)
2019-05-28 01:00:56 +02:00
69b3d5acd3 Merge #10068 from janlazo/vim-8.1.0020
vim-patch:8.1.{20,995,1077}
2019-05-27 12:01:35 +02:00
3c3b7844b9 lint 2019-05-26 21:50:37 -04:00
b2a11515b2 vim-patch:8.1.1077: reg_executing() is reset by calling input()
Problem:    reg_executing() is reset by calling input().
Solution:   Implement a more generic way to save and restore reg_executing.
            (Ozaki Kiichi, closes vim/vim#4192)
9a2c091a74
2019-05-26 20:58:57 -04:00
2393611588 vim-patch:8.1.0995: a getchar() call resets the reg_executing() result
Problem:    A getchar() call while executing a register resets the
            reg_executing() result.
Solution:   Save and restore reg_executing. (closes vim/vim#406
f0fab3046c
2019-05-26 20:55:44 -04:00
21f160746a vim-patch:8.1.0020: cannot tell whether a register is executing or recording
Problem:    Cannot tell whether a register is being used for executing or
            recording.
Solution:   Add reg_executing() and reg_recording(). (Hirohito Higashi,
            closes vim/vim#2745)  Rename the global variables for consistency.  Store
            the register name in reg_executing.
0b6d911e5d
2019-05-26 20:24:11 -04:00
fb4d5a1846 UI/ext_messages: restore kind=quickfix #10067
Accidentally removed in 34f9e72af9.
ref #6201
2019-05-27 00:01:41 +02:00
1ca84897a0 Merge #10059 from jerdna-regeiz/vim-8.1.0614
vim-patch:8.1.0614,8.1.0632,8.1.0644,8.1.0658,8.1.0660,8.1.0669,8.1.0673,8.1.0679,8.1.0697,8.1.0701,8.1.0702,8.1.0709,8.1.0717,8.1.0750,8.1.0767,8.1.0772,8.1.0039
2019-05-26 20:59:28 +02:00
Jit
0bbaef8a99 UI/cmdline: check if redraw is needed after K_EVENT, K_COMMAND #9804
fixes #8490
2019-05-26 19:52:30 +02:00
80f40f0203 lint 2019-05-26 19:32:32 +02:00
0b9e57aca1 Skipping Test_sign_memfailures (unsupported memory checks) 2019-05-26 19:32:32 +02:00
897431c486 Fix out of bounds read in sign_group_ref 2019-05-26 19:32:32 +02:00
237cecd81b vim-patch:8.1.0039: cannot easily delete lines in another buffer
Problem:    Cannot easily delete lines in another buffer.
Solution:   Add deletebufline().
d79a26219d
2019-05-26 19:32:32 +02:00
8df9213d1b Resolved compile warnings & fixed lot of style related to sign api 2019-05-26 19:32:32 +02:00
51563b70d7 Allow multiple signs of same type in one line (matching vim behaviour)
This partly rolls back 36762a00a8,
but it matches vim behaviour (covered with recent tests - oldtest).
2019-05-26 19:32:32 +02:00
7d43943e4e Fixed ordering of signs to align vim and neovim behaviour 2019-05-26 19:32:32 +02:00
f2341164c6 Changed sign_mark_adjust behaviour to match vim
Vim does not delete/free signs if they are placed on lines which get
deleted. In case of undo it does make a difference as in vim the sign
will be still available.
2019-05-26 19:32:32 +02:00
93e18e698e vim-patch:8.1.0772: the sign_define_by_name() function is too long
Problem:    The sign_define_by_name() function is too long.
Solution:   Split it into smaller functions. (Yegappan Lakshmanan,
            closes vim/vim#3819)
0314236aab
2019-05-26 19:32:32 +02:00
fb4cf05e44 vim-patch:8.1.0767: when deleting lines at the bottom signs are misplaced
Problem:    When deleting lines at the bottom signs are misplaced.
Solution:   Properly update the line number of signs at the end of a buffer
            after a delete/undo operation. (Yegappan Lakshmanan, closes vim/vim#3798)
c771bf9016
2019-05-26 19:32:32 +02:00
c5f3dbab35 vim-patch:8.1.0750: when the last sign is deleted the signcolumn may remain
Problem:    When the last sign is deleted the signcolumn may not be removed
            even though 'signcolumn' is "auto".
Solution:   When deleting the last sign redraw the buffer. (Dominique Pelle,
            closes vim/vim#3803, closes vim/vim#3804)
8144acbec3
2019-05-26 19:32:32 +02:00
fa07cc215d vim-patch:8.1.0717: there is no function for the ":sign jump" command
Problem:    There is no function for the ":sign jump" command.
Solution:   Add the sign_jump() function. (Yegappan Lakshmanan, closes vim/vim#3780)
6b7b7190aa
2019-05-26 19:32:32 +02:00
e09f3baed8 vim-patch:8.1.0709: windows are updated for every added/deleted sign
Problem:    Windows are updated for every added/deleted sign.
Solution:   Do not call update_debug_sign().  Only redraw when the line with
            the sign is visible.  (idea from neovim vim/vim#9479)
27a472c32e
2019-05-26 19:32:32 +02:00
f43900f686 vim-patch:8.1.0702: ":sign place" only uses the current buffer
Problem:    ":sign place" only uses the current buffer.
Solution:   List signs for all buffers when there is no buffer argument.
            Fix error message for invalid buffer name in sign_place().
            (Yegappan Lakshmanan, closes vim/vim#3774)
b589f95b38
2019-05-26 19:32:32 +02:00
35fbb4e1ca vim-patch:8.1.0701: sign message not translated and inconsistent spacing
Problem:    Sign message not translated and inconsistent spacing.
Solution:   Add _() for translation.  Add a space. (Ken Takata)  Also use
            MSG_BUF_LEN instead of BUFSIZ.
d730c8e297
2019-05-26 19:32:32 +02:00
e70609cfac vim-patch:8.1.0697: ":sign place" requires the buffer argument
Problem:    ":sign place" requires the buffer argument.
Solution:   Make the argument optional.  Also update the help and clean up the
            sign test. (Yegappan Lakshmanan, closes vim/vim#3767)
b328cca254
2019-05-26 19:32:32 +02:00
54c4567564 vim-patch:8.1.0679: sign functions do not take buffer argument as documented
Problem:    Sign functions do not take buffer argument as documented.
Solution:   Use get_buf_tv(). (Yegappan Lakshmanan, closes vim/vim#3755)
2cbc1a02cb
2019-05-26 19:32:32 +02:00
83025f0028 vim-patch:8.1.0673: functionality for signs is spread out over several files
Problem:    Functionality for signs is spread out over several files.
Solution:   Move most of the sign functionality into sign.c. (Yegappan
            Lakshmanan, closes vim/vim#3751)
bbea47075c
2019-05-26 19:32:32 +02:00
ce021baea0 vim-patch:8.1.0669: the ex_sign() function is too long
Problem:    The ex_sign() function is too long.
Solution:   Refactor the function.  Add a bit more testing. (Yegappan
            Lakshmanan, closes vim/vim#3745)
a355652ea5
2019-05-26 19:32:31 +02:00
88720c626e vim-patch:8.1.0660: sign_cleanup() may leak memory
Problem:    sign_cleanup() may leak memory.
Solution:   Free the group name before returning.  Add a few more tests.
            (Yegappan Lakshmanan)
1ea88a3e12
2019-05-26 19:32:31 +02:00
09c236ba5c vim-patch:8.1.0658: deleting signs and completion for :sign is insufficient
Problem:    Deleting signs and completion for :sign is insufficient.
Solution:   Add deleting signs in a specified or any group from the current
            cursor location.  Add group and priority to sign command
            completion. Add tests for different sign unplace commands. Update
            help text.  Add tests for sign jump with group. Update help for
            sign jump. (Yegappan Lakshmanan, closes vim/vim#3731)
7d83bf4f2b
2019-05-26 19:32:31 +02:00
3ee55edd2e vim-patch:8.1.0644: finding next sign ID is inefficient
Problem:    Finding next sign ID is inefficient.
Solution:   Add next_sign_id. (Yegappan Lakshmanan, closes vim/vim#3717)
6436cd83f9
2019-05-26 19:32:31 +02:00
4f844c587c vim-patch:8.1.0632: using sign group names is inefficient
Problem:    Using sign group names is inefficient.
Solution:   Store group names in a hash table and use a reference to them.
            Also remove unnecessary use of ":exe" from the tests.  (Yegappan
            Lakshmanan, closes vim/vim#3715)
7a2d9892b7
2019-05-26 19:32:31 +02:00
fb9abd7d99 vim-patch:8.1.0614: placing signs can be complicated
Problem:    Placing signs can be complicated.
Solution:   Add functions for defining and placing signs.  Introduce a group
            name to avoid different plugins using the same signs. (Yegappan
            Lakshmanan, closes vim/vim#3652)
162b71479b
2019-05-26 19:32:31 +02:00
fc7861f0fa Merge #9897 from janlazo/vim-8.0.0683 2019-05-26 18:44:35 +02:00
aabda31d54 Merge pull request #9547 from bfredl/rpc_multiline_err
messages: use proper multiline errors for rpcrequest and API wrappers
2019-05-26 18:11:49 +02:00
2b4c0181ba Merge #10064 from janlazo/vim-8.1.0211
vim-patch:8.1.{211,307}
2019-05-26 16:33:10 +02:00
52215f5752 doc/API: document indexing behavior #10058
close #10058
2019-05-26 16:15:20 +02:00
8ed54bbec3 messages: use proper multiline error message for rpcrequest and API wrappers 2019-05-26 15:42:16 +02:00
58d6e2d3cc lint 2019-05-26 07:27:50 -04:00
f60af8694b vim-patch:8.1.0307: there is no good way to get the window layout
Problem:    There is no good way to get the window layout.
Solution:   Add the winlayout() function. (Yegappan Lakshmanan)
0f6b4f06de
2019-05-26 07:27:50 -04:00
08aa9b0023 vim-patch:8.1.0211: expanding a file name "~" results in $HOME
Problem:    Expanding a file name "~" results in $HOME. (Aidan Shafran)
Solution:   Change "~" to "./~" before expanding. (closes vim/vim#3072)
00136dc321
2019-05-25 20:36:01 -04:00
55419a6904 Merge #10063 from janlazo/vim-8.1.0205
vim-patch:8.1.{205,206,208,506,546,547,751}
2019-05-25 23:45:00 +02:00
68de7e7244 test/old: remove duplicates, run test_tabpage.vim 2019-05-25 16:49:31 -04:00
06d9fa2e0c vim-patch:8.1.0751: some regexp errors are not tested
Problem:    Some regexp errors are not tested.
Solution:   Add a test function.
6057ed4720
2019-05-25 16:33:18 -04:00
f2f625c984 vim-patch:8.1.0547: modeline test with keymap still fails
Problem:    Modeline test with keymap still fails.
Solution:   Check that the keymap feature is available for the failure assert.
3067a4dd0d
2019-05-25 15:41:25 -04:00
55a88bcb1e vim-patch:8.1.0546: modeline test with keymap fails
Problem:    Modeline test with keymap fails.
Solution:   Check that the keymap feature is available.
4ace6ab7e7
2019-05-25 15:40:47 -04:00
b41ebe3e81 vim-patch:8.1.0506: modeline test fails when run by root
Problem:    Modeline test fails when run by root.
Solution:   Set 'modeline' for the test. (James McCoy, closes vim/vim#3592)
9691f82f86

N/A patches:

vim-patch:8.1.0208: file left behind after running individual test
2019-05-25 15:23:26 -04:00
0422cbae6b vim-patch:8.1.0206: duplicate test function name
Problem:    Duplicate test function name.
Solution:   Rename both functions.
cd96eef3a8
2019-05-25 15:20:55 -04:00
e664c2a158 vim-patch:8.1.0205: invalid memory access with invalid modeline
Problem:    Invalid memory access with invalid modeline.
Solution:   Pass pointer limit. Add a test. (closes vim/vim#3241)
9cf4b5005f
2019-05-25 15:18:31 -04:00
e0348c610c vim-patch:8.1.0817: test ":=" command #10062
Problem:    ":=" command is not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3859)
99531a7604
2019-05-25 20:52:34 +02:00
5d6a18f238 Merge #10061 from janlazo/vim-8.1.0188
vim-patch:8.1.{188,317}
2019-05-25 18:41:52 +02:00
e6c48ecef2 Fix memfile_test.c path 2019-05-25 12:20:56 -04:00
6fae460867 vim-patch:8.1.0317: Cscope test fails when using shadow directory
Problem:    Cscope test fails when using shadow directory.
Solution:   Resolve symlink in Vim. (James McCoy, closes vim/vim#3364)
320bf2d85e
2019-05-25 12:00:21 -04:00
bf10cdfcc0 vim-patch:8.1.0188: no test for ":cscope add"
Problem:    No test for ":cscope add".
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3212)
2196bca737
2019-05-25 11:59:52 -04:00
5e048baa5f Allow 3 beeps per half a second 2019-05-25 11:15:24 -04:00
2f023f40b2 Merge #10046 from justinmk/xfree
refactor: introduce XFREE_CLEAR()
2019-05-25 14:49:43 +02:00
eddd1bff3e clint: remove CheckAltTokens()
- These "alternative tokens" keywords are for C++, not C.
- The check sometimes has false positives, e.g. `compl` is a variable
  name in edit.c
2019-05-25 13:55:39 +02:00
51a59a0f62 lint 2019-05-25 13:51:30 +02:00
138110e082 vim-patch:8.0.0683: visual bell flashes too quickly
Problem:    When using a visual bell there is no delay, causing the flash to
            be very short, possibly unnoticeable.  Also, the flash and the
            beep can lockup the UI when repeated often.
Solution:   Do the delay in Vim or flush the output before the delay. Limit the
            bell to once per half a second. (Ozaki Kiichi, closes vim/vim#1789)
2e147caa14
2019-05-25 05:27:17 -04:00
c4f56c4134 kvec.h: kv_destroy: reinitialize after free 2019-05-25 10:29:56 +02:00
ae846b41df vim-patch:8.0.1496: VIM_CLEAR()
Problem:    Clearing a pointer takes two lines.
Solution:   Add VIM_CLEAR() and replace vim_clear(). (Hirohito Higashi,
            closes #2629)

vim-patch:8.0.1481
2019-05-25 10:07:05 +02:00
a9d7ec4587 refactor: introduce XFREE_CLEAR()
Unfortunately we cannot indiscriminately replace xfree() with
XFREE_CLEAR(), because comparing pointers after freeing them is a common
pattern. Example in `tv_list_remove_items()`:

    xfree(li);
    if (li == item2) {
      break;
    }

Instead we can do it selectively/explicitly.

ref #1375
2019-05-25 10:01:17 +02:00
4769deb36a doc #10017
- gen_vimdoc.py: fancy "bullet"
- rework `:help channel-callback`
- rename `:help buffered` to `:help channel-buffered`
2019-05-25 10:00:41 +02:00
d51f132cb1 Merge #10054 from janlazo/vim-8.1.1373
vim-patch:8.0.{1208,1220},8.1.{1171,1373}
2019-05-24 11:43:51 +02:00
f1464d0d80 vim-patch:8.1.1171: statusline test could fail in large terminal
Problem:    Statusline test could fail in large terminal.
Solution:   Make the test work on a huge terminal. (Dominique Pelle,
            closes vim/vim#4255)
316c16797a
2019-05-24 02:08:42 -04:00
4ed654d9e8 vim-patch:8.0.1220: skipping empty statusline groups is not correct
Problem:    Skipping empty statusline groups is not correct.
Solution:   Also set group_end_userhl. (itchyny)
235dddf1f4
2019-05-24 02:07:37 -04:00
83c9d1df1b vim-patch:8.0.1208: 'statusline' drops empty group with highlight change
Problem:    'statusline' drops empty group with highlight change.
Solution:   Do not drop an empty group if it changes highlighting. (Marius
            Gedminas, closes vim/vim#2228)
6b89dbb55f
2019-05-24 01:24:14 -04:00
9c43743945 lint 2019-05-23 20:07:37 -04:00
b87a1db5ac vim-patch:8.1.1373: "[p" in Visual mode puts in wrong line
Problem:    "[p" in Visual mode puts in wrong line.
Solution:   Call nv_put() instead of duplicating the functionality.
            (closes vim/vim#4408)
0ab190c057
2019-05-23 19:50:52 -04:00
66d127957e Merge #10049 'vim-patch:8.1.0293' 2019-05-22 11:59:04 +02:00
55fa966a92 vim-patch:8.1.1363: ":vert options" #10048
Problem:    ":vert options" does not make a vertical split.
Solution:   Pass the right modifiers in $OPTWIN_CMD. (Ken Takata,
            closes vim/vim#4401)
e0b5949a3b
2019-05-22 11:09:25 +02:00
7905f5df99 vim-patch:8.1.0293: checks for type of stack is cryptic
Problem:    Checks for type of stack is cryptic.
Solution:   Define IS_QF_STACK() and IS_LL_STACK(). (Yegappan Lakshmanan)
4d77c65a9e
2019-05-22 04:14:35 +02:00
62d5137c83 Merge #10038 from janlazo/vim-8.0.1514
vim-patch:8.0.{1514,1519},8.1.1360
2019-05-21 14:46:19 +02:00
1de77bbcec cleanup: remove HAVE_SELINUX #10040
We never define HAVE_SELINUX, and no one has asked for it.
So remove the dead code.
2019-05-21 11:15:10 +02:00
7187020783 vim-patch:8.1.1360: buffer left 'nomodifiable' after :substitute
Problem:    Buffer left 'nomodifiable' after :substitute. (Ingo Karkat)
Solution:   Save the value of 'modifiable' earlier' (Christian Brabandt,
            closes vim/vim#4403)
80341bcd89
2019-05-20 22:48:19 -04:00
7c979f972e vim-patch:8.0.1519: getchangelist() does not use argument as bufname()
Problem:    Getchangelist() does not use argument as bufname().
Solution:   Use get_buf_tv(). (Yegappan Lakshmanan, closes vim/vim#2641)
341a64c9ca
2019-05-20 19:07:15 -04:00
ca1ce59025 Merge #9709 'fileio: use os_copy to create backups'
ref #8288
2019-05-21 01:06:31 +02:00
5b04a4fa09 lua/shared: share trim() impl 2019-05-20 23:46:56 +02:00
646c3423dd fileio: set group of backup file
Restores code removed in #9709.

uv_fs_copyfile() copies the perm bits but not the group name.
https://github.com/libuv/libuv/pull/1547

ref #9709
ref #8288
2019-05-20 22:50:44 +02:00
7cc01c704c Merge #9709 'fileio: use os_copy to create backups'
ref #8288
2019-05-20 22:33:19 +02:00
783aa6b507 vim-patch:8.0.1514: getting the list of changes is not easy
Problem:    Getting the list of changes is not easy.
Solution:   Add the getchangelist() function. (Yegappan Lakshmanan,
            closes vim/vim#2634)
07ad816525
2019-05-20 13:33:59 -04:00
b9ba1295b4 runtime/termdebug.vim: handle "\n" as linebreaks #10037
Note: use "set print pretty" in gdb
Fixes #10020
2019-05-20 12:47:13 +02:00
60710dee82 Merge #10033 from janlazo/vim-8.0.1082
vim-patch:8.0.{1082,1497,1498,1513},8.1.{901,1357,1358}
2019-05-20 10:42:31 +02:00
7ea350456d vim-patch:8.1.1358: cannot enter character with a CSI byte
Problem:    Cannot enter character with a CSI byte.
Solution:   Only check "gui.in_use" when VIMDLL is defined. (Ken Takata,
            closes vim/vim#4396)
386b43e594
2019-05-19 23:35:28 -04:00
91c1737de6 vim-patch:8.1.1357: test 37 is old style
Problem:    Test 37 is old style.
Solution:   Turn it into a new style test. (Yegappan Lakshmanan, closes vim/vim#4398)
999dc14644
2019-05-19 23:15:47 -04:00
bd885d878f lint 2019-05-19 23:15:47 -04:00
854073f1db vim-patch:8.1.0901: index in getjumplist() may be wrong
Problem:    Index in getjumplist() may be wrong. (Epheien)
Solution:   Call cleanup_jumplist() earlier. (Yegappan Lakshmanan,
            closes vim/vim#3941)
57ee2b6e0b
2019-05-19 23:15:47 -04:00
4aad4c0533 vim-patch:8.0.1513: the jumplist is not always properly cleaned up
Problem:    The jumplist is not always properly cleaned up.
Solution:   Call fname2fnum() before cleanup_jumplist(). (Yegappan Lakshmanan)
4867974137
2019-05-19 23:15:47 -04:00
d6d9596b38 vim-patch:8.0.1498: getjumplist() returns duplicate entries
Problem:    Getjumplist() returns duplicate entries. (lacygoill)
Solution:   Call cleanup_jumplist(). (Yegappan Lakshmanan)
a7e18d237f
2019-05-19 23:15:47 -04:00
41828a7302 vim-patch:8.0.1497: getting the jump list requires parsing the output of :jumps
Problem:    Getting the jump list requires parsing the output of :jumps.
Solution:   Add getjumplist(). (Yegappan Lakshmanan, closes vim/vim#2609)
4f50588ba3
2019-05-19 23:15:47 -04:00
83aed410b6 vim-patch:8.0.1082: tests fail when run under valgrind
Problem:    Tests fail when run under valgrind.
Solution:   Increase waiting times.
9d18961323
2019-05-19 23:15:46 -04:00
8c842b39ba Merge #10034 from frangio/vim-8.1.1352 2019-05-20 00:19:44 +02:00
766cc60337 eval.c: add has("osx") for apple 2019-05-19 17:03:58 -03:00
16cac1d5f5 vim-patch:8.1.1353: undo test fails on Mac
Problem:    Undo test fails on Mac.
Solution:   Expect "private" on the Mac.
2b39d806f0
2019-05-19 17:03:58 -03:00
5c13f368c6 lint 2019-05-19 21:26:33 +02:00
8b3c0b87ff vim-patch:8.1.1352: undofile() reports wrong name
Problem:    Undofile() reports wrong name. (Francisco Giordano)
Solution:   Clean up the name before changing path separators. (closes vim/vim#4392,
            closes vim/vim#4394)
e9ebc9a91c
2019-05-19 15:31:23 -03:00
8e941c59ec Merge #9740 from KillTheMule/luadoc 2019-05-19 18:45:21 +02:00
fab81cfb04 lua/shared: share more stuff
Leave trim() in vim.lua, because gen_vimdoc.py needs at least one
function in there, else it gets confused...
2019-05-19 18:31:40 +02:00
e4c2d85c77 lua/shared: share deepcopy() with test/*
deepcopy() was duplicated in test/helpers.lua
2019-05-19 17:58:54 +02:00
e628c011bf gen_vimdoc.py: support lua/shared.lua module [ci skip] 2019-05-19 17:30:20 +02:00
53576dfb35 Document the vim.lua functions 2019-05-18 22:01:14 +02:00
b102c11e38 gen_vimdoc.py: get Lua docs via lua2dox.lua #9740 2019-05-18 22:01:14 +02:00
974b43fd79 Merge #10028 from janlazo/vim-8.1.1345
vim-patch:8.1.{1325,1345,1348,1349}
2019-05-18 21:53:20 +02:00
1cbe014569 Merge #9301 'runtime/lua' 2019-05-18 21:50:57 +02:00
9d7aaf7149 lua/shared: move table util funcs to vim.shared
Use `tbl_` prefix for all table-util functions. Specify in the function
docstring if it expects a list-like or map-like table.
2019-05-18 21:07:30 +02:00
aa610690bf 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 20:38:19 +02:00
d07a6e2b45 vim-patch:8.1.1349: if writing runs into conversion error backup file is deleted
Problem:    If writing runs into a conversion error the backup file is
            deleted. (Arseny Nasokin)
Solution:   Don't delete the backup file is the file was overwritten and a
            conversion error occurred. (Christian Brabandt, closes vim/vim#4387)
cf0bfd9ade
2019-05-18 14:12:08 -04:00
f286af170d vim-patch:8.1.1348: running tests may cause the window to move
Problem:    Running tests may cause the window to move.
Solution:   Correct the reported window position for the offset with the
            position after ":winpos".  Works around an xterm bug.
f8191c5f07
2019-05-18 13:39:23 -04:00
a33010d1e1 vim-patch:8.1.1325: cannot build with +eval but without +channel and +timers
Problem:    Cannot build with +eval but without +channel and +timers. (John
            Marriott)
Solution:   Adjust #ifdef for get_callback().
97b0075b0d
2019-05-18 12:21:06 -04:00
3574126b89 vim-patch:8.1.1345: stuck in sandbox with ":s/../\=Function/gn"
Problem:    Stuck in sandbox with ":s/../\=Function/gn".
Solution:   Don't skip over code to restore sandbox. (Christian Brabandt)
6349e9411f
2019-05-18 12:11:11 -04:00
e8beea204b kbtree.h: assert valid range #10022
ref #10012
2019-05-18 16:21:33 +02:00
fd04877eb0 test: remove use of require('test.helpers')
The test.functional.helpers and test.unit.helpers modules now include
all of the public functions from test.helpers, so there is no need to
separately require('test.helpers').
2019-05-18 15:48:13 +02:00
7669fc1e9b test: share implementation of testdir/load.vim
Also, don't compute load factor unless load_adjust() was called, it
slows down the test suite.

ref #9292
2019-05-18 15:48:13 +02:00
bba75eb184 lua/stdlib: Introduce vim.shared
This is where "pure functions" can live, which can be shared by Nvim and
test logic which may not have a running Nvim instance available.

If in the future we use Nvim itself as the Lua engine for tests, then
these functions could be moved directly onto the `vim` Lua module.

closes #6580
2019-05-18 15:48:13 +02:00
2b87485c22 test: Extend {unit,functional}.helpers with global helpers
Automatically include all "global helper" util functions in the
unit.helpers and functional.helpers and modules.  So tests don't need to
expicitly do:

    local global_helpers = require('test.helpers')
2019-05-18 14:51:01 +02:00
8e22c4510e Merge pull request #10025 from bfredl/bufhl_fixes
kbtree: pointer UB and unitialized value fixes
2019-05-18 14:33:14 +02:00
b247c6fd22 kbtree: pointer UB and unitialized value fixes
- don't underflow itr->p pointer (C standard only allows one past the end, not
  one before the beginning)
- make sure itr->p->i is always initialized (even when not used)
- don't rely on `NULL < &object` (likely UB)
2019-05-18 13:37:57 +02:00
5625c7d8e1 vim-patch:8.1.1338: fix hang when concealing wide char #10023
Problem:    Hang when concealing the '>' shown for a wide char that doesn't
            fit in the last cell.
Solution:   Put back the pointer when the '>' is not going to be displayed.
            (closes vim/vim#4377)
0ebe12be86
2019-05-18 10:18:48 +02:00
9420a2127f runtime/termdebug.vim #10015
* bugfix
* use NormalFloat for floating window background
* use floating window by default
* correctly use nvim_open_win()
* use nvim_win_set_option to set window local option
* use nvim_buf_set_option for buffer options
* renamed augroup to nvim_termdebug_close_hover to be consistent with
nvim_terminal_... augroup
2019-05-16 21:58:07 +02:00
3a699a790c runtime/termdebug.vim #8364
* commit 36257d0f97b396467bef7a5937befd894fb23e31
Author: Kwon-Young Choi <kwon-young.choi@hotmail.fr>
Date:   Sat May 5 16:57:45 2018 +0200

    Port of the termdebug.vim plugin to neovim terminal feature.
    For neovim compatibility,
    The vim specific calls were replaced with neovim specific calls:
      term_start -> term_open
      term_sendkeys -> jobsend
      term_getline -> getbufline
      job_info && term_getjob -> using linux command ps to get the tty

    fix1: forgot to port EndDebug callback to neovim

    fix2: use nvim_get_chan_info to get pty of job
          remove the use of communication buffer by using jobstart instead
          of termopen

    fix3: get gdbbuf using nvim_get_chan_info

* cleaned up if has('nvim') to remove vim support.
added neovim floating window support for expression evaluation

* improvred documentation, cleaned up vim menu code, fixed bug when
floating window feature is not available
2019-05-16 11:21:05 +02:00
94f78ccf89 Merge pull request #9883 from bfredl/termredraw
make terminal state redraw like any other state
2019-05-14 13:39:00 +02:00
5020daa6e5 ui/terminal: make terminal state redraw like any other state
Previously, ordinary redraws were missing from terminal mode. Instead,
there was an async callback that invoked update_screen() on terminal
data regardless of mode (as if :redraw! was invoked by a timer).

This created some issues:

- async changes to an unrelated ordinary buffer were not always redrawn in
  terminal mode
- screen cursor position was not properly updated in terminal mode (partial
  fix, will be properly fixed in a follow up PR)
- ad-hoc logic was needed for interaction with special states such as
  inccommand or horizontal wildmenu.

Instead redraw terminal mode just like any other state. This disables forced
redraws in cmdline mode, which were inconisent which async changes to
normal buffers (which are not redrawn in cmdline mode).
2019-05-14 12:54:39 +02:00
9e0982a1a2 Merge pull request #9985 from bfredl/shenanigans
Fix aucmd_win issues: crashes and redrawing errors.
2019-05-13 23:24:14 +02:00
74751117eb autocmd: fixes and tests for autocmd window issues
- redraw! in an invisible buffer rendered the screen unusable.
- storing the autocmd window handle and using it in API function could lead
  to crashes. Unregister the handle when the window is not active.
2019-05-13 20:32:04 +02:00
e882460e52 Merge #10003 from justinmk/api-keymap
API/nvim_set_keymap: minor cleanup
2019-05-13 09:03:14 +02:00
60aaae1c86 API/nvim_set_keymap: remove mode-shortname aliases
Reduce the API surface-area a bit. No need to have aliases for a mode.
ref #9924
2019-05-12 13:27:07 +02:00
f35d233e07 API/nvim_set_keymap: minor cleanup
ref #9924
2019-05-12 13:04:48 +02:00
fbf2c414ad API: nvim_set_keymap, nvim_del_keymap #9924
closes #9136

- Treat empty {rhs} like <Nop>

- getchar.c: Pull "repl. MapArg termcodes" into func
  The "preprocessing code" surrounding the replace_termcodes calls needs
  to invoke replace_termcodes, and also check if RHS is equal to "<Nop>".
  To reduce code duplication, factor this out into a helper function.

  Also add an rhs_is_noop flag to MapArguments; buf_do_map_explicit
  expects an empty {rhs} string for "<Nop>", but also needs to distinguish
  that from something like ":map lhs<cr>" where no {rhs} was provided.

- getchar.c: Use allocated buffer for rhs in MapArgs
  Since the MAXMAPLEN limit does not apply to the RHS of a mapping (or
  else an RHS that calls a really long autoload function from a plugin
  would be incorrectly rejected as being too long), use an allocated
  buffer for RHS rather than a static buffer of length MAXMAPLEN + 1.

- Mappings LHS and RHS can contain literal space characters, newlines, etc.

- getchar.c: replace_termcodes in str_to_mapargs
  It makes sense to do this; str_to_mapargs is, intuitively, supposed to
  take a "raw" command string and parse it into a totally "do_map-ready"
  struct.

- api/vim.c: Update lhs, rhs len after replace_termcodes
  Fixes a bug in which replace_termcodes changes the length of lhs or rhs,
  but the later search through the mappings/abbreviations hashtables
  still uses the old length value. This would cause the search to fail
  erroneously and throw 'E31: No such mapping' errors or 'E24: No such
  abbreviation' errors.

- getchar: Create new map_arguments struct
  So that a string of map arguments can be parsed into a more useful, more
  portable data structure.

- getchar.c: Add buf_do_map function
  Exactly the same as the old do_map, but replace the hardcoded references
  to the global `buf_T* curbuf` with a function parameter so that we can
  invoke it from nvim_buf_set_keymap.

- Remove gettext calls in do_map error handling
2019-05-12 11:44:48 +02:00
24f9dd73d5 test/channels_spec: cleanup
- Remove stray print()
- Use uname() instead of system('uname')
2019-05-12 00:43:28 +02:00
ab7d9ae193 Merge #9993 from justinmk/ui-message-kinds
UI/ext_messages: learn more message kinds
2019-05-12 00:11:57 +02:00
a0f775c4d3 doc 2019-05-11 23:42:55 +02:00
3d1ed7c959 UI/ext_messages: learn more message kinds
ref #6201
2019-05-11 23:42:55 +02:00
7c9d4d971c vim-patch:8.1.0543: fix memory leak #10001
Problem:    Coverity warns for leaking memory and using wrong struct.
Solution:   Free pointer when allocation fails. Change "boff" to "loff".
            (closes vim/vim#3634)
4e303c8ba8
2019-05-11 21:53:59 +02:00
da3c0e4962 Merge #9994 from janlazo/vim-8.1.1306
vim-patch:8.1.{1306,1312}
2019-05-11 12:48:26 +02:00
c82c5d7570 vim-patch:8.1.1312: Coverity warning for using uninitialized variable
Problem:    Coverity warning for using uninitialized variable.
Solution:   Clear exarg_T.
4ca41534b7
2019-05-09 23:16:17 -04:00
92f39762af vim-patch:8.1.1306: Borland support is outdated and doesn't work
Problem:    Borland support is outdated and doesn't work.
Solution:   Remove Borland support, there are other (free) compilers
            available. (Thomas Dziedzic, Ken Takata, closes vim/vim#4364)
eae1b91fea
2019-05-09 20:27:11 -04:00
a541c681f6 runtime/tutor [ci skip] #9990 2019-05-09 23:32:57 +02:00
d818135e3f Merge #9992 from justinmk/ui-upgrade
UI/nvim_ui_attach(): add "override" option
2019-05-09 23:31:30 +02:00
b9ad12e6c2 UI/nvim_ui_attach(): add override option
Before now, Nvim always degrades UI capabilities to the lowest-common
denominator. For example, if any connected UI has `ext_messages=false`
then `ext_messages=true` requested by any other connected UI is ignored.

Now `nvim_ui_attach()` supports `override=true`, which flips the
behavior: if any UI requests an `ext_*` UI capability then the
capability is enabled (and the legacy behavior is disabled).

Legacy UIs will be broken while a `override=true` UI is connected, but
it's useful for debugging: you can type into the TUI and observe the UI
events from another connected (UI) client. And the legacy UI will
"recover" after the `override=true` UI disconnects.

Example using pynvim:

    >>> n.ui_attach(2048, 2048, rgb=True, override=True, ext_multigrid=True, ext_messages=True, ext_popupmenu=True)
    >>> while True: n.next_message();
2019-05-09 22:27:41 +02:00
b6ad206024 Merge pull request #9987 from janlazo/vim-8.1.0865
vim-patch:8.1.{865,1299}
2019-05-09 11:15:19 +02:00
98398ff93f vim-patch:8.1.1299: "extends" from 'listchars' is used when 'list' is off
Problem:    "extends" from 'listchars' is used when 'list' is off. (Hiroyuki
            Yoshinaga)
Solution:   Only use the "extends" character when 'list' is on. (Hirohito
            Higashi, closes vim/vim#4360)
a5c6a0b6c7
2019-05-08 21:46:37 -04:00
924f1173cb vim-patch:8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Problem:    When 'listchars' only contains "nbsp:X" it does not work.
Solution:   Set extra_check when lcs_nbsp is set. (Ralf Schandl, closes vim/vim#3889)
895d966e34
2019-05-08 21:05:10 -04:00
8330cc22af vim-patch:8.1.1205: BufReadPre may move the cursor #9980
Problem:    A BufReadPre autocommand may cause the cursor to move.
Solution:   Restore the cursor position after executing the autocommand,
            unless the autocommand moved it. (Christian Brabandt,
            closes vim/vim#4302, closes vim/vim#4294)
a68e595909
2019-05-08 18:01:21 +02:00
d36ef9339f vim-patch:8.1.1293: MSVC files are no longer useful #9982
Problem:    MSVC files are no longer useful for debugging.  Newer Visual
            Studio versions cannot read them.
Solution:   Delete the files. (Ken Takata, closes vim/vim#4357)
fda9784dc9
2019-05-08 11:44:04 +02:00
bc395b4fd4 Merge #9979 from janlazo/vim-8.0.0876
vim-patch:8.0.{876,1144},8.1.0133
2019-05-07 11:42:21 +02:00
4423759d03 vim-patch:8.0.1144: using wrong #ifdef for computing length
Problem:    Using wrong #ifdef for computing length.
Solution:   use BACKSLASH_IN_FILENAME instead of COLON_IN_FILENAME. (Yasuhiro
            Matsomoto, closes vim/vim#2153)
0b05e491b4
2019-05-07 03:43:47 -04:00
32059526de lint 2019-05-07 03:24:37 -04:00
f4e5cd200a vim-patch:8.1.0133: tagfiles() can have duplicate entries
Problem:    tagfiles() can have duplicate entries.
Solution:   Simplify the filename to make checking for duplicates work better.
            Add a test. (Dominique Pelle, closes vim/vim#2979)
46577b5e54
2019-05-07 03:21:26 -04:00
400ee59247 API: fix cursor position when lines are added #9961
Restore code removed in #9674.
2019-05-07 09:17:37 +02:00
f76792a10b vim-patch:8.0.0876: backslashes and wildcards in backticks don't work
Problem:    MS-Windows: Backslashes and wildcards in backticks don't work.
Solution:   Do not handle backslashes inside backticks in the wrong place.
            (Yasuhiro Matsumoto, closes vim/vim#1942)
39d21e3c30
2019-05-07 03:03:28 -04:00
b3adfa03b7 Merge #9978 from janlazo/vim-8.1.1285
vim-patch:8.1.{1284,1285,1286}
2019-05-07 08:38:18 +02:00
ac1fbc2860 fixup! vim-patch:8.0.1782: no simple way to label quickfix entries 2019-05-06 22:35:45 -04:00
b5539c2044 vim-patch:8.1.1284: detecting *.tmpl as htmlcheetah is outdated
Problem:    Detecting *.tmpl as htmlcheetah is outdated.
Solution:   Use the generic name "template". (closes vim/vim#4348)
d136221129
2019-05-06 22:35:45 -04:00
53d99b9657 vim-patch:8.1.1286: running tests leaves XTest_tabpage_cmdheight file behind
Problem:    Running tests leaves XTest_tabpage_cmdheight file behind.
Solution:   Delete the right file. (closes vim/vim#4350)
4fa06870e5
2019-05-06 22:35:45 -04:00
210d803777 vim-patch:8.1.1285: test17 is old style
Problem:    Test17 is old style.
Solution:   Turn into new style test. (Yegappan Lakshmanan, closes vim/vim#4347)
f0ab01f6d8
2019-05-06 22:35:45 -04:00
5a714c53f2 Merge #9977 from justinmk/pvs 2019-05-06 23:59:43 +02:00
d83a7dc687 Merge #9798 'aucmd_prepbuf: Use floating window' 2019-05-06 23:10:16 +02:00
df9059d1a8 appdata: Include more info #9974
- Configuring the translation domain allows calculating and showing the translation states of each language
- OARS gives Neovim a nice ‘safe for children’ badge
- Releases allow displaying release info/update frequency
2019-05-06 22:11:59 +02:00
b0e3b5cf2e aucmd_win: use a floating window 2019-05-06 16:31:58 +02:00
91547a80b6 lint 2019-05-06 10:02:15 +02:00
e7a8908b11 PVS/V781: "maxlen" variable checked after use
False positive.
2019-05-06 10:02:08 +02:00
fe299a82a6 PVS/V547: Expression is always true
Since 67bac681ea (see msg_multiline_attr()) msg_clr_eos() is always
called.
2019-05-06 10:02:00 +02:00
a52e93dfd8 PVS/V547: Expression is always false 2019-05-06 10:01:57 +02:00
c08ca29649 PVS/V547: Expression is always false 2019-05-06 10:01:49 +02:00
5faed57ac7 PVS/V571: condition was already verified 2019-05-06 08:59:13 +02:00
4658e9c1d9 vim-patch:8.0.1750: crash clearing location list #9968
Problem:    Crash when clearing loccation list in autocommand.
Solution:   Check if "qi" equals "ql_info". (Yegappan Lakshmanan)
3b9474b4ad
2019-05-05 23:18:47 +02:00
4b65a0059a test: cleanup
Avoid hyper-granularity. Don't need subdirectories for every little
thing.
2019-05-05 23:01:35 +02:00
8a1880f041 Merge #9972 from janlazo/vim-8.1.1249
vim-patch:8.1.{613,1046,1249}
2019-05-05 20:04:35 +02:00
9d6c205a33 Merge #9842 from mhinz/vim-8.0.1782
vim-patch:8.0.{1353,1389,1406,1420,1432,1500,1569,1634,1678,1727,1782,1805,1831}
2019-05-05 20:01:27 +02:00
fb02e9f1e9 vim-patch:8.1.1046: the "secure" variable is used inconsistently
Problem:    the "secure" variable is used inconsistently. (Justin M. Keyes)
Solution:   Set it to one instead of incrementing.
82b033eff8
2019-05-05 11:40:19 -04:00
9c6476d81e vim-patch:8.1.0613: when executing an insecure function the secure flag is stuck
Problem:    When executing an insecure function the secure flag is stuck.
            (Gabriel Barta)
Solution:   Restore "secure" instead of decrementing it. (closes vim/vim#3705)
48f377a476
2019-05-05 11:38:21 -04:00
5f903a1648 lint 2019-05-05 14:05:26 +02:00
720cb36cea doc: update setqflist() 2019-05-05 14:05:25 +02:00
1eda387951 tests: adjust to latest Vim patches 2019-05-05 14:05:25 +02:00
daa82cbf69 vim-patch:8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Problem:    Sometimes the quickfix title is incorrectly prefixed with ':'.
Solution:   Prepend the colon in another way. (Yegappan Lakshmanan)

8b62e31003
2019-05-05 13:46:20 +02:00
446bfdd49f vim-patch:8.0.1805: qf_parse_line() is too long
Problem:    qf_parse_line() is too long.
Solution:   Split it in parts.  Properly handle vim_realloc() failing.
            (Yegappan Lakshmanan)

18cebf4417
2019-05-05 13:46:20 +02:00
e6c21c4bc0 vim-patch:8.0.1782: no simple way to label quickfix entries
Problem:    No simple way to label quickfix entries.
Solution:   Add the "module" item, to be used instead of the file name for
            display purposes. (Martin Szamotulski)

d76ce85266
2019-05-05 13:46:19 +02:00
ce0e083094 vim-patch:8.0.1727: qf_get_properties() function is too long
Problem:    qf_get_properties() function is too long.
Solution:   Refactor the code. (Yegappan Lakshmanan)

353eeeaca2
2019-05-05 13:46:19 +02:00
ced3598a96 vim-patch:8.0.1678: errorformat "%r" implies "%>"
Problem:    Errorformat "%r" implies "%>". (Jan Gosmann)
Solution:   Jump to before setting fmt_ptr. (Yegappan Lakshmanan)

e333e79f9b
2019-05-05 13:46:19 +02:00
98a8187764 vim-patch:8.0.1634: the ex_vimgrep() function is too long
Problem:    The ex_vimgrep() function is too long.
Solution:   Split it in smaller functions. (Yegappan Lakshmanan)

75b0a888e4
2019-05-05 13:46:19 +02:00
f75c48146a vim-patch:8.0.1569: warning for uninitialized variable from gcc
Problem:    Warning for uninitialized variable from gcc.
Solution:   Initialize the variable.

28ada699c1
2019-05-05 13:44:50 +02:00
0673b0d251 test/old: set shellslash in Test_finddir 2019-05-04 23:09:25 -04:00
246807b8f4 test/old: enable Test_normal01_keymodel
It works now.
2019-05-04 08:26:41 -04:00
49b0d41c3c vim-patch:8.1.1249: compiler warning for uninitialized variable
Problem:    Compiler warning for uninitialized variable.
Solution:   Initialize it. (Christian Brabandt)
c6b1cc967f
2019-05-03 23:15:06 -04:00
624dbfdd44 vim-patch:8.0.1500: possible NULL pointer dereference
Problem:    Possible NULL pointer dereference. (Coverity)
Solution:   Check for the pointer not being NULL.

0549a1e184
2019-05-04 01:40:11 +02:00
06b70bf1d6 vim-patch:8.0.1432: after ":copen" can't get the window-ID of the quickfix window
Problem:    After ":copen" can't get the window-ID of the quickfix window.
            (FalacerSelene)
Solution:   Make it work without a quickfix list.  Add a test. (Yegappan
            Lakshmanan)

2ec364e94d
2019-05-04 01:40:11 +02:00
dc5f4a3cc2 vim-patch:8.0.1420: accessing freed memory in vimgrep
Problem:    Accessing freed memory in vimgrep.
Solution:   Check that the quickfix list is still valid. (Yegappan Lakshmanan)

3c09722600
2019-05-04 01:40:10 +02:00
37d666bc80 vim-patch:8.0.1406: difficult to track changes to a quickfix list
Problem:    Difficult to track changes to a quickfix list.
Solution:   Add a "changedtick" value. (Yegappan Lakshmanan)

b254af312d
2019-05-04 01:40:00 +02:00
6d314484d4 vim-patch:8.0.1389: getqflist() items are missing if not set
Problem:    getqflist() items are missing if not set, that makes it more
            difficult to handle the values.
Solution:   When a value is not available return zero or another invalid
            value. (Yegappan Lakshmanan)

a6d4849c71
2019-05-03 23:36:51 +02:00
f3b88013a8 vim-patch:8.0.1353: QuickFixCmdPost is not used consistently
Problem:    QuickFixCmdPost is not used consistently.
Solution:   Invoke QuickFixCmdPost consistently after QuickFixCmdPre.
            (Yegappan Lakshmanan)

1ed2276fd5
2019-05-03 23:36:47 +02:00
6891d8aeca Merge #9970 from janlazo/vim-8.1.0794
vim-patch:8.0.1708,8.1.{369,794,1242}
2019-05-03 11:03:49 +02:00
96a8b0ab78 vim-patch:8.1.0369: continuation lines cannot contain comments
Problem:    Continuation lines cannot contain comments.
Solution:   Support using "\ .
67f8ab8299
2019-05-03 02:08:18 -04:00
4b287119fe vim-patch:8.0.1708: mkdir with 'p' flag fails on existing directory
Problem:    Mkdir with 'p' flag fails on existing directory, which is
            different from the mkdir shell command.
Solution:   Don't fail if the directory already exists. (James McCoy,
            closes vim/vim#2775)
78a16b0f2a
2019-05-03 00:55:56 -04:00
56bae9b7d9 lint 2019-05-02 22:47:04 -04:00
049321c357 vim-patch:8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Problem:    No cmdline redraw when tabpages have different 'cmdheight'.
Solution:   redraw the command line when 'cmdheight' changes when switching
            tabpages. (closes vim/vim#4321)
0fef0aeb1c
2019-05-02 22:43:02 -04:00
31755783e3 vim-patch:8.1.0794: white space before " -Ntabmove" causes problems
Problem:    White space before " -Ntabmove" causes problems.
Solution:   Skip whitespace. (Ozaki Kiichi, closes vim/vim#3841)
82a12468bd
2019-05-02 22:40:10 -04:00
9d58a58980 Merge #9966 from justinmk/te-hl
terminal: swap priority of terminal, editor highlights
2019-05-02 22:52:28 +02:00
660fe979c1 terminal.c: remove unnecessary macro 2019-05-02 21:59:15 +02:00
49c51f839b ex_getln: fix statusline redraw logic #9967
fixes #9908
2019-05-02 11:38:21 +02:00
fd0fd752c8 terminal: swap priority of terminal, editor highlights
closes #9964
2019-05-02 09:56:22 +02:00
53cef34f16 Merge #9946 from justinmk/doc 2019-05-01 00:22:17 +02:00
c11e618133 gen_vimdoc.py: support <pre> preformatted text [ci skip] 2019-05-01 00:18:49 +02:00
afd947e0c3 doc [ci skip]
ref #9886
2019-05-01 00:18:43 +02:00
e22c475156 Merge #9951 'vim-patch:8.1.0519: save/restore tag stack' 2019-04-30 23:41:34 +02:00
8342b4486b Merge #9957 from janlazo/vim-8.0.1263
vim-patch:8.0.{1263,1265,1267}
2019-04-30 12:24:56 +02:00
0e7048ae05 lint 2019-04-30 05:13:06 -04:00
c3edbf813a vim-patch:8.0.1267: Test_swap_group may leave file behind
Problem:    Test_swap_group may leave file behind.
Solution:   Add a try/finally.
5842a748be
2019-04-29 20:59:51 -04:00
3a8ebda10a vim-patch:8.0.1265: swap test not skipped when there is one group
Problem:    Swap test not skipped when there is one group.
Solution:   Convert list to string for the message.
ad7dac85c3
2019-04-29 20:48:18 -04:00
0cecf9f121 vim-patch:8.0.1263: others can read the swap file if a user is careless
Problem:    Others can read the swap file if a user is careless with his
            primary group.
Solution:   If the group permission allows for reading but the world
            permissions doesn't, make sure the group is right.
5a73e0ca54
2019-04-29 20:47:49 -04:00
63526f2eee Merge #9956 from justinmk/vim-8.1.1231
vim-patch:8.1.1231, swap-related patches
2019-04-30 01:26:33 +02:00
aac731c22b vim-patch:8.1.0642: swapinfo() leaks memory
Problem:    swapinfo() leaks memory.
Solution:   Avoid allocating the strings twice.
e6fdf79980
2019-04-29 22:41:16 +02:00
a01246c275 lint 2019-04-29 21:37:22 +02:00
7032562faf vim-patch:8.1.1234: swap file test fails on MS-Windows
Problem:    Swap file test fails on MS-Windows.
Solution:   Only compare the tail of the file names.
701df4eb64
2019-04-29 21:22:55 +02:00
7f8f6ac8d7 test/old: skip Test_swapfile_delete() until "blob" is merged 2019-04-29 21:22:55 +02:00
8cf7daaaa8 verb_msg: remove char_u 2019-04-29 21:22:55 +02:00
3033b5a70a vim-patch:8.1.1231: asking about existing swap file unnecessarily
Problem:    Asking about existing swap file unnecessarily.
Solution:   When it is safe, delete the swap file.  Remove
            HAS_SWAP_EXISTS_ACTION, it is always defined. (closes vim/vim#1237)
67cf86bfff

N/A:
vim-patch:8.1.1232
vim-patch:8.1.1233
vim-patch:8.1.1236
2019-04-29 21:22:55 +02:00
04f0bc97b7 vim-patch:8.1.0401: can't get swap name of another buffer
Problem:    Can't get swap name of another buffer.
Solution:   Add swapname(). (Ozaki Kiichi, closes vim/vim#3441)
110bd60985
2019-04-29 21:19:45 +02:00
035a41c218 vim-patch:8.1.0325: strings in swap file may not be NUL terminated
Problem:    Strings in swap file may not be NUL terminated. (Coverity)
Solution:   Limit the length of the used string.
7c60505e10
2019-04-29 21:19:45 +02:00
3a92040b44 vim-patch:8.1.0316: swapinfo() test fails on Travis
Problem:    swapinfo() test fails on Travis.
Solution:   Handle a long host name. (Ozaki Kiichi, closes vim/vim#3361)
            Also make the version check flexible. (James McCoy)
4c5765bc47
2019-04-29 21:19:45 +02:00
39e3783c69 vim-patch:8.1.0314: add swapinfo() "dirty" item
Problem:    Build failure without the +eval feature. (Brenton Horne)
Solution:   Add #ifdef.  Also add the "dirty" item.
47ad5656e1
2019-04-29 21:19:45 +02:00
24b7462b3c vim-patch:8.1.0313: information about a swap file is unavailable
Problem:    Information about a swap file is unavailable.
Solution:   Add swapinfo(). (Enzo Ferber)
00f123a565
2019-04-29 19:55:42 +02:00
a0d723db55 vim-patch:8.0.1563: getwinposx() timeout #9955
Problem:    Timeout of getwinposx() can be too short. (lilydjwg)
Solution:   Add getwinpos(). (closes vim/vim#2689)
3f54fd319f
2019-04-29 11:53:44 +02:00
8aca932aa0 clipboard: setreg("*") with clipboard=unnamed #9954
Helped-by: Björn Linse <bjorn.linse@gmail.com>
fix #5646
2019-04-28 21:06:24 +02:00
fb6ff2a593 lint 2019-04-28 19:58:13 +01:00
c76c798bf6 vim-patch:8.1.0843: memory leak when running "make test_cd" #9944
closes #9921
reverts f0a702d116

Problem:    Memory leak when running "make test_cd".
Solution:   Free the stack element when failing. (Dominique Pelle,
            closes vim/vim#3877)
e0de2164f6
2019-04-28 16:54:00 +02:00
33b20ce7de tui:cursor_goto(): remove dead code #9952
fix #9918
ref dbc25f5a87

Before 7ede14d191 the UGRID_FOREACH_CELL loop was never entered,
because it expanded to an always-false condition.
From build/src/nvim/auto/tui/tui.i:
    do {
      UCell *row_cells = (grid)->cells[grid->row];
      for (int col = grid->col; col < col; col++) {
        UCell *cell = row_cells + col;
        (void)(cell);
        {
          print_cell(ui, cell);
        };
      }
    } while (0);

After 7ede14d191 issue #9918 was reported.

    $ ./build/bin/nvim -Nu NONE +'colo evening'
    :h<tab>  " causes cursor to change colors

Since the code was dead before 7ede14d191, just remove it.
2019-04-28 16:19:36 +02:00
fbd6666a06 runtime/Tutor: define highlights as "default" #9947 2019-04-28 12:55:38 +02:00
924dd6f14a vim-patch:8.1.0519: cannot save and restore the tag stack
Problem:    Cannot save and restore the tag stack.
Solution:   Add gettagstack() and settagstack(). (Yegappan Lakshmanan,
            closes vim/vim#3604)
f49cc60aa8
2019-04-28 11:37:19 +01:00
8072f085d2 win: stream_init() issue with tty on Windows #9884
ref #9825
2019-04-28 11:46:48 +02:00
cf80fd9e02 Merge #9911 from justinmk/win-site-data
win/defaults: Use "…/nvim-data/site" in 'runtimepath'
2019-04-28 09:16:02 +02:00
070d9261b6 test/old: remove test16 (#9949)
Vim replaced it with a test in test_gui.vim, N/A for Neovim.
2019-04-28 08:55:13 +02:00
769f44e918 win/defaults: Use "…/nvim-data/site" in 'runtimepath'
On Windows we store non-config data in "$XDG_DATA_HOME/nvim-data". But
the "…/site" items in 'runtimepath' did not correctly point to that
location, they used "…/nvim/site".

Fix the init logic to use  "…/nvim-data/site".

closes #9910
2019-04-28 00:27:07 +02:00
f86f0a8bc7 vim-patch:8.1.1214: old style tests #9948
Problem:    Old style tests.
Solution:   Move tests from test14 to new style test files. (Yegappan
            Lakshmanan, closes vim/vim#4308)
c6b37db1ba
2019-04-27 21:45:53 +02:00
83d571653b spellfile.vim: store files in stdpath('data')
ref b9b2fb7d5d #6664 #6272
2019-04-27 21:34:54 +02:00
1039e0621d doc/API #9916 2019-04-27 17:28:18 +02:00
920ec8181b Merge #9915 'test: clear(): args_rm param' 2019-04-27 17:11:34 +02:00
698c4f662d test: clear(): remove opts.headless parameter
Callers can instead specify `args_rm={'--headless'}`.

TODO: should `nvim_argv` have "--headless" by default? Need to inspect
      some uses of spawn(nvim_argv) ...
2019-04-27 16:31:26 +02:00
17291642bd test: clear(): args_rm parameter 2019-04-27 16:19:40 +02:00
f0a7e3fc9a test: 'shadafile' default
ref 773bdd41ec
2019-04-27 16:19:40 +02:00
e5b53381a2 Merge #9942 from janlazo/vim-8.1.0837
vim-patch:8.1.{837,1180,1194,1203,1207,1209}
2019-04-27 14:27:55 +02:00
16cc3cf9eb test/old: remove test.out files
Do this for new-style tests too, because they run after the old-style
tests which don't clean up their temp files.

Reverts ebd251c
2019-04-27 11:07:26 +02:00
6a9a729674 vim-patch:8.1.1209: clever compiler warns for buffer being too small
Problem:    Clever compiler warns for buffer being too small.
Solution:   Make the buffer bigger (even though it's not really needed).
5431589d25
2019-04-27 00:13:46 -04:00
66d86d8bdb vim-patch:8.1.1207: some compilers give warning messages
Problem:    Some compilers give warning messages.
Solution:   Initialize variables, change printf() argument. (Christian
            Brabandt, closes vim/vim#4305)
1f3601e92e
2019-04-27 00:00:51 -04:00
2e339807ac vim-patch:8.1.1180: Vim script debugger tests are old style
Problem:    Vim script debugger tests are old style.
Solution:   Turn into new style tests. (Yegappan Lakshmanan, closes vim/vim#4259)
113bf0672b
2019-04-26 23:40:29 -04:00
ebd251cdf0 oldtests: pass Test_ReadWrite_Autocmds() 2019-04-26 23:40:29 -04:00
18fddad48b vim-patch:8.1.1203: some autocmd tests are old style
Problem:    Some autocmd tests are old style.
Solution:   Turn the tests into new style. (Yegappan Lakshmanan, closes vim/vim#4295)
69ea587289
2019-04-26 07:05:55 -04:00
7d90b90d63 vim-patch:8.1.1194: typos and small problems in source files
Problem:    Typos and small problems in source files.
Solution:   Small fixes.
ad3ec76bb8
2019-04-26 07:01:18 -04:00
ed6c7fbf0b vim-patch:8.1.0837: timer interrupting cursorhold and mapping not tested
Problem:    Timer interrupting cursorhold and mapping not tested.
Solution:   Add tests with timers. (Ozaki Kiichi, closes vim/vim#3871)
26d982185e
2019-04-26 00:02:12 -04:00
9d77a07686 vim-patch:8.0.1510: cannot assert beep #9938
Problem:    Cannot test if a command causes a beep.
Solution:   Add assert_beeps().
b48e96f61c
2019-04-25 14:31:33 +02:00
24a9516ff4 Merge #9906 from janlazo/vim-8.0.0647
vim-patch:8.0.{647,768,797,1085,1092,1107,1133,1408}
2019-04-24 11:23:32 +02:00
8c6f5b7f92 Spurious quote mark in command line when typing <C-R> (#9934)
Remove <C-R> special char after reading following chars
2019-04-24 10:41:07 +02:00
37c7c964ae vim-patch:8.0.1408: crash in setqflist()
Problem:    Crash in setqflist().
Solution:   Check for string to be NULL. (Dominique Pelle, closes vim/vim#2464)
a0ca7d002d
2019-04-23 00:03:48 -04:00
439bbe00ec vim-patch:8.0.0768: terminal window status shows "[Scratch]"
Problem:    Terminal window status shows "[Scratch]".
Solution:   Show "[Terminal]" when no title was set. (Yasuhiro Matsumoto)
            Store the terminal title that vterm sends and use it.  Update the
            special buffer name.  (closes vim/vim#1869)
2155441460
2019-04-23 00:03:48 -04:00
3bc8639c1a vim-patch:8.0.0797: finished job in terminal window is not handled
Problem:    Finished job in terminal window is not handled.
Solution:   Add the scrollback buffer.  Use it to fill the buffer when the job
            has ended.
d85f271bf8
2019-04-23 00:03:48 -04:00
6dacfe7217 vim-patch:8.0.1133: syntax timeout not used correctly
Problem:    Syntax timeout not used correctly.
Solution:   Do not pass the timeout to syntax_start() but set it explicitly.
            (Yasuhiro Matsumoto, closes vim/vim#2139)
f3d769a585
2019-04-23 00:03:48 -04:00
b8128aee02 vim-patch:8.0.1107: terminal debugger jumps to non-existing file
Problem:    Terminal debugger jumps to non-existing file.
Solution:   Check that the file exists.  Add an option to make the Vim wide
            wide. Fix removing highlight groups.
38baa3e634
2019-04-23 00:03:47 -04:00
e6f22d0fdd vim-patch:8.0.1092: terminal debugger can't evaluate expressions
Problem:    Terminal debugger can't evaluate expressions.
Solution:   Add :Evaluate and K.  Various other improvements.
45d5f26d11
2019-04-23 00:03:47 -04:00
9e9015ee23 vim-patch:8.0.1085: terminal debugger can't set breakpoints
Problem:    The terminal debugger can't set breakpoints.
Solution:   Add :Break and :Delete commands.  Also commands for stepping
            through code.
e09ba7bae5
2019-04-23 00:03:47 -04:00
bbc32fc831 lint 2019-04-23 00:03:47 -04:00
07a182c6b5 vim-patch:8.0.0647: syntax highlighting can make cause a freeze
Problem:    Syntax highlighting can make cause a freeze.
Solution:   Apply 'redrawtime' to syntax highlighting, per window.
06f1ed2f78
2019-04-23 00:03:47 -04:00
eada8f5aaa Merge pull request #9871 from justinmk/doc 2019-04-22 21:34:46 +02:00
c1887f465d gen_vimdoc.py: skip "Parameters" header if all excluded 2019-04-22 21:24:46 +02:00
d0fd66ba82 health/provider.vim: check curl HTTPS support
closes #9925
closes #9928
2019-04-22 21:05:39 +02:00
544305e802 doc: clarify -Es 2019-04-22 20:56:16 +02:00
eabe7d95f8 doc: UI 2019-04-22 20:56:16 +02:00
4d97abe805 doc 2019-04-22 20:56:16 +02:00
43356a43d0 health: check if tmux enabled true colors (#9929)
References https://github.com/neovim/neovim/issues/7764
2019-04-20 19:02:19 +02:00
3f71218505 Merge pull request #9926 from glacambre/fix_9889
Fix #9889: stopinsert prohibiting terminal mode
2019-04-20 10:46:20 +02:00
b3fd83a0ea Reset stop_insert_mode in terminal_enter rather than terminal_check
Problem: Using `:stopinsert` while in normal mode in a terminal buffer
prevents neovim from entering insert mode.

Solution: Move `stop_insert_mode = false` from terminal_check to
terminal_enter to be consistent with edit.c, as suggested by bfredl in
 #9889.

Closes https://github.com/neovim/neovim/issues/9889.
2019-04-20 10:41:46 +02:00
477e1a8648 vim-patch:8.1.1177: .ts files are recognized as xml, typescript is more common (#9922)
Problem:    .ts files are recognized as xml, while typescript is more common.
Solution:   Recognize .ts files as typescript.

1a4dce7cad
2019-04-19 12:06:23 +02:00
773bdd41ec options: avoid using empty 'shadafile'
References https://github.com/neovim/neovim/pull/9907
Fixes https://github.com/neovim/neovim/issues/9912
2019-04-16 20:00:32 +02:00
aa82f8b88f vim-patch:8.0.0716: "--clean", 'shadafile' #9907
Nvim notes:
- Nvim does not support "-u DEFAULTS", that change is omitted.
- Also add 'shadafile' as an alias to 'viminfofile'.
- Deprecate 'viminfofile'.

Problem:    Not easy to start Vim cleanly without changing the viminfo file.
            Not possible to know whether the -i command line flag was used.
Solution:   Add the --clean command line argument.  Add the 'viminfofile'
            option.  Add "-u DEFAULTS".
c4da113ef9
2019-04-15 21:15:36 +02:00
987619ddd7 Merge pull request #9902 from janlazo/vim-8.0.0761
vim-patch:8.0.{761,776,1093,1112}
2019-04-15 07:11:10 +02:00
7b219c638d vim-patch:8.0.1112: can't get size or current index from quickfix list
Problem:    Can't get size or current index from quickfix list.
Solution:   Add "idx" and "size" options. (Yegappan Lakshmanan)
fc2b270cfd
2019-04-14 20:25:42 -04:00
e52f6f21a1 vim-patch:8.0.1093: various small quickfix issues
Problem:    Various small quickfix issues.
Solution:   Remove ":" prefix from title set by a user. Add the qf_id2nr().
            function. Add a couple more tests.  Update documentation.
            (Yegappan Lakshmanan)
b4d5fbabc9
2019-04-14 19:09:19 -04:00
6de1ed1ff1 vim-patch:8.0.0776: function prototypes missing without the quickfix feature
Problem:    Function prototypes missing without the quickfix feature. (Tony
            Mechelynck)
Solution:   Move non-quickfix functions to buffer.c.
f0a521f4f7
2019-04-14 19:09:19 -04:00
8f2175e7d0 vim-patch:8.0.0761: options not set properly for a terminal buffer
Problem:    Options of a buffer for a terminal window are not set properly.
Solution:   Add "terminal" value for 'buftype'.  Make 'buftype' and
            'bufhidden' not depend on the quickfix feature.
            Also set the buffer name and show "running" or "finished" in the
            window title.
1f2903c431
2019-04-14 19:09:19 -04:00
d81b510ecf Merge pull request #9904 from bryant/pass-cc-cxx-to-gperf-build
Configure gperf to build with `CMAKE_C{XX}_COMPILER`.
2019-04-14 16:55:35 +02:00
0be8fb47a4 Merge pull request #9898 from bfredl/floatwidth
windows: float config changes
2019-04-14 13:35:11 +02:00
5613310538 Build gperf with configured host compiler.
This was initially added but unused in
7e2348f2b1, which led to its accidental
removal in feee814b30.
2019-04-14 03:01:14 -07:00
6222c74235 Set host C++ compiler CMake var. 2019-04-14 03:01:14 -07:00
9ddf99172c Merge pull request #9783 from justinmk/inccommand-ignore-redraw 2019-04-14 11:25:24 +02:00
c8acbe3b62 windows: float config changes
- Allow floating windows of width 1. #9846
- For a new floating window the size must be specified. Later on we
  might try to calculate a reasonable size by buffer contents
- Remember the configured size of a window, just like its position.
- Make get_config and set_config more consistent. Handle relative='' properly in set_config.
  get_config doesn't return keys that don't make sense for a non-floating window.
- Don't use width=0 for non-changed width, just omit the key.
2019-04-14 10:12:09 +02:00
0b8fc2742b inccommand: Disable K_EVENT during preview calculation
'inccommand' invokes ex_substitute() to build its "preview". During the
brief (~millisecond) time it takes to execute that function, the buffer
is "dirty" (its contents are invalid). Events must not be handled during
this time, else they would see a temporary state which is not the true,
logical state of the buffer.

ref #9777
2019-04-14 02:22:19 +02:00
dd9554a820 inccommand: Ignore :redraw during preview
closes #9777
2019-04-14 02:22:19 +02:00
2c34a10aa2 Merge pull request #9900 from mhinz/vim-8.0.1104
vim-patch:8.0.{1104,1130}
2019-04-14 00:15:35 +02:00
a0da692fce chdir: remove unused argument #9901 2019-04-14 00:08:18 +02:00
34f9e72af9 vim-patch:8.0.1130: the qf_jump() function is still too long
Problem:    The qf_jump() function is still too long.
Solution:   Split of parts to separate functions. (Yegappan Lakshmanan)

9cb03716c9
2019-04-13 21:25:40 +02:00
ace826e685 vim-patch:8.0.1104: the qf_jump() function is too long
Problem:    The qf_jump() function is too long.
Solution:   Split of parts to separate functions. (Yegappan Lakshmanan)

ef6b8de42f
2019-04-13 21:25:40 +02:00
82d48c0dab Merge pull request #9896 from justinmk/api-async-error
API: emit nvim_error_event on failed async request
2019-04-13 19:53:09 +02:00
cfe7f896b8 Merge pull request #9895 from janlazo/vim-8.1.1156
vim-patch:8.1.{1156,1157}
2019-04-13 19:49:17 +02:00
1d27a27656 generators: fix filename typo in help message 2019-04-13 12:08:44 -04:00
7e1591e06a API: emit nvim_error_event on failed async request
We already do this for _invalid_ async requests #9300.
Now we also do it for failed invocation of valid requests.
2019-04-13 17:07:58 +02:00
5f996e36d1 options: properly reset directories on 'autochdir' (#9894)
Fixes https://github.com/neovim/neovim/issues/9892
2019-04-13 12:50:36 +02:00
09120df890 lint 2019-04-12 23:44:31 -04:00
9eb5512082 vim-patch:8.1.1157: Unicode tables are out of date
Problem:    Unicode tables are out of date.
Solution:   Update to Unicode 12. (Christian Brabandt, closes vim/vim#4240)
f9b89b4679
2019-04-12 20:07:13 -04:00
210fa1e02d vim-patch:8.1.1156: Unicode emoji and other image characters not recognized
Problem:    Unicode emoji and other image characters not recognized.
Solution:   Add ranges for musical notation, game pieces, etc. (Martin
            Tournoij, closes vim/vim#4238)
d489c9801b
2019-04-12 19:55:11 -04:00
d08692a824 options: comma-separated options don't allow duplicates (#9891)
Closes https://github.com/neovim/neovim/issues/9890
2019-04-12 16:14:01 +02:00
3b7a4f233b vim-patch:8.0.0714: cmdline redraw during timer #9835
vim-patch:8.0.0714: when a timer causes a command line redraw " goes missing
Problem:    When a timer causes a command line redraw the " that is displayed
            for CTRL-R goes missing.
Solution:   Remember an extra character to display.
a92522fbf3

vim-patch:8.0.0720: unfinished mapping not displayed when running timer
Problem:    Unfinished mapping not displayed when running timer.
Solution:   Also use the extra_char while waiting for a mapping and digraph.
            (closes vim/vim#1844)
6a77d2667e

close #9835
2019-04-12 03:20:05 +02:00
e11a9d351a Merge pull request #9887 from justinmk/chan-notif-response-id
RPC: eliminate NO_RESPONSE
2019-04-12 03:12:08 +02:00
8dbf23181a RPC: conform message-id type to msgpack-RPC spec
According to [MessagePack RPC specification](https://github.com/msgpack-rpc/msgpack-rpc),
message ID must be 32-bit unsigned integer. But Neovim implementation
uses uint64_t instead of uint32_t. This can have wrong results in the
case of large ids or a malformed request, for example:

    Actual response:   [1,18446744073709551615,[1,"Message is not an array"],null]
    Expected response: [1,4294967295,[1,"Message is not an array"],null]

The issue does not affect RPC clients written in dynamically-typed
languages like Python. Wrong type of sequence id number breaks RPC
clients written statically typed languages like C/C++/Golang: all of
them expect uint32_t as message id.
Examples:
  11268ba2be/src/msgpack/rpc/protocol.h (L27)
  https://github.com/ugorji/go/blob/master/codec/msgpack.go#L993

closes #8850
2019-04-12 02:31:46 +02:00
fd00806f01 RPC: eliminate NO_RESPONSE
Using a sentinel value in the response-id is ambiguous because the
msgpack-rpc spec allows all values (including zero/max). And clients
control the id, so we can't be sure they won't use the sentinel value.

Instead of a sentinel value, check the message type explicitly.

ref #8850
2019-04-12 02:30:31 +02:00
b4ca56d96d PVS/V595: pointer utilized before checking NULL 2019-04-12 00:41:20 +02:00
49ca20aaf3 vim-patch.sh: perf, readability #9044
closes #9044
2019-04-12 00:28:02 +02:00
ae88e46563 float: always change to valid windows (#9878)
Using `:wincmd j` and friends doesn't make much sense to a floating window. For
convenience though, any direction will simply change to the previous window.

Make sure the previous window is valid, not the current window, and not another
floating window. Change to the first window (which is never a floating window)
otherwise.
2019-04-11 20:20:17 +02:00
b358054694 Merge pull request #9880 from janlazo/vim-8.0.0725
closes #9879
2019-04-11 13:31:05 +02:00
5cf96fc141 ops: use ARRAY_SIZE macro for opchars array length 2019-04-10 22:09:59 -04:00
d8d4f05564 vim-patch:8.0.1411: reading invalid memory with CTRL-W :
Problem:    Reading invalid memory with CTRL-W :.
Solution:   Correct the command characters. (closes vim/vim#2469)
2efb323e87
2019-04-10 20:38:16 -04:00
de2e86a698 vim-patch:8.0.0725: a terminal window does not handle keyboard input
Problem:    A terminal window does not handle keyboard input.
Solution:   Add terminal_loop().  ":term bash -i" sort of works now.
938783d0ab
2019-04-10 20:34:39 -04:00
21b108fe44 vim-patch:8.1.1140: not easy to find out what neighbors a window has (#9873)
Problem:    Not easy to find out what neighbors a window has.
Solution:   Add more arguments to winnr(). (Yegappan Lakshmanan)

46ad288b9b
2019-04-10 10:16:32 +02:00
ddd0eb6f51 startup: -es/-Es (silent/batch mode): skip swapfile #8540
To use Nvim as a scripting engine the side-effects of swapfiles and user
config should be avoided by default.
2019-04-10 03:27:25 +02:00
9daa7d9978 version.c: update [ci skip]
closes #9489

vim-patch:8.0.0210: no support for bracketed paste
vim-patch:8.0.0228: pasting in xterm on the command line has PasteStart
vim-patch:8.0.0230: bracketed paste does not support line breaks
vim-patch:8.0.0506: can't build with ANSI C
vim-patch:8.0.0506: can't build with ANSI C
vim-patch:8.0.0569: ?
vim-patch:8.0.0592:
vim-patch:8.0.0693: no terminal emulator support
vim-patch:8.0.0694: building in shadow directory does not work
vim-patch:8.0.0698: crash on exit when using Python function in timer.
vim-patch:8.0.0712: the terminal implementation is incomplete
vim-patch:8.0.0713: 'termkey' option not fully implemented
vim-patch:8.0.0713: 'termkey' option not fully implemented (follow-up to vim-patch:8.0.0712)
vim-patch:8.0.0717: terminal feature precence unclear
vim-patch:8.0.0718: output of job in terminal is not displayed
vim-patch:8.0.0730: terminal feature only supports Unix-like systems
vim-patch:8.0.0738: cannot use the mouse to resize a terminal window
vim-patch:8.0.0739: terminal resizing doesn't work well.
vim-patch:8.0.0740: cannot resize a terminal window by the command
vim-patch:8.0.0742: terminal feature does not work on MS-Windows
vim-patch:8.0.0743: the 'termsize' option can be set to an invalid value
vim-patch:8.0.0744: terminal window does not use a pty
vim-patch:8.0.0745: multi-byte characters in a terminal don't display well
vim-patch:8.0.0746: when :term fails the job is not properly cleaned up
vim-patch:8.0.0747: :terminal without an argument doesn't work
vim-patch:8.0.0748: running Vim in terminal window doesn't use the right colors
vim-patch:8.0.0753: no size reports to a job running in a terminal
vim-patch:8.0.0758: possible crash when using a terminal window
vim-patch:8.0.0759: MS-Windows: terminal does not adjust size
vim-patch:8.0.0771: cursor in terminal window not always updated in GUI
vim-patch:8.0.0778: in a terminal the cursor may be hidden
vim-patch:8.0.0799: missing semicolon
vim-patch:8.0.0802: last line of terminal window has no color
vim-patch:8.0.0804: running tests fails when stdin is /dev/null
vim-patch:8.0.0812: terminal window colors shift when 'number' is set
vim-patch:8.0.0840: MS-Windows: fopen() and open() prototypes are wrong
vim-patch:8.0.0843: MS-Windows: compiler warning for signed/unsigned
vim-patch:8.0.0844: wrong function prototype because of missing static
vim-patch:8.0.0853: crash when running terminal with unknown command
vim-patch:8.0.0871: status line for a terminal window always has "[+]".
vim-patch:8.0.0872: no mouse scroll with a terminal window
vim-patch:8.0.0886: crash when using ":term ls"
vim-patch:8.0.0903: early return from test function
vim-patch:8.0.0915: wrong initialisation of global
vim-patch:8.0.0950: MS-Windows: wrong #ifdef, compiler warnings
vim-patch:8.0.0951: another wrong #ifdef
vim-patch:8.0.0969: Coverity warning for unused return value
vim-patch:8.0.1003: 64 bit compiler warning
vim-patch:8.0.1005: terminal without job updates slowly in GUI
vim-patch:8.0.1018: warnings from 64-bit compiler
vim-patch:8.0.1079: memory leak when remote_foreground() fails
vim-patch:8.0.1128: old xterm sends CTRL-X in response to t_RS
vim-patch:8.0.1132: #if condition is not portable
vim-patch:8.0.1137: cannot build with Ruby
vim-patch:8.0.1143: macros always expand to the same thing
vim-patch:8.0.1145: warning when compiling with Perl
vim-patch:8.0.1182: cannot see or change mzscheme dll name
vim-patch:8.0.1199: when 'clipboard' is "autoselectplus" star register is set
vim-patch:8.0.1299: bracketed paste does not work well in terminal window
vim-patch:8.0.1545: screen dumps not included in distribution
vim-patch:8.0.1548: screen dump test script not included in distribution
vim-patch:8.0.1658: capitalize argument not available in long form
vim-patch:8.0.1693: xxd is excluded from coverage statistics
vim-patch:8.1.0363: internal diff isn't used by default as advertised
vim-patch:8.1.0443: unnecessary static function prototypes
vim-patch:8.1.0549: netbeans test depends on README.txt contents
vim-patch:8.1.0713: images for NSIS take up too much space
vim-patch:8.1.0714: unessesary #if lines in GTK code
vim-patch:8.1.0727: compiler warning for sprintf() argument
vim-patch:8.1.0733: too many #ifdefs for the multi-byte feature
vim-patch:8.1.0764: list of distributed files is outdated
vim-patch:8.1.0776: Travis does not build a version without GUI on Linux
vim-patch:8.1.0841: travis config to get Lua on MacOS is too complicated
vim-patch:8.1.0869: Travis CI script is too complicated
vim-patch:8.1.0873: list if distributed files does not include matchit autoload
vim-patch:8.1.0886: compiler warning for NULL pointer and condition always true
vim-patch:8.1.0916: with Python 3.7 "find_module" is not made available
vim-patch:8.1.0930: typo in Makefile
vim-patch:8.1.0943: still a trace of Farsi support
vim-patch:8.1.0944: format of nbdbg() arguments is not checked
vim-patch:8.1.0946: Coveralls is not very useful
vim-patch:8.1.0947: using MSWIN before it is defined
vim-patch:8.1.0948: when built without +eval "Vim --clean" produces errors
vim-patch:8.1.0949: MS-windows defines GUI macros different than other systems
vim-patch:8.1.0952: compilation warnings when building the MS-Windows installer
vim-patch:8.1.0955: matchit autoload directory not in installer
vim-patch:8.1.0976: dosinstall still has buffer overflow problems
vim-patch:8.1.0978: blob not tested with Perl
vim-patch:8.1.0979: compiler warning for unused functions
vim-patch:8.1.0983: checking CYGWIN32 unnecessarily
vim-patch:8.1.0984: unnecessary #ifdefs
vim-patch:8.1.0987: unnecessary condition in #ifdef
vim-patch:8.1.0991: cannot build with a mix of features
vim-patch:8.1.0996: a few screendump tests fail because of scrolling
vim-patch:8.1.1008: MS-Windows: HAVE_STDINT_H only defined for non-debug version
vim-patch:8.1.1009: MS-Windows: some text is not baseline aligned
vim-patch:8.1.1010: Lua interface leaks memory
vim-patch:8.1.1014: MS-Windows: /analyze only defined for non-debug version
vim-patch:8.1.1020: compiler warning for Python3 interface
vim-patch:8.1.1021: pyeval() and py3eval() leak memory
vim-patch:8.1.1029: DirectWrite doesn't take 'linespace' into account
vim-patch:8.1.1034: too many #ifdefs
vim-patch:8.1.1039: MS-Windows build fails
vim-patch:8.1.1040: FEAT_TAG_ANYWHITE is not enabled in any build
vim-patch:8.1.1048: minor issues with tests
vim-patch:8.1.1050: blank srceen when DirectWrite failed
vim-patch:8.1.1054: not checking return value of ga_grow()
vim-patch:8.1.1057: nsis config is too complicated
vim-patch:8.1.1059: MS-Windows: PlatformId() is called unnecessarily
vim-patch:8.1.1060: MS-Windows: get_cmd_args() is no longer needed
vim-patch:8.1.1064: no test for output conversion in the GTK GUI
vim-patch:8.1.1065: no test for using and deleting menu in the GUI
vim-patch:8.1.1066: VIMDLL isn't actually used
vim-patch:8.1.1067: issues added on github are unstructured
vim-patch:8.1.1069: source README file doesn't look nice on github
vim-patch:8.1.1070: issue templates are not good enough
vim-patch:8.1.1075: function reference count wrong in Python code
vim-patch:8.1.1081: MS-Windows: cannot use some fonts
vim-patch:8.1.1092: setting 'guifont' when maximized resizes the Vim window
vim-patch:8.1.1096: MS-Windows: cannot distinguish BS and CTRL-H
vim-patch:8.1.1097: Motif build fails
vim-patch:8.1.1104: MS-Windows: not all environment variables can be used
vim-patch:8.1.1105: long escape sequences may be split up
vim-patch:8.1.1109: deleted file still in list of distributed files
vim-patch:8.1.1117: build failure without the +eval feature
vim-patch:8.1.1119: no support for Windows on ARM64
vim-patch:8.1.1126: build failure with +terminal but without tgetent
vim-patch:8.1.1135: build failure for small version
vim-patch:8.1.1138: plugins don't get notified when the popup menu changes
2019-04-10 01:46:21 +02:00
9d085c75ff vim-patch:8.0.0702: error in a timer can make Vim unusable #9826
Problem:    An error in a timer can make Vim unusable.
Solution:   Don't set the error flag or exception from a timer.  Stop a timer
            if it causes an error 3 out of 3 times.  Discard an exception
            caused inside a timer.
c577d813b7

closes #9826
2019-04-10 00:50:51 +02:00
ae2401621a ci/build.ps1: Respect CMAKE_BUILD_TYPE if provided #9869 2019-04-09 00:17:07 +02:00
d5fd0732e0 Merge pull request #9859 from jamessan/gcc-9-compound-literal
Make SHM_ALL to a variable instead of a compound literal #define
2019-04-08 21:57:43 +02:00
2a6ccfccac Merge pull request #9868 from mhinz/vim-8.1.1118
vim-patch:8.1.1118: a couple of conditions are hard to understand
2019-04-08 21:54:18 +02:00
d48362fc8d Merge pull request #9867 from mhinz/vim-8.1.1134
vim-patch:{8.0.1763,8.1.1134}
2019-04-08 21:51:05 +02:00
e6101b4963 vim-patch:8.1.1118: a couple of conditions are hard to understand
Problem:    A couple of conditions are hard to understand.
Solution:   Split the conditions into pieces. (Ozaki Kiichi)

652de23dc7
2019-04-08 21:00:31 +02:00
7381c93e2c vim-patch:8.1.1134: buffer for quickfix window is reused for another file
Problem:    Buffer for quickfix window is reused for another file.
Solution:   Don't reuse the quickfx buffer. (Yegappan Lakshmanan)

39803d82db
2019-04-08 20:02:08 +02:00
a8d0062c67 vim-patch:8.0.1763: :argedit does not reuse an empty unnamed buffer
Problem:    :argedit does not reuse an empty unnamed buffer.
Solution:   Add the BLN_CURBUF flag and fix all the side effects. (Christian Brabandt)

46a53dfc29
2019-04-08 19:59:57 +02:00
61eff5d238 lint 2019-04-08 08:02:44 -04:00
6572c995fb Remove MSVC optimization workaround for SHM_ALL 2019-04-08 07:57:18 -04:00
5a81561e7a Merge pull request #9866 from bfredl/setbufcursor
api/window: validate cursor in nvim_win_set_buf
2019-04-08 13:41:39 +02:00
344c69b66b api/window: validate cursor in nvim_win_set_buf
validate_cursor() is called regularly, but only for the current window.
When changing the buffer for a non-current window, we need to invoke it
in the context of that window.
2019-04-08 12:39:08 +02:00
11bf89e3b5 Merge #9796 from justinmk/doc 2019-04-08 03:44:00 +02:00
ce76dffda4 doc: rewrite *feature-list* 2019-04-08 03:42:21 +02:00
27cd1e07ed doc [ci skip]
- README.md: Removed waffle.io because that service is shutting down.
2019-04-08 03:42:21 +02:00
943bedfc86 event-loop: do not set CA_COMMAND_BUSY #9853
CA_COMMAND_BUSY in nv_event() was carried over from Vim nv_cursorhold()
(ref: e5165bae11). It prevents :startinsert from working during a RPC
call, so remove it.

Helped-by: glacambre <me@r4>
closes #7254
2019-04-08 02:33:00 +02:00
9da348beda Merge #9858 from justinmk/ci-win 2019-04-08 02:32:33 +02:00
b8df2c6ebd 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-07 20:00:28 -04:00
8a8213f6d4 CI/AppVeyor: remove redundant cache directive
Maybe AppVeyor gets confused by the redundant entry?

Anyway, build.ps1 generally does not affect the validity of the deps
cache.
2019-04-08 01:46:25 +02:00
45bf5bb666 CI/AppVeyor: do not cache pacman packages
pacman log says:
    Total Download Size:   17.06 MiB
So this takes very little of the quota. But it also takes only a few
seconds to install, so caching it saves little or no time.
2019-04-08 01:41:25 +02:00
7872739d3c CI/AppVeyor: print info about restored cache 2019-04-08 01:19:38 +02:00
d928b036dc :stopinsert should leave terminal-mode #9856
Problem:  Calling :stopinsert from RPC while in terminal-mode does not
          go back to normal-mode.
Solution: Implement a check() handler for state_enter(), adapted from
          insert_check().

Fix #7807
2019-04-08 01:13:43 +02:00
02aa57afa5 CI/AppVeyor: build deps out-of-tree
appveyor.yml: set cache to an absolute path.

Desperate attempt to get AppVeyor cache to work.

My assumption in a7a56293aa #9852 that that different jobs were
overwriting each other's cache is probably wrong: AppVeyor
docs/discussions hint that the cache is per-config (though I haven't
found a clear, unambiguous statement as such).
2019-04-08 01:00:47 +02:00
c5e8924f4e CI/AppVeyor: do skip-logic earlier #9854 2019-04-07 14:43:50 +02:00
a7a56293aa CI/AppVeyor: per-compiler deps cache #9852
The deps cache does not work for MSVC builds because the MINGW builds
ovewrite it.  Cache saves 10+ minutes on the build.
2019-04-07 03:54:22 +02:00
805b5f2e1e Merge #9840 from janlazo/vim-8.0.0709
vim-patch:8.0.{709,728},8.1.{135,308}
2019-04-07 03:43:36 +02:00
cf072cf223 build: fix warning 2019-04-07 01:41:41 +02:00
8376d2c4b1 vim-patch:8.1.1123: avoid filtering autocomplete
Author: roxma <roxma@qq.com>

Problem:    No way to avoid filtering for autocomplete function, causing
            flickering of the popup menu.
Solution:   Add the "equal" field to complete items. (closes vim/vim#3887)
73655cf0ca

closes #9566
2019-04-07 00:56:26 +02:00
3cd9422c4c vim-patch:8.1.1113: making an autocommand trigger once is not so easy
Problem:    Making an autocommand trigger once is not so easy.
Solution:   Add the ++once argument.  Also add ++nested as an alias for
            "nested". (Justin M. Keyes, closes vim/vim#4100)
eb93f3f0e2
2019-04-06 23:48:26 +02:00
4d6e99c949 vim-patch:8.0.0728: the terminal structure is never freed
Problem:    The terminal structure is never freed.
Solution:   Free the structure and unreference what it contains.
96ca27a0ee
2019-04-06 01:10:32 -04:00
5262a1f4b5 oldtests: win: filename cannot have " 2019-04-05 22:57:08 -04:00
eba1ebafe5 oldtests: set shellslash for ":cd" test 2019-04-05 22:57:08 -04:00
e2f845632d vim-patch:8.1.0308: a quick undo shows "1 seconds ago"
Problem:    A quick undo shows "1 seconds ago". (Tony Mechelynck)
Solution:   Add singular/plural message.
fd6100b2aa
2019-04-05 22:57:08 -04:00
ca49ae9e36 vim-patch:8.1.0135: undo message delays screen update for CTRL-O u
Problem:    Undo message delays screen update for CTRL-O u.
Solution:   Add smsg_attr_keep(). (closes vim/vim#3125)
e0429681ae
2019-04-04 19:10:31 -04:00
0baf8583ef vim-patch:8.0.0709: libvterm cannot use vsnprintf()
Problem:    Libvterm cannot use vsnprintf(), it does not exist in C90.
Solution:   Use vim_vsnprintf() instead.
8327d1df17
2019-04-04 19:10:31 -04:00
052ced4954 Merge #9845 from mhinz/vim-8.1.0494
vim-patch:8.1.0{218,493,494}
2019-04-05 00:20:44 +02:00
d608e9c950 vim-patch:8.1.0494: functions do not check for a window ID in other tabs
Problem:    Functions do not check for a window ID in other tabs.
Solution:   Also find the window ID in other than the current tab.

babfcf54ae

Fixes https://github.com/neovim/neovim/issues/9843
2019-04-04 20:24:39 +02:00
5510361a8c vim-patch:8.1.0493: argv() and argc() only work on the current argument list
Problem:    argv() and argc() only work on the current argument list.
Solution:   Add a window ID argument. (Yegappan Lakshmanan, closes vim/vim#832)

e6e3989c1b
2019-04-04 20:24:39 +02:00
6b75d9f865 vim-patch:8.1.0218: cannot add matches to another window
Problem:    Cannot add matches to another window. (Qiming Zhao)
Solution:   Add the "window" argument to matchadd() and matchaddpos().
            (closes vim/vim#3260)

95e51470f1
2019-04-04 20:24:39 +02:00
fb555c6898 coverity/183543: Null pointer dereference #9836
Window may disappear, see e7e2115de5.
2019-04-03 11:33:16 +02:00
d9de4c0efb vim-patch:8.1.1072: extending sign and foldcolumn below the text is confusing (#9816)
Problem:    Extending sign and foldcolumn below the text is confusing.
Solution:   Let the sign and foldcolumn stop at the last text line, just like
            the line number column.  Also stop the command line window leader.
            (Christian Brabandt)

8ee4c01b8c

Closes https://github.com/neovim/neovim/issues/9613
2019-04-03 10:48:47 +02:00
c395cf018d Merge #9823 from mhinz/vim-8.1.1093
vim-patch:8.1.{1093,1094,1100}
2019-04-03 00:30:24 +02:00
5134b22ac5 Merge #9831 from janlazo/vim-8.0.0681
vim-patch:8.0.0681,8.1.{118,119}
2019-04-02 22:36:45 +02:00
a79c0c8f7a vim-patch:8.1.1100: tag file without trailing newline no longer works
Problem:    Tag file without trailing newline no longer works. (Marco Hinz)
Solution:   Don't expect a newline at the end of the file.

fd700393be
2019-04-02 22:20:53 +02:00
e05a47f68b vim-patch:8.1.1094: long line in tags file causes error
Problem:    Long line in tags file causes error.
Solution:   Check for overlong line earlier. (Andy Massimino)

5209334c55
2019-04-02 22:20:53 +02:00
2a73549ee8 vim-patch:8.1.1093: support for outdated tags format slows down tag parsing
Problem:    Support for outdated tags format slows down tag parsing.
Solution:   Remove FEAT_TAG_OLDSTATIC.

96428dd4e9
2019-04-02 22:20:53 +02:00
ed8b4987b7 lint 2019-04-02 07:12:52 -04:00
8eaa452073 Merge #9516 from erw7/improve-executable-on-windows
Improve executable() and exepath() on windows
2019-04-02 12:40:36 +02:00
42e1e2495c oldtests: set shellslash for Test_non_zero_arg 2019-04-01 23:28:16 -04:00
d00e913ea6 vim-patch:8.1.0119: failing test goes unnoticed because messages is not written
Problem:    Failing test goes unnoticed because testdir/messages is not
            written.
Solution:   Set 'nomodifiable' only local to the buffer.
ec12d64909
2019-04-01 21:48:35 -04:00
773086388d vim-patch:8.1.0118: duplicate error message for put command
Problem:    Duplicate error message for put command.
Solution:   Check return value of u_save(). (Jason Franklin)
f52f9ea8f5
2019-04-01 21:48:01 -04:00
8843928e10 vim-patch:8.0.0681: unnamed register only contains the last deleted text
Problem:    Unnamed register only contains the last deleted text when
            appending deleted text to a register. (Wolfgang Jeltsch)
Solution:   Only set y_previous when not using y_append. (Christian Brabandt)
18d90b95c4
2019-04-01 21:29:59 -04:00
c7039fd0d3 test: "$PATHEXT=::" 2019-04-02 01:28:11 +02:00
35362495c9 jumplist: avoid extra tail entry #9805
fixes #9775
2019-04-02 00:50:28 +02:00
70a0a12b53 fs.c: fix is_executable_ext()
- Corresponds to the case where pathext contains a zero-length
  extension.
- Remove unnecessary break statements.
- Fix function attributes.
2019-04-02 05:08:40 +09:00
a011f8a321 Merge #9827 from justinmk/fix-warnings 2019-04-01 21:59:21 +02:00
a062d307fb [ci skip] fs.c: fix comment 2019-04-01 23:36:16 +09:00
e62f4cc122 fs.c: Move sh check of is_executable_ext to outside of loop 2019-04-01 22:14:33 +09:00
cc6d3f7903 fs.c: Simplify calling is_executable_ext 2019-04-01 20:37:10 +09:00
ece8d88b10 test/win: Remove unnecessary set shell 2019-04-01 19:47:58 +09:00
a7cc18e563 fs.c: fix is_executable_ext
- Fix the problem of checking the extension in a UNIX like shell.
- Fix the problem of not checking the existence of the file when the
  pathext contains an extension.
2019-04-01 19:29:12 +09:00
7d61b2f64f fs.c: eliminate is_extension_executable
Add this functionality to is_executable_ext() instead.
2019-04-01 03:13:11 +02:00
4b25c2b4e8 is_extension_executable: simplify check for unix-style shell
mch_expand_wildcards does it this way, it's probably good enough.
2019-04-01 03:13:11 +02:00
692b83fc92 is_extension_executable: simplify
Simplify method of determining search position of the extension.
2019-04-01 03:13:11 +02:00
70ac7c876b cleanup: PATHEXT function 2019-04-01 03:13:11 +02:00
3be5aa1a34 test/win: executable(), exepath() #9516 2019-04-01 03:13:11 +02:00
35c2ceba96 win: exepath(): append extension if omitted
fixes #9403
2019-04-01 03:13:11 +02:00
acdcae6b1e PVS/V560: expression is always true 2019-04-01 03:07:24 +02:00
cf4e14c746 clang/"null pointer dereference": insert_execute 2019-04-01 03:05:02 +02:00
e32c9f888b clang/"result is garbage/undefined": win_close
win_free_mem: set `dirp` to a dummy value.
2019-04-01 02:57:43 +02:00
6be483b6ad win: executable(): also check extension 2019-04-01 00:14:35 +02:00
519b93d236 win: executable(): fix relative path bug
Qualified (i.e. dot-prefixed) relative paths should only search CWD, not
$PATH.
2019-04-01 00:14:35 +02:00
d13803f64f keymap, terminal: more keycodes #9810
- input: recognize <kEqual>, <kComma>
- terminal.c: If we need to support function key, a change must be made
  in libvtermkey. Currently, it emulates strictly VT220 terminal, and
  returning numeric value in 'normal' mode is the expected behaviour.

closes #9810
2019-03-31 23:39:06 +02:00
f793c578bc Merge #9822 from janlazo/vim-8.1.1073
vim-patch:8.1.{1073,1074,1082,1087}
2019-03-31 20:58:36 +02:00
13f4d4fb6e vim-patch:8.1.1087: tag stack is incorrect after CTRL-T and then :tag
Problem:    tag stack is incorrect after CTRL-T and then :tag
Solution:   Handle DT_TAG differently. (test by Andy Massimino, closes vim/vim#3944,
            closes vim/vim#4177)
7559dcef6c
2019-03-31 12:59:48 -04:00
3ae3d80bfb vim-patch:8.1.1082: "Conceal" match is mixed up with 'hlsearch' match.
Problem:    "Conceal" match is mixed up with 'hlsearch' match.
Solution:   Check that a match is found, not a 'hlsearch' item. (Andy
            Massimino, closes vim/vim#4073)
ab62c19ea0
2019-03-31 12:40:54 -04:00
be762a1b6f vim-patch:8.1.1074: Python test doesn't wipe out hidden buffer
Problem:    Python test doesn't wipe out hidden buffer.
Solution:   Wipe out the buffer. (Ben Jackson, closes vim/vim#4189)
bfd3603670
2019-03-31 12:40:54 -04:00
c5db02d792 vim-patch:8.1.1073: space in number column is on wrong side with 'rightleft' set
Problem:    Space in number column is on wrong side with 'rightleft' set.
Solution:   Move the space to the text side.  Add a test.
e73f911c53
2019-03-31 12:40:54 -04:00
157034bd6c Merge #9812 from janlazo/vim-8.0.1153 2019-03-31 16:32:23 +02:00
4c4a570156 Merge #9807 from mhinz/window-local-last-cursormoved 2019-03-31 15:13:38 +02:00
f772117b55 eval: diff_hlID() and hlID() return same id 2019-03-31 09:01:40 -04:00
1782550bfe vim-patch:8.0.1153: no tests for diff_hlID() and diff_filler()
Problem:    No tests for diff_hlID() and diff_filler().
Solution:   Add tests. (Dominique Pelle, closes vim/vim#2156)
97fbc404fc
2019-03-31 08:31:38 -04:00
11f03ee3f3 vim-patch:8.1.1095: win: executable() on very long name #9820
Problem:    MS-Windows: executable() fails on very long filename.
Solution:   (Ken Takata, closes vim/vim#4015)
8662189736
2019-03-31 13:29:16 +02:00
9e52255de2 autocmd: rename MenuPopupChanged to CompleteChanged #9819 2019-03-31 01:15:41 +01:00
c76494d8b7 vim-patch:8.0.0705: check did_throw before discarding exception #9808
Problem:    Crash when there is an error in a timer callback. (Aron Griffis,
            Ozaki Kiichi)
Solution:   Check did_throw before discarding an exception.  NULLify
            current_exception when no longer valid.
cae24be4a8
2019-03-30 22:28:19 +01:00
2bdc7cac8b vim-patch:8.1.1088: height of quickfix window not retained with vertical split (#9818)
Problem:    Height of quickfix window not retained with vertical split.
Solution:   Use frame_fixed_height() and frame_fixed_width(). (Hongbo Liu,
            closes vim/vim#4013, closes vim/vim#2998)
9e1e358d37

closes #3608
2019-03-30 22:20:08 +01:00
104a40463a vim-patch:8.0.0629: set starting earlier
The patch is N/A but we include it for consistency.
closes #9814

---
Problem:    Checking for ambigous width is not working. (Hirohito Higashi)
Solution:   Reset "starting" earlier.
6b1da3312e
2019-03-30 22:18:18 +01:00
1ae52a3bba complete_info(): fix null reference 2019-03-30 22:16:17 +01:00
fb33bae02d vim-patch:8.1.0045: popup test isn't run completely
Problem:    Popup test isn't run completely.
Solution:   Remove "finish".  Clean up function definitions.
ae0f30b761
2019-03-30 22:16:11 +01:00
a8783012e4 Merge #9815 'vim-patch:8.1.1068: complete_info()' 2019-03-30 21:30:16 +01:00
6feb9cb09d docs: explicitly state return value on success 2019-03-30 18:15:08 +01:00
2bf18e7843 test: move trim to global helpers 2019-03-30 18:14:20 +01:00
2d63b6d2c1 vim-patch:8.1.1068: cannot get all the information about current completion
Problem:    Cannot get all the information about current completion.
Solution:   Add complete_info(). (Shougo, Hirohito Higashi, closes vim/vim#4106)
fd133323d4
2019-03-30 22:24:35 +09:00
33d4c38131 cursormoved: add tests for CursorMoved 2019-03-29 10:58:53 +01:00
e2839d9633 cursormoved: always trigger CursorMoved when entering window 2019-03-29 10:58:53 +01:00
357f95a77e cursormoved: make global last_cursormoved window-local
Fixes https://github.com/neovim/neovim/issues/9755
2019-03-29 10:58:53 +01:00
dfb7f6b349 Merge #9792
fixes #9791
closes #9792
2019-03-29 03:29:50 +01:00
842e6fb92f fixup: use vim_snprintf, ASCII_ISALNUM
ASCII_ISALNUM is part of vim-patch:8.1.0540
2019-03-29 03:28:15 +01:00
b22ca804dd lint 2019-03-29 03:28:15 +01:00
f6fb370b1b keymap: add more (keypad) keycodes #9793
- K_KORIGIN instead of K_KCENTER: This name is similar to what is used
  by xev. Alternative could be K_KBEGIN as hinted here:
  https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-PC-Style-Function-Keys
  But I find Begin and Home too similar, and it might induced some
  confusion. The naming looked related to some old keyboard
  configuration.

- keymap.c: alias KPPeriod to kDel instead of kPoint.
  This might seems weird, but this is actually the behaviour that should
  be expected. libtermkey produces "KPPeriod" when num lock is off. To
  fix this would need to change this name in termkey.

closes #9780
closes #9793
2019-03-29 01:11:57 +01:00
33f99431dc Merge #9803 from janlazo/vim-8.0.0504
Benchmarked using RelWithDebInfo build and the `:Time` command from
https://github.com/tpope/vim-scriptease .

    :Time for i in range(0,99999)|call exists(':abbreviate')|endfor

- before (8698830cbd):   0.431 seconds
- after (63025a1d65): 0.345 seconds
- Vim 8.1.1005 : 0.361 seconds
2019-03-28 21:48:50 +01:00
c933378b9b vim-patch:8.1.0544: setting 'filetype' in a modeline causes an error
Problem:    Setting 'filetype' in a modeline causes an error (Hirohito
            Higashi).
Solution:   Don't add the P_INSECURE flag when setting 'filetype' from a
            modeline.  Also for 'syntax'.
916a818cea
2019-03-28 18:12:30 +02:00
ebfff8e802 vim-patch:8.1.0540: may evaluate insecure value when appending to option
Problem:    May evaluate insecure value when appending to option.
Solution:   Set the secure flag when changing an option that was previously
            set insecurely.  Also allow numbers for the characters from
            'spelllang' that are used for LANG.vim.
247bb7e43b
2019-03-28 18:12:30 +02:00
5eaa455479 vim-patch:8.1.0539: cannot build without the sandbox
Problem:    Cannot build without the sandbox.
Solution:   Set the secure option instead of using the sandbox.  Also restrict
            the characters from 'spelllang' that are used for LANG.vim.
            (suggested by Yasuhiro Matsumoto)
82e8c92ebe
2019-03-28 18:12:30 +02:00
63025a1d65 gen_ex_cmds.lua: build the command table
Lua port of create_cmdidxs.vim from 8.0.0572

N/A:
vim-patch:8.0.0572: building the command table requires Perl

Problem:    Building the command table requires Perl.
Solution:   Use a Vim script solution. (Dominique Pelle, closes vim/vim#1641)
6de5e12601
2019-03-28 07:56:21 -04:00
76204da1f8 Merge #9802 from janlazo/vim-8.1.0887 2019-03-28 12:32:41 +01:00
07a5c9d4f0 vim-patch:8.0.0506: can't build with ANSI C
Problem:    Can't build with ANSI C.
Solution:   Move declarations to start of block.
6c0c1e8052
2019-03-27 23:43:17 -04:00
c3158e230d vim-patch:8.0.0504: looking up an Ex command is a bit slow
Problem:    Looking up an Ex command is a bit slow.
Solution:   Instead of just using the first letter, also use the second letter
            to skip ahead in the list of commands. Generate the table with a
            Perl script. (Dominique Pelle, closes vim/vim#1589)
e5e0fbcd42
2019-03-27 23:43:16 -04:00
4b96002533 vim-patch:8.1.1061: when substitute string throws error, substitute happens anyway
Problem:    When substitute string throws error, substitute happens anyway.
Solution:   Skip substitution when aborting. (closes vim/vim#4161)
0e97b94875
2019-03-27 21:35:02 -04:00
2894d04b19 vim-patch:8.1.0887: the 'l' flag in :subsitute is sticky
Problem:    The 'l' flag in :subsitute is sticky.
Solution:   Reset the flag. (Dominique Pelle, closes vim/vim#3925)
9474716d39
2019-03-27 21:32:51 -04:00
2470c88291 Merge #9794 from janlazo/vim-8.0.1528 2019-03-27 11:09:54 +01:00
bf2ad145e3 vim-patch:8.1.0528: various typos in comments
Problem:    Various typos in comments.
Solution:   Fix the typos.
c4568ab37e
2019-03-26 23:59:01 -04:00
c95fdcd127 vim-patch:8.0.1528: dead code found
Problem:    Dead code found.
Solution:   Remove the useless lines. (CodeAi, closes vim/vim#2656)
81226e0310
2019-03-26 23:59:01 -04:00
281c011d44 gen_help_html.py [ci skip] 2019-03-27 00:50:38 +01:00
127e13f53e doc, lint 2019-03-26 22:56:09 +01:00
be676eccf1 Merge #9600 'doc, gen_vimdoc.py' 2019-03-26 21:36:33 +01:00
bec4066033 gen_vimdoc.py: render nested lists, etc [ci skip]
- render_node() is now the main rendering function: it traverses a node
  and builds the Vim help text recursively.
- render_para() is weird and ugly, it is the entry-point for rendering
  the help text for one docstring'd function.
2019-03-26 21:33:06 +01:00
eeb19a346a doc: mention "pynvim" module rename
closes #9764
2019-03-26 21:17:12 +01:00
d614c7932c doc: move ui-wildmenu to deprecated.txt [ci skip] 2019-03-26 19:55:33 +01:00
fbaee922d1 doc [ci skip]
closes #9719
2019-03-26 19:55:33 +01:00
2d50bf3498 mac: do not use libintl_setlocale() (#9789)
gettext contains libintl.h. That header file defines a macro that replaces
`setlocale` by `libintl_setlocale`. That function eventually calls the original
`setlocale()` from Apple's libc, but is known to make it fail.

Mac users with gettext from Homebrew can easily reproduce this:

    #include <stdio.h>
    #include <locale.h>
    #include <libintl.h>

    int main(void) {
      setlocale(LC_ALL, "");
      printf("locale: %s\n", setlocale(LC_CTYPE, NULL));
    }

Compile and run it:

    cc -I/usr/local/opt/gettext/include -L/usr/local/opt/gettext/lib -lintl -o test test.c && ./test

When $LC_CTYPE is set to a valid value like UTF-8, it should output:

    locale: UTF-8

But it does not. It returns C anyway. Remove libintl.h and recompile and you get
the expected UTF-8.

Fixes https://github.com/neovim/neovim/issues/9787
2019-03-26 11:42:25 +01:00
3441423481 tui/input.c: rename functions
- Rename the module prefix to "tinput_" instead of "term_input".
- Some of the private functions were confusing, for example
  enqueue_input() calls input_enqueue() in another module.
- It is helpful for discussion, documentation, and stacktraces if
  functions (even private) are globally unique.
2019-03-25 23:25:30 +01:00
36762a00a8 signs: support multiple columns #9295
closes #990
closes #9295

- Support for multiple auto-adjusted sign columns.
  With this change, having more than one sign on a line, and with the
  'auto' setting on 'signcolumn', extra columns will shown automatically
  to accomodate all the existing signs.

  For example, suppose we have this view:

   5147             }
   5148
   5149             return sign->typenr;
   5150         }
   5151     }
   5152     return 0;
   5153 }
   5154

  We have GitGutter installed, so it tells us about modified lines that
  are not commmited. So let's change line 5152:

     5147             }
     5148
     5149             return sign->typenr;
     5150         }
     5151     }
   ~ 5152     return 0;
     5153 }
     5154

  Now we add a mark over line 5152 using 'ma' in normal mode:

      5147             }
      5148
      5149             return sign->typenr;
      5150         }
      5151     }
  a ~ 5152     return 0;
      5153 }
      5154

  Previously, Vim/Nvim would have picked only one of the signs,
  because there was no support for having multiple signs in a line.

- Remove signs from deleted lines.
  Suppose we have highlights on a group of lines and we delete them:

   +     6 use std::ops::Deref;
   --+   7 use std::borrow::Cow;
   --+   8 use std::io::{Cursor};
         9 use proc_macro2::TokenStream;
        10 use syn::export::ToTokens;
   --+  11 use std::io::Write;
   >>   12 use std::ops::Deref;

  Without this change, these signs will momentarily accumulate in
  the sign column until the plugins wake up to refresh them.

  + --+ --+ --+ >>  6

  Discussion: It may be better to extend the API a bit and allow this
  to happen for only certain types of signs. For example, VIM marks
  and vim-gitgutter removal signs may want to be presreved, unlike
  line additions and linter highlights.

- 'signcolumn': support 'auto:NUM' and 'yes:NUM' settings
- sort signs according to id, from lowest to highest. If you have
  git-gutter, vim-signature, and ALE, it would appear in this order:
  git-gutter - vim-signature - ALE.
- recalculate size before screen update
- If no space for all signs, prefer the higher ids (while keeping the
  rendering order from low to high).
- Prevent duplicate signs. Duplicate signs were invisible to the user,
  before using our extended non-standard signcolumn settings.
- multi signcols: fix bug related to wrapped lines.
  In wrapped lines, the wrapped parts of a line did not include the extra
  columns if they existed. The result was a misdrawing of the wrapped
  parts. Fix the issue by:
    1. initializing the signcol counter to 0 when we are on a wrap boundary
    2. allowing for the draw of spaces in that case.
2019-03-25 02:17:47 +01:00
f705ed22fd Merge #9776 from janlazo/vim-8.1.0177 2019-03-24 12:55:41 +01:00
0920c6ca81 Merge pull request #9772 from gelguy/float-inccommand
floating-window.c: fix crash when using inccommand
2019-03-24 08:49:02 +01:00
a9df3fa5d2 test: make first attempt at some kind of test 2019-03-24 00:21:26 +01:00
4e49e44259 Update to restore layout only for non-floating windows 2019-03-23 22:14:03 +01:00
2a618e0ad0 Update test 2019-03-23 22:14:03 +01:00
31fa064c68 floating-window.c: fix crash when using inccommand 2019-03-23 22:14:03 +01:00
b3b8910c48 Merge pull request #9763 from bfredl/prevfloat
window: don't crash when closing two floats in a row
2019-03-23 22:13:57 +01:00
ae49e8da58 window: don't crash when closing two floats in a row
prevwin can be set to the current window. Then we can't jump to it
after closing a float.
2019-03-23 20:12:37 +01:00
a73e0e8e77 vim-patch:8.1.1045: E315 ml_get error when using Python and hidden buffer
Problem:    E315 ml_get error when using Python and hidden buffer.
Solution:   Make sure the cursor position is valid. (Ben Jackson,
            closes vim/vim#4153, closes vim/vim#4154)
63dbfd33c1
2019-03-23 14:56:34 -04:00
ca71c82196 vim-patch:8.1.0538: evaluating a modeline might invoke using a shell command
Problem:    Evaluating a modeline might invoke using a shell command. (Paul
            Huber)
Solution:   Set the sandbox flag when setting options from a modeline.
5958f95a40
2019-03-23 08:09:27 -04:00
6b3775bbe2 vim-patch:8.1.0189: function defined in sandbox not tested
Problem:    Function defined in sandbox not tested.
Solution:   Add a text.
d90a144eda
2019-03-23 01:26:13 -04:00
b5582d1b32 vim-patch:8.1.0177: defining function in sandbox is inconsistent
Problem:    Defining function in sandbox is inconsistent, cannot use :function
            but can define a lambda.
Solution:   Allow defining a function in the sandbox, but also use the sandbox
            when executing it. (closes vim/vim#3182)
93343725b5
2019-03-23 01:25:33 -04:00
3e78319ac6 help: ignore snapshotted window if invalid (#9774)
Nvim doesn't expect a window-changing command on an created-window event.

    autocmd WinNew * wincmd p
    help help

- A snapshot for window 1000 is created.
- The window is split and the cursor changes to the new window 1001.
- The autocmd kicks in and switches back to 1000.
- The help buffer is opened.
- On closing the help window 1000, it tries to go back to the snapshotted window
  which is... 1000.
- wp1000->w_buffer == NULL
- w_buffer is used by check_cursor()
- 🧨 -> 💥

Fixes https://github.com/neovim/neovim/issues/9773
2019-03-23 00:23:39 +01:00
3edf7fc64f api: ignore floating windows for laststatus=1 (#9771)
ONE_WINDOW considers all windows whereas one_window() ignores floating windows.

Fixes https://github.com/neovim/neovim/issues/9768
2019-03-22 17:17:33 +01:00
fa6ed5f759 Merge #9769 from janlazo/vim-8.1.1025 2019-03-21 19:35:30 +01:00
ea538f8799 vim-patch:8.1.1026: unused condition
Problem:    Unused condition. (Coverity)
Solution:   Remove the condition.  Also remove unused #define.
d00e024d9f
2019-03-21 07:55:48 -04:00
5c97bfb1e2 vim-patch:8.1.1025: checking NULL pointer after addition
Problem:    Checking NULL pointer after addition. (Coverity)
Solution:   First check for NULL, then add the column.
64c8ed366d
2019-03-21 07:44:52 -04:00
c5631338b1 :mksession : restore tab-local working directories #9754 2019-03-21 11:53:38 +01:00
8698830cbd doc #9751
closes #9750
2019-03-20 12:44:06 +01:00
f282324e1b test: add more debuggings tips [ci skip] (#9761)
Mention the common press-enter issue and how to visualize the screen.
2019-03-19 17:44:35 +01:00
24d7513dc4 vim-patch:8.1.0384: sign ordering #9758
Problem:    Sign ordering depends on +netbeans feature.
Solution:   Also order signs without +netbeans. (Christian Brabandt,
            closes vim/vim#3224)
8aeb504fc6
2019-03-19 12:42:17 +01:00
6f7b81bd6d vim-patch:8.1.{0849,1001}: 'cursorline' highlight #9757
- Lua test correctly fails when 8.1.0849 is reverted.
- 8.1.1001 bug does not manifest in Neovim.

vim-patch:8.1.0849: cursorline highlight is not always updated
Problem:    Cursorline highlight is not always updated.
Solution:   Set w_last_cursorline when redrawing.  Fix resetting cursor flags
            when using the popup menu.
c07ff5c60a

vim-patch:8.1.1001: Visual area not correct when using 'cursorline'
Problem:    Visual area not correct when using 'cursorline'.
Solution:   Update w_last_cursorline also in Visual mode. (Hirohito Higashi,
            closes vim/vim#4086)
8156ed3755
2019-03-19 12:24:41 +01:00
ad3b312cf5 build: do not pass empty CMAKE_INSTALL_PREFIX
ref #9748
ref #9743
2019-03-19 02:51:33 +01:00
5beb3b8ee5 test: example_spec.lua 2019-03-19 01:37:48 +01:00
a077f53914 Merge #9749 from janlazo/vim-8.1.1017 2019-03-19 00:03:23 +01:00
14bfa0c578 vim-patch:8.1.0775: matching too many files as zsh
Problem:    Matching too many files as zsh. (Danek Duvall)
Solution:   Be more specific with zsh filetype patterns.
2bf60b3001
2019-03-17 20:49:27 -04:00
fb95bb38b5 vim-patch:8.1.0771: some shell filetype patterns end in a star
Problem:    Some shell filetype patterns end in a star.
Solution:   Make sure that patterns not ending in a star are preferred.
147e7d0cab
2019-03-17 20:38:55 -04:00
8394bf676b vim-patch:8.1.1017: off-by-one error in filetype detection
Problem:    Off-by-one error in filetype detection.
Solution:   Also check the last line of the file.
493fbe4abe
2019-03-17 20:35:03 -04:00
29d6993ccd build: pass CMAKE_INSTALL_PREFIX explicitly #9748
On some (but not all) systems this works implicitly.

fixes #9743
2019-03-17 23:35:56 +01:00
f3e7815e61 Merge #9747 from janlazo/vim-8.1.0858 2019-03-17 22:12:39 +01:00
d86c816f8c vim-patch:8.1.0048: vim_str2nr() on numbers close to max #9744
Problem:    vim_str2nr() does not handle numbers close to the maximum.
Solution:   Check for overflow more precisely. (Ken Takata, closes vim/vim#2746)
07ccf7ce7f
2019-03-17 22:08:01 +01:00
94d933aa7e oldtests: use LoadAdjust() on timer test 2019-03-17 15:13:19 -04:00
027a2157d3 Merge pull request #9746 from bfredl/wildkeys
cmdline: revert <down> and <up> mappings for wildoptions=pum
2019-03-17 19:24:36 +01:00
536be31a19 vim-patch:8.1.0858: 'indentkeys' and 'cinkeys' defaults are different
Problem:    'indentkeys' and 'cinkeys' defaults are different.
Solution:   Make them the same, update docs. (close vim/vim#3882)
ce655743ba
2019-03-17 12:27:34 -04:00
16d607929d cmdline: revert <down> and <up> mappings for wildoptions=pum
These confict with navigation mappings.  Better leave them to the user to
reverse them for now for users that want it.
2019-03-17 16:17:23 +01:00
9ef8d0d6b0 Merge pull request #9726 from mhinz/nvim_win_get_config
Closes #9723
2019-03-17 02:34:50 +01:00
7c38994ff2 aucmd_prepbuf: also restore prevwin #9741
bisected to f5d5da3917

Other test steps:

    nvim -u NORC
    :terminal tree /    " Produces lots of output
    :edit somefile.txt
    :vsplit
    :vsplit
    <c-w>l
    <c-w>l
    <c-w>h
    <c-w>p
2019-03-17 02:09:06 +01:00
32998731bf vim-patch:8.1.1011: indent from autoindent not removed #9742
Problem:    Indent from autoindent not removed from blank line. (Daniel Hahler)
Solution:   Do not reset did_ai when text follows. (closes vim/vim#4119)
2ba4238818
2019-03-17 00:46:15 +01:00
d8316f2a1b clipboard: Always copy as plain text in Wayland #9737
`wl-copy` by default tries to determine the mime type of a copied bit of
text. From the [readme](https://github.com/bugaevc/wl-clipboard):

> wl-copy automatically infers the type of the copied content by running
> xdg-mime(1) on it.

So copying a Ruby script from Nvim may store it in the Wayland clipboard
as mime-type `application/x-ruby`.

This is a small reproduction without Nvim:

    $ cat test.rb
    #!/usr/bin/env ruby
    puts 'hello world'
    $ cat test.rb | wl-copy
    $ wl-paste --list-types
    application/x-ruby

This commit fixes that by telling wl-copy that all text copied from
Nvim has the mime type `text/plain`.

    $ cat test.rb | wl-copy --type text/plain
    $ wl-paste --list-types
    text/plain;charset=utf-8
2019-03-16 22:55:24 +01:00
b557654f36 api: add tests for new code paths 2019-03-16 21:44:15 +01:00
5c836d2ef8 Merge pull request #9607 from bfredl/wildpum
UI: deprecate redundant ext_wildmenu events and allow TUI popupmenu for cmdline
2019-03-16 20:41:10 +01:00
11a481f711 Merge #9686 'win/Lua: monkey-patch os.getenv()'
fixes #9681
2019-03-16 20:28:52 +01:00
be8ebba325 Allow using internal popupmenu or ext_popupmenu for wildmenu
Deprecate ext_wildmenu. ext_popupmenu already contains more state (anchor
position), and will allow further expansion (info about items).
2019-03-16 19:53:21 +01:00
8d00393d0c Merge #9736 from janlazo/vim-8.1.0019 2019-03-16 18:30:56 +01:00
3bad76008e oldtests: wait 200ms on mac for timer test 2019-03-16 10:40:50 -04:00
073ab7cda8 api: refactor FloatRelative usage 2019-03-16 15:34:16 +01:00
86992a7bb1 api: numerous small fixes 2019-03-16 15:02:56 +01:00
27c4b6b9bd api: update doc 2019-03-16 12:35:59 +01:00
96edbe7b1d api: add width/height to FloatConfig 2019-03-16 12:35:58 +01:00
3c88bbecb8 api: nvim_win_config() -> nvim_win_set_config() 2019-03-16 12:35:58 +01:00
98391cd6ab api: refactor FloatAnchor usage 2019-03-16 12:35:57 +01:00
cfed9a4123 api: add nvim_win_get_config() 2019-03-16 12:35:52 +01:00
175398f216 Merge pull request #9616 from chemzqm/completechange
add MenuPopupChanged autocmd
2019-03-16 10:36:54 +01:00
2ea6d3ab97 vim-patch:8.1.0019: error when defining a Lambda with index of a function result
Problem:    Error when defining a Lambda with index of a function result.
Solution:   When not evaluating an expression and skipping a function call,
            set the return value to VAR_UNKNOWN.
b4518563c7
2019-03-15 22:13:32 -04:00
b90256e6cc test: simplify TUI bg-detection test
Previous approach skipped the test if the expected value matched the
default value ("dark"). New approach always checks, but uses retry() to
ignore potentially wrong 'background' before the terminal response is
handled.
2019-03-15 05:26:41 +01:00
1baf4edbd9 Merge #9728 from justinmk/autocmd-once 2019-03-15 12:38:53 +01:00
680252aa15 vim-patch:8.1.0728: avoid breaking after single space #9733
Problem:    Cannot avoid breaking after a single space.
Solution:   Add the 'p' flag to 'formatoptions'. (Tom Ryder)
c3c3158756
2019-03-15 12:14:42 +01:00
6c375d71c3 autocmd: add MenuPopupChanged autocmd
Update src/nvim/auevents.lua

Co-Authored-By: chemzqm <chemzqm@gmail.com>
2019-03-15 04:24:41 +08:00
ced980ff17 Merge pull request #9730 from bfredl/pumfloat
compositor: fix rendering issues with floats opened after popupmenu
2019-03-14 12:22:46 +01:00
cbe4377fde vim-patch:8.1.0671: cursor in wrong column after auto-format #9729
Problem:    Cursor in the wrong column after auto-formatting.
Solution:   Check for deleting more spaces than adding. (closes vim/vim#3748)
e1e714ef0d
2019-03-14 11:23:05 +01:00
ca5f919965 compositor: fix rendering issues with floats opened after popupmenu 2019-03-14 10:43:49 +01:00
b1f25ea187 autocmd: do not show empty section after ++once handlers expire
Problem: If autocmd pattern only contained `++once` handlers, and
         all of them completed, then there would be an empty group
         displayed by `:autocmd Foo`.
Solution: Delete the pattern if all of its commands were deleted.
2019-03-14 01:30:11 +01:00
3259e45f92 autocmd: rename: "++nested", "++once"
Based on feedback from upstream:
https://github.com/vim/vim/pull/4100
2019-03-14 01:30:11 +01:00
907b480350 vim-patch:8.0.1447: still too many old style tests (#9725)
Problem:    Still too many old style tests.
Solution:   Turn a few tests into new style. (Yegappan Lakshmanan,
            closes vim/vim#2509)
cada78975e

Exclude test_shortpathname.vim.
nvim does not support 8.3 filenames on Windows.
2019-03-14 00:43:11 +01:00
9d207fd876 dictwatcheradd(): support b:changedtick #9693
fixes #6635
closes #9693
2019-03-14 00:38:56 +01:00
7fcf2f926f TextYankPost: add v:event["inclusive"] #9717 2019-03-13 03:24:09 +01:00
2af1e23278 vim-patch:8.1.0170: invalid memory use with complicated pattern #9724
Problem:    Invalid memory use with complicated pattern. (Andy Massimino)
Solution:   Reallocate the list of listids when needed. (closes vim/vim#3175)
            Remove unnecessary function prototypes.
2338c32b53
2019-03-13 03:16:22 +01:00
4f5e378124 test/CI: skip "throttles output" test on Travis macOS #9721
Travis macOS is not fast enough to run this test reliably. The test
depends on the system producing output faster than the Nvim TUI can
handle it.
2019-03-12 19:26:24 +01:00
8760816d46 Merge pull request #9722 from bfredl/float-doc2
Float docs and defaults.
2019-03-12 17:37:43 +01:00
dec3e027d9 docs: adjust the generated nvim_open_win docs
The format here is not meant to be ideal, just a backstop until
auto-generation has been fixed.
2019-03-12 17:17:58 +01:00
f9d3e69cc9 docs: update generated API docs 2019-03-12 17:17:58 +01:00
4ab0dcc4a9 docs: floating windows introduction 2019-03-12 17:17:58 +01:00
81e84f2aae floats: add NormalFloat highlight and 'nonumber' default 2019-03-12 17:17:54 +01:00
af966afaa4 window: simplify logic for entering new float 2019-03-12 12:49:11 +01:00
9312e2d06a autocmd: rename "once" => "-once" #9713
- Rename "nested" to "-nested", but continue to support "nested" for
  backwards-compatibility.
- Allow any order: "-once -nested" or "-nested -once".

ref https://github.com/neovim/neovim/pull/9706#issuecomment-471295747
2019-03-11 21:01:47 +01:00
3b63374b33 Dist: make icon a proper square (#9716)
The canvas was resized from 128x104 to 128x128 and centered via Gimp and further
optimized via optipng.

Fixes https://github.com/neovim/neovim/issues/9715
2019-03-11 21:00:12 +01:00
f4c2de4c45 style: make linter happy with fileio.c 2019-03-11 12:41:51 +01:00
b4d894c067 fs: add UV_FS_COPYFILE_FICLONE flag to os_copy 2019-03-11 11:55:58 +01:00
c0a29c3656 Merge #9708 from justinmk/tui-bg-detect 2019-03-11 09:25:39 +01:00
43184566aa TUI/background detection: hook into VimEnter event
If terminal response is received during startup, set 'background' from
a nested "one-shot" (once) VimEnter autocmd.

The previous not-so-clever "self-rescheduling" approach could cause
a long delay at startup (event-loop does not make forward progress).

fixes #9675
ref #9509
2019-03-11 08:43:27 +01:00
6db1757b53 fs: remove unecessary copybuf and os_open call 2019-03-10 20:50:56 +01:00
7a6d85a778 fs: replace another custom copy with os_copy 2019-03-10 19:52:08 +01:00
c99bff5f56 cleanup: rename menu_nable_recurse() #9707 2019-03-10 19:05:48 +01:00
8410c72b18 fs: add os_copy function that uses uv_fs_copyfile 2019-03-10 18:11:30 +01:00
ef5037e7f6 Merge #9706 from justinmk/aucmd-once 2019-03-10 13:10:09 +01:00
c12cf5bde7 autocmd: introduce "once" feature
Adds a new feature to :autocmd which sets the handler to be executed at
most one times.

Before:

    augroup FooGroup
      autocmd!
      autocmd FileType foo call Foo() | autocmd! FooGroup * <buffer>
    augroup END

After:

    autocmd FileType foo once call Foo()
2019-03-10 04:58:30 +01:00
95ce1e5408 vim-patch:8.1.1002: "gf" on URL with port number #9705
Problem:    "gf" does not always work when URL has a port number. (Jakob
            Schöttl)
Solution:   When a URL is recognized also accept ":". (closes vim/vim#4082)
cbef8e1aa1
2019-03-10 04:53:51 +01:00
092e7e6c60 Merge #9703 from erw7/fix-executable-on-unix 2019-03-09 23:23:20 +01:00
7757ce1cb8 executable(): return false if user is not owner #9703
S_IXUSR does not check ownership.  Test case:

    touch test.txt
    chmod 744 test.txt
    sudo chown root:root test.txt
    nvim -u NORC
    :echo executable('./test.txt')
2019-03-09 23:18:03 +01:00
3cb89cafe3 vim-patch:8.1.0994: fix relative cursor position #9676
Problem:    Relative cursor position is not calculated correctly.
Solution:   Always set topline, also when window is one line only.
            (Robert Webb) Add more info to getwininfo() for testing.
8fcb60f961
2019-03-09 23:12:33 +01:00
6eca56c6c5 Merge #9003 'vim-patch:8.0.1372' 2019-03-09 14:12:54 +01:00
f719247118 floating-window: fix crash setting cmdheight #9685
fixes #9680
2019-03-09 14:10:56 +01:00
c1ee5e0694 vim-patch:8.0.1372: profile log may be truncated halfway a character
Problem:    Profile log may be truncated halfway a character.
Solution:   Find the start of the character. (Ozaki Kiichi, closes vim/vim#2385)
ac112f01a6

nvim does not support "--clean" yet but "-es" should suffice for the test.
2019-03-08 21:35:03 -05:00
4352d41db0 Merge #9662 'vim-patch:8.0.{0643-0646}' 2019-03-08 13:21:11 +01:00
0355c1ed9c Merge #9695 'vim-patch:8.1.{739,826,998}' 2019-03-08 12:23:53 +01:00
e3d9945f7f vim-patch:8.1.0826: too many #ifdefs
Problem:    Too many #ifdefs.
Solution:   Graduate FEAT_VIRTUALEDIT.  Adds about 10Kbyte to the code.
29ddebef40
2019-03-08 03:12:57 -05:00
8bd194f98a oldtests: set shellslash in Test_true_false_arg() 2019-03-08 02:30:22 -05:00
e428fc4b52 oldtests: set shellslash in Test_shellescape()
Value of "&shell" does not affect "shellescape()".
2019-03-08 02:12:12 -05:00
aa985f4a7c vim-patch:8.1.0739: text objects in not sufficiently tested
Problem:    Text objects in not sufficiently tested.
Solution:   Add a few more test cases. (Dominique Pelle, closes vim/vim#3795)
81b1ba4be5
2019-03-07 23:30:12 -05:00
72e304c349 vim-patch:8.1.0998: getcurpos() unexpectedly changes "curswant"
Problem:    getcurpos() unexpectedly changes "curswant".
Solution:   Save and restore "curswant". (closes vim/vim#4069)
19a66858a5
2019-03-07 22:28:30 -05:00
96e2c3945f lint: fix coding style 2019-03-08 00:08:16 +08:00
0a471e009a vim-patch:8.0.0646: the hlsearch test fails on fast systems
Problem:    The hlsearch test fails on fast systems.
Solution:   Make the search pattern slower.  Fix that the old regexp engine
            doesn't timeout properly.
0946326580
2019-03-08 00:06:28 +08:00
fbd8209286 vim-patch:8.0.0645: no error for illegal back reference in NFA engine
Problem:    The new regexp engine does not give an error for using a back
            reference where it is not allowed. (Dominique Pelle)
Solution:   Check the back reference like the old engine. (closes vim/vim#1774)
1ef9bbe215
2019-03-07 23:48:53 +08:00
570e41fc08 vim-patch:8.0.0644: the timeout for 'hlsearch' is not tested
Problem:    There is no test for 'hlsearch' timing out.
Solution:   Add a test.
5b1affefd0
2019-03-07 23:48:53 +08:00
241b905b13 vim-patch:8.0.0643: when a pattern search is slow Vim becomes unusable
Problem:    When 'hlsearch' is set and matching with the last search pattern
            is very slow, Vim becomes unusable.  Cannot quit search by
            pressing CTRL-C.
Solution:   When the search times out set a flag and don't try again.  Check
            for timeout and CTRL-C in NFA loop that adds states.
fbd0b0af68
2019-03-07 23:27:19 +08:00
5f84b1dc41 vim-patch:8.1.0935: old regexp engine may use invalid buffer #9692
Problem:    Old regexp engine may use invalid buffer for 'iskeyword' or
            uninitialized buffer pointer. (Kuang-che Wu)
Solution:   Set rex.reg_buf when compiling the pattern. (closes vim/vim#3972)
8bfd9469ce
2019-03-07 12:05:22 +01:00
b51e5d8b8d tui_tk_ti_getstr: handle weird value #9688
tigetstr (used by libtermkey/driver-ti.c) may return -1 as a pointer.
Documented in man 3 tigetstr. https://linux.die.net/man/3/tigetstr

> The tigetstr routine returns the value (char *)-1 if capname is not a string
> capability, or 0 if it is canceled or absent from the terminal description.

Fixed #9687
2019-03-07 11:42:58 +01:00
c9264e6d52 Fix os.getenv of lua on Windows
Change to use os_getenv instead of getenv because environment variable
set by uv_os_setenv can not be get with getenv.
2019-03-07 13:49:02 +09:00
980dd7c011 Merge #9638 from mhinz/update-libtermkey 2019-03-07 00:57:21 +01:00
24a56cca30 Fix environment variable on Windows
Since uv_os_setenv uses SetEnvironmentVariableW, _wenviron is no
updated. As a result, inconsistency occurs in completion of environment
variable names. Change to use GetEnvironmentStaringsW instead of
_wenviron to solve it.
2019-03-06 18:06:51 +09:00
299f32dc01 PVS/V560: window.c: fix always true condition #9682 2019-03-05 22:48:52 +01:00
5d2e4a5021 Merge #9679 from janlazo/vim-8.1.0891 2019-03-05 22:47:19 +01:00
e386e51d9e Merge pull request #9674 from bfredl/bufapi-fix
api/buffer: use aucmd_prepbuf() to manipulate invisible buffer, fix some issues
2019-03-05 19:39:15 +01:00
f5d5da3917 buffer: use aucmd_prepbuf() instead of switch_to_win_for_buf() 2019-03-05 15:05:23 +01:00
04059312b0 vim-patch:8.1.0875: not all errors of marks and findfile()/finddir() are tested
Problem:    Not all errors of marks and findfile()/finddir() are tested.
Solution:   Add more test coverage. (Dominique Pelle)
71b13e92ae
2019-03-05 00:09:30 -05:00
cbab746fd8 vim-patch:8.1.0891: substitute command inssuficiently tested
Problem:    Substitute command inssuficiently tested.
Solution:   Add more test coverage. (Dominique Pelle)
d77aa4d22e
2019-03-05 00:04:48 -05:00
7e6fce0698 PVS/V501: ui_compositor.c: identical sub-expressions #9673 2019-03-05 01:33:40 +01:00
2816bc8620 Merge #8349 from lePerdu/completion-indent-adjust 2019-03-04 00:27:18 +01:00
f288a64264 edit.c: Disable indent during completion
closes #8345
2019-03-03 23:08:08 +01:00
bcbb96e31b Merge pull request #9667 from bfredl/winclose
api: add nvim_win_close() to close window by id
2019-03-03 17:30:58 +01:00
8e54847fdf Merge #9666 'Fix completion of multibyte env var names' 2019-03-03 13:45:38 +01:00
c8f310825c api: add nvim_win_close() to close window by id 2019-03-03 13:09:43 +01:00
bb8ea83d75 test: multibyte env var names #9655 2019-03-03 11:23:12 +01:00
cef0107c14 os/env: Fix completion of multibyte env var names
fixes #9655
2019-03-03 11:22:59 +01:00
14c53e4cbe vim-patch:8.1.0971: failure to select quoted text obj moves cursor #9658
closes #9640

Problem:    Failure for selecting quoted text object moves cursor.
Solution:   Restore the Visual selection on failure. (Christian Brabandt,
            closes vim/vim#4024)
55d3bdbbe2
2019-03-03 11:04:32 +01:00
7a6da502b9 Merge pull request #6619 from bfredl/floating
Floating windows in TUI and Remote UI
2019-03-02 17:26:50 +01:00
9a1675b065 floats: implement floating windows
Co-Author: Dongdong Zhou <dzhou121@gmail.com>
2019-03-02 16:29:50 +01:00
0aba4d825a ops.c: do_join expects count of 2 or greater #6855
test_normal.vim fails if we assert >= 2, so we only check >= 1. That at
least avoids invalid pointers.

    TEST_FILE=test_normal.res make oldtest
2019-03-02 04:52:03 +01:00
8ba484ab69 vim-patch.sh: mention URL for hub tool #9659
closes #9659
2019-03-02 03:26:11 +01:00
d44ab5fdea search.c: remove dead code #5307
has_mbyte is always true.
2019-03-02 03:13:00 +01:00
ed4132d7e9 cleanup: remove legacy enc_dbcs global #9660 2019-03-02 02:33:36 +01:00
708176aea1 screen.c: remove dead code #6609
enc_utf8, enc_dbcs, has_mbyte are always true, so the false branches are
never taken.
2019-03-02 01:23:15 +01:00
018e0d5a19 API/buffer-updates: always detach on buf-reload #9643
Independently of the 'undoreload' option and the length of the file.
closes #9642
closes #9643
2019-03-01 20:01:50 +01:00
6cd4ff2ab7 os: remove uv_translate_sys_error impl #9652
Since libuv minimum version is now v1.12, we can use libuv's impl.
2019-03-01 02:34:32 +01:00
085f0f1b1b Merge #9653 from justinmk/vim-8.1.0985 2019-03-01 02:32:13 +01:00
e7bd49d835 Merge #7920 'env: use libuv v1.12 getenv/setenv API' 2019-03-01 02:30:05 +01:00
e116b0f61f vim-patch:8.1.0973: pattern with syntax error gives threee error messages
Problem:    Pattern with syntax error gives threee error messages. (Kuang-che
            Wu)
Solution:   Remove outdated internal error.  Don't fall back to other engine
            after an error.
cd62512c55
2019-03-01 01:56:17 +01:00
ff98f61601 vim-patch:8.1.0965: search test fails
Problem:    Search test fails.
Solution:   Wait a bit longer for the 'ambiwidth' redraw.
e86ecbd922
2019-03-01 01:56:17 +01:00
1a0ee090ab vim-patch:8.1.0963: illegal memory access when using 'incsearch'
Problem:    Illegal memory access when using 'incsearch'.
Solution:   Reset highlight_match when changing text. (closes vim/vim#4022)
4a7d2d3b40
2019-03-01 01:56:17 +01:00
b183534c81 vim-patch:8.1.0968: crash when using search pattern \%Ufffffc23
Problem:    Crash when using search pattern \%Ufffffc23.
Solution:   Limit character to INT_MAX. (closes vim/vim#4009)
527a2d86fb
2019-03-01 01:56:17 +01:00
403922b1b4 test: fix isCI() for Quickbuild 2019-03-01 01:48:46 +01:00
67535b5940 test/env: multibyte env var to child process
Note: the test fails on non-Windows CI (Travis linux, Quickbuild bsd):
even on master before the env.c changes in this patch-series.
Maybe the unix part of printenv-test.c needs to be revisited.

Signed-off-by: Justin M. Keyes <justinkz@gmail.com>
2019-02-28 22:40:11 +01:00
900e96781f clint: check env functions 2019-02-28 12:48:21 +01:00
a66b1d4615 vim-patch:8.1.0985: crash with large number in regexp
Problem:    Crash with large number in regexp. (Kuang-che Wu)
Solution:   Check for long becoming negative int. (closes #)
ab350f89f9
2019-02-28 12:07:25 +01:00
89515304e4 os/env: use libuv v1.12 getenv/setenv API
- Minimum required libuv is now v1.12
- Because `uv_os_getenv` requires allocating, we must manage a map
  (`envmap` in `env.c`) to maintain the old behavior of `os_getenv` .
- free() map-items after removal. khash.h does not make copies of
  anything, so even its keys must be memory-managed by the caller.

closes #8398
closes #9267
2019-02-27 23:29:07 +01:00
1d8e768360 os_getenv, os_setenv: revert "widechar" impl
It's reported that the Windows widechar variants do automatically
convert from the current codepage to UTF16, which is very helpful. So
the "widechar" impls are a good direction.  But libuv v1.12 does that
for us, so the next commit will use that instead.

ref #8398
ref #9267
2019-02-26 22:38:52 +01:00
865584dd0c win: os_getenv(): use _wgetenv() 2019-02-25 23:47:54 +01:00
76562fa192 utf16_to_utf8: minor fixes 2019-02-25 23:47:54 +01:00
9153062095 os_setenv: use _wputenv_s; remove vestigial code #7920
_putenv_s variant was left over from 810d31a430, should have been
removed in cd5b131575.
2019-02-25 23:47:54 +01:00
533d4a36ec TUI: do not resize host-terminal on startup (#9645)
...unless the 'lines' and/or 'columns' options were set.

ref 5732340c20
fixes #5843
2019-02-25 23:30:12 +01:00
88652c49a8 vim-patch:8.1.0980: extend() insufficiently tested (#9646)
Problem:    extend() insufficiently tested.
Solution:   Add more tests. (Dominique Pelle, closes vim/vim#4040)
58d63a0a23
2019-02-25 11:34:55 +01:00
3b2d5317a5 vim-patch:8.1.0225: mode() does not indicate using CTRL-O from Insert mode (#9644)
Problem:    Mode() does not indicate using CTRL-O from Insert mode.
Solution:   Add "niI", "niR" and "niV" to mode() result. (closes vim/vim#3000)
612cc3888b
2019-02-24 21:44:31 +01:00
9327ea3e5a vim-patch:8.1.0959: sorting large numbers is not tested (#9641)
Problem:    Sorting large numbers is not tested and does not work properly.
Solution:   Add test.  Fix comparing lines with and without a number.
            (Dominique Pelle, closes vim/vim#4017)
a25e3d0695
2019-02-23 11:54:41 +01:00
246408621c Merge #9509 'TUI: detect background color' 2019-02-22 22:14:38 +01:00
d3dc946155 TUI: rework background-color detection
- Like Vim, use set_option_value() followed by reset_option_was_set().
- Do not use set_string_default(), so the default is predictable.
  This affects `:set bg&`.
- Wait until end-of-startup (VimEnter) to handle the response. The
  response is racey anyways, so timing is irrelevant. This allows
  OptionSet to be triggered, unlike during startup.
2019-02-22 21:15:16 +01:00
4f453830f7 Merge #9637 from justinmk/win-libuv-update
win/deps: update to (forked) libuv v1.26.0
2019-02-21 23:16:32 +01:00
27c3143466 third-party: libtermkey v0.20 -> v0.21.1
$ bzr log --line --forward -r v0.20..

372: Paul "LeoNerd" Evans 2017-03-30 {v0.20} Bumped VERSION to 0.20
373: Paul "LeoNerd" Evans 2017-04-10 [merge] Apply typo fixes from jamessan
374: Paul "LeoNerd" Evans 2017-11-29 Build termkey.pc by invoking a small shell script instead of sed'ing a template
375: Paul "LeoNerd" Evans 2018-03-29 Implement mouse key parsing (thanks Marc André Tanner <mat@brain-dump.org>)
376: Paul "LeoNerd" Evans 2019-01-02 Bugfix for infinite CPU spin on TERM=dumb, which has no terminfo key strings
377: Paul "LeoNerd" Evans 2019-02-14 Fix a couple of valgrind-cleanness errors in DEBUG mode
378: Paul "LeoNerd" Evans 2019-02-14 Fix valgrind uninitialised value warning
379: Paul "LeoNerd" Evans 2019-02-14 Remember to unibi_destroy() even if we never (lazily) loaded terminfo
380: Paul "LeoNerd" Evans 2019-02-14 Bugfix memory leak in TI driver on xterm
381: Paul "LeoNerd" Evans 2019-02-17 driver-ti.c does not need a separate TYPE_MOUSE node type since TERMKEY_TYPE_MOUSE already exists
382: Paul "LeoNerd" Evans 2019-02-17 Perform TI string lookup by iterating all the strings we care about, rather than iterating everything in the DB; that way a hook function can invent new strings
383: Paul "LeoNerd" Evans 2019-02-17 Avoid nonstandard \e sequence in unit tests (via neovim https://github.com/neovim/neovim/blob/master/third-party/patches/libtermkey-Fix-escape-sequences-for-MSVC.p...
384: Paul "LeoNerd" Evans 2019-02-17 win32: Win32 lacks <unistd.h> and S_ISFIFO()
385: Paul "LeoNerd" Evans 2019-02-17 win32: Win32 needs help to get ssize_t
386: Paul "LeoNerd" Evans 2019-02-17 win32: Win32 has no <termios.h>
387: Paul "LeoNerd" Evans 2019-02-17 win32: Win32 has no poll() so cannot provide termkey_waitkey()
388: Paul "LeoNerd" Evans 2019-02-17 win32: Win32 has no <strings.h> and needs help getting strcasecmp()
389: Paul "LeoNerd" Evans 2019-02-17 Write the version into the .pc file at 'make install' time so we don't get@VERSION@ from source
390: Paul "LeoNerd" Evans 2019-02-19 {v0.21} Bumped VERSION to 0.21
391: Paul "LeoNerd" Evans 2019-02-19 Bugfix to missing TERMIOS support
392: Paul "LeoNerd" Evans 2019-02-19 Fix offbyone buffer overflow in sprintf calculation of key names (neovim #9630)
393: Paul "LeoNerd" Evans 2019-02-19 {v0.21.1} Remove a pointless (and warny) cast

Our local patches are now part of the libtermkey repo and get removed.
2019-02-21 22:23:54 +01:00
6784ed206a win/deps: update to (forked) libuv v1.26.0
ref c59aa771a6
2019-02-21 19:43:10 +01:00
0be6d3c86f Merge #9634 'fsync: Ignore ENOTSUP. Fix writing to SMB.' 2019-02-21 19:38:24 +01:00
996916277d I/O: ignore ENOTSUP for failed fsync()
Suggested by ZyX in https://github.com/neovim/neovim/issues/6725#issuecomment-312197691 :
> There already is an exception if writing to a “device” (e.g. FIFO).
> It makes sense to ignore certain errors like ENOTSUP or EOPNOTSUPP
> since it is not something we or user can do anything about.

ref #6725
2019-02-21 02:00:51 +01:00
c59aa771a6 deps: update to libuv v1.26.0
Notable changes since v1.23.2:

- v1.26.0
  - uv_os_uname()
  - unix: don't attempt to invalidate invalid fd
    1ce6393a57
- v1.25.0
  - unix: better handling of unsupported F_FULLFSYNC (fixes #6725)
    6fc797c3fe
  - tty,win: fix Alt+key under WSL
    d2e59bb600
  - fsevents: really watch files with fsevents on macos 10.7+
    2d2af382ce
  - win: fix duplicate tty vt100 fn key
- v1.24.0
  - win,fs: retry if uv_fs_rename fails
    e94c184c7c
    - later [reverted](https://github.com/libuv/libuv/issues/2098) but may be useful reference
  - win: support more fine-grained windows hiding
    4c2dcca27b
2019-02-21 02:00:51 +01:00
0e97d3d4ee fix "E667: Fsync failed" on macOS
macOS: Try direct fsync() if F_FULLFSYNC fails.
closes #6725
ref https://github.com/vim/vim/pull/4016
vim-patch:8.1.0957

> on macOS F_FULLFSYNC fails with ENOTSUP for unsupported storage systems
> (e.g. SMB), though this is not documented in the Apple fcntl man page.

libuv fixed this in v1.25.0:
6fc797c3fe
2019-02-21 02:00:51 +01:00
40f5a6c4da man.vim: g:man_hardwrap #9633
This option allows restoring the behaviour prior to #9023.
Fixes #9583
Closes #9633
2019-02-21 00:06:26 +01:00
ece19b459c Merge #9626 from janlazo/vim-8.1.0926 2019-02-18 10:40:33 +01:00
9cf600e702 Merge #9625 from janlazo/vim-8.1.0945 2019-02-18 10:37:56 +01:00
d595ca021d vim-patch:8.1.0276: no test for 'incsearch' highlighting with :s
Problem:    No test for 'incsearch' highlighting with :s.
Solution:   Add a screendump test.
164251ff80
2019-02-17 21:59:49 -05:00
a4a024245b vim-patch:8.1.0387: no test for 'ambiwidth' detection
Problem:    No test for 'ambiwidth' detection.
Solution:   Add a test.
24839edc54
2019-02-17 21:47:12 -05:00
0735893caf vim-patch:8.1.0668: no test for overstrike mode in the command line
Problem:    No test for overstrike mode in the command line.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3742)
c0676bab92
2019-02-17 20:10:36 -05:00
486234ab3d vim-patch:8.1.0937: invalid memory access in search pattern
Problem:    Invalid memory access in search pattern. (Kuang-che Wu)
Solution:   Check for incomplete collation element. (Dominique Pelle,
            closes vim/vim#3985)
f1b57ab2ab
2019-02-17 19:37:44 -05:00
279ecaff00 vim-patch:8.1.0934: invalid memory access in search pattern
Problem:    Invalid memory access in search pattern. (Kuang-che Wu)
Solution:   Check for incomplete equivalence class. (closes vim/vim#3970)
985079c514
2019-02-17 19:35:41 -05:00
67c99ec620 vim-patch:8.1.0926: no test for :wnext, :wNext and :wprevious
Problem:    No test for :wnext, :wNext and :wprevious.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3963)
e93e5a504f
2019-02-17 19:31:57 -05:00
d8b4fb7838 lint 2019-02-17 19:14:40 -05:00
55821948cf vim-patch:8.1.0945: internal error when using pattern with NL in the range
Problem:    Internal error when using pattern with NL in the range.
Solution:   Use an actual newline for the range. (closes vim/vim#3989)  Also fix
            error message.  (Dominique Pelle)
a5483448cb
2019-02-17 19:11:16 -05:00
6b827bb664 build: checkprefix: skip if empty #9624
This regressed in 3b473bb14f:
```
% make 'CMAKE_BUILD_TYPE=RelWithDebInfo' 'CMAKE_EXTRA_FLAGS=-DCMAKE_INSTALL_PREFIX=/vim-build/neovim/neovim/master -DENABLE_JEMALLOC=OFF' 'DEPS_CMAKE_FLAGS=-DUSE_BUNDLED=OFF'

error: CMAKE_INSTALL_PREFIX '/vim-build/neovim/neovim/master' does not match cached value ''
       Run this command, then try again:
         cmake build -DCMAKE_INSTALL_PREFIX=/vim-build/neovim/neovim/master
make: *** [Makefile:169: checkprefix] Error 1
```

It was checking before for non-empty also [1].

1: https://github.com/neovim/neovim/pull/9621/files#diff-b67911656ef5d18c4ae36cb6741b7965L22
2019-02-17 21:41:42 +01:00
6bd6927656 Merge #5027 'TUI: detect background color' 2019-02-17 14:47:40 +01:00
33ce70c883 vim-patch:8.1.0932: remove Farsi support (#9622)
Problem:    Farsi support is outdated and unused.
Solution:   Delete the Farsi support.
14184a3133
2019-02-17 10:54:00 +01:00
dc9dd8d664 Merge #9593 'API: nvim_create_buf: "scratch" param' 2019-02-17 08:32:25 +01:00
5225c1ec30 terminal: Fix potential invalid local 'scrollback' (#9605)
TermOpen autocmd may set local 'scrollback' to -1, this needs to be
adjusted as in on_scrollback_option_changed().

fixes #9588 (OOM, out of memory)
2019-02-17 08:07:30 +01:00
aee29e51a6 API: nvim_create_buf: add scratch parameter
Creating a scratch buffer is a chore/ritual, and would be more
useful/common if formally exposed.
2019-02-17 06:58:03 +01:00
3b473bb14f build/Makefile: validate prefix for specific targets (#9621)
`clean` and `distclean` should not check CMAKE_INSTALL_PREFIX.
ref #9615

Helped-by: bruce-hill
2019-02-17 05:28:32 +01:00
023e832d40 vim-patch:8.1.0803: session restore: handle single quotes #9620
Problem:    Session file has problem with single quote in file name. (Jon
            Crowe)
Solution:   Use a double quoted string.  Add a test.

ad36a3588d

Fixes https://github.com/neovim/neovim/issues/9618
2019-02-17 05:00:14 +01:00
9bfd304459 Merge #9617 2019-02-16 03:35:04 +01:00
05c6c6ae08 build/Makefile: check CMAKE_INSTALL_PREFIX
closes #9615
2019-02-16 00:49:53 +01:00
4397bf5785 build/CMakeLists.txt: group related logic
- Group CMAKE_BUILD_TYPE-related logic together.
- Print the MIN_LOG_LEVEL message (in the build-log) next to the
  CMAKE_BUILD_TYPE message.
2019-02-16 00:38:20 +01:00
4031e93c45 Merge #9614 2019-02-16 00:37:35 +01:00
3d3a54f455 clang/"null pointer dereference": win_rotate 2019-02-14 05:54:42 +01:00
b7f518cbfa PVS/V1028: cast operands, not the result 2019-02-14 05:49:35 +01:00
969cc55993 vim-patch:8.1.0852: findfile() and finddir() are not properly tested (#9609)
Problem:    findfile() and finddir() are not properly tested.
Solution:   Extend the test and add more. (Dominique Pelle, closes vim/vim#3880)
ed71ed37bc
2019-02-13 08:30:30 +01:00
73dffc5053 Merge #9589 from justinmk/cterm-pumblend
UI: 'pumblend' for cterm (256-color TUI)
2019-02-12 20:22:28 +01:00
e50d0b6fc1 UI: change implementation of hl_rgb2cterm_color()
Replace the implementation cargo-culted from Vim's source with something
simpler which "seems to look better" with 'pumblend'.
2019-02-12 10:11:30 +01:00
c5173230f0 UI: 'pumblend' for cterm (256-color TUI)
hl_rgb2cterm_color, hl_cterm2rgb_color were adapted from Vim 8.1
(color2index, cterm_color2rgb).
ref: c5cd88554f
2019-02-12 09:26:06 +01:00
9b4383261a Merge #9601 from justinmk/tui-italic 2019-02-12 08:51:10 +01:00
1083c626b9 TUI: assume italics support in all xterm-likes
https://github.com/neovim/neovim/issues/9598#issuecomment-462421302
> On systems other than macOS, terminfo always has them set. It's part
> of the ANSI standard SGR codes
2019-02-12 08:09:21 +01:00
5e44a5945a Merge pull request #9603 from bfredl/reversepum
highlight: handle blending with gui=reverse and guisp attribute
2019-02-11 21:22:02 +01:00
af51ae944e highlight: handle blending with gui=reverse and guisp attributes 2019-02-11 19:38:02 +01:00
1b746c0ea9 TUI: sniff nsterm (Terminal.app) from $TERM_PROGRAM 2019-02-11 11:02:48 +01:00
ee21fe3d2a TUI: force italics in tmux
tmux users are encouraged to use "tmux-256color" instead of the old
"screen-256color". Put this in your .tmux.conf :

    if-shell 'infocmp tmux-256color' 'set -g default-terminal "tmux-256color"' 'set -g default-terminal "screen-256color"'

If default-terminal is "tmux-256color" AND tmux finds its terminfo, THEN
it will enable italics (regardless of whether the terminfo contains
sitm/ritm).

OTHERWISE tmux "emulates screen", which means it emits italics as
"reverse". That's unfortunate, but it's an acceptable compromise that
allows Nvim to support italics in tmux by default in compatible (and
increasingly-common) configurations.

Test case:

    tmux
    nvim -u NORC +'hi Comment cterm=italic' CMakeLists.txt

ref #9598
2019-02-11 10:52:30 +01:00
2beb731ed4 TUI: italics in Terminal.app (nsterm)
This is the conservative approach, requiring TERM=nsterm as recommended
at `:help $TERM`.  It won't work with Terminal.app's default of
TERM=xterm-256color, nor in tmux.

Test case:

    TERM=nsterm nvim -u NORC +'hi Comment cterm=italic' CMakeLists.txt

closes #9598
2019-02-11 10:51:52 +01:00
b3ce0019a7 Merge pull request #7466 from bfredl/ext_messages
ui: implement ext_messages to externalize all messages in msg area
2019-02-10 14:55:12 +01:00
51fc54325c ui: implement ext_messages
Co-Author: Dongdong Zhou <dzhou121@gmail.com>
2019-02-10 13:36:46 +01:00
3ff1228f78 Merge pull request #9272 from bfredl/createbuf
api: add nvim_create_buf to create a new empty buffer.
2019-02-09 15:01:06 +01:00
c9d01ff7db doc: 'fillchars' is local to window
This was forgotten in 352811fe5 since the commit was originally meant to only
change 'listchars'.
2019-02-09 12:21:24 +01:00
891ed14f13 api: add nvim_create_buf to create a new empty buffer.
Loading existing files into a buffer is non-trivial and requires a window.
Creating an unnamed emtpy buffer is trivial and safe though, thus worth a
special case.

Change nvim_buf_set_option to use aucmd_prepbuf. This is necessary
to allow some options to be set on a not yet displayed buffer, such
as 'buftype' option.

vim-patch:7.4.1858: Add BLN_NEW to enforce buflist_new creating new buffer
2019-02-09 11:48:45 +01:00
f6faeea41c Merge pull request #9586 from bfredl/screencleanup
screen: cleanup allocation and scrolling
2019-02-07 21:41:45 +01:00
be8058cfe4 screen: cleanup allocation, clearing and validation
grid_xx functions shouldn't randomly be called when the screen is not valid.
Nvim deterministically initializes a default screen early in main(), so the
default grid can be assumed to be allocated.
2019-02-07 17:56:02 +01:00
6e9ea5adce screen: simplify scrolling code
Since the separation between internal screen and TUI, internal scroll
cannot FAIL. Delete the conditions for this.
2019-02-07 17:56:02 +01:00
fa2580f953 Merge pull request #9571 from bfredl/pum_transparent
UI: implement 'pumblend' option for semi-transparent popupmenu
2019-02-07 17:52:58 +01:00
37f8df8824 UI: implement 'pumblend' option for semi-transparent popupmenu
Why?

- Because we can.
- Because the TUI is just another GUI™
- Because it looks kinda nice, and provides useful context like 1 out of 100
  times

Complies with "don't pay for what you don't use".

Some crashes for resizing were unfolded, add tests for those.
2019-02-07 16:43:51 +01:00
ed0e96cd28 man.vim: set 'linebreak'
closes #9583
2019-02-06 22:18:34 +01:00
c9b7f0c249 Merge pull request #9581 from bfredl/alwaysrgb
UI: always use contrete colors for default_colors_set
2019-02-05 20:59:07 +01:00
baf93d9606 UI: always use contrete colors for default_colors_set
But add an escape hatch needed for external TUI, so it still can use
terminal emulator defaults.
2019-02-05 19:41:38 +01:00
36378c33c6 Merge #9560 from justinmk/Wmissing-prototypes 2019-02-04 19:40:14 +01:00
45f25f7e0b build: PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES
On Travis CI, -Wmissing-prototypes gives strange error:

    In file included from ../src/nvim/eval.c:5965:
    /home/travis/build/neovim/neovim/build/src/nvim/auto/funcs.generated.h.gperf:215:1: error: conflicting types for 'find_internal_func_gperf'
    find_internal_func_gperf (register const char *str, register unsigned int len)
    ^
    ../src/nvim/eval.c:5962:20: note: previous declaration is here
    const VimLFuncDef *find_internal_func_gperf(register const char *str,
                   ^
2019-02-04 13:16:59 +01:00
f2c6164b04 build: -Wmissing-prototypes
ref #343

Though I don't see a strong benefit, it isn't too much of a burden, and
maybe avoids confusion in some cases.
2019-02-04 04:00:20 +01:00
4386814b04 build: set compiler options in one place
- add_definitions() is preferred to CMAKE_C_FLAGS.
2019-02-04 02:57:18 +01:00
91688b4883 options: set 'scrollback' to -1 by default #9563
Makes the 'scrollback' option more consistent (same default for all buffers) and future-proof.

- Default to -1 for all buffers, but treat it as an implementation detail.
- Document range of 1 - 100_000.
- New terminal buffer by default sets scrollback=10_000 if the global default is -1.
- Existing terminal buffer: On entering terminal-mode or on refresh, if the user explicitly did `:set[local] scbk=-1`, the local value goes to 100_000 (max). (This is undocumented on purpose. Users should work with explicit values in the range of 1-100_000.)
2019-02-04 02:53:23 +01:00
70f6939fd4 events: add "Signal" event #9564
..which gets triggered when SIGUSR1 is sent to the nvim process.

Closes #9562
2019-02-04 02:39:05 +01:00
da88278f27 Merge pull request #9579 from bfredl/pum_fix
popupmenu: fix alignment of kind and extra after #9530
2019-02-03 22:17:28 +01:00
08155e2b53 Merge #9578 'vim-patch:8.0.{1045,1073,1077,1114}' 2019-02-03 21:36:32 +01:00
81ac8e9015 popupmenu: fix alignment of kind and extra after #9530 2019-02-03 20:43:23 +01:00
01b4efe9d9 rename ui_is_external to ui_has (#9576) 2019-02-03 16:42:44 +01:00
5a40abe2d5 vim-patch:8.0.1114: default for 'iminsert' is annoying
Problem:    Default for 'iminsert' is annoying.
Solution:   Make the default always zero. (Yasuhiro Matsumoto, closes vim/vim#2071)
4cf56bbc85
2019-02-03 09:52:13 -05:00
45fadf7323 vim-patch:8.0.1077: no debugger making use of the terminal window
Problem:    No debugger making use of the terminal window.
Solution:   Add the term debugger plugin.  So far only displays the current
            line when stopped.
fe386641b0
2019-02-03 08:51:11 -05:00
c1ef241390 vim-patch:8.0.1073: may get an endless loop if 'statusline' changes a highlight
Problem:    May get an endless loop if 'statusline' changes a highlight.
Solution:   Do not let evaluating 'statusline' trigger a redraw.
ba2929b6af
2019-02-03 08:32:51 -05:00
79a0ea2bec Merge pull request #9530 from bfredl/pum_float
Implement popupmenu as a floating grid internally to reduce flicker
2019-02-02 21:27:09 +01:00
0f96a21e3f multigrid: reset win scrolling after swap message 2019-02-02 16:31:49 +01:00
bfe2435459 tests/ui: add test for popupmenu redrawing in various situations
Many of these are handled by the compositor. Check that it causes
no glitches.
2019-02-02 16:31:49 +01:00
69bdc4f072 ui/compositor: add redraws needed due to intersected doublewidth chars. 2019-02-02 16:31:49 +01:00
2405cf8255 vim-patch:8.1.0792: bad display if opening cmdline window from Insert completion 2019-02-02 16:31:49 +01:00
2c01e79dc4 Reduce pum redraws from edit.c by delaying undisplay of pum
This makes it possible for the compositor to compare the old pum with
the new position, and only clear what is necessary.
2019-02-02 16:31:49 +01:00
31cbd34d97 UI: add "compositor" layer to merge grids for TUI use in a correct way
Initially we will use this for the popupmenu, floating windows will
follow soon

NB: writedelay + compositor is weird, we need more flexible
redraw introspection.
2019-02-02 16:31:49 +01:00
29db365e4c vim-patch:8.0.1045: running tests may pollute shell history
Problem:    Running tests may pollute shell history. (Manuel Ortega)
Solution:   Make $HISTFILE empty.
6a8691d483
2019-02-02 07:38:53 -05:00
f89d0d8230 inccommand: auto-disable if folding is slow #9568
Fixes #9557
2019-02-01 01:40:01 +01:00
ada82f3482 Merge #9565 from justinmk/test 2019-01-31 22:27:12 +01:00
a494910aa1 test: adjust timer_spec 2019-01-31 22:26:32 +01:00
d4750100b0 test: improve reliability of ":terminal topline" test
- Avoid using platform-specific shell, it failed in MINGW_64 env.
- tty-test.c echos our input, which is exactly what we need for this test.
- Test fails correctly if 894f6bee54 is reverted.
2019-01-31 22:26:32 +01:00
894f6bee54 :terminal : set topline based on window height #8325
closes #8324
closes #8556
2019-01-29 03:00:48 +01:00
28f87c505d Merge #9539 "options: make 'listchars' and 'fillchars' local to window" 2019-01-28 00:45:59 +01:00
7e6980a161 doc [ci skip] (#9553) 2019-01-27 15:06:11 +01:00
8171e96b96 Merge pull request #9551 from bfredl/multiterm
Fix :terminal resizing, and some multigrid size cleanup
2019-01-27 14:15:08 +01:00
de16c0bf64 screen: simplify wp->w_lines allocation logic 2019-01-27 12:07:06 +01:00
30bd1c1e85 terminal: handle size when switching buffers in window 2019-01-27 12:07:06 +01:00
2ab70cb55c window/ui: reorganize size variables, fix terminal window size with multigrid.
wp->w_height_inner now contains the "inner" size, regardless if the
window has been drawn yet or not. It should be used instead of
wp->w_grid.Rows, for stuff that is not directly related to accessing
the allocated grid memory, such like cursor movement and terminal size
2019-01-27 12:07:06 +01:00
80b75bc99a screen: remove superfluous default_grid indirection for global size
This was changed by mistake in multigrid PR.
default_grid.Rows rather corresponds to the old screen_Rows
2019-01-27 12:07:06 +01:00
d9406f4b64 terminal: simplify sizing logic 2019-01-27 12:07:06 +01:00
f2398a766e vim-patch:8.0.0413: menu test fails on MS-Windows #8173
Problem:    Menu test fails on MS-Windows using gvim.
Solution:   First delete the English menus.
a1c8ecfda9
2019-01-27 01:35:00 +01:00
9697c7f56a Merge #8194 from justinmk/fix-menu
fix ":menu Item.SubItem", fix menu_get("foo")
2019-01-27 01:32:12 +01:00
1a3d2dbfe7 menu_get(): fix query behavior
- Return the menu properties, not only its children.
- If the {path} param is given, return only the first node. The "next"
  nodes in the linked-list are irrelevant.
2019-01-27 00:51:58 +01:00
d760e08fac menu_get(): Do not include empty items
Caused by a typo: `dict` instead of `dic`. Renamed variable to `d` to
make it less similar.
2019-01-27 00:51:58 +01:00
827ed144fb fix ":menu Item.SubItem"
:menu should print sub-menu contents. E.g. this should print the
"File.Save" submenu:

    nvim -u NORC
    :source $VIMRUNTIME/menu.vim
    :menu File.Save

Regressed in dc685387a3
Blocks #8173

menu_get() also was missing some results for some cases.
2019-01-27 00:51:58 +01:00
d63b534f31 Merge #9478 from justinmk/doc 2019-01-26 21:41:01 +01:00
cd64f5abd4 gen_api_vimdoc.py: Do not wrap on hyphens, long words
- Any long symbol is intentional and should never be hardwrapped.
- Vim help tags are often hyphenated, and hardwrapping on hyphens breaks
  the Vim help syntax parser.
2019-01-26 20:38:14 +01:00
c70c8b607f doc [ci skip] #9478
- Lua
- developer guidelines
- MAINTAIN.md
- TUI: cleanup
- TUI: mention Windows terminfo builtins
- cleanup if_pyth, redirect python-bindeval tag

Helped-by: Björn Linse <bjorn.linse@gmail.com>
Helped-by: erw7 <erw7.github@gmail.com>
2019-01-26 20:38:14 +01:00
2132bbf919 Merge #9552 from janlazo/vim-8.0.0411 2019-01-26 16:19:02 +01:00
88b0899eb4 tests: 'fcs' and 'lcs' are local to the window 2019-01-26 15:10:46 +01:00
2ae97f3d4c vim-patch:8.1.0759: showing two characters for tab is limited
Problem:    Showing two characters for tab is limited.
Solution:   Allow for a third character for "tab:" in 'listchars'. (Nathaniel
            Braun, Ken Takata, closes vim/vim#3810)

83a52171ba
2019-01-26 14:45:48 +01:00
2418aa3a4a linter: fix issues 2019-01-26 14:45:48 +01:00
df5534f576 tests: fix mouse tests that use lcs=eol:$
Previously the mouse tests set 'listchars', but not 'list'. Funnily enough, the
space, where the `$` would normally appear, would still use new highlight group.

Set 'list' for good and fix the tests accordingly.
2019-01-26 14:45:47 +01:00
352811fe5f options: make 'fillchars'/'listchars' local to window
Using 'listchars' is a nice way to highlight tabs that were included by accident
for buffers that set 'expandtab'.

But maybe one does not want this for buffers that set 'noexpandtab', so now one
can use:

    autocmd FileType go let &l:listchars .= ',tab:  '
2019-01-26 14:45:47 +01:00
64f91fa1fd vim-patch:8.0.0412: menu test fails on MS-Windows
Problem:    Menu test fails on MS-Windows.
Solution:   Use a menu entry with only ASCII characters.
5558d19432
2019-01-26 08:44:30 -05:00
1338702b2b vim-patch:8.0.0411: menu translations don't match when case is changed.
Problem:    We can't change the case in menu entries, it breaks translations.
Solution:   Ignore case when looking up a menu translation.
11dd8c1201
2019-01-26 08:43:57 -05:00
ec5a4d862d checkhealth: validate locale (#9548)
Test case:

    LANG= LC_ALL= LC_CTYPE= tmux
    nvim -u NORC +'checkhealth nvim'
2019-01-26 00:41:42 +01:00
6e6bc3b6c0 Merge pull request #9520 from bfredl/errmsg2
Lua: format multiline messages / emsgf_multiline()
2019-01-23 20:48:44 +01:00
3b56f59532 :terminal : Fix F1-F4 key codes (#9535)
fixes #9529
2019-01-23 19:51:23 +01:00
f7b174eb71 tests/lua: test for multiline error messages in lua 2019-01-23 19:34:13 +01:00
27b7813025 cleanup: reduce some duplicate code, avoid function pointers for a condition
Add 'multiline' flag to history for correct :messages output

Use larger buffer size for multiline messages. if this turns out to not
be enough, we could do size calculation like api_set_error
2019-01-23 19:34:13 +01:00
9e54778e7c Merge pull request #9538 from beeender/patch-1
Fix api doc nvim_buf_lines_event example
2019-01-22 22:09:16 +01:00
67bac681ea ex_echo: reuse code from message.c to show arg to user 2019-01-22 20:16:12 +01:00
7f2e43c637 message.c: add msg_echo_attr functions, use it for lua error messages
The added function behaves like the non-echo function but display message
in a echo-style way (i.e. tab and newline are preserved)
2019-01-22 20:15:27 +01:00
09f6b1f2cb Fix api doc nvim_buf_lines_event example
when send_buffer=true, the first nvim_buf_lines_event will come with
lastline=-1 instead of 0.
2019-01-22 11:43:44 +08:00
bfb8170d32 PVS/V1028 (rework): cast operands, not the result #9531
closes #9522
2019-01-21 23:49:58 +01:00
4cea88aa37 CI/codecov: fix invalid yaml [ci skip]
To validate:

    cat codecov.yml | curl --data-binary @- https://codecov.io/validate
2019-01-21 19:45:47 +01:00
969618ebb5 Merge #9532 from justinmk/fix-fpclassify 2019-01-21 10:08:27 +01:00
226352afcb build: Fix -Wconversion warnings for fpclassify et al
closes #8274

The parent commit tries a different approach, but that fails on Apple
Clang version:
    Apple LLVM version 10.0.0 (clang-1000.11.45.5)
    Target: x86_64-apple-darwin17.7.0
which somehow compiles the check_c_source_compiles() check, but then
complains during later compilation that __fpclassify is not defined
(regardless of "#include <math.h>").
2019-01-21 00:32:34 +01:00
c6a039d087 build: Fix -Wconversion warnings for fpclassify et al
closes #8274

- Instead of #undef and re-#define, define "xfoo" wrappers to avoid
  include-order sensitivity.
- The warnings are bogus, caused by bad interaction between glibc and
  clang 6+.
  - https://bugs.llvm.org/show_bug.cgi?id=35268
  - https://bugs.llvm.org/show_bug.cgi?id=39738
  - https://bugzilla.redhat.com/show_bug.cgi?id=1472437
2019-01-20 23:51:12 +01:00
53c0f0bba5 CI/codecov: remove "only_pulls" directive [ci skip]
Since this was added, codecov has been adding comments to every PR, even
though we have specified `comment: off`.
2019-01-20 23:10:25 +01:00
7e3300f717 Merge pull request #9526 from jamessan/remove-jemalloc
Remove support for using jemalloc instead of the system allocator
2019-01-20 13:58:38 -05:00
62254d2cc0 Merge pull request #9429 from bfredl/grid_mouse
API/UI: add nvim_input_mouse() including multigrid mouse support
2019-01-20 13:36:20 +01:00
ed6b44e1be Merge #9525 'STRICT_ADD, STRICT_SUB: Log error' 2019-01-20 12:32:41 +01:00
a2be9c7218 ui: multigrid mouse support 2019-01-20 10:32:05 +01:00
c11b79ce51 STRICT_ADD, STRICT_SUB: Log error before abort 2019-01-20 00:18:39 +01:00
dbba685c69 build: include auto/config.h explicitly
Otherwise the symbols defined in config/config.h.in may not be defined,
depending on include-order.
2019-01-20 00:18:39 +01:00
c2343180d7 Remove support for using jemalloc instead of the system allocator
There was never any investigation done to determine whether using
jemalloc was actually a net benefit for nvim.  It has been a portability
limitation and adds another factor to consider when triaging issues.
2019-01-19 18:09:52 -05:00
f2cc9e8826 pvscheck.sh: set --sourcetree-root [ci skip]
Reverts previous experiment. PVS root is working correctly, one can
observe this in the PVS-studio.err file, for example:

    /usr/local/clang-7.0.0/lib/clang/7.0.0/include/stddef.h:51:1: warning: V677 ...
    /usr/local/clang-7.0.0/lib/clang/7.0.0/include/stddef.h:132:1: warning: V677 ...
    ./src/nvim/fileio.c:1382:1: warning: V1026 ...
    ./src/nvim/fileio.c:1388:1: warning: V1026 ...

The "./src/nvim/…" paths are correctly rooted, yet PVS somehow still
thinks it should analyze "/usr/local/clang-7.0.0/…".

See also: https://stackoverflow.com/q/44906903
2019-01-19 22:13:58 +01:00
391f0c1ce7 pvscheck.sh: do not set --sourcetree-root [ci skip]
System headers should be ignored by PVS, but somehow aren't.
See also: https://stackoverflow.com/q/44906903
2019-01-19 13:04:32 +01:00
8a5c68f695 Merge #9518 from justinmk/pvs-warnings 2019-01-18 21:51:32 +01:00
e8137d263e pvscheck.sh: ignore stddef.h
This system header should be ignored by PVS.
See also: https://stackoverflow.com/q/44906903
2019-01-18 02:43:42 +01:00
ce6a5fb94b PVS/V560: expression is always true
This macro serves as a sanity-check / documentation.
2019-01-18 02:43:38 +01:00
6cd3912a51 clang/"null pointer dereference": expand_wildcards
This invariant is explained in aa39fc56f6.
2019-01-18 02:43:32 +01:00
8f9fc1f692 Merge #9508 from justinmk/pvs-warnings 2019-01-18 00:20:38 +01:00
aa39fc56f6 PVS/V1032: pointer cast to a more strictly aligned type
Rework-of: ea7491586f
Helped-by: Björn Linse <bjorn.linse@gmail.com>

- The old (Vim) use of (char_u **)"" before ea7491586f is garbage,
  which hints that this value was never used.
- The necessary condition is next to the NULL assigmnent, the pointer
  would only be started to be accessed, if the length assignment next to
  it is also changed.
2019-01-18 00:10:08 +01:00
ea7491586f PVS/V1032: pointer cast to a more strictly aligned type 2019-01-18 00:09:50 +01:00
ed171f7be2 PVS/V1028: cast operands, not the result 2019-01-18 00:09:50 +01:00
dca0da4e3f PVS/V501: diff.c: silence warning
False positive: vim_fgets has side effects.

ref 8586770e1f
2019-01-18 00:09:50 +01:00
8093cbd8e8 Merge #9292 from mhinz/xcode10 2019-01-17 23:24:03 +01:00
a8a38f3465 test: Lua 5.2/5.3 compat
close #9515
ref #9280
2019-01-17 23:06:04 +01:00
06785da5b6 ci: switch to Xcode 10.1 / macOS 10.13 2019-01-17 15:59:44 +01:00
f2e996b991 tests: load-adjust timer tests (functionaltest) 2019-01-17 15:59:23 +01:00
0afd452ef1 tests: load-adjust timer tests (oldtest) 2019-01-17 15:59:23 +01:00
9d6bffd517 tests: fix Test_help_tagjump()
The Vim version of Test_help_tagjump() tests for `:help sm?le` here. That
command got removed from Nvim, so the test was changed to check against `:help
sp?it` instead.

The new test already handled the case that on Win `:h split` would jump to the
entry for split() and on all other systems to the entry for :split.

Then this commit happened:

   bb3aa824b lua/stdlib: vim.inspect, string functions

Since then `:h split` would jump to split() for macOS as well! I'm not sure why.

Anyway, instead of adding another check for has('mac'), we change the test once
more to be more akin to the original test. Instead of testing for :smile, which
is exclusive to Vim, we check against :checkhealth, which is exclusive to Nvim.
2019-01-17 15:59:22 +01:00
7e9b99d55b Merge #5027 'TUI: detect background color' 2019-01-17 13:05:51 +01:00
279043d625 Merge pull request #9507 from bfredl/noscrollclear
screen: don't unconditionally clear messages on window scroll
2019-01-15 21:19:02 +01:00
5a836d4767 screen: don't unconditionally clear messages on window scroll
In vim, scrolling a window might mess up the cmdline. To keep it simple,
cmdline was always cleared for any window scroll. In nvim, where safe scrolling
is implemented in the TUI layer, this problem doesn't exist.

Clearing the message on scrolling, when we not do it e.g when switching tabs
is a bit weird, as the former is a much smaller context change.

A vim patch introduced the possibility to avoid the cmdlline clear for
redraws caused by async events. This case will now trivially be covered,
as the redraw is always avoided.

vim-patch:8.0.0592: if a job writes to a buffer screen is not updated
2019-01-15 19:48:49 +01:00
95fa71c6d2 :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:47:53 +01:00
387ab4f706 Merge pull request #9505 from bfredl/inspect
lua: expose full interface of vim.inspect and add test
2019-01-14 23:30:09 +01:00
3a84e5be88 lua: expose full interface of vim.inspect and add test
Implement lazy loading for vim.submodule, this would be over-engineering
for inspect only, but we expect to use this solution also for more and
larger modules.
2019-01-14 20:12:57 +01:00
89d7e24891 Merge #9463 'Lua stdlib' 2019-01-14 02:25:45 +01:00
6c02ff4747 lua/stdlib: Load runtime modules on-demand
Instead of eager-loading during plugin/* sourcing, define runtime
modules such as `vim.inspect` as lazy builtins. Otherwise non-builtin
Lua modules such as `vim.inspect` would not be available during startup
(init.vim, `-c`, `--cmd`, …).

ref #6580
ref #8677
2019-01-14 02:22:16 +01:00
bb3aa824b7 lua/stdlib: vim.inspect, string functions
ref #6580
ref #8677
2019-01-14 02:14:34 +01:00
989fbad502 Merge #9395 from pqzx/api-set-vvar 2019-01-14 02:13:39 +01:00
38b9256439 test/API: nvim_set_vvar() #9395 2019-01-14 00:50:29 +01:00
475b97e021 API: nvim_set_vvar(): set v: variables #9395
closes #9349
2019-01-14 00:42:25 +01:00
0b8c4b995a dict_set_var: check value before checking its container
- When setting a fixed/locked/readonly var, it is more relevant to
  report on the key, not its container dict. If its container dict (v:)
  is readonly, that does not mean the key itself is readonly.
- Allow modifying a "fixed" var. "fixed" only prevents deletion.
2019-01-14 00:42:25 +01:00
0d66cdc6f9 pvscheck.sh: Fix download URL #9500
- old URL redirects to https://www.viva64.com/en/pvs-studio-download/
- page now contains tgz files for macOS and Linux; the pattern must
  match only the Linux URL
2019-01-14 00:23:28 +01:00
a3d8cd3f69 Merge #9471 from justinmk/pvs-warnings 2019-01-13 23:09:59 +01:00
4cba75dab0 clang/"null pointer dereference": close_buffer
False positive: win_valid_any_tab() already checks `win != NULL`.
2019-01-13 19:57:52 +01:00
1ec0b9204b clang/"Dead assignment": screen.c
Vim 8.1 source has equivalent structure (this isn't a case of accidental
regression), but it depends on FEAT_MBYTE.
2019-01-13 19:57:52 +01:00
ddd4ed3ce5 clang/"Dead assignment" 2019-01-13 17:53:26 +01:00
94fc3e0182 clang/"null passed to nonnull arg": shada.c 2019-01-13 17:03:55 +01:00
fb7c48f2f3 clang/"null passed to nonnull arg": ex_history 2019-01-13 17:02:37 +01:00
712cf9d8f3 clang/"null passed to nonnull arg": cs_manage_matches 2019-01-13 16:55:14 +01:00
09d21f6f0b clang/"null passed to nonnull arg": expand_wildcards 2019-01-13 16:54:18 +01:00
651e82af9f clang/"Assigned garbage": parse_shape_opt
False positive, see b6c1fae6a9. Clang ignores the assert introduced in
that commit?
2019-01-13 16:39:38 +01:00
fff68dccd9 PVS/V560: expression is always true 2019-01-13 16:39:38 +01:00
61ec31cde1 release.sh 2019-01-13 15:21:24 +01:00
4e917e8731 Merge 'upstream/release-0.3' 2019-01-13 15:10:03 +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
a7fc01a532 Merge pull request #9492 from bfredl/cul_cole
redraw: share more code between cursorline and conceal redraws. Add tests for conceal cursor
2019-01-13 12:10:26 +01:00
23c71d5182 display: unify cursorline and concealcursor redraw logic
There is various places where 'conceallevel' and 'concealcursor'
necessitates additional redraws. This tries to separate the different
cases and handle each accordingly:

  - Share code with 'cursorline' for the common case: vertical move of
    cursor within the same window (concealcursor not active)
  - Improve the logic for managing 'concealcursor' and switching modes:
    test for the case where the new mode behaves differently from the
    last one.
  - Clarify the special case for horizontal movement within a line when
    'concealcursor' is active, now there is an if-statement only for this
     and not hidden in larger check mostly for the first point.
  - Keep the special case for moving between windows as is.
2019-01-13 12:08:11 +01:00
9c75929e7b test: add tests for conceal cursor movement 2019-01-13 12:08:11 +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
424388c207 win/dist: nvim-qt v0.2.12 2019-01-12 23:47:05 +01:00
fe3f2ad0f9 CI/codecov: Avoid "fail" status for non-PR
Purpose of codecov is to:

1. show a web UI of lines that need coverage
2. sanity-check PRs
3. show a pretty badge on README

codecov (and/or gcov) is not reliable enough to allow it to cause
a "red" status in the `master` branch CI history.
2019-01-12 16:58:00 +01:00
88963a18de Merge pull request #9490 from bfredl/vim-patch-8.1.0726
normal/edit: add missing "need_cursor_line_redraw = false"
2019-01-12 10:10:56 +01:00
ca58c3a4f5 normal/edit: add missing "need_cursor_line_redraw = false"
vim-patch:8.1.0726: redrawing specifically for conceal feature
2019-01-12 09:22:21 +01:00
db3c797c6b 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-12 00:52:12 +01:00
8853fca1fd Merge pull request #9484 from bfredl/highlander
screen: make update_screen() the only entry point for redrawing
2019-01-11 12:30:17 +01:00
889f73e861 screen: make update_screen() the only entry point for redrawing
update_single_line() was only used for 'concealcursor'. But 'cursorline'
has very similiar characteristics (redraw both lines on move cursor
between lines) and works without its own special entry point to the
redraw subsystem.

Later on 'concealcursor' and 'cursorline' could share more logic, but for
now make the former use standard redrawWinline(). Make sure it is called
before update_screen(), so that it is immediately visible.

Get rid of update_prepare() and update_finish(), and all issues from
them and their callsites not being in sync with changes to
update_screen()
2019-01-11 10:55:43 +01:00
10f29f79f4 version.c: update [ci skip] (#9444)
vim-patch:8.0.1336: cannot use imactivatefunc() unless compiled with +xim
vim-patch:8.0.1338: USE_IM_CONTROL is confusing and incomplete

vim-patch:8.1.0646: cannot build with Ruby 2.6.0
vim-patch:8.1.0656: trying to reconnect to X server may cause problems
vim-patch:8.1.0664: configure "fail-if-missing" does not apply to enable-gui
2019-01-11 02:24:26 +01:00
8986f70bdc Merge #9468 'checkhealth: detect broken pip"' 2019-01-11 02:03:56 +01:00
99429e5f41 Merge #9481 'vim-patch:8.1.0449,8.1.0450'
closes #9481
2019-01-11 01:45:38 +01:00
56dec2a3a0 vim-patch:8.1.0450: build failure without the +fold feature
Problem:    Build failure without the +fold feature.
Solution:   Add #ifdef.
0e9deefb4f
2019-01-11 01:44:15 +01:00
bed95b37b2 vim-patch:8.1.0449: fix display of 'rnu' with folded lines #9481
Problem:    When 'rnu' is set folded lines are not displayed correctly.
            (Vitaly Yashin)
Solution:   When only redrawing line numbers do draw folded lines.
            (closes vim/vim#3484)
7701f30856

---
Explanation:
Before this patch, relative line numbers would update on a cursor
movement and overwrite fold highlighting in the line number columns.
Other operations can cause the fold highlighting to overwrite the line
number styles. Together, this causes the highlighting in the line number
columns to flicker back and forth while editing.

Test case: create `t.vim` with these contents:

    set fdm=marker rnu foldcolumn=2
    call setline(1, ["{{{1", "nline 1", "{{{1", "line 2"])

and then call `nvim -u NORC -S t.vim` and press `j`; observe that the fold
highlighting disappears.
2019-01-11 01:44:15 +01:00
3f10c5b533 clipboard/macOS: assume that pbcopy works #9480
Avoids ~30-60 ms startup cost for users of clipboard=unnamed.
2019-01-10 09:11:36 +01:00
6d8b5989bc Merge #9472 from justinmk/pvs-warnings2 2019-01-10 08:56:38 +01:00
57c7e1d4a0 vim-patch:8.1.0648: custom operators can't act upon forced motion
Problem:    Custom operators can't act upon a forced motion. (Christian
            Wellenbrock)
Solution:   Add the forced motion to the mode() result. (Christian Brabandt,
            closes vim/vim#3490)
5976f8ff00

closes #8667
closes #9476

Christian Wellenbrock:

> For (most) built in text objects it's possible to force operation on
> them to be linewise, for example by using `dVab` (`:h o_V`,
> `motion_force`). When using custom text objects (defined as mappings
> by plugins for example), this doesn't currently work.
>
> Example:
>
>     onoremap x viw
>
> Open a file with a few lines each containing some words. With the
> cursor on any word, try:
>
> 1. `dw` (builtin) deletes some characters
> 2. `dVw` (builtin) deletes linewise
> 3. `dx` (from mapping) deletes some characters
> 4. `dVx` (from mapping) deletes some characters, but should delete
>    linewise

ref: https://github.com/wellle/targets.vim/issues/214
ref: https://gitter.im/neovim/neovim?at=5b379ff7f1664406610e7483
2019-01-10 08:50:07 +01:00
1ca2c8950f Merge pull request #9479 from bfredl/redrawsign
screen: remove ad-hoc code path for redrawing signs.
2019-01-09 21:26:49 +01:00
8510d5ff86 Merge pull request #9445 from bfredl/pum_api
API: select items in popupmenu
2019-01-09 11:43:19 +01:00
fc4ca5bdd8 CMake: Feature-detect __builtin_{add,sub}_overflow 2019-01-09 10:41:17 +01:00
596f020e90 PVS/V1028: cast operands, not the result 2019-01-09 10:41:17 +01:00
6b6a4d63ec assert.h: Check overflow with STRICT_ADD, STRICT_SUB 2019-01-09 10:41:17 +01:00
a4076e5dcf win/TUI: fix text overrides line numbers #9474
fixes #9461
2019-01-09 10:40:02 +01:00
d5d8deec06 bufhl: simplify redraw logic
using changed_lines_buf was technically incorrect, as the buffer wasn't
modififed.
2019-01-09 10:30:09 +01:00
b819795661 remove dead argument of redrawWinline 2019-01-09 10:23:26 +01:00
ead222d2cd screen: avoid redrawing windows immediately when debug signs are placed. 2019-01-09 10:22:48 +01:00
ae218c108f api: select items in popupmenu 2019-01-09 10:17:48 +01:00
aadfea7159 Merge pull request #9477 from bfredl/nocmdredraw
API: don't directly call update_screen() in API functions
2019-01-09 10:06:09 +01:00
9452532036 API: don't directly call update_screen() in API functions
There is no need to call update_screen() directly in an API function,
mode input processing invokes update_screen() as needed. And if the API
call is done in a context where redraw is disabled, then redraw is
disabled for a reason. A lot of API functions are of equal semantical
strength (nvim_call_function and nvim_execute_lua can also do whatever,
nvim_command is not special), this inconsistency has no purpose.
2019-01-08 23:31:48 +01:00
eaabec459a doc: CONTRIBUTING.md 2019-01-08 22:50:43 +01:00
c8e78abaf9 pvscheck.sh: Skip install if dir exists 2019-01-08 01:30:46 +01:00
75593e6fce health/pythonx: handle "pip upgrade failure"
Reference: https://github.com/neovim/neovim/wiki/Following-HEAD#20181118
2019-01-07 23:29:46 +01:00
0ccb9704d7 vim-patch:8.1.0700: using "gt" sometimes does not redraw a tab (#9464)
Problem:    Using "gt" sometimes does not redraw a tab. (Jason Franklin)
Solution:   Always set must_redraw in redraw_all_later().
04b4e1a424

ref bf3250a8ad (r31852304)

> I fixed it in a more general way, in that if we don't find a window
> that doesn't have the redraw type set it, then it will not set
> must_redraw, even though that's clearly intended.

ref #9152
ref #9155

NA patches:
vim-patch:8.1.0698
vim-patch:8.1.0699
2019-01-07 22:33:57 +01:00
3081f60989 Merge #9466 from janlazo/vim-8.1.0696 2019-01-07 22:28:00 +01:00
eb91101a46 health/pythonx: refactor #Detect() 2019-01-07 19:58:33 +01:00
7f27e14a6e health/pythonx: refactor pyenv check 2019-01-07 19:58:33 +01:00
b5216a3e5b lint 2019-01-07 01:00:13 -05:00
5395dd6209 vim-patch:8.1.0696: when test_edit fails 'insertmode' may not be reset
Problem:    When test_edit fails 'insertmode' may not be reset and the next
            test may get stuck. (James McCoy)
Solution:   Always reset 'insertmode' after executing a test.  Avoid that an
            InsertCharPre autocommand or a 'complete' function can change the
            state. (closes vim/vim#3768)
8ad16da729
2019-01-06 20:30:38 -05:00
0c42e0e8b1 editorconfig: set default tab width to 8 (#9467)
Vim patches may include tabs in Vimscript test files.
editorconfig uses "indent_size" for tabs if "tab_width" is unset
so the user sees 2-width tabs.
2019-01-07 02:15:19 +01:00
ea7504cf8e Merge #9459 from janlazo/vim-8.1.0677 2019-01-06 13:02:40 +01:00
072448a2c9 Merge #8604 from janlazo/vim-8.0.0286 2019-01-06 12:45:37 +01:00
fba80f5edc vim-patch:8.1.0685: get_buf_tv() is named inconsistently
Problem:    get_buf_tv() is named inconsistently.
Solution:   Rename it to tv_get_buf(). (Yegappan Lakshmanan, closes vim/vim#3759)
f2d79fa92d
2019-01-05 23:10:00 -05:00
758955d1b6 vim-patch:8.1.0687: sentence text object in Visual mode is not tested
Problem:    Sentence text object in Visual mode is not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3758)
6d3a1940be
2019-01-05 22:45:31 -05:00
772f4ce9f8 vim-patch:8.1.0677: look-behind match may use the wrong line number
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-01-05 22:43:46 -05:00
f3d2d3c814 Merge #9458 from justinmk/pvs-warnings 2019-01-06 02:32:30 +01:00
624f5c8be3 vim-patch:8.1.0683: spell highlighting does not always end
Problem:    Spell highlighting does not always end. (Gary Johnson)
Solution:   Also reset char_attr when spell errors are highlighted.
637532b3c0
2019-01-05 17:29:11 -05:00
40f7ce96c3 vim-patch:8.1.0674: leaking memory when updating a single line
Problem:    Leaking memory when updating a single line.
Solution:   Do not call start_search_hl() twice.
6d5b4f566a
2019-01-05 17:29:11 -05:00
fd674c875b vim-patch:8.0.0286: not always redrawing after screen resize
Problem:    When concealing is active and the screen is resized in the GUI it
            is not immediately redrawn.
Solution:   Use update_prepare() and update_finish() from
            update_single_line().
c10f0e7cb0
2019-01-05 17:29:11 -05:00
2d1214ef46 PVS/V501: diff.c: silence warning
False positive: vim_fgets has side effects.

ref 8586770e1f
2019-01-05 23:19:23 +01:00
46fc0437ba PVS/V547: Expression is always false 2019-01-05 23:19:23 +01:00
2a325892c2 PVS/V1026: normal.c: signed integer overflow
> V1026 The 'curwin->w_curswant' variable is incremented in the loop.
> Undefined behavior will occur in case of signed integer overflow.
2019-01-05 00:52:31 +01:00
3e558468cf PVS/V547: indent.c: xmalloc() never returns NULL 2019-01-05 00:33:26 +01:00
38b4ca26b5 Merge #9454 from justinmk/pvs-warnings 2019-01-04 23:45:21 +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
292b1790c8 release.sh: Format issue-numbers in descriptions [ci skip] 2019-01-04 06:03:47 +01:00
e22bf529c1 release.sh: fix exclusion pattern [ci skip]
grep support of "\s" pattern is unreliable.
2019-01-04 06:03:37 +01:00
7436a62168 Merge #9451 from justinmk/build
build: fix `doc_html` target
2019-01-04 11:36:49 +01:00
58538d1210 PVS/V547: window.c: Expression is always true 2019-01-04 02:29:43 +01:00
6abdc0aeec PVS/V547: viml/parser/expressions.c: Expression is always true 2019-01-04 02:29:38 +01:00
788ade1d29 PVS/V751: tui.c, Parameter is not used
False positive. Documentation for grid_scroll says "`cols` is always
zero, reserved for future use".
2019-01-04 02:29:35 +01:00
423b6d9907 PVS/V535: shada.c: variable reassigned in inner loop
False positive: `i` is intentionally, temporarily reassigned.
See a70fde1b45 #9425
2019-01-04 02:29:31 +01:00
6a432d4a0d PVS/V547: diff.c: xmalloc() never returns NULL
Normally we consider OOM to be fatal, but the diff module has extra
functionality to handle OOM in case huge files are compared. Use
try_malloc instead of xmalloc in that case.
2019-01-04 02:29:22 +01:00
a1e97b18f1 PVS/V547: diff.c: Expression is always true 2019-01-04 02:29:17 +01:00
8586770e1f PVS/V501: diff.c: silence warning
False positive: vim_fgets has side effects.
2019-01-04 02:29:11 +01:00
6b3fa0689c build: remove cmake/GenerateHelptags.cmake.in
This file wasn't used since e1cc0fe996.  That may have been
accidental, but it's not needed anymore anyway.  Also the "Workaround
for hanging" is no longer relevant.
2019-01-04 02:25:17 +01:00
685b2028dc build: fix doc_html target
ref 24f2cc55a8 #9430
2019-01-04 02:17:23 +01:00
c403a95a52 Merge #9446 'Visual: highlight char-at-cursor' 2019-01-04 01:53:13 +01:00
37a499148f Visual: highlight char-at-cursor
Decide whether to highlight the visual-selected character under the
cursor, depending on 'guicursor' style:

- Highlight if cursor is blinking or non-block (vertical, horiz).
- Do NOT highlight if cursor is non-blinking block.

Traditionally Vim's visual selection does "reverse mode", which perhaps
conflicts with the non-blinking block cursor. But 'guicursor' defaults
to a vertical bar for selection=exclusive, and this confuses users who
expect to see the text highlighted.

closes #8983
2019-01-04 01:28:44 +01:00
e2d71d11de remove check_visual_highlight()
This check is meaningless, we assume the terminal supports reverse-mode.
2019-01-04 01:24:49 +01:00
103e021912 Merge pull request #9447 from janlazo/vim-8.1.0651
vim-patch:8.1.{651,653}
2019-01-03 07:01:19 -05:00
111e46582c vim-patch:8.1.0653: arglist test fails on MS-windows
Problem:    Arglist test fails on MS-windows.
Solution:   Only use a file name with a double quote on Unix.
3de8c2d1f0
2019-01-03 01:07:21 -05:00
8e408c95fe vim-patch:8.1.0651: :args \"foo works like :args without argument
Problem:    :args \"foo works like :args without argument.
Solution:   Fix check for empty argument. (closes vim/vim#3728)
2ac372ccee
2019-01-03 01:04:09 -05:00
0afb5fa70a Merge #9425 'build: enable -Wshadow' 2019-01-03 00:44:36 +01:00
9f19e8d29d TUI: Do not disable BCE for builtin terminfos (#9443)
Remove this vestigial hack from #7624.

Since 5a0d0286ff we blacklist BCE more surgically. And
patch_terminfo_bugs() is the more appropriate place for that.

ref 5749ecaf22
ref #4210 #4421 #7035 #7337 #7381 #7425 #7618
2019-01-02 22:31:03 +01:00
7ede14d191 UGRID_FOREACH_CELL: avoid shadowed variables 2019-01-02 21:06:37 +01:00
a70fde1b45 build: enable -Wshadow
Note about shada.c:
- shada_read_next_item_start was intentionally shadowing `unpacked` and
  `i` because many of the macros (e.g. ADDITIONAL_KEY) implicitly
  depended on those variable names.
- Macros were changed to parameterize `unpacked` (but not `i`). Macros
  like CLEAR_GA_AND_ERROR_OUT do control-flow (goto), so any other
  approach is messy.
2019-01-02 21:06:37 +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
5fba815921 Merge pull request #9438 from jamessan/revert-pynvim
Rework Python provider/health check to use neovim module again
2019-01-02 11:05:13 -05:00
8f288698e4 vim-patch:8.0.0251: not easy to select Python 2 or 3 (#9173)
Problem: It is not so easy to write a script that works with both Python 2 and Python 3, even when the Python code works with both.
Solution: Add 'pyxversion', :pyx, etc. (Marc Weber, Ken Takata)

f42dd3c390
2019-01-02 14:51:03 +01: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
5a11e55358 Merge pull request #9434 from bfredl/multigrid_fixes
Multigrid: fix popupmenu position + some cleanup
2019-01-01 22:21:57 +01: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
e2e5a105c6 Merge pull request #9436 from jamessan/more-fragile-tests
Mark a few more functionaltests as fragile
2019-01-01 16:02:23 -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
a0140da7b0 Merge pull request #9432 from jamessan/only-lint-master
travis: Only run lint job for master branch/PRs
2019-01-01 09:23:25 -05:00
cdfa395ad8 popupmenu: fix positioning with vsplits 2019-01-01 15:20:37 +01:00
57e0a578f0 travis: Only run lint job for master branch/PRs 2019-01-01 09:15:51 -05:00
4e5f5e93c2 multigrid: do all adjustment in screen.c
Adjustment will get more complex with floats, tabgrid etc,
so make it into a function.
2019-01-01 15:11:51 +01:00
83fca0ab13 travis: Run ci for release-* branches 2019-01-01 08:14:54 -05:00
cf1ef631cf Merge pull request #9431 from jamessan/bug-fix-branch-ci
travis: Run ci for release-* branches
2019-01-01 08:13:18 -05:00
fb815bd7b7 version bump 2019-01-01 08:10:13 -05:00
db36cc740e travis: Run ci for release-* branches 2019-01-01 08:06:02 -05:00
d4dc7c7509 Merge pull request #9427 from jamessan/man-fix
nvim.1: Add missing .El directive
2019-01-01 07:57:20 -05:00
24f2cc55a8 cmake: runtime: use add_custom_command for tags directly (#9430)
This avoids generating the tags files all the time, and makes `make
install` with `CMAKE_INSTALL_MESSAGE=LAZY` much more silent in general.

Using `copy_if_different` instead of `remove` + `copy_directory` might
be good on top, but is a) not really necessary anymore and b) would not
sync removed files.
For this `file(COPY` could be used, but would require to re-run cmake on
changed input files then.
2019-01-01 13:56:20 +01:00
8ff144d876 nvim.1: Add missing .El directive
$ LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 man --warnings -E UTF-8 -l -Tutf8 -Z man/nvim.1 >/dev/null
    mdoc warning: A .Bl directive has no matching .El (#59)
2018-12-31 20:55:15 -05:00
3340e08bec TUI: Konsole DECSCUSR fixup (#9423)
Apparently Konsole's terminfo is still broken.

ref #9364
closes #9420
2018-12-31 22:24:21 +01:00
6427894d89 Merge pull request #8455 from UtkarshMe/grid-split
implement ext_multigrid: draw each window on a separate resizable grid.
2018-12-31 17:37:50 +01:00
c72d9ce0a6 multigrid: rename grid->ScreenLines and other grid arrays 2018-12-31 16:24:07 +01:00
c778c2e107 multigrid: API version bump 2018-12-31 16:24:07 +01:00
9a1c61456b multigrid: simplify tests 2018-12-31 16:24:07 +01:00
dc44309336 multigrid: rename to grid.row_offset and grid.requested_rows 2018-12-31 16:24:07 +01:00
1cec5542a8 multigrid: reorganize types and global varaibles 2018-12-31 16:24:07 +01:00
820c81e638 multigrid: various cleanup (types, unused parameters)
Handle the rare case of full highlight table properly
2018-12-31 16:24:07 +01:00
44b8e58f33 multigrid: add tests for multiline messages and tabs 2018-12-31 16:24:07 +01:00
ed3da23cf4 multigrid: test refactor 2018-12-31 16:24:07 +01:00
13f74635fa multigrid: doc update 2018-12-31 16:24:07 +01:00
47c053cc39 multigrid: Add multigrid documentation 2018-12-31 12:44:22 +01:00
db14d78e4f multigrid: rename event to win_pos, make grid first 2018-12-31 12:44:22 +01:00
f6f8f0ee76 multigrid: add msg_scroll_start and msg_scroll_reset events 2018-12-31 12:44:22 +01:00
c3e2e40e02 multigrid: send win_hide events when changing tabpage 2018-12-31 12:44:22 +01:00
ebe16cd9bd multigrid: add multigrid screen tests 2018-12-31 12:44:22 +01:00
1f8afe15a4 multigrid: add multigrid support to test infrastructure
make Screen explicitly tied to its session
2018-12-31 12:44:22 +01:00
f77f09ea6e multigrid: don't clear window grids on resize
Instead define that the shared top-left part of the grid is preserved.
2018-12-31 12:44:22 +01:00
ba6f9f60ad multigrid: Fix lint errors 2018-12-31 12:44:22 +01:00
8b47b56fc6 multigrid: Draw fold for the entire width of window grid 2018-12-31 12:44:22 +01:00
f241930472 multigrid: Fix rebase errors in screen.c 2018-12-31 12:44:22 +01:00
62be9f39ef multigrid: Fix sending window grid handle in ext_newline mode 2018-12-31 12:44:22 +01:00
16c3337122 multigrid: use grid-based coordinates for ext_popupmenu 2018-12-31 12:44:22 +01:00
882dd63dc7 multigrid: Fix grid allocation misses
- Clear whole grid in one go.
- Fix wrongly sent "copy" flag.
- Add clear function comment.
2018-12-31 12:44:22 +01:00
1a896bc93f multigrid: avoid allocation when not ext_multigrid.
Move grid specific functions from mbyte.c to screen.c
2018-12-31 12:44:22 +01:00
4f1dcf7c28 multigrid: Clean whole grid when it was just resized 2018-12-31 12:44:22 +01:00
0bab611a96 multigrid: Add ScreenGrid as a param to multibyte functions 2018-12-31 12:44:22 +01:00
911b731378 multigrid: Get rid of global ScreenLines and set_screengrid 2018-12-31 12:44:22 +01:00
0432e1586e multigrid: Put everything on default_grid if not ext_multigrid 2018-12-31 12:44:22 +01:00
d5754eae02 multigrid: Add win_position event
Throttle win_position events
2018-12-31 12:44:22 +01:00
01555de2da multigrid: Allow UIs to set grid size different from window size 2018-12-31 12:44:21 +01:00
f102f50ebe multigrid: Change screen_* functions to grid_* functions 2018-12-31 12:44:21 +01:00
c9b559a030 multigrid: introduce grid abstraction 2018-12-31 12:44:21 +01:00
ccbcd390d4 Merge #9408 from justinmk/tui-title-stacking
TUI: attempt "title stacking" unconditionally
2018-12-31 03:41:13 +01: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
a2ce40fae3 version bump 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
a5867a24c8 TUI: attempt "title stacking" unconditionally
Rework #9407: save/restore title/icon always (for all terminals).

Works in tmux, iTerm2, xterm, and any other terminal that supports
title-stacking.

Test case (title is "foo" while running, then restored after exit):

    tmux
    nvim -u NONE +'set title titlestring=foo'
    :q

closes #4063
2018-12-29 16:12:02 +01: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
ff8b2eb435 Merge branch 'master' into option-fixes 2017-04-24 11:35:10 +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
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
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
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
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
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
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
ZyX
caeff6e1af regexp: Do not use locale-dependent functions in cstrchr 2017-04-07 23:18:36 +03: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
4049492b6d also test set_option 2017-04-01 12:26:58 +02:00
8a55f9b1c8 update for changes in master; fix 'window'; tests 2017-03-31 18:30:06 +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
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
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
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
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
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
5372d9a705 Add tests for terminal background detection 2016-07-24 01:56:33 -07:00
298608f88c Automatically detect terminal background and set bg=dark or bg=light
xterm-compatible terminals support reporting their configured colors
back to the application.  Use this to obtain the current background
color, compute its luminance to classify it as light or dark, and set
'bg' accordingly.  Also set the default for 'bg', so that `:set bg&`
will revert to that detected default.
2016-07-24 01:56:33 -07:00
1555 changed files with 238814 additions and 77553 deletions

41
.builds/openbsd.yml Normal file
View File

@ -0,0 +1,41 @@
# sourcehut CI: https://builds.sr.ht/~jmk/neovim
image: openbsd/6.5
packages:
- autoconf-2.69p2
- automake-1.15.1
- cmake
- gettext-0.19.8.1p3
- gettext-tools-0.19.8.1
- gmake
- libtool
- ninja-1.8.2p0
- unzip-6.0p11
sources:
- https://github.com/neovim/neovim
tasks:
- build: |
export AUTOCONF_VERSION=2.69
export AUTOMAKE_VERSION=1.15
cd neovim
mkdir .deps
cd .deps
cmake -G Ninja ../third-party/
cmake --build . --config Debug
cd ..
mkdir build
cd build
cmake -G Ninja -DMIN_LOG_LEVEL=3 ..
cmake --build . --config Debug
./bin/nvim --version
- test: |
export LC_CTYPE=en_US.UTF-8
# functional tests
cd neovim/build
# cmake --build . --config Debug --target functionaltest
# oldtests
cd ..
gmake oldtest

View File

@ -8,6 +8,7 @@ IndentCaseLabels: true
BreakBeforeBraces: Linux
AlignEscapedNewlinesLeft: false
AllowShortFunctionsOnASingleLine: false
AlignTrailingComments: true
SpacesBeforeTrailingComments: 2
PenaltyReturnTypeOnItsOwnLine: 200
AllowAllParametersOfDeclarationOnNextLine: false
@ -15,4 +16,5 @@ AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
BinPackParameters: false
BreakBeforeBinaryOperators: true
BreakBeforeTernaryOperators: true
ContinuationIndentWidth: 4

View File

@ -3,10 +3,11 @@ root = true
[*]
indent_style = space
indent_size = 2
tab_width = 8
end_of_line = lf
insert_final_newline = true
charset = utf_8
charset = utf-8
[Makefile]
[{Makefile,**/Makefile,runtime/doc/*.txt}]
indent_style = tab
tab_width = 4
indent_size = 8

2
.flake8 Normal file
View File

@ -0,0 +1,2 @@
[flake8]
max-line-length = 88

1
.gitattributes vendored Executable file
View File

@ -0,0 +1 @@
*.h linguist-language=C

1
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1 @@
custom: https://salt.bountysource.com/teams/neovim

29
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,29 @@
---
name: Bug report
about: Report a problem in Nvim
title: ''
labels: bug
---
<!-- Before reporting: search existing issues and check the FAQ. -->
- `nvim --version`:
- `vim -u DEFAULTS` (version: ) behaves differently?
- Operating system/version:
- Terminal name/version:
- `$TERM`:
### Steps to reproduce using `nvim -u NORC`
```
nvim -u NORC
# Alternative for shell-related problems:
# env -i TERM=ansi-256color "$(which nvim)"
```
### Actual behaviour
### Expected behaviour

View File

@ -0,0 +1,27 @@
---
name: Feature request
about: Request an enhancement for Nvim
title: ''
labels: enhancement
---
<!-- Before reporting: search existing issues and check the FAQ. -->
- `nvim --version`:
- `vim -u DEFAULTS` (version: ) behaves differently?
- Operating system/version:
- Terminal name/version:
- `$TERM`:
### Steps to reproduce using `nvim -u NORC`
```
nvim -u NORC
```
### Actual behaviour
### Expected behaviour

27
.gitignore vendored
View File

@ -1,10 +1,16 @@
# Tools
.ropeproject/
compile_commands.json
# Visual Studio
/.vs/
# Build/deps dir
/build/
/cmake-build-debug/
/dist/
/.deps/
/tmp/
*.orig
*.mo
.*.sw?
*~
@ -17,10 +23,13 @@ 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/test*.out
/src/nvim/testdir/test*.res
@ -32,12 +41,15 @@ tags
/src/nvim/testdir/X*
/src/nvim/testdir/valgrind.*
/src/nvim/testdir/.gdbinit
/runtime/indent/testdir/*.out
# Generated by src/nvim/testdir/runnvim.sh.
/src/nvim/testdir/*.tlog
# Folder generated by the unit tests
# Generated by unit tests.
/test/includes/post/
# generated by luacheck during `make testlint'
/test/.luacheckcache
# Generated by luacheck during `make lualint'
.luacheckcache
# local make targets
local.mk
@ -46,3 +58,6 @@ local.mk
/runtime/doc/*.html
/runtime/doc/tags.ref
/runtime/doc/errors.log
# CLion
/.idea/

20
.luacheckrc Normal file
View File

@ -0,0 +1,20 @@
-- vim: ft=lua tw=80
-- Ignore W211 (unused variable) with preload files.
files["**/preload.lua"] = {ignore = { "211" }}
-- Don't report unused self arguments of methods.
self = false
-- Rerun tests only if their modification time changed.
cache = true
ignore = {
"631", -- max_line_length
"212/_.*", -- unused argument, for vars with "_" prefix
}
-- Global objects defined by the C code
read_globals = {
"vim",
}

View File

@ -1,34 +1,29 @@
dist: trusty
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.
- PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:/usr/lib/llvm-symbolizer-3.9/bin:$PATH"
# 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.
- DEPS_BUILD_DIR="$HOME/nvim-deps"
# Directory where third-party dependency sources are downloaded to.
- DEPS_DOWNLOAD_DIR="$TRAVIS_BUILD_DIR/deps-downloads"
# Install directory for Neovim.
- 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
-DBUSTED_OUTPUT_TYPE=nvim
-DDEPS_PREFIX=$DEPS_BUILD_DIR/usr
-DMIN_LOG_LEVEL=2"
- DEPS_CMAKE_FLAGS="-DDEPS_DOWNLOAD_DIR:PATH=$DEPS_DOWNLOAD_DIR"
-DMIN_LOG_LEVEL=3"
- DEPS_CMAKE_FLAGS="-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
@ -39,44 +34,117 @@ env:
- UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan"
# Environment variables for Valgrind.
- VALGRIND_LOG="$LOG_DIR/valgrind-%p.log"
# Cache marker for third-party dependencies cache.
# If this file exists, we know that the cache contains compiled
# dependencies and we can use it.
- CACHE_MARKER="$HOME/.cache/nvim-deps/.travis_cache_marker"
- CACHE_NVIM_DEPS_DIR="$HOME/.cache/nvim-deps"
# If this file exists, the cache is valid (compile was successful).
- CACHE_MARKER="$CACHE_NVIM_DEPS_DIR/.travis_cache_marker"
# 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"
# Default since 3.3, but Travis (Xenial) has 3.2.4; required with newer gcc/clang.
- CCACHE_CPP2=1
matrix:
anchors:
envs: &common-job-env
# Do not fall back to cache for "master" for PR on "release" branch:
# adds the target branch to the cache key.
FOR_TRAVIS_CACHE=v1-$TRAVIS_BRANCH
addons:
apt:
packages: &common-apt-packages
- apport
- autoconf
- automake
- build-essential
- clang
- cmake
- cscope
- gcc-multilib
- gdb
- gperf
- language-pack-tr
- libc6-dev-i386
- libtool-bin
- locales
- ninja-build
- pkg-config
- unzip
- valgrind
- xclip
homebrew:
update: false
packages:
- ccache
- ninja
jobs:
include:
- os: linux
env: CI_TARGET=lint
- os: linux
compiler: gcc-5
env: GCOV=gcov-5 CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
- os: linux
compiler: gcc-5
env: FUNCTIONALTEST=functionaltest-lua
- 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: BUILD_32BIT=ON
- os: linux
compiler: clang-3.9
env: CLANG_SANITIZER=ASAN_UBSAN
- os: linux
compiler: clang-3.9
env: CLANG_SANITIZER=TSAN
- os: osx
- stage: baseline
name: clang-asan
os: linux
compiler: clang
osx_image: xcode7.3 # macOS 10.11
- os: osx
compiler: gcc-4.9
osx_image: xcode7.3 # macOS 10.11
allow_failures:
- env: GCOV=gcov-5 CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
# Use Lua so that ASAN can test our embedded Lua support. 8fec4d53d0f6
env:
- CLANG_SANITIZER=ASAN_UBSAN
- CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
- *common-job-env
- name: gcc-coverage (gcc 9)
os: linux
compiler: gcc-9
env:
- GCOV=gcov-9
- CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
- GCOV_ERROR_FILE="/tmp/libgcov-errors.log"
- *common-job-env
addons:
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- *common-apt-packages
- gcc-9
- if: branch = master AND commit_message !~ /\[skip.lint\]/
name: lint
os: linux
env:
- CI_TARGET=lint
- *common-job-env
- stage: second stage
name: "macOS: clang"
os: osx
compiler: clang
osx_image: xcode10.2 # macOS 10.14
env:
- *common-job-env
- name: gcc-functionaltest-lua
os: linux
compiler: gcc
env:
- FUNCTIONALTEST=functionaltest-lua
- CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
- DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
- *common-job-env
- name: gcc-32bit
os: linux
# 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
# Minimum required CMake.
- CMAKE_URL=https://cmake.org/files/v2.8/cmake-2.8.12-Linux-i386.sh
- *common-job-env
- name: clang-tsan
os: linux
compiler: clang
env:
- CLANG_SANITIZER=TSAN
- *common-job-env
fast_finish: true
before_install: ci/before_install.sh
@ -84,45 +152,20 @@ 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
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-3.9
packages:
- autoconf
- automake
- apport
- build-essential
- clang-3.9
- cmake
- cscope
- g++-5-multilib
- g++-multilib
- gcc-5-multilib
- gcc-multilib
- gdb
- language-pack-tr
- libc6-dev-i386
- libtool
- llvm-3.9-dev
- locales
- pkg-config
- unzip
- valgrind
- xclip
branches:
except:
- nightly
only:
- master
- /^release-\d+\.\d+$/
cache:
apt: true
ccache: true
directories:
- "$HOME/.cache/pip"
- "$HOME/.cache/nvim-deps"
- "$CACHE_NVIM_DEPS_DIR"
git:
quiet: true
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,9 +1,10 @@
cmake_minimum_required(VERSION 2.8.7)
project(nvim)
# CMAKE REFERENCE
# intro: https://codingnest.com/basic-cmake/
# best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1
if(POLICY CMP0059)
cmake_policy(SET CMP0059 OLD) # Needed until cmake 2.8.12. #4389
endif()
# Version should match the tested CMAKE_URL in .travis.yml.
cmake_minimum_required(VERSION 2.8.12)
project(nvim C)
# Point CMake at any custom modules we may ship
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
@ -11,8 +12,41 @@ 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")
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)
@ -39,9 +73,6 @@ 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()
if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
@ -49,26 +80,45 @@ if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(USE_FNAME_CASE TRUE)
endif()
# 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)
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()
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
# Build type.
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "CMAKE_BUILD_TYPE not specified, default is 'Debug'")
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build" FORCE)
else()
message(STATUS "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug)
set(DEBUG 1)
else()
set(DEBUG 0)
endif()
# Set available build types for CMake GUIs.
# A different build type can still be set by -DCMAKE_BUILD_TYPE=...
# Other build types 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")
# 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 2)
set(NVIM_VERSION_PATCH 0)
set(NVIM_VERSION_MINOR 4)
set(NVIM_VERSION_PATCH 3)
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
# API level
set(NVIM_API_LEVEL 2) # Bump this after any API change.
set(NVIM_API_LEVEL 6) # Bump this after any API change.
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
set(NVIM_API_PRERELEASE false)
@ -90,68 +140,50 @@ set(NVIM_VERSION_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# 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 DMIN_LOG_LEVEL)
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DMIN_LOG_LEVEL=3")
endif()
if(NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DMIN_LOG_LEVEL)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DMIN_LOG_LEVEL=3")
endif()
# Log level (MIN_LOG_LEVEL in log.h)
if("${MIN_LOG_LEVEL}" MATCHES "^$")
message(STATUS "MIN_LOG_LEVEL not specified, default is 1 (INFO)")
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=${MIN_LOG_LEVEL}")
endif()
# 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")
endif()
if(NOT CMAKE_C_FLAGS_MINSIZEREL MATCHES DDISABLE_LOG)
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DDISABLE_LOG")
endif()
if(NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DDISABLE_LOG)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDISABLE_LOG")
if(CMAKE_COMPILER_IS_GNUCC)
check_c_compiler_flag(-Og HAS_OG_FLAG)
else()
set(HAS_OG_FLAG 0)
endif()
# Enable assertions for RelWithDebInfo.
#
# 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+ sets _FORTIFY_SOURCE=2 automatically. This currently
# does not work with Neovim due to some uses of dynamically-sized structures.
# https://github.com/neovim/neovim/issues/223
@ -183,17 +215,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).
@ -201,7 +232,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}")
@ -214,30 +245,61 @@ 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];
backtrace(trace, 1);
return 0;
}
" HAVE_EXECINFO_BACKTRACE)
check_c_source_compiles("
int main(void)
{
int a = 42;
__builtin_add_overflow(a, a, &a);
__builtin_sub_overflow(a, a, &a);
return 0;
}
" HAVE_BUILTIN_ADD_OVERFLOW)
if(MSVC)
# XXX: /W4 gives too many warnings. #3241
add_definitions(/W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
add_compile_options(/W3)
add_definitions(-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)
add_compile_options(-Wall -Wextra -pedantic -Wno-unused-parameter
-Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion
-Wmissing-prototypes)
check_c_compiler_flag(-Wimplicit-fallthrough HAS_WIMPLICIT_FALLTHROUGH_FLAG)
if(HAS_WIMPLICIT_FALLTHROUGH_FLAG)
add_compile_options(-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")
add_definitions(-Wno-c11-extensions)
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND CMAKE_C_COMPILER_ID MATCHES "Clang")
add_compile_options(-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)
if(HAS_WVLA_FLAG)
add_definitions(-Wvla)
add_compile_options(-Wvla)
endif()
if(UNIX)
@ -246,50 +308,51 @@ if(UNIX)
check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG)
if(HAS_FSTACK_PROTECTOR_STRONG_FLAG)
add_definitions(-fstack-protector-strong)
add_compile_options(-fstack-protector-strong)
elseif(HAS_FSTACK_PROTECTOR_FLAG)
add_definitions(-fstack-protector --param ssp-buffer-size=4)
add_compile_options(-fstack-protector --param ssp-buffer-size=4)
endif()
endif()
check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG)
if(HAS_DIAG_COLOR_FLAG)
add_definitions(-fdiagnostics-color=auto)
endif()
option(TRAVIS_CI_BUILD "Travis/QuickBuild CI. Extra flags will be set." OFF)
if(TRAVIS_CI_BUILD)
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)
if(CMAKE_GENERATOR MATCHES "Ninja")
add_compile_options(-fdiagnostics-color=always)
else()
add_compile_options(-fdiagnostics-color=auto)
endif()
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug)
set(DEBUG 1)
else()
set(DEBUG 0)
option(TRAVIS_CI_BUILD "Travis/QuickBuild CI, extra flags will be set" OFF)
if(TRAVIS_CI_BUILD)
message(STATUS "Travis/QuickBuild CI build enabled")
add_compile_options(-Werror)
if(DEFINED ENV{BUILD_32BIT})
# Get some test coverage for unsigned char
add_compile_options(-funsigned-char)
endif()
endif()
option(LOG_LIST_ACTIONS "Add list actions logging" OFF)
add_definitions(-DINCLUDE_GENERATED_DECLARATIONS)
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")
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}")
# 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_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_NAME STREQUAL "SunOS")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined -lsocket")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
# Required for luajit.
set(CMAKE_EXE_LINKER_FLAGS
@ -303,12 +366,30 @@ endif()
include_directories("${PROJECT_BINARY_DIR}/config")
include_directories("${PROJECT_SOURCE_DIR}/src")
find_package(LibUV REQUIRED)
find_package(LibUV 1.28.0 REQUIRED)
include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
find_package(Msgpack 1.0.0 REQUIRED)
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
find_package(LibLUV 1.30.0 REQUIRED)
include_directories(SYSTEM ${LIBLUV_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)
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()
list(APPEND CMAKE_REQUIRED_INCLUDES "${MSGPACK_INCLUDE_DIRS}")
check_c_source_compiles("
#include <msgpack.h>
@ -319,28 +400,46 @@ main(void)
return MSGPACK_OBJECT_FLOAT32;
}
" MSGPACK_HAS_FLOAT32)
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${MSGPACK_INCLUDE_DIRS}")
if(MSGPACK_HAS_FLOAT32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_MSGPACK_HAS_FLOAT32")
add_definitions(-DNVIM_MSGPACK_HAS_FLOAT32)
endif()
if(UNIX)
option(FEAT_TUI "Enable the Terminal UI" ON)
else()
option(FEAT_TUI "Enable the Terminal UI" OFF)
endif()
option(FEAT_TUI "Enable the Terminal UI" ON)
if(FEAT_TUI)
find_package(Unibilium REQUIRED)
find_package(UNIBILIUM 2.0 REQUIRED)
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
find_package(LibTermkey REQUIRED)
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)
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}")
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_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)
find_package(LIBVTERM 0.1 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)
@ -348,38 +447,21 @@ 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()
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD|FreeBSD")
message(STATUS "detected OpenBSD/FreeBSD; disabled jemalloc. #5318")
option(ENABLE_JEMALLOC "enable jemalloc" OFF)
else()
option(ENABLE_JEMALLOC "enable jemalloc" ON)
endif()
if (ENABLE_JEMALLOC)
if(CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN)
message(STATUS "Sanitizers have been enabled; don't use jemalloc.")
else()
find_package(JeMalloc)
if(JEMALLOC_FOUND)
include_directories(SYSTEM ${JEMALLOC_INCLUDE_DIRS})
endif()
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()
@ -421,23 +503,20 @@ 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 NAMES busted busted.bat)
find_program(BUSTED_LUA_PRG busted-lua)
if(NOT BUSTED_OUTPUT_TYPE)
if(WIN32)
set(BUSTED_OUTPUT_TYPE "plainTerminal")
else()
set(BUSTED_OUTPUT_TYPE "utfTerminal")
endif()
set(BUSTED_OUTPUT_TYPE "nvim")
endif()
find_program(LUACHECK_PRG luacheck)
find_program(FLAKE8_PRG flake8)
find_program(GPERF_PRG gperf)
include(InstallHelpers)
@ -445,33 +524,26 @@ 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(DEFINED MIN_LOG_LEVEL)
if(NOT MIN_LOG_LEVEL MATCHES "^[0-3]$")
message(FATAL_ERROR "MIN_LOG_LEVEL must be a number 0-3")
endif()
message(STATUS "MIN_LOG_LEVEL set to ${MIN_LOG_LEVEL}")
else()
message(STATUS "MIN_LOG_LEVEL not specified, defaulting to INFO(1)")
endif()
#
# Go down the tree.
#
add_subdirectory(src/nvim)
# Read compilation flags from src/nvim,
# used in config subdirectory below.
include(GetCompileFlags)
get_compile_flags(NVIM_VERSION_CFLAGS)
get_directory_property(NVIM_VERSION_CFLAGS DIRECTORY src/nvim DEFINITION NVIM_VERSION_CFLAGS)
add_subdirectory(test/includes)
add_subdirectory(config)
add_subdirectory(test/functional/fixtures) # compile test programs
add_subdirectory(runtime)
get_directory_property(GENERATED_HELP_TAGS DIRECTORY runtime DEFINITION GENERATED_HELP_TAGS)
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.
@ -479,17 +551,6 @@ 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)
endif()
if(CMAKE_GENERATOR MATCHES "Visual Studio")
set(TEST_LIBNVIM_PATH ${CMAKE_BINARY_DIR}/lib/nvim-test.dll)
else()
get_target_property(TEST_LIBNVIM_PATH nvim-test LOCATION)
endif()
# When running tests from 'ninja' we need to use the
# console pool: to do so we need to use the USES_TERMINAL
# option, but this is only available in CMake 3.2
@ -498,12 +559,8 @@ if(BUSTED_PRG)
list(APPEND TEST_TARGET_ARGS "USES_TERMINAL")
endif()
configure_file(
test/config/paths.lua.in
${CMAKE_BINARY_DIR}/test/config/paths.lua)
set(UNITTEST_PREREQS nvim-test unittest-headers)
set(FUNCTIONALTEST_PREREQS nvim printargs-test shell-test)
set(FUNCTIONALTEST_PREREQS nvim printargs-test shell-test streams-test ${GENERATED_HELP_TAGS})
if(NOT WIN32)
list(APPEND FUNCTIONALTEST_PREREQS tty-test)
endif()
@ -512,6 +569,7 @@ if(BUSTED_PRG)
# 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})
@ -530,14 +588,26 @@ if(BUSTED_PRG)
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
-DBUILD_DIR=${CMAKE_BINARY_DIR}
-DTEST_TYPE=unit
-DSYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${UNITTEST_PREREQS}
${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}
@ -548,10 +618,11 @@ if(BUSTED_PRG)
-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}
${TEST_TARGET_ARGS})
set_target_properties(functionaltest functionaltest-prereqs
PROPERTIES FOLDER test)
add_custom_target(benchmark
COMMAND ${CMAKE_COMMAND}
@ -563,10 +634,10 @@ if(BUSTED_PRG)
-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}
${TEST_TARGET_ARGS})
set_target_properties(benchmark benchmark-prereqs PROPERTIES FOLDER test)
endif()
if(BUSTED_LUA_PRG)
@ -580,19 +651,19 @@ if(BUSTED_LUA_PRG)
-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
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-P ${PROJECT_SOURCE_DIR}/cmake/RunTestsLint.cmake)
add_custom_target(lualint
COMMAND ${LUACHECK_PRG} -q runtime/ src/ test/
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
else()
add_custom_target(lualint false
COMMENT "lualint: LUACHECK_PRG not defined")
endif()
set(CPACK_PACKAGE_NAME "Neovim")

View File

@ -1,4 +1,5 @@
# Contributing to Neovim
Contributing to Neovim
======================
Getting started
---------------
@ -6,34 +7,42 @@ Getting started
If you want to help but don't know where to start, here are some
low-risk/isolated tasks:
- Merge a [Vim patch].
- [Merge a Vim patch].
- Try a [complexity:low] issue.
- Fix [clang-scan], [coverity](#coverity), and [PVS](#pvs-studio) warnings.
Developer guidelines
--------------------
- Nvim developers should read `:help dev-help`.
- External UI developers should read `:help dev-ui`.
- Fix bugs found by [Clang](#clang-scan-build), [PVS](#pvs-studio) or
[Coverity](#coverity).
Reporting problems
------------------
- Check the [**FAQ**][wiki-faq].
- Search [existing issues][github-issues] (including closed!)
- [Check the FAQ][wiki-faq].
- [Search existing issues][github-issues] (including closed!)
- Update Neovim to the latest version to see if your problem persists.
- If you're using a plugin manager, comment out your plugins, then add them back
in one by one, to narrow down the cause of the issue.
- Crash reports which include a stacktrace are 10x more valuable.
- [Bisecting][git-bisect] to the cause of a regression often leads to an
immediate fix.
- Disable plugins incrementally, to narrow down the cause of the issue.
- When reporting a crash, [include a stacktrace](https://github.com/neovim/neovim/wiki/FAQ#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-related issues.
Pull requests ("PRs")
Developer guidelines
--------------------
- Nvim contributors should read `:help dev`.
- 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.
```
Pull requests (PRs)
---------------------
- To avoid duplicate work, create a `[WIP]` pull request as soon as possible.
- Avoid cosmetic changes to unrelated files in the same commit: noise makes
reviews take longer.
- Your PR must include **test coverage.** See [test/README.md][run-tests].
- 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.
@ -43,7 +52,7 @@ Pull requests ("PRs")
- Use the `ri` git alias:
```
[alias]
ri = "!sh -c 't=\"${1:-master}\" ; s=\"${2:-HEAD}\" ; if git merge-base --is-ancestor \"$t\" \"$s\" ; then o=\"$t\" ; else 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 ; fi ; [ $# -gt 0 ] && shift ; [ $# -gt 0 ] && shift ; git rebase --interactive \"$o\" \"$@\"' -"
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.
@ -56,20 +65,10 @@ Pull requests ("PRs")
Pull requests have three stages: `[WIP]` (Work In Progress), `[RFC]` (Request
For Comment) and `[RDY]` (Ready).
- 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.
For example, a typical workflow is:
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]`.
- `[RFC]` is assumed by default, i.e. you are requesting a review.
- Add `[WIP]` to the PR title if you are _not_ requesting feedback and the work
is still in flux.
- Add `[RDY]` if you are _done_ and only waiting on merge.
### Commit messages
@ -79,55 +78,117 @@ the VCS/git logs more valuable.
- Try to keep the first line under 72 characters.
- **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`.
- Subject line for commits with only style/lint changes can be a single
word: `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."
### Automated builds (CI)
Each pull request must pass the automated builds ([travis CI] and [quickbuild]).
Each pull request must pass the automated builds on [Travis CI], [QuickBuild]
and [AppVeyor].
- CI builds are compiled with [`-Werror`][gcc-warnings], so if your PR
introduces any compiler warnings, the build will fail.
- CI builds are compiled with [`-Werror`][gcc-warnings], so compiler warnings
will fail the build.
- If any tests fail, the build will fail.
See [Building Neovim#running-tests][wiki-run-tests] to run tests locally.
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`
- 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.
- 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](#lint) build checks modified lines _and their immediate
neighbors_, to encourage incrementally updating the legacy style to meet our
[style](#style). (See [#3174][3174] for background.)
- [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
```
QuickBuild uses this invocation:
### Clang scan-build
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
View the [Clang report] to see potential bugs found by the Clang
[scan-build](https://clang-analyzer.llvm.org/scan-build.html) analyzer.
- Search the Neovim commit history to find examples:
```
git log --oneline --no-merges --grep clang
```
- To verify a fix locally, run `scan-build` like this:
```
rm -rf build/
scan-build --use-analyzer=/usr/bin/clang make
```
### PVS-Studio
View the [PVS report](https://neovim.io/doc/reports/pvs/PVS-studio.html.d/) to
see potential bugs found by [PVS Studio](https://www.viva64.com/en/pvs-studio/).
- Use this format for commit messages (where `{id}` is the PVS warning-id)):
```
PVS/V{id}: {description}
```
- Search the Neovim commit history to find examples:
```
git log --oneline --no-merges --grep PVS
```
- Try `./scripts/pvscheck.sh` to run PVS locally.
### Coverity
[Coverity](https://scan.coverity.com/projects/neovim-neovim) runs against the
master build. If you want to view the defects, just request access at the
_Contributor_ level. An Admin will grant you permission.
master build. To view the defects, just request access; you will be approved.
Use this commit-message format for coverity fixes:
- Use this format for commit messages (where `{id}` is the CID (Coverity ID);
([example](https://github.com/neovim/neovim/pull/804))):
```
coverity/{id}: {description}
```
- Search the Neovim commit history to find examples:
```
git log --oneline --no-merges --grep coverity
```
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).
Coding
------
### PVS-Studio
### Lint
You can run the linter locally by:
make lint
The lint step downloads the [master error list] and excludes them, so only lint
errors related to the local changes are reported.
You can lint a single file (but this will _not_ exclude legacy errors):
./src/clint.py src/nvim/ops.c
### Style
The repo includes a `.clang-format` config file which (mostly) matches the
[style-guide]. You can use `clang-format` to format code with the `gq`
operator in Nvim:
if !empty(findfile('.clang-format', ';'))
setlocal formatprg=clang-format\ -style=file
endif
### Navigate
- Use **[universal-ctags](https://github.com/universal-ctags/ctags).**
("Exuberant ctags", the typical `ctags` binary provided by your distro, is
unmaintained and won't recognize many function signatures in Neovim source.)
- Explore the source code [on the web](https://sourcegraph.com/github.com/neovim/neovim).
Run `scripts/pvscheck.sh` to check the codebase with [PVS
Studio](https://www.viva64.com/en/pvs-studio/).
Reviewing
---------
@ -146,7 +207,7 @@ shows each commit's diff. To show the whole surrounding function of a change
as context, use the `-W` argument as well.
[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
@ -157,12 +218,14 @@ as context, use the `-W` argument as well.
[hygiene]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[style-guide]: http://neovim.io/develop/style-guide.xml
[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
[wiki-run-tests]: https://github.com/neovim/neovim/wiki/Building-Neovim#running-tests
[run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ
[review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
[3174]: https://github.com/neovim/neovim/issues/3174
[travis CI]: https://travis-ci.org/neovim/neovim
[quickbuild]: http://neovim-qb.szakmeister.net/dashboard
[Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
[clang-scan]: https://neovim.io/doc/reports/clang/
[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 report]: https://neovim.io/doc/reports/clang/
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
[master error list]: https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint/errors.json

View File

@ -1,16 +0,0 @@
- `nvim --version`:
- Vim (version: ) behaves differently?
- Operating system/version:
- Terminal name/version:
- `$TERM`:
### Actual behaviour
### Expected behaviour
### Steps to reproduce using `nvim -u NORC`
```
nvim -u NORC
```

63
MAINTAIN.md Normal file
View File

@ -0,0 +1,63 @@
Maintaining the Neovim project
==============================
Notes on maintaining the Neovim project.
General guidelines
------------------
* Decide by cost-benefit
* Write down what was decided
* Constraints are good
* Use automation to solve problems
* Never break the API
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
--------------
Release "often", but not "early".
The (unreleased) `master` branch is the "early" channel; it should not be
released if it's not stable. High-risk changes may be merged to `master` if
the next release is not imminent.
For maintenance releases, create a `release-x.y` branch. If the current release
has a major bug:
1. Fix the bug on `master`.
2. Cherry-pick the fix to `release-x.y`.
3. Cut a release from `release-x.y`.
- Run `./scripts/release.sh`
- Update (force-push) the remote `stable` tag.
- The [nightly job](https://github.com/neovim/bot-ci/blob/master/ci/nightly.sh)
will update the release assets based on the `stable` tag.
See also
--------
- https://github.com/neovim/neovim/issues/862
- https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt

126
Makefile
View File

@ -1,18 +1,46 @@
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
all: nvim
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
# Extra CMake flags which extend the default set
CMAKE_EXTRA_FLAGS ?=
# CMAKE_INSTALL_PREFIX
# - May be passed directly or as part of CMAKE_EXTRA_FLAGS.
# - `checkprefix` target checks that it matches the CMake-cached value. #9615
ifneq (,$(CMAKE_INSTALL_PREFIX)$(CMAKE_EXTRA_FLAGS))
CMAKE_INSTALL_PREFIX := $(shell echo $(CMAKE_EXTRA_FLAGS) | 2>/dev/null \
grep -o 'CMAKE_INSTALL_PREFIX=[^ ]\+' | cut -d '=' -f2)
endif
ifneq (,$(CMAKE_INSTALL_PREFIX))
override CMAKE_EXTRA_FLAGS += -DCMAKE_INSTALL_PREFIX=$(CMAKE_INSTALL_PREFIX)
checkprefix:
@if [ -f build/.ran-cmake ]; then \
cached_prefix=$(shell $(CMAKE_PRG) -L -N build | 2>/dev/null grep 'CMAKE_INSTALL_PREFIX' | cut -d '=' -f2); \
if ! [ "$(CMAKE_INSTALL_PREFIX)" = "$$cached_prefix" ]; then \
printf "Re-running CMake: CMAKE_INSTALL_PREFIX '$(CMAKE_INSTALL_PREFIX)' does not match cached value '%s'.\n" "$$cached_prefix"; \
$(RM) build/.ran-cmake; \
fi \
fi
else
checkprefix: ;
endif
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))
@ -28,35 +56,32 @@ ifeq (,$(BUILD_TOOL))
endif
endif
BUILD_CMD = $(BUILD_TOOL)
ifneq ($(VERBOSE),)
# Only need to handle Ninja here. Make will inherit the VERBOSE variable.
ifeq ($(BUILD_TYPE),Ninja)
VERBOSE_FLAG := -v
BUILD_CMD += -v
endif
endif
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/usr/bin/lua ] || rm build/.ran-*)
$(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
# a warning, but we need to keep SCRIPTS argument.
SINGLE_MAKE = export MAKEFLAGS= ; $(MAKE)
all: nvim
nvim: build/.ran-cmake deps
+$(BUILD_CMD) -C build
@ -68,26 +93,28 @@ cmake:
$(MAKE) build/.ran-cmake
build/.ran-cmake: | deps
cd build && $(CMAKE_PRG) -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 && \
ifeq ($(call filter-true,$(USE_BUNDLED)),)
$(DEPS_BUILD_DIR):
mkdir -p "$@"
build/.ran-third-party-cmake:: $(DEPS_BUILD_DIR)
cd $(DEPS_BUILD_DIR) && \
$(CMAKE_PRG) -G '$(BUILD_TYPE)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
$(DEPS_CMAKE_FLAGS) ../third-party
$(DEPS_CMAKE_FLAGS) $(THIS_DIR)/third-party
endif
build/.ran-third-party-cmake::
mkdir -p build
touch $@
# TODO: cmake 3.2+ add_custom_target() has a USES_TERMINAL flag.
oldtest: | nvim helptags
oldtest: | nvim build/runtime/doc/tags
+$(SINGLE_MAKE) -C src/nvim/testdir clean
ifeq ($(strip $(TEST_FILE)),)
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" $(MAKEOVERRIDES)
@ -95,8 +122,12 @@ 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
build/runtime/doc/tags helptags: | nvim
+$(BUILD_CMD) -C build runtime/doc/tags
# Builds help HTML _and_ checks for invalid help tags.
helphtml: | nvim build/runtime/doc/tags
+$(BUILD_CMD) -C build doc_html
functionaltest: | nvim
+$(BUILD_CMD) -C build functionaltest
@ -104,8 +135,16 @@ functionaltest: | 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
pylint:
flake8 contrib/ scripts/ src/ test/
# Run pylint only if flake8 is installed.
_opt_pylint:
@command -v flake8 && { $(MAKE) pylint; exit $$?; } \
|| echo "SKIP: pylint (flake8 not found)"
unittest: | nvim
+$(BUILD_CMD) -C build unittest
@ -120,10 +159,11 @@ clean:
$(MAKE) -C src/nvim/testdir clean
$(MAKE) -C runtime/doc clean
distclean: clean
rm -rf .deps build
distclean:
rm -rf $(DEPS_BUILD_DIR) build
$(MAKE) clean
install: | nvim
install: checkprefix nvim
+$(BUILD_CMD) -C build install
clint: build/.ran-cmake
@ -135,6 +175,28 @@ clint-full: build/.ran-cmake
check-single-includes: build/.ran-cmake
+$(BUILD_CMD) -C build check-single-includes
lint: check-single-includes clint testlint
generated-sources: build/.ran-cmake
+$(BUILD_CMD) -C build generated-sources
.PHONY: test testlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install
appimage:
bash scripts/genappimage.sh
# Build an appimage with embedded update information.
# appimage-nightly: for nightly builds
# appimage-latest: for a release
appimage-%:
bash scripts/genappimage.sh $*
lint: check-single-includes clint lualint _opt_pylint
# Generic pattern rules, allowing for `make build/bin/nvim` etc.
# Does not work with "Unix Makefiles".
ifeq ($(BUILD_TYPE),Ninja)
build/%:
$(BUILD_CMD) -C build $(patsubst build/%,%,$@)
$(DEPS_BUILD_DIR)/%:
$(BUILD_CMD) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
endif
.PHONY: test lualint pylint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix

137
README.md
View File

@ -1,18 +1,20 @@
[![Neovim](https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-600x173.png)](https://neovim.io)
[![Neovim](https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-300x87.png)](https://neovim.io)
[Wiki](https://github.com/neovim/neovim/wiki) |
[Documentation](https://neovim.io/doc) |
[Twitter](https://twitter.com/Neovim) |
[Community](https://neovim.io/community/) |
[Gitter **Chat**](https://gitter.im/neovim/neovim)
[Chat/Discussion](https://gitter.im/neovim/neovim) |
[Twitter](https://twitter.com/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/urdqjrik5u521fac/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](https://neovim.io/doc/reports/clang/badge.svg)](https://neovim.io/doc/reports/clang)
<a href="https://buildd.debian.org/neovim"><img src="https://www.debian.org/logos/openlogo-nd-25.png" width="13" height="15">Debian</a>
[![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:
@ -21,50 +23,92 @@ Neovim is a project that seeks to aggressively refactor Vim in order to:
- Enable [advanced UIs] without modifications to the core
- Maximize [extensibility](https://github.com/neovim/neovim/wiki/Plugin-UI-architecture)
See [the wiki](https://github.com/neovim/neovim/wiki/Introduction) and [Roadmap]
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)
Features
--------
Install from source
-------------------
- Modern [GUIs](https://github.com/neovim/neovim/wiki/Related-projects#gui)
- [API access](https://github.com/neovim/neovim/wiki/Related-projects#api-clients)
from any language including C/C++, C#, Clojure, D, Elixir, Go, Haskell, Java,
JavaScript/Node.js, Julia, Lisp, Lua, Perl, Python, Racket, Ruby, 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
make CMAKE_BUILD_TYPE=RelWithDebInfo
sudo make install
See [the wiki](https://github.com/neovim/neovim/wiki/Building-Neovim) for details.
See [`:help nvim-features`][nvim-features] for the full list!
Install from package
--------------------
Packages are in [Homebrew], [Debian], [Ubuntu], [Fedora], [Arch Linux], and
[more](https://github.com/neovim/neovim/wiki/Installing-Neovim).
Pre-built packages for Windows, macOS, and Linux are found on the
[Releases](https://github.com/neovim/neovim/releases/) page.
[Managed packages] are in Homebrew, [Debian], [Ubuntu], [Fedora], [Arch Linux],
[Gentoo], and more!
Install from source
-------------------
The build is CMake-based, but a Makefile is provided as a convenience.
make CMAKE_BUILD_TYPE=RelWithDebInfo
sudo make install
To install to a non-default location:
make CMAKE_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
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
```
To inspect the build, these CMake features are useful:
- `cmake --build build --target help` lists all build targets.
- `build/CMakeCache.txt` (or `cmake -LAH build/`) 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 server scripts
- `cmake/`: Build scripts
- `runtime/`: Application files
- [`src/`](src/nvim/README.md): Application source code
- `third-party/`: CMake sub-project to build third-party dependencies (if the
`USE_BUNDLED_DEPS` flag is undefined or `USE_BUNDLED` CMake option is false).
- [`test/`](test/README.md): Test files
What's been done so far
-----------------------
- RPC API based on [MessagePack](https://msgpack.org)
- Embedded [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html)
- Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
- [Shared data (shada)](https://github.com/neovim/neovim/pull/2506) among multiple editor instances
- [XDG base directories](https://github.com/neovim/neovim/pull/3470) support
- [libuv](https://github.com/libuv/libuv/)-based platform/OS layer
- [Pushdown automaton](https://github.com/neovim/neovim/pull/3413) input model
- 1000s of new tests
- Legacy tests converted to Lua tests
See [`:help nvim-features`][nvim-features] for a comprehensive list.
├─ 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
-------
@ -95,11 +139,12 @@ See `LICENSE` for details.
[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-projects
[Homebrew]: https://github.com/neovim/homebrew-neovim#installation
[advanced UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui
[Managed packages]: https://github.com/neovim/neovim/wiki/Installing-Neovim#install-from-package
[Debian]: https://packages.debian.org/testing/neovim
[Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim
[Fedora]: https://admin.fedoraproject.org/pkgdb/package/rpms/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,13 +1,42 @@
version: '{build}'
environment:
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: "-t7z -m0=lzma -mx=9"
DEPS_BUILD_DIR: "C:/projects/nvim-deps"
DEPS_PREFIX: "C:/projects/nvim-deps/usr"
# Silence/redirect errors due to missing locking support (via libgcov).
GCOV_ERROR_FILE: "$(TEMP)/libgcov-errors.log"
image: Visual Studio 2017
configuration:
- MINGW_64
- MINGW_64-gcov
- MINGW_32
- MSVC_64
- MSVC_32
init:
- ps: |
# Pull requests: skip some build configurations to save time.
if ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -and $env:CONFIGURATION -match '^(MSVC_64|MINGW_32)$') {
$env:APPVEYOR_CACHE_SKIP_SAVE = "true"
Exit-AppVeyorBuild
}
# RDP
#- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
matrix:
fast_finish: true
install: []
before_build:
- ps: Install-Product node 8
build_script:
- call ci\build.bat
- powershell ci\build.ps1
after_build:
- ps: |
if (Test-Path $env:GCOV_ERROR_FILE) {
Get-Content $env:GCOV_ERROR_FILE -Head 10
Get-Content $env:GCOV_ERROR_FILE -Tail 10
} else {
write-host "no GCOV_ERROR_FILE"
}
cache:
- C:\msys64\var\cache\pacman\pkg -> ci\build.bat
- .deps -> third-party\**
- C:\projects\nvim-deps -> third-party\**
artifacts:
- path: build/Neovim.zip
- path: build/bin/nvim.exe

View File

@ -1,8 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
if [[ -n "${GCOV}" ]]; then
coveralls --gcov "$(which "${GCOV}")" --encoding iso-8859-1 || echo 'coveralls upload failed.'
fi

View File

@ -4,16 +4,24 @@ 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 -chd 1 "${HOME}/.cache" | sort -rh | head -20
echo "before_cache.sh: ccache stats"
ccache -s 2>/dev/null || true
# Do not keep ccache stats (uploaded to cache otherwise; reset initially anyway).
find "${HOME}/.ccache" -name stats -delete
# 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"
# Do not cache downloads. They should not be needed with up-to-date deps.
rm -rf "${DEPS_BUILD_DIR}/build/downloads"
rm -rf "${CACHE_NVIM_DEPS_DIR}"
mv "${DEPS_BUILD_DIR}" "${CACHE_NVIM_DEPS_DIR}"
touch "${CACHE_MARKER}"
echo "Updated third-party dependencies (timestamp: $(stat -c '%y' "${CACHE_MARKER}"))."
echo "Updated third-party dependencies (timestamp: $(_stat "${CACHE_MARKER}"))."
fi

View File

@ -7,19 +7,58 @@ if [[ "${CI_TARGET}" == lint ]]; then
exit
fi
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
brew update
echo 'Python info:'
(
set -x
python3 --version
python2 --version
python --version
pip3 --version
pip2 --version
pip --version
pyenv --version
pyenv versions
) 2>&1 | sed 's/^/ /' || true
# Use pyenv, but not for OSX on Travis, where it only has the "system" version.
if [[ "${TRAVIS_OS_NAME}" != osx ]] && command -v pyenv; then
echo 'Setting Python versions via pyenv'
# Prefer Python 2 over 3 (more conservative).
pyenv global 2.7.15:3.7
echo 'Updated Python info:'
(
set -x
python3 --version
python2 --version
python --version
python3 -m pip --version
python2 -m pip --version
) 2>&1 | sed 's/^/ /'
fi
echo "Upgrade Python 2 pip."
pip2.7 -q install --user --upgrade pip
echo "Install node (LTS)"
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
echo "Install Python 3."
brew install python3
echo "Upgrade Python 3 pip."
pip3 -q install --user --upgrade pip
else
echo "Upgrade Python 3 pip."
pip3 -q install --user --upgrade pip
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
if [[ -n "$CMAKE_URL" ]]; then
echo "Installing custom CMake: $CMAKE_URL"
curl --retry 5 --silent --fail -o /tmp/cmake-installer.sh "$CMAKE_URL"
mkdir -p "$HOME/.local/bin" /opt/cmake-custom
bash /tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license
ln -sfn /opt/cmake-custom/bin/cmake "$HOME/.local/bin/cmake"
cmake_version="$(cmake --version)"
echo "$cmake_version" | grep -qF '2.8.12' || {
echo "Unexpected CMake version: $cmake_version"
exit 1
}
fi

View File

@ -20,6 +20,11 @@ if [[ -n "${LLVM_SYMBOLIZER}" ]] && [[ ! $(type -P "${LLVM_SYMBOLIZER}") ]]; the
exit 1
fi
echo "before_script.sh: ccache stats (will be cleared)"
ccache -s
# Reset ccache stats for real results in before_cache.
ccache --zero-stats
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`.

View File

@ -1,54 +0,0 @@
:: These are native MinGW builds, but they use the toolchain inside
:: MSYS2, this allows using all the dependencies and tools available
:: in MSYS2, but we cannot build inside the MSYS2 shell.
echo on
if "%CONFIGURATION%" == "MINGW_32" (
set ARCH=i686
set BITS=32
) else (
set ARCH=x86_64
set BITS=64
)
:: We cannot have sh.exe in the PATH (MinGW)
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
set PATH=C:\msys64\mingw%BITS%\bin;C:\Windows\System32;C:\Windows;%PATH%
:: The default cpack in the PATH is not CMake
set PATH=C:\Program Files (x86)\CMake\bin\cpack.exe;%PATH%
:: Build third-party dependencies
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Su" || goto :error
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S mingw-w64-%ARCH%-cmake mingw-w64-%ARCH%-perl mingw-w64-%ARCH%-diffutils gperf" || goto :error
:: Setup python (use AppVeyor system python)
C:\Python27\python.exe -m pip install neovim || goto :error
C:\Python35\python.exe -m pip install neovim || goto :error
:: Disambiguate python3
move c:\Python35\python.exe c:\Python35\python3.exe
set PATH=C:\Python35;C:\Python27;%PATH%
:: Sanity check
python -c "import neovim; print(str(neovim))" || goto :error
python3 -c "import neovim; print(str(neovim))" || goto :error
mkdir .deps
cd .deps
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ..\third-party\ || goto :error
mingw32-make VERBOSE=1 || goto :error
cd ..
:: Build Neovim
mkdir build
cd build
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUSTED_OUTPUT_TYPE=nvim -DGPERF_PRG="C:\msys64\usr\bin\gperf.exe" .. || goto :error
mingw32-make VERBOSE=1 || goto :error
bin\nvim --version || goto :error
:: Functional tests
mingw32-make functionaltest VERBOSE=1 || goto :error
:: Build artifacts
cpack -G ZIP -C Release
if defined APPVEYOR_REPO_TAG_NAME cpack -G NSIS -C Release
goto :EOF
:error
exit /b %errorlevel%

153
ci/build.ps1 Normal file
View File

@ -0,0 +1,153 @@
$ErrorActionPreference = 'stop'
Set-PSDebug -Strict -Trace 1
$isPullRequest = ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -ne $null)
$env:CONFIGURATION -match '^(?<compiler>\w+)_(?<bits>32|64)(?:-(?<option>\w+))?$'
$compiler = $Matches.compiler
$compileOption = $Matches.option
$bits = $Matches.bits
$cmakeBuildType = $(if ($env:CMAKE_BUILD_TYPE -ne $null) {$env:CMAKE_BUILD_TYPE} else {'RelWithDebInfo'});
$buildDir = [System.IO.Path]::GetFullPath("$(pwd)")
$depsCmakeVars = @{
CMAKE_BUILD_TYPE = $cmakeBuildType;
}
$nvimCmakeVars = @{
CMAKE_BUILD_TYPE = $cmakeBuildType;
BUSTED_OUTPUT_TYPE = 'nvim';
DEPS_PREFIX=$(if ($env:DEPS_PREFIX -ne $null) {$env:DEPS_PREFIX} else {".deps/usr"});
}
if ($env:DEPS_BUILD_DIR -eq $null) {
$env:DEPS_BUILD_DIR = ".deps";
}
$uploadToCodeCov = $false
function exitIfFailed() {
if ($LastExitCode -ne 0) {
Set-PSDebug -Off
exit $LastExitCode
}
}
if (-Not (Test-Path -PathType container $env:DEPS_BUILD_DIR)) {
write-host "cache dir not found: $($env:DEPS_BUILD_DIR)"
mkdir $env:DEPS_BUILD_DIR
} else {
write-host "cache dir $($env:DEPS_BUILD_DIR) size: $(Get-ChildItem $env:DEPS_BUILD_DIR -recurse | Measure-Object -property length -sum | Select -expand sum)"
}
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
$env:GCOV = "C:\msys64\mingw$bits\bin\gcov"
}
# 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').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)" }
}
cd $env:DEPS_BUILD_DIR
cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
cd $buildDir
# Build Neovim
mkdir build
cd build
cmake -G $cmakeGenerator $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
.\bin\nvim --version ; exitIfFailed
# Ensure that the "win32" feature is set.
.\bin\nvim -u NONE --headless -c 'exe !has(\"win32\").\"cq\"' ; 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) {
if ($uploadToCodecov) {
bash -l /c/projects/neovim/ci/common/submit_coverage.sh functionaltest
}
exit $LastExitCode
}
Set-PSDebug -Strict -Trace 1
if ($uploadToCodecov) {
bash -l /c/projects/neovim/ci/common/submit_coverage.sh functionaltest
}
# Old tests
# Add MSYS to path, required for e.g. `find` used in test scripts.
# But would break functionaltests, where its `more` would be used then.
$OldPath = $env:PATH
$env:PATH = "C:\msys64\usr\bin;$env:PATH"
& "C:\msys64\mingw$bits\bin\mingw32-make.exe" -C $(Convert-Path ..\src\nvim\testdir) VERBOSE=1 ; exitIfFailed
$env:PATH = $OldPath
if ($uploadToCodecov) {
bash -l /c/projects/neovim/ci/common/submit_coverage.sh oldtest
}
# Build artifacts
cpack -G ZIP -C RelWithDebInfo
if ($env:APPVEYOR_REPO_TAG_NAME -ne $null) {
cpack -G NSIS -C RelWithDebInfo
}

View File

@ -1,5 +1,16 @@
_stat() {
if test "${TRAVIS_OS_NAME}" = osx ; then
stat -f %Sm "${@}"
else
stat -c %y "${@}"
fi
}
top_make() {
${MAKE_CMD} "$@"
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() {
@ -10,32 +21,26 @@ build_deps() {
if test "${BUILD_32BIT}" = ON ; then
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
fi
if test "${FUNCTIONALTEST}" = "functionaltest-lua" ; then
if test "${FUNCTIONALTEST}" = "functionaltest-lua" \
|| test "${CLANG_SANITIZER}" = "ASAN_UBSAN" ; then
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
fi
rm -rf "${DEPS_BUILD_DIR}"
mkdir -p "${DEPS_BUILD_DIR}"
# If there is a valid cache and we're not forced to recompile,
# use cached third-party dependencies.
if test -f "${CACHE_MARKER}" && test "${BUILD_NVIM_DEPS}" != "true" ; then
local statcmd="stat -c '%y'"
if test "${TRAVIS_OS_NAME}" = osx ; then
statcmd="stat -f '%Sm'"
fi
echo "Using third-party dependencies from Travis's cache (last updated: $(${statcmd} "${CACHE_MARKER}"))."
mkdir -p "$(dirname "${DEPS_BUILD_DIR}")"
mv "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}"
else
mkdir -p "${DEPS_BUILD_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 -a "${CACHE_NVIM_DEPS_DIR}"/. "${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}'."
CC= cmake ${DEPS_CMAKE_FLAGS} "${TRAVIS_BUILD_DIR}/third-party/"
CC= cmake -G Ninja ${DEPS_CMAKE_FLAGS} "${TRAVIS_BUILD_DIR}/third-party/"
if ! top_make; then
exit 1
@ -55,7 +60,7 @@ prepare_build() {
mkdir -p "${BUILD_DIR}"
cd "${BUILD_DIR}"
echo "Configuring with '${CMAKE_FLAGS} $@'."
cmake ${CMAKE_FLAGS} "$@" "${TRAVIS_BUILD_DIR}"
cmake -G Ninja ${CMAKE_FLAGS} "$@" "${TRAVIS_BUILD_DIR}"
}
build_nvim() {
@ -70,19 +75,29 @@ build_nvim() {
exit 1
fi
echo "Building nvim-test."
if ! top_make nvim-test ; then
exit 1
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}"
if ! (bin/nvim --version && bin/nvim -u NONE -e -cq | cat -vet) ; then
check_sanitizer "${LOG_DIR}"
exit 1
fi
asan_check "${LOG_DIR}"
check_sanitizer "${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
}

45
ci/common/submit_coverage.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/sh
# Collect and submit coverage reports.
#
# Args:
# $1: Flag(s) for codecov, separated by comma.
set -ex
# Change to grandparent dir (POSIXly).
CDPATH='' cd -P -- "$(dirname -- "$0")/../.." || exit
echo "=== running submit_coverage in $PWD: $* ==="
"$GCOV" --version
# Download/install codecov-bash and gcovr once.
codecov_sh="${TEMP:-/tmp}/codecov.bash"
if ! [ -f "$codecov_sh" ]; then
curl --retry 5 --silent --fail -o "$codecov_sh" https://codecov.io/bash
chmod +x "$codecov_sh"
python3 -m pip install --quiet --user gcovr
fi
(
cd build
python3 -m gcovr --branches --exclude-unreachable-branches --print-summary -j 2 --exclude '.*/auto/.*' --root .. --delete -o ../coverage.xml --xml
)
# Upload to codecov.
# -X gcov: disable gcov, done manually above.
# -X fix: disable fixing of reports (not necessary, rather slow)
# -Z: exit non-zero on failure
# -F: flag(s)
# NOTE: ignoring flags for now, since this causes timeouts on codecov.io then,
# which they know about for about a year already...
# Flags must match pattern ^[\w\,]+$ ("," as separator).
codecov_flags="$(uname -s),${1}"
codecov_flags=$(echo "$codecov_flags" | sed 's/[^,_a-zA-Z0-9]/_/g')
if ! "$codecov_sh" -f coverage.xml -X gcov -X fix -Z -F "${codecov_flags}"; then
echo "codecov upload failed."
fi
# Cleanup always, especially collected data.
find . \( -name '*.gcov' -o -name '*.gcda' \) -ls -delete | wc -l
rm -f coverage.xml

View File

@ -39,10 +39,11 @@ enter_suite() {
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}"
else
travis_fold end "${NVIM_TEST_CURRENT_SUITE}"
fi
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}"
if test "$1" != "--continue" ; then

View File

@ -1,6 +1,12 @@
. "${CI_DIR}/common/build.sh"
. "${CI_DIR}/common/suite.sh"
submit_coverage() {
if [ -n "${GCOV}" ]; then
"${CI_DIR}/common/submit_coverage.sh" "$@" || echo 'codecov upload failed.'
fi
}
print_core() {
local app="$1"
local core="$2"
@ -23,10 +29,13 @@ check_core_dumps() {
shift
fi
local app="${1:-${BUILD_DIR}/bin/nvim}"
local cores
if test "${TRAVIS_OS_NAME}" = osx ; then
local cores="$(find /cores/ -type f -print)"
cores="$(find /cores/ -type f -print)"
local _sudo='sudo'
else
local cores="$(find ./ -type f -name 'core.*' -print)"
cores="$(find ./ -type f -name 'core.*' -print)"
local _sudo=
fi
if test -z "${cores}" ; then
@ -36,7 +45,7 @@ check_core_dumps() {
for core in $cores; do
if test "$del" = "1" ; then
print_core "$app" "$core" >&2
rm "$core"
"$_sudo" rm "$core"
else
print_core "$app" "$core"
fi
@ -60,6 +69,7 @@ check_logs() {
for log in $(find "${1}" -type f -name "${2}" -size +0); do
cat "${log}"
err=1
rm "${log}"
done
if test -n "${err}" ; then
fail 'logs' E 'Runtime errors detected.'
@ -70,8 +80,10 @@ valgrind_check() {
check_logs "${1}" "valgrind-*"
}
asan_check() {
check_logs "${1}" "*san.*"
check_sanitizer() {
if test -n "${CLANG_SANITIZER}"; then
check_logs "${1}" "*san.*"
fi
}
run_unittests() {(
@ -80,7 +92,8 @@ run_unittests() {(
if ! build_make unittest ; then
fail 'unittests' F 'Unit tests failed'
fi
check_core_dumps "$(which luajit)"
submit_coverage unittest
check_core_dumps "$(command -v luajit)"
exit_suite
)}
@ -90,7 +103,8 @@ run_functionaltests() {(
if ! build_make ${FUNCTIONALTEST}; then
fail 'functionaltests' F 'Functional tests failed'
fi
asan_check "${LOG_DIR}"
submit_coverage functionaltest
check_sanitizer "${LOG_DIR}"
valgrind_check "${LOG_DIR}"
check_core_dumps
exit_suite
@ -99,11 +113,12 @@ run_functionaltests() {(
run_oldtests() {(
enter_suite oldtests
ulimit -c unlimited || true
if ! make -C "${TRAVIS_BUILD_DIR}/src/nvim/testdir"; then
if ! make oldtest; then
reset
fail 'oldtests' F 'Legacy tests failed'
fi
asan_check "${LOG_DIR}"
submit_coverage oldtest
check_sanitizer "${LOG_DIR}"
valgrind_check "${LOG_DIR}"
check_core_dumps
exit_suite

View File

@ -4,20 +4,23 @@ set -e
set -o pipefail
if [[ "${CI_TARGET}" == lint ]]; then
python -m pip -q install --user --upgrade flake8
exit
fi
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
brew install gettext
brew reinstall -s libtool
export PATH="/usr/local/opt/ccache/libexec:$PATH"
fi
# Use default CC to avoid compilation problems when installing Python modules.
echo "Install neovim module and coveralls for Python 2."
CC=cc pip2.7 -q install --user --upgrade neovim cpp-coveralls
echo "Install neovim module for Python 3."
CC=cc pip3 -q install --user --upgrade neovim
CC=cc python3 -m pip -q install --upgrade pynvim
echo "Install neovim module for Python 2."
CC=cc python2 -m pip -q install --upgrade pynvim
echo "Install neovim RubyGem."
gem install --no-document --version ">= 0.2.0" neovim
gem install --no-document --version ">= 0.8.0" neovim
echo "Install neovim npm package"
npm install -g neovim
npm link neovim

View File

@ -9,26 +9,24 @@ source "${CI_DIR}/common/build.sh"
source "${CI_DIR}/common/suite.sh"
enter_suite 'clint'
run_test 'top_make clint-full' clint
run_test 'make clint-full' clint
exit_suite --continue
enter_suite 'testlint'
run_test 'top_make testlint' testlint
enter_suite 'lualint'
run_test 'make lualint' lualint
exit_suite --continue
enter_suite 'pylint'
run_test 'make pylint' pylint
exit_suite --continue
enter_suite single-includes
CLICOLOR_FORCE=1 run_test_wd \
--allow-hang \
10s \
'top_make check-single-includes' \
'make check-single-includes' \
'csi_clean' \
single-includes
exit_suite --continue
end_tests

View File

@ -22,7 +22,9 @@ 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
run_test run_unittests
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
run_test run_unittests
fi
run_test run_functionaltests
fi
run_test run_oldtests

View File

@ -11,3 +11,9 @@ if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
else
ci/run_${CI_TARGET}.sh
fi
if [[ -s "${GCOV_ERROR_FILE}" ]]; then
echo '=== Unexpected gcov errors: ==='
cat "${GCOV_ERROR_FILE}"
exit 1
fi

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

@ -1,47 +0,0 @@
# - Try to find jemalloc
# Once done this will define
# JEMALLOC_FOUND - System has jemalloc
# JEMALLOC_INCLUDE_DIRS - The jemalloc include directories
# JEMALLOC_LIBRARIES - The libraries needed to use jemalloc
if(NOT USE_BUNDLED_JEMALLOC)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_JEMALLOC QUIET jemalloc)
endif()
else()
set(PC_JEMALLOC_INCLUDEDIR)
set(PC_JEMALLOC_INCLUDE_DIRS)
set(PC_JEMALLOC_LIBDIR)
set(PC_JEMALLOC_LIBRARY_DIRS)
set(LIMIT_SEARCH NO_DEFAULT_PATH)
endif()
set(JEMALLOC_DEFINITIONS ${PC_JEMALLOC_CFLAGS_OTHER})
find_path(JEMALLOC_INCLUDE_DIR jemalloc/jemalloc.h
PATHS ${PC_JEMALLOC_INCLUDEDIR} ${PC_JEMALLOC_INCLUDE_DIRS}
${LIMIT_SEARCH})
# If we're asked to use static linkage, add libjemalloc.a as a preferred library name.
if(JEMALLOC_USE_STATIC)
list(APPEND JEMALLOC_NAMES
"${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()
list(APPEND JEMALLOC_NAMES jemalloc)
find_library(JEMALLOC_LIBRARY NAMES ${JEMALLOC_NAMES}
HINTS ${PC_JEMALLOC_LIBDIR} ${PC_JEMALLOC_LIBRARY_DIRS}
${LIMIT_SEARCH})
set(JEMALLOC_LIBRARIES ${JEMALLOC_LIBRARY})
set(JEMALLOC_INCLUDE_DIRS ${JEMALLOC_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set JEMALLOC_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(JeMalloc DEFAULT_MSG
JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR)
mark_as_advanced(JEMALLOC_INCLUDE_DIR JEMALLOC_LIBRARY)

10
cmake/FindLIBVTERM.cmake Normal file
View File

@ -0,0 +1,10 @@
# - Try to find libvterm
# Once done this will define
# LIBVTERM_FOUND - System has libvterm
# LIBVTERM_INCLUDE_DIRS - The libvterm include directories
# LIBVTERM_LIBRARIES - The libraries needed to use libvterm
include(LibFindMacros)
libfind_pkg_detect(LIBVTERM vterm FIND_PATH vterm.h FIND_LIBRARY vterm)
libfind_process(LIBVTERM REQUIRED)

View File

@ -27,31 +27,43 @@ 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}")
list(APPEND 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}")
list(APPEND CMAKE_REQUIRED_LIBRARIES "${LibIntl_LIBRARY}")
endif()
check_c_source_compiles("
#include <libintl.h>
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 (LibIntl_INCLUDE_DIR)
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${LibIntl_INCLUDE_DIR}")
endif()
if (LibIntl_LIBRARY)
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${LibIntl_LIBRARY}")
endif()
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()
set(LibIntl_FIND_QUIETLY ON)
check_variable_exists(_nl_msg_cat_cntr HAVE_NL_MSG_CAT_CNTR)
endif()

32
cmake/FindLibLUV.cmake Normal file
View File

@ -0,0 +1,32 @@
# - Try to find luv
# Once done this will define
# LIBLUV_FOUND - System has libluv
# LIBLUV_INCLUDE_DIRS - The libluv include directories
# LIBLUV_LIBRARIES - The libraries needed to use libluv
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_LIBLUV QUIET luv)
endif()
set(LIBLUV_DEFINITIONS ${PC_LIBLUV_CFLAGS_OTHER})
find_path(LIBLUV_INCLUDE_DIR luv/luv.h
PATHS ${PC_LIBLUV_INCLUDEDIR} ${PC_LIBLUV_INCLUDE_DIRS})
# Explicitly look for luv.so. #10407
list(APPEND LIBLUV_NAMES luv luv${CMAKE_SHARED_LIBRARY_SUFFIX})
find_library(LIBLUV_LIBRARY NAMES ${LIBLUV_NAMES}
HINTS ${PC_LIBLUV_LIBDIR} ${PC_LIBLUV_LIBRARY_DIRS})
set(LIBLUV_LIBRARIES ${LIBLUV_LIBRARY})
set(LIBLUV_INCLUDE_DIRS ${LIBLUV_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBLUV_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(LibLUV DEFAULT_MSG
LIBLUV_LIBRARY LIBLUV_INCLUDE_DIR)
mark_as_advanced(LIBLUV_INCLUDE_DIR LIBLUV_LIBRARY)

View File

@ -4,36 +4,20 @@
# LIBTERMKEY_INCLUDE_DIRS - The libtermkey include directories
# LIBTERMKEY_LIBRARIES - The libraries needed to use libtermkey
if(NOT USE_BUNDLED_LIBTERMKEY)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_LIBTERMKEY QUIET termkey)
endif()
else()
set(PC_LIBTERMKEY_INCLUDEDIR)
set(PC_LIBTERMKEY_INCLUDE_DIRS)
set(PC_LIBTERMKEY_LIBDIR)
set(PC_LIBTERMKEY_LIBRARY_DIRS)
set(LIMIT_SEARCH NO_DEFAULT_PATH)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_LIBTERMKEY QUIET termkey)
endif()
set(LIBTERMKEY_DEFINITIONS ${PC_LIBTERMKEY_CFLAGS_OTHER})
find_path(LIBTERMKEY_INCLUDE_DIR termkey.h
PATHS ${PC_LIBTERMKEY_INCLUDEDIR} ${PC_LIBTERMKEY_INCLUDE_DIRS}
${LIMIT_SEARCH})
# If we're asked to use static linkage, add libuv.a as a preferred library name.
if(LIBTERMKEY_USE_STATIC)
list(APPEND LIBTERMKEY_NAMES
"${CMAKE_STATIC_LIBRARY_PREFIX}termkey${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()
PATHS ${PC_LIBTERMKEY_INCLUDEDIR} ${PC_LIBTERMKEY_INCLUDE_DIRS})
list(APPEND LIBTERMKEY_NAMES termkey)
find_library(LIBTERMKEY_LIBRARY NAMES ${LIBTERMKEY_NAMES}
HINTS ${PC_LIBTERMKEY_LIBDIR} ${PC_LIBTERMKEY_LIBRARY_DIRS}
${LIMIT_SEARCH})
HINTS ${PC_LIBTERMKEY_LIBDIR} ${PC_LIBTERMKEY_LIBRARY_DIRS})
set(LIBTERMKEY_LIBRARIES ${LIBTERMKEY_LIBRARY})
set(LIBTERMKEY_INCLUDE_DIRS ${LIBTERMKEY_INCLUDE_DIR})

View File

@ -4,42 +4,19 @@
# LIBUV_FOUND - system has libuv
# LIBUV_INCLUDE_DIRS - the libuv include directories
# LIBUV_LIBRARIES - link these to use libuv
#
# Set the LIBUV_USE_STATIC variable to specify if static libraries should
# be preferred to shared ones.
if(NOT USE_BUNDLED_LIBUV)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_LIBUV QUIET libuv)
endif()
else()
set(PC_LIBUV_INCLUDEDIR)
set(PC_LIBUV_INCLUDE_DIRS)
set(PC_LIBUV_LIBDIR)
set(PC_LIBUV_LIBRARY_DIRS)
set(LIMIT_SEARCH NO_DEFAULT_PATH)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_LIBUV QUIET libuv)
endif()
find_path(LIBUV_INCLUDE_DIR uv.h
HINTS ${PC_LIBUV_INCLUDEDIR} ${PC_LIBUV_INCLUDE_DIRS}
${LIMIT_SEARCH})
HINTS ${PC_LIBUV_INCLUDEDIR} ${PC_LIBUV_INCLUDE_DIRS})
# If we're asked to use static linkage, add libuv.a as a preferred library name.
if(LIBUV_USE_STATIC)
list(APPEND LIBUV_NAMES
"${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}
${LIMIT_SEARCH})
HINTS ${PC_LIBUV_LIBDIR} ${PC_LIBUV_LIBRARY_DIRS})
mark_as_advanced(LIBUV_INCLUDE_DIR LIBUV_LIBRARY)
@ -65,7 +42,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

@ -1,47 +0,0 @@
# - Try to find libvterm
# Once done this will define
# LIBVTERM_FOUND - System has libvterm
# LIBVTERM_INCLUDE_DIRS - The libvterm include directories
# LIBVTERM_LIBRARIES - The libraries needed to use libvterm
if(NOT USE_BUNDLED_LIBVTERM)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_LIBVTERM QUIET vterm)
endif()
else()
set(PC_LIBVTERM_INCLUDEDIR)
set(PC_LIBVTERM_INCLUDE_DIRS)
set(PC_LIBVTERM_LIBDIR)
set(PC_LIBVTERM_LIBRARY_DIRS)
set(LIMIT_SEARCH NO_DEFAULT_PATH)
endif()
set(LIBVTERM_DEFINITIONS ${PC_LIBVTERM_CFLAGS_OTHER})
find_path(LIBVTERM_INCLUDE_DIR vterm.h
PATHS ${PC_LIBVTERM_INCLUDEDIR} ${PC_LIBVTERM_INCLUDE_DIRS}
${LIMIT_SEARCH})
# If we're asked to use static linkage, add libuv.a as a preferred library name.
if(LIBVTERM_USE_STATIC)
list(APPEND LIBVTERM_NAMES
"${CMAKE_STATIC_LIBRARY_PREFIX}vterm${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()
list(APPEND LIBVTERM_NAMES vterm)
find_library(LIBVTERM_LIBRARY NAMES ${LIBVTERM_NAMES}
HINTS ${PC_LIBVTERM_LIBDIR} ${PC_LIBVTERM_LIBRARY_DIRS}
${LIMIT_SEARCH})
set(LIBVTERM_LIBRARIES ${LIBVTERM_LIBRARY})
set(LIBVTERM_INCLUDE_DIRS ${LIBVTERM_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBVTERM_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(LibVterm DEFAULT_MSG
LIBVTERM_LIBRARY LIBVTERM_INCLUDE_DIR)
mark_as_advanced(LIBVTERM_INCLUDE_DIR LIBVTERM_LIBRARY)

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,32 +4,16 @@
# LUAJIT_INCLUDE_DIRS - The luajit include directories
# LUAJIT_LIBRARIES - The libraries needed to use luajit
if(NOT USE_BUNDLED_LUAJIT)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_LUAJIT QUIET luajit)
endif()
else()
set(PC_LUAJIT_INCLUDEDIR)
set(PC_LUAJIT_INCLUDE_DIRS)
set(PC_LUAJIT_LIBDIR)
set(PC_LUAJIT_LIBRARY_DIRS)
set(LIMIT_SEARCH NO_DEFAULT_PATH)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_LUAJIT QUIET luajit)
endif()
set(LUAJIT_DEFINITIONS ${PC_LUAJIT_CFLAGS_OTHER})
find_path(LUAJIT_INCLUDE_DIR luajit.h
PATHS ${PC_LUAJIT_INCLUDEDIR} ${PC_LUAJIT_INCLUDE_DIRS}
PATH_SUFFIXES luajit-2.0
${LIMIT_SEARCH})
# If we're asked to use static linkage, add libluajit-5.1.a as a preferred
# library name.
if(LUAJIT_USE_STATIC)
list(APPEND LUAJIT_NAMES
"${CMAKE_STATIC_LIBRARY_PREFIX}luajit-5.1${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()
PATH_SUFFIXES luajit-2.0 luajit-2.1)
if(MSVC)
list(APPEND LUAJIT_NAMES lua51)
@ -40,8 +24,7 @@ else()
endif()
find_library(LUAJIT_LIBRARY NAMES ${LUAJIT_NAMES}
PATHS ${PC_LUAJIT_LIBDIR} ${PC_LUAJIT_LIBRARY_DIRS}
${LIMIT_SEARCH})
PATHS ${PC_LUAJIT_LIBDIR} ${PC_LUAJIT_LIBRARY_DIRS})
set(LUAJIT_LIBRARIES ${LUAJIT_LIBRARY})
set(LUAJIT_INCLUDE_DIRS ${LUAJIT_INCLUDE_DIR})

View File

@ -4,26 +4,17 @@
# MSGPACK_INCLUDE_DIRS - The msgpack include directories
# MSGPACK_LIBRARIES - The libraries needed to use msgpack
if(NOT USE_BUNDLED_MSGPACK)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_search_module(PC_MSGPACK QUIET
msgpackc>=${Msgpack_FIND_VERSION}
msgpack>=${Msgpack_FIND_VERSION})
endif()
else()
set(PC_MSGPACK_INCLUDEDIR)
set(PC_MSGPACK_INCLUDE_DIRS)
set(PC_MSGPACK_LIBDIR)
set(PC_MSGPACK_LIBRARY_DIRS)
set(LIMIT_SEARCH NO_DEFAULT_PATH)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_search_module(PC_MSGPACK QUIET
msgpackc>=${Msgpack_FIND_VERSION}
msgpack>=${Msgpack_FIND_VERSION})
endif()
set(MSGPACK_DEFINITIONS ${PC_MSGPACK_CFLAGS_OTHER})
find_path(MSGPACK_INCLUDE_DIR msgpack/version_master.h
HINTS ${PC_MSGPACK_INCLUDEDIR} ${PC_MSGPACK_INCLUDE_DIRS}
${LIMIT_SEARCH})
HINTS ${PC_MSGPACK_INCLUDEDIR} ${PC_MSGPACK_INCLUDE_DIRS})
if(MSGPACK_INCLUDE_DIR)
file(READ ${MSGPACK_INCLUDE_DIR}/msgpack/version_master.h msgpack_version_h)
@ -35,16 +26,9 @@ 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()
if(MSVC)
# The import library for the msgpack DLL has a different name
list(APPEND MSGPACK_NAMES msgpack_import)
list(APPEND MSGPACK_NAMES msgpackc_import)
else()
list(APPEND MSGPACK_NAMES msgpackc msgpack)
endif()
@ -53,8 +37,7 @@ 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})
HINTS ${PC_MSGPACK_LIBDIR} ${PC_MSGPACK_LIBRARY_DIRS})
mark_as_advanced(MSGPACK_INCLUDE_DIR MSGPACK_LIBRARY)

12
cmake/FindUNIBILIUM.cmake Normal file
View File

@ -0,0 +1,12 @@
# - Try to find unibilium
# Once done this will define
# UNIBILIUM_FOUND - System has unibilium
# UNIBILIUM_INCLUDE_DIRS - The unibilium include directories
# UNIBILIUM_LIBRARIES - The libraries needed to use unibilium
include(LibFindMacros)
libfind_pkg_detect(UNIBILIUM unibilium
FIND_PATH unibilium.h
FIND_LIBRARY unibilium)
libfind_process(UNIBILIUM)

View File

@ -1,47 +0,0 @@
# - Try to find unibilium
# Once done this will define
# UNIBILIUM_FOUND - System has unibilium
# UNIBILIUM_INCLUDE_DIRS - The unibilium include directories
# UNIBILIUM_LIBRARIES - The libraries needed to use unibilium
if(NOT USE_BUNDLED_UNIBILIUM)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_UNIBILIUM QUIET unibilium)
endif()
else()
set(PC_UNIBILIUM_INCLUDEDIR)
set(PC_UNIBILIUM_INCLUDE_DIRS)
set(PC_UNIBILIUM_LIBDIR)
set(PC_UNIBILIUM_LIBRARY_DIRS)
set(LIMIT_SEARCH NO_DEFAULT_PATH)
endif()
set(UNIBILIUM_DEFINITIONS ${PC_UNIBILIUM_CFLAGS_OTHER})
find_path(UNIBILIUM_INCLUDE_DIR unibilium.h
PATHS ${PC_UNIBILIUM_INCLUDEDIR} ${PC_UNIBILIUM_INCLUDE_DIRS}
${LIMIT_SEARCH})
# If we're asked to use static linkage, add libunibilium.a as a preferred library name.
if(UNIBILIUM_USE_STATIC)
list(APPEND UNIBILIUM_NAMES
"${CMAKE_STATIC_LIBRARY_PREFIX}unibilium${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()
list(APPEND UNIBILIUM_NAMES unibilium)
find_library(UNIBILIUM_LIBRARY NAMES ${UNIBILIUM_NAMES}
HINTS ${PC_UNIBILIUM_LIBDIR} ${PC_UNIBILIUM_LIBRARY_DIRS}
${LIMIT_SEARCH})
set(UNIBILIUM_LIBRARIES ${UNIBILIUM_LIBRARY})
set(UNIBILIUM_INCLUDE_DIRS ${UNIBILIUM_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set UNIBILIUM_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(unibilium DEFAULT_MSG
UNIBILIUM_LIBRARY UNIBILIUM_INCLUDE_DIR)
mark_as_advanced(UNIBILIUM_INCLUDE_DIR UNIBILIUM_LIBRARY)

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

@ -1,39 +0,0 @@
if(DEFINED ENV{DESTDIR})
file(TO_CMAKE_PATH
$ENV{DESTDIR}/@CMAKE_INSTALL_FULL_DATADIR@/nvim/runtime/doc
HELPTAGS_WORKING_DIRECTORY)
else()
file(TO_CMAKE_PATH
@CMAKE_INSTALL_FULL_DATADIR@/nvim/runtime/doc
HELPTAGS_WORKING_DIRECTORY)
endif()
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
# tags. Tell the user to remove the directory and try again.
set(TROUBLESHOOTING "\nRemove \"${HELPTAGS_WORKING_DIRECTORY}\" and try again.")
endif()
# Workaround for hanging "yes | nvim -c 'helptags ++t .'"
# and therefore hanging "yes | make install":
# Set INPUT_FILE to an empty file, causing execute_process
# to disregard other standard input (such as "yes |").
set(EMPTY_FILE ${CMAKE_CURRENT_BINARY_DIR}/.GenerateHelptags)
file(WRITE ${EMPTY_FILE} "")
execute_process(
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/nvim
-u NONE
-es
-c "helptags ++t ."
-c quit
WORKING_DIRECTORY ${HELPTAGS_WORKING_DIRECTORY}
INPUT_FILE ${EMPTY_FILE}
OUTPUT_VARIABLE err
ERROR_VARIABLE err
RESULT_VARIABLE res)
if(NOT res EQUAL 0)
message(FATAL_ERROR "Generating helptags failed: ${err} - ${res}${TROUBLESHOOTING}")
endif()

View File

@ -1,6 +1,6 @@
function(get_compile_flags _compile_flags)
# Create template akin to CMAKE_C_COMPILE_OBJECT.
set(compile_flags "<CMAKE_C_COMPILER> <CFLAGS> <BUILD_TYPE_CFLAGS> <DEFINITIONS> <INCLUDES>")
set(compile_flags "<CMAKE_C_COMPILER> <CFLAGS> <BUILD_TYPE_CFLAGS> <COMPILE_OPTIONS><COMPILE_DEFINITIONS> <INCLUDES>")
# Get C compiler.
string(REPLACE
@ -9,13 +9,36 @@ function(get_compile_flags _compile_flags)
compile_flags
"${compile_flags}")
# Get flags set by add_definition().
get_directory_property(definitions
DIRECTORY "src/nvim"
DEFINITIONS)
# Get flags set by add_definitions().
get_property(compile_definitions DIRECTORY PROPERTY COMPILE_DEFINITIONS)
get_target_property(compile_definitions_target nvim COMPILE_DEFINITIONS)
if(compile_definitions_target)
list(APPEND compile_definitions ${compile_definitions_target})
list(REMOVE_DUPLICATES compile_definitions)
endif()
# NOTE: list(JOIN) requires CMake 3.12, string(CONCAT) requires CMake 3.
string(REPLACE ";" " -D" compile_definitions "${compile_definitions}")
if(compile_definitions)
set(compile_definitions " -D${compile_definitions}")
endif()
string(REPLACE
"<DEFINITIONS>"
"${definitions}"
"<COMPILE_DEFINITIONS>"
"${compile_definitions}"
compile_flags
"${compile_flags}")
# Get flags set by add_compile_options().
get_property(compile_options DIRECTORY PROPERTY COMPILE_OPTIONS)
get_target_property(compile_options_target nvim COMPILE_OPTIONS)
if(compile_options_target)
list(APPEND compile_options ${compile_options_target})
list(REMOVE_DUPLICATES compile_options)
endif()
# NOTE: list(JOIN) requires CMake 3.12.
string(REPLACE ";" " " compile_options "${compile_options}")
string(REPLACE
"<COMPILE_OPTIONS>"
"${compile_options}"
compile_flags
"${compile_flags}")
@ -35,9 +58,8 @@ function(get_compile_flags _compile_flags)
"${compile_flags}")
# Get include directories.
get_directory_property(include_directories_list
DIRECTORY "src/nvim"
INCLUDE_DIRECTORIES)
get_property(include_directories_list DIRECTORY PROPERTY 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

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

@ -1,46 +1,101 @@
# Version 1.0 (2013-04-12)
# Public Domain, originally written by Lasse Kärkkäinen <tronic@zi.fi>
# Published at http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries
# Version 2.2
# Public Domain, originally written by Lasse Kärkkäinen <tronic>
# Maintained at https://github.com/Tronic/cmake-modules
# Please send your improvements as pull requests on Github.
# If you improve the script, please modify the forementioned wiki page because
# I no longer maintain my scripts (hosted as static files at zi.fi). Feel free
# to remove this entire header if you use real version control instead.
# Changelog:
# 2013-04-12 Added version number (1.0) and this header, no other changes
# 2009-10-08 Originally published
# Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments
# used for the current package. For this to work, the first parameter must be the
# prefix of the current package, then the prefix of the new package etc, which are
# passed to find_package.
macro (libfind_package PREFIX)
set (LIBFIND_PACKAGE_ARGS ${ARGN})
if (${PREFIX}_FIND_QUIETLY)
set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} QUIET)
endif (${PREFIX}_FIND_QUIETLY)
# Find another package and make it a dependency of the current package.
# This also automatically forwards the "REQUIRED" argument.
# Usage: libfind_package(<prefix> <another package> [extra args to find_package])
macro (libfind_package PREFIX PKG)
set(${PREFIX}_args ${PKG} ${ARGN})
if (${PREFIX}_FIND_REQUIRED)
set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} REQUIRED)
endif (${PREFIX}_FIND_REQUIRED)
find_package(${LIBFIND_PACKAGE_ARGS})
endmacro (libfind_package)
set(${PREFIX}_args ${${PREFIX}_args} REQUIRED)
endif()
find_package(${${PREFIX}_args})
set(${PREFIX}_DEPENDENCIES ${${PREFIX}_DEPENDENCIES};${PKG})
unset(${PREFIX}_args)
endmacro()
# CMake developers made the UsePkgConfig system deprecated in the same release (2.6)
# where they added pkg_check_modules. Consequently I need to support both in my scripts
# to avoid those deprecated warnings. Here's a helper that does just that.
# Works identically to pkg_check_modules, except that no checks are needed prior to use.
macro (libfind_pkg_check_modules PREFIX PKGNAME)
if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
include(UsePkgConfig)
pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS)
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(${PREFIX} ${PKGNAME})
endif (PKG_CONFIG_FOUND)
endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
endmacro (libfind_pkg_check_modules)
# A simple wrapper to make pkg-config searches a bit easier.
# Works the same as CMake's internal pkg_check_modules but is always quiet.
macro (libfind_pkg_check_modules)
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(${ARGN} QUIET)
endif()
endmacro()
# Avoid useless copy&pasta by doing what most simple libraries do anyway:
# pkg-config, find headers, find library.
# Usage: libfind_pkg_detect(<prefix> <pkg-config args> FIND_PATH <name> [other args] FIND_LIBRARY <name> [other args])
# E.g. libfind_pkg_detect(SDL2 sdl2 FIND_PATH SDL.h PATH_SUFFIXES SDL2 FIND_LIBRARY SDL2)
function (libfind_pkg_detect PREFIX)
# Parse arguments
set(argname pkgargs)
foreach (i ${ARGN})
if ("${i}" STREQUAL "FIND_PATH")
set(argname pathargs)
elseif ("${i}" STREQUAL "FIND_LIBRARY")
set(argname libraryargs)
else()
set(${argname} ${${argname}} ${i})
endif()
endforeach()
if (NOT pkgargs)
message(FATAL_ERROR "libfind_pkg_detect requires at least a pkg_config package name to be passed.")
endif()
# Find library
libfind_pkg_check_modules(${PREFIX}_PKGCONF ${pkgargs})
if (pathargs)
find_path(${PREFIX}_INCLUDE_DIR NAMES ${pathargs} HINTS ${${PREFIX}_PKGCONF_INCLUDE_DIRS})
endif()
if (libraryargs)
find_library(${PREFIX}_LIBRARY NAMES ${libraryargs} HINTS ${${PREFIX}_PKGCONF_LIBRARY_DIRS})
endif()
# Read pkg-config version
if (${PREFIX}_PKGCONF_VERSION)
set(${PREFIX}_VERSION ${${PREFIX}_PKGCONF_VERSION} PARENT_SCOPE)
endif()
endfunction()
# Extracts a version #define from a version.h file, output stored to <PREFIX>_VERSION.
# Usage: libfind_version_header(Foobar foobar/version.h FOOBAR_VERSION_STR)
# Fourth argument "QUIET" may be used for silently testing different define names.
# This function does nothing if the version variable is already defined.
function (libfind_version_header PREFIX VERSION_H DEFINE_NAME)
# Skip processing if we already have a version or if the include dir was not found
if (${PREFIX}_VERSION OR NOT ${PREFIX}_INCLUDE_DIR)
return()
endif()
set(quiet ${${PREFIX}_FIND_QUIETLY})
# Process optional arguments
foreach(arg ${ARGN})
if (arg STREQUAL "QUIET")
set(quiet TRUE)
else()
message(AUTHOR_WARNING "Unknown argument ${arg} to libfind_version_header ignored.")
endif()
endforeach()
# Read the header and parse for version number
set(filename "${${PREFIX}_INCLUDE_DIR}/${VERSION_H}")
if (NOT EXISTS ${filename})
if (NOT quiet)
message(AUTHOR_WARNING "Unable to find ${${PREFIX}_INCLUDE_DIR}/${VERSION_H}")
endif()
return()
endif()
file(READ "${filename}" header)
string(REGEX REPLACE ".*#[ \t]*define[ \t]*${DEFINE_NAME}[ \t]*\"([^\n]*)\".*" "\\1" match "${header}")
# No regex match?
if (match STREQUAL header)
if (NOT quiet)
message(AUTHOR_WARNING "Unable to find \#define ${DEFINE_NAME} \"<version>\" from ${${PREFIX}_INCLUDE_DIR}/${VERSION_H}")
endif()
return()
endif()
# Export the version string
set(${PREFIX}_VERSION "${match}" PARENT_SCOPE)
endfunction()
# Do the final processing once the paths have been detected.
# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain
@ -48,65 +103,167 @@ endmacro (libfind_pkg_check_modules)
# Ditto for ${PREFIX}_PROCESS_LIBS and library files.
# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES.
# Also handles errors in case library detection was required, etc.
macro (libfind_process PREFIX)
# Skip processing if already processed during this run
if (NOT ${PREFIX}_FOUND)
# Start with the assumption that the library was found
set (${PREFIX}_FOUND TRUE)
function (libfind_process PREFIX)
# Skip processing if already processed during this configuration run
if (${PREFIX}_FOUND)
return()
endif()
# Process all includes and set _FOUND to false if any are missing
foreach (i ${${PREFIX}_PROCESS_INCLUDES})
if (${i})
set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}})
mark_as_advanced(${i})
else (${i})
set (${PREFIX}_FOUND FALSE)
endif (${i})
endforeach (i)
set(found TRUE) # Start with the assumption that the package was found
# Process all libraries and set _FOUND to false if any are missing
foreach (i ${${PREFIX}_PROCESS_LIBS})
if (${i})
set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}})
mark_as_advanced(${i})
else (${i})
set (${PREFIX}_FOUND FALSE)
endif (${i})
endforeach (i)
# Did we find any files? Did we miss includes? These are for formatting better error messages.
set(some_files FALSE)
set(missing_headers FALSE)
# Print message and/or exit on fatal error
if (${PREFIX}_FOUND)
if (NOT ${PREFIX}_FIND_QUIETLY)
message (STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
endif (NOT ${PREFIX}_FIND_QUIETLY)
else (${PREFIX}_FOUND)
if (${PREFIX}_FIND_REQUIRED)
foreach (i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS})
message("${i}=${${i}}")
endforeach (i)
message (FATAL_ERROR "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually.")
endif (${PREFIX}_FIND_REQUIRED)
endif (${PREFIX}_FOUND)
endif (NOT ${PREFIX}_FOUND)
endmacro (libfind_process)
# Shorthands for some variables that we need often
set(quiet ${${PREFIX}_FIND_QUIETLY})
set(required ${${PREFIX}_FIND_REQUIRED})
set(exactver ${${PREFIX}_FIND_VERSION_EXACT})
set(findver "${${PREFIX}_FIND_VERSION}")
set(version "${${PREFIX}_VERSION}")
macro(libfind_library PREFIX basename)
set(TMP "")
if(MSVC80)
set(TMP -vc80)
endif(MSVC80)
if(MSVC90)
set(TMP -vc90)
endif(MSVC90)
set(${PREFIX}_LIBNAMES ${basename}${TMP})
if(${ARGC} GREATER 2)
set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2})
string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES})
set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP})
endif(${ARGC} GREATER 2)
find_library(${PREFIX}_LIBRARY
NAMES ${${PREFIX}_LIBNAMES}
PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS}
)
endmacro(libfind_library)
# Lists of config option names (all, includes, libs)
unset(configopts)
set(includeopts ${${PREFIX}_PROCESS_INCLUDES})
set(libraryopts ${${PREFIX}_PROCESS_LIBS})
# Process deps to add to
foreach (i ${PREFIX} ${${PREFIX}_DEPENDENCIES})
if (DEFINED ${i}_INCLUDE_OPTS OR DEFINED ${i}_LIBRARY_OPTS)
# The package seems to export option lists that we can use, woohoo!
list(APPEND includeopts ${${i}_INCLUDE_OPTS})
list(APPEND libraryopts ${${i}_LIBRARY_OPTS})
else()
# If plural forms don't exist or they equal singular forms
if ((NOT DEFINED ${i}_INCLUDE_DIRS AND NOT DEFINED ${i}_LIBRARIES) OR
(${i}_INCLUDE_DIR STREQUAL ${i}_INCLUDE_DIRS AND ${i}_LIBRARY STREQUAL ${i}_LIBRARIES))
# Singular forms can be used
if (DEFINED ${i}_INCLUDE_DIR)
list(APPEND includeopts ${i}_INCLUDE_DIR)
endif()
if (DEFINED ${i}_LIBRARY)
list(APPEND libraryopts ${i}_LIBRARY)
endif()
else()
# Oh no, we don't know the option names
message(FATAL_ERROR "We couldn't determine config variable names for ${i} includes and libs. Aieeh!")
endif()
endif()
endforeach()
if (includeopts)
list(REMOVE_DUPLICATES includeopts)
endif()
if (libraryopts)
list(REMOVE_DUPLICATES libraryopts)
endif()
string(REGEX REPLACE ".*[ ;]([^ ;]*(_INCLUDE_DIRS|_LIBRARIES))" "\\1" tmp "${includeopts} ${libraryopts}")
if (NOT tmp STREQUAL "${includeopts} ${libraryopts}")
message(AUTHOR_WARNING "Plural form ${tmp} found in config options of ${PREFIX}. This works as before but is now deprecated. Please only use singular forms INCLUDE_DIR and LIBRARY, and update your find scripts for LibFindMacros > 2.0 automatic dependency system (most often you can simply remove the PROCESS variables entirely).")
endif()
# Include/library names separated by spaces (notice: not CMake lists)
unset(includes)
unset(libs)
# Process all includes and set found false if any are missing
foreach (i ${includeopts})
list(APPEND configopts ${i})
if (NOT "${${i}}" STREQUAL "${i}-NOTFOUND")
list(APPEND includes "${${i}}")
else()
set(found FALSE)
set(missing_headers TRUE)
endif()
endforeach()
# Process all libraries and set found false if any are missing
foreach (i ${libraryopts})
list(APPEND configopts ${i})
if (NOT "${${i}}" STREQUAL "${i}-NOTFOUND")
list(APPEND libs "${${i}}")
else()
set (found FALSE)
endif()
endforeach()
# Version checks
if (found AND findver)
if (NOT version)
message(WARNING "The find module for ${PREFIX} does not provide version information, so we'll just assume that it is OK. Please fix the module or remove package version requirements to get rid of this warning.")
elseif (version VERSION_LESS findver OR (exactver AND NOT version VERSION_EQUAL findver))
set(found FALSE)
set(version_unsuitable TRUE)
endif()
endif()
# If all-OK, hide all config options, export variables, print status and exit
if (found)
foreach (i ${configopts})
mark_as_advanced(${i})
endforeach()
if (NOT quiet)
message(STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
if (LIBFIND_DEBUG)
message(STATUS " ${PREFIX}_DEPENDENCIES=${${PREFIX}_DEPENDENCIES}")
message(STATUS " ${PREFIX}_INCLUDE_OPTS=${includeopts}")
message(STATUS " ${PREFIX}_INCLUDE_DIRS=${includes}")
message(STATUS " ${PREFIX}_LIBRARY_OPTS=${libraryopts}")
message(STATUS " ${PREFIX}_LIBRARIES=${libs}")
endif()
endif()
set (${PREFIX}_INCLUDE_OPTS ${includeopts} PARENT_SCOPE)
set (${PREFIX}_LIBRARY_OPTS ${libraryopts} PARENT_SCOPE)
set (${PREFIX}_INCLUDE_DIRS ${includes} PARENT_SCOPE)
set (${PREFIX}_LIBRARIES ${libs} PARENT_SCOPE)
set (${PREFIX}_FOUND TRUE PARENT_SCOPE)
return()
endif()
# Format messages for debug info and the type of error
set(vars "Relevant CMake configuration variables:\n")
foreach (i ${configopts})
mark_as_advanced(CLEAR ${i})
set(val ${${i}})
if ("${val}" STREQUAL "${i}-NOTFOUND")
set (val "<not found>")
elseif (val AND NOT EXISTS ${val})
set (val "${val} (does not exist)")
else()
set(some_files TRUE)
endif()
set(vars "${vars} ${i}=${val}\n")
endforeach()
set(vars "${vars}You may use CMake GUI, cmake -D or ccmake to modify the values. Delete CMakeCache.txt to discard all values and force full re-detection if necessary.\n")
if (version_unsuitable)
set(msg "${PREFIX} ${${PREFIX}_VERSION} was found but")
if (exactver)
set(msg "${msg} only version ${findver} is acceptable.")
else()
set(msg "${msg} version ${findver} is the minimum requirement.")
endif()
else()
if (missing_headers)
set(msg "We could not find development headers for ${PREFIX}. Do you have the necessary dev package installed?")
elseif (some_files)
set(msg "We only found some files of ${PREFIX}, not all of them. Perhaps your installation is incomplete or maybe we just didn't look in the right place?")
if(findver)
set(msg "${msg} This could also be caused by incompatible version (if it helps, at least ${PREFIX} ${findver} should work).")
endif()
else()
set(msg "We were unable to find package ${PREFIX}.")
endif()
endif()
# Fatal error out if REQUIRED
if (required)
set(msg "REQUIRED PACKAGE NOT FOUND\n${msg} This package is REQUIRED and you need to install it or adjust CMake configuration in order to continue building ${CMAKE_PROJECT_NAME}.")
message(FATAL_ERROR "${msg}\n${vars}")
endif()
# Otherwise just print a nasty warning
if (NOT quiet)
message(WARNING "WARNING: MISSING PACKAGE\n${msg} This package is NOT REQUIRED and you may ignore this warning but by doing so you may miss some functionality of ${CMAKE_PROJECT_NAME}. \n${vars}")
endif()
endfunction()

View File

@ -4,9 +4,8 @@
# 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)
set(${RESULT_VAR} False PARENT_SCOPE)
else()
@ -18,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")

View File

@ -1,7 +1,19 @@
# Set LC_ALL to meet expectations of some locale-sensitive tests.
set(ENV{LC_ALL} "en_US.UTF-8")
if(POLICY CMP0012)
# Handle CI=true, without dev warnings.
cmake_policy(SET CMP0012 NEW)
endif()
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)
set(ENV{NVIM_RPLUGIN_MANIFEST} ${BUILD_DIR}/Xtest_rplugin_manifest)
set(ENV{XDG_CONFIG_HOME} ${BUILD_DIR}/Xtest_xdg/config)
set(ENV{XDG_DATA_HOME} ${BUILD_DIR}/Xtest_xdg/share)
if(NOT DEFINED ENV{NVIM_LOG_FILE})
set(ENV{NVIM_LOG_FILE} ${BUILD_DIR}/.nvimlog)
endif()
if(NVIM_PRG)
set(ENV{NVIM_PRG} "${NVIM_PRG}")
@ -13,35 +25,62 @@ else()
set(TEST_PATH "${TEST_DIR}/${TEST_TYPE}")
endif()
# Force $TEST_PATH to workdir-relative path ("test/…").
if(IS_ABSOLUTE ${TEST_PATH})
file(RELATIVE_PATH TEST_PATH "${WORKING_DIR}" "${TEST_PATH}")
endif()
if(BUSTED_OUTPUT_TYPE STREQUAL junit)
set(EXTRA_ARGS OUTPUT_FILE ${BUILD_DIR}/${TEST_TYPE}test-junit.xml)
endif()
if(DEFINED ENV{TEST_TAG})
set(TEST_TAG "--tags=$ENV{TEST_TAG}")
set(BUSTED_ARGS $ENV{BUSTED_ARGS})
separate_arguments(BUSTED_ARGS)
if(DEFINED ENV{TEST_TAG} AND NOT "$ENV{TEST_TAG}" STREQUAL "")
list(APPEND BUSTED_ARGS --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 "")
list(APPEND BUSTED_ARGS --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})
# TMPDIR: use relative test path (for parallel test runs / isolation).
set(ENV{TMPDIR} "${BUILD_DIR}/Xtest_tmpdir/${TEST_PATH}")
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory $ENV{TMPDIR})
set(ENV{SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_NAME}) # used by test/helpers.lua.
execute_process(
COMMAND ${BUSTED_PRG} ${TEST_TAG} ${TEST_FILTER} -v -o ${BUSTED_OUTPUT_TYPE}
--lua=${LUA_PRG} --lazy --helper=${TEST_DIR}/${TEST_TYPE}/preload.lua
--lpath=${BUILD_DIR}/?.lua ${TEST_PATH}
COMMAND ${BUSTED_PRG} -v -o test.busted.outputHandlers.${BUSTED_OUTPUT_TYPE}
--lazy --helper=${TEST_DIR}/${TEST_TYPE}/preload.lua
--lpath=${BUILD_DIR}/?.lua
--lpath=${WORKING_DIR}/runtime/lua/?.lua
--lpath=?.lua
${BUSTED_ARGS}
${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)
file(GLOB RM_FILES ${BUILD_DIR}/Xtest_*)
file(REMOVE_RECURSE ${RM_FILES})
if(NOT res EQUAL 0)
message(STATUS "Output to stderr:\n${err}")
message(FATAL_ERROR "Running ${TEST_TYPE} tests failed with error: ${res}.")
message(STATUS "Tests exited non-zero: ${res}")
if("${err}" STREQUAL "")
message(STATUS "No output to stderr.")
else()
message(STATUS "Output to stderr:\n${err}")
endif()
# Dump the logfile on CI (if not displayed and moved already).
if($ENV{CI})
if(EXISTS $ENV{NVIM_LOG_FILE} AND NOT EXISTS $ENV{NVIM_LOG_FILE}.displayed)
file(READ $ENV{NVIM_LOG_FILE} out)
message(STATUS "$NVIM_LOG_FILE: $ENV{NVIM_LOG_FILE}\n${out}")
endif()
endif()
message(FATAL_ERROR "${TEST_TYPE} tests failed with error: ${res}")
endif()

View File

@ -1,13 +0,0 @@
set(IGNORE_FILES "${TEST_DIR}/*/preload.lua")
execute_process(
COMMAND ${LUACHECK_PRG} -q ${TEST_DIR} --exclude-files ${IGNORE_FILES}
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

@ -1,53 +0,0 @@
#
# Mingw-w64 cross compiler toolchain
#
# - The usual CMAKE variables will point to the cross compiler
# - HOST_EXE_LINKER, HOST_C_COMPILER, HOST_EXE_LINKER_FLAGS,
# HOST_C_FLAGS point to a host compiler
#
set(MINGW_TRIPLET i686-w64-mingw32)
# For x86_64 use
#set(MINGW_TRIPLET x86_64-w64-mingw32)
# The location of your toolchain sys-root
set(MINGW_PREFIX_PATH /opt/mingw32/${MINGW_TRIPLET}/)
# or sometimes like this
#set(MINGW_PREFIX_PATH /usr/${MINGW_TRIPLET}/sys-root)
# the name of the target operating system
set(CMAKE_SYSTEM_NAME Windows)
# which compilers to use for C and C++
set(CMAKE_C_COMPILER ${MINGW_TRIPLET}-gcc)
set(CMAKE_CXX_COMPILER ${MINGW_TRIPLET}-g++)
set(CMAKE_RC_COMPILER ${MINGW_TRIPLET}-windres)
set(CMAKE_C_COMPILER ${MINGW_TRIPLET}-gcc)
set(CMAKE_CXX_COMPILER ${MINGW_TRIPLET}-g++)
set(CMAKE_RC_COMPILER ${MINGW_TRIPLET}-windres)
# Where is the target environment located
set(CMAKE_FIND_ROOT_PATH "${MINGW_PREFIX_PATH}/mingw")
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CROSS_TARGET ${MINGW_TRIPLET})
# We need a host compiler too - assuming mildly sane Unix
# defaults here
set(HOST_C_COMPILER cc)
set(HOST_EXE_LINKER ld)
if (MINGW_TRIPLET MATCHES "^x86_64")
set(HOST_C_FLAGS)
set(HOST_EXE_LINKER_FLAGS)
else()
# In 32 bits systems have the HOST compiler generate 32 bits binaries
set(HOST_C_FLAGS -m32)
set(HOST_EXE_LINKER_FLAGS -m32)
endif()

27
codecov.yml Normal file
View File

@ -0,0 +1,27 @@
# To validate:
# cat codecov.yml | curl --data-binary @- https://codecov.io/validate
codecov:
notify:
require_ci_to_pass: no
ci:
- appveyor
- travis
- !neovim-qb.szakmeister.net
coverage:
precision: 2
round: down
range: "70...100"
status:
project:
default:
threshold: 1
patch:
default:
threshold: 1
only_pulls: true
changes: no
comment: off

View File

@ -12,10 +12,14 @@ 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(iconv.h HAVE_ICONV_H)
check_include_files(langinfo.h HAVE_LANGINFO_H)
check_include_files(locale.h HAVE_LOCALE_H)
check_include_files(pwd.h HAVE_PWD_H)
@ -27,7 +31,6 @@ if(NOT HAVE_SYS_WAIT_H AND 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(sys/uio.h HAVE_SYS_UIO_H)
# Functions
@ -35,35 +38,19 @@ check_function_exists(fseeko HAVE_FSEEKO)
check_function_exists(getpwent HAVE_GETPWENT)
check_function_exists(getpwnam HAVE_GETPWNAM)
check_function_exists(getpwuid HAVE_GETPWUID)
check_function_exists(uv_translate_sys_error HAVE_UV_TRANSLATE_SYS_ERROR)
check_function_exists(readv HAVE_READV)
if(Iconv_FOUND)
set(HAVE_ICONV 1)
endif()
if(JEMALLOC_FOUND)
set(HAVE_JEMALLOC 1)
endif()
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)
if(UNIX AND NOT HAVE_SETENV)
message(SEND_ERROR "setenv() function not found on your system.")
endif()
check_function_exists(unsetenv HAVE_UNSETENV)
check_function_exists(setpgid HAVE_SETPGID)
check_function_exists(setsid HAVE_SETSID)
check_function_exists(sigaction HAVE_SIGACTION)
check_function_exists(strcasecmp HAVE_STRCASECMP)
check_function_exists(strncasecmp HAVE_STRNCASECMP)
check_function_exists(utime HAVE_UTIME)
check_function_exists(utimes HAVE_UTIMES)
# Symbols
check_symbol_exists(FD_CLOEXEC "fcntl.h" HAVE_FD_CLOEXEC)

View File

@ -13,7 +13,6 @@
#endif
#define PROJECT_NAME "@PROJECT_NAME@"
#define LOCALE_INSTALL_DIR "@CMAKE_INSTALL_FULL_LOCALEDIR@"
#cmakedefine HAVE__NSGETENVIRON
#cmakedefine HAVE_FD_CLOEXEC
@ -22,19 +21,12 @@
#cmakedefine HAVE_GETPWNAM
#cmakedefine HAVE_GETPWUID
#cmakedefine HAVE_ICONV
#cmakedefine HAVE_ICONV_H
#cmakedefine HAVE_LANGINFO_H
#cmakedefine HAVE_LOCALE_H
#cmakedefine HAVE_NL_LANGINFO_CODESET
#cmakedefine HAVE_NL_MSG_CAT_CNTR
#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
#cmakedefine HAVE_UNSETENV
#cmakedefine HAVE_SETPGID
#cmakedefine HAVE_SETSID
#cmakedefine HAVE_SIGACTION
@ -44,10 +36,8 @@
#cmakedefine HAVE_SYS_UTSNAME_H
#cmakedefine HAVE_SYS_WAIT_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
@ -61,11 +51,14 @@
#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
#cmakedefine HAVE_BUILTIN_ADD_OVERFLOW
#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

@ -26,13 +26,13 @@ def get_color_code(bg, color_num):
prefix += 1
color_num %= 8
else:
prefix = '48;5;' if bg else '38;5;'
prefix = '48;5;' if bg else '38;5;'
return '\x1b[{0}{1}m'.format(prefix, color_num)
def highlight(attrs):
fg, bg = [int(attrs['foreground']), int(attrs['background'])]
rv = [SGR0] # start with sgr0
rv = [SGR0] # start with sgr0
if fg != -1:
rv.append(get_color_code(False, fg))
if bg != -1:

View File

@ -7,33 +7,26 @@
# These CFLAGS can be used in addition to those specified in CMakeLists.txt:
# CMAKE_EXTRA_FLAGS="-DCMAKE_C_FLAGS=-ftrapv -Wlogical-op"
# By default, the jemalloc family of memory allocation functions are used.
# Uncomment the following to instead use libc memory allocation functions.
# CMAKE_EXTRA_FLAGS += -DENABLE_JEMALLOC=OFF
# To turn compiler warnings into errors:
# CMAKE_EXTRA_FLAGS += "-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -Werror"
# 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
# By default, nvim's log level is INFO (1) (unless CMAKE_BUILD_TYPE is
# "Release", in which case logging is disabled).
# The log level must be a number DEBUG (0), INFO (1), WARNING (2) or ERROR (3).
# 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
@ -42,8 +35,6 @@
# 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
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LIBVTERM=OFF
@ -51,19 +42,11 @@
# 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.
# Uncomment these entries to instead use dynamic linking.
#
# CMAKE_EXTRA_FLAGS += -DLIBTERMKEY_USE_STATIC=OFF
# CMAKE_EXTRA_FLAGS += -DLIBUNIBILIUM_USE_STATIC=OFF
# CMAKE_EXTRA_FLAGS += -DLIBUV_USE_STATIC=OFF
# 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.

View File

@ -1,4 +1,4 @@
.Dd January 28, 2016
.Dd December 17, 2017
.Dt NVIM 1
.Os
.Sh NAME
@ -20,41 +20,52 @@
.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.
.El
.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 +77,84 @@ 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 (non-interactive) Ex mode, reading stdin as Ex commands.
Useful for scripting because it does NOT start a UI, unlike
.Fl e .
.Ic :help silent-mode
.It Fl \&Es
Silent (non-interactive) Ex mode, reading stdin as text.
Useful for scripting because it does NOT start a UI, unlike
.Fl E .
.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,45 +167,44 @@ 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
.Cm -u NONE .
.It Fl -clean
Skip loading plugins and shada (viminfo) file.
.It Fl o Ns Op Ar N
Open
.Ar N
@ -233,7 +231,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 +243,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 +253,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 +282,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 +314,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,82 +329,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
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.
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

@ -21,33 +21,25 @@ add_custom_command(OUTPUT ${GENERATED_SYN_VIM}
${FUNCS_DATA}
)
if(POLICY CMP0054)
cmake_policy(SET CMP0054 OLD)
endif()
file(GLOB PACKAGES ${PROJECT_SOURCE_DIR}/runtime/pack/dist/opt/*)
set(GENERATED_PACKAGE_TAGS)
foreach(PACKAGE ${PACKAGES})
get_filename_component(PACKNAME ${PACKAGE} NAME)
file(GLOB "${PACKNAME}_DOC_FILES" ${PACKAGE}/doc/*.txt)
if("${PACKNAME}_DOC_FILES")
if(${PACKNAME}_DOC_FILES)
file(MAKE_DIRECTORY ${GENERATED_PACKAGE_DIR}/${PACKNAME})
add_custom_target("${PACKNAME}-tags"
add_custom_command(OUTPUT "${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/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
nvim_runtime_deps
WORKING_DIRECTORY "${GENERATED_PACKAGE_DIR}/${PACKNAME}"
)
add_custom_command(OUTPUT "${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/tags"
DEPENDS
"${PACKNAME}-tags"
)
set("${PACKNAME}_DOC_NAMES")
foreach(DF "${${PACKNAME}_DOC_FILES}")
get_filename_component(F ${DF} NAME)
@ -70,20 +62,18 @@ foreach(DF ${DOCFILES})
list(APPEND BUILDDOCFILES ${GENERATED_RUNTIME_DIR}/doc/${F})
endforeach()
add_custom_target(helptags
add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
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
nvim
nvim_runtime_deps
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}"
)
add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
DEPENDS
helptags
)
add_custom_target(doc_html
COMMAND make html
@ -100,20 +90,6 @@ add_custom_target(
${GENERATED_PACKAGE_TAGS}
)
# Optional targets for nvim.desktop file and icon.
find_program(XDG_MENU_PRG xdg-desktop-menu)
find_program(XDG_ICON_PRG xdg-icon-resource)
if(XDG_MENU_PRG)
add_custom_target(desktop-file
COMMAND xdg-desktop-menu install --novendor ${PROJECT_SOURCE_DIR}/runtime/nvim.desktop)
# add_dependencies(runtime desktop-file)
endif()
if(XDG_ICON_PRG)
add_custom_target(desktop-icon
COMMAND xdg-icon-resource install --novendor --size 128 ${PROJECT_SOURCE_DIR}/runtime/nvim.png)
# add_dependencies(runtime desktop-icon)
endif()
# CMake is painful here. It will create the destination using the user's
# current umask, and we don't want that. And we don't just want to install
# the target directory, as it will mess with existing permissions. So this
@ -128,6 +104,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)
@ -140,7 +126,8 @@ endforeach()
file(GLOB_RECURSE RUNTIME_FILES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
*.vim *.dict *.py *.rb *.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,62 @@
" Author: Antony Lee <anntzer.lee@gmail.com>
" Description: Helper functions for reStructuredText syntax folding
" Last Modified: 2018-12-29
function s:CacheRstFold()
if !g:rst_fold_enabled
return
endif
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()
let save_mark = getpos("'[")
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)
call setpos("'[", save_mark)
let b:RstFoldCache = closure.levels
endfunction
function RstFold#GetRstFold()
if !g:rst_fold_enabled
return
endif
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 !g:rst_fold_enabled
return
endif
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

@ -591,7 +591,7 @@ function ada#Map_Menu (Text, Keys, Command)
\" :" . a:Command
execute
\ "inoremap <buffer>" .
\ " <Learder>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.

View File

@ -4,7 +4,7 @@
" plus CSS Speech Module <http://www.w3.org/TR/css3-speech/>
" Maintainer: Kao, Wei-Ko(othree) ( othree AT gmail DOT com )
" Original Author: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2016 Jan 11
" Last Change: 2018 Jul 02
let s:values = split("all additive-symbols align-content align-items align-self animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function backface-visibility background background-attachment background-blend-mode background-clip background-color background-image background-origin background-position background-repeat background-size block-size border border-block-end border-block-end-color border-block-end-style border-block-end-width border-block-start border-block-start-color border-block-start-style border-block-start-width border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-inline-end border-inline-end-color border-inline-end-style border-inline-end-width border-inline-start border-inline-start-color border-inline-start-style border-inline-start-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-decoration-break box-shadow box-sizing break-after break-before break-inside caption-side clear clip clip-path color columns column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width content counter-increment counter-reset cue cue-before cue-after cursor direction display empty-cells fallback filter flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float font font-family font-feature-settings font-kerning font-language-override font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-weight grid grid-area grid-auto-columns grid-auto-flow grid-auto-position grid-auto-rows grid-column grid-column-start grid-column-end grid-row grid-row-start grid-row-end grid-template grid-template-areas grid-template-rows grid-template-columns height hyphens image-rendering image-resolution image-orientation ime-mode inline-size isolation justify-content left letter-spacing line-break line-height list-style list-style-image list-style-position list-style-type margin margin-block-end margin-block-start margin-bottom margin-inline-end margin-inline-start margin-left margin-right margin-top marks mask mask-type max-block-size max-height max-inline-size max-width max-zoom min-block-size min-height min-inline-size min-width min-zoom mix-blend-mode negative object-fit object-position offset-block-end offset-block-start offset-inline-end offset-inline-start opacity order orientation orphans outline outline-color outline-offset outline-style outline-width overflow overflow-wrap overflow-x overflow-y pad padding padding-block-end padding-block-start padding-bottom padding-inline-end padding-inline-start padding-left padding-right padding-top page-break-after page-break-before page-break-inside pause-before pause-after pause perspective perspective-origin pointer-events position prefix quotes range resize rest rest-before rest-after right ruby-align ruby-merge ruby-position scroll-behavior scroll-snap-coordinate scroll-snap-destination scroll-snap-points-x scroll-snap-points-y scroll-snap-type scroll-snap-type-x scroll-snap-type-y shape-image-threshold shape-margin shape-outside speak speak-as suffix symbols system table-layout tab-size text-align text-align-last text-combine-upright text-decoration text-decoration-color text-decoration-line text-emphasis text-emphasis-color text-emphasis-position text-emphasis-style text-indent text-orientation text-overflow text-rendering text-shadow text-transform text-underline-position top touch-action transform transform-box transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi unicode-range user-zoom vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-rate voice-range voice-stress voice-volume white-space widows width will-change word-break word-spacing word-wrap writing-mode z-index zoom")
@ -19,7 +19,6 @@ function! csscomplete#CompleteCSS(findstart, base)
while start >= 0 && line[start - 1] =~ '\%(\k\|-\)'
let start -= 1
endwhile
let b:after = line[compl_begin :]
let b:compl_context = line[0:compl_begin]
return start
endif
@ -37,11 +36,14 @@ function! csscomplete#CompleteCSS(findstart, base)
" 5. if @ complete at-rule
" 6. if ! complete important
if exists("b:compl_context")
let line = getline('.')
let compl_begin = col('.') - 2
let after = line[compl_begin:]
let line = b:compl_context
let after = b:after
unlet! b:compl_context
else
let line = a:base
let after = ''
endif
let res = []

757
runtime/autoload/dist/ft.vim vendored Normal file
View File

@ -0,0 +1,757 @@
" Vim functions for file type detection
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2019 Mar 08
" 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", "//" or "/*" 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 FALLBACK 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 did_filetype()
" Filetype was already detected
return
endif
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 did_filetype()
" Filetype was already detected
return
endif
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 did_filetype()
" Filetype was already detected
return
endif
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

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +1,24 @@
function! s:enhance_syntax() abort
syntax case match
syntax keyword healthError ERROR
syntax keyword healthError ERROR[:]
\ containedin=markdownCodeBlock,mkdListItemLine
highlight link healthError Error
highlight default link healthError Error
syntax keyword healthWarning WARNING
syntax keyword healthWarning WARNING[:]
\ containedin=markdownCodeBlock,mkdListItemLine
highlight link healthWarning WarningMsg
highlight default link healthWarning WarningMsg
syntax keyword healthSuccess SUCCESS
syntax keyword healthSuccess OK[:]
\ containedin=markdownCodeBlock,mkdListItemLine
highlight healthSuccess guibg=#5fff00 guifg=#080808 ctermbg=82 ctermfg=232
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 link healthHelp Identifier
highlight default link healthHelp Identifier
" We do not care about markdown syntax errors in :CheckHealth output.
" We do not care about markdown syntax errors in :checkhealth output.
highlight! link markdownError Normal
endfunction
@ -30,10 +30,11 @@ function! health#check(plugin_names) abort
\ : s:to_fn_names(a:plugin_names)
tabnew
setlocal wrap breakindent
setlocal wrap breakindent linebreak
setlocal filetype=markdown
setlocal conceallevel=2 concealcursor=nc
setlocal keywordprg=:help iskeyword=@,48-57,_,192-255,-,#
setlocal keywordprg=:help
let &l:iskeyword='!-~,^*,^|,^",192-255'
call s:enhance_syntax()
if empty(healthchecks)
@ -66,6 +67,7 @@ function! health#check(plugin_names) abort
" needed for plasticboy/vim-markdown, because it uses fdm=expr
normal! zR
setlocal nomodified
setlocal bufhidden=hide
redraw|echo ''
endfunction
@ -88,30 +90,30 @@ 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')
return substitute(a:s, '\v:h%[elp] ([^|][^"\r\n ]+)', ':help |\1|', 'g')
endfunction
" Format a message for a specific report item
" 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)
let suggestions = []
" Optional parameters
if a:0 > 0
let suggestions = type(a:1) == type("") ? [a:1] : a:1
if type(suggestions) != type([])
echoerr "Expected String or List"
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
" Report each suggestion
if len(suggestions) > 0
let output .= "\n - SUGGESTIONS:"
endif
for suggestion in suggestions
let output .= "\n - " . s:indent_after_line1(suggestion, 10)
endfor
return s:help_to_link(output)
endfunction " }}}
@ -122,10 +124,11 @@ endfunction " }}}
" Reports a successful healthcheck.
function! health#report_ok(msg) abort " {{{
echo s:format_report_message('SUCCESS', a:msg)
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)
@ -135,6 +138,7 @@ function! health#report_warn(msg, ...) abort " {{{
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)
@ -157,7 +161,10 @@ endfunction
" Translates a list of plugin names to healthcheck function names.
function! s:to_fn_names(plugin_names) abort
let healthchecks = []
for p in a:plugin_names
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

View File

@ -4,22 +4,49 @@ function! s:check_config() abort
let ok = v:true
call health#report_start('Configuration')
if get(g:, 'loaded_sensible', 0)
let vimrc = empty($MYVIMRC) ? stdpath('config').'/init.vim' : $MYVIMRC
if !filereadable(vimrc)
let ok = v:false
let sensible_pi = globpath(&runtimepath, '**/sensible.vim', 1, 1)
call health#report_info("found sensible.vim plugin:\n".join(sensible_pi, "\n"))
call health#report_error("sensible.vim plugin is not needed; Nvim has the same defaults built-in."
\ ." Also, sensible.vim sets 'ttimeoutlen' to a sub-optimal value.",
\ ["Remove sensible.vim plugin, or wrap it in a `if !has('nvim')` check."])
let has_vim = filereadable(expand('~/.vimrc'))
call health#report_warn((-1 == getfsize(vimrc) ? 'Missing' : 'Unreadable').' 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+",
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 v:ctype ==# 'C'
let ok = v:false
call health#report_error('Locale does not support UTF-8. Unicode characters may not display correctly.'
\ .printf("\n$LANG=%s $LC_ALL=%s $LC_CTYPE=%s", $LANG, $LC_ALL, $LC_CTYPE),
\ [ 'If using tmux, try the -u option.',
\ 'Ensure that your terminal/shell/tmux/etc inherits the environment, or set $LANG explicitly.' ,
\ 'Configure your system locale.' ])
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
let shadafile = (empty(&shadafile) || &shadafile ==# 'NONE') ? stdpath('data').'/shada/main.shada' : &shadafile
if !empty(shadafile) && (!filereadable(shadafile) || !filewritable(shadafile))
let ok = v:false
call health#report_error('shada file is not '.(filereadable(shadafile) ? 'writeable' : 'readable').":\n".shadafile)
endif
if ok
call health#report_ok('no issues found')
endif
@ -54,7 +81,7 @@ function! s:check_rplugin_manifest() abort
let contents = join(readfile(script))
if contents =~# '\<\%(from\|import\)\s\+neovim\>'
if script =~# '[\/]__init__\.py$'
let script = fnamemodify(script, ':h')
let script = tr(fnamemodify(script, ':h'), '\', '/')
endif
if !has_key(existing_rplugins, script)
@ -96,8 +123,8 @@ function! s:check_performance() abort
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`.",
\ 'Non-optimized '.(has('debug')?'(DEBUG) ':'').'build. Nvim will be slower.',
\ ['Install a different Nvim package, or rebuild with `CMAKE_BUILD_TYPE=RelWithDebInfo`.',
\ s:suggest_faq])
endif
endfunction
@ -149,6 +176,17 @@ function! s:check_tmux() abort
\ ["Set default-terminal in ~/.tmux.conf:\nset-option -g default-terminal \"screen-256color\"",
\ s:suggest_faq])
endif
" check for RGB capabilities
let info = system('tmux server-info')
let has_tc = stridx(info, " Tc: (flag) true") != -1
let has_rgb = stridx(info, " RGB: (flag) true") != -1
if !has_tc && !has_rgb
call health#report_warn(
\ "Neither Tc nor RGB capability set. True colors are disabled. |'termguicolors'| won't work properly.",
\ ["Put this in your ~/.tmux.conf and replace XXX by your $TERM outside of tmux:\nset-option -sa terminal-overrides ',XXX:RGB'",
\ "For older tmux versions use this instead:\nset-option -ga terminal-overrides ',XXX:Tc'"])
endif
endfunction
function! s:check_terminal() abort
@ -169,6 +207,11 @@ function! s:check_terminal() abort
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

View File

@ -13,6 +13,12 @@ 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)
@ -31,31 +37,45 @@ endfunction
" Handler for s:system() function.
function! s:system_handler(jobid, data, event) dict abort
if a:event ==# 'stdout' || a:event ==# 'stderr'
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_stderr = a:0 > 1 ? a:2 : 0
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'),
\ }
if !ignore_stderr
let opts.on_stderr = function('s:system_handler')
endif
let jobid = jobstart(a:cmd, opts)
if jobid < 1
call health#report_error(printf('Command error %d: %s', jobid,
\ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd))
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
@ -66,13 +86,11 @@ function! s:system(cmd, ...) abort
let res = jobwait([jobid], 30000)
if res[0] == -1
call health#report_error(printf('Command timed out: %s',
\ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd))
call 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 (%d) %s: %s', jobid,
\ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd,
\ opts.output))
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
@ -88,7 +106,8 @@ endfunction
" Fetch the contents of a URL.
function! s:download(url) abort
if executable('curl')
let has_curl = executable('curl')
if has_curl && system(['curl', '-V']) =~# 'Protocols:.*https'
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')
@ -106,27 +125,40 @@ function! s:download(url) abort
\ ? 'python urllib.request error: '.s:shell_error
\ : rv
endif
return 'missing `curl` and `python`, cannot make pypi request'
return 'missing `curl` '
\ .(has_curl ? '(with HTTPS support) ' : '')
\ .'and `python`, cannot make web 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 empty(clipboard_tool)
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 will not work.',
\ '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 version from PyPI.
" 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/neovim/json')
let pypi_response = s:download('https://pypi.python.org/pypi/pynvim/json')
if !empty(pypi_response)
try
let pypi_data = json_decode(pypi_response)
@ -157,11 +189,13 @@ function! s:version_info(python) abort
\ ]))
if empty(python_version)
let python_version = 'unable to parse python response'
let python_version = 'unable to parse '.a:python.' response'
endif
let nvim_path = s:trim(s:system([
\ a:python, '-c', 'import neovim; print(neovim.__file__)']))
\ 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]
@ -176,7 +210,7 @@ function! s:version_info(python) abort
endfunction
" Try to get neovim.VERSION (added in 0.1.11dev).
let nvim_version = s:system(['python', '-c',
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)
@ -227,73 +261,56 @@ function! s:check_python(version) abort
call health#report_start('Python ' . a:version . ' provider (optional)')
let pyname = 'python'.(a:version == 2 ? '' : '3')
let pyenv = resolve(exepath('pyenv'))
let pyenv_root = exists('$PYENV_ROOT') ? resolve($PYENV_ROOT) : 'n'
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_bin = ''
let python_multiple = []
if exists(loaded_var) && !exists('*provider#'.pyname.'#Call')
call health#report_info('Disabled. '.loaded_var.'='.eval(loaded_var))
return
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_errs] = provider#pythonx#Detect(a:version)
let [pyname, pythonx_errors] = provider#pythonx#Detect(a:version)
if empty(pyname)
call health#report_warn('No Python interpreter was found with the neovim '
\ . 'module. Using the first available for diagnostics.')
if !empty(pythonx_errs)
call health#report_warn(pythonx_errs)
endif
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
if !empty(pyname)
if exists('g:'.host_prog_var)
let python_bin = exepath(pyname)
endif
let pyname = fnamemodify(pyname, ':t')
endif
" No Python executable could `import neovim`.
if !empty(pythonx_errors)
call health#report_error('Python provider error:', pythonx_errors)
if !empty(pythonx_errs)
call health#report_error('Python provider error', pythonx_errs)
endif
if !empty(pyname) && empty(python_bin) && empty(pythonx_errs)
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)
if empty(pyenv_root)
call health#report_warn(
\ 'pyenv was found, but $PYENV_ROOT is not set.',
\ ['Did you follow the final install instructions?']
\ )
else
call health#report_ok(printf('pyenv found: "%s"', pyenv))
endif
let python_exe = s:trim(s:system([pyenv, 'which', pyname], '', 1))
let python_bin = s:trim(s:system([pyenv, 'which', pyname], '', 1))
if empty(python_bin)
if empty(python_exe)
call health#report_warn(printf('pyenv could not find %s.', pyname))
endif
endif
if empty(python_bin)
let python_bin = exepath(pyname)
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_bin)
if path_bin != s:normalize_path(python_exe)
\ && index(python_multiple, path_bin) == -1
\ && executable(path_bin)
call add(python_multiple, path_bin)
@ -307,115 +324,153 @@ function! s:check_python(version) abort
\ . 'Set `g:%s` to avoid surprises.', pyname, host_prog_var))
endif
if python_bin =~# '\<shims\>'
call health#report_warn(printf('`%s` appears to be a pyenv shim.', python_bin), [
\ 'The `pyenv` executable is not in $PATH,',
\ 'Your pyenv installation is broken. You should set '
\ . '`g:'.host_prog_var.'` to avoid surprises.',
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_bin)
if empty(venv) && !empty(pyenv) && !exists('g:'.host_prog_var)
\ && !empty(pyenv_root) && resolve(python_bin) !~# '^'.pyenv_root.'/'
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 Neovim''s Python module in each '
\ . 'the need to install the pynvim module in each '
\ . 'version/virtualenv.', host_prog_var)
\ ])
elseif !empty(venv) && exists('g:'.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_bin) !~# '^'.venv_root.'/'
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 Neovim''s Python module in each '
\ . 'the need to install the pynvim module in each '
\ . 'virtualenv.', host_prog_var)
\ ])
endif
endif
endif
if empty(python_bin) && !empty(pyname)
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_bin) && !s:check_bin(python_bin)
let python_bin = ''
elseif !empty(python_exe) && !s:check_bin(python_exe)
let python_exe = ''
endif
" Check if $VIRTUAL_ENV is active
let virtualenv_inactive = 0
if exists('$VIRTUAL_ENV')
if !empty(pyenv)
let pyenv_prefix = resolve(s:trim(s:system([pyenv, 'prefix'])))
if $VIRTUAL_ENV != pyenv_prefix
let virtualenv_inactive = 1
endif
elseif !empty(pyname) && exepath(pyname) !~# '^'.$VIRTUAL_ENV.'/'
let virtualenv_inactive = 1
" 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
if virtualenv_inactive
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/5229' ])
endif
" Diagnostic output
call health#report_info('Executable: ' . (empty(python_bin) ? 'Not found' : python_bin))
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
if !empty(python_bin)
let [pyversion, current, latest, status] = s:version_info(python_bin)
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'.a:version.' version: ' . pyversion)
call health#report_info('Python version: ' . pyversion)
if s:is_bad_response(status)
call health#report_info(printf('%s-neovim version: %s (%s)', pyname, current, status))
call health#report_info(printf('pynvim version: %s (%s)', current, status))
else
call health#report_info(printf('%s-neovim version: %s', pyname, current))
call health#report_info(printf('pynvim version: %s', current))
endif
if s:is_bad_response(current)
call health#report_error(
\ "Neovim Python client is not installed.\nError: ".current,
\ ['Run in shell: pip' . a:version . ' install neovim'])
\ "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 %s-neovim is NOT installed: %s',
\ pyname, latest))
call health#report_warn(printf('Latest pynvim is NOT installed: %s', latest))
elseif !s:is_bad_response(current)
call health#report_ok(printf('Latest %s-neovim is installed: %s',
\ pyname, latest))
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
@ -437,10 +492,11 @@ function! s:check_ruby() abort
let host = provider#ruby#Detect()
if empty(host)
call health#report_warn('Missing "neovim" gem.',
\ ['Run in shell: gem install neovim',
\ 'Is the gem bin directory in $PATH? Check `gem environment`.',
\ 'If you are using rvm/rbenv/chruby, try "rehashing".'])
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)
@ -453,7 +509,7 @@ function! s:check_ruby() abort
\ 'Are you behind a firewall or proxy?'])
return
endif
let latest_gem = get(split(latest_gem, ' (\|, \|)$' ), 1, 'not found')
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)
@ -473,9 +529,84 @@ function! s:check_ruby() abort
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 manager = executable('npm') ? 'npm' : 'yarn'
let latest_npm_cmd = has('win32') ?
\ 'cmd /c '. manager .' info neovim --json' :
\ manager .' 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',
\ 'Run in shell (if you use yarn): yarn global add 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,16 +1,36 @@
" Maintainer: Anmol Sethi <anmol@aubble.com>
let s:man_find_arg = "-w"
if exists('s:loaded_man')
finish
endif
let s:loaded_man = 1
" TODO(nhooyr) Completion may work on SunOS; I'm not sure if `man -l` displays
" the list of searched directories.
try
if !has('win32') && $OSTYPE !~? 'cygwin\|linux' && system('uname -s') =~? 'SunOS' && system('uname -r') =~# '^5'
let s:man_find_arg = '-l'
let s:find_arg = '-w'
let s:localfile_arg = v:true " Always use -l if possible. #6683
let s:section_arg = '-s'
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
catch /E145:/
" Ignore the error in restricted mode
endtry
endfunction
function! s:init() abort
call s:init_section_flag()
" TODO(nhooyr): Does `man -l` on SunOS list searched directories?
try
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
@ -50,9 +70,9 @@ function! man#open_page(count, count1, mods, ...) abort
try
set eventignore+=BufReadCmd
if a:mods !~# 'tab' && s:find_man()
execute 'silent edit' fnameescape(bufname)
execute 'silent keepalt edit' fnameescape(bufname)
else
execute 'silent' a:mods 'split' fnameescape(bufname)
execute 'silent keepalt' a:mods 'split' fnameescape(bufname)
endif
finally
set eventignore-=BufReadCmd
@ -88,10 +108,8 @@ endfunction
" Handler for s:system() function.
function! s:system_handler(jobid, data, event) dict abort
if a:event == 'stdout'
let self.stdout .= join(a:data, "\n")
elseif a:event == 'stderr'
let self.stderr .= join(a:data, "\n")
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
@ -118,7 +136,7 @@ function! s:system(cmd, ...) abort
try
call jobstop(jobid)
throw printf('command timed out: %s', join(a:cmd))
catch /^Vim\%((\a\+)\)\=:E900/
catch /^Vim(call):E900:/
endtry
elseif res[0] == -2
throw printf('command interrupted: %s', join(a:cmd))
@ -131,11 +149,15 @@ function! s:system(cmd, ...) abort
endfunction
function! s:get_page(path) abort
" Respect $MANWIDTH or default to window width.
let manwidth = empty($MANWIDTH) ? winwidth(0) : $MANWIDTH
" Disable hard-wrap by using a big $MANWIDTH (max 1000 on some systems #9065).
" Soft-wrap: ftplugin/man.vim sets wrap/breakindent/….
" Hard-wrap: driven by `man`.
let manwidth = !get(g:,'man_hardwrap') ? 999 : (empty($MANWIDTH) ? winwidth(0) : $MANWIDTH)
" Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db).
" http://comments.gmane.org/gmane.editors.vim.devel/29085
return s:system(['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'man', a:path])
" 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
@ -143,11 +165,15 @@ function! s:put_page(page) abort
setlocal noreadonly
silent keepjumps %delete _
silent put =a:page
" Remove all backspaced/escape characters.
execute 'silent keeppatterns keepjumps %substitute,.\b\|\e\[\d\+m,,e'.(&gdefault?'':'g')
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
@ -198,15 +224,17 @@ function! man#extract_sect_and_name_ref(ref) abort
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 s:system(['man', s:man_find_arg, a:name])
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 s:system(['man', s:man_find_arg, '-s', a:sect, a:name])
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
@ -219,13 +247,10 @@ function! s:verify_exists(sect, name) abort
let path = s:get_path('', a:name)
endtry
endtry
" We need to extract the section from the path because sometimes
" the actual section of the manpage is more specific than the section
" we provided to `man`. Try ':Man 3 App::CLI'.
" Also on linux, it seems that the name is case insensitive. So if one does
" ':Man PRIntf', we still want the name of the buffer to be 'printf' or
" whatever the correct capitilization is.
let path = path[:len(path)-2]
" 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
@ -285,6 +310,12 @@ 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
@ -331,7 +362,7 @@ endfunction
function! s:complete(sect, psect, name) abort
try
let mandirs = join(split(s:system(['man', s:man_find_arg]), ':\|\n'), ',')
let mandirs = join(split(s:system(['man', s:find_arg]), ':\|\n'), ',')
catch
call s:error(v:exception)
return
@ -356,20 +387,23 @@ function! s:format_candidate(path, psect) abort
endfunction
function! man#init_pager() abort
" Remove all backspaced/escape characters.
execute 'silent keeppatterns keepjumps %substitute,.\b\|\e\[\d\+m,,e'.(&gdefault?'':'g')
if getline(1) =~# '^\s*$'
silent keepjumps 1delete _
else
keepjumps 1
endif
" This is not perfect. See `man glDrawArraysInstanced`. Since the title is
" all caps it is impossible to tell what the original capitilization was.
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
execute 'silent file man://'.fnameescape(ref)
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"
@ -601,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)

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
" netrwSettings.vim: makes netrw settings simpler
" Date: Dec 30, 2014
" Date: Nov 09, 2016
" Maintainer: Charles E Campbell <drchipNOSPAM at campbellfamily dot biz>
" Version: 15
" Version: 16
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
@ -19,7 +19,7 @@
if exists("g:loaded_netrwSettings") || &cp
finish
endif
let g:loaded_netrwSettings = "v15"
let g:loaded_netrwSettings = "v16"
if v:version < 700
echohl WarningMsg
echo "***warning*** this version of netrwSettings needs vim 7.0"
@ -154,9 +154,13 @@ fun! netrwSettings#NetrwSettings()
put = 'let g:netrw_list_hide = '.g:netrw_list_hide
put = 'let g:netrw_liststyle = '.g:netrw_liststyle
put = 'let g:netrw_localcopycmd = '.g:netrw_localcopycmd
put = 'let g:netrw_localcopycmdopt = '.g:netrw_localcopycmdopt
put = 'let g:netrw_localmkdir = '.g:netrw_localmkdir
put = 'let g:netrw_localmkdiropt = '.g:netrw_localmkdiropt
put = 'let g:netrw_localmovecmd = '.g:netrw_localmovecmd
put = 'let g:netrw_localmovecmdopt = '.g:netrw_localmovecmdopt
put = 'let g:netrw_localrmdir = '.g:netrw_localrmdir
put = 'let g:netrw_localrmdiropt = '.g:netrw_localrmdiropt
put = 'let g:netrw_maxfilenamelen = '.g:netrw_maxfilenamelen
put = 'let g:netrw_menu = '.g:netrw_menu
put = 'let g:netrw_mousemaps = '.g:netrw_mousemaps

View File

@ -1,35 +1,25 @@
" Vim support file to help with paste mappings and menus
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2006 Jun 23
" Last Change: 2019 Jan 27
" 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.
" Pasting blockwise and linewise selections is not possible in Insert and
" Visual mode without the +virtualedit feature. They are pasted as if they
" were characterwise instead. Add to that some tricks to leave the cursor in
" the right position, also for "gi".
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 = {'n': ":call paste#Paste()<CR>"}
let paste#paste_cmd['v'] = '"-c<Esc>' . paste#paste_cmd['n']
let paste#paste_cmd['i'] = "\<c-\>\<c-o>\"+gP"
func! paste#Paste()
let ove = &ve
set ve=all
normal! `^
if @+ != ''
normal! "+gP
endif
let c = col(".")
normal! i
if col(".") < c " compensate for i<ESC> moving the cursor left
normal! l
endif
let &ve = ove
endfunc
else
let paste#paste_cmd = {'n': "\"=@+.'xy'<CR>gPFx\"_2x"}
let paste#paste_cmd['v'] = '"-c<Esc>gix<Esc>' . paste#paste_cmd['n'] . '"_x'
let paste#paste_cmd['i'] = 'x<Esc>' . paste#paste_cmd['n'] . '"_s'
endif
func! paste#Paste()
let ove = &ve
set ve=all
normal! `^
if @+ != ''
normal! "+gP
endif
let c = col(".")
normal! i
if col(".") < c " compensate for i<ESC> moving the cursor left
normal! l
endif
let &ve = ove
endfunc

View File

@ -3,7 +3,7 @@
" Maintainer: Dávid Szabó ( complex857 AT gmail DOT com )
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" URL: https://github.com/shawncplus/phpcomplete.vim
" Last Change: 2016 Oct 10
" Last Change: 2018 Oct 10
"
" OPTIONS:
"
@ -146,6 +146,8 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
end
try
let eventignore = &eventignore
let &eventignore = 'all'
let winheight = winheight(0)
let winnr = winnr()
@ -216,6 +218,7 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
endif
finally
silent! exec winnr.'resize '.winheight
let &eventignore = eventignore
endtry
endfunction
" }}}
@ -1393,23 +1396,28 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
for classstructure in classcontents
let docblock_target_pattern = 'function\s\+&\?'.method.'\>\|\(public\|private\|protected\|var\).\+\$'.method.'\>\|@property.\+\$'.method.'\>'
let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), docblock_target_pattern)
if doc_str != ''
let return_type_hint = phpcomplete#GetFunctionReturnTypeHint(split(classstructure.content, '\n'), 'function\s\+&\?'.method.'\>')
if doc_str != '' || return_type_hint != ''
break
endif
endfor
if doc_str != ''
if doc_str != '' || return_type_hint != ''
let docblock = phpcomplete#ParseDocBlock(doc_str)
if has_key(docblock.return, 'type') || has_key(docblock.var, 'type') || len(docblock.properties) > 0
let type = has_key(docblock.return, 'type') ? docblock.return.type : has_key(docblock.var, 'type') ? docblock.var.type : ''
if has_key(docblock.return, 'type') || has_key(docblock.var, 'type') || len(docblock.properties) > 0 || return_type_hint != ''
if return_type_hint == ''
let type = has_key(docblock.return, 'type') ? docblock.return.type : has_key(docblock.var, 'type') ? docblock.var.type : ''
if type == ''
for property in docblock.properties
if property.description =~? method
let type = property.type
break
endif
endfor
endif
if type == ''
for property in docblock.properties
if property.description =~? method
let type = property.type
break
endif
endfor
endif
else
let type = return_type_hint
end
" there's a namespace in the type, threat the type as FQCN
if type =~ '\\'
@ -1483,7 +1491,7 @@ function! phpcomplete#GetMethodStack(line) " {{{
continue
endif
" if it's looks like a string
" if it looks like a string
if current_char == "'" || current_char == '"'
" and it is not escaped
if prev_char != '\' || (prev_char == '\' && prev_prev_char == '\')
@ -1587,9 +1595,11 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
elseif function_file != '' && filereadable(function_file)
let file_lines = readfile(function_file)
let docblock_str = phpcomplete#GetDocBlock(file_lines, 'function\s*&\?\<'.function_name.'\>')
let return_type_hint = phpcomplete#GetFunctionReturnTypeHint(file_lines, 'function\s*&\?'.function_name.'\>')
let docblock = phpcomplete#ParseDocBlock(docblock_str)
if has_key(docblock.return, 'type')
let classname_candidate = docblock.return.type
let type = has_key(docblock.return, 'type') ? docblock.return.type : return_type_hint
if type != ''
let classname_candidate = type
let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines)
" try to expand the classname of the returned type with the context got from the function's source file
@ -1821,9 +1831,11 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
elseif function_file != '' && filereadable(function_file)
let file_lines = readfile(function_file)
let docblock_str = phpcomplete#GetDocBlock(file_lines, 'function\s*&\?\<'.function_name.'\>')
let return_type_hint = phpcomplete#GetFunctionReturnTypeHint(file_lines, 'function\s*&\?'.function_name.'\>')
let docblock = phpcomplete#ParseDocBlock(docblock_str)
if has_key(docblock.return, 'type')
let classname_candidate = docblock.return.type
let type = has_key(docblock.return, 'type') ? docblock.return.type : return_type_hint
if type != ''
let classname_candidate = type
let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines)
" try to expand the classname of the returned type with the context got from the function's source file
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports)
@ -2413,6 +2425,44 @@ function! phpcomplete#ParseDocBlock(docblock) " {{{
endfunction
" }}}
function! phpcomplete#GetFunctionReturnTypeHint(sccontent, search)
let i = 0
let l = 0
let function_line_start = -1
let function_line_end = -1
let sccontent_len = len(a:sccontent)
let return_type = ''
while (i < sccontent_len)
let line = a:sccontent[i]
" search for a function declaration
if line =~? a:search
let l = i
let function_line_start = i
" now search for the first { where the function body starts
while l < sccontent_len
let line = a:sccontent[l]
if line =~? '\V{'
let function_line_end = l
break
endif
let l += 1
endwhile
break
endif
let i += 1
endwhile
" now grab the lines that holds the function declaration line
if function_line_start != -1 && function_line_end != -1
let function_line = join(a:sccontent[function_line_start :function_line_end], " ")
let class_name_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*'
let return_type = matchstr(function_line, '\c\s*:\s*\zs'.class_name_pattern.'\ze\s*{')
endif
return return_type
endfunction
function! phpcomplete#GetTypeFromDocBlockParam(docblock_type) " {{{
if a:docblock_type !~ '|'
return a:docblock_type
@ -2572,7 +2622,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
" find kind flags from tags or built in methods for the objects we extracted
" they can be either classes, interfaces or namespaces, no other thing is importable in php
for [key, import] in items(imports)
" if theres a \ in the name we have it's definetly not a built in thing, look for tags
" if theres a \ in the name we have it's definitely not a built in thing, look for tags
if import.name =~ '\\'
let patched_ctags_detected = 0
let [classname, namespace_for_classes] = phpcomplete#ExpandClassName(import.name, '\', {})

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

@ -1,30 +1,46 @@
" The clipboard provider uses shell commands to communicate with the clipboard.
" The provider function will only be registered if a supported command is
" available.
if exists('g:loaded_clipboard_provider')
finish
endif
" Default to 1. provider#clipboard#Executable() may set 2.
" To force a reload:
" :unlet g:loaded_clipboard_provider
" :runtime autoload/provider/clipboard.vim
let g:loaded_clipboard_provider = 1
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
if !exists('s:did_error_try_cmd')
echohl WarningMsg
echomsg "clipboard: error: ".(len(out) ? out[0] : '')
echomsg "clipboard: error: ".(len(out) ? out[0] : v:shell_error)
echohl None
let s:did_error_try_cmd = 1
endif
@ -34,7 +50,7 @@ function! s:try_cmd(cmd, ...)
endfunction
" Returns TRUE if `cmd` exits with success, else FALSE.
function! s:cmd_ok(cmd)
function! s:cmd_ok(cmd) abort
call system(a:cmd)
return v:shell_error == 0
endfunction
@ -47,25 +63,43 @@ function! provider#clipboard#Error() abort
endfunction
function! provider#clipboard#Executable() abort
if has('mac') && executable('pbcopy')
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')
let s:copy['+'] = 'pbcopy'
let s:paste['+'] = 'pbpaste'
let s:copy['*'] = s:copy['+']
let s:paste['*'] = s:paste['+']
let s:cache_enabled = 0
return 'pbcopy'
elseif exists('$DISPLAY') && executable('xsel') && 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 exists('$WAYLAND_DISPLAY') && executable('wl-copy') && executable('wl-paste')
let s:copy['+'] = 'wl-copy --foreground --type text/plain'
let s:paste['+'] = 'wl-paste --no-newline'
let s:copy['*'] = 'wl-copy --foreground --primary --type text/plain'
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'
@ -78,32 +112,34 @@ function! provider#clipboard#Executable() abort
let s:copy['*'] = s:copy['+']
let s:paste['*'] = s:paste['+']
return 'doitclient'
elseif executable('win32yank')
let s:copy['+'] = 'win32yank -i --crlf'
let s:paste['+'] = 'win32yank -o --lf'
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 available. :help clipboard'
let s:err = 'clipboard: No clipboard tool. :help clipboard'
return ''
endfunction
if empty(provider#clipboard#Executable())
finish
endif
let s:clipboard = {}
function! s:clipboard.get(reg)
if s:selections[a:reg].owner > 0
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[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['+']
@ -111,33 +147,62 @@ 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
" 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)
if s:selections[a:reg].owner > 0
let prev_job = 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
let ret = 1
else
echohl WarningMsg
echo "clipboard: error when invoking provider"
echomsg 'clipboard: failed to execute: '.(s:copy[a:reg])
echohl None
return 0
let ret = 1
endif
call jobsend(jobid, a:lines)
call jobclose(jobid, 'stdin')
let selection.owner = jobid
" 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.
if exists('prev_job')
call timer_start(1000, {... ->
\ jobwait([prev_job], 0)[0] == -1
\ && jobstop(prev_job)})
endif
return ret
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
" eval_has_provider() decides based on this variable.
let g:loaded_clipboard_provider = empty(provider#clipboard#Executable()) ? 1 : 2

View File

@ -0,0 +1,149 @@
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()
let g:loaded_node_provider = empty(s:prog) ? 1 : 2
if g:loaded_node_provider != 2
let s:err = 'Cannot find the "neovim" node package. Try :checkhealth'
endif
call remote#host#RegisterPlugin('node-provider', 'node', [])

View File

@ -7,29 +7,23 @@
if exists('g:loaded_python_provider')
finish
endif
let g:loaded_python_provider = 1
let [s:prog, s:err] = provider#pythonx#Detect(2)
let g:loaded_python_provider = empty(s:prog) ? 1 : 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
if s:prog == ''
" Detection failed
finish
endif
" 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', 'script_host.py', [])
function! provider#python#Call(method, args)
function! provider#python#Call(method, args) abort
if s:err != ''
return
endif

View File

@ -7,29 +7,23 @@
if exists('g:loaded_python3_provider')
finish
endif
let g:loaded_python3_provider = 1
let [s:prog, s:err] = provider#pythonx#Detect(3)
let g:loaded_python3_provider = empty(s:prog) ? 1 : 2
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
if s:prog == ''
" Detection failed
finish
endif
" 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', 'script_host.py', [])
function! provider#python3#Call(method, args)
function! provider#python3#Call(method, args) abort
if s:err != ''
return
endif

View File

@ -5,18 +5,6 @@ endif
let s:loaded_pythonx_provider = 1
let s:stderr = {}
let s:job_opts = {'rpc': v:true}
" TODO(bfredl): this logic is common and should be builtin
function! s:job_opts.on_stderr(chan_id, data, event)
let stderr = get(s:stderr, a:chan_id, [''])
let last = remove(stderr, -1)
let a:data[0] = last.a:data[0]
call extend(stderr, a:data)
let s:stderr[a:chan_id] = stderr
endfunction
function! provider#pythonx#Require(host) abort
let ver = (a:host.orig_name ==# 'python') ? 2 : 3
@ -30,95 +18,97 @@ function! provider#pythonx#Require(host) abort
call add(args, plugin.path)
endfor
try
let channel_id = jobstart(args, s:job_opts)
if rpcrequest(channel_id, 'poll') ==# 'ok'
return channel_id
endif
catch
echomsg v:throwpoint
echomsg v:exception
for row in get(s:stderr, channel_id, [])
echomsg row
endfor
endtry
throw remote#host#LoadErrorForHost(a:host.orig_name,
\ '$NVIM_PYTHON_LOG_FILE')
return provider#Poll(args, a:host.orig_name, '$NVIM_PYTHON_LOG_FILE')
endfunction
function! provider#pythonx#Detect(major_ver) abort
if a:major_ver == 2
if exists('g:python_host_prog')
return [g:python_host_prog, '']
else
let progs = ['python2', 'python2.7', 'python2.6', 'python']
endif
else
if exists('g:python3_host_prog')
return [g:python3_host_prog, '']
else
let progs = ['python3', 'python3.7', 'python3.6', 'python3.5',
\ 'python3.4', 'python3.3', 'python']
endif
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
let candidates = s:get_python_candidates(a:major_version)
let errors = []
for prog in progs
let [result, err] = s:check_interpreter(prog, a:major_ver)
for exe in candidates
let [result, error] = provider#pythonx#CheckForModule(exe, a:module, a:major_version)
if result
return [prog, err]
return [exe, error]
endif
" Accumulate errors in case we don't find
" any suitable Python interpreter.
call add(errors, err)
" Accumulate errors in case we don't find any suitable Python executable.
call add(errors, error)
endfor
" No suitable Python interpreter found.
return ['', 'provider/pythonx: Could not load Python ' . a:major_ver
\ . ":\n" . join(errors, "\n")]
" No suitable Python executable found.
return ['', 'provider/pythonx: Could not load Python '.a:major_version.":\n".join(errors, "\n")]
endfunction
function! s:check_interpreter(prog, major_ver) abort
" 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("%s") is None))',
\ a:module)])
return [v:shell_error, prog_version]
endfunction
" 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_ver == 2) ? '2.6' : '3.3'
let min_version = (a:major_version == 2) ? '2.6' : '3.3'
" Try to load neovim module, and output Python version.
" Return codes:
" 0 Neovim module can be loaded.
" 2 Neovim module cannot be loaded.
" 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_ver = system([ a:prog , '-c' ,
\ '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))'
\ ])
let [prog_exitcode, prog_version] = s:import_module(a:prog, a:module)
if v:shell_error == 2 || v:shell_error == 0
if prog_exitcode == 2 || prog_exitcode == 0
" Check version only for expected return codes.
if prog_ver !~ '^' . a:major_ver
return [0, prog_path . ' is Python ' . prog_ver . ' and cannot provide Python '
\ . a:major_ver . '.']
elseif prog_ver =~ '^' . a:major_ver && prog_ver < min_version
return [0, prog_path . ' is Python ' . prog_ver . ' and cannot provide Python >= '
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 == 2
return [0, prog_path.' does not have the "neovim" module. :help provider-python']
elseif v:shell_error == 127
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_ver]
elseif v:shell_error
return [0, prog_path . ' does not exist: ' . prog_version]
elseif prog_exitcode
return [0, 'Checking ' . prog_path . ' caused an unknown error. '
\ . '(' . v:shell_error . ', output: ' . prog_ver . ')'
\ . '(' . prog_exitcode . ', output: ' . prog_version . ')'
\ . ' Report this at https://github.com/neovim/neovim']
endif

View File

@ -4,49 +4,26 @@ if exists('g:loaded_ruby_provider')
endif
let g:loaded_ruby_provider = 1
let s:stderr = {}
let s:job_opts = {'rpc': v:true}
function! s:job_opts.on_stderr(chan_id, data, event)
let stderr = get(s:stderr, a:chan_id, [''])
let last = remove(stderr, -1)
let a:data[0] = last.a:data[0]
call extend(stderr, a:data)
let s:stderr[a:chan_id] = stderr
endfunction
function! provider#ruby#Detect() abort
return exepath('neovim-ruby-host')
return s:prog
endfunction
function! provider#ruby#Prog()
function! provider#ruby#Prog() abort
return s:prog
endfunction
function! provider#ruby#Require(host) abort
let args = [provider#ruby#Prog()]
let prog = provider#ruby#Prog()
let ruby_plugins = remote#host#PluginsForHost(a:host.name)
for plugin in ruby_plugins
call add(args, plugin.path)
let prog .= " " . shellescape(plugin.path)
endfor
try
let channel_id = jobstart(args, s:job_opts)
if rpcrequest(channel_id, 'poll') ==# 'ok'
return channel_id
endif
catch
echomsg v:throwpoint
echomsg v:exception
for row in get(s:stderr, channel_id, [])
echomsg row
endfor
endtry
throw remote#host#LoadErrorForHost(a:host.orig_name, '$NVIM_RUBY_LOG_FILE')
return provider#Poll(prog, a:host.orig_name, '$NVIM_RUBY_LOG_FILE')
endfunction
function! provider#ruby#Call(method, args)
function! provider#ruby#Call(method, args) abort
if s:err != ''
echoerr s:err
return
@ -66,12 +43,29 @@ function! provider#ruby#Call(method, args)
return call('rpcrequest', insert(insert(a:args, 'ruby_'.a:method), s:host))
endfunction
let s:err = ''
let s:prog = provider#ruby#Detect()
let s:plugin_path = expand('<sfile>:p:h') . '/script_host.rb'
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
if empty(s:prog)
let s:err = 'Cannot find the neovim RubyGem. Try :CheckHealth'
let s:err = ''
let s:prog = s:detect()
let s:plugin_path = expand('<sfile>:p:h') . '/script_host.rb'
let g:loaded_ruby_provider = empty(s:prog) ? 1 : 2
if g:loaded_ruby_provider != 2
let s:err = 'Cannot find the neovim RubyGem. Try :checkhealth'
endif
call remote#host#RegisterClone('legacy-ruby-provider', 'ruby')

View File

@ -1,8 +1,6 @@
begin
require "neovim/ruby_provider"
require 'neovim/ruby_provider'
rescue LoadError
warn(
"Your neovim RubyGem is missing or out of date. " +
"Install the latest version using `gem install neovim`."
)
warn('Your neovim RubyGem is missing or out of date.',
'Install the latest version using `gem install neovim`.')
end

View File

@ -44,7 +44,7 @@
"
if !has('python3')
echo "Error: Required vim compiled with +python3"
echo 'Error: Requires python3 + pynvim. :help provider-python'
finish
endif

View File

@ -42,7 +42,7 @@
"
if !has('python')
echo "Error: Required vim compiled with +python"
echo 'Error: Requires python + pynvim. :help provider-python'
finish
endif

View File

@ -89,7 +89,8 @@ 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.'"'
@ -168,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',

View File

@ -114,7 +114,7 @@ function! s:RegistrationCommands(host) abort
let host_id = a:host.'-registration-clone'
call remote#host#RegisterClone(host_id, a:host)
let pattern = s:plugin_patterns[a:host]
let paths = globpath(&rtp, 'rplugin/'.a:host.'/'.pattern, 0, 1)
let paths = globpath(&rtp, 'rplugin/'.a:host.'/'.pattern, 1, 1)
let paths = map(paths, 'tr(resolve(v:val),"\\","/")') " Normalize slashes #4795
let paths = uniq(sort(paths))
if empty(paths)
@ -147,7 +147,7 @@ function! s:RegistrationCommands(host) abort
\ a:host, string(map(registered, "fnamemodify(v:val, ':t')")))
" Delete the temporary host clone
call rpcstop(s:hosts[host_id].channel)
call jobstop(s:hosts[host_id].channel)
call remove(s:hosts, host_id)
call remove(s:plugins_for_host, host_id)
return lines
@ -199,3 +199,7 @@ call remote#host#Register('python3', '*',
" Ruby
call remote#host#Register('ruby', '*.rb',
\ function('provider#ruby#Require'))
" nodejs
call remote#host#Register('node', '*',
\ function('provider#node#Require'))

View File

@ -1,9 +1,9 @@
" Vim completion script
" Language: Ruby
" Maintainer: Mark Guzman <segfault@hasno.info>
" URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
" Maintainer Version: 0.8.1
" Language: Ruby
" Maintainer: Mark Guzman <segfault@hasno.info>
" URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 Jan 06
" ----------------------------------------------------------------------------
"
" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
@ -103,7 +103,7 @@ function! s:GetBufferRubyEntity( name, type, ... )
endif
let curpos = getpos(".")
let [enum,ecol] = searchpairpos( crex, '', '\(end\|}\)', 'wr' )
let [enum,ecol] = searchpairpos( crex, '', '\(end\|}\)', 'W' )
call cursor(lastpos[1], lastpos[2])
if lnum > enum
@ -253,15 +253,27 @@ class VimRubyCompletion
# {{{ buffer analysis magic
def load_requires
custom_paths = VIM::evaluate("get(g:, 'rubycomplete_load_paths', [])")
if !custom_paths.empty?
$LOAD_PATH.concat(custom_paths).uniq!
end
buf = VIM::Buffer.current
enum = buf.line_number
nums = Range.new( 1, enum )
nums.each do |x|
ln = buf[x]
begin
eval( "require %s" % $1 ) if /.*require\s*(.*)$/.match( ln )
rescue Exception
#ignore?
if /.*require_relative\s*(.*)$/.match( ln )
eval( "require %s" % File.expand_path($1) )
elsif /.*require\s*(["'].*?["'])/.match( ln )
eval( "require %s" % $1 )
end
rescue Exception => e
dprint e.inspect
end
end
end
@ -344,8 +356,13 @@ class VimRubyCompletion
if x != cur_line
next if x == 0
ln = buf[x]
if /^\s*(module|class|def|include)\s+/.match(ln)
clscnt += 1 if $1 == "class"
is_const = false
if /^\s*(module|class|def|include)\s+/.match(ln) || is_const = /^\s*?[A-Z]([A-z]|[1-9])*\s*?[|]{0,2}=\s*?.+\s*?/.match(ln)
clscnt += 1 if /class|module/.match($1)
# We must make sure to load each constant only once to avoid errors
if is_const
ln.gsub!(/\s*?[|]{0,2}=\s*?/, '||=')
end
#dprint "\$1$1
classdef += "%s\n" % ln
classdef += "end\n" if /def\s+/.match(ln)
@ -423,7 +440,6 @@ class VimRubyCompletion
return get_buffer_entity_list( "class" )
end
def load_rails
allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails")
return if allow_rails.to_i.zero?
@ -529,7 +545,6 @@ class VimRubyCompletion
ret += ActiveRecord::ConnectionAdapters::SchemaStatements.methods
end
return ret
end
@ -587,11 +602,13 @@ class VimRubyCompletion
# {{{ main completion code
def self.preload_rails
a = VimRubyCompletion.new
require 'Thread'
Thread.new(a) do |b|
begin
b.load_rails
rescue
if VIM::evaluate("has('nvim')") == 0
require 'thread'
Thread.new(a) do |b|
begin
b.load_rails
rescue
end
end
end
a.load_rails
@ -612,7 +629,6 @@ class VimRubyCompletion
want_gems = VIM::evaluate("get(g:, 'rubycomplete_load_gemfile')")
load_gems unless want_gems.to_i.zero?
input = VIM::Buffer.current.line
cpos = VIM::Window.current.cursor[1] - 1
@ -666,6 +682,7 @@ class VimRubyCompletion
message = Regexp.quote($4)
dprint "const or cls 2 [recv: \'%s\', msg: \'%s\']" % [ receiver, message ]
load_buffer_class( receiver )
load_buffer_module( receiver )
begin
classes = eval("#{receiver}.constants")
#methods = eval("#{receiver}.methods")
@ -786,7 +803,6 @@ class VimRubyCompletion
methods += Kernel.public_methods
end
include_object = VIM::evaluate("exists('g:rubycomplete_include_object') && g:rubycomplete_include_object")
methods = clean_sel( methods, message )
methods = (methods-Object.instance_methods) if include_object == "0"
@ -829,5 +845,4 @@ let s:rubycomplete_rails_loaded = 0
call s:DefRuby()
"}}} ruby-side code
" vim:tw=78:sw=4:ts=8:et:fdm=marker:ft=vim:norl:

415
runtime/autoload/rust.vim Normal file
View File

@ -0,0 +1,415 @@
" Author: Kevin Ballard
" Description: Helper functions for Rust commands/mappings
" Last Modified: May 27, 2014
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
" Jump {{{1
function! rust#Jump(mode, function) range
let cnt = v:count1
normal! m'
if a:mode ==# 'v'
norm! gv
endif
let foldenable = &foldenable
set nofoldenable
while cnt > 0
execute "call <SID>Jump_" . a:function . "()"
let cnt = cnt - 1
endwhile
let &foldenable = foldenable
endfunction
function! s:Jump_Back()
call search('{', 'b')
keepjumps normal! w99[{
endfunction
function! s:Jump_Forward()
normal! j0
call search('{', 'b')
keepjumps normal! w99[{%
call search('{')
endfunction
" Run {{{1
function! rust#Run(bang, args)
let args = s:ShellTokenize(a:args)
if a:bang
let idx = index(l:args, '--')
if idx != -1
let rustc_args = idx == 0 ? [] : l:args[:idx-1]
let args = l:args[idx+1:]
else
let rustc_args = l:args
let args = []
endif
else
let rustc_args = []
endif
let b:rust_last_rustc_args = l:rustc_args
let b:rust_last_args = l:args
call s:WithPath(function("s:Run"), rustc_args, args)
endfunction
function! s:Run(dict, rustc_args, args)
let exepath = a:dict.tmpdir.'/'.fnamemodify(a:dict.path, ':t:r')
if has('win32')
let exepath .= '.exe'
endif
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
let rustc_args = [relpath, '-o', exepath] + a:rustc_args
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
let output = s:system(pwd, shellescape(rustc) . " " . join(map(rustc_args, 'shellescape(v:val)')))
if output != ''
echohl WarningMsg
echo output
echohl None
endif
if !v:shell_error
exe '!' . shellescape(exepath) . " " . join(map(a:args, 'shellescape(v:val)'))
endif
endfunction
" Expand {{{1
function! rust#Expand(bang, args)
let args = s:ShellTokenize(a:args)
if a:bang && !empty(l:args)
let pretty = remove(l:args, 0)
else
let pretty = "expanded"
endif
call s:WithPath(function("s:Expand"), pretty, args)
endfunction
function! s:Expand(dict, pretty, args)
try
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
if a:pretty =~? '^\%(everybody_loops$\|flowgraph=\)'
let flag = '--xpretty'
else
let flag = '--pretty'
endif
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
let args = [relpath, '-Z', 'unstable-options', l:flag, a:pretty] + a:args
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
if v:shell_error
echohl WarningMsg
echo output
echohl None
else
new
silent put =output
1
d
setl filetype=rust
setl buftype=nofile
setl bufhidden=hide
setl noswapfile
" give the buffer a nice name
let suffix = 1
let basename = fnamemodify(a:dict.path, ':t:r')
while 1
let bufname = basename
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
let bufname .= '.pretty.rs'
if bufexists(bufname)
let suffix += 1
continue
endif
exe 'silent noautocmd keepalt file' fnameescape(bufname)
break
endwhile
endif
endtry
endfunction
function! rust#CompleteExpand(lead, line, pos)
if a:line[: a:pos-1] =~ '^RustExpand!\s*\S*$'
" first argument and it has a !
let list = ["normal", "expanded", "typed", "expanded,identified", "flowgraph=", "everybody_loops"]
if !empty(a:lead)
call filter(list, "v:val[:len(a:lead)-1] == a:lead")
endif
return list
endif
return glob(escape(a:lead, "*?[") . '*', 0, 1)
endfunction
" Emit {{{1
function! rust#Emit(type, args)
let args = s:ShellTokenize(a:args)
call s:WithPath(function("s:Emit"), a:type, args)
endfunction
function! s:Emit(dict, type, args)
try
let output_path = a:dict.tmpdir.'/output'
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
let args = [relpath, '--emit', a:type, '-o', output_path] + a:args
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
if output != ''
echohl WarningMsg
echo output
echohl None
endif
if !v:shell_error
new
exe 'silent keepalt read' fnameescape(output_path)
1
d
if a:type == "llvm-ir"
setl filetype=llvm
let extension = 'll'
elseif a:type == "asm"
setl filetype=asm
let extension = 's'
endif
setl buftype=nofile
setl bufhidden=hide
setl noswapfile
if exists('l:extension')
" give the buffer a nice name
let suffix = 1
let basename = fnamemodify(a:dict.path, ':t:r')
while 1
let bufname = basename
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
let bufname .= '.'.extension
if bufexists(bufname)
let suffix += 1
continue
endif
exe 'silent noautocmd keepalt file' fnameescape(bufname)
break
endwhile
endif
endif
endtry
endfunction
" Utility functions {{{1
" Invokes func(dict, ...)
" Where {dict} is a dictionary with the following keys:
" 'path' - The path to the file
" 'tmpdir' - The path to a temporary directory that will be deleted when the
" function returns.
" 'istemp' - 1 if the path is a file inside of {dict.tmpdir} or 0 otherwise.
" If {istemp} is 1 then an additional key is provided:
" 'tmpdir_relpath' - The {path} relative to the {tmpdir}.
"
" {dict.path} may be a path to a file inside of {dict.tmpdir} or it may be the
" existing path of the current buffer. If the path is inside of {dict.tmpdir}
" then it is guaranteed to have a '.rs' extension.
function! s:WithPath(func, ...)
let buf = bufnr('')
let saved = {}
let dict = {}
try
let saved.write = &write
set write
let dict.path = expand('%')
let pathisempty = empty(dict.path)
" Always create a tmpdir in case the wrapped command wants it
let dict.tmpdir = tempname()
call mkdir(dict.tmpdir)
if pathisempty || !saved.write
let dict.istemp = 1
" if we're doing this because of nowrite, preserve the filename
if !pathisempty
let filename = expand('%:t:r').".rs"
else
let filename = 'unnamed.rs'
endif
let dict.tmpdir_relpath = filename
let dict.path = dict.tmpdir.'/'.filename
let saved.mod = &mod
set nomod
silent exe 'keepalt write! ' . fnameescape(dict.path)
if pathisempty
silent keepalt 0file
endif
else
let dict.istemp = 0
update
endif
call call(a:func, [dict] + a:000)
finally
if bufexists(buf)
for [opt, value] in items(saved)
silent call setbufvar(buf, '&'.opt, value)
unlet value " avoid variable type mismatches
endfor
endif
if has_key(dict, 'tmpdir') | silent call s:RmDir(dict.tmpdir) | endif
endtry
endfunction
function! rust#AppendCmdLine(text)
call setcmdpos(getcmdpos())
let cmd = getcmdline() . a:text
return cmd
endfunction
" Tokenize the string according to sh parsing rules
function! s:ShellTokenize(text)
" states:
" 0: start of word
" 1: unquoted
" 2: unquoted backslash
" 3: double-quote
" 4: double-quoted backslash
" 5: single-quote
let l:state = 0
let l:current = ''
let l:args = []
for c in split(a:text, '\zs')
if l:state == 0 || l:state == 1 " unquoted
if l:c ==# ' '
if l:state == 0 | continue | endif
call add(l:args, l:current)
let l:current = ''
let l:state = 0
elseif l:c ==# '\'
let l:state = 2
elseif l:c ==# '"'
let l:state = 3
elseif l:c ==# "'"
let l:state = 5
else
let l:current .= l:c
let l:state = 1
endif
elseif l:state == 2 " unquoted backslash
if l:c !=# "\n" " can it even be \n?
let l:current .= l:c
endif
let l:state = 1
elseif l:state == 3 " double-quote
if l:c ==# '\'
let l:state = 4
elseif l:c ==# '"'
let l:state = 1
else
let l:current .= l:c
endif
elseif l:state == 4 " double-quoted backslash
if stridx('$`"\', l:c) >= 0
let l:current .= l:c
elseif l:c ==# "\n" " is this even possible?
" skip it
else
let l:current .= '\'.l:c
endif
let l:state = 3
elseif l:state == 5 " single-quoted
if l:c == "'"
let l:state = 1
else
let l:current .= l:c
endif
endif
endfor
if l:state != 0
call add(l:args, l:current)
endif
return l:args
endfunction
function! s:RmDir(path)
" sanity check; make sure it's not empty, /, or $HOME
if empty(a:path)
echoerr 'Attempted to delete empty path'
return 0
elseif a:path == '/' || a:path == $HOME
echoerr 'Attempted to delete protected path: ' . a:path
return 0
endif
return system("rm -rf " . shellescape(a:path))
endfunction
" Executes {cmd} with the cwd set to {pwd}, without changing Vim's cwd.
" If {pwd} is the empty string then it doesn't change the cwd.
function! s:system(pwd, cmd)
let cmd = a:cmd
if !empty(a:pwd)
let cmd = 'cd ' . shellescape(a:pwd) . ' && ' . cmd
endif
return system(cmd)
endfunction
" Playpen Support {{{1
" Parts of gist.vim by Yasuhiro Matsumoto <mattn.jp@gmail.com> reused
" gist.vim available under the BSD license, available at
" http://github.com/mattn/gist-vim
function! s:has_webapi()
if !exists("*webapi#http#post")
try
call webapi#http#post()
catch
endtry
endif
return exists("*webapi#http#post")
endfunction
function! rust#Play(count, line1, line2, ...) abort
redraw
let l:rust_playpen_url = get(g:, 'rust_playpen_url', 'https://play.rust-lang.org/')
let l:rust_shortener_url = get(g:, 'rust_shortener_url', 'https://is.gd/')
if !s:has_webapi()
echohl ErrorMsg | echomsg ':RustPlay depends on webapi.vim (https://github.com/mattn/webapi-vim)' | echohl None
return
endif
let bufname = bufname('%')
if a:count < 1
let content = join(getline(a:line1, a:line2), "\n")
else
let save_regcont = @"
let save_regtype = getregtype('"')
silent! normal! gvy
let content = @"
call setreg('"', save_regcont, save_regtype)
endif
let body = l:rust_playpen_url."?code=".webapi#http#encodeURI(content)
if strlen(body) > 5000
echohl ErrorMsg | echomsg 'Buffer too large, max 5000 encoded characters ('.strlen(body).')' | echohl None
return
endif
let payload = "format=simple&url=".webapi#http#encodeURI(body)
let res = webapi#http#post(l:rust_shortener_url.'create.php', payload, {})
let url = res.content
redraw | echomsg 'Done: '.url
endfunction
" }}}1
" vim: set noet sw=8 ts=8:

View File

@ -0,0 +1,107 @@
" Author: Stephen Sugden <stephen@stephensugden.com>
"
" Adapted from https://github.com/fatih/vim-go
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
if !exists("g:rustfmt_autosave")
let g:rustfmt_autosave = 0
endif
if !exists("g:rustfmt_command")
let g:rustfmt_command = "rustfmt"
endif
if !exists("g:rustfmt_options")
let g:rustfmt_options = ""
endif
if !exists("g:rustfmt_fail_silently")
let g:rustfmt_fail_silently = 0
endif
let s:got_fmt_error = 0
function! s:RustfmtCommandRange(filename, line1, line2)
let l:arg = {"file": shellescape(a:filename), "range": [a:line1, a:line2]}
return printf("%s %s --write-mode=overwrite --file-lines '[%s]'", g:rustfmt_command, g:rustfmt_options, json_encode(l:arg))
endfunction
function! s:RustfmtCommand(filename)
return g:rustfmt_command . " --write-mode=overwrite " . g:rustfmt_options . " " . shellescape(a:filename)
endfunction
function! s:RunRustfmt(command, curw, tmpname)
if exists("*systemlist")
let out = systemlist(a:command)
else
let out = split(system(a:command), '\r\?\n')
endif
if v:shell_error == 0 || v:shell_error == 3
" remove undo point caused via BufWritePre
try | silent undojoin | catch | endtry
" Replace current file with temp file, then reload buffer
call rename(a:tmpname, expand('%'))
silent edit!
let &syntax = &syntax
" only clear location list if it was previously filled to prevent
" clobbering other additions
if s:got_fmt_error
let s:got_fmt_error = 0
call setloclist(0, [])
lwindow
endif
elseif g:rustfmt_fail_silently == 0
" otherwise get the errors and put them in the location list
let errors = []
for line in out
" src/lib.rs:13:5: 13:10 error: expected `,`, or `}`, found `value`
let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\):\s*\(\d\+:\d\+\s*\)\?\s*error: \(.*\)')
if !empty(tokens)
call add(errors, {"filename": @%,
\"lnum": tokens[2],
\"col": tokens[3],
\"text": tokens[5]})
endif
endfor
if empty(errors)
% | " Couldn't detect rustfmt error format, output errors
endif
if !empty(errors)
call setloclist(0, errors, 'r')
echohl Error | echomsg "rustfmt returned error" | echohl None
endif
let s:got_fmt_error = 1
lwindow
" We didn't use the temp file, so clean up
call delete(a:tmpname)
endif
call winrestview(a:curw)
endfunction
function! rustfmt#FormatRange(line1, line2)
let l:curw = winsaveview()
let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
call writefile(getline(1, '$'), l:tmpname)
let command = s:RustfmtCommandRange(l:tmpname, a:line1, a:line2)
call s:RunRustfmt(command, l:curw, l:tmpname)
endfunction
function! rustfmt#Format()
let l:curw = winsaveview()
let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
call writefile(getline(1, '$'), l:tmpname)
let command = s:RustfmtCommand(l:tmpname)
call s:RunRustfmt(command, l:curw, l:tmpname)
endfunction

View File

@ -45,7 +45,7 @@ call map(copy(s:SHADA_ENTRY_NAMES),
let s:SHADA_MAP_ENTRIES = {
\'search_pattern': ['sp', 'sh', 'ss', 'sb', 'sm', 'sc', 'sl', 'se', 'so',
\ 'su'],
\'register': ['n', 'rc', 'rw', 'rt'],
\'register': ['n', 'rc', 'rw', 'rt', 'ru'],
\'global_mark': ['n', 'f', 'l', 'c'],
\'local_mark': ['f', 'n', 'l', 'c'],
\'jump': ['f', 'l', 'c'],
@ -139,6 +139,7 @@ let s:SHADA_STANDARD_KEYS = {
\'rt': ['type', 'regtype', s:SHADA_ENUMS.regtype.CHARACTERWISE],
\'rw': ['block width', 'uint', 0],
\'rc': ['contents', 'binarray', s:SHADA_REQUIRED],
\'ru': ['is_unnamed', 'boolean', g:msgpack#false],
\'n': ['name', 'intchar', char2nr('"')],
\'l': ['line number', 'uint', 1],
\'c': ['column', 'uint', 0],

View File

@ -20,6 +20,7 @@ function! spellfile#LoadFile(lang)
endif
return
endif
let lang = tolower(a:lang)
" If the URL changes we try all files again.
if s:spellfile_URL != g:spellfile_URL
@ -28,13 +29,13 @@ function! spellfile#LoadFile(lang)
endif
" I will say this only once!
if has_key(s:donedict, a:lang . &enc)
if has_key(s:donedict, lang . &enc)
if &verbose
echomsg 'spellfile#LoadFile(): Tried this language/encoding before.'
endif
return
endif
let s:donedict[a:lang . &enc] = 1
let s:donedict[lang . &enc] = 1
" Find spell directories we can write in.
let [dirlist, dirchoices] = spellfile#GetDirChoices()
@ -88,13 +89,13 @@ function! spellfile#LoadFile(lang)
endif
endif
if newbufnr == winbufnr(0)
" We are back the old buffer, remove any (half-finished) download.
g/^/d_
" We are back to the old buffer, remove any (half-finished) download.
keeppatterns g/^/d_
else
let newbufnr = winbufnr(0)
endif
let fname = a:lang . '.ascii.spl'
let fname = lang . '.ascii.spl'
echo 'Could not find it, trying ' . fname . '...'
call spellfile#Nread(fname)
if getline(2) !~ 'VIMspell'
@ -127,7 +128,7 @@ function! spellfile#LoadFile(lang)
exe "write " . dirname . '/' . fname
" Also download the .sug file.
g/^/d_
keeppatterns g/^/d_
let fname = substitute(fname, '\.spl$', '.sug', '')
echo 'Downloading ' . fname . '...'
call spellfile#Nread(fname)
@ -194,16 +195,6 @@ function! spellfile#GetDirChoices()
endfunc
function! spellfile#WritableSpellDir()
" Always use the $XDG_DATA_HOME/nvim/site directory
if exists('$XDG_DATA_HOME')
return $XDG_DATA_HOME . "/nvim/site/spell"
else
return $HOME . "/.local/share/nvim/site/spell"
endif
for dir in split(&rtp, ',')
if filewritable(dir) == 2
return dir . "/spell"
endif
endfor
return ''
" Always use the $XDG_DATA_HOME//site directory
return stdpath('data').'/site/spell'
endfunction

View File

@ -2,7 +2,7 @@
" Language: SQL
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
" Version: 16.0
" Last Change: 2015 Dec 29
" Last Change: 2017 Oct 15
" Homepage: http://www.vim.org/scripts/script.php?script_id=1572
" Usage: For detailed help
" ":help sql.txt"

View File

@ -2,7 +2,7 @@
" Language: All languages, uses existing syntax highlighting rules
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
" Version: 13.0
" Last Change: 2013 May 14
" Last Change: 2019 Aug 08
" Usage: For detailed help, ":help ft-syntax-omni"
" History
@ -597,7 +597,7 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
" Remove all non-word characters
" let syn_list = substitute( syn_list, '\<match /\zs.\{-}\<\W\+\>.\{-}\ze\/ ', "", 'g' )
" let syn_list = substitute( syn_list, '\%(\<match \/[^/]\{-}\)\@<=\W\+\ze.\{-}\/ ', ' ', 'g' )
" Do this by using the outer substitue() call to gather all
" Do this by using the outer substitute() call to gather all
" text between the match /.../ tags.
" The inner substitute() call operates on the text selected
" and replaces all non-word characters.

View File

@ -152,10 +152,12 @@ fun! tar#Browse(tarfile)
" assuming cygwin
let tarfile=substitute(system("cygpath -u ".shellescape(tarfile,0)),'\n$','','e')
endif
let curlast= line("$")
if tarfile =~# '\.\(gz\|tgz\)$'
let gzip_command = s:get_gzip_command(tarfile)
" call Decho("1: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
exe "sil! r! " . gzip_command . " -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
elseif tarfile =~# '\.lrp'
" call Decho("2: exe silent r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - ")
exe "sil! r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - "
@ -287,12 +289,14 @@ fun! tar#Read(fname,mode)
else
let tar_secure= " "
endif
if tarfile =~# '\.bz2$'
" call Decho("7: exe silent r! bzip2 -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp)
exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
elseif tarfile =~# '\.\(gz\|tgz\)$'
let gzip_command = s:get_gzip_command(tarfile)
" call Decho("5: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd.' -'.g:tar_readoptions.' - '.tar_secure.shellescape(fname,1))
exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "sil! r! " . gzip_command . " -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
elseif tarfile =~# '\.lrp$'
" call Decho("6: exe silent r! cat ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp)
exe "sil! r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
@ -389,6 +393,8 @@ fun! tar#Write(fname)
let tarfile = substitute(b:tarfile,'tarfile:\(.\{-}\)::.*$','\1','')
let fname = substitute(b:tarfile,'tarfile:.\{-}::\(.*\)$','\1','')
let gzip_command = s:get_gzip_command(tarfile)
" handle compressed archives
if tarfile =~# '\.bz2'
call system("bzip2 -d -- ".shellescape(tarfile,0))
@ -396,12 +402,12 @@ fun! tar#Write(fname)
let compress= "bzip2 -- ".shellescape(tarfile,0)
" call Decho("compress<".compress.">")
elseif tarfile =~# '\.gz'
call system("gzip -d -- ".shellescape(tarfile,0))
call system(gzip_command . " -d -- ".shellescape(tarfile,0))
let tarfile = substitute(tarfile,'\.gz','','e')
let compress= "gzip -- ".shellescape(tarfile,0)
" call Decho("compress<".compress.">")
elseif tarfile =~# '\.tgz'
call system("gzip -d -- ".shellescape(tarfile,0))
call system(gzip_command . " -d -- ".shellescape(tarfile,0))
let tarfile = substitute(tarfile,'\.tgz','.tar','e')
let compress= "gzip -- ".shellescape(tarfile,0)
let tgz = 1
@ -581,7 +587,10 @@ fun! tar#Vimuntar(...)
" if necessary, decompress the tarball; then, extract it
if tartail =~ '\.tgz'
if executable("gunzip")
let gzip_command = s:get_gzip_command(tarfile)
if executable(gzip_command)
silent exe "!" . gzip_command . " -d ".shellescape(tartail)
elseif executable("gunzip")
silent exe "!gunzip ".shellescape(tartail)
elseif executable("gzip")
silent exe "!gzip -d ".shellescape(tartail)
@ -619,6 +628,28 @@ fun! tar#Vimuntar(...)
" call Dret("tar#Vimuntar")
endfun
func s:get_gzip_command(file)
" Try using the "file" command to get the actual compression type, since
" there is no standard way for the naming: ".tgz", ".tbz", ".txz", etc.
" If the "file" command doesn't work fall back to just using the file name.
if a:file =~# 'z$'
let filetype = system('file ' . a:file)
if filetype =~ 'bzip2 compressed' && executable('bzip2')
return 'bzip2'
endif
if filetype =~ 'XZ compressed' && executable('xz')
return 'xz'
endif
endif
if a:file =~# 'bz2$'
return 'bzip2'
endif
if a:file =~# 'xz$'
return 'xz'
endif
return 'gzip'
endfunc
" =====================================================================
" Modelines And Restoration: {{{1
let &cpo= s:keepcpo

View File

@ -1,6 +1,6 @@
" Vim autoload file for the tohtml plugin.
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
" Last Change: 2013 Sep 03
" Last Change: 2018 Nov 11
"
" Additional contributors:
"
@ -544,12 +544,16 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
" add required javascript in reverse order so we can just call append again
" and again without adjusting {{{
" insert script closing tag
call append(style_start, [
\ '',
\ s:settings.use_xhtml ? '//]]>' : '-->',
\ "</script>"
\ ])
let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids || !empty(s:settings.prevent_copy)
" insert script closing tag if needed
if s:uses_script
call append(style_start, [
\ '',
\ s:settings.use_xhtml ? '//]]>' : '-->',
\ "</script>"
\ ])
endif
" insert script which corrects the size of small input elements in
" prevent_copy mode. See 2html.vim for details on why this is needed and how
@ -575,55 +579,61 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
\ '}'
\ ])
endif
"
" insert javascript to get IDs from line numbers, and to open a fold before
" jumping to any lines contained therein
call append(style_start, [
\ " /* Always jump to new location even if the line was hidden inside a fold, or",
\ " * we corrected the raw number to a line ID.",
\ " */",
\ " if (lineElem) {",
\ " lineElem.scrollIntoView(true);",
\ " }",
\ " return true;",
\ "}",
\ "if ('onhashchange' in window) {",
\ " window.onhashchange = JumpToLine;",
\ "}"
\ ])
if s:settings.dynamic_folds
if s:settings.line_ids
call append(style_start, [
\ " /* Always jump to new location even if the line was hidden inside a fold, or",
\ " * we corrected the raw number to a line ID.",
\ " */",
\ " if (lineElem) {",
\ " lineElem.scrollIntoView(true);",
\ " }",
\ " return true;",
\ "}",
\ "if ('onhashchange' in window) {",
\ " window.onhashchange = JumpToLine;",
\ "}"
\ ])
if s:settings.dynamic_folds
call append(style_start, [
\ "",
\ " /* navigate upwards in the DOM tree to open all folds containing the line */",
\ " var node = lineElem;",
\ " while (node && node.id != 'vimCodeElement".s:settings.id_suffix."')",
\ " {",
\ " if (node.className == 'closed-fold')",
\ " {",
\ " /* toggle open the fold ID (remove window ID) */",
\ " toggleFold(node.id.substr(4));",
\ " }",
\ " node = node.parentNode;",
\ " }",
\ ])
endif
endif
if s:settings.line_ids
call append(style_start, [
\ "",
\ " /* navigate upwards in the DOM tree to open all folds containing the line */",
\ " var node = lineElem;",
\ " while (node && node.id != 'vimCodeElement".s:settings.id_suffix."')",
\ " {",
\ " if (node.className == 'closed-fold')",
\ " {",
\ " /* toggle open the fold ID (remove window ID) */",
\ " toggleFold(node.id.substr(4));",
\ " }",
\ " node = node.parentNode;",
\ "/* function to open any folds containing a jumped-to line before jumping to it */",
\ "function JumpToLine()",
\ "{",
\ " var lineNum;",
\ " lineNum = window.location.hash;",
\ " lineNum = lineNum.substr(1); /* strip off '#' */",
\ "",
\ " if (lineNum.indexOf('L') == -1) {",
\ " lineNum = 'L'+lineNum;",
\ " }",
\ " if (lineNum.indexOf('W') == -1) {",
\ " lineNum = 'W1'+lineNum;",
\ " }",
\ " var lineElem = document.getElementById(lineNum);"
\ ])
endif
call append(style_start, [
\ "",
\ "/* function to open any folds containing a jumped-to line before jumping to it */",
\ "function JumpToLine()",
\ "{",
\ " var lineNum;",
\ " lineNum = window.location.hash;",
\ " lineNum = lineNum.substr(1); /* strip off '#' */",
\ "",
\ " if (lineNum.indexOf('L') == -1) {",
\ " lineNum = 'L'+lineNum;",
\ " }",
\ " if (lineNum.indexOf('W') == -1) {",
\ " lineNum = 'W1'+lineNum;",
\ " }",
\ " lineElem = document.getElementById(lineNum);"
\ ])
" Insert javascript to toggle matching folds open and closed in all windows,
" if dynamic folding is active.
@ -648,11 +658,13 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
\ ])
endif
" insert script tag; javascript is always needed for the line number
" normalization for URL hashes
call append(style_start, [
\ "<script type='text/javascript'>",
\ s:settings.use_xhtml ? '//<![CDATA[' : "<!--"])
if s:uses_script
" insert script tag; javascript is always needed for the line number
" normalization for URL hashes
call append(style_start, [
\ "<script type='text/javascript'>",
\ s:settings.use_xhtml ? '//<![CDATA[' : "<!--"])
endif
" Insert styles from all the generated html documents and additional styles
" for the table-based layout of the side-by-side diff. The diff should take
@ -767,7 +779,7 @@ func! tohtml#GetUserSettings() "{{{
if user_settings.no_pre == 0
call tohtml#GetOption(user_settings,
\ 'expand_tabs',
\ &expandtab || &ts != 8 || user_settings.number_lines ||
\ &expandtab || &ts != 8 || (exists("+vts") && &vts != '') || user_settings.number_lines ||
\ (user_settings.dynamic_folds && !user_settings.no_foldcolumn))
else
let user_settings.expand_tabs = 1

Some files were not shown because too many files have changed in this diff Show More