glow icon indicating copy to clipboard operation
glow copied to clipboard

feat: Add `--tui` Flag to Open TUI-mode on File Argument

Open h0rv opened this issue 7 months ago • 6 comments

Adds the feature for the following issue: https://github.com/charmbracelet/glow/issues/535.

h0rv avatar Dec 10 '23 03:12 h0rv

Hi @caarlos0, would you be able to review this PR when you get a chance? I will add some tests in the meantime - thanks!

h0rv avatar Dec 10 '23 03:12 h0rv

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?

h0rv avatar Dec 10 '23 03:12 h0rv

Update x, and added functionality to open the editor at the current line as well, resolving https://github.com/charmbracelet/glow/issues/547.

h0rv avatar Jan 27 '24 17:01 h0rv

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!

h0rv avatar Jan 29 '24 23:01 h0rv

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.

h0rv avatar Mar 03 '24 18:03 h0rv

Hi @maaslalani, this PR is ready for review, thanks!

h0rv avatar Mar 03 '24 18:03 h0rv