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

Make Goto line a Popup and column input #91388

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

Conversation

kitbdev
Copy link
Contributor

@kitbdev kitbdev commented May 1, 2024

Changes Goto Line Dialog to be a popup, since it should be transient. Clicking outside will close it.
Allows inputting column after the line, after a :. This is actually the character position, so tabs count as 1 and not 4. It also starts at 1, like the line number. If the column number is too high or too low, it will be clamped to the line length.

Live navigation, the editor will move to the line immediately without needing to confirm.
Pressing Enter closes the popup. Even if there is no number.
Pressing Esc closes and returns to the original position (using navigation state).
The default popup position is at the top center of the TextEditor it is on.

Fixes Goto line not deselecting.
Goto Line now centers to the line and sets the caret column to 0.

image

@KoBeWi
Copy link
Member

KoBeWi commented Oct 24, 2024

Using EditorSpinSlider won't allow inputting columns (e.g. 100:20) if we ever want to support that.

@kitbdev
Copy link
Contributor Author

kitbdev commented Oct 24, 2024

Yeah, I think column support is probably more important than expression support here.
The EditorSpinSlider isn't the best fit anyway, since it starts focused and the buttons on it are only available after unfocusing it with tab.
It would also be nice to have live changes.
I'll make some changes.

@kitbdev kitbdev changed the title Make Goto line a Popup and allow expressions Make Goto line a Popup and column input Oct 24, 2024
@kitbdev
Copy link
Contributor Author

kitbdev commented Oct 24, 2024

Updated

  • allows column number input.
  • goes to line immediately (can cancel to return).
  • no longer supports expressions.

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

Successfully merging this pull request may close these issues.

3 participants