You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When moving a line down on an inline editor, the problem seems to be moving the line to the last line and not moving the last line beyond the inline widget. But moving the line beyond the inline widgets breaks getLastVisibleLine() which starts giving 1 line less than it should and then breaking the move line up.
So this change doesn't move down in an inline editor when trying to move the line to the last visible line or when moving the last visible line down.
Tried out your fix and I'm seeing a few issues. You should be able to see them as well in the getting started project. Open an inline editor on line 14 on the h2. This opens main.css lines 19-21. Reset the file after each bug described.
Attempt to move line 20 down. Result: Does not move.
Attempt to move line 21 up. Result: Line 20 becomes line 22.
@TomMalbran Looks like this pull request was submitted right before our winter break. Just pinging you again in case you've been on vacation. Thanks for the contribution.
I knew it was before the vacations, but I got the idea about the fix right back then, and yes, I am on vacations and with poor internet connection. I'll be back in a few days anyway and try to fix this.
Moving the line 20 down on a 19-21 widget closed it, so as a fix, I blocked it. There might be a better way to fix this, but not within the function.
I didnt noticed the other issue, so the solution would be to block the moving up of the last line.
But I cant find a way to fix the first one, since the move line up generates a document change that gets into the special case of TextRange.prototype._applySingleChangeToRange which ultimately removes the link to the inline editor and closing it. I am not sure if there is a way to avoid this, but anyway, in the bug issue it was expected that the text shouldn't move if moving it would cause the inline editor to close, so this fix does this, even thought the line that causes the editor to close is not the last one as mentioned but the second to last, which is the one that I blocked from moving down.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a possible fix for the issue #1933.
When moving a line down on an inline editor, the problem seems to be moving the line to the last line and not moving the last line beyond the inline widget. But moving the line beyond the inline widgets breaks
getLastVisibleLine()
which starts giving 1 line less than it should and then breaking the move line up.So this change doesn't move down in an inline editor when trying to move the line to the last visible line or when moving the last visible line down.