Expose `vim.lsp.buf.diagnostics_by_buf`
This makes it easier to customize the diagnostics behavior. For example
to defer the update they can override the
`textDocument/publishDiagnostics` callback to only call
`buf_diagnostics_save_positions` and then defer the other actions to a
autocmd event.
Offsets of window were not taken into account when sending mouse
coordinates to the terminal. Therefore, when nu or rnu is set, the mouse
coordinates sent to the terminal were not correct. Change it to send the
correct coordinates by subtract window offset from col.
Since "nvim_get_option" is executed on the tui thread as a C function
instead of msgpack-rpc, it accesses global variables that may change on the
main thread.
Problem: A plugin cannot easily expand a command like done internally.
Solution: Add the expandcmd() function. (Yegappan Lakshmanan, closesvim/vim#4514)
80dad48c50
Problem: :echomsg and :echoerr do not handle List and Dict like :echo does.
(Daniel Hahler)
Solution: Be more tolerant about the expression result type.
461a7fcfce
Add lua functional tests for :echo,:echon,:echomsg,:echoerr
because nvim did not port "test_" functions from Vim
that modify internal state.
Testing :echoerr via try/catch is sufficient.
- os.exit(1) is too generic, since code 1 may be caused by Nvim exiting
for some other reason. Change it to os.exit(101).
- style: de-architect json_encode/json_decode calls.
Failure seen in travis macOS job:
https://travis-ci.org/neovim/neovim/jobs/647849133
[ FAILED ] test/functional/plugin/lsp_spec.lua@ 266 SP basic_init test should not send didOpen if the buffer closes before init
test/functional/plugin/lsp_spec.lua:297: exit code
Expected objects to be the same.
Passed in:
(number) 1
Expected:
(number) 0
stack traceback:
test/functional/plugin/lsp_spec.lua:297: in function 'on_exit'
test/functional/plugin/lsp_spec.lua💯 in function 'test_rpc_server'
test/functional/plugin/lsp_spec.lua:272: in function <test/functional/plugin/lsp_spec.lua:266>
Problem: Not restoring Insert mode if leaving a prompt buffer by using a
mouse click.
Solution: Set b_prompt_insert appropriately. Also correct cursor position
when moving cursor to last line.
891e1fd894
Problem: BS in prompt buffer starts new line.
Solution: Do not allows BS over the prompt. Make term_sendkeys() handle
special keys. Add a test.
6b810d92a9
Sloppy code inherited from Vim caused user scripts to be able
to observe the cursor line in an invalid intermediary state,
due to Neovim change callbacks being unbuffered unlike Vim listeners.
Manifested in Vimscript executed from the callback possibly erroring
when `:call`:ing any function,
due to the implicit range `curwin->w_cursor.lnum,curwin->w_cursor.lnum`
failing validation.
Fixed by deferring the call to `changed_lines()` until after
`curwin->w_cursor.lnum` gets its correct value.
Problem: When session-restore creates a terminal buffer with command
like `:edit term://.//16450:/bin/bash`, the buffer gets
a different name (depends on PID). Thus the later call to
`bufexists('term://.//16450:/bin/bash)` will return false.
Solution: Force the buffer name with :file. This as least ensures
the same buffer will show in multiple windows correctly, as
expected when saving the session. But it still has problems:
1. the PID in the buffer name is bogus
2. redundant :terminal buffers still hang around
fix#5250