[vim/vim] Fragile `tagfunc` `cmd` Field Parsing (Issue #20781)

3 views
Skip to first unread message

Mao-Yining

unread,
4:32 AM (10 hours ago) 4:32 AM
to vim/vim, Subscribed
mao-yining created an issue (vim/vim#20781)

Steps to reproduce

vim --clean -Nu ./vimrc, vimrc:

vim9script
var foo = []
var res = {name: 'foo', kind: 'f', filename: @% ?? 'filename', cmd: '/\%3l\%5c'}
def Tag(_, _, _): list<dict<string>>
	return [res]
enddef
setl tagfunc=Tag
echo taglist('foo')->string()
res.cmd = 'call cursor(3, 5)'
echo taglist('foo')->string()
res.cmd = 'norm! 3G5|'
echo taglist('foo')->string()
quit

Output:

[{'cmd': '/\%3l\%5c;"	f', 'static': 0, 'name': 'foo', 'kind': '', 'filename': 'filename'}]
[{'cmd': 'call cursor(3, 5);"	f', 'static': 0, 'name': 'foo', 'kind': '', 'filename': 'filename'}]
[{'cmd': 'norm! 3G5', 'static': 0, 'name': 'foo', 'kind': 'f', 'filename': 'filename'}]

Expected behaviour

Expect:

[{'cmd': '/\%3l\%5c/', 'static': 0, 'name': 'foo', 'kind': 'f', 'filename': 'filename'}]
[{'cmd': 'call cursor(3, 5)', 'static': 0, 'name': 'foo', 'kind': 'f', 'filename': 'filename'}]
[{'cmd': 'norm! 3G5|', 'static': 0, 'name': 'foo', 'kind': 'f', 'filename': 'filename'}]

Version of Vim

92.782

Environment

MS-Windows and WSL GUI

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/20781@github.com>

Mao-Yining

unread,
4:35 AM (10 hours ago) 4:35 AM
to vim/vim, Subscribed
mao-yining left a comment (vim/vim#20781)

relates: yegappan/lsp#824


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/20781/5000775693@github.com>

Reply all
Reply to author
Forward
0 new messages