diff options
author | Ryooooooga <eial5q265e5@gmail.com> | 2022-11-14 22:23:14 +0900 |
---|---|---|
committer | Ryooooooga <eial5q265e5@gmail.com> | 2022-11-25 21:48:44 +0900 |
commit | cf048e480754e77de1a303f594868d82261bb419 (patch) | |
tree | 49204c2c95c635c596577fc6870d92d15fb3a0ae /vendor | |
parent | a6ebc5869e4f7ab5a88a9574b788dfbc47c421ef (diff) |
bump gocui
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/github.com/jesseduffield/gocui/escape.go | 21 | ||||
-rw-r--r-- | vendor/github.com/jesseduffield/gocui/view.go | 38 | ||||
-rw-r--r-- | vendor/golang.org/x/sys/unix/sockcmsg_unix.go | 14 | ||||
-rw-r--r-- | vendor/golang.org/x/sys/unix/syscall_linux.go | 1 | ||||
-rw-r--r-- | vendor/golang.org/x/term/terminal.go | 1 | ||||
-rw-r--r-- | vendor/modules.txt | 8 |
6 files changed, 62 insertions, 21 deletions
diff --git a/vendor/github.com/jesseduffield/gocui/escape.go b/vendor/github.com/jesseduffield/gocui/escape.go index 87d6de72a..1bd670a94 100644 --- a/vendor/github.com/jesseduffield/gocui/escape.go +++ b/vendor/github.com/jesseduffield/gocui/escape.go @@ -39,6 +39,8 @@ const ( stateEscape stateCSI stateParams + stateOSC + stateOSCEscape bold fontEffect = 1 faint fontEffect = 2 @@ -124,11 +126,16 @@ func (ei *escapeInterpreter) parseOne(ch rune) (isEscape bool, err error) { } return false, nil case stateEscape: - if ch == '[' { + switch ch { + case '[': ei.state = stateCSI return true, nil + case ']': + ei.state = stateOSC + return true, nil + default: + return false, errNotCSI } - return false, errNotCSI case stateCSI: switch { case ch >= '0' && ch <= '9': @@ -189,6 +196,16 @@ func (ei *escapeInterpreter) parseOne(ch rune) (isEscape bool, err error) { default: return false, errCSIParseError } + case stateOSC: + switch ch { + case 0x1b: + ei.state = stateOSCEscape + return true, nil + } + return true, nil + case stateOSCEscape: + ei.state = stateNone + return true, nil } return false, nil } diff --git a/vendor/github.com/jesseduffield/gocui/view.go b/vendor/github.com/jesseduffield/gocui/view.go index ea6923781..aa9dbd214 100644 --- a/vendor/github.com/jesseduffield/gocui/view.go +++ b/vendor/github.com/jesseduffield/gocui/view.go @@ -950,33 +950,44 @@ func (v *View) draw() error { start = len(v.viewLines) - 1 } - y := 0 emptyCell := cell{chr: ' ', fgColor: ColorDefault, bgColor: ColorDefault} var prevFgColor Attribute - for _, vline := range v.viewLines[start:] { + + for y, vline := range v.viewLines[start:] { if y >= maxY { break } + + // x tracks the current x position in the view, and cellIdx tracks the + // index of the cell. If we print a double-sized rune, we increment cellIdx + // by one but x by two. x := -v.ox - j := 0 + cellIdx := 0 + var c cell for { - if x < 0 { - if j < len(vline.line) { - x += runewidth.RuneWidth(vline.line[j].chr) - } - j++ - continue - } if x >= maxX { break } - if j > len(vline.line)-1 { + if x < 0 { + if cellIdx < len(vline.line) { + x += runewidth.RuneWidth(vline.line[cellIdx].chr) + cellIdx++ + continue + } else { + // no more characters to write so we're only going to be printing empty cells + // past this point + x = 0 + } + } + + // if we're out of cells to write, we'll just print empty cells. + if cellIdx > len(vline.line)-1 { c = emptyCell c.fgColor = prevFgColor } else { - c = vline.line[j] + c = vline.line[cellIdx] // capturing previous foreground colour so that if we're using the reverse // attribute we honour the final character's colour and don't awkwardly switch // to a new background colour for the remainder of the line @@ -1006,9 +1017,8 @@ func (v *View) draw() error { // Not sure why the previous code was here but it caused problems // when typing wide characters in an editor x += runewidth.RuneWidth(c.chr) - j++ + cellIdx++ } - y++ } return nil } diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_unix.go b/vendor/golang.org/x/sys/unix/sockcmsg_unix.go index 453a942c5..3865943f6 100644 --- a/vendor/golang.org/x/sys/unix/sockcmsg_unix.go +++ b/vendor/golang.org/x/sys/unix/sockcmsg_unix.go @@ -52,6 +52,20 @@ func ParseSocketControlMessage(b []byte) ([]SocketControlMessage, error) { return msgs, nil } +// ParseOneSocketControlMessage parses a single socket control message from b, returning the message header, +// message data (a slice of b), and the remainder of b after that single message. +// When there are no remaining messages, len(remainder) == 0. +func ParseOneSocketControlMessage(b []byte) (hdr Cmsghdr, data []byte, remainder []byte, err error) { + h, dbuf, err := socketControlMessageHeaderAndData(b) + if err != nil { + return Cmsghdr{}, nil, nil, err + } + if i := cmsgAlignOf(int(h.Len)); i < len(b) { + remainder = b[i:] + } + return *h, dbuf, remainder, nil +} + func socketControlMessageHeaderAndData(b []byte) (*Cmsghdr, []byte, error) { h := (*Cmsghdr)(unsafe.Pointer(&b[0])) if h.Len < SizeofCmsghdr || uint64(h.Len) > uint64(len(b)) { diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index e044d5b54..c5a98440e 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -1554,6 +1554,7 @@ func sendmsgN(fd int, iov []Iovec, oob []byte, ptr unsafe.Pointer, salen _Sockle var iova [1]Iovec iova[0].Base = &dummy iova[0].SetLen(1) + iov = iova[:] } } msg.Control = &oob[0] diff --git a/vendor/golang.org/x/term/terminal.go b/vendor/golang.org/x/term/terminal.go index 4b48a5899..f636667fb 100644 --- a/vendor/golang.org/x/term/terminal.go +++ b/vendor/golang.org/x/term/terminal.go @@ -233,7 +233,6 @@ func (t *Terminal) queue(data []rune) { t.outBuf = append(t.outBuf, []byte(string(data))...) } -var eraseUnderCursor = []rune{' ', keyEscape, '[', 'D'} var space = []rune{' '} func isPrintable(key rune) bool { diff --git a/vendor/modules.txt b/vendor/modules.txt index 94ee1ccc4..89161b6a6 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -172,7 +172,7 @@ github.com/jesseduffield/go-git/v5/utils/merkletrie/filesystem github.com/jesseduffield/go-git/v5/utils/merkletrie/index github.com/jesseduffield/go-git/v5/utils/merkletrie/internal/frame github.com/jesseduffield/go-git/v5/utils/merkletrie/noder -# github.com/jesseduffield/gocui v0.3.1-0.20221016041636-16c24668f71c +# github.com/jesseduffield/gocui v0.3.1-0.20221112081529-154bebde5bb5 ## explicit; go 1.12 github.com/jesseduffield/gocui # github.com/jesseduffield/kill v0.0.0-20220618033138-bfbe04675d10 @@ -295,17 +295,17 @@ golang.org/x/exp/slices golang.org/x/net/context golang.org/x/net/internal/socks golang.org/x/net/proxy -# golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 +# golang.org/x/sys v0.2.0 ## explicit; go 1.17 golang.org/x/sys/cpu golang.org/x/sys/internal/unsafeheader golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows -# golang.org/x/term v0.0.0-20220919170432-7a66f970e087 +# golang.org/x/term v0.2.0 ## explicit; go 1.17 golang.org/x/term -# golang.org/x/text v0.3.8 +# golang.org/x/text v0.4.0 ## explicit; go 1.17 golang.org/x/text/encoding golang.org/x/text/encoding/internal/identifier |