glow
glow copied to clipboard
feat: Add `--tui` Flag to Open TUI-mode on File Argument
Adds the feature for the following issue: https://github.com/charmbracelet/glow/issues/535.
Hi @caarlos0, would you be able to review this PR when you get a chance? I will add some tests in the meantime - thanks!
Note: I added optional function parameter (params that have ...<type>
) to existing functions so the existing calls still work. Should I remove that and make them required and just update the other existing calls, or leave it?
Update x
, and added functionality to open the editor at the current line as well, resolving https://github.com/charmbracelet/glow/issues/547.
This is the function I want to extract the logic out to open a documentation, so I don't have to simulate the user clicking "enter" on the file they pass in (https://github.com/charmbracelet/glow/pull/548#discussion_r1421678257). However, looking at the update
function, it would be hard to take the logic out due to the list of commands/messages being collected.
https://github.com/meowgorithm, https://github.com/caarlos0, any thoughts on how to approach this, or is the hack "good enough" for now? Thanks!
Due to rendered spacing, there is some inconsistency to where which line is opened in the editor. Not sure if there is a way to get this exact but it should be good enough as of now.
Hi @maaslalani, this PR is ready for review, thanks!