aboutsummaryrefslogtreecommitdiffstats
path: root/vendor
diff options
context:
space:
mode:
Diffstat (limited to 'vendor')
-rw-r--r--vendor/github.com/MichaelMure/gocui/.gitignore (renamed from vendor/github.com/jroimartin/gocui/.gitignore)0
-rw-r--r--vendor/github.com/MichaelMure/gocui/AUTHORS (renamed from vendor/github.com/jroimartin/gocui/AUTHORS)0
-rw-r--r--vendor/github.com/MichaelMure/gocui/LICENSE (renamed from vendor/github.com/jroimartin/gocui/LICENSE)0
-rw-r--r--vendor/github.com/MichaelMure/gocui/README.md (renamed from vendor/github.com/jroimartin/gocui/README.md)0
-rw-r--r--vendor/github.com/MichaelMure/gocui/attribute.go (renamed from vendor/github.com/jroimartin/gocui/attribute.go)0
-rw-r--r--vendor/github.com/MichaelMure/gocui/doc.go (renamed from vendor/github.com/jroimartin/gocui/doc.go)0
-rw-r--r--vendor/github.com/MichaelMure/gocui/edit.go (renamed from vendor/github.com/jroimartin/gocui/edit.go)27
-rw-r--r--vendor/github.com/MichaelMure/gocui/escape.go (renamed from vendor/github.com/jroimartin/gocui/escape.go)0
-rw-r--r--vendor/github.com/MichaelMure/gocui/gui.go (renamed from vendor/github.com/jroimartin/gocui/gui.go)0
-rw-r--r--vendor/github.com/MichaelMure/gocui/keybinding.go (renamed from vendor/github.com/jroimartin/gocui/keybinding.go)0
-rw-r--r--vendor/github.com/MichaelMure/gocui/view.go (renamed from vendor/github.com/jroimartin/gocui/view.go)3
11 files changed, 18 insertions, 12 deletions
diff --git a/vendor/github.com/jroimartin/gocui/.gitignore b/vendor/github.com/MichaelMure/gocui/.gitignore
index 1377554e..1377554e 100644
--- a/vendor/github.com/jroimartin/gocui/.gitignore
+++ b/vendor/github.com/MichaelMure/gocui/.gitignore
diff --git a/vendor/github.com/jroimartin/gocui/AUTHORS b/vendor/github.com/MichaelMure/gocui/AUTHORS
index 43ec4cec..43ec4cec 100644
--- a/vendor/github.com/jroimartin/gocui/AUTHORS
+++ b/vendor/github.com/MichaelMure/gocui/AUTHORS
diff --git a/vendor/github.com/jroimartin/gocui/LICENSE b/vendor/github.com/MichaelMure/gocui/LICENSE
index 8cb28215..8cb28215 100644
--- a/vendor/github.com/jroimartin/gocui/LICENSE
+++ b/vendor/github.com/MichaelMure/gocui/LICENSE
diff --git a/vendor/github.com/jroimartin/gocui/README.md b/vendor/github.com/MichaelMure/gocui/README.md
index d7b55a3b..d7b55a3b 100644
--- a/vendor/github.com/jroimartin/gocui/README.md
+++ b/vendor/github.com/MichaelMure/gocui/README.md
diff --git a/vendor/github.com/jroimartin/gocui/attribute.go b/vendor/github.com/MichaelMure/gocui/attribute.go
index bad758a1..bad758a1 100644
--- a/vendor/github.com/jroimartin/gocui/attribute.go
+++ b/vendor/github.com/MichaelMure/gocui/attribute.go
diff --git a/vendor/github.com/jroimartin/gocui/doc.go b/vendor/github.com/MichaelMure/gocui/doc.go
index fe128afb..fe128afb 100644
--- a/vendor/github.com/jroimartin/gocui/doc.go
+++ b/vendor/github.com/MichaelMure/gocui/doc.go
diff --git a/vendor/github.com/jroimartin/gocui/edit.go b/vendor/github.com/MichaelMure/gocui/edit.go
index e1b19c20..de86580f 100644
--- a/vendor/github.com/jroimartin/gocui/edit.go
+++ b/vendor/github.com/MichaelMure/gocui/edit.go
@@ -4,7 +4,11 @@
package gocui
-import "errors"
+import (
+ "errors"
+
+ "github.com/mattn/go-runewidth"
+)
const maxInt = int(^uint(0) >> 1)
@@ -55,7 +59,7 @@ func simpleEditor(v *View, key Key, ch rune, mod Modifier) {
// EditWrite writes a rune at the cursor position.
func (v *View) EditWrite(ch rune) {
v.writeRune(v.cx, v.cy, ch)
- v.MoveCursor(1, 0, true)
+ v.MoveCursor(runewidth.RuneWidth(ch), 0, true)
}
// EditDelete deletes a rune at the cursor position. back determines the
@@ -89,12 +93,12 @@ func (v *View) EditDelete(back bool) {
v.MoveCursor(-1, 0, true)
}
} else { // wrapped line
- v.deleteRune(len(v.viewLines[y-1].line)-1, v.cy-1)
- v.MoveCursor(-1, 0, true)
+ ch, _ := v.deleteRune(len(v.viewLines[y-1].line)-1, v.cy-1)
+ v.MoveCursor(0-runewidth.RuneWidth(ch), 0, true)
}
} else { // middle/end of the line
- v.deleteRune(v.cx-1, v.cy)
- v.MoveCursor(-1, 0, true)
+ ch, _ := v.deleteRune(v.cx-1, v.cy)
+ v.MoveCursor(0-runewidth.RuneWidth(ch), 0, true)
}
} else {
if x == len(v.viewLines[y].line) { // end of the line
@@ -275,19 +279,20 @@ func (v *View) writeRune(x, y int, ch rune) error {
// deleteRune removes a rune from the view's internal buffer, at the
// position corresponding to the point (x, y).
-func (v *View) deleteRune(x, y int) error {
+func (v *View) deleteRune(x, y int) (ch rune, err error) {
v.tainted = true
- x, y, err := v.realPosition(x, y)
+ x, y, err = v.realPosition(x, y)
if err != nil {
- return err
+ return 0, err
}
if x < 0 || y < 0 || y >= len(v.lines) || x >= len(v.lines[y]) {
- return errors.New("invalid point")
+ return 0, errors.New("invalid point")
}
+ chx := v.lines[y][x]
v.lines[y] = append(v.lines[y][:x], v.lines[y][x+1:]...)
- return nil
+ return chx.chr, nil
}
// mergeLines merges the lines "y" and "y+1" if possible.
diff --git a/vendor/github.com/jroimartin/gocui/escape.go b/vendor/github.com/MichaelMure/gocui/escape.go
index ec31bbe0..ec31bbe0 100644
--- a/vendor/github.com/jroimartin/gocui/escape.go
+++ b/vendor/github.com/MichaelMure/gocui/escape.go
diff --git a/vendor/github.com/jroimartin/gocui/gui.go b/vendor/github.com/MichaelMure/gocui/gui.go
index 9499d3c3..9499d3c3 100644
--- a/vendor/github.com/jroimartin/gocui/gui.go
+++ b/vendor/github.com/MichaelMure/gocui/gui.go
diff --git a/vendor/github.com/jroimartin/gocui/keybinding.go b/vendor/github.com/MichaelMure/gocui/keybinding.go
index 03fe677c..03fe677c 100644
--- a/vendor/github.com/jroimartin/gocui/keybinding.go
+++ b/vendor/github.com/MichaelMure/gocui/keybinding.go
diff --git a/vendor/github.com/jroimartin/gocui/view.go b/vendor/github.com/MichaelMure/gocui/view.go
index 42082f8c..d7943497 100644
--- a/vendor/github.com/jroimartin/gocui/view.go
+++ b/vendor/github.com/MichaelMure/gocui/view.go
@@ -10,6 +10,7 @@ import (
"io"
"strings"
+ "github.com/mattn/go-runewidth"
"github.com/nsf/termbox-go"
)
@@ -353,7 +354,7 @@ func (v *View) draw() error {
if err := v.setRune(x, y, c.chr, fgColor, bgColor); err != nil {
return err
}
- x++
+ x += runewidth.RuneWidth(c.chr)
}
y++
}