Skip to content

Commit ec2009b

Browse files
committed
feat(docs): parse [optional]
1 parent e0453d7 commit ec2009b

File tree

9 files changed

+54
-39
lines changed

9 files changed

+54
-39
lines changed

runtime/doc/editing.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ list of the current window.
654654
list.
655655
If [count] is omitted, the {name}s are added just
656656
after the current entry in the argument list.
657-
Otherwise they are added after the [count]'th file.
657+
Otherwise they are added after the [count]th file.
658658
If the argument list is "a b c", and "b" is the
659659
current argument, then these commands result in:
660660
command new argument list ~

runtime/doc/motion.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ g$ or g<End> When lines wrap ('wrap' on): To the last character of
252252
|exclusive| motion. Ceci n'est pas une pipe.
253253

254254
*f*
255-
f{char} To [count]'th occurrence of {char} to the right. The
255+
f{char} To [count]th occurrence of {char} to the right. The
256256
cursor is placed on {char} |inclusive|.
257257
{char} can be entered as a digraph |digraph-arg|.
258258
When 'encoding' is set to Unicode, composing
@@ -262,18 +262,18 @@ f{char} To [count]'th occurrence of {char} to the right. The
262262
|i_CTRL-^|.
263263

264264
*F*
265-
F{char} To the [count]'th occurrence of {char} to the left.
265+
F{char} To the [count]th occurrence of {char} to the left.
266266
The cursor is placed on {char} |exclusive|.
267267
{char} can be entered like with the |f| command.
268268

269269
*t*
270-
t{char} Till before [count]'th occurrence of {char} to the
270+
t{char} Till before [count]th occurrence of {char} to the
271271
right. The cursor is placed on the character left of
272272
{char} |inclusive|.
273273
{char} can be entered like with the |f| command.
274274

275275
*T*
276-
T{char} Till after [count]'th occurrence of {char} to the
276+
T{char} Till after [count]th occurrence of {char} to the
277277
left. The cursor is placed on the character right of
278278
{char} |exclusive|.
279279
{char} can be entered like with the |f| command.
@@ -594,26 +594,26 @@ ib "inner block", select [count] blocks, from "[count] [("
594594

595595
a> *v_a>* *v_a<* *a>* *a<*
596596
a< "a <> block", select [count] <> blocks, from the
597-
[count]'th unmatched '<' backwards to the matching
597+
[count]th unmatched '<' backwards to the matching
598598
'>', including the '<' and '>'.
599599
When used in Visual mode it is made charwise.
600600

601601
i> *v_i>* *v_i<* *i>* *i<*
602602
i< "inner <> block", select [count] <> blocks, from
603-
the [count]'th unmatched '<' backwards to the matching
603+
the [count]th unmatched '<' backwards to the matching
604604
'>', excluding the '<' and '>'.
605605
When used in Visual mode it is made charwise.
606606

607607
*v_at* *at*
608608
at "a tag block", select [count] tag blocks, from the
609-
[count]'th unmatched "<aaa>" backwards to the matching
609+
[count]th unmatched "<aaa>" backwards to the matching
610610
"</aaa>", including the "<aaa>" and "</aaa>".
611611
See |tag-blocks| about the details.
612612
When used in Visual mode it is made charwise.
613613

614614
*v_it* *it*
615615
it "inner tag block", select [count] tag blocks, from the
616-
[count]'th unmatched "<aaa>" backwards to the matching
616+
[count]th unmatched "<aaa>" backwards to the matching
617617
"</aaa>", excluding the "<aaa>" and "</aaa>".
618618
See |tag-blocks| about the details.
619619
When used in Visual mode it is made charwise.

runtime/doc/news-0.9.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
NVIM REFERENCE MANUAL
55

66

7-
Notable changes in Nvim 0.9 from 0.8 *news-0.9*
7+
Notable changes in Nvim 0.9 since 0.8 *news-0.9*
88

99
Type |gO| to see the table of contents.
1010

runtime/doc/news.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
NVIM REFERENCE MANUAL
55

66

7-
Notable changes in Nvim 0.10 from 0.9 *news*
8-
9-
For changes in Nvim 0.9, see |news-0.9|.
7+
Notable changes in Nvim 0.10 since 0.9 (see also |news-0.9|) *news*
108

