doc: Update documentation

This commit is contained in:
ZyX 2017-07-26 12:31:01 +03:00
parent 0a46ae3c0a
commit d23c0de0c1
2 changed files with 23 additions and 10 deletions

View File

@ -4723,23 +4723,26 @@ input({opts})
"-complete=" argument. Refer to |:command-completion| for "-complete=" argument. Refer to |:command-completion| for
more information. Example: > more information. Example: >
let fname = input("File: ", "", "file") let fname = input("File: ", "", "file")
< < *E5400* *E5402*
The optional highlight key allows specifying function which The optional highlight key allows specifying function which
will be used for highlighting user input. This function will be used for highlighting user input. This function
receives user input as its only argument and must return receives user input as its only argument and must return
a list of 3-tuples [hl_start_byte, hl_end_byte + 1, hl_group] a list of 3-tuples [hl_start_col, hl_end_col + 1, hl_group]
where where
hl_start_byte is the first highlighted byte, hl_start_col is the first highlighted column,
hl_end_byte is the last highlighted byte (+ 1!), hl_end_col is the last highlighted column (+ 1!),
hl_group is |:hl| group used for highlighting. hl_group is |:hl| group used for highlighting.
*E5403* *E5404* *E5405* *E5406* *E5403* *E5404* *E5405* *E5406*
Both hl_start_byte and hl_end_byte + 1 must point to the start Both hl_start_col and hl_end_col + 1 must point to the start
of the multibyte character (highlighting must not break of the multibyte character (highlighting must not break
multibyte characters), hl_end_byte + 1 may be equal to the multibyte characters), hl_end_col + 1 may be equal to the
input length. Start column must be in range [0, len(input)), input length. Start column must be in range [0, len(input)),
end column must be in range (hl_start_byte, len(input)], end column must be in range (hl_start_col, len(input)],
sections must be ordered so that next hl_start_byte is greater sections must be ordered so that next hl_start_col is greater
then or equal to previous hl_end_byte. then or equal to previous hl_end_col.
Currently coloring is disabled when command-line contains
arabic characters.
NOTE: This function must not be used in a startup file, for NOTE: This function must not be used in a startup file, for
the versions that only run in GUI mode (e.g., the Win32 GUI). the versions that only run in GUI mode (e.g., the Win32 GUI).

View File

@ -126,7 +126,6 @@ Commands:
Functions: Functions:
|dictwatcheradd()| notifies a callback whenever a |Dict| is modified |dictwatcheradd()| notifies a callback whenever a |Dict| is modified
|dictwatcherdel()| |dictwatcherdel()|
|execute()| works with |:redir|
|msgpackdump()|, |msgpackparse()| provide msgpack de/serialization |msgpackdump()|, |msgpackparse()| provide msgpack de/serialization
Events: Events:
@ -143,6 +142,15 @@ Highlight groups:
|hl-TermCursorNC| |hl-TermCursorNC|
|hl-Whitespace| highlights 'listchars' whitespace |hl-Whitespace| highlights 'listchars' whitespace
UI:
*E5408* *E5409* *g:Nvim_color_expr* *g:Nvim_color_cmdline*
UI now supports command-line coloring. Officially only |input()| and
|inputdialog()| may be colored, temporary for testing purposes expressions
(e.g. |i_CTRL-R_=|) and regular command-line (|:|) are colored by callbacks
defined in `g:Nvim_color_expr` and `g:Nvim_color_cmdline` respectively.
Callbacks are to be replaced by parser implemented in C which will also do
the coloring.
============================================================================== ==============================================================================
4. Changed features *nvim-features-changed* 4. Changed features *nvim-features-changed*
@ -261,6 +269,8 @@ Lua interface (|if_lua.txt|):
on cancel and completion respectively) via dictionary argument (replaces all on cancel and completion respectively) via dictionary argument (replaces all
other arguments if used). other arguments if used).
|input()| and |inputdialog()| now support user-defined cmdline highlighting.
============================================================================== ==============================================================================
5. Missing legacy features *nvim-features-missing* 5. Missing legacy features *nvim-features-missing*