Merge #8679 from justinmk/doc

This commit is contained in:
Justin M. Keyes 2018-07-18 13:42:07 +02:00 committed by GitHub
commit 44b4f8c6e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 194 additions and 182 deletions

View File

@ -879,11 +879,11 @@ nvim_buf_detach({buffer}) *nvim_buf_detach()*
*nvim_buf_get_lines()* *nvim_buf_get_lines()*
nvim_buf_get_lines({buffer}, {start}, {end}, {strict_indexing}) nvim_buf_get_lines({buffer}, {start}, {end}, {strict_indexing})
Retrieves a line range from the buffer Gets a line-range from the buffer.
Indexing is zero-based, end-exclusive. Negative indices are Indexing is zero-based, end-exclusive. Negative indices are
interpreted as length+1+index, i e -1 refers to the index past interpreted as length+1+index: -1 refers to the index past the
the end. So to get the last element set start=-2 and end=-1. end. So to get the last element use start=-2 and end=-1.
Out-of-bounds indices are clamped to the nearest valid value, Out-of-bounds indices are clamped to the nearest valid value,
unless `strict_indexing` is set. unless `strict_indexing` is set.
@ -901,15 +901,15 @@ nvim_buf_get_lines({buffer}, {start}, {end}, {strict_indexing})
*nvim_buf_set_lines()* *nvim_buf_set_lines()*
nvim_buf_set_lines({buffer}, {start}, {end}, {strict_indexing}, nvim_buf_set_lines({buffer}, {start}, {end}, {strict_indexing},
{replacement}) {replacement})
Replaces line range on the buffer Sets (replaces) a line-range in the buffer.
Indexing is zero-based, end-exclusive. Negative indices are Indexing is zero-based, end-exclusive. Negative indices are
interpreted as length+1+index, i e -1 refers to the index past interpreted as length+1+index: -1 refers to the index past the
the end. So to change or delete the last element set start=-2 end. So to change or delete the last element use start=-2 and
and end=-1. end=-1.
To insert lines at a given index, set both start and end to To insert lines at a given index, set `start` and `end` to the
the same index. To delete a range of lines, set replacement to same index. To delete a range of lines, set `replacement` to
an empty array. an empty array.
Out-of-bounds indices are clamped to the nearest valid value, Out-of-bounds indices are clamped to the nearest valid value,

View File

@ -1528,8 +1528,8 @@ v:event Dictionary of event data for the current |autocommand|. Valid
event, e.g. |DirChanged| or |TextYankPost|. event, e.g. |DirChanged| or |TextYankPost|.
KEY DESCRIPTION ~ KEY DESCRIPTION ~
abort Whether the event triggered during abort Whether the event triggered during
an aborting condition, i e |c_Esc| or an aborting condition (e.g. |c_Esc| or
|c_CTRL-c|for |CmdlineLeave|. |c_CTRL-c| for |CmdlineLeave|).
cmdlevel Level of cmdline. cmdlevel Level of cmdline.
cmdtype Type of cmdline, |cmdline-char|. cmdtype Type of cmdline, |cmdline-char|.
cwd Current working directory. cwd Current working directory.
@ -4995,6 +4995,9 @@ jobstart({cmd}[, {opts}]) *jobstart()*
:call jobstart(split(&shell) + split(&shellcmdflag) + ['{cmd}']) :call jobstart(split(&shell) + split(&shellcmdflag) + ['{cmd}'])
< (See |shell-unquoting| for details.) < (See |shell-unquoting| for details.)
Example: >
:call jobstart('nvim -h', {'on_stdout':{j,d,e->append(line('.'),d)}})
<
Returns |job-id| on success, 0 on invalid arguments (or job Returns |job-id| on success, 0 on invalid arguments (or job
table is full), -1 if {cmd}[0] or 'shell' is not executable. table is full), -1 if {cmd}[0] or 'shell' is not executable.
For communication over the job's stdio, it is represented as a For communication over the job's stdio, it is represented as a

View File

