* 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)
* 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
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.
Problem: Cannot delete a match from another window. (Paul Jolly)
Solution: Add window ID argument to matchdelete(), clearmatches(),
getmatches() and setmatches(). (Andy Massimino, closesvim/vim#4178)
aff749145e
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
* 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
Problem: 'showbreak' does not work for a very long line. (John Little)
Solution: Check whether 'briopt' contains "sbr". (Ken Takata, closesvim/vim#5523,
closesvim/vim#5684)
1aa76b8fd0
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
...
```
* 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
* 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
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
: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)
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.