Use getStringScreenWidth in Session.computeWidth
This commit is contained in:
parent
af5d11770f
commit
d4a46aa467
1 changed files with 14 additions and 17 deletions
|
|
@ -417,14 +417,11 @@ var EditSession = function(text, mode) {
|
|||
var tabSize = this.getTabSize();
|
||||
|
||||
for ( var i = 0; i < lines.length; i++) {
|
||||
var len = lines[i].length;
|
||||
var line = lines[i],
|
||||
len = line.length,
|
||||
screenLen = this.$getStringScreenWidth(line);
|
||||
longestLine = Math.max(longestLine, len);
|
||||
|
||||
lines[i].replace(/\t/g, function(m) {
|
||||
len += tabSize-1;
|
||||
return m;
|
||||
});
|
||||
longestScreenLine = Math.max(longestScreenLine, len);
|
||||
longestScreenLine = Math.max(longestScreenLine, screenLen);
|
||||
}
|
||||
this.width = longestLine;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue