-
Notifications
You must be signed in to change notification settings - Fork 228
Expand $EDITOR in the TUI #1313
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
Conversation
pkg/tui/page/chat/chat.go
Outdated
| "zed": "Zed", | ||
| } | ||
|
|
||
| if displayName, ok := editorNames[baseName]; ok { |
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.
It would be better to check if it starts with, an $EDITOR coud be code --wait for example
84bbe25 to
8ff630b
Compare
~/english_corrector.yaml
Outdated
| @@ -0,0 +1,50 @@ | |||
| version: 2 | |||
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.
error?
pkg/tui/page/chat/chat_test.go
Outdated
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| // Set test env | ||
| t.Setenv("VISUAL", "") |
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.
Can you avoid setting env variables in tests? It prevents run running tests in parallel
pkg/tui/page/chat/chat_test.go
Outdated
| { | ||
| name: "Empty", | ||
| envValue: "", | ||
| want: "$EDITOR", |
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.
For me, $EDITOR means vim. Probably a default somewhere. Do you handle that?
|
One thing we could add here, or do in a subsequent PR, is removing the footer option altogether for those users that don't have $EDITOR set, since it just flashes the screen atm |
Signed-off-by: Jean-Laurent de Morlhon <[email protected]>
8ff630b to
885c20e
Compare
Expand $EDITOR to actual editor name in TUI help text
The TUI help footer now displays the actual configured editor name instead of the literal
string "$EDITOR".
Before: Ctrl+g edit in $EDITOR
After: Ctrl+g edit in VSCode (or Vim, Neovim, Cursor, etc.)
The implementation:
so moving from


to