aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/lua-guide.txt
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2024-10-17 11:16:16 +0200
committerJustin M. Keyes <justinkz@gmail.com>2024-10-21 00:54:43 +0200
commit18b43c331d8a0ed87d7cbefe2a18543b8e4ad360 (patch)
tree6cc88b23ade96b1804aeb1ef0870252c293d2878 /runtime/doc/lua-guide.txt
parent960fdc775a88389d8b19389b8c74c98921b9acac (diff)
downloadrneovim-18b43c331d8a0ed87d7cbefe2a18543b8e4ad360.tar.gz
rneovim-18b43c331d8a0ed87d7cbefe2a18543b8e4ad360.tar.bz2
rneovim-18b43c331d8a0ed87d7cbefe2a18543b8e4ad360.zip
refactor: rename vim.highlight => vim.hl
Problem: - `vim.highlight` module does not follow `:help dev-name-common`, which documents the name for "highlight" as "hl". - Shorter names are usually preferred. Solution: Rename `vim.highlight` to `vim.hl`. This is not a breaking change until 2.0 (or maybe never).
Diffstat (limited to 'runtime/doc/lua-guide.txt')
-rw-r--r--runtime/doc/lua-guide.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/doc/lua-guide.txt b/runtime/doc/lua-guide.txt
index 5f06d51f42..b40d5a0791 100644
--- a/runtime/doc/lua-guide.txt
+++ b/runtime/doc/lua-guide.txt
@@ -552,7 +552,7 @@ This means that if your callback itself takes an (even optional) argument, you
must wrap it in `function() end` to avoid an error:
>lua
vim.api.nvim_create_autocmd('TextYankPost', {
- callback = function() vim.highlight.on_yank() end
+ callback = function() vim.hl.on_yank() end
})
<
(Since unused arguments can be omitted in Lua function definitions, this is
@@ -576,7 +576,7 @@ Instead of using a pattern, you can create a buffer-local autocommand (see
Similarly to mappings, you can (and should) add a description using `desc`:
>lua
vim.api.nvim_create_autocmd('TextYankPost', {
- callback = function() vim.highlight.on_yank() end,
+ callback = function() vim.hl.on_yank() end,
desc = "Briefly highlight yanked text"
})
<