mirror of
https://github.com/zyedidia/micro.git
synced 2026-02-07 07:30:20 +09:00
Remove unecessary function
This commit is contained in:
@@ -3,7 +3,6 @@ package main
|
||||
import (
|
||||
"github.com/vinzmay/go-rope"
|
||||
"io/ioutil"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -112,21 +111,6 @@ func (b *Buffer) Remove(start, end int) string {
|
||||
return removed
|
||||
}
|
||||
|
||||
func (b *Buffer) Replace(search, replace string) error {
|
||||
re, err := regexp.Compile(search)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
text := re.ReplaceAllString(b.text, replace)
|
||||
if text == "" {
|
||||
b.r = new(rope.Rope)
|
||||
} else {
|
||||
b.r = rope.New(text)
|
||||
}
|
||||
b.Update()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Len gives the length of the buffer
|
||||
func (b *Buffer) Len() int {
|
||||
return b.r.Len()
|
||||
|
||||
Reference in New Issue
Block a user