A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/neovim/neovim/commit/3ee1ba35a79be452951ac35e4f45e779332657ed below:

retain terminal buffer after K (#17046) · neovim/neovim@3ee1ba3 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+24

-5

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+24

-5

lines changed Original file line number Diff line number Diff line change

@@ -4437,11 +4437,7 @@ static void nv_ident(cmdarg_T *cap)

4437 4437

// Start insert mode in terminal buffer

4438 4438

restart_edit = 'i';

4439 4439 4440 -

add_map((char_u *)"<buffer> <esc> <Cmd>call jobstop(&channel)<CR>", TERM_FOCUS, true);

4441 -

do_cmdline_cmd("autocmd TermClose <buffer> "

4442 -

" if !v:event.status |"

4443 -

" exec 'bdelete! ' .. expand('<abuf>') |"

4444 -

" endif");

4440 +

add_map((char_u *)"<buffer> <esc> <Cmd>bdelete!<CR>", TERM_FOCUS, true);

4445 4441

}

4446 4442

}

4447 4443 Original file line number Diff line number Diff line change

@@ -33,6 +33,29 @@ describe('K', function()

33 33

feed('i'..test_file..'<ESC>K')

34 34

retry(nil, nil, function() eq(1, eval('filereadable("'..test_file..'")')) end)

35 35

eq({'fnord'}, eval("readfile('"..test_file.."')"))

36 +

-- Confirm that Neovim is still in terminal mode after K is pressed (#16692).

37 +

helpers.sleep(500)

38 +

eq('t', eval('mode()'))

39 +

feed('<space>') -- Any key, not just <space>, can be used here to escape.

40 +

eq('n', eval('mode()'))

41 +

end)

42 + 43 +

it("<esc> kills the buffer for a running 'keywordprg' command", function()

44 +

helpers.source('set keywordprg=less')

45 +

eval('writefile(["hello", "world"], "' .. test_file .. '")')

46 +

feed('i' .. test_file .. '<esc>K')

47 +

eq('t', eval('mode()'))

48 +

-- Confirm that an arbitrary keypress doesn't escape (i.e., the process is

49 +

-- still running). If the process were no longer running, an arbitrary

50 +

-- keypress would escape.

51 +

helpers.sleep(500)

52 +

feed('<space>')

53 +

eq('t', eval('mode()'))

54 +

-- Confirm that <esc> kills the buffer for the running command.

55 +

local bufnr = eval('bufnr()')

56 +

feed('<esc>')

57 +

eq('n', eval('mode()'))

58 +

helpers.neq(bufnr, eval('bufnr()'))

36 59

end)

37 60 38 61

end)

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4