Commit Graph

305 Commits

Author SHA1 Message Date
notomo
8e86f5e460 api: nvim_echo 2021-01-20 16:41:39 +01:00
Björn Linse
4cdc8b1efd input: consider "-- more --" state to be blocking, fixes #11899 2021-01-04 09:41:25 +01:00
Thomas Vigouroux
fd960a33e4
fix: check for valid buffer handles in modify_keymap (#13543)
Fixes #13541
Neovim would crash when trying to map a key on non existant buffer
2021-01-03 19:14:18 +01:00
chentau
f7d01a65d5 api: set_text: more tests, and fixing lint
removing pending virtcol tests

Allow passing in empty array as a shorthand for array with empty string; add more documentation

add check for start_row as well
2021-01-01 19:51:58 +01:00
Tony Chen
45b14f88db api: set_text: rebase, update to new api, and add more tests 2021-01-01 19:51:45 +01:00
Blaž Hrastnik
29ad2ebc16 api: set_text: fix validation and some issues
fix double free because intermediary lines weren't xmemdup'd.

NL-for-NUL dance.

Normalize row indices and perform more validation.

Adjust the cursor position if it's on the right side of the replacement.

Tests and documentation.
2021-01-01 19:51:37 +01:00
Björn Linse
95352f490a rpc: don't handle stale requests on already closed channel 2020-12-23 23:58:56 +01:00
Björn Linse
17a58043a3 api/options: cleanup the fixup 2020-12-04 13:29:44 +01:00
TJ DeVries
ced951c2aa api/options: fixup 2020-12-04 13:29:44 +01:00
Björn Linse
d285fa73da api: enable nvim_get_runtime_file to find subdirectories 2020-11-24 14:18:46 +01:00
Alvaro Muñoz
aaca2c1c4d
feat(lua): improve error message to make it actionable (#13276)
* improve error message to make it actionable
2020-11-13 19:50:03 +01:00
TJ DeVries
78556aba7d api: nvim_buf_delete 2020-10-22 16:08:32 -04:00
Björn Linse
38efa1730f
Merge pull request #13118 from bfredl/mudholland
A Mudholland Dr. Recast
2020-10-19 23:14:55 +02:00
Björn Linse
07cc231142 A Mudholland Dr. Recast
The commit summary maybe does not make sense, but calling a function
that does not wait on anything `wait()` makes even less sense.
2020-10-19 21:48:06 +02:00
Justin M. Keyes
8e77d70e29 test/vim.validate(): assert normalized stacktrace
- The previous commit lost information in the tests. Instead, add some
  more "normalization" substitutions in pcall_err(), so that the general
  shape of the stacktrace is included in the asserted text.
- Eliminate contains(), it is redundant with matches()
2020-10-05 09:47:59 -04:00
erw7
620c8fdfe9 extmark: fix decoration ploblems with extmark
54ce101 changed the way undo entries are created when adding decorations.
This creates all sorts of problems.This change fixes the problem by
reverting to the previous behavior.
2020-10-02 11:41:30 +09:00
Thomas Vigouroux
cecc45efb1 api(extmarks): allow extrange past final newline 2020-09-17 21:23:52 +02:00
Björn Linse
866308c3de API: be less breaking in the christmas tree decorations 2020-09-04 19:11:26 +02:00
Björn Linse
49f5b57587 decor: sketch new decorations API
return decorations back

lol no nvim_buf_get_virtual_text

share decorations that are hl only to avoid alloc avalanche
2020-09-03 15:40:24 +02:00
Björn Linse
d3302573ba extmark: move id to dict in nvim_buf_set_extmark 2020-09-03 10:23:52 +02:00
James McCoy
55a885c179
lua: Use #var instead of deprecated table.getn(var) 2020-07-31 01:33:42 -04:00
Matthieu Coudron
d8c5d122f1
Merge pull request #12376 from erw7/fix-stack-overflow-on-input-enqueue
input: fix stack overflow
2020-06-08 16:52:56 +02:00
Jan Edmund Lazo
909af2f3f1
vim-patch:8.2.0491: cannot recognize a <script> mapping using maparg()
Problem:    Cannot recognize a <script> mapping using maparg().
Solution:   Add the "script" key. (closes vim/vim#5873)
2da0f0c445
2020-06-04 20:52:53 -04:00
Justin M. Keyes
977c0f292f
API: nvim_create_buf: unset 'modeline' in scratch-buffer #12379
Although 'nomodeline' is not strictly part of the definition of
a "scratch-buffer" it is obviously the right default.
2020-05-29 09:45:32 -07:00
erw7
e6e6affc0e nvim_input: add test 2020-05-25 14:59:27 +09: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
Björn Linse
7ce9a5c7da api: add nvim_get_runtime_file for finding runtime files 2020-02-07 09:22:55 +01:00
Björn Linse
48a869dc6d shed biking: it's always extmarks, never marks extended 2020-01-20 19:36:35 +01:00
Björn Linse
ca1a00edd6 extmarks/bufhl: reimplement using new marktree data structure
Add new "splice" interface for tracking buffer changes at the byte
level. This will later be reused for byte-resolution buffer updates.
(Implementation has been started, but using undocumented "_on_bytes"
option now as interface hasn't been finalized).

Use this interface to improve many edge cases of extmark adjustment.
Changed tests indicate previously incorrect behavior. Adding tests for
more edge cases will be follow-up work (overlaps on_bytes tests)

Don't consider creation/deletion of marks an undoable event by itself.
This behavior was never documented, and imposes  complexity for little gain.

Add nvim__buf_add_decoration temporary API for direct access to the new
implementation. This should be refactored into a proper API for
decorations, probably involving a huge dict.

fixes #11598
2020-01-16 12:36:10 +01:00
Daniel Hahler
3d1531aee5
API: include invalid buffer/window/tabpage in error message (#11712) 2020-01-14 09:21:10 +01:00
kevinhwang91
831fa45ad8 API: nvim_get_hl_by_id: omit hl instead of returning -1 #11685
Problem: When Normal highlight group defines ctermfg/bg, but other
         highlight group lacks ctermfg/bg, nvim_get_hl_by_id(hl_id,
         v:false) returns -1 for the missing ctermfg/bg instead of just
         omitting it.
Solution: checking for -1 in hlattrs2dict()

fix #11680
2020-01-08 06:19:23 -08:00
Björn Linse
440695c296 tree-sitter: implement query functionality and highlighting prototype [skip.lint] 2019-12-22 12:51:46 +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
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
Brian Wignall
001e69cd46 doc: fix typos
close #11459
2019-11-27 22:47:25 -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
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
ebdf90e7d7 extmark: don't crash in RO buffer. 2019-11-16 11:58:32 +01:00
Björn Linse
18a8b702c0 extmark: review changes 2019-11-11 20:18:15 +01:00
timeyyy
a9065a5051 nsmarks: initial commit 2019-11-11 19:43:15 +01:00
Justin M. Keyes
019c8d13dd
build/doc/CI: remove/update quickbuild references #11258 2019-10-19 18:04:08 -07:00
Daniel Hahler
4bbad54817
tests: fix non-controversial misuse of pending (#11247)
Ref: https://github.com/neovim/neovim/pull/11184
2019-10-18 04:46:30 +02:00
Björn Linse
4987311fb5 tests/ui: remove unnecessary screen:detach()
It is perfectly fine and expected to detach from the screen just by
the UI disconnecting from nvim or exiting nvim. Just keep detach() in
screen_basic_spec, to get some coverage of the detach method itself.

This avoids hang on failure in many situations (though one could argue
that detach() should be "fast", or at least "as fast as resize",
which works in press-return already).

Never use detach() just to change the size of the screen, try_resize()
method exists for that specifically.
2019-10-13 22:10:42 +02:00
Daniel Hahler
4df38ec9df
server_requests_spec: fix assertion, pass Lua paths via args (#10875)
This makes it pick up the nvim Luarocks module properly when not
installed via third-party.
2019-09-16 19:16:39 +02:00