Skip to content
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: option to disable external editor in Text field #516

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rahji
Copy link

@rahji rahji commented Jan 28, 2025

Adds the ability to disable the external editor option in text fields. I was looking for this feature when I noticed that someone else had asked for the same thing in issue #512

@rahji rahji requested a review from a team as a code owner January 28, 2025 03:42
@rahji rahji requested review from csandeep and removed request for a team January 28, 2025 03:42
@caarlos0
Copy link
Member

hey! thanks for the PR!

would you mind adding a test for it as well?

@rahji
Copy link
Author

rahji commented Jan 28, 2025

Yes, I can do that 👍🏽

@rahji
Copy link
Author

rahji commented Jan 28, 2025

I added a test and squashed the commits.

huh_test.go Outdated
Comment on lines 392 to 395
if !strings.Contains(view, "alt+enter / ctrl+j new line • enter submit") {
t.Log(pretty.Render(view))
t.Error("Expected field to contain help, without ctrl+e.")
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably safer to check that view doesn't not contain 'ctrl+e'?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to mirror the other text field test, but I agree with you. I updated it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants