Commit Graph

14593 Commits

Author SHA1 Message Date
Daniel Hahler
f96d1e6bc4
tui: fix handling of bg response after suspend (#11145)
`tui_terminal_after_startup` gets called right after resuming from
suspending (via `Ctrl-z`) already (not delayed as with the startup
itself), and would set `waiting_for_bg_response` to false then directly.
This results in the terminal response not being processed then anymore,
and leaking into Neovim itself.

This changes it to try 5 times always, which means that it typically
would stop after a few characters of input from the user typically, e.g.
with tmux, which does not send a reply.

While it might be better to have something based on the time (e.g. only
wait for max 1s), this appears to be easier to do.

Fixes regression in 8a4ae3d.
2019-10-03 08:04:24 +02:00
Justin M. Keyes
30479417e8
Merge #11087 from janlazo/vim-8.1.0010
vim-patch:8.1.{10,230,315,330,514,517,518,1327,1347,1758,2072,2074,2091,2095,2103}
2019-10-02 22:43:59 -07:00
Daniel Hahler
b069e9b20f tests: unit: NVIM_TEST_TRACE_LEVEL: default to 0 #11144
Traces are not useful normally (unless debugging/fixing tests), but only add
overhead.  Disable them by default.
2019-10-02 22:41:57 -07:00
Daniel Hahler
3d3c783fea
ci: Travis: simplify 32bit build (#11093)
- `CMAKE_SYSTEM_LIBRARY_PATH` should not be used, and is a
  semicolon-separated list anyway [1]

1: https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_LIBRARY_PATH.html
2019-10-03 05:40:25 +02:00
Jan Edmund Lazo
4518f230fa
vim-patch:8.1.0330: the qf_add_entries() function is too long
Problem:    The qf_add_entries() function is too long.
Solution:   Split in two parts. (Yegappan Lakshmanan)
6f6ef7c195
2019-10-02 00:52:22 -04:00
Daniel Hahler
0c1be45ea0
shell: improve displaying of pulse (#11130)
- output "[...]" to indicate throttling is being used, instead of just
  an empty line
- go to beginning of line after displaying the pulse, so that following
  output is displayed over it
2019-10-02 06:26:57 +02:00
Daniel Hahler
333dc3d138
Fix flaky test: tui_spec: increase timeout (#11134)
Meant to fix:

    [  ERROR   ] test/functional/terminal/tui_spec.lua @ 925: TUI FocusGained/FocusLost in terminal-mode
    test/functional/ui/screen.lua:587: Row 6 did not match.
    Expected:
      |{1:r}eady $                                           |
      |[Process exited 0]                                |
      |                                                  |
      |                                                  |
      |                                                  |
      |*gained                                            |
      |{3:-- TERMINAL --}                                    |
    Actual:
      |{1:r}eady $                                           |
      |[Process exited 0]                                |
      |                                                  |
      |                                                  |
      |                                                  |
      |*:terminal                                         |
      |{3:-- TERMINAL --}                                    |

    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/terminal/tui_spec.lua:934: in function <test/functional/terminal/tui_spec.lua:925>

I've thought about adding this, but it might not be really relevant, and
slows down the tests a bit (and a warning "warning: Screen test
succeeded immediately" with another test):

```diff
diff --git i/test/functional/terminal/tui_spec.lua w/test/functional/terminal/tui_spec.lua
index ada073c4e..4bc2ab4e0 100644
--- i/test/functional/terminal/tui_spec.lua
+++ w/test/functional/terminal/tui_spec.lua
@@ -818,6 +818,11 @@ describe('TUI FocusGained/FocusLost', function()
       ..'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile noshowcmd noruler"]')
     feed_data(":autocmd FocusGained * echo 'gained'\n")
     feed_data(":autocmd FocusLost * echo 'lost'\n")
+    -- Wait for autocommand to be registered.
+    retry(nil, nil, function()
+      feed_data(":autocmd FocusLost\n")
+      screen:expect{any="         echo 'lost'"}
+    end)
     feed_data("\034\016")  -- CTRL-\ CTRL-N
   end)
```
2019-10-02 04:56:22 +02:00
Jan Edmund Lazo
ada2ec4416
vim-patch:8.1.0315: helpgrep with language doesn't work properly
Problem:    Helpgrep with language doesn't work properly. (Takuya Fujiwara)
Solution:   Check for the language earlier. (Hirohito Higashi)
c631f2df62
2019-10-01 22:27:45 -04:00
Jan Edmund Lazo
efef797126
vim-patch:8.1.2103: wrong error message if "termdebugger" is not executable
Problem:    wrong error message if "termdebugger" is not executable.
Solution:   Check if "termdebugger" is executable and give a clear error
            message. (Ozaki Kiichi, closes vim/vim#5000)  Fix indents.
18223a592e
2019-10-01 22:27:45 -04:00
Jan Edmund Lazo
655085204e
vim-patch:8.1.0230: directly checking 'buftype' value
Problem:    Directly checking 'buftype' value.
Solution:   Add the bt_normal() function. (Yegappan Lakshmanan)
91335e5a67
2019-10-01 22:27:45 -04:00
Jan Edmund Lazo
8b67c8f8c6
vim-patch:8.1.2095: leaking memory when getting item from dict
Problem:    Leaking memory when getting item from dict.
Solution:   Also free the key when not evaluating.
a893194d91
2019-10-01 22:27:44 -04:00
Jan Edmund Lazo
74947203af
vim-patch:8.1.2091: double free when memory allocation fails
Problem:    Double free when memory allocation fails. (Zu-Ming Jiang)
Solution:   Use VIM_CLEAR() instead of vim_free(). (closes vim/vim#4991)
0f1c6708fd
2019-10-01 22:27:44 -04:00
Jan Edmund Lazo
56c860ac4a
quickfix: fix pvs/v547 errors 2019-10-01 22:27:44 -04:00
Jan Edmund Lazo
8732cce315
vim-patch:8.1.2074: test for SafeState autocommand is a bit flaky
Problem:    Test for SafeState autocommand is a bit flaky.
Solution:   Add to list of flaky tests.
0d0c3ca007
2019-10-01 22:27:44 -04:00
Jan Edmund Lazo
1f4c9da9c6
test: fix screen assertions 2019-10-01 22:27:44 -04:00
Jan Edmund Lazo
90c2abc53f
vim-patch:8.1.1347: fractional scroll position not restored after closing window
Problem:    Fractional scroll position not restored after closing window.
Solution:   Do restore fraction if topline is not one.
bd2d68c2f4
2019-10-01 22:27:44 -04:00
Jan Edmund Lazo
6ed20ff25c
vim-patch:8.1.1327: unnecessary scroll after horizontal split
Problem:    Unnecessary scroll after horizontal split.
Solution:   Don't adjust to fraction if all the text fits in the window.
            (Martin Kunev, closes vim/vim#4367)
a9b2535f44
2019-10-01 22:27:43 -04:00
Jan Edmund Lazo
e8144d204c
vim-patch:8.1.0518: Test_window_split_edit_bufnr() fails on AppVeyor
Problem:    Test_window_split_edit_bufnr() fails on AppVeyor.
Solution:   Disable the failing part for now.
8617b40159
2019-10-01 22:27:43 -04:00
Jan Edmund Lazo
14f3287b98
vim-patch:8.1.0517: Test_window_split_edit_alternate() fails on AppVeyor
Problem:    Test_window_split_edit_alternate() fails on AppVeyor.
Solution:   Disable the failing part for now.
d42333d8e9
2019-10-01 22:27:43 -04:00
Jan Edmund Lazo
17e96d96ba
vim-patch:8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Problem:    CTRL-W ^ does not work when alternate buffer has no name.
Solution:   Use another method to split and edit the alternate buffer. (Jason
            Franklin)
1bbb619483
2019-10-01 22:27:43 -04:00
Jan Edmund Lazo
8d0bc3c189
vim-patch:8.1.1758: count of g$ not used correctly when text is not wrapped
Problem:    Count of g$ not used correctly when text is not wrapped.
Solution:   Do use the count. (Christian Brabandt, closes vim/vim#4729, closes vim/vim#4566)
d5c8234517
2019-10-01 22:27:43 -04:00
Jan Edmund Lazo
24c4d4e125
vim-patch:8.1.2072: "gk" moves to start of line instead of upwards
Problem:    "gk" moves to start of line instead of upwards.
Solution:   Fix off-by-one error. (Christian Brabandt, closes vim/vim#4969)
03ac52fc02
2019-10-01 22:27:43 -04:00
Jan Edmund Lazo
0253f0cd92
vim-patch:8.1.0010: efm_to_regpat() is too long
Problem:    efm_to_regpat() is too long.
Solution:   Split off three functions. (Yegappan Lakshmanan, closes vim/vim#2924)
6bff719f7e
2019-10-01 22:27:42 -04:00
Daniel Hahler
8e25cf3881
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-02 04:07:10 +02:00
Daniel Hahler
b7d6caaa03 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-02 03:51:46 +02:00
Daniel Hahler
30ae60e7ca
Fix/revisit git-describe enhancement (#11124)
* Fix/keep massaging git-describe result

Ref: https://github.com/neovim/neovim/pull/11117#issuecomment-536416223

* build: revisit generation of version from Git

Fixes "make clean && make", where "auto/versiondef.h" would be missing
since b18b84d - because BYPRODUCTS are apparently removed when cleaning.

This includes the following improvements/changes:

- do not run git-describe during CMake's configure phase just for
  reporting
- do not print with changed Git version (too noisy, simplifies code)

* Move to src/nvim (included before config) for easier flow

* fallback to describe always, write empty include file

* update_version_stamp.lua: use prefix always
2019-10-02 03:45:59 +02:00
Daniel Hahler
ac32426b94
build: get rid of warnings with cmake --debug-output (#11131) 2019-10-02 03:44:57 +02:00
Daniel Hahler
8a4ae3d664
tui: improve handle_background_color: short-circuit (#11067)
* handle_background_color: short-circuit if handled already

* Unit tests for handle_background_color

* set waiting_for_bg_response to false in tui_terminal_after_startup
  By then it should have been received.
2019-09-30 22:00:55 +02:00
Björn Linse
7e46fcaf23
Merge pull request #11121 from bfredl/invalidcell
screen: don't crash on invalid cells being recomposed (tui_raw_line assert)
2019-09-30 20:32:59 +02:00
Björn Linse
dd26bd5974 screen: don't crash on invalid grid cells being recomposed 2019-09-30 19:05:54 +02:00
Daniel Hahler
dc52458522
third-party: upgrade libluv: 1.30.0-0 => 1.30.1-1 (#11092)
Changes: https://github.com/luvit/luv/compare/1.30.0-0...1.30.1-1
2019-09-30 12:55:47 +02:00
Daniel Hahler
179c46a016
provider#pythonx: resolve/expand exe from host var (#11047)
This reverts part of ade88fe4c [1].

This is required for `let g:python3_host_prog = 'python'` etc, where it
should get picked up from PATH.

Without this it would show:

```
  - INFO: pyenv: Path: /home/user/.pyenv/libexec/pyenv
  - INFO: pyenv: Root: /home/user/.pyenv
  - INFO: Using: g:python3_host_prog = "python"
  - ERROR: "python" was not found.
  - INFO: Executable: Not found
  - ERROR: Detected pip upgrade failure: Python executable can import "pynvim" but not "neovim": python
    - ADVICE:
      - Use that Python version to reinstall "pynvim" and optionally "neovim".
          pip3 uninstall pynvim neovim
          pip3 install pynvim
          pip3 install neovim  # only if needed by third-party software
```

Note that it additionally causes a weird error
("Detected pip upgrade failure"), due to `s:check_bin` emptying
`python_exe` (because the non-absolute file not being readable), and
`provider#pythonx#DetectByModule('pynvim', a:version)` from 75593e6fce
then just getting the value from the host var again (without actual
checks).
This is implicitly fixed via this patch now (because it is skipped), but
could need some improvement in this regard probably.

With this patch it resolves it (for a virtualenv where pynvim is not
made available intentionally):
```
  - INFO: pyenv: Path: /home/daniel/.pyenv/libexec/pyenv
  - INFO: pyenv: Root: /home/daniel/.pyenv
  - INFO: Using: g:python3_host_prog = "python"
  - 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: /home/daniel/.pyenv/shims/tmp-system-deoplete.nvim-f205aF/python
  - ERROR: Command error (job=11, exit code 1): `'/home/daniel/.pyenv/shims/tmp-system-deoplete.nvim-f205aF/python' -c 'import sys; sys.path.remove(""); import neovim; print(neovim.__file__)'` (in '/home/daniel/.dotfiles/vim/plugged/deoplete.nvim')
    Output: Traceback (most recent call last):  File "<string>", line 1, in <module>ModuleNotFoundError: No module named 'neovim'
    Stderr: Traceback (most recent call last):  File "<string>", line 1, in <module>ModuleNotFoundError: No module named 'neovim'
  - INFO: Python version: 3.7.4
  - INFO: pynvim version: unable to load neovim Python module
  - ERROR: pynvim is not installed.
    Error: unable to load neovim Python module
    - ADVICE:
      - Run in shell: pip3 install pynvim

```

Note: this appears to display the error twice via "Output:" and
"Stderr:".

1: https://github.com/neovim/neovim/pull/8784
2019-09-30 12:52:04 +02:00
Daniel Hahler
b0f5441c5e
bundle: upgrade LuaJIT to latest v2.1 (#10321) 2019-09-30 12:50:22 +02:00
Daniel Hahler
b18b84df5e
build: run git-describe for dev version during build (#11117)
This avoids invoking CMake after a new commit, which might take 15s on
some systems.

Skipped on CMake < 3.2.0 (missing BYPRODUCTS support).

Co-Authored-By: Justin M. Keyes <justinkz@gmail.com>
2019-09-30 00:10:29 +02:00
Björn Linse
ce637d0ef1
Merge pull request #11115 from bfredl/wildmenumode
cmdline: wildmenumode() should be true with wildoptions+=pum
2019-09-29 15:55:18 +02:00
Daniel Hahler
0a2a1e241f
cmake: use LibFindMacros for utf8proc (#11114)
Also update doc.
2019-09-29 04:44:02 +02:00
Daniel Hahler
34d55f8607
terminfo_start: keep first flushing of ui buffer (#11118)
Initially done in 3626d2107 (#11074, for #11062), it was reverted then
in 445f2f409 (#11083, which added flushing later).

But it is still required here to avoid the reporting of the background
response with urxvt/kitty (`nvim -u NONE -cq`).
Apparently I've tested this not enough with 445f2f409 (probably only within tmux).
2019-09-29 03:06:36 +02:00
Björn Linse
0636b25f28 cmdline: wildmenumode() should be true with wildoptions+=pum 2019-09-28 21:00:27 +02:00
Björn Linse
e933426299
Merge pull request #10124 from bfredl/tree-sitter-api
Tree-sitter step 1: vendor runtime lib + add lua API
2019-09-28 18:35:02 +02:00
Björn Linse
9fa850991d tree-sitter: improve and cleanup tests 2019-09-28 17:46:25 +02:00
Björn Linse
c844f986d4 tree-sitter: use "module" pattern in lua source 2019-09-28 17:46:25 +02:00
Björn Linse
d5a69eb076 tree-sitter: handle node equality 2019-09-28 17:46:25 +02:00
Björn Linse
3ffcb477ef tree-sitter: start docs 2019-09-28 17:46:25 +02:00
Björn Linse
e0d6228978 tree-sitter: use "range" instead of "point_range" consistently in lua API 2019-09-28 17:46:25 +02:00
Björn Linse
f86a2c33a2 tree-sitter: simplify editing using the new old_byte_size parameter 2019-09-28 17:46:25 +02:00
Björn Linse
06ee45b9b1 tree-sitter: fix lint, delete "demo" plugin (replaced by functional tests) 2019-09-28 17:46:25 +02:00
Björn Linse
167a1cfdef tree-sitter: improve parser API (shared parser between plugins) 2019-09-28 14:55:43 +02:00
Björn Linse
d697841a9d tree-sitter: cleanup tree refcounting 2019-09-28 14:55:43 +02:00
Björn Linse
d24dec596c tree-sitter: inspect language 2019-09-28 14:55:43 +02:00
Björn Linse
a88a9f128e tree-sitter: add some more API 2019-09-28 14:55:43 +02:00