mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-30 06:37:14 +09:00
Use rope substring instead of report
This commit is contained in:
@@ -102,9 +102,9 @@ func (c *Cursor) DeleteSelection() {
|
||||
// GetSelection returns the cursor's selection
|
||||
func (c *Cursor) GetSelection() string {
|
||||
if c.curSelection[0] > c.curSelection[1] {
|
||||
return string([]rune(c.v.Buf.Text)[c.curSelection[1]:c.curSelection[0]])
|
||||
return c.v.Buf.Substr(c.curSelection[1], c.curSelection[0])
|
||||
}
|
||||
return string([]rune(c.v.Buf.Text)[c.curSelection[0]:c.curSelection[1]])
|
||||
return c.v.Buf.Substr(c.curSelection[0], c.curSelection[1])
|
||||
}
|
||||
|
||||
// SelectLine selects the current line
|
||||
|
||||
Reference in New Issue
Block a user