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
1/ Clean content
2/ Add this as the first line : 123456789 123456789 123456789 12
3/ On second line, press TAB key 16 times and add 123456789 1234567
4/ Horizontal scrollbar should appear
5/ Put cursor at the end of the second line
6/ Press DEL to remove the '7' char
=> End of second line is truncated
I dig into the source code, and I noticed that lineLength function (src/line/spans.js) doesn't take tabs into account. Maybe I misunderstood something but I have fix this with :
function lineLength(line, tabSize) {
if (line.height == 0) return 0;
// take tabs into account
var text = line.text.replace(/\t/g, Array(tabSize).fill(" "));
var len = text.length, merged, cur = line;
The text was updated successfully, but these errors were encountered:
Reproduced on Windows 10 Chrome stable
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
Reproduced on Windows 10 Firefox stable
"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0"
Go to: http://codemirror.net/demo/visibletabs.html
(Chrome Version 56.0.2924.87)
1/ Clean content
2/ Add this as the first line : 123456789 123456789 123456789 12
3/ On second line, press TAB key 16 times and add 123456789 1234567
4/ Horizontal scrollbar should appear
5/ Put cursor at the end of the second line
6/ Press DEL to remove the '7' char
=> End of second line is truncated
I dig into the source code, and I noticed that lineLength function (src/line/spans.js) doesn't take tabs into account. Maybe I misunderstood something but I have fix this with :
The text was updated successfully, but these errors were encountered: