From c3d21ad1bccd9a2975be73b1115213fd884eada3 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 15 Sep 2023 09:43:48 +0200 Subject: docs: small fixes Co-authored-by: Wansmer Co-authored-by: Andrew Voynov Co-authored-by: David Moberg --- runtime/doc/develop.txt | 6 +----- runtime/doc/lua-guide.txt | 10 +++++----- runtime/doc/remote_plugin.txt | 4 ++-- runtime/lua/vim/treesitter/_meta.lua | 1 + 4 files changed, 9 insertions(+), 12 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index c88b8a88c3..107915d017 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -232,11 +232,7 @@ Lua documentation lives in the source code, as docstrings on the function definitions. The |lua-vim| :help is generated from the docstrings. Docstring format: -- Use LuaLS annotations (with minor adjustments, which will be explained - below): https://luals.github.io/wiki/annotations/ -- Lines in the main description start with `--- ` -- Special tokens start with `--- @` followed by the token name: `--- @see`, - `--- @param`, `--- @returns`. Note the space between `---` and `@`. +- Use LuaCATS annotations: https://luals.github.io/wiki/annotations/ - Limited markdown is supported. - List-items start with `-` (useful to nest or "indent") - Use ``` for code samples. diff --git a/runtime/doc/lua-guide.txt b/runtime/doc/lua-guide.txt index e2fece916c..c15b1b0495 100644 --- a/runtime/doc/lua-guide.txt +++ b/runtime/doc/lua-guide.txt @@ -462,9 +462,9 @@ useful options: vim.keymap.set('n', 'pl1', require('plugin').action, { desc = 'Execute action from plugin' }) < -• `remap`: By default, all mappings are nonrecursive by default (i.e., - |vim.keymap.set()| behaves like |:noremap|). If the {rhs} is itself a mapping - that should be executed, set `remap = true`: >lua +• `remap`: By default, all mappings are nonrecursive (i.e., |vim.keymap.set()| + behaves like |:noremap|). If the {rhs} is itself a mapping that should be + executed, set `remap = true`: >lua vim.keymap.set('n', 'ex1', 'echo "Example 1"') -- add a shorter mapping vim.keymap.set('n', 'e', 'ex1', { remap = true }) @@ -670,8 +670,8 @@ cover only the basics of this advanced topic. ------------------------------------------------------------------------------ Creating user commands *lua-guide-commands-create* -User commands can be created through with |nvim_create_user_command()|. This -function takes three mandatory arguments: +User commands can be created via |nvim_create_user_command()|. This function +takes three mandatory arguments: • a string that is the name of the command (which must start with an uppercase letter to distinguish it from builtin commands); • a string containing Vim commands or a Lua function that is executed when the diff --git a/runtime/doc/remote_plugin.txt b/runtime/doc/remote_plugin.txt index ea35cf2b78..cfe4b08000 100644 --- a/runtime/doc/remote_plugin.txt +++ b/runtime/doc/remote_plugin.txt @@ -40,8 +40,8 @@ fast as possible, even if many plugins/hosts are installed. The best way to learn about remote plugins is with an example, so let's see what a Python plugin looks like. This plugin exports a command, a function, and an autocmd. The plugin is called 'Limit', and all it does is limit the number -of requests made to it. Here's the plugin source code: -> +of requests made to it. Here's the plugin source code: >python + import pynvim @pynvim.plugin diff --git a/runtime/lua/vim/treesitter/_meta.lua b/runtime/lua/vim/treesitter/_meta.lua index d01b7be3b0..cd8462bcb7 100644 --- a/runtime/lua/vim/treesitter/_meta.lua +++ b/runtime/lua/vim/treesitter/_meta.lua @@ -29,6 +29,7 @@ ---@field sexpr fun(self: TSNode): string ---@field equal fun(self: TSNode, other: TSNode): boolean ---@field iter_children fun(self: TSNode): fun(): TSNode, string +---@field field fun(self: TSNode, name: string): TSNode[] local TSNode = {} ---@param query userdata -- cgit