Mercurial > vim
comparison src/getchar.c @ 13829:044337cbf854 v8.0.1786
patch 8.0.1786: no test for 'termwinkey'
commit https://github.com/vim/vim/commit/b2ac14c0b5e23f8ab97c5c784bcd83e13ba8ded3
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 1 18:47:59 2018 +0200
patch 8.0.1786: no test for 'termwinkey'
Problem: No test for 'termwinkey'.
Solution: Add a test. Make feedkeys() handle terminal_loop() returning
before characters are consumed.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 01 May 2018 19:00:07 +0200 |
parents | 9de2b25932eb |
children | b7ca1a8db3e8 |
comparison
equal
deleted
inserted
replaced
13828:4dece4ef17bd | 13829:044337cbf854 |
---|---|
2057 { | 2057 { |
2058 /* flush all input */ | 2058 /* flush all input */ |
2059 c = inchar(typebuf.tb_buf, typebuf.tb_buflen - 1, 0L); | 2059 c = inchar(typebuf.tb_buf, typebuf.tb_buflen - 1, 0L); |
2060 /* | 2060 /* |
2061 * If inchar() returns TRUE (script file was active) or we | 2061 * If inchar() returns TRUE (script file was active) or we |
2062 * are inside a mapping, get out of insert mode. | 2062 * are inside a mapping, get out of Insert mode. |
2063 * Otherwise we behave like having gotten a CTRL-C. | 2063 * Otherwise we behave like having gotten a CTRL-C. |
2064 * As a result typing CTRL-C in insert mode will | 2064 * As a result typing CTRL-C in insert mode will |
2065 * really insert a CTRL-C. | 2065 * really insert a CTRL-C. |
2066 */ | 2066 */ |
2067 if ((c || typebuf.tb_maplen) | 2067 if ((c || typebuf.tb_maplen) |
2753 * For the cmdline window: Alternate between ESC and | 2753 * For the cmdline window: Alternate between ESC and |
2754 * CTRL-C: ESC for most situations and CTRL-C to close the | 2754 * CTRL-C: ESC for most situations and CTRL-C to close the |
2755 * cmdline window. */ | 2755 * cmdline window. */ |
2756 if (p_im && (State & INSERT)) | 2756 if (p_im && (State & INSERT)) |
2757 c = Ctrl_L; | 2757 c = Ctrl_L; |
2758 #ifdef FEAT_TERMINAL | |
2759 else if (terminal_is_active()) | |
2760 c = K_CANCEL; | |
2761 #endif | |
2758 else if ((State & CMDLINE) | 2762 else if ((State & CMDLINE) |
2759 #ifdef FEAT_CMDWIN | 2763 #ifdef FEAT_CMDWIN |
2760 || (cmdwin_type > 0 && tc == ESC) | 2764 || (cmdwin_type > 0 && tc == ESC) |
2761 #endif | 2765 #endif |
2762 ) | 2766 ) |
2896 #endif | 2900 #endif |
2897 } | 2901 } |
2898 } /* for (;;) */ | 2902 } /* for (;;) */ |
2899 } /* if (!character from stuffbuf) */ | 2903 } /* if (!character from stuffbuf) */ |
2900 | 2904 |
2901 /* if advance is FALSE don't loop on NULs */ | 2905 /* if advance is FALSE don't loop on NULs */ |
2902 } while (c < 0 || (advance && c == NUL)); | 2906 } while ((c < 0 && c != K_CANCEL) || (advance && c == NUL)); |
2903 | 2907 |
2904 /* | 2908 /* |
2905 * The "INSERT" message is taken care of here: | 2909 * The "INSERT" message is taken care of here: |
2906 * if we return an ESC to exit insert mode, the message is deleted | 2910 * if we return an ESC to exit insert mode, the message is deleted |
2907 * if we don't return an ESC but deleted the message before, redisplay it | 2911 * if we don't return an ESC but deleted the message before, redisplay it |