mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-09 01:00:58 +00:00
Remove unecessary function
This commit is contained in:
parent
d45e19d444
commit
cc80722c18
1 changed files with 0 additions and 16 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue