Commit Graph

3075 Commits

Author SHA1 Message Date
Björn Linse 9e9dcd4bd7
Merge pull request #11113 from bfredl/tree-sitter-query
tree-sitter step 2: query API and  highlighting prototype
2019-12-22 13:47:45 +01:00
Björn Linse 440695c296 tree-sitter: implement query functionality and highlighting prototype [skip.lint] 2019-12-22 12:51:46 +01:00
Daniel Hahler e1d63c180c
tests: ex_terminal_spec: retry ":terminal (with fake shell)" (#11588)
Flaky failure (Travis CI, macOS):

    [ RUN      ] :terminal (with fake shell) works with gf: 10518.41 ms FAIL
    test/functional/terminal/ex_terminal_spec.lua:248: Row 1 did not match.
    Expected:
      |*^ready $ echo "scripts/shadacat.py"                |
      |*                                                  |
      |*[Process exited 0]                                |
      |:terminal echo "scripts/shadacat.py"              |
    Actual:
      |*^                                                  |
      |*[Process exited 0]                                |
      |*                                                  |
      |:terminal echo "scripts/shadacat.py"              |
    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:579: in function '_wait'
            test/functional/ui/screen.lua:361: in function 'expect'
            test/functional/terminal/ex_terminal_spec.lua:248: in function <test/functional/terminal/ex_terminal_spec.lua:245>
2019-12-22 11:23:39 +01:00
Matthieu Coudron 65aca4d857 TUI: can make the cursor transparent #11519
when setting 'guicursor' highlight blend=100.
2019-12-19 12:27:21 -08:00
Jan Edmund Lazo ad5049aa60
vim-patch:8.2.0010: test64 is old style
Problem:    Test64 is old style.
Solution:   Convert to new style test. (Yegappan Lakshmanan, closes vim/vim#5363)
f9cb05c147
2019-12-16 19:38:29 -05:00
James McCoy 9f3d483c79
Merge pull request #7202 from teto/jobstart_env
[RFC] override environment for jobstart
2019-12-13 06:52:48 -05:00
James McCoy 91b313a904
Add negative test for type of job's env option 2019-12-12 07:57:27 -05:00
Matthieu Coudron f3fcaedfad
test: new test for setting environment 2019-12-11 21:06:42 -05:00
butwerenotthereyet 39094b3fae jumplist: browser-style (or 'tagstack') navigation #11530
Traditionally, when navigating to a specific location from the middle of
the jumplist results in shifting the current location to the bottom of
the list and adding the new location after it.  This behavior is not
desireable to all users--see, for example
https://vi.stackexchange.com/questions/18344/how-to-change-jumplist-behavior.

Here, another jumplist behavior is introduced.  When jumpoptions (a new
option set added here) includes stack, the jumplist behaves like the
tagstack or like history in a web browser.  That is, when navigating to
a location from the middle of the jumplist

    2 first
    1 second
    0 third <-- current location
    1 fourth
    2 fifth

to a new location the locations after the current location in the jump
list are discarded

    2 first
    1 second
    0 third
            <-- current location

The result is that when moving forward from that location, the new
location will be appended to the jumplist:

    3 first
    2 second
    1 third
    0 new

If the new location is the same

  new == second

as some previous (but not immediately prior) entry in the jumplist,

    2 first
    1 second
    0 third <-- current location
    1 fourth
    2 fifth

both occurrences preserved

    3 first
    2 second
    1 third
    0 second (new)

when moving forward from that location.

It would be desireable to go farther and, when the new location is the
same as the location that is currently next in the jumplist,

    new == fourth

make the result of navigating to the new location by jumping (e.g. 50gg)
be the same as moving forward in the jumplist

    2 first
    1 second
    0 third
    1 new <-- current location
    2 fifth

and simply increment the jumplist index.  That change is NOT part of
this patch because it would require passing the new cursor location to
the function (setpcmark) from all of its callees.  That in turn would
require those callees to know *before* calling what the new cursor
location is, which do they do not currently.
2019-12-10 00:56:56 -08:00
Ashkan Kiani 0e6c6261e1
Fix access on vim.wo (#11517)
* Add more tests for vim.wo
2019-12-07 03:34:02 -08:00
Justin M. Keyes 3aa95ef27e
defaults: set nostartofline (#11135)
Having the cursor change column can be surprising.

Force startofline in functional and old tests.
Remove the functional breakindent test, as it's a subset of the oldtest one.
2019-12-03 20:58:03 -08:00
Matthieu Coudron 4598e489c7
test: always pass a string to expect_msg_seq
Seems like pcall doesn't always return a string as a 2nd element of the tuple.
2019-12-03 23:51:30 -05:00
Matthieu Coudron 3beef8ee1c defaults: set nostartofline
Having the cursor change column can be surprising.

Force startofline in functional and old tests.
Remove the functional breakindent test, as it's a subset of the oldtest one.
2019-12-03 13:31:17 +01:00
Justin M. Keyes a3b6c2a3dc API: rename nvim_execute_lua => nvim_exec_lua
- We already find ourselves renaming nvim_execute_lua in tests and
  scripts, which suggests "exec" is the verb we actually want.
- Add "exec" verb to `:help dev-api`.
2019-12-02 22:06:42 -08:00
Justin M. Keyes c34130d13a API: deprecate nvim_command_output 2019-12-02 20:52:06 -08:00
Daniel Hahler 22b52dd462
log_init: call log_path_init (#11501)
This has to be done after `init_homedir` for XDG default and `set_init_1` for
lookup from env, which could be done earlier likely (to help with
https://github.com/neovim/neovim/issues/10937), but this keeps it in
sync with Vim.

Fixes https://github.com/neovim/neovim/issues/11499.
2019-12-02 22:21:15 +01:00
Daniel Hahler 0b7a7b23cc
oldtest: support for running by filename (#11473)
Follow-up to 8969efca8 (Vim patch 8.1.0723)

NOTE: This changes the main entrypoint for running single oldtest files
to not use/require the ".res" extension anymore.  But it is handled for
B/C.

Adds a phony rule to run oldtest by filename.
Not going through "$(MAKE)" avoids GNUmakefile being used then (which I
use for WIP things), and it seems like SINGLE_MAKE should be used anyway
probably.
2019-12-02 17:18:37 +01:00
erw7 ab860cb5f6 dictwatcher: fix use-after-free #11495
fixes #11494
2019-12-02 02:09:30 -08:00
Justin M. Keyes b1991f66d5 API: rename nvim_source => nvim_exec
- Eliminate nvim_source_output(): add boolean `output` param to
  nvim_exec() instead.
2019-12-01 22:35:15 -08:00
Vikram Pal bd43e011b5 API: nvim_source_output
- Similar to nvim_source but will capture the output
- Add meaningful VimL tracebacks for nvim_source
- Handle got_int
- Add error reporting
2019-12-01 19:07:57 -08:00
Justin M. Keyes 276c2da286 API: nvim_source: fix multiline input
- DOCMD_REPEAT is needed to source all lines of input.
- Fix ":verbose set {option}?" by handling SID_STR in get_scriptname().

closes #8722
2019-12-01 16:09:24 -08:00
Siddhant Gupta 6aa03e86da API: nvim_source 2019-12-01 16:09:24 -08:00
Ashkan Kiani 70b6061666
Add vim.startswith and vim.endswith (#11248) 2019-12-01 05:32:55 -08:00
Ashkan Kiani e6da21d128
Add vim.cmd as an alias for nvim_command (#11446) 2019-12-01 05:28:53 -08:00
Ashkan Kiani edca84cfc9
Return nil instead of NIL for vim.env (#11486) 2019-12-01 05:04:57 -08:00
Justin M. Keyes a17ccb0d24
screen.lua: remove screen:_on_event #11488
Tests can redefine the handlers, so we don't need this extra hook.
2019-12-01 01:06:10 -08:00
Justin M. Keyes f6e7857c54
floatwin: show error if window is closed immediately #11476
Autocmds may close window while it is being entered, then
win_set_minimal_style(wp) operates on an invalid pointer.

We could silently ignore this instead, but it is unlikely to be
intentional, so it is more useful to show an error.

fix #11383
2019-11-29 23:48:14 -08:00
erw7 1bb7ea189e win_line: Fix crash with 'rightleft' in :terminal #11460
fixes #11438

Backtrace:

    0  schar_from_ascii ( p=0x801cc9e112c3 <error: Cannot access memory at address 0x801cc9e112c3>, c=32 ' ') at ../src/nvim/screen.c:5263
    1  0x00007f31460eccc5 in win_line (wp=wp@entry=0x7fffc9df6230, lnum=lnum@entry=11, startrow=startrow@entry=10, endrow=41, nochange=false, number_only=number_only@entry=false) at ../src/nvim/screen.c:4025
    2  0x00007f31460eed8e in win_update (wp=wp@entry=0x7fffc9df6230) at ../src/nvim/screen.c:1403
    3  0x00007f31460f011f in update_screen (type=<optimized out>) at ../src/nvim/screen.c:502
    4  0x00007f3146138ef4 in normal_redraw (s=s@entry=0x7fffd0a5f700) at ../src/nvim/normal.c:1247
    5  0x00007f314613b159 in normal_check (state=0x7fffd0a5f700) at ../src/nvim/normal.c:1324
    6  0x00007f31460accfe in state_enter (s=0x7fffd0a5f700) at ../src/nvim/state.c:28
    7  0x00007f3146143099 in normal_enter (cmdwin=<optimized out>, noexmode=<optimized out>) at ../src/nvim/normal.c:463
    8  0x00007f314618b541 in main (argc=<optimized out>, argv=<optimized out>) at ../src/nvim/main.c:580
2019-11-28 20:09:03 -08:00
Brian Wignall 001e69cd46 doc: fix typos
close #11459
2019-11-27 22:47:25 -08:00
Björn Linse 5f9209389b
Merge pull request #11445 from bfredl/fcslcs
options: make 'fillchars' and 'listchars' global-local instead of local-only
2019-11-26 22:10:13 +01:00
Björn Linse 49a40f425d options: make 'fillchars' and 'listchars' global-local
These options were previously global. A global-local window option
behaves closer to a global option "per default" (i e with :set),
but still supports local behavior via :setl

Also this restores back-compat for nvim_set_option("fcs", ...)
which are currently broken on 0.4.x but worked in earlier versions
2019-11-26 19:14:54 +01:00
Björn Linse a76a669ac2 lua: make vim.wo and vim.bo used nested indexing for specified handle
Also missing option should be an error. Options are functionality,
not arbitrary variable names (as for vim.g)
2019-11-26 18:44:36 +01:00
Justin M. Keyes 36d1335a66
UI: emit mouse_on/mouse_off on attach #11455
closes #11372
2019-11-25 08:56:42 -08:00
notomo 4a77df2e51 [RFC] extmark: fix E315 in nvim_buf_set_extmark (#11449)
extmark: need to use buf instead of curbuf
2019-11-25 16:50:30 +01:00
Justin M. Keyes fd5710ae9a
doc + extmarks tweaks #11421
- nvim_buf_get_extmarks: rename "amount" => "limit"
- rename `set_extmark_index_from_obj`
2019-11-25 01:08:02 -08:00
Ashkan Kiani b78fdd7ce5 Merge branch 'master' into lsp-followup 2019-11-24 02:29:23 -08:00
Ashkan Kiani d0d38fc36e Lua: vim.env, vim.{g,v,w,bo,wo} #11442
- Add vim variable meta accessors: vim.env, vim.{g,v,w,bo,wo}
- Redo gen_char_blob to generate multiple blobs instead of just one
  so that multiple Lua modules can be inlined.
- Reorder vim.lua inclusion so that it can use previously defined C
  functions and utility functions like vim.shared and vim.inspect things.
- Inline shared.lua into nvim, but also keep it available in runtime.
2019-11-24 02:28:48 -08:00
Ashkan Kiani 42c53d266a Merge remote-tracking branch 'origin/master' into lsp-followup 2019-11-23 14:28:54 -08:00
Björn Linse 7d5988feee tests: remove irrelevant timing info 2019-11-23 21:26:16 +01:00
Björn Linse ddf509c2ba test was wrong 2019-11-23 16:46:47 +01:00
Björn Linse 2cc83c961c refactor: use inserted_bytes pattern from vim
This covers all "small" inserts and deletes in insert mode, as well
as a few more cases like small normal mode deletes

vim-patch:8.1.0678: text properties as not adjusted for inserted text
2019-11-23 16:46:47 +01:00
Björn Linse bdebe8516c bufhl: use extmark column adjustment for bufhl
NB: this is not the final implementation. Bufhl should be made a
part of the extmark tree, so that "start" adjustment just works
automatically. But "stop" will still need some ad-hoc trickery,
until extended marks natively support ranges (hopefully sooner than
forever).
2019-11-23 14:50:31 +01:00
Dennis B d5f14b8372 Clear 'cc' in nvim_open_win 'minimal' style #11361 (#11427)
* Clear 'cc' in nvim_open_win 'minimal' style #11361

Add 'colorcolumn' to the list of options that should be cleared when creating
a 'minimal'-style floating window.
2019-11-22 10:55:04 +01:00
Ashkan Kiani b4ca07896c lualint 2019-11-21 15:23:43 -08:00
Ashkan Kiani bcae04f6c6 Updates
- Use correct implementation of text_edits.
- Send indent options to rangeFormatting and formatting.
- Remove references to vim bindings and filetype from lsp.txt
- Add more examples to docs.
- Add before_init to allow changing initialize_params.
2019-11-21 15:19:06 -08:00
Ashkan Kiani 6a51401378 Merge remote-tracking branch 'origin/master' into lsp-followup 2019-11-21 10:04:32 -08:00
Björn Linse 76e0a8bd93 lsp: transmit "\n" after last line when 'eol' is set
Otherwise some servers like clangd will emit spurious
"no newline at end of file" warnings.
2019-11-21 11:12:57 +01:00
Ashkan Kiani b984f613c1 Extend list_extend to take start/finish. 2019-11-20 17:09:21 -08:00
Joe Hermaszewski 1ff5b60cb9 vim-patch:8.1.0251: support full paths for 'backupdir' #11269
Problem:    Using a full path is supported for 'directory' but not for
            'backupdir'. (Mikolaj Machowski)
Solution:   Support 'backupdir' as well. (Christian Brabandt, closes vim/vim#179)
b782ba475a
2019-11-17 23:38:27 -08:00
Björn Linse dab40f43b1 Add v:lua.func() vimL syntax for calling lua
Also simplify error messages when calling lua from vimL.
2019-11-16 22:33:21 +01:00