mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-16 13:57:07 +09:00
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user