docs: fix typos (#19588)

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: notomo <notomo.motono@gmail.com>
This commit is contained in:
dundargoc 2022-08-03 03:47:16 +02:00 committed by GitHub
parent cc1ceebf8f
commit b8dcbcc732
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 72 additions and 71 deletions

View File

@ -5311,7 +5311,7 @@ mode([expr]) Return a string that indicates the current mode.
niV Normal using |i_CTRL-O| in |Virtual-Replace-mode| niV Normal using |i_CTRL-O| in |Virtual-Replace-mode|
nt Normal in |terminal-emulator| (insert goes to nt Normal in |terminal-emulator| (insert goes to
Terminal mode) Terminal mode)
ntT Normal using |t_CTRL-\_CTRL-O| in |terminal-mode| ntT Normal using |t_CTRL-\_CTRL-O| in |Terminal-mode|
v Visual by character v Visual by character
vs Visual by character using |v_CTRL-O| in Select mode vs Visual by character using |v_CTRL-O| in Select mode
V Visual by line V Visual by line

View File

@ -1315,7 +1315,7 @@ cmd({command}) *vim.cmd()*
vim.cmd('write! myfile.txt') vim.cmd('write! myfile.txt')
vim.cmd { cmd = 'write', args = { "myfile.txt" }, bang = true } vim.cmd { cmd = 'write', args = { "myfile.txt" }, bang = true }
vim.cmd.write { args = { "myfile.txt" }, bang = true } vim.cmd.write { args = { "myfile.txt" }, bang = true }
vim.cmd.write {"myfile.txt", bang = true }) vim.cmd.write { "myfile.txt", bang = true }
-- Ex command :colorscheme blue -- Ex command :colorscheme blue
vim.cmd('colorscheme blue') vim.cmd('colorscheme blue')
@ -2229,7 +2229,8 @@ set({mode}, {lhs}, {rhs}, {opts}) *vim.keymap.set()*
• remap: (boolean) Make the mapping recursive. • remap: (boolean) Make the mapping recursive.
This is the inverse of the "noremap" option from This is the inverse of the "noremap" option from
|nvim_set_keymap()|. Default `false`. |nvim_set_keymap()|. Default `false`.
• replace_keycodes: (boolean) defaults to true. • replace_keycodes: (boolean) defaults to true if
"expr" is true.
See also: ~ See also: ~
|nvim_set_keymap()| |nvim_set_keymap()|

View File

@ -312,7 +312,7 @@ end
--- vim.cmd('write! myfile.txt') --- vim.cmd('write! myfile.txt')
--- vim.cmd { cmd = 'write', args = { "myfile.txt" }, bang = true } --- vim.cmd { cmd = 'write', args = { "myfile.txt" }, bang = true }
--- vim.cmd.write { args = { "myfile.txt" }, bang = true } --- vim.cmd.write { args = { "myfile.txt" }, bang = true }
--- vim.cmd.write {"myfile.txt", bang = true }) --- vim.cmd.write { "myfile.txt", bang = true }
--- ---
--- -- Ex command :colorscheme blue --- -- Ex command :colorscheme blue
--- vim.cmd('colorscheme blue') --- vim.cmd('colorscheme blue')

View File

