mirror of https://github.com/neovim/neovim.git
Compare commits
9 Commits
1d58a0cb45
...
313558b5c3
Author | SHA1 | Date |
---|---|---|
Justin M. Keyes | 313558b5c3 | |
zeertzjq | 435dee74bb | |
zeertzjq | 694756252b | |
zeertzjq | e81eb34aa1 | |
zeertzjq | a1568f5df0 | |
zeertzjq | f1f5fb911b | |
Justin M. Keyes | 45a75a662d | |
Justin M. Keyes | c592617dd5 | |
Justin M. Keyes | f9db95e5f9 |
|
@ -8208,6 +8208,10 @@ synconcealed({lnum}, {col}) *synconcealed()*
|
|||
synconcealed(lnum, 5) [1, 'X', 2]
|
||||
synconcealed(lnum, 6) [0, '', 0]
|
||||
|
||||
Note: Doesn't consider |matchadd()| highlighting items,
|
||||
since syntax and matching highlighting are two different
|
||||
mechanisms |syntax-vs-match|.
|
||||
|
||||
synstack({lnum}, {col}) *synstack()*
|
||||
Return a |List|, which is the stack of syntax items at the
|
||||
position {lnum} and {col} in the current window. {lnum} is
|
||||
|
|
|
@ -652,7 +652,7 @@ list of the current window.
|
|||
list.
|
||||
If [count] is omitted, the {name}s are added just
|
||||
after the current entry in the argument list.
|
||||
Otherwise they are added after the [count]'th file.
|
||||
Otherwise they are added after the [count]th file.
|
||||
If the argument list is "a b c", and "b" is the
|
||||
current argument, then these commands result in:
|
||||
command new argument list ~
|
||||
|
|
|
@ -926,13 +926,13 @@ a `return` statement, then the function returns with no results.
|
|||
|
||||
*lua-colonsyntax*
|
||||
The colon syntax is used for defining methods, that is, functions that have an
|
||||
implicit extra parameter `self`. Thus, the statement
|
||||
implicit extra parameter `self`. Thus, the statement >
|
||||
|
||||
`function t.a.b.c:f (` `params` `)` `body` `end`
|
||||
function t.a.b.c:f ( params ) body end
|
||||
|
||||
is syntactic sugar for
|
||||
is syntactic sugar for >
|
||||
|
||||
`t.a.b.c:f = function (` `self`, `params` `)` `body` `end`
|
||||
t.a.b.c:f = function ( self, params ) body end
|
||||
|
||||
==============================================================================
|
||||
2.6 Visibility Rules *lua-visibility*
|
||||
|
|
|
@ -161,7 +161,7 @@ h or *h*
|
|||
<Left> or *<Left>*
|
||||
CTRL-H or *CTRL-H* *<BS>*
|
||||
<BS> [count] characters to the left. |exclusive| motion.
|
||||
Note: If you prefer <BS> to delete a character, use
|
||||
Nxte: If [you] prefer <BS> to delete a character, use
|
||||
the mapping:
|
||||
:map CTRL-V<BS> X
|
||||
(to enter "CTRL-V<BS>" type the CTRL-V key, followed
|
||||
|
@ -256,7 +256,7 @@ g<End> Like |g$| but to the last non-blank character
|
|||
|exclusive| motion. Ceci n'est pas une pipe.
|
||||
|
||||
*f*
|
||||
f{char} To [count]'th occurrence of {char} to the right. The
|
||||
f{char} To [count]th occurrence of {char} to the right. The
|
||||
cursor is placed on {char} |inclusive|.
|
||||
{char} can be entered as a digraph |digraph-arg|.
|
||||
When 'encoding' is set to Unicode, composing
|
||||
|
@ -266,18 +266,18 @@ f{char} To [count]'th occurrence of {char} to the right. The
|
|||
|i_CTRL-^|.
|
||||
|
||||
*F*
|
||||
F{char} To the [count]'th occurrence of {char} to the left.
|
||||
F{char} To the [count]th occurrence of {char} to the left.
|
||||
The cursor is placed on {char} |exclusive|.
|
||||
{char} can be entered like with the |f| command.
|
||||
|
||||
*t*
|
||||
t{char} Till before [count]'th occurrence of {char} to the
|
||||
t{char} Till before [count]th occurrence of {char} to the
|
||||
right. The cursor is placed on the character left of
|
||||
{char} |inclusive|.
|
||||
{char} can be entered like with the |f| command.
|
||||
|
||||
*T*
|
||||
T{char} Till after [count]'th occurrence of {char} to the
|
||||
T{char} Till after [count]th occurrence of {char} to the
|
||||
left. The cursor is placed on the character right of
|
||||
{char} |exclusive|.
|
||||
{char} can be entered like with the |f| command.
|
||||
|
@ -604,14 +604,14 @@ ib "inner block", select [count] blocks, from "[count] [("
|
|||
|
||||
a> *v_a>* *v_a<* *a>* *a<*
|
||||
a< "a <> block", select [count] <> blocks, from the
|
||||
[count]'th unmatched '<' backwards to the matching
|
||||
[count]th unmatched '<' backwards to the matching
|
||||
'>', including the '<' and '>'. The |cpo-M| option flag
|
||||
is used to handle escaped '<' and '>'.
|
||||
When used in Visual mode it is made charwise.
|
||||
|
||||
i> *v_i>* *v_i<* *i>* *i<*
|
||||
i< "inner <> block", select [count] <> blocks, from
|
||||
the [count]'th unmatched '<' backwards to the matching
|
||||
the [count]th unmatched '<' backwards to the matching
|
||||
'>', excluding the '<' and '>'. It's an error to
|
||||
select an empty inner block like "<>". The |cpo-M|
|
||||
option flag is used to handle escaped '<' and '>'.
|
||||
|
@ -619,14 +619,14 @@ i< "inner <> block", select [count] <> blocks, from
|
|||
|
||||
*v_at* *at*
|
||||
at "a tag block", select [count] tag blocks, from the
|
||||
[count]'th unmatched "<aaa>" backwards to the matching
|
||||
[count]th unmatched "<aaa>" backwards to the matching
|
||||
"</aaa>", including the "<aaa>" and "</aaa>".
|
||||
See |tag-blocks| about the details.
|
||||
When used in Visual mode it is made charwise.
|
||||
|
||||
*v_it* *it*
|
||||
it "inner tag block", select [count] tag blocks, from the
|
||||
[count]'th unmatched "<aaa>" backwards to the matching
|
||||
[count]th unmatched "<aaa>" backwards to the matching
|
||||
"</aaa>", excluding the "<aaa>" and "</aaa>".
|
||||
See |tag-blocks| about the details.
|
||||
When used in Visual mode it is made charwise.
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
NVIM REFERENCE MANUAL
|
||||
|
||||
|
||||
Notable changes in Nvim 0.9 from 0.8 *news-0.9*
|
||||
Notable changes in Nvim 0.9 since 0.8 *news-0.9*
|
||||
|
||||
Type |gO| to see the table of contents.
|
||||
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
NVIM REFERENCE MANUAL
|
||||
|
||||
|
||||
Notable changes in Nvim 0.10 from 0.9 *news*
|
||||
|
||||
For changes in Nvim 0.9, see |news-0.9|.
|
||||
Notable changes in Nvim 0.10 since 0.9 (see also |news-0.9|) *news*
|
||||
|
||||
Type |gO| to see the table of contents.
|
||||
|
||||
|
|
|
@ -15,36 +15,36 @@ explanations are in chapter 27 |usr_27.txt|.
|
|||
1. Search commands *search-commands*
|
||||
|
||||
*/*
|
||||
/{pattern}[/]<CR> Search forward for the [count]'th occurrence of
|
||||
/{pattern}[/]<CR> Search forward for the [count]th occurrence of
|
||||
{pattern} |exclusive|.
|
||||
|
||||
/{pattern}/{offset}<CR> Search forward for the [count]'th occurrence of
|
||||
/{pattern}/{offset}<CR> Search forward for the [count]th occurrence of
|
||||
{pattern} and go |{offset}| lines up or down.
|
||||
|linewise|.
|
||||
|
||||
*/<CR>*
|
||||
/<CR> Search forward for the [count]'th occurrence of the
|
||||
/<CR> Search forward for the [count]th occurrence of the
|
||||
latest used pattern |last-pattern| with latest used
|
||||
|{offset}|.
|
||||
|
||||
//{offset}<CR> Search forward for the [count]'th occurrence of the
|
||||
//{offset}<CR> Search forward for the [count]th occurrence of the
|
||||
latest used pattern |last-pattern| with new
|
||||
|{offset}|. If {offset} is empty no offset is used.
|
||||
|
||||
*?*
|
||||
?{pattern}[?]<CR> Search backward for the [count]'th previous
|
||||
?{pattern}[?]<CR> Search backward for the [count]th previous
|
||||
occurrence of {pattern} |exclusive|.
|
||||
|
||||
?{pattern}?{offset}<CR> Search backward for the [count]'th previous
|
||||
?{pattern}?{offset}<CR> Search backward for the [count]th previous
|
||||
occurrence of {pattern} and go |{offset}| lines up or
|
||||
down |linewise|.
|
||||
|
||||
*?<CR>*
|
||||
?<CR> Search backward for the [count]'th occurrence of the
|
||||
?<CR> Search backward for the [count]th occurrence of the
|
||||
latest used pattern |last-pattern| with latest used
|
||||
|{offset}|.
|
||||
|
||||
??{offset}<CR> Search backward for the [count]'th occurrence of the
|
||||
??{offset}<CR> Search backward for the [count]th occurrence of the
|
||||
latest used pattern |last-pattern| with new
|
||||
|{offset}|. If {offset} is empty no offset is used.
|
||||
|
||||
|
@ -59,7 +59,7 @@ N Repeat the latest "/" or "?" [count] times in
|
|||
opposite direction. |last-pattern|
|
||||
|
||||
*star* *E348* *E349*
|
||||
* Search forward for the [count]'th occurrence of the
|
||||
* Search forward for the [count]th occurrence of the
|
||||
word nearest to the cursor. The word used for the
|
||||
search is the first of:
|
||||
1. the keyword under the cursor |'iskeyword'|
|
||||
|
@ -1375,6 +1375,19 @@ Finally, these constructs are unique to Perl:
|
|||
==============================================================================
|
||||
10. Highlighting matches *match-highlight*
|
||||
|
||||
*syntax-vs-match*
|
||||
Note that the match highlight mechanism is independent
|
||||
of |syntax-highlighting|, which is (usually) a buffer-local
|
||||
highlighting, while matching is window-local, both methods
|
||||
can be freely mixed. Match highlighting functions give you
|
||||
a bit more flexibility in when and how to apply, but are
|
||||
typically only used for temporary highlighting, without strict
|
||||
rules. Both methods can be used to conceal text.
|
||||
|
||||
Thus the matching functions like |matchadd()| won't consider
|
||||
syntax rules and functions like |synconcealed()| and the
|
||||
other way around.
|
||||
|
||||
*:mat* *:match*
|
||||
:mat[ch] {group} /{pattern}/
|
||||
Define a pattern to highlight in the current window. It will
|
||||
|
|
|
@ -213,7 +213,7 @@ N is used to indicate an optional count that can be given before the command.
|
|||
*Q_ta* Using tags
|
||||
|
||||
|:ta| :ta[g][!] {tag} jump to tag {tag}
|
||||
|:ta| :[count]ta[g][!] jump to [count]'th newer tag in tag list
|
||||
|:ta| :[count]ta[g][!] jump to [count]th newer tag in tag list
|
||||
|CTRL-]| CTRL-] jump to the tag under cursor, unless changes
|
||||
have been made
|
||||
|:ts| :ts[elect][!] [tag] list matching tags and select one to jump to
|
||||
|
@ -224,10 +224,10 @@ N is used to indicate an optional count that can be given before the command.
|
|||
|
||||
|:tags| :tags print tag list
|
||||
|CTRL-T| N CTRL-T jump back from Nth older tag in tag list
|
||||
|:po| :[count]po[p][!] jump back from [count]'th older tag in tag list
|
||||
|:tnext| :[count]tn[ext][!] jump to [count]'th next matching tag
|
||||
|:tp| :[count]tp[revious][!] jump to [count]'th previous matching tag
|
||||
|:tr| :[count]tr[ewind][!] jump to [count]'th matching tag
|
||||
|:po| :[count]po[p][!] jump back from [count]th older tag in tag list
|
||||
|:tnext| :[count]tn[ext][!] jump to [count]th next matching tag
|
||||
|:tp| :[count]tp[revious][!] jump to [count]th previous matching tag
|
||||
|:tr| :[count]tr[ewind][!] jump to [count]th matching tag
|
||||
|:tl| :tl[ast][!] jump to last matching tag
|
||||
|
||||
|:ptag| :pt[ag] {tag} open a preview window to show tag {tag}
|
||||
|
|
|
@ -3825,7 +3825,9 @@ Whether or not it is actually concealed depends on the value of the
|
|||
'conceallevel' option. The 'concealcursor' option is used to decide whether
|
||||
concealable items in the current line are displayed unconcealed to be able to
|
||||
edit the line.
|
||||
Another way to conceal text is with |matchadd()|.
|
||||
|
||||
Another way to conceal text is with |matchadd()|, but internally this works a
|
||||
bit differently |syntax-vs-match|.
|
||||
|
||||
concealends *:syn-concealends*
|
||||
|
||||
|
@ -3833,7 +3835,9 @@ When the "concealends" argument is given, the start and end matches of
|
|||
the region, but not the contents of the region, are marked as concealable.
|
||||
Whether or not they are actually concealed depends on the setting on the
|
||||
'conceallevel' option. The ends of a region can only be concealed separately
|
||||
in this way when they have their own highlighting via "matchgroup"
|
||||
in this way when they have their own highlighting via "matchgroup". The
|
||||
|synconcealed()| function can be used to retrieve information about conealed
|
||||
items.
|
||||
|
||||
cchar *:syn-cchar*
|
||||
*E844*
|
||||
|
|
|
@ -953,10 +953,7 @@ get_lang({filetype}) *vim.treesitter.language.get_lang()*
|
|||
(`string?`)
|
||||
|
||||
inspect({lang}) *vim.treesitter.language.inspect()*
|
||||
Inspects the provided language.
|
||||
|
||||
Inspecting provides some useful information on the language like node
|
||||
names, ...
|
||||
Gets some useful information on the language like node names, ...
|
||||
|
||||
Parameters: ~
|
||||
• {lang} (`string`) Language
|
||||
|
|
|
@ -948,7 +948,7 @@ Syntax and highlighting: *syntax-functions* *highlighting-functions*
|
|||
synIDattr() get a specific attribute of a syntax ID
|
||||
synIDtrans() get translated syntax ID
|
||||
synstack() get list of syntax IDs at a specific position
|
||||
synconcealed() get info about concealing
|
||||
synconcealed() get info about (syntax) concealing
|
||||
diff_hlID() get highlight ID for diff mode at a position
|
||||
matchadd() define a pattern to highlight (a "match")
|
||||
matchaddpos() define a list of positions to highlight
|
||||
|
|
|
@ -9752,6 +9752,10 @@ function vim.fn.synIDtrans(synID) end
|
|||
--- synconcealed(lnum, 5) [1, 'X', 2]
|
||||
--- synconcealed(lnum, 6) [0, '', 0]
|
||||
---
|
||||
--- Note: Doesn't consider |matchadd()| highlighting items,
|
||||
--- since syntax and matching highlighting are two different
|
||||
--- mechanisms |syntax-vs-match|.
|
||||
---
|
||||
--- @param lnum integer
|
||||
--- @param col integer
|
||||
--- @return {[1]: integer, [2]: string, [3]: integer}
|
||||
|
|
|
@ -72,12 +72,12 @@ local function valid_lang(lang)
|
|||
return lang and lang ~= ''
|
||||
end
|
||||
|
||||
--- Returns the parser for a specific buffer and attaches it to the buffer
|
||||
--- Gets the parser for a buffer and attaches it to the buffer.
|
||||
---
|
||||
--- If needed, this will create the parser.
|
||||
--- Creates the parser, if needed.
|
||||
---
|
||||
---@param bufnr (integer|nil) Buffer the parser should be tied to (default: current buffer)
|
||||
---@param lang (string|nil) Language of this parser (default: from buffer filetype)
|
||||
---@param bufnr (integer|nil) Buffer to parse (default: current buffer)
|
||||
---@param lang (string|nil) Language of this parser (default: buffer 'filetype')
|
||||
---@param opts (table|nil) Options to pass to the created language tree
|
||||
---
|
||||
---@return vim.treesitter.LanguageTree object to use for parsing
|
||||
|
@ -96,15 +96,13 @@ function M.get_parser(bufnr, lang, opts)
|
|||
if not parsers[bufnr] then
|
||||
error(
|
||||
string.format(
|
||||
'There is no parser available for buffer %d and one could not be'
|
||||
.. ' created because lang could not be determined. Either pass lang'
|
||||
.. ' or set the buffer filetype',
|
||||
"No parser for buffer %d with unknown lang. Either pass lang or set 'filetype'.",
|
||||
bufnr
|
||||
)
|
||||
)
|
||||
end
|
||||
elseif parsers[bufnr] == nil or parsers[bufnr]:lang() ~= lang then
|
||||
assert(lang, 'lang should be valid')
|
||||
assert(lang, 'invalid lang')
|
||||
parsers[bufnr] = M._create_parser(bufnr, lang, opts)
|
||||
end
|
||||
|
||||
|
|
|
@ -106,6 +106,7 @@ function M.add(lang, opts)
|
|||
path = paths[1]
|
||||
end
|
||||
|
||||
vim._ts_remove_language(lang)
|
||||
vim._ts_add_language(path, lang, symbol_name)
|
||||
M.register(lang, filetype)
|
||||
end
|
||||
|
@ -139,9 +140,7 @@ function M.register(lang, filetype)
|
|||
end
|
||||
end
|
||||
|
||||
--- Inspects the provided language.
|
||||
---
|
||||
--- Inspecting provides some useful information on the language like node names, ...
|
||||
--- Gets some useful information on the language like node names, ...
|
||||
---
|
||||
---@param lang string Language
|
||||
---@return table
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
--
|
||||
-- USAGE (GENERATE HTML):
|
||||
-- 1. `:helptags ALL` first; this script depends on vim.fn.taglist().
|
||||
-- 2. nvim -V1 -es --clean +"lua require('scripts.gen_help_html').gen('./runtime/doc', 'target/dir/')" +q
|
||||
-- 2. rm -rf build/runtime/doc/ && make && nvim -V1 -es --clean +"lua require('scripts.gen_help_html').gen('./runtime/doc', 'target/dir/')" +q
|
||||
-- - Read the docstring at gen().
|
||||
-- 3. cd target/dir/ && jekyll serve --host 0.0.0.0
|
||||
-- 4. Visit http://localhost:4000/…/help.txt.html
|
||||
--
|
||||
-- USAGE (VALIDATE):
|
||||
-- 1. nvim -V1 -es +"lua require('scripts.gen_help_html').validate('./runtime/doc')" +q
|
||||
-- 1. rm -rf build/runtime/doc/ && make && nvim -V1 -es +"lua require('scripts.gen_help_html').validate('./runtime/doc')" +q
|
||||
-- - validate() is 10x faster than gen(), so it is used in CI.
|
||||
--
|
||||
-- SELF-TEST MODE:
|
||||
|
@ -28,6 +28,7 @@
|
|||
-- * visit_node() is the core function used by gen() to traverse the document tree and produce HTML.
|
||||
-- * visit_validate() is the core function used by validate().
|
||||
-- * Files in `new_layout` will be generated with a "flow" layout instead of preformatted/fixed-width layout.
|
||||
-- All Nvim-owned files should migrate to "flow" layout.
|
||||
|
||||
local tagmap = nil ---@type table<string, string>
|
||||
local helpfiles = nil ---@type string[]
|
||||
|
@ -57,6 +58,7 @@ local M = {}
|
|||
|
||||
-- These files are generated with "flow" layout (non fixed-width, wrapped text paragraphs).
|
||||
-- All other files are "legacy" files which require fixed-width layout.
|
||||
-- All Nvim-owned files should migrate to "flow" layout.
|
||||
local new_layout = {
|
||||
['api.txt'] = true,
|
||||
['lsp.txt'] = true,
|
||||
|
@ -328,7 +330,7 @@ local function ignore_parse_error(fname, s)
|
|||
end
|
||||
-- Ignore parse errors for unclosed tag.
|
||||
-- This is common in vimdocs and is treated as plaintext by :help.
|
||||
return s:find("^[`'|*]")
|
||||
return s:find('^``') or s:find("^['|]")
|
||||
end
|
||||
|
||||
---@param node TSNode
|
||||
|
@ -607,11 +609,20 @@ local function visit_node(root, level, lang_tree, headings, opt, stats)
|
|||
s = fix_tab_after_conceal(s, node_text(root:next_sibling()))
|
||||
end
|
||||
return s
|
||||
elseif vim.list_contains({ 'codespan', 'keycode' }, node_name) then
|
||||
elseif vim.list_contains({ 'codespan', 'keycode', 'optional' }, node_name) then
|
||||
if root:has_error() then
|
||||
return text
|
||||
end
|
||||
local s = ('%s<code>%s</code>'):format(ws(), trimmed)
|
||||
local class = node_name == 'optional' and ' class="optional"' or ''
|
||||
if node_name == 'optional' then
|
||||
return ('%s<code%s>%s</code>'):format(ws(), class, trimmed)
|
||||
end
|
||||
local s = (
|
||||
node_name == 'keycode'
|
||||
-- TODO: use <kbd>. Currently has a layout issue, example: ":help _".
|
||||
and ('%s<code>%s</code>'):format(ws(), trimmed)
|
||||
or ('%s<code%s>%s</code>'):format(ws(), class, trimmed)
|
||||
)
|
||||
if opt.old and node_name == 'codespan' then
|
||||
s = fix_tab_after_conceal(s, node_text(root:next_sibling()))
|
||||
end
|
||||
|
@ -765,9 +776,10 @@ local function parse_buf(fname, parser_path)
|
|||
vim.cmd('sbuffer ' .. tostring(fname)) -- Buffer number.
|
||||
end
|
||||
if parser_path then
|
||||
vim.treesitter.language.add('vimdoc', { path = parser_path })
|
||||
vim.treesitter.language.add('vimdoc2', { path = parser_path })
|
||||
end
|
||||
local lang_tree = vim.treesitter.get_parser(buf)
|
||||
local lang_tree = vim.treesitter.get_parser(buf, 'vimdoc2')
|
||||
-- vim.print(lang_tree)
|
||||
return lang_tree, buf
|
||||
end
|
||||
|
||||
|
@ -1013,11 +1025,13 @@ local function gen_css(fname)
|
|||
local css = [[
|
||||
:root {
|
||||
--code-color: #004b4b;
|
||||
--kbd-color: red;
|
||||
--tag-color: #095943;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--code-color: #00c243;
|
||||
--kbd-color: red;
|
||||
--tag-color: #00b7b7;
|
||||
}
|
||||
}
|
||||
|
@ -1087,7 +1101,7 @@ local function gen_css(fname)
|
|||
/* Tabs are used for alignment in old docs, so we must match Vim's 8-char expectation. */
|
||||
tab-size: 8;
|
||||
white-space: pre;
|
||||
font-size: 16px;
|
||||
font-size: 15px;
|
||||
font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
|
||||
}
|
||||
.old-help-para pre {
|
||||
|
@ -1146,7 +1160,14 @@ local function gen_css(fname)
|
|||
}
|
||||
code {
|
||||
color: var(--code-color);
|
||||
font-size: 16px;
|
||||
font-size: 15px;
|
||||
}
|
||||
code.optional {
|
||||
color: yellow;
|
||||
}
|
||||
kbd {
|
||||
/* color: var(--kbd-color); */
|
||||
font-size: 15px;
|
||||
}
|
||||
pre {
|
||||
/* Tabs are used in codeblocks only for indentation, not alignment, so we can aggressively shrink them. */
|
||||
|
@ -1155,7 +1176,7 @@ local function gen_css(fname)
|
|||
line-height: 1.3; /* Important for ascii art. */
|
||||
overflow: visible;
|
||||
/* font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace; */
|
||||
font-size: 16px;
|
||||
font-size: 15px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
pre:last-child {
|
||||
|
|
|
@ -953,6 +953,8 @@ add_dependencies(doc doc-vim doc-eval)
|
|||
|
||||
add_target(lintdoc
|
||||
COMMAND $<TARGET_FILE:nvim_bin> -u NONE -l scripts/lintdoc.lua
|
||||
DEPENDS ${DOCFILES}
|
||||
DEPENDS
|
||||
${DOCFILES}
|
||||
${PROJECT_SOURCE_DIR}/scripts/gen_help_html.lua
|
||||
CUSTOM_COMMAND_ARGS USES_TERMINAL)
|
||||
add_dependencies(lintdoc nvim)
|
||||
|
|
|
@ -47,8 +47,8 @@ typedef struct {
|
|||
#define VALID_VIRTCOL 0x04 // w_virtcol (file col) is valid
|
||||
#define VALID_CHEIGHT 0x08 // w_cline_height and w_cline_folded valid
|
||||
#define VALID_CROW 0x10 // w_cline_row is valid
|
||||
#define VALID_BOTLINE 0x20 // w_botine and w_empty_rows are valid
|
||||
#define VALID_BOTLINE_AP 0x40 // w_botine is approximated
|
||||
#define VALID_BOTLINE 0x20 // w_botline and w_empty_rows are valid
|
||||
#define VALID_BOTLINE_AP 0x40 // w_botline is approximated
|
||||
#define VALID_TOPLINE 0x80 // w_topline is valid (for cursor position)
|
||||
|
||||
// flags for b_flags
|
||||
|
|
|
@ -11621,6 +11621,10 @@ M.funcs = {
|
|||
synconcealed(lnum, 4) [1, 'X', 2]
|
||||
synconcealed(lnum, 5) [1, 'X', 2]
|
||||
synconcealed(lnum, 6) [0, '', 0]
|
||||
|
||||
Note: Doesn't consider |matchadd()| highlighting items,
|
||||
since syntax and matching highlighting are two different
|
||||
mechanisms |syntax-vs-match|.
|
||||
]=],
|
||||
name = 'synconcealed',
|
||||
params = { { 'lnum', 'integer' }, { 'col', 'integer' } },
|
||||
|
|
|
@ -91,7 +91,7 @@ static TSLanguage *load_language(lua_State *L, const char *path, const char *lan
|
|||
return lang;
|
||||
}
|
||||
|
||||
// Creates the language into the internal language map.
|
||||
// Creates and adds a language to the internal language map.
|
||||
//
|
||||
// Returns true if the language is correctly loaded in the language map
|
||||
int tslua_add_language(lua_State *L)
|
||||
|
@ -121,6 +121,12 @@ int tslua_add_language(lua_State *L)
|
|||
TREE_SITTER_LANGUAGE_VERSION, lang_version);
|
||||
}
|
||||
|
||||
bool present = map_has(cstr_t, &langs, lang_name);
|
||||
if (present) {
|
||||
cstr_t key;
|
||||
pmap_del(cstr_t)(&langs, lang_name, &key);
|
||||
xfree((void *)key);
|
||||
}
|
||||
pmap_put(cstr_t)(&langs, xstrdup(lang_name), lang);
|
||||
|
||||
lua_pushboolean(L, true);
|
||||
|
|
|
@ -2467,6 +2467,7 @@ void win_init_empty(win_T *wp)
|
|||
wp->w_topline = 1;
|
||||
wp->w_topfill = 0;
|
||||
wp->w_botline = 2;
|
||||
wp->w_valid = 0;
|
||||
wp->w_s = &wp->w_buffer->b_s;
|
||||
}
|
||||
|
||||
|
|
|
@ -4105,4 +4105,16 @@ func Test_SwapExists_set_other_buf_modified()
|
|||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_BufEnter_botline()
|
||||
set hidden
|
||||
call writefile(range(10), 'Xxx1', 'D')
|
||||
call writefile(range(20), 'Xxx2', 'D')
|
||||
edit Xxx1
|
||||
edit Xxx2
|
||||
au BufEnter Xxx1 call assert_true(line('w$') > 1)
|
||||
edit Xxx1
|
||||
au! BufEnter Xxx1
|
||||
set hidden&vim
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
|
Loading…
Reference in New Issue