Repository navigation
Handle edits that scroll up due to hiding the horizontal scrollbar - #15831
Conversation
Updating the soft wrap column could cause us to compute different values for derived dimensions, so any dimensions that were cached *in the process* of updating the soft wrap column need to be cleared.
|
@as-cii @nathansobo appveyor is getting the same failure that I saw locally. |
0521d9a to
43fcdf8
Compare
|
@as-cii I paired with @nathansobo on this. Can you take a look at our proposed change when you have time? 👀 Setup: We then delete all content except the first character of the file which causes an update. Our proposed change is to restart the frame in scenarios where the scrollbar visibility changes during the update. Maybe you have some other idea on how we could solve this? You can ask me in Slack if this doesn't make sense, explaining is hard 😆 We still need to change the spec to style the scrollbars so it's failing on other platforms and probably rebase and clean up the git history. |
|
@Ben3eeE Hope you don't mind. I made a small clarifying edit to the body of this PR. |
| component.scheduleUpdate() | ||
| await component.getNextUpdatePromise() | ||
|
|
||
| editor.setSelectedBufferRange(new Range(Point(0,1),Point(12,2))) |
There was a problem hiding this comment.
It's fine to express a range as nested arrays like [[0, 1], [12, 2]], especially in tests.
| const restartFrame = this.measureContentDuringUpdateSync() | ||
| scheduler.updateDocument(() => { | ||
| this.updateSyncAfterMeasuringContent() | ||
| if (restartFrame) { |
There was a problem hiding this comment.
We probably should support this same behavior on the non-scheduled code path as well, which is in the else branch of the useScheduler === true branch.
| // rendered start row accurately. 😥 | ||
| this.populateVisibleRowRange(renderedStartRow) | ||
| this.props.model.setEditorWidthInChars(this.getScrollContainerClientWidthInBaseCharacters()) | ||
| this.derivedDimensionsCache = {} |
There was a problem hiding this comment.
Did this fix some other failing seed or something?
There was a problem hiding this comment.
This is cherry-picked from your PR which was not yet merged when this was opened #15828 just to verify that PR wouldn't fix this failure.
|
@Ben3eeE Maybe rebase this on the latest master? I feel like that autocomplete failure on Circle might be fixed in newer versions. Could be wrong. |
|
@nathansobo Yeah that failure is something Justin has already fixed. We should definitely rebase this. As a side note edit: I'm not really sure how to rebase this and I'm going to be away for a couple of days. If someone wants to get this merged before then please feel free to rebase and address the review comments. |
|
What's the status of this? Should we go ahead and merge it? It looks reasonable, although seems like tests are failing. |
We need to address the review feedback by @nathansobo and style the scrollbars in the test to be the same size as the lineHeight so it's consistently failing on all platforms. It was only failing on appveyor because both the scrollbar and lineHeight was both 17 or something. The failing test was on master when this PR was created and has already been fixed and everything should be green if we rebase with master. I won't have time to work on these things anytime soon and will be away for quite a while starting today 🌴 |
|
Addressed the review comments by @nathansobo and edited the body of the PR to reflect the current status of this PR. |
|
This fixes some serious known issues but @Ben3eeE is having trouble coming up with a regression test that works on all platforms. In the interest of not delaying further, I'm going to merge this now and @Ben3eeE is going to follow up with another attempt at a regression test, possibly based on hard coding a failing seed in addition to the randomly generated ones in our randomized test. |
|
Thanks @Ben3eeE. I feel honored to work with you and am truly thankful for all that you contribute. ❤️ ⚡ |
This causes the failure fixed by #15831 to be caught by the randomized test more easily
TODO
Before:

After:

Fixes #16289
Fixes #16722
Fixes #16710
Fixes #15263