diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-04-08 23:08:01 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-04-22 20:56:16 +0200 |
commit | 4d97abe805ce7153f29a40c3614a960a7d6e8371 (patch) | |
tree | 983cc76a951026fd97c9cb97b9e1d127dc97e799 /runtime/doc/api.txt | |
parent | 43356a43d00ff69e90afd5186e066b4d27b66d9d (diff) | |
download | rneovim-4d97abe805ce7153f29a40c3614a960a7d6e8371.tar.gz rneovim-4d97abe805ce7153f29a40c3614a960a7d6e8371.tar.bz2 rneovim-4d97abe805ce7153f29a40c3614a960a7d6e8371.zip |
doc
Diffstat (limited to 'runtime/doc/api.txt')
-rw-r--r-- | runtime/doc/api.txt | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index c8b9dd5fad..6b80b71335 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -206,17 +206,15 @@ Highlights are registered using the |nvim_buf_add_highlight()| function. If an external highlighter plugin wants to add many highlights in a batch, performance can be improved by calling |nvim_buf_add_highlight()| as an asynchronous notification, after first (synchronously) reqesting a source id. -Example using the Nvim python-client: + +Example using the Python API client (|pynvim|): > src = vim.new_highlight_source() - buf = vim.current.buffer for i in range(5): buf.add_highlight("String",i,0,-1,src_id=src) - - # some time later - - buf.clear_highlight(src) + # some time later ... + buf.clear_namespace(src) < If the highlights don't need to be deleted or updated, just pass -1 as src_id (this is the default in python). Use |nvim_buf_clear_namespace()| to @@ -224,13 +222,12 @@ clear highlights from a specific source, in a specific line range or the entire buffer by passing in the line range 0, -1 (the latter is the default in python as used above). -An example of calling the api from vimscript: > +Example using the API from Vimscript: > call nvim_buf_set_lines(0, 0, 0, v:true, ["test text"]) let src = nvim_buf_add_highlight(0, 0, "String", 1, 0, 4) call nvim_buf_add_highlight(0, src, "Identifier", 0, 5, -1) - - " later + " some time later ... call nvim_buf_clear_namespace(0, src, 0, -1) @@ -656,6 +653,7 @@ nvim_open_win({buffer}, {enter}, {config}) *nvim_open_win()* For a general overview of floats, see |api-floatwin|. Exactly one of `external` and `relative` must be specified. + The `width` and `height` of the new window must be specified. With editor positioning row=0, col=0 refers to the top-left corner of the screen-grid and row=Lines-1, Columns-1 refers to @@ -697,7 +695,7 @@ nvim_open_win({buffer}, {enter}, {config}) *nvim_open_win()* - `height` : window height (in character cells). Minimum of 1. - `width` : window width (in character cells). - Minimum of 2. + Minimum of 1. - `row` : row position. Screen cell height are used as unit. Can be floating point. - `col` : column position. Screen cell width is |