diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-05-26 21:45:46 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-05-26 21:50:37 -0400 |
commit | 3c3b7844b95879bcfd86677df4cfac3edb0fb132 (patch) | |
tree | f34ba1b9e0e138f86666e77280da66f6ca0687e3 /src/nvim/normal.c | |
parent | b2a11515b2cf6923dd0c1a36efe22aabf6bc582c (diff) | |
download | rneovim-3c3b7844b95879bcfd86677df4cfac3edb0fb132.tar.gz rneovim-3c3b7844b95879bcfd86677df4cfac3edb0fb132.tar.bz2 rneovim-3c3b7844b95879bcfd86677df4cfac3edb0fb132.zip |
lint
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index b63d3812d4..db2da6a807 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -541,30 +541,29 @@ static bool normal_need_additional_char(NormalState *s) int flags = nv_cmds[s->idx].cmd_flags; bool pending_op = s->oa.op_type != OP_NOP; int cmdchar = s->ca.cmdchar; - return - // without NV_NCH we never need to check for an additional char - flags & NV_NCH && ( - // NV_NCH_NOP is set and no operator is pending, get a second char - ((flags & NV_NCH_NOP) == NV_NCH_NOP && !pending_op) - // NV_NCH_ALW is set, always get a second char - || (flags & NV_NCH_ALW) == NV_NCH_ALW - // 'q' without a pending operator, recording or executing a register, - // needs to be followed by a second char, examples: - // - qc => record using register c - // - q: => open command-line window - || (cmdchar == 'q' - && !pending_op - && reg_recording == 0 - && reg_executing == 0) - // 'a' or 'i' after an operator is a text object, examples: - // - ciw => change inside word - // - da( => delete parenthesis and everything inside. - // Also, don't do anything when these keys are received in visual mode - // so just get another char. - // - // TODO(tarruda): Visual state needs to be refactored into a - // separate state that "inherits" from normal state. - || ((cmdchar == 'a' || cmdchar == 'i') && (pending_op || VIsual_active))); + // without NV_NCH we never need to check for an additional char + return flags & NV_NCH && ( + // NV_NCH_NOP is set and no operator is pending, get a second char + ((flags & NV_NCH_NOP) == NV_NCH_NOP && !pending_op) + // NV_NCH_ALW is set, always get a second char + || (flags & NV_NCH_ALW) == NV_NCH_ALW + // 'q' without a pending operator, recording or executing a register, + // needs to be followed by a second char, examples: + // - qc => record using register c + // - q: => open command-line window + || (cmdchar == 'q' + && !pending_op + && reg_recording == 0 + && reg_executing == 0) + // 'a' or 'i' after an operator is a text object, examples: + // - ciw => change inside word + // - da( => delete parenthesis and everything inside. + // Also, don't do anything when these keys are received in visual mode + // so just get another char. + // + // TODO(tarruda): Visual state needs to be refactored into a + // separate state that "inherits" from normal state. + || ((cmdchar == 'a' || cmdchar == 'i') && (pending_op || VIsual_active))); } static bool normal_need_redraw_mode_message(NormalState *s) |