mirror of
https://github.com/neovim/neovim.git
synced 2026-06-15 16:23:48 +00:00
fix(terminal): memory leak when pasting '=' register (#39738)
Problem: Memory leak when pasting '=' register in terminal.
Solution: Free the register.
(cherry picked from commit 41e8201c6c)
This commit is contained in:
committed by
github-actions[bot]
parent
dfd6cd477f
commit
fa69cac7e3
@@ -1470,7 +1470,7 @@ void do_put(int regname, yankreg_T *reg, int dir, int count, int flags)
|
||||
|
||||
if (curbuf->terminal) {
|
||||
terminal_paste(count, y_array, y_size);
|
||||
return;
|
||||
goto end;
|
||||
}
|
||||
|
||||
colnr_T split_pos = 0;
|
||||
@@ -2076,7 +2076,9 @@ end:
|
||||
xfree(y_array);
|
||||
}
|
||||
|
||||
VIsual_active = false;
|
||||
if (!curbuf->terminal) { // XXX
|
||||
VIsual_active = false;
|
||||
}
|
||||
|
||||
// If the cursor is past the end of the line put it at the end.
|
||||
adjust_cursor_eol();
|
||||
|
||||
@@ -123,6 +123,14 @@ describe(':terminal buffer', function()
|
||||
appended tty ready |*5
|
||||
|
|
||||
]])
|
||||
-- pasting expression register shouldn't leak memory
|
||||
feed([["="abcd\nefghi"<CR>pi]])
|
||||
screen:expect([[
|
||||
appended tty ready |*4
|
||||
abcd |
|
||||
efghi^ |
|
||||
{5:-- TERMINAL --} |
|
||||
]])
|
||||
end)
|
||||
|
||||
it('sends data to the terminal when the ":put" command is used', function()
|
||||
|
||||
Reference in New Issue
Block a user