[vim/vim] popup_atcursor() with buffer argument fails to display on whitespace and called from within another popup's filter (Issue #20652)

2 views
Skip to first unread message

Mao-Yining

unread,
10:05 AM (3 hours ago) 10:05 AM
to vim/vim, Subscribed
mao-yining created an issue (vim/vim#20652)

Steps to reproduce

vim9script

def ShowAtCursorWithBuffer()
	var bufnr = bufadd(null_string)
	bufload(bufnr)
	setbufline(bufnr, 1, 'Loading...')
	popup_atcursor(bufnr, {})
enddef

def ShowAtCursorWithText()
	popup_atcursor('Text', {})
enddef

def Call()
	popup_create('foo', {
		filter: (winid, key) => {
			if key == "b"
				ShowAtCursorWithBuffer()
				popup_close(winid)
			elseif key == "t"
				ShowAtCursorWithText()
				popup_close(winid)
			endif
			return 1
		}
	})
enddef

map s <ScriptCmd>Call()<CR>
map mb <ScriptCmd>ShowAtCursorWithBuffer()<CR>
map mt <ScriptCmd>ShowAtCursorWithText()<CR>
  • Type sb can't work well.
  • Type mb works well.
  • Type st works well.
  • Type mt works well.

Expected behaviour

sb works correctly as mb

Version of Vim

9.2.0677

Environment

MS-Windows GUI and TUI

Logs and stack traces


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/20652@github.com>

Reply all
Reply to author
Forward
0 new messages