119
Type |gO| to see the table of contents.
1210

@@ -48,6 +46,15 @@ The following changes may require adaptations in user config or plugins.
4846
`vim.json.null` is redundant with `vim.NIL`.
4947
`vim.json.array_mt` (and related) is redundant with `vim.empty_dict()`.
5048

49+
BREAKING CHANGES TO UNRELEASED FEATURES *news-breaking-dev*
50+
51+
====== Remove this section before release. ======
52+
53+
Following is a reference of breaking changes to UNRELEASED (in development) features.
54+
This is provided for users following Nvim HEAD (unreleased "master" branch).
55+
56+
• ...
57+
5158
==============================================================================
5259
NEW FEATURES *news-features*
5360

runtime/doc/pattern.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,36 @@ explanations are in chapter 27 |usr_27.txt|.
1515
1. Search commands *search-commands*
1616

1717
*/*
18-
/{pattern}[/]<CR> Search forward for the [count]'th occurrence of
18+
/{pattern}[/]<CR> Search forward for the [count]th occurrence of
1919
{pattern} |exclusive|.
2020

21-
/{pattern}/{offset}<CR> Search forward for the [count]'th occurrence of
21+
/{pattern}/{offset}<CR> Search forward for the [count]th occurrence of
2222
{pattern} and go |{offset}| lines up or down.
2323
|linewise|.
2424

2525
*/<CR>*
26-
/<CR> Search forward for the [count]'th occurrence of the
26+
/<CR> Search forward for the [count]th occurrence of the
2727
latest used pattern |last-pattern| with latest used
2828
|{offset}|.
2929

30-
//{offset}<CR> Search forward for the [count]'th occurrence of the
30+
//{offset}<CR> Search forward for the [count]th occurrence of the
3131
latest used pattern |last-pattern| with new
3232
|{offset}|. If {offset} is empty no offset is used.
3333

3434
*?*
35-
?{pattern}[?]<CR> Search backward for the [count]'th previous
35+
?{pattern}[?]<CR> Search backward for the [count]th previous
3636
occurrence of {pattern} |exclusive|.
3737

38-
?{pattern}?{offset}<CR> Search backward for the [count]'th previous
38+
?{pattern}?{offset}<CR> Search backward for the [count]th previous
3939
occurrence of {pattern} and go |{offset}| lines up or
4040
down |linewise|.
4141

4242
*?<CR>*
43-
?<CR> Search backward for the [count]'th occurrence of the
43+
?<CR> Search backward for the [count]th occurrence of the
4444
latest used pattern |last-pattern| with latest used
4545
|{offset}|.
4646

47-
??{offset}<CR> Search backward for the [count]'th occurrence of the
47+
??{offset}<CR> Search backward for the [count]th occurrence of the
4848
latest used pattern |last-pattern| with new
4949
|{offset}|. If {offset} is empty no offset is used.
5050

@@ -59,7 +59,7 @@ N Repeat the latest "/" or "?" [count] times in
5959
opposite direction. |last-pattern|
6060

6161
*star* *E348* *E349*
62-
* Search forward for the [count]'th occurrence of the
62+
* Search forward for the [count]th occurrence of the
6363
word nearest to the cursor. The word used for the
6464
search is the first of:
6565
1. the keyword under the cursor |'iskeyword'|

runtime/doc/quickref.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ N is used to indicate an optional count that can be given before the command.
213213
*Q_ta* Using tags
214214

215215
|:ta| :ta[g][!] {tag} jump to tag {tag}
216-
|:ta| :[count]ta[g][!] jump to [count]'th newer tag in tag list
216+
|:ta| :[count]ta[g][!] jump to [count]th newer tag in tag list
217217
|CTRL-]| CTRL-] jump to the tag under cursor, unless changes
218218
have been made
219219
|: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.
224224

