1
0
forked from aniani/vim

patch 8.0.0764: 'termkey' does not work yet

Problem:    'termkey' does not work yet.
Solution:   Implement 'termkey'.
This commit is contained in:
Bram Moolenaar
2017-07-23 22:50:51 +02:00
parent b6e0ec6b71
commit dbe948d6c3
4 changed files with 27 additions and 7 deletions

View File

@@ -60,9 +60,9 @@
* - implement term_scrape(buf, row) inspect terminal screen
* - implement term_open(command, options) open terminal window
* - implement term_getjob(buf)
* - implement 'termkey'
* - when 'encoding' is not utf-8, or the job is using another encoding, setup
* conversions.
* - In the GUI use a terminal emulator for :!cmd.
*/
#include "vim.h"
@@ -445,6 +445,10 @@ terminal_loop(void)
size_t len;
static int mouse_was_outside = FALSE;
int dragging_outside = FALSE;
int termkey = 0;
if (*curwin->w_p_tk != NUL)
termkey = string_to_key(curwin->w_p_tk, TRUE);
for (;;)
{
@@ -459,10 +463,15 @@ terminal_loop(void)
--no_mapping;
--allow_keys;
if (c == (termkey == 0 ? Ctrl_W : termkey))
{
stuffcharReadbuff(Ctrl_W);
return;
}
/* Catch keys that need to be handled as in Normal mode. */
switch (c)
{
case Ctrl_W:
case NUL:
case K_ZERO:
stuffcharReadbuff(c);