@ -43,7 +43,7 @@ local keymap = {}
--- - remap: (boolean) Make the mapping recursive. This is the --- - remap: (boolean) Make the mapping recursive. This is the
--- inverse of the "noremap" option from |nvim_set_keymap()|. --- inverse of the "noremap" option from |nvim_set_keymap()|.
--- Default `false`. --- Default `false`.
--- - replace_keycodes: (boolean) defaults to true. --- - replace_keycodes: (boolean) defaults to true if "expr" is true.
---@see |nvim_set_keymap()| ---@see |nvim_set_keymap()|
function keymap.set(mode, lhs, rhs, opts) function keymap.set(mode, lhs, rhs, opts)
vim.validate({ vim.validate({

View File

@ -27,7 +27,7 @@ typedef struct {
uint64_t channel_id; uint64_t channel_id;
#define UI_BUF_SIZE 4096 ///< total buffer size for pending msgpack data. #define UI_BUF_SIZE 4096 ///< total buffer size for pending msgpack data.
/// guranteed size available for each new event (so packing of simple events /// guaranteed size available for each new event (so packing of simple events
/// and the header of grid_line will never fail) /// and the header of grid_line will never fail)
#define EVENT_BUF_SIZE 256 #define EVENT_BUF_SIZE 256
char buf[UI_BUF_SIZE]; ///< buffer of packed but not yet sent msgpack data char buf[UI_BUF_SIZE]; ///< buffer of packed but not yet sent msgpack data
@ -43,7 +43,7 @@ typedef struct {
// We start packing the two outermost msgpack arrays before knowing the total // We start packing the two outermost msgpack arrays before knowing the total
// number of elements. Thus track the location where array size will need // number of elements. Thus track the location where array size will need
// to be written in the msgpack buffer, once the specifc array is finished. // to be written in the msgpack buffer, once the specific array is finished.
char *nevents_pos; char *nevents_pos;
char *ncalls_pos; char *ncalls_pos;
uint32_t nevents; ///< number of distinct events (top-level args to "redraw" uint32_t nevents; ///< number of distinct events (top-level args to "redraw"

View File

@ -43,7 +43,7 @@ cursorentry_T shape_table[SHAPE_IDX_COUNT] =
}; };
/// Converts cursor_shapes into an Array of Dictionaries /// Converts cursor_shapes into an Array of Dictionaries
/// @param arena initialized arena where memory will be alocated /// @param arena initialized arena where memory will be allocated
/// ///
/// @return Array of the form {[ "cursor_shape": ... ], ...} /// @return Array of the form {[ "cursor_shape": ... ], ...}
Array mode_style_array(Arena *arena) Array mode_style_array(Arena *arena)

View File

@ -5054,7 +5054,7 @@ int find_help_tags(const char *arg, int *num_matches, char ***matches, bool keep
int i; int i;
// Specific tags that either have a specific replacement or won't go // Specific tags that either have a specific replacement or won't go
// throught the generic rules. // through the generic rules.
static char *(except_tbl[][2]) = { static char *(except_tbl[][2]) = {
{ "*", "star" }, { "*", "star" },
{ "g*", "gstar" }, { "g*", "gstar" },

View File

@ -1737,7 +1737,7 @@ static bool at_ins_compl_key(void)
|| ((compl_cont_status & CONT_LOCAL) && (c == Ctrl_N || c == Ctrl_P)); || ((compl_cont_status & CONT_LOCAL) && (c == Ctrl_N || c == Ctrl_P));
} }
/// Check if typebuf.tb_buf[] contains a modifer plus key that can be changed /// Check if typebuf.tb_buf[] contains a modifier plus key that can be changed
/// into just a key, apply that. /// into just a key, apply that.
/// Check from typebuf.tb_buf[typebuf.tb_off] to typebuf.tb_buf[typebuf.tb_off + "max_offset"]. /// Check from typebuf.tb_buf[typebuf.tb_off] to typebuf.tb_buf[typebuf.tb_off + "max_offset"].
/// @return the length of the replaced bytes, 0 if nothing changed, -1 for error. /// @return the length of the replaced bytes, 0 if nothing changed, -1 for error.

View File

@ -2002,7 +2002,7 @@ int get_c_indent(void)
} }
// #defines and so on go at the left when included in 'cinkeys', // #defines and so on go at the left when included in 'cinkeys',
// exluding pragmas when customized in 'cinoptions' // excluding pragmas when customized in 'cinoptions'
if (*theline == '#' && (*linecopy == '#' || in_cinkeys('#', ' ', true))) { if (*theline == '#' && (*linecopy == '#' || in_cinkeys('#', ' ', true))) {
const char_u *const directive = (char_u *)skipwhite((char *)theline + 1); const char_u *const directive = (char_u *)skipwhite((char *)theline + 1);
if (curbuf->b_ind_pragma == 0 || STRNCMP(directive, "pragma", 6) != 0) { if (curbuf->b_ind_pragma == 0 || STRNCMP(directive, "pragma", 6) != 0) {

View File

@ -7,10 +7,8 @@
// //
// Any special key code sequences are replaced by these codes. // Any special key code sequences are replaced by these codes.
// /// For MS-DOS some keys produce codes larger than 0xff. They are split into two
// For MS-DOS some keys produce codes larger than 0xff. They are split into two /// chars, the first one is K_NUL.
// chars, the first one is K_NUL.
//
#define K_NUL (0xce) // for MS-DOS: special key follows #define K_NUL (0xce) // for MS-DOS: special key follows
/// K_SPECIAL is the first byte of a special key code and is always followed by /// K_SPECIAL is the first byte of a special key code and is always followed by
@ -59,13 +57,13 @@
#define KS_SELECT 245 #define KS_SELECT 245
#define K_SELECT_STRING (char_u *)"\200\365X" #define K_SELECT_STRING (char_u *)"\200\365X"
// Used a termcap entry that produces a normal character. /// Used a termcap entry that produces a normal character.
#define KS_KEY 242 #define KS_KEY 242
// Used for click in a tab pages label. /// Used for click in a tab pages label.
#define KS_TABLINE 240 #define KS_TABLINE 240
// Used for menu in a tab pages line. /// Used for menu in a tab pages line.
#define KS_TABMENU 239 #define KS_TABMENU 239
/// Filler used after KS_SPECIAL and others /// Filler used after KS_SPECIAL and others
@ -89,18 +87,19 @@
#define TO_SPECIAL(a, b) ((a) == KS_SPECIAL ? K_SPECIAL : (a) == \ #define TO_SPECIAL(a, b) ((a) == KS_SPECIAL ? K_SPECIAL : (a) == \
KS_ZERO ? K_ZERO : TERMCAP2KEY(a, b)) KS_ZERO ? K_ZERO : TERMCAP2KEY(a, b))
// Codes for keys that do not have a termcap name. /// Codes for keys that do not have a termcap name.
// The numbers are fixed to make sure that recorded key sequences remain valid. /// The numbers are fixed to make sure that recorded key sequences remain valid.
// Add new entries at the end, not halfway. /// Add new entries at the end, not halfway.
// ///
// K_SPECIAL KS_EXTRA KE_xxx /// K_SPECIAL KS_EXTRA KE_xxx
// ///
// Entries must be in the range 0x02-0x7f (see comment at K_SPECIAL). /// Entries must be in the range 0x02-0x7f (see comment at K_SPECIAL).
enum key_extra { enum key_extra {
KE_S_UP = 4, // shift-up KE_S_UP = 4, // shift-up
KE_S_DOWN = 5, // shift-down KE_S_DOWN = 5, // shift-down
KE_S_F1 = 6, // shifted function keys // shifted function keys
KE_S_F1 = 6,
KE_S_F2 = 7, KE_S_F2 = 7,
KE_S_F3 = 8, KE_S_F3 = 8,
KE_S_F4 = 9, KE_S_F4 = 9,
@ -160,7 +159,7 @@ enum key_extra {
KE_TAB = 54, // unshifted TAB key KE_TAB = 54, // unshifted TAB key
KE_S_TAB_OLD = 55, // shifted TAB key (no longer used) KE_S_TAB_OLD = 55, // shifted TAB key (no longer used)
// , KE_SNIFF_UNUSED = 56 // obsolete // KE_SNIFF_UNUSED = 56, // obsolete
KE_XF1 = 57, // extra vt100 function keys for xterm KE_XF1 = 57, // extra vt100 function keys for xterm
KE_XF2 = 58, KE_XF2 = 58,
KE_XF3 = 59, KE_XF3 = 59,
@ -211,14 +210,14 @@ enum key_extra {
KE_X2RELEASE = 94, KE_X2RELEASE = 94,
KE_DROP = 95, // DnD data is available KE_DROP = 95, // DnD data is available
// , KE_CURSORHOLD = 96 // CursorHold event // KE_CURSORHOLD = 96, // CursorHold event
KE_NOP = 97, // no-op: does nothing KE_NOP = 97, // no-op: does nothing
// , KE_FOCUSGAINED = 98 // focus gained // KE_FOCUSGAINED = 98, // focus gained
// , KE_FOCUSLOST = 99 // focus lost // KE_FOCUSLOST = 99, // focus lost
KE_MOUSEMOVE = 100, // mouse moved with no button down KE_MOUSEMOVE = 100, // mouse moved with no button down
// , KE_CANCEL = 101 // return from vgetc // KE_CANCEL = 101, // return from vgetc()
KE_EVENT = 102, // event KE_EVENT = 102, // event
KE_LUA = 103, // lua special key KE_LUA = 103, // Lua special key
KE_COMMAND = 104, // <Cmd> special key KE_COMMAND = 104, // <Cmd> special key
}; };
@ -259,7 +258,8 @@ enum key_extra {
#define K_XLEFT TERMCAP2KEY(KS_EXTRA, KE_XLEFT) #define K_XLEFT TERMCAP2KEY(KS_EXTRA, KE_XLEFT)
#define K_XRIGHT TERMCAP2KEY(KS_EXTRA, KE_XRIGHT) #define K_XRIGHT TERMCAP2KEY(KS_EXTRA, KE_XRIGHT)
#define K_F1 TERMCAP2KEY('k', '1') // function keys // function keys
#define K_F1 TERMCAP2KEY('k', '1')
#define K_F2 TERMCAP2KEY('k', '2') #define K_F2 TERMCAP2KEY('k', '2')
#define K_F3 TERMCAP2KEY('k', '3') #define K_F3 TERMCAP2KEY('k', '3')
#define K_F4 TERMCAP2KEY('k', '4') #define K_F4 TERMCAP2KEY('k', '4')
@ -463,13 +463,13 @@ enum key_extra {
/// Current longest is <M-C-S-T-D-A-4-ScrollWheelRight> (length includes '<' and '>'). /// Current longest is <M-C-S-T-D-A-4-ScrollWheelRight> (length includes '<' and '>').
#define MAX_KEY_NAME_LEN 32 #define MAX_KEY_NAME_LEN 32
// Maximum length of a special key event as tokens. This includes modifiers. /// Maximum length of a special key event as tokens. This includes modifiers.
// The longest event is something like <M-C-S-T-4-LeftDrag> which would be the /// The longest event is something like <M-C-S-T-4-LeftDrag> which would be the
// following string of tokens: /// following string of tokens:
// ///
// <K_SPECIAL> <KS_MODIFIER> bitmask <K_SPECIAL> <KS_EXTRA> <KE_LEFTDRAG>. /// <K_SPECIAL> <KS_MODIFIER> bitmask <K_SPECIAL> <KS_EXTRA> <KE_LEFTDRAG>.
// ///
// This is a total of 6 tokens, and is currently the longest one possible. /// This is a total of 6 tokens, and is currently the longest one possible.
#define MAX_KEY_CODE_LEN 6 #define MAX_KEY_CODE_LEN 6
#define FLAG_CPO_BSLASH 0x01 #define FLAG_CPO_BSLASH 0x01
@ -477,7 +477,7 @@ enum key_extra {
? 0 \ ? 0 \
: FLAG_CPO_BSLASH) : FLAG_CPO_BSLASH)
// Flags for replace_termcodes() /// Flags for replace_termcodes()
enum { enum {
REPTERM_FROM_PART = 1, REPTERM_FROM_PART = 1,
REPTERM_DO_LT = 2, REPTERM_DO_LT = 2,
@ -485,7 +485,7 @@ enum {
REPTERM_NO_SIMPLIFY = 8, REPTERM_NO_SIMPLIFY = 8,
}; };
// Flags for find_special_key() /// Flags for find_special_key()
enum { enum {
FSK_KEYCODE = 0x01, ///< prefer key code, e.g. K_DEL in place of DEL FSK_KEYCODE = 0x01, ///< prefer key code, e.g. K_DEL in place of DEL
FSK_KEEP_X_KEY = 0x02, ///< dont translate xHome to Home key FSK_KEEP_X_KEY = 0x02, ///< dont translate xHome to Home key

View File

@ -235,7 +235,7 @@ static void showmap(mapblock_T *mp, bool local)
/// @param[in] orig_lhs Original mapping LHS, with characters to replace. /// @param[in] orig_lhs Original mapping LHS, with characters to replace.
/// @param[in] orig_lhs_len `strlen` of orig_lhs. /// @param[in] orig_lhs_len `strlen` of orig_lhs.
/// @param[in] orig_rhs Original mapping RHS, with characters to replace. /// @param[in] orig_rhs Original mapping RHS, with characters to replace.
/// @param[in] rhs_lua Lua reference for Lua maps. /// @param[in] rhs_lua Lua reference for Lua mappings.
/// @param[in] orig_rhs_len `strlen` of orig_rhs. /// @param[in] orig_rhs_len `strlen` of orig_rhs.
/// @param[in] cpo_flags See param docs for @ref replace_termcodes. /// @param[in] cpo_flags See param docs for @ref replace_termcodes.
/// @param[out] mapargs MapArguments struct holding the replaced strings. /// @param[out] mapargs MapArguments struct holding the replaced strings.
@ -1633,7 +1633,7 @@ int makemap(FILE *fd, buf_T *buf)
continue; continue;
} }
// skip lua mappings and mappings that contain a <SNR> (script-local thing), // skip Lua mappings and mappings that contain a <SNR> (script-local thing),
// they probably don't work when loaded again // they probably don't work when loaded again
if (mp->m_luaref != LUA_NOREF) { if (mp->m_luaref != LUA_NOREF) {
continue; continue;
@ -2601,7 +2601,7 @@ fail_and_free:
/// ///
/// @param mode The abbreviation for the mode /// @param mode The abbreviation for the mode
/// @param buf The buffer to get the mapping array. NULL for global /// @param buf The buffer to get the mapping array. NULL for global
/// @param from_lua Whether it is called from internal lua api. /// @param from_lua Whether it is called from internal Lua api.
/// @returns Array of maparg()-like dictionaries describing mappings /// @returns Array of maparg()-like dictionaries describing mappings
ArrayOf(Dictionary) keymap_array(String mode, buf_T *buf, bool from_lua) ArrayOf(Dictionary) keymap_array(String mode, buf_T *buf, bool from_lua)
{ {

View File

@ -546,7 +546,7 @@ void arena_start(Arena *arena, ArenaMem *reuse_blk)
/// Finnish the allocations in an arena. /// Finnish the allocations in an arena.
/// ///
/// This does not immedately free the memory, but leaves existing allocated /// This does not immediately free the memory, but leaves existing allocated
/// objects valid, and returns an opaque ArenaMem handle, which can be used to /// objects valid, and returns an opaque ArenaMem handle, which can be used to
/// free the allocations using `arena_mem_free`, when the objects allocated /// free the allocations using `arena_mem_free`, when the objects allocated
/// from the arena are not needed anymore. /// from the arena are not needed anymore.

View File

@ -4889,7 +4889,7 @@ void op_addsub(oparg_T *oap, linenr_T Prenum1, bool g_cmd)
linenr_T amount = Prenum1; linenr_T amount = Prenum1;
// do_addsub() might trigger re-evaluation of 'foldexpr' halfway, when the // do_addsub() might trigger re-evaluation of 'foldexpr' halfway, when the
// buffer is not completly updated yet. Postpone updating folds until before // buffer is not completely updated yet. Postpone updating folds until before
// the call to changed_lines(). // the call to changed_lines().
disable_fold_update++; disable_fold_update++;

View File

@ -156,7 +156,7 @@ void rbuffer_consumed(RBuffer *buf, size_t count)
/// Use instead of rbuffer_consumed to use rbuffer in a linear, non-cyclic fashion. /// Use instead of rbuffer_consumed to use rbuffer in a linear, non-cyclic fashion.
/// ///
/// This is generally usefull if we can guarantee to parse all input /// This is generally useful if we can guarantee to parse all input
/// except some small incomplete token, like when parsing msgpack. /// except some small incomplete token, like when parsing msgpack.
void rbuffer_consumed_compact(RBuffer *buf, size_t count) void rbuffer_consumed_compact(RBuffer *buf, size_t count)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_ALL

View File

@ -1649,7 +1649,7 @@ static void clear_submatch_list(staticList10_T *sl)
/// vim_regexec_multi() match. /// vim_regexec_multi() match.
/// ///
/// If "flags" has REGSUB_COPY really copy into "dest[destlen]". /// If "flags" has REGSUB_COPY really copy into "dest[destlen]".
/// Oterwise nothing is copied, only compue the length of the result. /// Otherwise nothing is copied, only compute the length of the result.
/// ///
/// If "flags" has REGSUB_MAGIC then behave like 'magic' is set. /// If "flags" has REGSUB_MAGIC then behave like 'magic' is set.
/// ///

View File

@ -53,7 +53,7 @@ UIClientHandler ui_client_get_redraw_handler(const char *name, size_t name_len,
/// Placeholder for _sync_ requests with 'redraw' method name /// Placeholder for _sync_ requests with 'redraw' method name
/// ///
/// async 'redraw' events, which are expected when nvim acts as an ui client. /// async 'redraw' events, which are expected when nvim acts as an ui client.
/// get handled in msgpack_rpc/unpacker.c and directy dispatched to handlers /// get handled in msgpack_rpc/unpacker.c and directly dispatched to handlers
/// of specific ui events, like ui_client_event_grid_resize and so on. /// of specific ui events, like ui_client_event_grid_resize and so on.
Object handle_ui_client_redraw(uint64_t channel_id, Array args, Error *error) Object handle_ui_client_redraw(uint64_t channel_id, Array args, Error *error)
{ {