mirror of
https://github.com/Hopiu/micro.git
synced 2026-05-26 07:03:44 +00:00
Slightly improve performance for very long lines
This commit is contained in:
parent
ffc922a7c5
commit
b05d3a5193
1 changed files with 0 additions and 3 deletions
|
|
@ -74,9 +74,6 @@ func (c *Cursor) GetVisualX() int {
|
||||||
|
|
||||||
bytes := c.buf.LineBytes(c.Y)
|
bytes := c.buf.LineBytes(c.Y)
|
||||||
tabsize := int(c.buf.Settings["tabsize"].(float64))
|
tabsize := int(c.buf.Settings["tabsize"].(float64))
|
||||||
if c.X > util.CharacterCount(bytes) {
|
|
||||||
c.X = util.CharacterCount(bytes) - 1
|
|
||||||
}
|
|
||||||
|
|
||||||
return util.StringWidth(bytes, c.X, tabsize)
|
return util.StringWidth(bytes, c.X, tabsize)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue