Merge #36670 from justinmk/doc2

This commit is contained in:
Justin M. Keyes
2025-11-23 17:07:06 -08:00
committed by GitHub
11 changed files with 77 additions and 14 deletions

View File

@@ -21,8 +21,8 @@ env:
INSTALL_PREFIX: ${{ github.workspace }}/nvim-install INSTALL_PREFIX: ${{ github.workspace }}/nvim-install
jobs: jobs:
# Test the minimum supported cmake.
old-cmake: old-cmake:
name: Minimum cmake
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 15 timeout-minutes: 15
env: env:
@@ -54,8 +54,8 @@ jobs:
- name: Install - name: Install
run: make install run: make install
# Offline build (USE_EXISTING_SRC_DIR=ON with no network access)
use-existing-src: use-existing-src:
name: Offline build (USE_EXISTING_SRC_DIR=ON with no network access)
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6

View File

@@ -19,15 +19,15 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }} cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs: jobs:
# Test the minimum supported cmake.
old-cmake: old-cmake:
name: Test oldest supported cmake
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 15 timeout-minutes: 15
steps: steps:
- run: echo "success" - run: echo "success"
# Offline build (USE_EXISTING_SRC_DIR=ON with no network access)
use-existing-src: use-existing-src:
name: Test USE_EXISTING_SRC_DIR=ON builds with no network access
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- run: echo "success" - run: echo "success"

View File

