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

Unbreak rune filtering functionality #61

Merged
merged 1 commit into from
May 15, 2024

Conversation

sohomdatta1
Copy link
Contributor

Currently, the rune filtering functionality does not work since the check assumes that the reading of runes fails, which is incorrect in most circumstances when the FilterRunes function is called.

This patch flips the condition so that instead evaluates to true instead.

Currently, the rune filtering functionality does not work
since the check assumes that the reading of runes fails,
which is incorrect in most circumstances when the FilterRunes
function is called.

This patch flips the condition so that instead evaluates to true
instead.

Signed-off-by: Sohom <[email protected]>
@slingamn
Copy link
Member

Thanks!

@slingamn
Copy link
Member

I'm just curious, what's your use case for this functionality? I'd like to get a better sense of how people are using the library.

@slingamn slingamn merged commit 087affd into ergochat:master May 15, 2024
1 check passed
@sohomdatta1
Copy link
Contributor Author

I'm just curious, what's your use case for this functionality? I'd like to get a better sense of how people are using the library.

My immediate use case is to slim down https://github.com/sohomdatta1/promptui :) It appears that the upstream for that library is unmaintained and I want to update it and fix a few bugs since I depend on it for a few hobby projects :)

@slingamn
Copy link
Member

Nice :-) What I meant was, what are you using FuncFilterInputRune for?

@sohomdatta1
Copy link
Contributor Author

Nice :-) What I meant was, what are you using FuncFilterInputRune for?

The original library used UniqueEditLine to show an error prompt after the readline when the user puts in invalid input. That does not appears to be possible in the current version. My thought-process is to intercept the Enter character and show a error under the the prompt instead of processing the enter event if the input is invalid.

@sohomdatta1 sohomdatta1 deleted the filter-runes branch May 15, 2024 16:36
@slingamn
Copy link
Member

If I understand the problem statement correctly, it seems like you can accomplish this by processing the return value of ReadLine(), determining that it's invalid, and then calling SetPrompt()?

@slingamn
Copy link
Member

@sohomdatta1 I just wanted to check in about this again?

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.

2 participants