You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was playing with popups and textprops the other day, and made a plugin that popups the function name when on/after typing the closing paren, if the function name is not visible on screen:
+ l:col_offset : v })█ map(
I used textprops to highlight the function name in the popup as it is highlighted in the buffer, by calling synID() on every char and parsing it to an object like
Following that I translate the syntax IDs, create any missing text property types for them with prop_type_add(), offset the column start/end values, and pass the object to popup_atcursor()
That might seem like overkill for that particular use, but I have some additional ideas where I'd like to parse and reproduce the syntax highlighting. Think things similar to the output of g/{pat}/p, :changes, :jumps, etc.
A clear and concise description of what is hard to do.
Resolving the syntax stack for every char in a line seems not only awkward, but expensive compared to constructing an object for a line/range of lines in one pass from vim's internal representations.
Describe the solution you'd like
A classic highlighting equivalent of prop_list()
A function syngetline() that returns an object similar to the one above, facilitating classic highlighting to textprops conversion.
The text was updated successfully, but these errors were encountered:
I was playing with popups and textprops the other day, and made a plugin that popups the function name when on/after typing the closing paren, if the function name is not visible on screen:
I used textprops to highlight the function name in the popup as it is highlighted in the buffer, by calling
synID()
on every char and parsing it to an object likeFollowing that I translate the syntax IDs, create any missing text property types for them with
prop_type_add()
, offset the column start/end values, and pass the object topopup_atcursor()
That might seem like overkill for that particular use, but I have some additional ideas where I'd like to parse and reproduce the syntax highlighting. Think things similar to the output of
g/{pat}/p
,:changes
,:jumps
, etc.Resolving the syntax stack for every char in a line seems not only awkward, but expensive compared to constructing an object for a line/range of lines in one pass from vim's internal representations.
Describe the solution you'd like
A classic highlighting equivalent of
prop_list()
A function
syngetline()
that returns an object similar to the one above, facilitating classic highlighting to textprops conversion.The text was updated successfully, but these errors were encountered: