diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-31 18:34:32 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-07-31 18:34:32 +0100 |
commit | 101d57b34b72f4fbc7df1b6edfd64c64a6be14fc (patch) | |
tree | 246feb7236973fb7a526652ab5795f49a808e553 /src/edit.c | |
parent | c146d974f13450453a7c1f5ab10b105c515f0ccb (diff) |
patch 9.0.0124: code has more indent than neededv9.0.0124
Problem: Code has more indent than needed.
Solution: Use continue and return statements. (closes #10824)
Diffstat (limited to 'src/edit.c')
-rw-r--r-- | src/edit.c | 85 |
1 files changed, 43 insertions, 42 deletions
diff --git a/src/edit.c b/src/edit.c index 54c53ffc00..0e715c2d1b 100644 --- a/src/edit.c +++ b/src/edit.c @@ -3749,51 +3749,52 @@ ins_ctrl_(void) static int ins_start_select(int c) { - if (km_startsel) - switch (c) - { - case K_KHOME: - case K_KEND: - case K_PAGEUP: - case K_KPAGEUP: - case K_PAGEDOWN: - case K_KPAGEDOWN: + if (!km_startsel) + return FALSE; + switch (c) + { + case K_KHOME: + case K_KEND: + case K_PAGEUP: + case K_KPAGEUP: + case K_PAGEDOWN: + case K_KPAGEDOWN: # ifdef MACOS_X - case K_LEFT: - case K_RIGHT: - case K_UP: - case K_DOWN: - case K_END: - case K_HOME: + case K_LEFT: + case K_RIGHT: + case K_UP: + case K_DOWN: + case K_END: + case K_HOME: # endif - if (!(mod_mask & MOD_MASK_SHIFT)) - break; - // FALLTHROUGH - case K_S_LEFT: - case K_S_RIGHT: - case K_S_UP: - case K_S_DOWN: - case K_S_END: - case K_S_HOME: - // Start selection right away, the cursor can move with - // CTRL-O when beyond the end of the line. - start_selection(); - - // Execute the key in (insert) Select mode. - stuffcharReadbuff(Ctrl_O); - if (mod_mask) - { - char_u buf[4]; + if (!(mod_mask & MOD_MASK_SHIFT)) + break; + // FALLTHROUGH + case K_S_LEFT: + case K_S_RIGHT: + case K_S_UP: + case K_S_DOWN: + case K_S_END: + case K_S_HOME: + // Start selection right away, the cursor can move with CTRL-O when + // beyond the end of the line. + start_selection(); - buf[0] = K_SPECIAL; - buf[1] = KS_MODIFIER; - buf[2] = mod_mask; - buf[3] = NUL; - stuffReadbuff(buf); - } - stuffcharReadbuff(c); - return TRUE; - } + // Execute the key in (insert) Select mode. + stuffcharReadbuff(Ctrl_O); + if (mod_mask) + { + char_u buf[4]; + + buf[0] = K_SPECIAL; + buf[1] = KS_MODIFIER; + buf[2] = mod_mask; + buf[3] = NUL; + stuffReadbuff(buf); + } + stuffcharReadbuff(c); + return TRUE; + } return FALSE; } |