aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2022-08-03 03:47:16 +0200
committerGitHub <noreply@github.com>2022-08-03 09:47:16 +0800
commitb8dcbcc732baf84fc48d6b272c3ade0bcb129b3b (patch)
tree4818e98e9211d71d21eec359f29721e2b3ff3f2e /src
parentcc1ceebf8f13aed1ec0cbe0ff1ad7b2d8a6f10be (diff)
downloadrneovim-b8dcbcc732baf84fc48d6b272c3ade0bcb129b3b.tar.gz
rneovim-b8dcbcc732baf84fc48d6b272c3ade0bcb129b3b.tar.bz2
rneovim-b8dcbcc732baf84fc48d6b272c3ade0bcb129b3b.zip
docs: fix typos (#19588)
Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: notomo <notomo.motono@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/nvim/api/ui.c4
-rw-r--r--src/nvim/cursor_shape.c2
-rw-r--r--src/nvim/ex_cmds.c2
-rw-r--r--src/nvim/getchar.c2
-rw-r--r--src/nvim/indent_c.c2
-rw-r--r--src/nvim/keycodes.h90
-rw-r--r--src/nvim/mapping.c6
-rw-r--r--src/nvim/memory.c2
-rw-r--r--src/nvim/ops.c2
-rw-r--r--src/nvim/rbuffer.c2
-rw-r--r--src/nvim/regexp.c2
-rw-r--r--src/nvim/ui_client.c2
12 files changed, 59 insertions, 59 deletions
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c
index aa7bed1132..6239e414a7 100644
--- a/src/nvim/api/ui.c
+++ b/src/nvim/api/ui.c
@@ -27,7 +27,7 @@ typedef struct {
uint64_t channel_id;
#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)
#define EVENT_BUF_SIZE 256
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
// 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 *ncalls_pos;
uint32_t nevents; ///< number of distinct events (top-level args to "redraw"
diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c
index 62cf60e03b..9c33b1a806 100644
--- a/src/nvim/cursor_shape.c
+++ b/src/nvim/cursor_shape.c
@@ -43,7 +43,7 @@ cursorentry_T shape_table[SHAPE_IDX_COUNT] =
};
/// 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": ... ], ...}
Array mode_style_array(Arena *arena)
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 5ff1a9dd47..23e7660606 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -5054,7 +5054,7 @@ int find_help_tags(const char *arg, int *num_matches, char ***matches, bool keep
int i;
// 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]) = {
{ "*", "star" },
{ "g*", "gstar" },
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 4a5841ca6e..28ff0cbd59 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -1737,7 +1737,7 @@ static bool at_ins_compl_key(void)
|| ((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.
/// 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.
diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c
index b89ab19226..c5e030ce25 100644
--- a/src/nvim/indent_c.c
+++ b/src/nvim/indent_c.c
@@ -2002,7 +2002,7 @@ int get_c_indent(void)
}
// #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))) {
const char_u *const directive = (char_u *)skipwhite((char *)theline + 1);
if (curbuf->b_ind_pragma == 0 || STRNCMP(directive, "pragma", 6) != 0) {
diff --git a/src/nvim/keycodes.h b/src/nvim/keycodes.h
index f6c576f6ee..c4d984ee17 100644
--- a/src/nvim/keycodes.h
+++ b/src/nvim/keycodes.h
@@ -7,10 +7,8 @@
//
// 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
-// chars, the first one is K_NUL.
-//
+/// For MS-DOS some keys produce codes larger than 0xff. They are split into two
+/// chars, the first one is K_NUL.
#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
@@ -59,13 +57,13 @@
#define KS_SELECT 245
#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
-// Used for click in a tab pages label.
+/// Used for click in a tab pages label.
#define KS_TABLINE 240
-// Used for menu in a tab pages line.
+/// Used for menu in a tab pages line.
#define KS_TABMENU 239
/// Filler used after KS_SPECIAL and others
@@ -89,18 +87,19 @@
#define TO_SPECIAL(a, b) ((a) == KS_SPECIAL ? K_SPECIAL : (a) == \
KS_ZERO ? K_ZERO : TERMCAP2KEY(a, b))
-// Codes for keys that do not have a termcap name.
-// The numbers are fixed to make sure that recorded key sequences remain valid.
-// Add new entries at the end, not halfway.
-//
-// K_SPECIAL KS_EXTRA KE_xxx
-//
-// Entries must be in the range 0x02-0x7f (see comment at K_SPECIAL).
+/// Codes for keys that do not have a termcap name.
+/// The numbers are fixed to make sure that recorded key sequences remain valid.
+/// Add new entries at the end, not halfway.
+///
+/// K_SPECIAL KS_EXTRA KE_xxx
+///
+/// Entries must be in the range 0x02-0x7f (see comment at K_SPECIAL).
enum key_extra {
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_F3 = 8,
KE_S_F4 = 9,
@@ -141,7 +140,7 @@ enum key_extra {
KE_S_F36 = 41,
KE_S_F37 = 42,
- KE_MOUSE = 43, // mouse event start
+ KE_MOUSE = 43, // mouse event start
// Symbols for pseudo keys which are translated from the real key symbols
// above.
@@ -153,14 +152,14 @@ enum key_extra {
KE_MIDDLERELEASE = 49, // Middle mouse button release
KE_RIGHTMOUSE = 50, // Right mouse button click
KE_RIGHTDRAG = 51, // Drag with right mouse button down
- KE_RIGHTRELEASE = 52, // Right mouse button release
+ KE_RIGHTRELEASE = 52, // Right mouse button release
- KE_IGNORE = 53, // Ignored mouse drag/release
+ KE_IGNORE = 53, // Ignored mouse drag/release
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_XF2 = 58,
KE_XF3 = 59,
@@ -175,7 +174,7 @@ enum key_extra {
KE_XRIGHT = 68,
KE_LEFTMOUSE_NM = 69, // non-mappable Left mouse button click
- KE_LEFTRELEASE_NM = 70, // non-mappable left mouse button release
+ KE_LEFTRELEASE_NM = 70, // non-mappable left mouse button release
KE_S_XF1 = 71, // vt100 shifted function keys for xterm
KE_S_XF2 = 72,
@@ -188,20 +187,20 @@ enum key_extra {
KE_MOUSEDOWN = 75, // scroll wheel pseudo-button Down
KE_MOUSEUP = 76, // scroll wheel pseudo-button Up
KE_MOUSELEFT = 77, // scroll wheel pseudo-button Left
- KE_MOUSERIGHT = 78, // scroll wheel pseudo-button Right
+ KE_MOUSERIGHT = 78, // scroll wheel pseudo-button Right
KE_KINS = 79, // keypad Insert key
- KE_KDEL = 80, // keypad Delete key
+ KE_KDEL = 80, // keypad Delete key
// KE_CSI = 81, // Nvim doesn't need escaping CSI
KE_SNR = 82, // <SNR>
KE_PLUG = 83, // <Plug>
- KE_CMDWIN = 84, // open command-line window from Command-line Mode
+ KE_CMDWIN = 84, // open command-line window from Command-line Mode
KE_C_LEFT = 85, // control-left
KE_C_RIGHT = 86, // control-right
KE_C_HOME = 87, // control-home
- KE_C_END = 88, // control-end
+ KE_C_END = 88, // control-end
KE_X1MOUSE = 89, // X1/X2 mouse-buttons
KE_X1DRAG = 90,
@@ -210,16 +209,16 @@ enum key_extra {
KE_X2DRAG = 93,
KE_X2RELEASE = 94,
- KE_DROP = 95, // DnD data is available
- // , KE_CURSORHOLD = 96 // CursorHold event
- KE_NOP = 97, // no-op: does nothing
- // , KE_FOCUSGAINED = 98 // focus gained
- // , KE_FOCUSLOST = 99 // focus lost
- KE_MOUSEMOVE = 100, // mouse moved with no button down
- // , KE_CANCEL = 101 // return from vgetc
+ KE_DROP = 95, // DnD data is available
+ // KE_CURSORHOLD = 96, // CursorHold event
+ KE_NOP = 97, // no-op: does nothing
+ // KE_FOCUSGAINED = 98, // focus gained
+ // KE_FOCUSLOST = 99, // focus lost
+ KE_MOUSEMOVE = 100, // mouse moved with no button down
+ // KE_CANCEL = 101, // return from vgetc()
KE_EVENT = 102, // event
- KE_LUA = 103, // lua special key
- KE_COMMAND = 104, // <Cmd> special key
+ KE_LUA = 103, // Lua special key
+ KE_COMMAND = 104, // <Cmd> special key
};
// the three byte codes are replaced with the following int when using vgetc()
@@ -259,7 +258,8 @@ enum key_extra {
#define K_XLEFT TERMCAP2KEY(KS_EXTRA, KE_XLEFT)
#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_F3 TERMCAP2KEY('k', '3')
#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 '>').
#define MAX_KEY_NAME_LEN 32
-// 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
-// following string of tokens:
-//
-// <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.
+/// 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
+/// following string of tokens:
+///
+/// <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.
#define MAX_KEY_CODE_LEN 6
#define FLAG_CPO_BSLASH 0x01
@@ -477,7 +477,7 @@ enum key_extra {
? 0 \
: FLAG_CPO_BSLASH)
-// Flags for replace_termcodes()
+/// Flags for replace_termcodes()
enum {
REPTERM_FROM_PART = 1,
REPTERM_DO_LT = 2,
@@ -485,7 +485,7 @@ enum {
REPTERM_NO_SIMPLIFY = 8,
};
-// Flags for find_special_key()
+/// Flags for find_special_key()
enum {
FSK_KEYCODE = 0x01, ///< prefer key code, e.g. K_DEL in place of DEL
FSK_KEEP_X_KEY = 0x02, ///< don’t translate xHome to Home key
diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c
index 520a91491a..1797bb0365 100644
--- a/src/nvim/mapping.c
+++ b/src/nvim/mapping.c
@@ -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_len `strlen` of orig_lhs.
/// @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] cpo_flags See param docs for @ref replace_termcodes.
/// @param[out] mapargs MapArguments struct holding the replaced strings.
@@ -1633,7 +1633,7 @@ int makemap(FILE *fd, buf_T *buf)
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
if (mp->m_luaref != LUA_NOREF) {
continue;
@@ -2601,7 +2601,7 @@ fail_and_free:
///
/// @param mode The abbreviation for the mode
/// @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
ArrayOf(Dictionary) keymap_array(String mode, buf_T *buf, bool from_lua)
{
diff --git a/src/nvim/memory.c b/src/nvim/memory.c
index a74fcf6137..5ae7f7bbe3 100644
--- a/src/nvim/memory.c
+++ b/src/nvim/memory.c
@@ -546,7 +546,7 @@ void arena_start(Arena *arena, ArenaMem *reuse_blk)
/// 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
/// free the allocations using `arena_mem_free`, when the objects allocated
/// from the arena are not needed anymore.
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 660902b10b..53612be697 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -4889,7 +4889,7 @@ void op_addsub(oparg_T *oap, linenr_T Prenum1, bool g_cmd)
linenr_T amount = Prenum1;
// 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().
disable_fold_update++;
diff --git a/src/nvim/rbuffer.c b/src/nvim/rbuffer.c
index 6407ac172e..2f718e9c2e 100644
--- a/src/nvim/rbuffer.c
+++ b/src/nvim/rbuffer.c
@@ -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.
///
-/// 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.
void rbuffer_consumed_compact(RBuffer *buf, size_t count)
FUNC_ATTR_NONNULL_ALL
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index c2a9c90dda..fbbf904f8b 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -1649,7 +1649,7 @@ static void clear_submatch_list(staticList10_T *sl)
/// vim_regexec_multi() match.
///
/// 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.
///
diff --git a/src/nvim/ui_client.c b/src/nvim/ui_client.c
index 09e971f03f..a586fec3bf 100644
--- a/src/nvim/ui_client.c
+++ b/src/nvim/ui_client.c
@@ -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
///
/// 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.
Object handle_ui_client_redraw(uint64_t channel_id, Array args, Error *error)
{