From 3e6db5b2ec6fc152f70246f58654d762527c9ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=E1=BA=A1m=20B=C3=ACnh=20An?= <111893501+brianhuster@users.noreply.github.com> Date: Wed, 28 Jan 2026 06:19:38 +0700 Subject: [PATCH] fix(termdebug): use mark `:` to get prompt line in prompt buffer #37336 Problem: - Nvim supports multi-line input in prompt buffer, so line(`$`) is not always the prompt line. Solution: - Use `line("':")` to get the prompt line. --- runtime/pack/dist/opt/termdebug/plugin/termdebug.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index 18b36f4e70..a57f58164b 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -692,7 +692,9 @@ func s:GdbOutCallback(job_id, msgs, event) " Add the output above the current prompt. for line in lines - call append(line('$') - 1, line) + " Nvim supports multi-line input in prompt-buffer, so the prompt line is + " not always the last line. + call append(line("':") - 1, line) endfor if !empty(lines) set modified