@ -310,14 +310,22 @@ semantically equivalent in Lua to:
return chunk(arg) -- return typval return chunk(arg) -- return typval
end end
Note that "_A" receives the argument to "luaeval". Lua nils, numbers, strings, Lua nils, numbers, strings, tables and booleans are converted to their
tables and booleans are converted to their respective VimL types. An error is respective VimL types. An error is thrown if conversion of any other Lua types
thrown if conversion of any of the remaining Lua types is attempted. is attempted.
Note 2: lua tables are used as both dictionaries and lists, thus making it The magic global "_A" contains the second argument to luaeval().
impossible to determine whether empty table is meant to be empty list or empty
dictionary. Additionally lua does not have integer numbers. To distinguish Example: >
between these cases there is the following agreement: :echo luaeval('_A[1] + _A[2]', [40, 2])
42
:echo luaeval('string.match(_A, "[a-z]+")', 'XYXfoo123')
foo
Lua tables are used as both dictionaries and lists, so it is impossible to
determine whether empty table is meant to be empty list or empty dictionary.
Additionally lua does not have integer numbers. To distinguish between these
cases there is the following agreement:
0. Empty table is empty list. 0. Empty table is empty list.
1. Table with N incrementally growing integral numbers, starting from 1 and 1. Table with N incrementally growing integral numbers, starting from 1 and

View File

@ -4845,9 +4845,10 @@ Cursor character under the cursor
*hl-CursorIM* *hl-CursorIM*
CursorIM like Cursor, but used when in IME mode |CursorIM| CursorIM like Cursor, but used when in IME mode |CursorIM|
*hl-CursorColumn* *hl-CursorColumn*
CursorColumn screen column at the cursor, when 'cursorcolumn' is set CursorColumn Screen-column at the cursor, when 'cursorcolumn' is set.
*hl-CursorLine* *hl-CursorLine*
CursorLine screen line at the cursor, when 'cursorline' is set CursorLine Screen-line at the cursor, when 'cursorline' is set.
Low-priority if foreground (ctermfg OR guifg) is not set.
*hl-Directory* *hl-Directory*
Directory directory names (and other special names in listings) Directory directory names (and other special names in listings)
*hl-DiffAdd* *hl-DiffAdd*

View File

@ -191,11 +191,11 @@ ArrayOf(String) buffer_get_line_slice(Buffer buffer,
return nvim_buf_get_lines(0, buffer, start , end, false, err); return nvim_buf_get_lines(0, buffer, start , end, false, err);
} }
/// Retrieves a line range from the buffer /// Gets a line-range from the buffer.
/// ///
/// Indexing is zero-based, end-exclusive. Negative indices are interpreted /// Indexing is zero-based, end-exclusive. Negative indices are interpreted
/// as length+1+index, i e -1 refers to the index past the end. So to get the /// as length+1+index: -1 refers to the index past the end. So to get the
/// last element set start=-2 and end=-1. /// last element use start=-2 and end=-1.
/// ///
/// Out-of-bounds indices are clamped to the nearest valid value, unless /// Out-of-bounds indices are clamped to the nearest valid value, unless
/// `strict_indexing` is set. /// `strict_indexing` is set.
@ -286,14 +286,14 @@ void buffer_set_line_slice(Buffer buffer,
} }
/// Replaces line range on the buffer /// Sets (replaces) a line-range in the buffer.
/// ///
/// Indexing is zero-based, end-exclusive. Negative indices are interpreted /// Indexing is zero-based, end-exclusive. Negative indices are interpreted
/// as length+1+index, i e -1 refers to the index past the end. So to change /// as length+1+index: -1 refers to the index past the end. So to change
/// or delete the last element set start=-2 and end=-1. /// or delete the last element use start=-2 and end=-1.
/// ///
/// To insert lines at a given index, set both start and end to the same index. /// To insert lines at a given index, set `start` and `end` to the same index.
/// To delete a range of lines, set replacement to an empty array. /// To delete a range of lines, set `replacement` to an empty array.
/// ///
/// Out-of-bounds indices are clamped to the nearest valid value, unless /// Out-of-bounds indices are clamped to the nearest valid value, unless
/// `strict_indexing` is set. /// `strict_indexing` is set.