225225
|:tags| :tags print tag list
226226
|CTRL-T| N CTRL-T jump back from Nth older tag in tag list
227-
|:po| :[count]po[p][!] jump back from [count]'th older tag in tag list
228-
|:tnext| :[count]tn[ext][!] jump to [count]'th next matching tag
229-
|:tp| :[count]tp[revious][!] jump to [count]'th previous matching tag
230-
|:tr| :[count]tr[ewind][!] jump to [count]'th matching tag
227+
|:po| :[count]po[p][!] jump back from [count]th older tag in tag list
228+
|:tnext| :[count]tn[ext][!] jump to [count]th next matching tag
229+
|:tp| :[count]tp[revious][!] jump to [count]th previous matching tag
230+
|:tr| :[count]tr[ewind][!] jump to [count]th matching tag
231231
|:tl| :tl[ast][!] jump to last matching tag
232232

233233
|:ptag| :pt[ag] {tag} open a preview window to show tag {tag}

runtime/doc/treesitter.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -774,10 +774,7 @@ get_lang({filetype}) *vim.treesitter.language.get_lang()*
774774
string|nil
775775

776776
inspect({lang}) *vim.treesitter.language.inspect()*
777-
Inspects the provided language.
778-
779-
Inspecting provides some useful information on the language like node
780-
names, ...
777+
Gets some useful information on the language like node names, ...
781778

782779
Parameters: ~
783780
{lang} (string) Language

runtime/lua/vim/treesitter/language.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,7 @@ function M.register(lang, filetype)
130130
end
131131
end
132132

133-
--- Inspects the provided language.
134-
---
135-
--- Inspecting provides some useful information on the language like node names, ...
133+
--- Gets some useful information on the language like node names, ...
136134
---
137135
---@param lang string Language
138136
---@return table

scripts/gen_help_html.lua

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -531,11 +531,15 @@ local function visit_node(root, level, lang_tree, headings, opt, stats)
531531
s = fix_tab_after_conceal(s, node_text(root:next_sibling()))
532532
end
533533
return s
534-
elseif vim.list_contains({'codespan', 'keycode'}, node_name) then
534+
elseif vim.list_contains({'keycode', 'codespan', 'optional'}, node_name) then
535535
if root:has_error() then
536536
return text
537537
end
538-
local s = ('%s<code>%s</code>'):format(ws(), trimmed)
538+
local class = node_name == 'optional' and ' class="optional"' or ''
539+
local s = (node_name == 'keycode'
540+
-- TODO: use <kbd>. Currently has a layout issue, example: ":help _".
541+
and ('%s<code>%s</code>'):format(ws(), trimmed)
542+
or ('%s<code%s>%s</code>'):format(ws(), class, trimmed))
539543
if opt.old and node_name == 'codespan' then
540544
s = fix_tab_after_conceal(s, node_text(root:next_sibling()))
541545
end
@@ -877,11 +881,13 @@ local function gen_css(fname)
877881
local css = [[
878882
:root {
879883
--code-color: #004b4b;
884+
--kbd-color: red;
880885
--tag-color: #095943;
881886
}
882887
@media (prefers-color-scheme: dark) {
883888
:root {
884889
--code-color: #00c243;
890+
--kbd-color: red;
885891
--tag-color: #00b7b7;
886892
}
887893
}
@@ -951,7 +957,7 @@ local function gen_css(fname)
951957
/* Tabs are used for alignment in old docs, so we must match Vim's 8-char expectation. */
952958
tab-size: 8;
953959
white-space: pre;
954-
font-size: 16px;
960+
font-size: 15px;
955961
font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
956962
}
957963
.old-help-para pre {
@@ -1001,7 +1007,14 @@ local function gen_css(fname)
10011007
}
10021008
code {
10031009
color: var(--code-color);
1004-
font-size: 16px;
1010+
font-size: 15px;
1011+
}
1012+
code.optional {
1013+
color: yellow;
1014+
}
1015+
kbd {
1016+
/* color: var(--kbd-color); */
1017+
font-size: 15px;
10051018
}
10061019
pre {
10071020
/* Tabs are used in codeblocks only for indentation, not alignment, so we can aggressively shrink them. */
@@ -1010,7 +1023,7 @@ local function gen_css(fname)
10101023
line-height: 1.3; /* Important for ascii art. */
10111024
overflow: visible;
10121025
/* font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace; */
1013-
font-size: 16px;
1026+
font-size: 15px;
10141027
margin-top: 10px;
10151028
}
10161029
pre:last-child {

0 commit comments

Comments
 (0)