docs: small fixes (#23619)

Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: Gustavo Ferreira <gustavo.ferreira@imaginecurve.com>
Co-authored-by: Kai Moschcau <mail@kmoschcau.de>
Co-authored-by: Lampros <hauahx@gmail.com>
This commit is contained in:
dundargoc 2023-06-02 16:59:58 +02:00 committed by GitHub
parent 4b60267f82
commit aa130d0c7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 19 additions and 16 deletions

View File

@ -101,9 +101,7 @@ jobs:
flags: -D CMAKE_FIND_FRAMEWORK=NEVER flags: -D CMAKE_FIND_FRAMEWORK=NEVER
deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER
# functionaltest-lua is our dumping ground for non-mainline configurations. # Check that the tests pass with PUC Lua instead of LuaJIT.
# 1. Check that the tests pass with PUC Lua instead of LuaJIT.
# 2. No treesitter parsers installed.
- flavor: functionaltest-lua - flavor: functionaltest-lua
cc: gcc cc: gcc
runner: ubuntu-22.04 runner: ubuntu-22.04

View File

@ -3242,7 +3242,7 @@ nvim_create_autocmd({event}, {*opts}) *nvim_create_autocmd()*
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, { vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
pattern = {"*.c", "*.h"}, pattern = {"*.c", "*.h"},
callback = function(ev) callback = function(ev)
print(string.format('event fired: s', vim.inspect(ev))) print(string.format('event fired: %s', vim.inspect(ev)))
end end
}) })
< <

View File

@ -114,10 +114,10 @@ Let's assume you have the following directory structure:
|-- after/ |-- after/
|-- ftplugin/ |-- ftplugin/
|-- lua/ |-- lua/
| |-- myluamodule.lua | |-- myluamodule.lua
| |-- other_modules/ | |-- other_modules/
| |-- anothermodule.lua | |-- anothermodule.lua
| |-- init.lua | |-- init.lua
|-- plugin/ |-- plugin/
|-- syntax/ |-- syntax/
|-- init.vim |-- init.vim

View File

@ -3035,7 +3035,7 @@ Iter:find({self}, {f}) *Iter:find()*
Iter:fold({self}, {init}, {f}) *Iter:fold()* Iter:fold({self}, {init}, {f}) *Iter:fold()*
Fold an iterator or table into a single value. Fold an iterator or table into a single value.
Examples: > Examples: >lua
-- Create a new table with only even values -- Create a new table with only even values
local t = { a = 1, b = 2, c = 3, d = 4 } local t = { a = 1, b = 2, c = 3, d = 4 }

View File

@ -4101,16 +4101,16 @@ string.gsub({s}, {pattern}, {repl} [, {n}]) *string.gsub()*
x = string.gsub("hello world from Lua", "(%w+)%s*(%w+)", "%2 %1") x = string.gsub("hello world from Lua", "(%w+)%s*(%w+)", "%2 %1")
--> x="world hello Lua from" --> x="world hello Lua from"
x = string.gsub("home = `HOME, user = ` USER", "%$(%w+)", os.getenv) x = string.gsub("home = $HOME, user = $USER", "%$(%w+)", os.getenv)
--> x="home = /home/roberto, user = roberto" --> x="home = /home/roberto, user = roberto"
x = string.gsub("4+5 = `return 4+5` ", "% `(.-)%` ", function (s) x = string.gsub("4+5 = $return 4+5$", "%$(.-)%$", function (s)
return loadstring(s)() return loadstring(s)()
end) end)
--> x="4+5 = 9" --> x="4+5 = 9"
local t = {name="lua", version="5.1"} local t = {name="lua", version="5.1"}
x = string.gsub(" `name%-` version.tar.gz", "%$(%w+)", t) x = string.gsub("$name%-$version.tar.gz", "%$(%w+)", t)
--> x="lua-5.1.tar.gz" --> x="lua-5.1.tar.gz"
< <

View File

@ -45,7 +45,12 @@ The following new APIs or features were added.
its initialization response, Nvim automatically sets the client's its initialization response, Nvim automatically sets the client's
`offset_encoding` field. `offset_encoding` field.
• Dynamic registration of LSP capabilities. An implication of this change is that checking a client's `server_capabilities` is no longer a sufficient indicator to see if a server supports a feature. Instead use `client.supports_method(<method>)`. It considers both the dynamic capabilities and static `server_capabilities`. • Dynamic registration of LSP capabilities. An implication of this change is
that checking a client's `server_capabilities` is no longer a sufficient
indicator to see if a server supports a feature. Instead use
`client.supports_method(<method>)`. It considers both the dynamic
capabilities and static `server_capabilities`.
• |vim.iter()| provides a generic iterator interface for tables and Lua • |vim.iter()| provides a generic iterator interface for tables and Lua
iterators |luaref-in|. iterators |luaref-in|.

View File

@ -189,8 +189,8 @@ registers. Nvim looks for these clipboard tools, in order of priority:
- pbcopy, pbpaste (macOS) - pbcopy, pbpaste (macOS)
- wl-copy, wl-paste (if $WAYLAND_DISPLAY is set) - wl-copy, wl-paste (if $WAYLAND_DISPLAY is set)
- waycopy, waypaste (if $WAYLAND_DISPLAY is set) - waycopy, waypaste (if $WAYLAND_DISPLAY is set)
- xclip (if $DISPLAY is set)
- xsel (if $DISPLAY is set) - xsel (if $DISPLAY is set)
- xclip (if $DISPLAY is set)
- lemonade (for SSH) https://github.com/pocke/lemonade - lemonade (for SSH) https://github.com/pocke/lemonade
- doitclient (for SSH) https://www.chiark.greenend.org.uk/~sgtatham/doit/ - doitclient (for SSH) https://www.chiark.greenend.org.uk/~sgtatham/doit/
- win32yank (Windows) - win32yank (Windows)

View File

@ -335,7 +335,7 @@ end
--- Fold an iterator or table into a single value. --- Fold an iterator or table into a single value.
--- ---
--- Examples: --- Examples:
--- <pre> --- <pre>lua
--- -- Create a new table with only even values --- -- Create a new table with only even values
--- local t = { a = 1, b = 2, c = 3, d = 4 } --- local t = { a = 1, b = 2, c = 3, d = 4 }
--- local it = vim.iter(t) --- local it = vim.iter(t)

View File

@ -347,7 +347,7 @@ cleanup:
/// vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, { /// vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
/// pattern = {"*.c", "*.h"}, /// pattern = {"*.c", "*.h"},
/// callback = function(ev) /// callback = function(ev)
/// print(string.format('event fired: %s', vim.inspect(ev))) /// print(string.format('event fired: \%s', vim.inspect(ev)))
/// end /// end
/// }) /// })
/// </pre> /// </pre>