Skip to main content
3 votes

How to add a third argument to a popup_menu() callback function?

I would use lambda function to dispatch: vim9script var my_fruit = ['banana', 'apple', 'orange'] var my_animals = ['dog', 'cat', 'snake'] def MyPopupCallback(type: string, id: number, idx: number) ...
Maxim Kim's user avatar
  • 13.8k
2 votes
Accepted

How to add a third argument to a popup_menu() callback function?

You were on the right track, you basically need to use function() to create a partial. I modified your example code to come up with this: vim9script var my_fruit: list<string> = ['banana', '...
Heptite's user avatar
  • 1,165
2 votes
Accepted

Multiple nesting in syntax highlighting

This one looks absolutely straightforward to me. syn region level1 start=/header/ end=/trailer/ contains=level2,error1 syn match error1 /anything except trailer, empty space or {/ contained syn region ...
Matt's user avatar
  • 21.4k
1 vote

Multiple nesting in syntax highlighting

If I broke the EBNF down a bit further such that: By focusing on the lowest, deepest grouping (block_2), we get " Inside nest 2 " hi link trailer2 Number syn match trailer2 "trailer2&...
John Greene's user avatar
1 vote

syntax highlighting needs rejoining back to common regexes

I'll attempt a short answer here. Based on my experience, it seems you are trying to use classical parsing in a way that is not possible Vim's syntax engine. I would instead "embrace" the ...
Karl Yngve Lervåg's user avatar
1 vote

Do not delay mapped keys with common prefix

Here's a different approach taken from my config. In my approach, we use the SafeState autocommand rather than waiting for a timeout. This works by immediately performing the mapped action, manually ...
user22476690's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible