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(cursor): Add a method to retrieve the character underneath the cursor. #624

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

Conversation

kyleochata
Copy link

Added a method to get the character beneath the Cursor.

  • func (m Model) GetChar() string

Ran into an edge case that can benefit from just knowing the character that is underneath the cursor.

@kyleochata kyleochata changed the title feat(Cursor): Add a method to retrieve the character underneath the cursor. feat(cursor): Add a method to retrieve the character underneath the cursor. Sep 23, 2024
@meowgorithm
Copy link
Member

meowgorithm commented Sep 23, 2024

Interesting! What's the edge case?

@kyleochata
Copy link
Author

After getting some sleep I realized I overlooked textinput.Position() while navigating through a textinput.

Could be useful as a quality of life change for a character check rather than calling Position() and Value()

@meowgorithm
Copy link
Member

Would love to hear your actual use case so as to better ascertain if something like this makes sense.

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