Syntax highlighting in preview mode
It will be super if preview mode will support syntax highlighting. As I see it can be implemented using LSP.
LSP for highlighting seems like a completely an overkill. Starting a LSP per language just for highlighting?
LSP for highlighting seems like a completely an overkill. Starting a LSP per language just for highlighting?
yeah, you're right. What do you think about using chroma library or wrapping bat tool?
About using chroma
How about using environment variables, like WALK_REMOVE_CMD?
I use bat with a custom highlighting theme and indentation size.
This approach is convenient as it removes the need to configure similar settings in walk.
export WALK_PREVIEW_CMD='bat'
Problem is with tge way bubbletea works. We have to join together two strings. Getting output and joining with walk list is difficult.
Is embedding moar can help?
moar is very cool. The problem is with vertical joining.
lipgloss seems to support layouting.
However, using them may require not a few changes to the current implementation...
Joining i what I use now. The problem is with "spilling". Here explanation with html: List of files:
file.txt
another.txt
more.txt
And some highlighted code:
yaml: <green>string
with goes multiline</green>
We join the together:
file.txt yaml: <green>string
another.txt with goes multiline</green>
more.txt
And now another.txt also will be colored green.
This also happens with we truncate part of the string with "closing" escape code:
file.txt yaml: <green>string | </green>
another.txt |
more.txt |
IF we cut stuff of screen at | we will color another.txt and more.txt as green too.
What do you think about gocui?
Gocui looks cool.