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({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
interpreted as length+1+index, i e -1 refers to the index past
the end. So to get the last element set start=-2 and end=-1.
interpreted as length+1+index: -1 refers to the index past the
end. So to get the last element use start=-2 and end=-1.
Out-of-bounds indices are clamped to the nearest valid value,
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({buffer}, {start}, {end}, {strict_indexing},
{replacement})
Replaces line range on the buffer
Sets (replaces) a line-range in the buffer.
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 or delete the last element set start=-2
and end=-1.
interpreted as length+1+index: -1 refers to the index past the
end. So to change 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 delete a range of lines, set replacement to
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.
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|.
KEY DESCRIPTION ~
abort Whether the event triggered during
an aborting condition, i e |c_Esc| or
|c_CTRL-c|for |CmdlineLeave|.
an aborting condition (e.g. |c_Esc| or
|c_CTRL-c| for |CmdlineLeave|).
cmdlevel Level of cmdline.
cmdtype Type of cmdline, |cmdline-char|.
cwd Current working directory.
@ -4995,6 +4995,9 @@ jobstart({cmd}[, {opts}]) *jobstart()*
:call jobstart(split(&shell) + split(&shellcmdflag) + ['{cmd}'])
< (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
table is full), -1 if {cmd}[0] or 'shell' is not executable.
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
end
Note that "_A" receives the argument to "luaeval". Lua nils, numbers, strings,
tables and booleans are converted to their respective VimL types. An error is
thrown if conversion of any of the remaining Lua types is attempted.
Lua nils, numbers, strings, tables and booleans are converted to their
respective VimL types. An error is thrown if conversion of any other Lua types
is attempted.
Note 2: lua tables are used as both dictionaries and lists, thus making it
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:
The magic global "_A" contains the second argument to luaeval().
Example: >
: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.
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*
CursorIM like Cursor, but used when in IME mode |CursorIM|
*hl-CursorColumn*
CursorColumn screen column at the cursor, when 'cursorcolumn' is set
CursorColumn Screen-column at the cursor, when 'cursorcolumn' is set.
*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*
Directory directory names (and other special names in listings)
*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);
}
/// Retrieves a line range from the buffer
/// Gets a line-range from the buffer.
///
/// 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
/// last element set start=-2 and end=-1.
/// as length+1+index: -1 refers to the index past the end. So to get the
/// last element use start=-2 and end=-1.
///
/// Out-of-bounds indices are clamped to the nearest valid value, unless
/// `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
/// as length+1+index, i e -1 refers to the index past the end. So to change
/// or delete the last element set start=-2 and end=-1.
/// as length+1+index: -1 refers to the index past the end. So to change
/// 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 delete a range of lines, set replacement to an empty array.
/// 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.
///
/// Out-of-bounds indices are clamped to the nearest valid value, unless
/// `strict_indexing` is set.