summaryrefslogtreecommitdiffstats
path: root/vendor
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-06-01 20:11:06 +1000
committerJesse Duffield <jessedduffield@gmail.com>2023-06-01 22:20:30 +1000
commit4ff02bd3b7d59cb9d8542d757d3f744c4e7c1264 (patch)
tree2529ff20f5e9471c0c97412b73228d963c41175f /vendor
parent5df27c61ed27afeffda50e527c8845ccb7570aca (diff)
Add integration test for commit highlighting on focus
A better refactor would be to allow matchers to assert against either a string or a slice of cells, so that I could have the same ergonomics that I have elsewhere, but this is a start.
Diffstat (limited to 'vendor')
-rw-r--r--vendor/github.com/jesseduffield/gocui/view.go36
-rw-r--r--vendor/golang.org/x/sys/unix/ioctl_signed.go70
-rw-r--r--vendor/golang.org/x/sys/unix/ioctl_unsigned.go (renamed from vendor/golang.org/x/sys/unix/ioctl.go)4
-rw-r--r--vendor/golang.org/x/sys/unix/ioctl_zos.go12
-rw-r--r--vendor/golang.org/x/sys/unix/mkerrors.sh5
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_aix.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_aix_ppc.go1
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go1
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_darwin.go3
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_dragonfly.go1
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_freebsd.go1
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux.go10
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_386.go27
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_amd64.go1
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_arm.go27
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_arm64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_loong64.go5
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go1
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go27
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_ppc.go27
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go1
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go1
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_s390x.go1
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go1
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_netbsd.go2
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_openbsd.go1
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_solaris.go21
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_unix.go7
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_zos_s390x.go4
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go19
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go19
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux.go14
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go15
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go18
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go39
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s11
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go39
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s11
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_386.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go14
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s5
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go14
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s5
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go14
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s5
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go14
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s5
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go14
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s5
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go14
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s6
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go14
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s5
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go17
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go4
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go11
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go11
-rw-r--r--vendor/golang.org/x/sys/windows/env_windows.go6
-rw-r--r--vendor/golang.org/x/sys/windows/exec_windows.go7
-rw-r--r--vendor/golang.org/x/sys/windows/service.go7
-rw-r--r--vendor/golang.org/x/sys/windows/types_windows.go10
-rw-r--r--vendor/golang.org/x/sys/windows/zsyscall_windows.go9
-rw-r--r--vendor/modules.txt8
89 files changed, 330 insertions, 661 deletions
diff --git a/vendor/github.com/jesseduffield/gocui/view.go b/vendor/github.com/jesseduffield/gocui/view.go
index f614da556..6bc1c195c 100644
--- a/vendor/github.com/jesseduffield/gocui/view.go
+++ b/vendor/github.com/jesseduffield/gocui/view.go
@@ -13,6 +13,7 @@ import (
"unicode"
"unicode/utf8"
+ "github.com/gdamore/tcell/v2"
"github.com/go-errors/errors"
"github.com/mattn/go-runewidth"
)
@@ -1461,3 +1462,38 @@ func (v *View) scrollMargin() int {
return 0
}
}
+
+// Returns true if the view contains a line containing the given text with the given
+// foreground color
+func (v *View) ContainsColoredText(fgColor string, text string) bool {
+ for _, line := range v.lines {
+ if containsColoredTextInLine(fgColor, text, line) {
+ return true
+ }
+ }
+
+ return false
+}
+
+func containsColoredTextInLine(fgColorStr string, text string, line []cell) bool {
+ fgColor := tcell.GetColor(fgColorStr)
+
+ currentMatch := ""
+ for i := 0; i < len(line); i++ {
+ cell := line[i]
+
+ // stripping attributes by converting to and from hex
+ cellColor := tcell.NewHexColor(cell.fgColor.Hex())
+
+ if cellColor == fgColor {
+ currentMatch += string(cell.chr)
+ } else if currentMatch != "" {
+ if strings.Contains(currentMatch, text) {
+ return true
+ }
+ currentMatch = ""
+ }
+ }
+
+ return strings.Contains(currentMatch, text)
+}
diff --git a/vendor/golang.org/x/sys/unix/ioctl_signed.go b/vendor/golang.org/x/sys/unix/ioctl_signed.go
new file mode 100644
index 000000000..7def9580e
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/ioctl_signed.go
@@ -0,0 +1,70 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build aix || solaris
+// +build aix solaris
+
+package unix
+
+import (
+ "unsafe"
+)
+
+// ioctl itself should not be exposed directly, but additional get/set
+// functions for specific types are permissible.
+
+// IoctlSetInt performs an ioctl operation which sets an integer value
+// on fd, using the specified request number.
+func IoctlSetInt(fd int, req int, value int) error {
+ return ioctl(fd, req, uintptr(value))
+}
+
+// IoctlSetPointerInt performs an ioctl operation which sets an
+// integer value on fd, using the specified request number. The ioctl
+// argument is called with a pointer to the integer value, rather than
+// passing the integer value directly.
+func IoctlSetPointerInt(fd int, req int, value int) error {
+ v := int32(value)
+ return ioctlPtr(fd, req, unsafe.Pointer(&v))
+}
+
+// IoctlSetWinsize performs an ioctl on fd with a *Winsize argument.
+//
+// To change fd's window size, the req argument should be TIOCSWINSZ.
+func IoctlSetWinsize(fd int, req int, value *Winsize) error {
+ // TODO: if we get the chance, remove the req parameter and
+ // hardcode TIOCSWINSZ.
+ return ioctlPtr(fd, req, unsafe.Pointer(value))
+}
+
+// IoctlSetTermios performs an ioctl on fd with a *Termios.
+//
+// The req value will usually be TCSETA or TIOCSETA.
+func IoctlSetTermios(fd int, req int, value *Termios) error {
+ // TODO: if we get the chance, remove the req parameter.
+ return ioctlPtr(fd, req, unsafe.Pointer(value))
+}
+
+// IoctlGetInt performs an ioctl operation which gets an integer value
+// from fd, using the specified request number.
+//
+// A few ioctl requests use the return value as an output parameter;
+// for those, IoctlRetInt should be used instead of this function.
+func IoctlGetInt(fd int, req int) (int, error) {
+ var value int
+ err := ioctlPtr(fd, req, unsafe.Pointer(&value))
+ return value, err
+}
+
+func IoctlGetWinsize(fd int, req int) (*Winsize, error) {
+ var value Winsize
+ err := ioctlPtr(fd, req, unsafe.Pointer(&value))
+ return &value, err
+}
+
+func IoctlGetTermios(fd int, req int) (*Termios, error) {
+ var value Termios
+ err := ioctlPtr(fd, req, unsafe.Pointer(&value))
+ return &value, err
+}
diff --git a/vendor/golang.org/x/sys/unix/ioctl.go b/vendor/golang.org/x/sys/unix/ioctl_unsigned.go
index 7ce8dd406..649913d1e 100644
--- a/vendor/golang.org/x/sys/unix/ioctl.go
+++ b/vendor/golang.org/x/sys/unix/ioctl_unsigned.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build aix || darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd || solaris
-// +build aix darwin dragonfly freebsd hurd linux netbsd openbsd solaris
+//go:build darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd
+// +build darwin dragonfly freebsd hurd linux netbsd openbsd
package unix
diff --git a/vendor/golang.org/x/sys/unix/ioctl_zos.go b/vendor/golang.org/x/sys/unix/ioctl_zos.go
index 6532f09af..cdc21bf76 100644
--- a/vendor/golang.org/x/sys/unix/ioctl_zos.go
+++ b/vendor/golang.org/x/sys/unix/ioctl_zos.go
@@ -17,14 +17,14 @@ import (
// IoctlSetInt performs an ioctl operation which sets an integer value
// on fd, using the specified request number.
-func IoctlSetInt(fd int, req uint, value int) error {
+func IoctlSetInt(fd int, req int, value int) error {
return ioctl(fd, req, uintptr(value))
}
// IoctlSetWinsize performs an ioctl on fd with a *Winsize argument.
//
// To change fd's window size, the req argument should be TIOCSWINSZ.
-func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
+func IoctlSetWinsize(fd int, req int, value *Winsize) error {
// TODO: if we get the chance, remove the req parameter and
// hardcode TIOCSWINSZ.
return ioctlPtr(fd, req, unsafe.Pointer(value))
@@ -33,7 +33,7 @@ func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
// IoctlSetTermios performs an ioctl on fd with a *Termios.
//
// The req value is expected to be TCSETS, TCSETSW, or TCSETSF
-func IoctlSetTermios(fd int, req uint, value *Termios) error {
+func IoctlSetTermios(fd int, req int, value *Termios) error {
if (req != TCSETS) && (req != TCSETSW) && (req != TCSETSF) {
return ENOSYS
}
@@ -47,13 +47,13 @@ func IoctlSetTermios(fd int, req uint, value *Termios) error {
//
// A few ioctl requests use the return value as an output parameter;
// for those, IoctlRetInt should be used instead of this function.
-func IoctlGetInt(fd int, req uint) (int, error) {
+func IoctlGetInt(fd int, req int) (int, error) {
var value int
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
return value, err
}
-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
+func IoctlGetWinsize(fd int, req int) (*Winsize, error) {
var value Winsize
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
return &value, err
@@ -62,7 +62,7 @@ func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
// IoctlGetTermios performs an ioctl on fd with a *Termios.
//
// The req value is expected to be TCGETS
-func IoctlGetTermios(fd int, req uint) (*Termios, error) {
+func IoctlGetTermios(fd int, req int) (*Termios, error) {
var value Termios
if req != TCGETS {
return &value, ENOSYS
diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh
index 7456d9ddd..be0423e68 100644
--- a/vendor/golang.org/x/sys/unix/mkerrors.sh
+++ b/vendor/golang.org/x/sys/unix/mkerrors.sh
@@ -66,6 +66,7 @@ includes_Darwin='
#include <sys/ptrace.h>
#include <sys/select.h>
#include <sys/socket.h>
+#include <sys/stat.h>
#include <sys/un.h>
#include <sys/sockio.h>
#include <sys/sys_domain.h>
@@ -203,6 +204,7 @@ struct ltchars {
#include <sys/timerfd.h>
#include <sys/uio.h>
#include <sys/xattr.h>
+#include <netinet/udp.h>
#include <linux/audit.h>
#include <linux/bpf.h>
#include <linux/can.h>
@@ -517,10 +519,11 @@ ccflags="$@"
$2 ~ /^LOCK_(SH|EX|NB|UN)$/ ||
$2 ~ /^LO_(KEY|NAME)_SIZE$/ ||
$2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ ||
- $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT)_/ ||
+ $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT|UDP)_/ ||
$2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ ||