-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Keep top line in view when resizing Console to avoid losing user context #13695
Conversation
Functionally, this works well until I have results in my output, and then things start to behave weirdly. Regarding the technical implementation, I find it somewhat confusing that we're storing the |
@kobelb Thanks for the good idea of moving the state to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…d losing user context (elastic#13695) * keep current cursor or top line in view when resizing to avoid losing user context * rename variable to more descriptive name * move state from editor to smart_resize
…d losing user context (elastic#13695) * keep current cursor or top line in view when resizing to avoid losing user context * rename variable to more descriptive name * move state from editor to smart_resize
…d losing user context (elastic#13695) * keep current cursor or top line in view when resizing to avoid losing user context * rename variable to more descriptive name * move state from editor to smart_resize
fixes #10677
When moving the divider pane in console, the editor will keep the cursor in the center. If no line is selected, then the editor will keep the top line at the start of the dragging as the top line.
There is nothing in ace.js that natively does this. There is an open issue, ajaxorg/ace#3339. This PR just keeps track of the cursor or top row when dragging starts and then scrolls to that row after calling resize.