mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-13 02:50:58 +00:00
parent
39b5c4746e
commit
3741a71cc5
1 changed files with 3 additions and 0 deletions
|
|
@ -337,6 +337,9 @@ func (c *Cursor) GetCharPosInLine(lineNum, visualPos int) int {
|
|||
func (c *Cursor) GetVisualX() int {
|
||||
runes := []rune(c.buf.Line(c.Y))
|
||||
tabSize := int(c.buf.Settings["tabsize"].(float64))
|
||||
if c.X > len(runes) {
|
||||
c.X = len(runes) - 1
|
||||
}
|
||||
return StringWidth(string(runes[:c.X]), tabSize)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue