Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: regenerate #2

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 34 additions & 2 deletions runtime/doc/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ nvim_get_mode() *nvim_get_mode()*
{fast}

nvim_get_option({name}) *nvim_get_option()*
Gets an option value string.
Gets the global value of an option.

Parameters: ~
{name} Option name
Expand Down Expand Up @@ -1049,6 +1049,24 @@ nvim_get_option_info({name}) *nvim_get_option_info()*
Return: ~
Option Information

nvim_get_option_value({name}, {*opts}) *nvim_get_option_value()*
Gets the value of an option. The behavior of this function
matches that of |:set|: the local value of an option is
returned if it exists; otherwise, the global value is
returned. Local values always correspond to the current buffer
or window. To get a buffer-local or window-local option for a
specific buffer or window, use |nvim_buf_get_option()| or
|nvim_win_get_option()|.

Parameters: ~
{name} Option name
{opts} Optional parameters
• scope: One of 'global' or 'local'. Analagous to
|:setglobal| and |:setlocal|, respectively.

Return: ~
Option value

nvim_get_proc({pid}) *nvim_get_proc()*
Gets info describing process `pid` .

Expand Down Expand Up @@ -1510,11 +1528,25 @@ nvim_set_keymap({mode}, {lhs}, {rhs}, {*opts}) *nvim_set_keymap()*
key is an error.

nvim_set_option({name}, {value}) *nvim_set_option()*
Sets an option value.
Sets the global value of an option.

Parameters: ~
{name} Option name
{value} New option value

*nvim_set_option_value()*
nvim_set_option_value({name}, {value}, {*opts})
Sets the value of an option. The behavior of this function
matches that of |:set|: for global-local options, both the
global and local value are set unless otherwise specified with
{scope}.

Parameters: ~
{name} Option name
{value} New option value
{opts} Optional parameters
• scope: One of 'global' or 'local'. Analagous to
|:setglobal| and |:setlocal|, respectively.

nvim_set_var({name}, {value}) *nvim_set_var()*
Sets a global (g:) variable.
Expand Down
6 changes: 6 additions & 0 deletions runtime/doc/lsp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,12 @@ client() *vim.lsp.client*
server.
• {handlers} (table): The handlers used by the client as
described in |lsp-handler|.
• {requests} (table): The current pending requests in flight
to the server. Entries are key-value pairs with the key
being the request ID while the value is a table with
`type` , `bufnr` , and `method` key-value pairs. `type` is
either "pending" for an active request, or "cancel" for a
cancel request.
• {config} (table): copy of the table that was passed by the
user to |vim.lsp.start_client()|.
• {server_capabilities} (table): Response from the server
Expand Down
15 changes: 14 additions & 1 deletion runtime/doc/sign.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ The color of the column is set with the SignColumn highlight group

:highlight SignColumn guibg=darkgrey
<
If 'cursorline' is enabled, then the CursorLineSign highlight group is used
|hl-CursorLineSign|.
*sign-identifier*
Each placed sign is identified by a number called the sign identifier. This
identifier is used to jump to the sign or to remove the sign. The identifier
Expand Down Expand Up @@ -131,6 +133,10 @@ See |sign_define()| for the equivalent Vim script function.
texthl={group}
Highlighting group used for the text item.

culhl={group}
Highlighting group used for the text item when the cursor is
on the same line as the sign and 'cursorline' is enabled.

Example: >
:sign define MySign text=>> texthl=Search linehl=DiffText
<
Expand Down Expand Up @@ -377,6 +383,9 @@ sign_define({list})
text text that is displayed when there is no icon
or the GUI is not being used.
texthl highlight group used for the text item
culhl highlight group used for the text item when
the cursor is on the same line as the sign and
'cursorline' is enabled.
numhl highlight group used for 'number' column at the
associated line. Overrides |hl-LineNr|,
|hl-CursorLineNr|.
Expand Down Expand Up @@ -425,9 +434,13 @@ sign_getdefined([{name}]) *sign_getdefined()*
or the GUI is not being used.
texthl highlight group used for the text item; not
present if not set.
culhl highlight group used for the text item when
the cursor is on the same line as the sign and
'cursorline' is enabled; not present if not
set.
numhl highlight group used for 'number' column at the
associated line. Overrides |hl-LineNr|,
|hl-CursorLineNr|.
|hl-CursorLineNr|; not present if not set.

Returns an empty List if there are no signs and when {name} is
not found.
Expand Down
4 changes: 4 additions & 0 deletions runtime/doc/syntax.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5127,6 +5127,10 @@ LineNrBelow Line number for when the 'relativenumber'
*hl-CursorLineNr*
CursorLineNr Like LineNr when 'cursorline' is set and 'cursorlineopt'
contains "number" or is "both", for the cursor line.
*hl-CursorLineSign*
CursorLineSign Like SignColumn when 'cursorline' is set for the cursor line.
*hl-CursorLineFold*
CursorLineFold Like FoldColumn when 'cursorline' is set for the cursor line.
*hl-MatchParen*
MatchParen The character under the cursor or just before it, if it
is a paired bracket, and its match. |pi_paren.txt|
Expand Down
8 changes: 3 additions & 5 deletions runtime/doc/treesitter.txt
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,9 @@ Query:iter_matches({self}, {node}, {source}, {start}, {stop})
for id, node in pairs(match) do
local name = query.captures[id]
-- `node` was captured by the `name` capture in the match
<
>
local node_data = metadata[id] -- Node level metadata
<
>

local node_data = metadata[id] -- Node level metadata

