mirror of
https://github.com/neovim/neovim.git
synced 2026-04-20 06:20:53 +00:00
docs: misc, editorconfig
fix https://github.com/neovim/neovim/issues/36858
This commit is contained in:
@@ -1193,7 +1193,7 @@ local function check_language(filename, clean_lines, linenum, error)
|
||||
|
||||
-- Check for MAYBE
|
||||
if maybe_regex:match_str(line) then
|
||||
error(filename, linenum, 'readability/bool', 4, 'Use kNONE from TriState instead of MAYBE.')
|
||||
error(filename, linenum, 'readability/bool', 4, 'Use kNone from TriState instead of MAYBE.')
|
||||
end
|
||||
|
||||
-- Detect preincrement/predecrement at start of line
|
||||
|
||||
@@ -497,18 +497,29 @@ String nvim_replace_termcodes(String str, Boolean from_part, Boolean do_lt, Bool
|
||||
return cstr_as_string(ptr);
|
||||
}
|
||||
|
||||
/// Execute Lua code. Parameters (if any) are available as `...` inside the
|
||||
/// chunk. The chunk can return a value.
|
||||
/// Executes Lua code. Arguments are available as `...` inside the chunk. The chunk can return
|
||||
/// a value.
|
||||
///
|
||||
/// Only statements are executed. To evaluate an expression, prefix it
|
||||
/// with `return`: return my_function(...)
|
||||
/// Only statements are executed. To evaluate an expression, prefix it with "return": `return
|
||||
/// my_function(...)`
|
||||
///
|
||||
/// @param code Lua code to execute
|
||||
/// @param args Arguments to the code
|
||||
/// @param[out] err Details of an error encountered while parsing
|
||||
/// or executing the Lua code.
|
||||
/// Example:
|
||||
/// ```lua
|
||||
/// local peer = vim.fn.jobstart({ vim.v.progpath, '--clean', '--embed' }, { rpc=true })
|
||||
/// vim.print(vim.rpcrequest(peer, 'nvim_exec_lua', [[
|
||||
/// local a, b = ...
|
||||
/// return ('result: %s'):format(a + b)
|
||||
/// ]],
|
||||
/// { 1, 3 }
|
||||
/// )
|
||||
/// )
|
||||
/// ```
|
||||
///
|
||||
/// @return Return value of Lua code if present or NIL.
|
||||
/// @param code Lua code to execute.
|
||||
/// @param args Arguments to the Lua code.
|
||||
/// @param[out] err Lua error raised while parsing or executing the Lua code.
|
||||
///
|
||||
/// @return Value returned by the Lua code (if any), or NIL.
|
||||
Object nvim_exec_lua(String code, Array args, Arena *arena, Error *err)
|
||||
FUNC_API_SINCE(7)
|
||||
FUNC_API_REMOTE_ONLY
|
||||
|
||||
@@ -1668,7 +1668,8 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, b
|
||||
= !has_foldtext && buf_meta_total(wp->w_buffer, kMTMetaInline) > 0;
|
||||
int virt_line_index = -1;
|
||||
int virt_line_flags = 0;
|
||||
// Repeat for the whole displayed line.
|
||||
|
||||
// Repeat for each cell in the displayed line.
|
||||
while (true) {
|
||||
int has_match_conc = 0; ///< match wants to conceal
|
||||
int decor_conceal = 0;
|
||||
|
||||
@@ -1084,14 +1084,15 @@ void grid_del_lines(ScreenGrid *grid, int row, int line_count, int end, int col,
|
||||
}
|
||||
}
|
||||
|
||||
/// @param overflow Number of cells to skip.
|
||||
static void grid_draw_bordertext(VirtText vt, int col, int winbl, const int *hl_attr,
|
||||
BorderTextType bt, int over_flow)
|
||||
BorderTextType bt, int overflow)
|
||||
{
|
||||
int default_attr = hl_attr[bt == kBorderTextTitle ? HLF_BTITLE : HLF_BFOOTER];
|
||||
if (over_flow > 0) {
|
||||
if (overflow > 0) {
|
||||
grid_line_puts(1, "<", -1, hl_apply_winblend(winbl, default_attr));
|
||||
col += 1;
|
||||
over_flow += 1;
|
||||
overflow += 1;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < kv_size(vt);) {
|
||||
@@ -1104,18 +1105,17 @@ static void grid_draw_bordertext(VirtText vt, int col, int winbl, const int *hl_
|
||||
attr = default_attr;
|
||||
}
|
||||
// Skip characters from the beginning when title overflows available width.
|
||||
// over_flow contains the number of cells to skip.
|
||||
if (over_flow > 0) {
|
||||
if (overflow > 0) {
|
||||
int cells = (int)mb_string2cells(text);
|
||||
// Skip entire chunk if overflow is larger than chunk width.
|
||||
if (over_flow >= cells) {
|
||||
over_flow -= cells;
|
||||
if (overflow >= cells) {
|
||||
overflow -= cells;
|
||||
continue;
|
||||
}
|
||||
// Skip partial characters within the chunk.
|
||||
char *p = text;
|
||||
while (*p && over_flow > 0) {
|
||||
over_flow -= utf_ptr2cells(p);
|
||||
while (*p && overflow > 0) {
|
||||
overflow -= utf_ptr2cells(p);
|
||||
p += utfc_ptr2len(p);
|
||||
}
|
||||
text = p;
|
||||
|
||||
Reference in New Issue
Block a user