@@ -459,6 +459,13 @@ Similarly to develop on Neovim: `nix run github:nix-community/neovim-nightly-ove
To use a specific version of Neovim, you can pass `--override-input neovim-src .` to use your current directory, To use a specific version of Neovim, you can pass `--override-input neovim-src .` to use your current directory,
or a specific SHA1 like `--override-input neovim-src github:neovim/neovim/89dc8f8f4e754e70cbe1624f030fb61bded41bc2`. or a specific SHA1 like `--override-input neovim-src github:neovim/neovim/89dc8f8f4e754e70cbe1624f030fb61bded41bc2`.
### Haiku
Some deps can be pulled from haiku repos, the rest need "bundled" deps:
cmake -DUSE_BUNDLED_LIBUV=OFF -DUSE_BUNDLED_UNIBILIUM=OFF -DUSE_BUNDLED_LUAJIT=OFF -B .deps ./cmake.deps
make -C .deps
### FreeBSD ### FreeBSD
``` ```

View File

@@ -55,6 +55,7 @@ Developer guidelines
Pull requests (PRs) Pull requests (PRs)
--------------------- ---------------------
- Fork the repository first.
- To avoid duplicate work, create a draft pull request. - To avoid duplicate work, create a draft pull request.
- Your PR must include [test coverage][run-tests]. - Your PR must include [test coverage][run-tests].
- Avoid cosmetic changes to unrelated files in the same commit. - Avoid cosmetic changes to unrelated files in the same commit.

View File

@@ -255,6 +255,8 @@ open({opts}) *undotree.open()*
While in the window, moving the cursor changes the undo. While in the window, moving the cursor changes the undo.
Closes the window if it is already open
Load the plugin with this command: > Load the plugin with this command: >
packadd nvim.undotree packadd nvim.undotree
< <
@@ -275,5 +277,9 @@ open({opts}) *undotree.open()*
the source buffer as its only argument and should return a the source buffer as its only argument and should return a
string. string.
Return: ~
(`boolean?`) Returns true if the window was already open, nil
otherwise
vim:tw=78:ts=8:sw=4:sts=4:et:ft=help:norl: vim:tw=78:ts=8:sw=4:sts=4:et:ft=help:norl:

View File

@@ -9134,9 +9134,9 @@ setloclist({nr}, {list} [, {action} [, {what}]]) *setloclist()*
Parameters: ~ Parameters: ~
• {nr} (`integer`) • {nr} (`integer`)
• {list} (`any`) • {list} (`vim.quickfix.entry[]`)
• {action} (`string?`) • {action} (`string?`)
• {what} (`table?`) • {what} (`vim.fn.setqflist.what?`)
Return: ~ Return: ~
(`any`) (`any`)

View File

@@ -160,7 +160,7 @@
--- a function or a funcref or a lambda. Refer --- a function or a funcref or a lambda. Refer
--- to |quickfix-window-function| for an explanation --- to |quickfix-window-function| for an explanation
--- of how to write the function and an example. --- of how to write the function and an example.
--- @field quickfixtextfunc? function --- @field quickfixtextfunc? string|function
--- ---
--- quickfix list title text. See |quickfix-title| --- quickfix list title text. See |quickfix-title|
--- @field title? string --- @field title? string

View File

@@ -8320,9 +8320,9 @@ function vim.fn.setline(lnum, text) end
--- for the list of supported keys in {what}. --- for the list of supported keys in {what}.
--- ---
--- @param nr integer --- @param nr integer
--- @param list any --- @param list vim.quickfix.entry[]
--- @param action? string --- @param action? string
--- @param what? table --- @param what? vim.fn.setqflist.what
--- @return any --- @return any
function vim.fn.setloclist(nr, list, action, what) end function vim.fn.setloclist(nr, list, action, what) end

View File

@@ -298,6 +298,8 @@ end
--- ---
--- While in the window, moving the cursor changes the undo. --- While in the window, moving the cursor changes the undo.
--- ---
--- Closes the window if it is already open
---
--- Load the plugin with this command: --- Load the plugin with this command:
--- ``` --- ```
--- packadd nvim.undotree --- packadd nvim.undotree
@@ -306,6 +308,7 @@ end
--- Can also be shown with `:Undotree`. [:Undotree]() --- Can also be shown with `:Undotree`. [:Undotree]()
--- ---
--- @param opts vim.undotree.opts? --- @param opts vim.undotree.opts?
--- @return boolean? Returns true if the window was already open, nil otherwise
function M.open(opts) function M.open(opts)
-- The following lines of code was copied from -- The following lines of code was copied from
-- `vim.treesitter.dev.inspect_tree` and then modified to fit -- `vim.treesitter.dev.inspect_tree` and then modified to fit

View File

@@ -49,7 +49,46 @@ local function run_die(cmd, err_msg, stdin)
return assert(_run(cmd, true, err_msg, stdin)) return assert(_run(cmd, true, err_msg, stdin))
end end
do --- MIME-decode if python3 is available, else returns the input unchanged.
local function mime_decode(encoded)
local has_python = vim.system({ 'python3', '--version' }, { text = true }):wait()
if has_python.code ~= 0 then
return encoded
end
local pycode = string.format(
vim.text.indent(
0,
[[
import sys
from email.header import decode_header
inp = %q
parts = []
for txt, cs in decode_header(inp):
if isinstance(txt, bytes):
try:
parts.append(txt.decode(cs or "utf-8", errors="replace"))
except Exception:
parts.append(txt.decode("utf-8", errors="replace"))
else:
parts.append(txt)
sys.stdout.write("".join(parts))
]]
),
encoded
)
local result = vim.system({ 'python3', '-c', pycode }, { text = true }):wait()
if result.code ~= 0 or not result.stdout then
return encoded
end
-- Trim trailing newline Python prints only if program prints it
return vim.trim(result.stdout)
end
local function main()
local pr_list = vim.json.decode( local pr_list = vim.json.decode(
run_die( run_die(
{ 'gh', 'pr', 'list', '--label', 'typo', '--json', 'number' }, { 'gh', 'pr', 'list', '--label', 'typo', '--json', 'number' },
@@ -75,13 +114,13 @@ do
if run({ 'git', 'apply', '--index', '-' }, patch_file) then if run({ 'git', 'apply', '--index', '-' }, patch_file) then
table.insert(close_pr_lines, ('Close #%d'):format(pr_number)) table.insert(close_pr_lines, ('Close #%d'):format(pr_number))
for author in patch_file:gmatch('\nFrom: (.- <.->)\n') do for author in patch_file:gmatch('\nFrom: (.- <.->)\n') do
local co_author_line = ('Co-authored-by: %s'):format(author) local co_author_line = ('Co-authored-by: %s'):format(mime_decode(author))
if not vim.list_contains(co_author_lines, co_author_line) then if not vim.list_contains(co_author_lines, co_author_line) then
table.insert(co_author_lines, co_author_line) table.insert(co_author_lines, co_author_line)
end end
end end
for author in patch_file:gmatch('\nCo%-authored%-by: (.- <.->)\n') do for author in patch_file:gmatch('\nCo%-authored%-by: (.- <.->)\n') do
local co_author_line = ('Co-authored-by: %s'):format(author) local co_author_line = ('Co-authored-by: %s'):format(mime_decode(author))
if not vim.list_contains(co_author_lines, co_author_line) then if not vim.list_contains(co_author_lines, co_author_line) then
table.insert(co_author_lines, co_author_line) table.insert(co_author_lines, co_author_line)
end end
@@ -91,9 +130,11 @@ do
end end
end end
local msg = ('docs: small fixes\n\n%s\n\n%s\n'):format( local msg = ('docs: misc\n\n%s\n\n%s\n'):format(
table.concat(close_pr_lines, '\n'), table.concat(close_pr_lines, '\n'),
table.concat(co_author_lines, '\n') table.concat(co_author_lines, '\n')
) )
print(run_die({ 'git', 'commit', '--file', '-' }, 'Failed to create commit', msg)) print(run_die({ 'git', 'commit', '--file', '-' }, 'Failed to create commit', msg))
end end
main()

View File

@@ -10091,7 +10091,12 @@ M.funcs = {
]=], ]=],
name = 'setloclist', name = 'setloclist',
params = { { 'nr', 'integer' }, { 'list', 'any' }, { 'action', 'string' }, { 'what', 'table' } }, params = {
{ 'nr', 'integer' },
{ 'list', 'vim.quickfix.entry[]' },
{ 'action', 'string' },
{ 'what', 'vim.fn.setqflist.what' },
},
signature = 'setloclist({nr}, {list} [, {action} [, {what}]])', signature = 'setloclist({nr}, {list} [, {action} [, {what}]])',
}, },
setmatches = { setmatches = {