-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Conversation
|
||
} else if (coords.top + inlineEditor.info.height < scrollInfo.top + editorHeight) { | ||
editorHeight -= inlineEditor.info.height; | ||
linesInView = _getLinesInView(textHeight, scrollTop, editorHeight); | ||
} |
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.
Since it doesn't use linesInView
inside the forEach, I could just calculate the new scrollTop
and editorHeight
and call _getLinesInView(textHeight, scrollTop, editorHeight);
just once after this for each.
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.
Thanks for explanation. I did try to understand the logic here and did verify and test scrolling with several inline editors and watched the cursor moving to next line when the previous line is moving out of view.
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.
Hehe, wasn't trying to explain it, but mentioning that the calculations here could be simplified. The idea of this for each is to remove the height of the inline editors from the scroll position and the editor height. After that is done I can just divide the left over scroll and height by the text height and get the correct first and last line in view.
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.
Sorry, I misunderstand you. Please create another pull request.
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.
Done #7120
Looks good and all the integration tests for ViewCommandHandlers pass. Merging. |
Remove the use of the viewport hack
Oh, I was going to submit a fix for the issue I mentioned... new PR I guess. |
Since #3115 is now fixed, I removed the use of the viewport hack used to properly calculate the height of the editor. This also fixes scroll adjustment when changing the font, which was using the viewport hack and stopped working when #3115 was fixed.