Mercurial > vim
diff src/libvterm/src/keyboard.c @ 17777:811a12a78164 v8.1.1885
patch 8.1.1885: comments in libvterm are inconsistent
commit https://github.com/vim/vim/commit/db1085a5630ffdaa2e9f342c06cc739ebdf1a99a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 18 20:41:38 2019 +0200
patch 8.1.1885: comments in libvterm are inconsistent
Problem: Comments in libvterm are inconsistent.
Solution: Use // comments. Als update the table of combining characters.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 18 Aug 2019 20:45:04 +0200 |
parents | 2449b6ce1456 |
children | e8d1f3209dcd |
line wrap: on
line diff
--- a/src/libvterm/src/keyboard.c +++ b/src/libvterm/src/keyboard.c @@ -8,9 +8,8 @@ void vterm_keyboard_unichar(VTerm *vt, u { int needs_CSIu; - /* The shift modifier is never important for Unicode characters - * apart from Space - */ + // The shift modifier is never important for Unicode characters + // apart from Space if(c != ' ') mod &= ~VTERM_MOD_SHIFT; @@ -23,24 +22,24 @@ void vterm_keyboard_unichar(VTerm *vt, u } switch(c) { - /* Special Ctrl- letters that can't be represented elsewise */ + // Special Ctrl- letters that can't be represented elsewise case 'i': case 'j': case 'm': case '[': needs_CSIu = 1; break; - /* Ctrl-\ ] ^ _ don't need CSUu */ + // Ctrl-\ ] ^ _ don't need CSUu case '\\': case ']': case '^': case '_': needs_CSIu = 0; break; - /* Shift-space needs CSIu */ + // Shift-space needs CSIu case ' ': needs_CSIu = !!(mod & VTERM_MOD_SHIFT); break; - /* All other characters needs CSIu except for letters a-z */ + // All other characters needs CSIu except for letters a-z default: needs_CSIu = (c < 'a' || c > 'z'); } - /* ALT we can just prefix with ESC; anything else requires CSI u */ + // ALT we can just prefix with ESC; anything else requires CSI u if(needs_CSIu && (mod & ~VTERM_MOD_ALT)) { vterm_push_output_sprintf_ctrl(vt, C1_CSI, "%d;%du", c, mod+1); return; @@ -68,7 +67,7 @@ typedef struct { int csinum; } keycodes_s; -/* Order here must be exactly the same as VTermKey enum! */ +// Order here must be exactly the same as VTermKey enum! static keycodes_s keycodes[] = { { KEYCODE_NONE, 0, 0 }, // NONE @@ -155,7 +154,7 @@ void vterm_keyboard_key(VTerm *vt, VTerm break; case KEYCODE_TAB: - /* Shift-Tab is CSI Z but plain Tab is 0x09 */ + // Shift-Tab is CSI Z but plain Tab is 0x09 if(mod == VTERM_MOD_SHIFT) vterm_push_output_sprintf_ctrl(vt, C1_CSI, "Z"); else if(mod & VTERM_MOD_SHIFT) @@ -165,7 +164,7 @@ void vterm_keyboard_key(VTerm *vt, VTerm break; case KEYCODE_ENTER: - /* Enter is CRLF in newline mode, but just LF in linefeed */ + // Enter is CRLF in newline mode, but just LF in linefeed if(vt->state->mode.newline) vterm_push_output_sprintf(vt, "\r\n"); else