ReplaceRange absorbs line content when fewer number of digits #1012
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I demonstrate it in a video here:
http://www.screenr.com/n4S7
I'm running a editor.replaceRange, and it works nicely for values that have the same number of digits. The general idea here is I do:
obj = editor.getTokenAt(currLine);
editor.replaceRange(ui.value.toString(), {
line: currLine.line,
ch: obj.start
}, {
line: currLine.line,
ch: obj.end
});
Don't send me videos, send me a file that reproduces the issue. Even with your code snippet, this does not happen for me.
It occurs with code between lines 454 and 472 on https://github.com/rioleo/fabrique/blob/master/index.php or can be demonstrated live by clicking on line 3's y value (100) and sliding it downwards: http://rioleo.org/fabrique
Which browser are you testing on? Sliding downwards in the demo works just fine for me on Chrome.
I am using Chrome 23.0.1271.91 on Snow Leopard.
You know what I really hate? Debugging other people's code without getting paid for it. You're calling replaceRange with the same start and end, even after the actual number shrank. Simply log the inputs you're giving to replaceRange to see it. Also, to reproduce, set a value to 100, and click on the left side of the second zero before sliding down.