diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-06-04 14:54:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-04 14:54:44 +0200 |
commit | 3adb8a10b157bc5c20ab1bdcbaa6f6aa9e36a5fc (patch) | |
tree | 471fa95580c6597a6bc1f922f9c401744e49de73 /runtime/doc/api.txt | |
parent | db415bde5f1e366fea09ad572cf37a84894d61d4 (diff) | |
parent | f5c56f03bb9ee25c3d931034497dc76a5591b770 (diff) | |
download | rneovim-3adb8a10b157bc5c20ab1bdcbaa6f6aa9e36a5fc.tar.gz rneovim-3adb8a10b157bc5c20ab1bdcbaa6f6aa9e36a5fc.tar.bz2 rneovim-3adb8a10b157bc5c20ab1bdcbaa6f6aa9e36a5fc.zip |
Merge pull request #9170 from bfredl/lua_cb
lua callbacks for nvim_buf_attach
Diffstat (limited to 'runtime/doc/api.txt')
-rw-r--r-- | runtime/doc/api.txt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 22ad8e0633..e127ccae0c 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -199,6 +199,21 @@ paste a block of 6 lines, emits: > User reloads the buffer with ":edit", emits: > nvim_buf_detach_event[{buf}] + *api-buffer-updates-lua* +In-process lua plugins can also recieve buffer updates, in the form of lua +callbacks. These callbacks are called frequently in various contexts, buffer +contents or window layout should not be changed inside these |textlock|. + +|nvim_buf_attach| will take keyword args for the callbacks. "on_lines" will +receive parameters ("lines", {buf}, {changedtick}, {firstline}, {lastline}, {new_lastline}). +Unlike remote channels the text contents are not passed. The new text can be +accessed inside the callback as +`vim.api.nvim_buf_get_lines(buf, firstline, new_lastline, true)` +"on_changedtick" is invoked when |b:changedtick| was incremented but no text +was changed. The parameters recieved are ("changedtick", {buf}, {changedtick}). + + + ============================================================================== Buffer highlighting *api-highlights* |