-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add --tui
Flag to Open TUI-mode on File Argument
#548
base: master
Are you sure you want to change the base?
Conversation
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 |
ui/ui.go
Outdated
// Open file passed in with TUI-mode flag | ||
m.pager.currentDocument = *localFileToMarkdown(cfg.WorkingDirectory, cfg.FilePath, cfg.FileCreatedAt, true) // TODO: Fix time | ||
m.state = stateShowDocument | ||
m.pager.update(keyEnter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hacky solution, but works.
Update |
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 (#548 (comment)). However, looking at the 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! |
any update on this? |
Adds the feature for the following issue: #535.