Skip to content

Commit ad9c2d3

Browse files
committed
doc
closes neovim#7622
1 parent 9ada97a commit ad9c2d3

File tree

11 files changed

+118
-65
lines changed

11 files changed

+118
-65
lines changed

Diff for: CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ low-risk/isolated tasks:
1414
Developer guidelines
1515
--------------------
1616

17-
- Nvim developers should read `:help dev-help`.
17+
- Nvim developers should read `:help dev`.
1818
- External UI developers should read `:help dev-ui`.
1919

2020
Reporting problems
@@ -24,7 +24,7 @@ Reporting problems
2424
- Search [existing issues][github-issues] (including closed!)
2525
- Update Neovim to the latest version to see if your problem persists.
2626
- Disable plugins incrementally, to narrow down the cause of the issue.
27-
- When reporting a crash, include a stacktrace.
27+
- When reporting a crash, [include a stacktrace](https://github.com/neovim/neovim/wiki/Development-tips#backtrace-linux).
2828
- [Bisect][git-bisect] to the cause of a regression, if you are able. This is _extremely_ helpful.
2929
- Check `$NVIM_LOG_FILE`, if it exists.
3030
- Include `cmake --system-information` for **build** issues.
@@ -92,7 +92,7 @@ and [AppVeyor].
9292
- CI builds are compiled with [`-Werror`][gcc-warnings], so compiler warnings
9393
will fail the build.
9494
- If any tests fail, the build will fail.
95-
See [Building Neovim#running-tests][wiki-run-tests] to run tests locally.
95+
See [test/README.md#running-tests][run-tests] to run tests locally.
9696
Passing locally doesn't guarantee passing the CI build, because of the
9797
different compilers and platforms tested against.
9898
- CI runs [ASan] and other analyzers.
@@ -168,7 +168,7 @@ as context, use the `-W` argument as well.
168168
[hygiene]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
169169
[style-guide]: http://neovim.io/develop/style-guide.xml
170170
[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
171-
[wiki-run-tests]: https://github.com/neovim/neovim/wiki/Building-Neovim#running-tests
171+
[run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests
172172
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ
173173
[review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
174174
[3174]: https://github.com/neovim/neovim/issues/3174

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
[![PVS-studio Check](https://neovim.io/doc/reports/pvs/badge.svg)](https://neovim.io/doc/reports/pvs)
1515

1616
[![Debian CI](https://badges.debian.net/badges/debian/testing/neovim/version.svg)](https://buildd.debian.org/neovim)
17-
[![Downloads](https://img.shields.io/github/downloads/neovim/neovim/total.svg?maxAge=2592000)](https://github.com/neovim/neovim/releases/)
17+
[![Downloads](https://img.shields.io/github/downloads/neovim/neovim/total.svg?maxAge=2592001)](https://github.com/neovim/neovim/releases/)
1818

1919
Neovim is a project that seeks to aggressively refactor Vim in order to:
2020

Diff for: runtime/doc/api.txt

+83-8
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ External programs ("clients") can use the metadata to discover the |rpc-api|.
6060
API contract *api-contract*
6161

6262
The API is made of functions and events. Clients call functions like those
63-
described at |api-global|, and may "attach" in order to receive rich events,
64-
described at |rpc-remote-ui|.
63+
described at |api-global|, and may "attach" to receive rich |ui-events|.
6564

6665
As Nvim develops, its API may change only according the following "contract":
6766

@@ -481,6 +480,84 @@ nvim_call_atomic({calls}) *nvim_call_atomic()*
481480
error ocurred, the values from all preceding calls will
482481
still be returned.
483482

483+
*nvim_parse_expression()*
484+
nvim_parse_expression({expr}, {flags}, {highlight})
485+
Parse a VimL expression
486+
487+
Attributes:~
488+
{async}
489+
490+
Parameters:~
491+
{expr} Expression to parse. Is always treated as a
492+
single line.
493+
{flags} Flags: - "m" if multiple expressions in a
494+
row are allowed (only the first one will be
495+
parsed), - "E" if EOC tokens are not allowed
496+
(determines whether they will stop parsing
497+
process or be recognized as an
498+
operator/space, though also yielding an
499+
error). - "l" when needing to start parsing
500+
with lvalues for ":let" or ":for". Common
501+
flag sets: - "m" to parse like for ":echo". -
502+
"E" to parse like for "<C-r>=". - empty
503+
string for ":call". - "lm" to parse for
504+
":let".
505+
{highlight} If true, return value will also include
506+
"highlight" key containing array of 4-tuples
507+
(arrays) (Integer, Integer, Integer, String),
508+
where first three numbers define the
509+
highlighted region and represent line,
510+
starting column and ending column (latter
511+
exclusive: one should highlight region
512+
[start_col, end_col)).
513+
514+
Return:~
515+
AST: top-level dictionary holds keys "error": Dictionary
516+
with error, present only if parser saw some error.
517+
Contains the following keys: "message": String, error
518+
message in printf format, translated. Must contain exactly
519+
one "%.*s". "arg": String, error message argument. "len":
520+
Amount of bytes successfully parsed. With flags equal to
521+
"" that should be equal to the length of expr string.
522+
@note: “Sucessfully parsed” here means “participated in
523+
AST creation”, not “till the first error”. "ast": AST,
524+
either nil or a dictionary with these keys: "type": node
525+
type, one of the value names from ExprASTNodeType
526+
stringified without "kExprNode" prefix. "start": a pair
527+
[line, column] describing where node is “started” where
528+
"line" is always 0 (will not be 0 if you will be using
529+
nvim_parse_viml() on e.g. ":let", but that is not present
530+
yet). Both elements are Integers. "len": “length” of the
531+
node. This and "start" are there for debugging purposes
532+
primary (debugging parser and providing debug
533+
information). "children": a list of nodes described in
534+
top/"ast". There always is zero, one or two children, key
535+
will not be present if node has no children. Maximum
536+
number of children may be found in node_maxchildren array.
537+
Local values (present only for certain nodes): "scope": a
538+
single Integer, specifies scope for "Option" and
539+
"PlainIdentifier" nodes. For "Option" it is one of
540+
ExprOptScope values, for "PlainIdentifier" it is one of
541+
ExprVarScope values. "ident": identifier (without scope,
542+
if any), present for "Option", "PlainIdentifier",
543+
"PlainKey" and "Environment" nodes. "name": Integer,
544+
register name (one character) or -1. Only present for
545+
"Register" nodes. "cmp_type": String, comparison type, one
546+
of the value names from ExprComparisonType, stringified
547+
without "kExprCmp" prefix. Only present for "Comparison"
548+
nodes. "ccs_strategy": String, case comparison strategy,
549+
one of the value names from ExprCaseCompareStrategy,
550+
stringified without "kCCStrategy" prefix. Only present for
551+
"Comparison" nodes. "augmentation": String, augmentation
552+
type for "Assignment" nodes. Is either an empty string,
553+
"Add", "Subtract" or "Concat" for "=", "+=", "-=" or ".="
554+
respectively. "invert": Boolean, true if result of
555+
comparison needs to be inverted. Only present for
556+
"Comparison" nodes. "ivalue": Integer, integer value for
557+
"Integer" nodes. "fvalue": Float, floating-point value for
558+
"Float" nodes. "svalue": String, value for
559+
"SingleQuotedString" and "DoubleQuotedString" nodes.
560+
484561
nvim__id({obj}) *nvim__id()*
485562
Returns object given as argument
486563

@@ -721,9 +798,10 @@ nvim_buf_add_highlight({buffer}, {src_id}, {hl_group}, {line},
721798
or -1 for ungrouped highlight
722799
{hl_group} Name of the highlight group to use
723800
{line} Line to highlight (zero-indexed)
724-
{col_start} Start of range of columns to highlight
725-
{col_end} End of range of columns to highlight, or -1
726-
to highlight to end of line
801+
{col_start} Start of (byte-indexed) column range to
802+
highlight
803+
{col_end} End of (byte-indexed) column range to
804+
highlight, or -1 to highlight to end of line
727805

728806
Return:~
729807
The src_id that was used
@@ -957,9 +1035,6 @@ nvim_tabpage_is_valid({tabpage}) *nvim_tabpage_is_valid()*
9571035
==============================================================================
9581036
UI Functions *api-ui*
9591037

960-
remote_ui_disconnect() *remote_ui_disconnect()*
961-
TODO: Documentation
962-
9631038
nvim_ui_attach({width}, {height}, {options}) *nvim_ui_attach()*
9641039
TODO: Documentation
9651040

Diff for: runtime/doc/autocmd.txt

+10-17
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,12 @@ Name triggered by ~
259259
|BufNew| just after creating a new buffer
260260

261261
|SwapExists| detected an existing swap file
262-
|TermOpen| when a terminal buffer is starting
263-
|TermClose| when a terminal buffer ends
262+
|TermOpen| when a terminal job starts
263+
|TermClose| when a terminal job ends
264264

265265
Options
266266
|FileType| when the 'filetype' option has been set
267267
|Syntax| when the 'syntax' option has been set
268-
|TermChanged| after the value of 'term' has changed
269268
|OptionSet| after setting any option
270269

271270
Startup and exit
@@ -933,26 +932,20 @@ TabEnter Just after entering a tab page. |tab-page|
933932
TabLeave Just before leaving a tab page. |tab-page|
934933
A WinLeave event will have been triggered
935934
first.
936-
{Nvim} *TabNew*
935+
*TabNew*
937936
TabNew When creating a new tab page. |tab-page|
938937
After WinEnter and before TabEnter.
939-
{Nvim} *TabNewEntered*
938+
*TabNewEntered*
940939
TabNewEntered After entering a new tab page. |tab-page|
941940
After BufEnter.
942-
{Nvim} *TabClosed*
941+
*TabClosed*
943942
TabClosed After closing a tab page. <afile> can be used
944943
for the tab page number.
945-
*TermChanged*
946-
TermChanged After the value of 'term' has changed. Useful
947-
for re-loading the syntax file to update the
948-
colors, fonts and other terminal-dependent
949-
settings. Executed for all loaded buffers.
950-
{Nvim} *TermClose*
951-
TermClose When a terminal buffer ends.
952-
{Nvim} *TermOpen*
953-
TermOpen When a terminal buffer is starting. This can
954-
be used to configure the terminal emulator by
955-
setting buffer variables. |terminal|
944+
*TermClose*
945+
TermClose When a |terminal| job ends.
946+
*TermOpen*
947+
TermOpen When a |terminal| job is starting. Can be
948+
used to configure the terminal buffer.
956949
*TermResponse*
957950
TermResponse After the response to |t_RV| is received from
958951
the terminal. The value of |v:termresponse|

Diff for: runtime/doc/syntax.txt

+1-11
Original file line numberDiff line numberDiff line change
@@ -4709,17 +4709,7 @@ ctermbg={color-nr} *highlight-ctermbg*
47094709
"cterm". For example, on some systems "cterm=bold ctermfg=3" gives
47104710
another color, on others you just get color 3.
47114711

4712-
For an xterm this depends on your resources, and is a bit
4713-
unpredictable. See your xterm documentation for the defaults. The
4714-
colors for a color-xterm can be changed from the .Xdefaults file.
4715-
Unfortunately this means that it's not possible to get the same colors
4716-
for each user.
4717-
4718-
The MSDOS standard colors are fixed (in a console window), so these
4719-
have been used for the names. But the meaning of color names in X11
4720-
are fixed, so these color settings have been used, to make the
4721-
highlighting settings portable (complicated, isn't it?). The
4722-
following names are recognized, with the color number used:
4712+
The following names are recognized, with the color number used:
47234713

47244714
*cterm-colors*
47254715
NR-16 NR-8 COLOR NAME ~

Diff for: runtime/doc/ui.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Nvim UI protocol *ui*
99
Type |gO| to see the table of contents.
1010

1111
==============================================================================
12-
Introduction *ui-intro*
12+
UI Events *ui-events*
1313

1414
GUIs can be implemented as external processes communicating with Nvim over the
1515
RPC API. The UI model consists of a terminal-like grid with a single,

Diff for: runtime/doc/various.txt

+8-11
Original file line numberDiff line numberDiff line change
@@ -207,21 +207,18 @@ g8 Print the hex values of the bytes used in the
207207
:sh[ell] Removed. |vim-differences| {Nvim}
208208

209209
*:terminal* *:te*
210-
:te[rminal][!] [{cmd}] Execute {cmd} with 'shell' in a new |terminal| buffer.
211-
Equivalent to: >
212-
:enew
213-
:call termopen('{cmd}')
214-
<
215-
See |termopen()|.
210+
:te[rminal][!] [{cmd}] Execute {cmd} with 'shell' in a new |terminal-emulator|
211+
buffer. Without {cmd}, start an interactive 'shell'.
216212

217-
Without {cmd}, start an interactive shell.
213+
Type |i| to enter |Terminal-mode|, then keys are sent to
214+
the job running in the terminal. Type <C-\><C-N> to
215+
leave Terminal-mode. |CTRL-\_CTRL-N|
218216

219-
Creating the terminal buffer fails when changes have been
220-
made to the current buffer, unless 'hidden' is set.
217+
Fails if changes have been made to the current buffer,
218+
unless 'hidden' is set.
221219

222220
To enter |Terminal-mode| automatically: >
223-
autocmd BufEnter term://* startinsert
224-
autocmd BufLeave term://* stopinsert
221+
autocmd TermOpen * startinsert
225222
<
226223
*:!cmd* *:!* *E34*
227224
:!{cmd} Execute {cmd} with 'shell'. See also |:terminal|.

Diff for: runtime/doc/vim_diff.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ Highlight groups:
302302
|hl-ColorColumn|, |hl-CursorColumn| are lower priority than most other
303303
groups
304304

305-
The variable name "count" is no fallback for |v:count| anymore.
305+
VimL (Vim script) compatibility:
306+
`count` does not alias to |v:count|
306307

307308
==============================================================================
308309
5. Missing legacy features *nvim-features-missing*

Diff for: src/nvim/api/buffer.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -763,8 +763,8 @@ ArrayOf(Integer, 2) nvim_buf_get_mark(Buffer buffer, String name, Error *err)
763763
/// or -1 for ungrouped highlight
764764
/// @param hl_group Name of the highlight group to use
765765
/// @param line Line to highlight (zero-indexed)
766-
/// @param col_start Start of range of columns to highlight
767-
/// @param col_end End of range of columns to highlight,
766+
/// @param col_start Start of (byte-indexed) column range to highlight
767+
/// @param col_end End of (byte-indexed) column range to highlight,
768768
/// or -1 to highlight to end of line
769769
/// @param[out] err Error details, if any
770770
/// @return The src_id that was used

Diff for: src/nvim/tui/tui.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term,
15291529
|| iterm || iterm_pretending_xterm
15301530
|| teraterm // per TeraTerm "Supported Control Functions" doco
15311531
// Some linux-type terminals (such as console-terminal-emulator
1532-
// from the nosh toolset) implement implement the xterm extension.
1532+
// from the nosh toolset) implement the xterm extension.
15331533
|| (linuxvt && (xterm_version || (vte_version > 0) || colorterm)))) {
15341534
data->unibi_ext.set_cursor_style =
15351535
(int)unibi_add_ext_str(ut, "Ss", "\x1b[%p1%d q");

Diff for: test/README.md

+5-8
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,13 @@ minutes](http://learnxinyminutes.com/docs/lua/).
168168
Do not silently skip the test with `if-else`. If a functional test depends on
169169
some external factor (e.g. the existence of `md5sum` on `$PATH`), *and* you
170170
can't mock or fake the dependency, then skip the test via `pending()` if the
171-
external factor is missing. This ensures that the *total* test-count (success
172-
+ fail + error + pending) is the same in all environments.
171+
external factor is missing. This ensures that the *total* test-count
172+
(success + fail + error + pending) is the same in all environments.
173173
- *Note:* `pending()` is ignored if it is missing an argument _unless_ it is
174-
[contained in an `it()`
175-
block](https://github.com/neovim/neovim/blob/d21690a66e7eb5ebef18046c7a79ef898966d786/test/functional/ex_cmds/grep_spec.lua#L11).
176-
Provide empty function argument if the `pending()` call is outside of
177-
`it()`
174+
[contained in an `it()` block](https://github.com/neovim/neovim/blob/d21690a66e7eb5ebef18046c7a79ef898966d786/test/functional/ex_cmds/grep_spec.lua#L11).
175+
Provide empty function argument if the `pending()` call is outside of `it()`
178176
([example](https://github.com/neovim/neovim/commit/5c1dc0fbe7388528875aff9d7b5055ad718014de#diff-bf80b24c724b0004e8418102f68b0679R18)).
179-
- Use `make testlint` for using the shipped luacheck program ([supported by
180-
syntastic](https://github.com/scrooloose/syntastic/blob/d6b96c079be137c83009827b543a83aa113cc011/doc/syntastic-checkers.txt#L3546))
177+
- Use `make testlint` for using the shipped luacheck program ([supported by syntastic](https://github.com/scrooloose/syntastic/blob/d6b96c079be137c83009827b543a83aa113cc011/doc/syntastic-checkers.txt#L3546))
181178
to lint all tests.
182179

183180
### Where tests go

0 commit comments

Comments
 (0)