chore: fix typos (#17670)

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
This commit is contained in:
dundargoc 2022-03-17 06:21:24 +01:00 committed by GitHub
parent 746a29c580
commit d238b8f600
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 27 additions and 24 deletions

View File

@ -86,7 +86,7 @@ You can not put options there!
2. Missing functionality *E5600* *clientserver-missing*
Vim supports additional functionality in clientserver that's not yet
implemented in Nvim. In particular, none of the 'wait' variants are supported
implemented in Nvim. In particular, none of the "wait" variants are supported
yet. The following command line arguments are not yet available:
argument meaning ~

View File

@ -25,8 +25,8 @@ local keymap = {}
--- vim.keymap.set('n', 'asdf', require('jkl').my_fun)
--- </pre>
---
--- the `require('jkl')` gets evaluated during this call in order to access the function. If you want to
--- avoid this cost at startup you can wrap it in a function, for example:
--- the ``require('jkl')`` gets evaluated during this call in order to access the function.
--- If you want to avoid this cost at startup you can wrap it in a function, for example:
--- <pre>
--- vim.keymap.set('n', 'asdf', function() return require('jkl').my_fun() end)
--- </pre>

View File

@ -1689,7 +1689,7 @@ end
---
--- Currently only supports a single client. This can be set via
--- `setlocal formatexpr=v:lua.vim.lsp.formatexpr()` but will typically or in `on_attach`
--- via `vim.api.nvim_buf_set_option(bufnr, 'formatexpr', 'v:lua.vim.lsp.formatexpr(#{timeout_ms:250})')`.
--- via ``vim.api.nvim_buf_set_option(bufnr, 'formatexpr', 'v:lua.vim.lsp.formatexpr(#{timeout_ms:250})')``.
---
---@param opts table options for customizing the formatting expression which takes the
--- following optional keys:

View File

@ -331,7 +331,7 @@ end
--- Add the reverse lookup values to an existing table.
--- For example:
--- `tbl_add_reverse_lookup { A = 1 } == { [1] = 'A', A = 1 }`
--- ``tbl_add_reverse_lookup { A = 1 } == { [1] = 'A', A = 1 }``
--
--Do note that it *modifies* the input.
---@param o table The table to add the reverse to.

View File

@ -127,7 +127,7 @@ Dictionary nvim__get_hl_defs(Integer ns_id, Error *err)
///
/// Note: Unlike the `:highlight` command which can update a highlight group,
/// this function completely replaces the definition. For example:
/// `nvim_set_hl(0, 'Visual', {})` will clear the highlight group 'Visual'.
/// ``nvim_set_hl(0, 'Visual', {})`` will clear the highlight group 'Visual'.
///
/// @param ns_id Namespace id for this highlight |nvim_create_namespace()|.
/// Use 0 to set a highlight group globally |:highlight|.

View File

@ -71,7 +71,7 @@ ArrayOf(Integer, 2) nvim_win_get_cursor(Window window, Error *err)
}
/// Sets the (1,0)-indexed cursor position in the window. |api-indexing|
/// Unlike |win_execute()| this scrolls the window.
/// This scrolls the window even if it is not the current one.
///
/// @param window Window handle, or 0 for current window
/// @param pos (row, col) tuple representing the new position

View File

@ -397,7 +397,7 @@ int augroup_add(char *name)
}
/// Delete the augroup that matches name.
/// @param stupid_legacy_mode bool: This paremeter determines whether to run the augroup
/// @param stupid_legacy_mode bool: This parameter determines whether to run the augroup
/// deletion in the same fashion as `:augroup! {name}` where if there are any remaining
/// autocmds left in the augroup, it will change the name of the augroup to `--- DELETED ---`
/// but leave the autocmds existing. These are _separate_ augroups, so if you do this for

View File

