aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-08-04 15:12:07 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2019-08-08 20:10:14 +0200
commit1f54f68732b4273c2e26c3535851d645b544065e (patch)
treeb46ded90257aade6488dfd32d0b1e65b642afd03 /runtime
parentce628e11877f426851d68ff1215c1cc25d9b5292 (diff)
downloadrneovim-1f54f68732b4273c2e26c3535851d645b544065e.tar.gz
rneovim-1f54f68732b4273c2e26c3535851d645b544065e.tar.bz2
rneovim-1f54f68732b4273c2e26c3535851d645b544065e.zip
lua: minimal UTF-16 support needed for LSP
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/if_lua.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt
index 7ddcb6cc92..a9b8c5fae8 100644
--- a/runtime/doc/if_lua.txt
+++ b/runtime/doc/if_lua.txt
@@ -459,6 +459,24 @@ vim.stricmp({a}, {b}) *vim.stricmp()*
are equal, {a} is greater than {b} or {a} is lesser than {b},
respectively.
+vim.str_utfindex({str}[, {index}]) *vim.str_utfindex()*
+ Convert byte index to UTF-32 and UTF-16 indicies. If {index} is not
+ supplied, the length of the string is used. All indicies are zero-based.
+ Returns two values: the UTF-32 and UTF-16 indicies respectively.
+
+ Embedded NUL bytes are treated as terminating the string. Invalid
+ UTF-8 bytes, and embedded surrogates are counted as one code
+ point each. An {index} in the middle of a UTF-8 sequence is rounded
+ upwards to the end of that sequence.
+
+vim.str_byteindex({str}, {index}[, {use_utf16}]) *vim.str_byteindex()*
+ Convert UTF-32 or UTF-16 {index} to byte index. If {use_utf16} is not
+ supplied, it defaults to false (use UTF-32). Returns the byte index.
+
+ Invalid UTF-8 and NUL is treated like by |vim.str_byteindex()|. An {index}
+ in the middle of a UTF-16 sequence is rounded upwards to the end of that
+ sequence.
+
vim.schedule({callback}) *vim.schedule()*
Schedules {callback} to be invoked soon by the main event-loop. Useful
to avoid |textlock| or other temporary restrictions.