... use the info here ...
end
end
Expand Down
2 changes: 2 additions & 0 deletions src/nvim/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,8 @@ EXTERN char e_non_empty_string_required[] INIT(= N_("E1142: Non-empty string req

EXTERN char e_cannot_define_autocommands_for_all_events[] INIT(= N_("E1155: Cannot define autocommands for ALL events"));

EXTERN char e_highlight_group_name_too_long[] INIT(= N_("E1249: Highlight group name too long"));

EXTERN char top_bot_msg[] INIT(= N_("search hit TOP, continuing at BOTTOM"));
EXTERN char bot_top_msg[] INIT(= N_("search hit BOTTOM, continuing at TOP"));

Expand Down
4 changes: 4 additions & 0 deletions src/nvim/highlight_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ typedef enum {
HLF_LNA, // LineNrAbove
HLF_LNB, // LineNrBelow
HLF_CLN, // current line number when 'cursorline' is set
HLF_CLS, // current line sign column
HLF_CLF, // current line fold
HLF_R, // return to continue message and yes/no questions
HLF_S, // status lines
HLF_SNC, // status lines of not-current windows
Expand Down Expand Up @@ -122,6 +124,8 @@ EXTERN const char *hlf_names[] INIT(= {
[HLF_LNA] = "LineNrAbove",
[HLF_LNB] = "LineNrBelow",
[HLF_CLN] = "CursorLineNr",
[HLF_CLS] = "CursorLineSign",
[HLF_CLF] = "CursorLineFold",
[HLF_R] = "Question",
[HLF_S] = "StatusLine",
[HLF_SNC] = "StatusLineNC",
Expand Down
1 change: 1 addition & 0 deletions src/nvim/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ typedef struct vimoption {
#define HIGHLIGHT_INIT \
"8:SpecialKey,~:EndOfBuffer,z:TermCursor,Z:TermCursorNC,@:NonText,d:Directory,e:ErrorMsg," \
"i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr," \
"G:CursorLineSign,O:CursorLineFold" \
"r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg," \
"W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn," \
"-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar," \
Expand Down
41 changes: 31 additions & 10 deletions src/nvim/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2746,7 +2746,11 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool noc
p_extra = p_extra_free;
c_extra = NUL;
c_final = NUL;
char_attr = win_hl_attr(wp, HLF_FC);
if (use_cursor_line_sign(wp, lnum)) {
char_attr = win_hl_attr(wp, HLF_CLF);
} else {
char_attr = win_hl_attr(wp, HLF_FC);
}
}
}

Expand All @@ -2757,7 +2761,7 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool noc
* buffer or when using Netbeans. */
int count = win_signcol_count(wp);
if (count > 0) {
get_sign_display_info(false, wp, sattrs, row,
get_sign_display_info(false, wp, lnum, sattrs, row,
startrow, filler_lines, filler_todo, count,
&c_extra, &c_final, extra, sizeof(extra),
&p_extra, &n_extra,
Expand All @@ -2778,7 +2782,7 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool noc
if (*wp->w_p_scl == 'n' && *(wp->w_p_scl + 1) == 'u'
&& num_signs > 0) {
int count = win_signcol_count(wp);
get_sign_display_info(true, wp, sattrs, row,
get_sign_display_info(true, wp, lnum, sattrs, row,
startrow, filler_lines, filler_todo, count,
&c_extra, &c_final, extra, sizeof(extra),
&p_extra, &n_extra,
Expand Down Expand Up @@ -4617,26 +4621,38 @@ void screen_adjust_grid(ScreenGrid **grid, int *row_off, int *col_off)
}
}

// Return true if CursorLineSign highlight is to be used.
static bool use_cursor_line_sign(win_T *wp, linenr_T lnum)
{
return wp->w_p_cul
&& lnum == wp->w_cursor.lnum
&& (wp->w_p_culopt_flags & CULOPT_NBR);
}

// Get information needed to display the sign in line 'lnum' in window 'wp'.
// If 'nrcol' is TRUE, the sign is going to be displayed in the number column.
// Otherwise the sign is going to be displayed in the sign column.
//
// @param count max number of signs
// @param[out] n_extrap number of characters from pp_extra to display
// @param[in, out] sign_idxp Index of the displayed sign
static void get_sign_display_info(bool nrcol, win_T *wp, sign_attrs_T sattrs[], int row,
int startrow, int filler_lines, int filler_todo, int count,
int *c_extrap, int *c_finalp, char_u *extra, size_t extra_size,
char_u **pp_extra, int *n_extrap, int *char_attrp,
int *draw_statep, int *sign_idxp)
static void get_sign_display_info(bool nrcol, win_T *wp, linenr_T lnum, sign_attrs_T sattrs[],
int row, int startrow, int filler_lines, int filler_todo,
int count, int *c_extrap, int *c_finalp, char_u *extra,
size_t extra_size, char_u **pp_extra, int *n_extrap,
int *char_attrp, int *draw_statep, int *sign_idxp)
{
// Draw cells with the sign value or blank.
*c_extrap = ' ';
*c_finalp = NUL;
if (nrcol) {
*n_extrap = number_width(wp) + 1;
} else {
*char_attrp = win_hl_attr(wp, HLF_SC);
if (use_cursor_line_sign(wp, lnum)) {
*char_attrp = win_hl_attr(wp, HLF_CLS);
} else {
*char_attrp = win_hl_attr(wp, HLF_SC);
}
*n_extrap = win_signcol_width(wp);
}

Expand Down Expand Up @@ -4676,7 +4692,12 @@ static void get_sign_display_info(bool nrcol, win_T *wp, sign_attrs_T sattrs[],
(*pp_extra)[*n_extrap] = NUL;
}
}
*char_attrp = sattr->sat_texthl;

if (use_cursor_line_sign(wp, lnum) && sattr->sat_culhl > 0) {
*char_attrp = sattr->sat_culhl;
} else {
*char_attrp = sattr->sat_texthl;
}
}
}

Expand Down