Mercurial > vim
comparison src/getchar.c @ 20595:3609e842f822 v8.2.0851
patch 8.2.0851: can't distinguish <M-a> from accented "a" in the GUI
Commit: https://github.com/vim/vim/commit/f4ae6b245a54f11dd967d06b80f30e5abf55fb82
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 30 19:52:46 2020 +0200
patch 8.2.0851: can't distinguish <M-a> from accented "a" in the GUI
Problem: Can't distinguish <M-a> from accented "a" in the GUI.
Solution: Use another way to make mapping <C-bslash> work. (closes https://github.com/vim/vim/issues/6163)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 30 May 2020 20:00:03 +0200 |
parents | 5995db0fe84a |
children | fbee68c6aab1 |
comparison
equal
deleted
inserted
replaced
20594:033006d6a9c6 | 20595:3609e842f822 |
---|---|
1591 int c = c_arg; | 1591 int c = c_arg; |
1592 | 1592 |
1593 if (mod_mask & MOD_MASK_CTRL) | 1593 if (mod_mask & MOD_MASK_CTRL) |
1594 { | 1594 { |
1595 if ((c >= '`' && c <= 0x7f) || (c >= '@' && c <= '_')) | 1595 if ((c >= '`' && c <= 0x7f) || (c >= '@' && c <= '_')) |
1596 { | |
1597 c &= 0x1f; | 1596 c &= 0x1f; |
1598 mod_mask &= ~MOD_MASK_CTRL; | |
1599 } | |
1600 else if (c == '6') | 1597 else if (c == '6') |
1601 { | |
1602 // CTRL-6 is equivalent to CTRL-^ | 1598 // CTRL-6 is equivalent to CTRL-^ |
1603 c = 0x1e; | 1599 c = 0x1e; |
1600 #ifdef FEAT_GUI_GTK | |
1601 // These mappings look arbitrary at the first glance, but in fact | |
1602 // resemble quite exactly the behaviour of the GTK+ 1.2 GUI on my | |
1603 // machine. The only difference is BS vs. DEL for CTRL-8 (makes | |
1604 // more sense and is consistent with usual terminal behaviour). | |
1605 else if (c == '2') | |
1606 c = NUL; | |
1607 else if (c >= '3' && c <= '7') | |
1608 c = c ^ 0x28; | |
1609 else if (c == '8') | |
1610 c = BS; | |
1611 else if (c == '?') | |
1612 c = DEL; | |
1613 #endif | |
1614 if (c != c_arg) | |
1604 mod_mask &= ~MOD_MASK_CTRL; | 1615 mod_mask &= ~MOD_MASK_CTRL; |
1605 } | |
1606 } | 1616 } |
1607 if ((mod_mask & (MOD_MASK_META | MOD_MASK_ALT)) | 1617 if ((mod_mask & (MOD_MASK_META | MOD_MASK_ALT)) |
1608 && c >= 0 && c <= 127) | 1618 && c >= 0 && c <= 127) |
1609 { | 1619 { |
1610 c += 0x80; | 1620 c += 0x80; |