Commit Graph

15674 Commits

Author SHA1 Message Date
Kei Kamikawa
c6dc397801
fixed hang issue with --headless and -r option specified (#12209)
* fixed hang issue with --headless and -r option specified

Calling the do_more_prompt function in headless mode will freeze neovim because it is eventally in the input-accepting state (the same as waiting for --more--).

* fixed "Press ENTER or type command to continue" to be suppressed

If in headless mode, we need to exit at this point. If we continue, we will enter the normal mode and the message "Press ENTER or type command to continue" will be displayed and we will be in the input waiting state.

* fixed functional ex_cmds tests

* Revert "fixed "Press ENTER or type command to continue" to be suppressed"

This reverts commit a02dc40e3b.

* Revert "fixed functional ex_cmds tests"

This reverts commit 3bdb8da20a.

* fixed conditional again

* added test for fixed hang issue with --headless (#11386)
2020-05-20 10:32:02 -04:00
Faris A Chugthai
7116105d66
provider: Add python3.9 to autoload/provider/pythonx.vim (#12344)
3.9's scheduled for beta release today.
https://www.python.org/dev/peps/pep-0596/
2020-05-20 13:57:46 +02:00
Hirokazu Hata
74fed7d50f
Merge pull request #12338 from h-michael/fix-flaky 2020-05-19 10:18:05 +09:00
Mike Hartington
5126546ed7
lsp: fix get diagnositcs 2020-05-19 10:06:30 +09:00
Hirokazu Hata
eabf1803cd
test: fix flaky vim.defer_fn test 2020-05-19 00:02:14 +09:00
Christian Clason
f2894bffb0
lua: Add highlight.on_yank (#12279)
* add lua function to highlight yanked region

* extract namespace, better naming, default values

* add default for event argument

* free timer

* factor out mark to position calculation

* d'oh

* make sure timer stops before callback (cf. luv example)

* factor out timer, more documentation

* fixup

* validate function argument for schedule

* fix block selection past eol

* correct handling of multibyte characters

* move arguments around, some cleanup

* move utility functions to vim.lua

* use anonymous namespaces, avoid local api

* rename function

* add test for schedule_fn

* fix indent

* turn hl-yank into proper (hightlight) module

* factor out position-to-region function

mark extraction now part of highlight.on_yank

* rename schedule_fn to defer_fn

* add test for vim.region

* todo: handle double-width characters

* remove debug printout

* do not shadow arguments

* defer also callable table

* whitespace change

* move highlight to vim/highlight.lua

* add documentation

* add @return documentation

* test: add check before vim.defer fires

* doc: fixup
2020-05-18 09:49:50 -04:00
TJ DeVries
a6be7a9180
doc: Vim internal variables & options in lua (#12302)
* doc: Add info about vim dicts in lua

* doc: preamble and info

* doc: remove weird spacing

* fixup
2020-05-17 23:29:34 -04:00
Eisuke Kawashima
a91ce497b4
lsp: Fix timezone format of LSP log (ISO 8601) (#12332) 2020-05-17 20:12:22 -04:00
Andreas Johansson
4fbbe1c957
lsp: Handle end lines in apply_text_edits (#12314)
If the LSP sends an end line that is larger than what nvim considers to be the
last line, you get an Index out of bounds error when fetching the line from
nvim, a change that was introduced in #12223. This change removes the strict
indexing and checks the return value from nvim_buf_get_lines.
2020-05-17 13:47:14 -04:00
Hirokazu Hata
ae5bd0454e
lua: add tbl_deep_extend (#11969) 2020-05-17 13:24:34 -04:00
Shougo
090d3c2813
matchdelete: fix porting (#12328)
really use win and not curwin
2020-05-17 13:55:10 +02:00
Shougo
d7d69fed18
vim-patch:8.1.1084: cannot delete a match from another window (#12325)
Problem:    Cannot delete a match from another window. (Paul Jolly)
Solution:   Add window ID argument to matchdelete(), clearmatches(),
            getmatches() and setmatches(). (Andy Massimino, closes vim/vim#4178)
aff749145e
2020-05-16 15:25:51 +02:00
Hirokazu Hata
f3d0a1741e
Merge pull request #12324 from alindeman/nil-code-actions 2020-05-16 11:58:54 +09:00
Andy Lindeman
986bed2329 Check for nil before checking for empty table
At least the `gopls` language server seems to return nil/null if no code
actions are available. Currently this results in an error:

> Error executing vim.schedule lua callback: shared.lua:199: Expected table, got nil
2020-05-15 21:34:28 -04:00
Jesse
f559e5249e
LSP: Add textDocument/codeAction support (#11607)
* Add textDocument/codeAction

* Add callback for workspace/executeCommand
* Escape newlines in codeAction titles
* Return empty list in get_line_diagnostics if no buffer diagnostics
* Add stub documentation
* Validate context parameter in code_action
* Add support for edit in CodeAction responses
* Group diagnostics by line in vim.lsp.util.get_line_diagnostics()
* Advertise code action literal support
2020-05-16 01:18:59 +02:00
James McCoy
c37d9fa3da
Merge pull request #11764 from blueyed/vim-patch-usage 2020-05-15 10:45:10 -04:00
James McCoy
e2a33a6622
Merge pull request #12259 from janlazo/vim-8.1.1186 2020-05-15 10:36:32 -04:00
Mathias Fußenegger
da6f38ab3c
LSP: Add workspace.applyEdit client capabilities (#12313)
applyEdit is supported by the built-in client.
2020-05-14 18:56:33 +02:00
landerlo
02155f5c10
lsp: fix bug when documentEdit version=null for unattached buffer (#12272) 2020-05-13 23:14:52 -04:00
Jan Edmund Lazo
076b0949d0
vim-patch:8.2.0736: some files not recognized as pamenv
Problem:    Some files not recognized as pamenv.
Solution:   Add pam_inv.conf. (closes vim/vim#6065)
aacc6afdb8
2020-05-11 23:57:29 -04:00
Jan Edmund Lazo
adcabb73bc
vim-patch:8.2.0309: window-local values have confusing name
Problem:    Window-local values have confusing name.
Solution:   Rename w_p_bri* to w_briopt_*.
b81f56fb57
2020-05-11 22:30:24 -04:00
Jan Edmund Lazo
801c8e06d6
vim-patch:8.2.0308: 'showbreak' does not work for a very long line
Problem:    'showbreak' does not work for a very long line. (John Little)
Solution:   Check whether 'briopt' contains "sbr". (Ken Takata, closes vim/vim#5523,
            closes vim/vim#5684)
1aa76b8fd0
2020-05-11 22:30:24 -04:00
Jan Edmund Lazo
393dc2b0f5
vim-patch:8.2.0713: the pam_environment file is not recognized
Problem:    The pam_environment file is not recognized.
Solution:   Add a filetype pattern for pamenv. (closes vim/vim#6051)
6115481053
2020-05-11 22:30:24 -04:00
Jan Edmund Lazo
03cc818fdc
vim-patch:8.2.0705: indent tests don't run on CI for FreeBSD
Problem:    Indent tests don't run on CI for FreeBSD.
Solution:   Set modeline. (Ozaki Kiichi, closes vim/vim#6048)
3657686a0e
2020-05-11 22:30:24 -04:00
Jan Edmund Lazo
ae01a5e9f8
vim-patch:8.1.1186: readdir() allocates list twice
Problem:    readdir() allocates list twice.
Solution:   Remove second allocation.  Also check for zero length.
334ad41504
2020-05-11 22:30:23 -04:00
Mathias Fußenegger
55b62a937c
LSP: Make applyEdit return a response (#12270)
According to the specification workspace/applyEdit needs to respond with
a `ApplyWorkspaceEditResponse`

See https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_applyEdit

This is a subset of https://github.com/neovim/neovim/pull/11607
2020-05-11 16:56:35 +02:00
Justin M. Keyes
9816173fb3
Merge #12275 from erw7/profile-fix-use-after-free
viml/profile: fix missing fixes when merging vim-patch:8.1.0130

Fix #12255

### Steps to reproduce using `nvim -u NORC`

```
nvim -u NORC
:function Test()
:endfunction
:profile start log1
:profile func Test
:call Test()
:profile stop
:profile start log2
:profile func Test
:call Test()
:profile stop
```

### Actual behaviour

#### log1
```
FUNCTION Test()
Called 1 times
...
```

#### log2
```
FUNCTION Test()
Called 2 times
...
```

### Expected behaviour

#### log1
```
FUNCTION Test()
Called 1 times
...
```

#### log2
```
FUNCTION Test()
Called 1 times
...
```
2020-05-09 17:22:08 -04:00
erw7
7872877ce5 test: add more profile tests
- Add a test to make sure that 'profile dump' does not reset the profile.
- Add a test to make sure that 'profile stop' does reset the profile.
2020-05-10 03:16:30 +09:00
erw7
949783fdfa viml/profile: fix issue where profile is not reset on stop 2020-05-09 11:21:52 +09:00
erw7
861aade680 viml/profile: fix use after free
fixes #12255.
2020-05-09 11:21:52 +09:00
Felipe Morales
2f818eb9ee
runtime/tutor: fix broken inline spans #12282
* runtime/syntax/tutor: fix broken inline spans

Also, conceal the ends of code blocks.

Re: #11401 and #12273

* fixup
2020-05-08 09:48:25 -07:00
Christian Clason
281e44f7bb
lsp: Make apply_text_edits non-ASCII safe (#12223)
* Make apply_text_edits non-ASCII safe

Use `vim.str_byteindex` to correct starting and ending positions for text edits if the line contains non-ASCII characters.

Fixes #12221

* text_edit may be applied to other buffers

* make sure the buffer is loaded

* add comments

* add test for non-ASCII edits
2020-05-08 10:04:41 -04:00
Hirokazu Hata
9a67b030d9
lsp: Handle unknown CompletionItemKind and SymbolKind (#12257)
* lsp: handle kinds not specified in protocol

fix: #12200
If the client set "symbolKind.valueSet",
the client must handle it properly even if it receives a value outside the specification.

* test: add lsp.util.{get_completion_item_kind_name, get_symbol_kind_name} test case

* lsp: make lsp.util.{get_completion_item_kind_name, get_symbol_kind_name} private
2020-05-07 16:23:25 -04:00
TJ DeVries
1407899c32
lua: Add buffer, window and tab accessors (#12268)
* Add buffer, window and tab accessors

* Fix deletion and add tests
2020-05-07 15:22:24 -04:00
Gabriel Sanches
7432b3ca4c
lsp: set buflisted when jumping to location (#12253) 2020-05-07 09:30:42 -04:00
Justin M. Keyes
f04a9a2c9a
Merge #12203 from janlazo/vim-8.2.0648
vim-patch:8.1.{800,868,1581},8.2.{648,649,663,678,681,688,691,692}
2020-05-05 23:38:15 -04:00
Hennadii Chernyshchyk
d2766b06c8
vim-patch:8.1.1120: cannot easily get directory entry matches #12222
Problem:    Cannot easily get directory entry matches.
Solution:   Add the readdir() function. (Yasuhiro Matsumoto, closes vim/vim#2439)
543c9b1921

closes #12212
2020-05-05 08:15:45 -07:00
Jesse
48c2198297
paste: support replace mode (#11945)
* paste: support replace mode
* Clean up

Co-authored-by: Jesse Bakker <git@jessebakker.com>
2020-05-05 13:18:41 +02:00
erw7
a467f3f665
tag: fix problem when tagfunc return value is v:null (#12251)
fixes #12250.
2020-05-05 10:33:48 +02:00
Justin M. Keyes
fdd328d568
Merge #12230 'fix :terminal flicker with scrolloff' 2020-05-05 00:32:23 -04:00
Justin M. Keyes
7b764bb43d terminal: disable 'scrolloff' (fixes flicker)
Besides the special-case in get_scrolloff_value(), it makes sense for
'scrolloff' and 'sidescrolloff' to reflect the correct values (for
plugins, scripts, …).

ref 53d607af9c53accfd634435908fb79061f1212b9
ref #11915
ref #12230
2020-05-04 21:21:33 -07:00
LawAbidingCactus
edd5b233d8 terminal: always return zero from get_scrolloff_value() #12230
Fixes flicker

fix #11072
fix #11915
2020-05-04 21:21:33 -07:00
Gabriel Sanches
f605eeec65
lsp: fix tagstack for location jump #12248 2020-05-04 20:12:35 -07:00
Mathias Fußenegger
2c40a38b39
LSP: Avoid URI-to-fname conversion for non-file URIs #12243
Fixes https://github.com/neovim/neovim/issues/12210
2020-05-04 20:06:40 -07:00
Booome
ebee77e73c
checkhealth/ruby: fix off-by-one error #12245
Co-authored-by: BodongLiKolmostar <bodong.li@kolmostar.com>
2020-05-04 19:58:45 -07:00
erw7
d46c4003cf
funcs: Fix a memory leak in f_expand (#12227)
:echo expand('%', v:false, v:true)

==423== 28 bytes in 1 blocks are definitely lost in loss record 124 of 420
==423==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==423==    by 0x2AD09C: try_malloc (memory.c:71)
==423==    by 0x2AD0B8: xmalloc (memory.c:105)
==423==    by 0x2AE05D: xmallocz (memory.c:182)
==423==    by 0x1F7CF4: vim_strnsave (strings.c:68)
==423==    by 0x318813: eval_vars (ex_docmd.c:8885)
==423==    by 0x34F5FC: f_expand (funcs.c:2058)
==423==    by 0x36D023: call_func (eval.c:6419)
==423==    by 0x370C28: get_func_tv.lto_priv.707 (eval.c:6150)
==423==    by 0x372748: eval7 (eval.c:4326)
==423==    by 0x37291A: eval6 (eval.c:4036)
==423==    by 0x372BF6: eval5 (eval.c:3884)
2020-05-04 10:50:54 +02:00
Matthieu Coudron
496b668ad1
Merge pull request #12237 from h-michael/vim-nil
lsp: text_document.version may be vim.NIL not nil
2020-05-04 09:53:00 +02:00
Hirokazu Hata
67634da714
lsp: add a lsp.util.apply_text_edits test(pending)
We don't handle non-ASCII characters well in UTF-16.
So I add a non-ASCII characters test case.
2020-05-04 09:05:16 +09:00
Hirokazu Hata
0107a194fa
lsp: fix apply_text_document_edit test
lsp.util.buf_versions must be set in advance.
Use helper.insert to create an anonymous buffer,
so create a named buffer for testing without using insert.
2020-05-04 08:10:27 +09:00
Jan Edmund Lazo
ed4df85f6b
vim-patch:8.2.0692: startup test fails on MS-Windows
Problem:    Startup test fails on MS-Windows.
Solution:   Allow for any path.
4515bcdec8
2020-05-03 13:44:13 -04:00