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

Added cursor position check before running prompt history trigger #214

Conversation

dogusata
Copy link
Collaborator

Problem

  • When using the up and down arrow keys to grab previous prompts like in a terminal, it is not possible to navigate through the text anymore. It should only trigger the historical previous/next prompt actions when on the first and last lines
  • Cursor jumps to text end after up and down arrow actions even if there is no previous prompt available.

Solution

  • Added current cursor line check before triggering historical prompt calls.
  • Fixed unnecessary cleanup which causes a cursor jump to the end.

Tests

  • I have tested this change on VSCode
  • I have tested this change on JetBrains

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dogusata dogusata requested a review from a team as a code owner December 24, 2024 14:06
Copy link
Contributor

@ege0zcan ege0zcan left a comment

Choose a reason for hiding this comment

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

I would suggest adding some test cases to the ui tests to check for some cases:

  • Going up and down in a multiline prompt
  • Going up when the prompt input area is empty
  • Test case where the cursor is initially in the first line and then window size is shrunk down and the cursor moves to the next line

@dogusata dogusata merged commit 073bb06 into main Dec 31, 2024
2 checks passed
@dogusata dogusata deleted the dogusata/add-check-for-first-and-last-line-cursor-position-before-prompt-history-trigger branch December 31, 2024 08:43
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