@ -408,7 +408,7 @@ void deleted_lines(linenr_T lnum, long count)
/// be triggered to display the cursor.
void deleted_lines_mark(linenr_T lnum, long count)
{
// if we deleted the entire buffer, we need to implicity add a new empty line
// if we deleted the entire buffer, we need to implicitly add a new empty line
bool made_empty = (count > 0) && curbuf->b_ml.ml_flags & ML_EMPTY;
mark_adjust(lnum, (linenr_T)(lnum + count - 1), (long)MAXLNUM,

View File

@ -5116,10 +5116,10 @@ static int ins_complete(int c, bool enable_pum)
|| ctrl_x_mode == CTRL_X_PATH_PATTERNS
|| ctrl_x_mode == CTRL_X_PATH_DEFINES) {
if (compl_startpos.lnum != curwin->w_cursor.lnum) {
/* line (probably) wrapped, set compl_startpos to the
* first non_blank in the line, if it is not a wordchar
* include it to get a better pattern, but then we don't
* want the "\\<" prefix, check it bellow */
// line (probably) wrapped, set compl_startpos to the
// first non_blank in the line, if it is not a wordchar
// include it to get a better pattern, but then we don't
// want the "\\<" prefix, check it below.
compl_col = (colnr_T)getwhitecols(line);
compl_startpos.col = compl_col;
compl_startpos.lnum = curwin->w_cursor.lnum;

View File

@ -1500,7 +1500,7 @@ static void f_ctxsize(typval_T *argvars, typval_T *rettv, FunPtr fptr)
}
/// Set the cursor position.
/// If 'charcol' is true, then use the column number as a character offet.
/// If 'charcol' is true, then use the column number as a character offset.
/// Otherwise use the column number as a byte offset.
static void set_cursorpos(typval_T *argvars, typval_T *rettv, bool charcol)
{
@ -7781,7 +7781,7 @@ static void f_reverse(typval_T *argvars, typval_T *rettv, FunPtr fptr)
}
}
/// "reduce(list, { accumlator, element -> value } [, initial])" function
/// "reduce(list, { accumulator, element -> value } [, initial])" function
static void f_reduce(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{
if (argvars[0].v_type != VAR_LIST && argvars[0].v_type != VAR_BLOB) {
@ -8885,7 +8885,7 @@ static void f_setbufvar(typval_T *argvars, typval_T *rettv, FunPtr fptr)
}
/// Set the cursor or mark position.
/// If 'charpos' is TRUE, then use the column number as a character offet.
/// If 'charpos' is TRUE, then use the column number as a character offset.
/// Otherwise use the column number as a byte offset.
static void set_position(typval_T *argvars, typval_T *rettv, bool charpos)
{

View File

@ -9655,7 +9655,7 @@ static void ex_filetype(exarg_T *eap)
/// Source ftplugin.vim and indent.vim to create the necessary FileType
/// autocommands. We do this separately from filetype.vim so that these
/// autocommands will always fire first (and thus can be overriden) while still
/// autocommands will always fire first (and thus can be overridden) while still
/// allowing general filetype detection to be disabled in the user's init file.
void filetype_plugin_enable(void)
{

View File

@ -231,7 +231,7 @@ static int compl_selected;
/// |:checkhealth| completion items
///
/// Regenerates on every new command line prompt, to accomodate changes on the
/// Regenerates on every new command line prompt, to accommodate changes on the
/// runtime files.
typedef struct {
garray_T names; // healthcheck names

View File

@ -86,7 +86,7 @@ static int openpty(int *amaster, int *aslave, char *name, struct termios *termp,
ioctl(slave, I_PUSH, "ptem");
// ldterm provides most of the termio terminal interface
ioctl(slave, I_PUSH, "ldterm");
// ttcompat compatability with older terminal ioctls
// ttcompat compatibility with older terminal ioctls
ioctl(slave, I_PUSH, "ttcompat");
if (termp) {

View File

@ -307,7 +307,7 @@ static void pty_process_finish2(PtyProcess *ptyproc)
/// Build the command line to pass to CreateProcessW.
///
/// @param[in] argv Array with string arguments.
/// @param[out] cmd_line Location where saved builded cmd line.
/// @param[out] cmd_line Location where saved built cmd line.
///
/// @returns zero on success, or error code of MultiByteToWideChar function.
///

View File

@ -5689,7 +5689,7 @@ search_line:
// we read a line, set "already" to check this "line" later
// if depth >= 0 we'll increase files[depth].lnum far
// bellow -- Acevedo
// below -- Acevedo
already = aux = p = skipwhite(line);
p = find_word_start(p);
p = find_word_end(p);

View File

@ -1288,7 +1288,7 @@ static bool send_mouse_event(Terminal *term, int c)
return mouse_win == curwin;
}
// ignore left release action if it was not proccessed above
// ignore left release action if it was not processed above
// to prevent leaving Terminal mode after entering to it using a mouse
if (c == K_LEFTRELEASE && mouse_win->w_buffer->terminal == term) {
return false;

View File

@ -115,6 +115,7 @@ static void tinput_wait_enqueue(void **argv)
{
TermInput *input = argv[0];
if (rbuffer_size(input->key_buffer) == 0 && input->paste == 3) {
// End streamed paste with an empty string.
const String keys = { .data = "", .size = 0 };
String copy = copy_string(keys);
multiqueue_put(main_loop.events, tinput_paste_event, 3,

View File

@ -52,6 +52,8 @@ void ui_client_init(uint64_t chan)
/// Handler for "redraw" events sent by the NVIM server
///
/// This is just a stub. The mentioned functionality will be implemented.
///
/// This function will be called by handle_request (in msgpack_rpc/channel.c)
/// The individual ui_events sent by the server are individually handled
/// by their respective handlers defined in ui_events_client.generated.h

View File

@ -33,7 +33,7 @@ describe('terminal channel is closed and later released if', function()
-- channel has been closed but not released
eq("Vim(call):Can't send data to closed stream",
pcall_err(command, [[call chanclose(id) | call chansend(id, 'test')]]))
screen:expect({any='%[Terminal closed]'})
screen:expect({any='%[Terminal closed%]'})
eq(chans, eval('len(nvim_list_chans())'))
-- delete terminal
feed('i<CR>')
@ -49,7 +49,7 @@ describe('terminal channel is closed and later released if', function()
-- channel has been closed but not released
eq("Vim(call):Can't send data to closed stream",
pcall_err(command, [[call chanclose(id) | call chansend(id, 'test')]]))
screen:expect({any='%[Terminal closed]'})
screen:expect({any='%[Terminal closed%]'})
eq(chans, eval('len(nvim_list_chans())'))
-- channel still hasn't been released yet
eq("Vim(call):Can't send data to closed stream",