summaryrefslogtreecommitdiffstats
path: root/src/digraph.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2023-01-09 19:04:23 +0000
committerBram Moolenaar <Bram@vim.org>2023-01-09 19:04:23 +0000
commit1cfb14aa972ccf3235ac67f07b7db1175b7c5384 (patch)
treeb746eda548993b9e0987d7c9c0c543ddddc5758f /src/digraph.c
parent765d82a657c5e42d5d7c88ae410e53f398c34c43 (diff)
patch 9.0.1166: code is indented more than necessaryv9.0.1166
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes #11792)
Diffstat (limited to 'src/digraph.c')
-rw-r--r--src/digraph.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/digraph.c b/src/digraph.c
index 88643e35f7..97a72e1d55 100644
--- a/src/digraph.c
+++ b/src/digraph.c
@@ -1533,29 +1533,30 @@ get_digraph(
c = plain_vgetc();
--no_mapping;
--allow_keys;
- if (c != ESC) // ESC cancels CTRL-K
+
+ if (c == ESC) // ESC cancels CTRL-K
+ return NUL;
+
+ if (IS_SPECIAL(c)) // insert special key code
+ return c;
+ if (cmdline)
{
- if (IS_SPECIAL(c)) // insert special key code
- return c;
- if (cmdline)
- {
- if (char2cells(c) == 1
+ if (char2cells(c) == 1
#if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
- && cmdline_star == 0
+ && cmdline_star == 0
#endif
- )
- putcmdline(c, TRUE);
- }
- else
- add_to_showcmd(c);
- ++no_mapping;
- ++allow_keys;
- cc = plain_vgetc();
- --no_mapping;
- --allow_keys;
- if (cc != ESC) // ESC cancels CTRL-K
- return digraph_get(c, cc, TRUE);
+ )
+ putcmdline(c, TRUE);
}
+ else
+ add_to_showcmd(c);
+ ++no_mapping;
+ ++allow_keys;
+ cc = plain_vgetc();
+ --no_mapping;
+ --allow_keys;
+ if (cc != ESC) // ESC cancels CTRL-K
+ return digraph_get(c, cc, TRUE);
return NUL;
}