Commit Graph

158 Commits

Author SHA1 Message Date
Javier Lopez
1b5767aa34
feat(lua): add <f-args> to user commands callback (#17522)
Works similar to ex <f-args>. It only splits the arguments if the
command has more than one posible argument. In cases were the command
can only have 1 argument opts.fargs = { opts.args }
2022-02-27 12:35:06 -07:00
Gregory Anders
11f7aeed7a
feat(api): implement nvim_buf_get_text (#15181)
nvim_buf_get_text is the mirror of nvim_buf_set_text. It differs from
nvim_buf_get_lines in that it allows retrieving only portions of lines.

While this can typically be done easily enough by API clients,
implementing this function provides symmetry between the get/set
text/lines APIs, and also provides a nice convenience that saves API
clients the work of having to slice the result of nvim_buf_get_lines
themselves.
2022-02-22 20:19:21 +00:00
zeertzjq
cc81a8253b docs: minor changes related to mapping description 2022-02-16 16:58:32 +08:00
marvim
45e666fb92 docs: regenerate [skip ci] 2022-02-13 13:44:51 +00:00
dundargoc
64116d7850
chore: fix typos (#17250)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Dani Dickstein <daniel.dickstein@gmail.com>
Co-authored-by: Axel Dahlberg <git@valleymnt.com>
2022-02-08 08:19:06 +08:00
marvim
2c94b75eac docs: regenerate [skip ci] 2022-01-17 18:28:23 +00:00
Gregory Anders
39238435db
fix(api): force redefinition of user commands by default (#16918) 2022-01-04 11:51:45 -07:00
dundargoc
0b0c4f7dfa
chore: fix typos (#16816)
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Sebastian Volland <seb@baunz.net>
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-01-04 11:07:40 -07:00
shadmansaleh
b411f436d3 feat(api): add support for lua function & description in keymap
Behavioral changes:

1. Added support for lua function in keymaps in
--------------------------------------------
- nvim_set_keymap
  Can set lua function as keymap rhs like following:
```lua
vim.api.nvim_{buf_}set_keymap('n', '<leader>lr', '', {callback = vim.lsp.buf.references})
```
  Note: lua function can only be set from lua . If api function being
  called from viml or over rpc this option isn't available.
- nvim_{buf_}get_keymap
  When called from lua, lua function is returned is `callback` key .
  But in other cases callback contains number of the function ref.
- :umap, nvim_del_keymap & nvim_buf_del_keymap clears lua keymaps correctly.
- :map commands for displaing rhs .
   For lua keymaps rhs is displayed as <Lua function ref_no>
   Note: lua keymap cannot be set through viml command / functions.
- mapargs()
  When dict is false it returns string in `<Lua function ref_no>`
  format (same format as :map commands).
  When dict is true it returns ref_no number in `callback` key.
- mapcheck()
  returns string in `<Lua function ref_no>` format (same format as :map commands).

2. Added support for keymap description
---------------------------------------
- nvim_{buf_}set_keymap: added `desc` option in opts table .
 ```lua
vim.api.nvim_set_keymap('n', '<leader>w', '<cmd>w<cr>', {desc='Save current file'})
```
- nvim_{buf_}get_keymap: contains `desc` in returned list.
- commands like `:nmap <leader>w` will show description in a new line below rhs.
- `maparg()` return dict contains `desc`.
2022-01-01 00:26:58 +06:00
Björn Linse
7bb593169e
Merge pull request #16752 from gpanders/lua-user-commands
feat(api): implement nvim_{add,del}_user_command
2021-12-28 23:18:07 +01:00
Gregory Anders
eff11b3c3f feat(api): implement nvim_{add,del}_user_command
Add support for adding and removing custom user commands with the Nvim
API.
2021-12-28 14:08:44 -07:00
dundargoc
08616571f4
chore: fix typos (#16506)
Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Christoph Hasse <hassec@users.noreply.github.com>
Co-authored-by: Alef Pereira <ealefpereira@gmail.com>
Co-authored-by: AusCyber <willp@outlook.com.au>
Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com>
2021-12-28 18:15:16 +01:00
github-actions[bot]
4393360796
docs: regenerate (#16468)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2021-12-15 08:19:54 -07:00
Gregory Anders
cf32053d60
fix(api): allow nvim_buf_set_extmark to accept end_row key (#16548)
nvim_buf_get_extmark uses "end_row" rather than "end_line" in its
'details' dict, which means callers must modify the key names if they
want to re-use the information. Change the parameter name in
nvim_buf_set_extmark to "end_row" and use "end_line" as an alias
to make this more consistent.
2021-12-08 08:44:48 -07:00
github-actions[bot]
b51b0aecc9
docs: regenerate (#16390)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2021-11-27 11:26:49 -05:00
marvim
2d340a3746 docs: regenerate 2021-11-18 21:50:55 +00:00
Javier Lopez
961cd83b3b
refactor(api/marks)!: add opts param for feature extensibility (#16146)
In the future we might want to extend the concept of named marks and
adding opts reduces the need of changing the function signature in the
furute.
2021-11-01 07:46:26 -06:00
Gregory Anders
dfef90a518
fix(gen_vimdoc.py): spacing around inline elements #16092
The spacing fix drew attention to a couple of places that were using
incorrect formatting such as the key listing for `nvim_open_win`, so
those were fixed too.
2021-10-19 12:55:22 -07:00
github-actions[bot]
29b718d04c
docs: regenerate (#15986)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2021-10-19 06:03:20 -07:00
github-actions[bot]
59edd377d3
docs: regenerate #15545 2021-10-05 10:48:48 -07:00
Javier Lopez
49fdc62114
feat(api): named marks set, get, delete #15346
Adds the following API functions.

- nvim_buf_set_mark(buf, name, line, col)
  * Set marks in a buffer.
- nvim_buf_del_mark(buf, name)
  * Delete a mark that belongs to buffer.
- nvim_del_mark(name)
  * Delete a global mark.
- nvim_get_mark(name)
  * Get a global mark.

Tests:

- Adds test to all the new api functions, and adds more for the existing
  nvim_buf_get_mark.
    * Tests include failure cases.

Documentation:

- Adds documentation for all the new functions, and improves the
  existing fucntion docs.
2021-10-05 08:49:20 -07:00
Aditya Kurdunkar
83fa8956c3
docs: fix typo 2021-10-04 13:09:32 -06:00
Justin M. Keyes
915703f2d8 docs: extmarks indexing #15311
ref #11456
2021-09-10 19:10:09 -07:00
Javier López
f8e406ed30 docs: extmarks indexing #15311
fix #11456
2021-09-10 18:31:11 -07:00
Patrice Peterson
9b553ad28d docs: extmark indexing #12742
Extmarks mostly use api-indexing, except for nvim_buf_get_extmarks(),
which uses api-indexing with inclusive ranges.

ref #11456
2021-09-10 17:59:28 -07:00
Gregory Anders
2093b12b82 refactor: remove remaining references to nvim_buf_set_virtual_text 2021-08-03 11:39:46 -06:00
marvim
0c93525340 docs: regenerate 2021-07-31 20:26:57 +00:00
marvim
86baf582b8 docs: regenerate 2021-07-26 18:48:46 +00:00
Stephan Seitz
5ea6cc1d75 docs(tree-sitter): document highlight priority 2021-07-22 21:38:57 +02:00
marvim
6b313d68d0 docs: regenerate 2021-07-08 15:42:31 +00:00
Daniel Steinberg
f83c25942d
fix(doc/api): Remove 'border' as unsupported (#14916)
PR #13998 added support for floating window borders.
2021-06-28 20:40:56 -04:00
marvim
67c4ae1322 docs: regenerate 2021-06-14 20:39:02 +00:00
marvim
04f9511715 docs: regenerate 2021-06-10 08:03:28 +00:00
Björn Linse
53791c0546
Merge pull request #14510 from urandom/doc_nvim_buf_set_extmark
Minor observational corrections to the nvim_buf_set_extmark documentation
2021-06-10 09:39:35 +02:00
marvim
2ebc28018e docs: regenerate 2021-06-02 00:43:13 +00:00
Karim Abou Zeid
07f81b3b05 docs: regenerate 2021-05-31 19:47:51 +02:00
Viktor Kojouharov
5ea9cbc280 Update the functio documentation in C 2021-05-10 11:27:48 +02:00
Viktor Kojouharov
a257f00f75 Minor observational corrections to the set_extmark documentation
Add a note for the line and col, saying they are 0-based.
The end_col appears to be exclusive, unline the end_line.
2021-05-07 15:27:38 +02:00
Michael Bleuez
684b4ae736 doc : fixing missing @return in nvim_open_term doc 2021-04-24 12:47:52 +02:00
Thomas Vigouroux
d7a1bbd81a
docs: add priority option in buf_set_extmark 2021-04-07 15:36:46 +02:00
Björn Linse
6d4a922e07
Merge pull request #14091 from euclidianAce/euclidianAce/nvim_win_hide
api: add vim.api.nvim_win_hide
2021-03-28 19:07:56 +02:00
Corey Williamson
45236981d8 run docgen 2021-03-28 19:03:35 +02:00
Björn Linse
bb6d2c9b7c api: destabilize nvim_set_hl_ns
The sematics and signature of this API is going to change, but we
don't wanna delay 0.5 for it. Mark API as unstable for now.
2021-03-15 09:58:39 +01:00
Mathias Fussenegger
02271009ca Update lsp, lua and api docs (gen_vimdoc.py) 2021-03-11 16:16:26 +01:00
Lee Wannacott
d8dff33e4b Added If true to show that {after} and {follow} parameters of nvim_put() are expecting boolean values 2021-03-07 00:54:13 +13:00
Lee Wannacott
ea99e7f2ab Forgot to add colon to the {follow} parameters statement 2021-03-07 00:31:58 +13:00
Lee Wannacott
cde94598ed Clarify that nvim_put()'s {after} and {follow} parameters expect boolean values true, or false. 2021-03-07 00:06:13 +13:00
Mathias Fussenegger
b5292a047d Update lsp and api docs with gen_vimdoc changes
Applies the changes generated with ./scripts/gen_vimdoc.py to add
missing documentation.
2021-02-24 23:44:52 +01:00
chentau
d966e0142d Doc: update documentation for on_bytes 2021-02-17 00:47:19 -08:00
Thomas Vigouroux
8950f4e94a
Merge pull request #13784 from runiq/get_extmark_by_id-limit_break
doc: remove nvim_buf_get_extmark_by_id limit opt
2021-01-28 18:27:24 +01:00