ReplaceRange absorbs line content when fewer number of digits #1012

Closed
opened 2012-11-28 10:32:22 +01:00 by marijnh · 5 comments
marijnh commented 2012-11-28 10:32:22 +01:00 (Migrated from gitlab.com)

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
});

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 });
marijnh commented 2012-11-28 11:09:48 +01:00 (Migrated from gitlab.com)

Don't send me videos, send me a file that reproduces the issue. Even with your code snippet, this does not happen for me.

**Don't** send me videos, send me a file that reproduces the issue. Even with your code snippet, this does not happen for me.
marijnh commented 2012-11-29 07:20:08 +01:00 (Migrated from gitlab.com)

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

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
marijnh commented 2012-11-29 10:49:06 +01:00 (Migrated from gitlab.com)

Which browser are you testing on? Sliding downwards in the demo works just fine for me on Chrome.

Which browser are you testing on? Sliding downwards in the demo works just fine for me on Chrome.
marijnh commented 2012-11-30 08:32:25 +01:00 (Migrated from gitlab.com)

I am using Chrome 23.0.1271.91 on Snow Leopard.

I am using Chrome 23.0.1271.91 on Snow Leopard.
marijnh commented 2012-11-30 10:28:54 +01:00 (Migrated from gitlab.com)

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.

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.
marijnh (Migrated from gitlab.com) closed this issue 2012-11-30 10:28:54 +01:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/codemirror5#1012
No description provided.