Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Cut and paste inline folded text will cause the cursor on the lines following the cut and pasted text to be offset by 1. #1337

Closed
rhuang opened this Issue Mar 29, 2013 · 2 comments

Comments

Projects
None yet
2 participants

rhuang commented Mar 29, 2013

I can reproduce this in the kitchen sink.

I have the following text typed out:

This is some placeholder text that will be folded inline.
This is some placeholder text that will be folded inline.
More text.
<p>The cursor in this paragraph text will be offset by 1 row.<p>
<p>Everything after this will be offset as well due to the folds in the row before too.</p>

I have font size at 14px and soft wrap at 40 chars.

I open the console and use JavaScript to perform the following folds:

Range = require('ace/range').Range;
ace.session.addFold('...', new Range(0, 8, 0, 42));
ace.session.addFold('...', new Range(1, 8, 1, 42));
ace.session.addFold('...', new Range(3, 7, 3, 51));

The result should look like this:

Folded text.

Then I cut the first 3 lines:

Cut text.

As you can see, an extra line showed up at the end.

If I try to put my cursor on the line <p>Everything after this will be offset, it won't work as the cursor keeps pointing to the end of line 2.

Now, if I put my cursor starting at line 3, as well due to the folds in the row, or anywhere below that, and then delete some characters, I will actually be deleting characters from the line above, because while the cursor is on line 3, the cursor seems to think it is actually on the line above.

You can't really tell, but I tried to delete the word folds on line 3 but the cursor deleted the word this on the line above.

Delete text.

I am using Chrome 26.0.1410.43.

Member

nightwing commented Mar 30, 2013

Thanks for awesome, detailed bug report and testcase!
Should be fixed with #1340

@nightwing nightwing closed this in 4be0153 Mar 30, 2013

rhuang commented Apr 1, 2013

Thanks for such a quick fix! Just a question, when will this fix be pushed to stable?

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