summaryrefslogtreecommitdiffstats
path: root/vendor
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-09-09 21:11:05 -0700
committerJesse Duffield <jessedduffield@gmail.com>2022-09-16 08:42:39 -0700
commit7af7af27c6252b862989d11f930787e5b370b119 (patch)
treea12b68c82de17aafb3b3479e81aae363a4cdec4e /vendor
parent7b757d1cfe88363aa52a660d53838478243eca00 (diff)
various changes to improve integration tests
Diffstat (limited to 'vendor')
-rw-r--r--vendor/github.com/gdamore/tcell/v2/README.md9
-rw-r--r--vendor/github.com/jesseduffield/gocui/gui.go19
-rw-r--r--vendor/github.com/jesseduffield/gocui/tcell_driver.go4
-rw-r--r--vendor/github.com/jesseduffield/gocui/view.go3
-rw-r--r--vendor/github.com/rivo/uniseg/README.md16
-rw-r--r--vendor/github.com/rivo/uniseg/doc.go77
-rw-r--r--vendor/github.com/rivo/uniseg/eastasianwidth.go5
-rw-r--r--vendor/github.com/rivo/uniseg/emojipresentation.go285
-rw-r--r--vendor/github.com/rivo/uniseg/gen_properties.go120
-rw-r--r--vendor/github.com/rivo/uniseg/grapheme.go136
-rw-r--r--vendor/github.com/rivo/uniseg/graphemeproperties.go2
-rw-r--r--vendor/github.com/rivo/uniseg/graphemerules.go37
-rw-r--r--vendor/github.com/rivo/uniseg/line.go8
-rw-r--r--vendor/github.com/rivo/uniseg/lineproperties.go5
-rw-r--r--vendor/github.com/rivo/uniseg/properties.go13
-rw-r--r--vendor/github.com/rivo/uniseg/sentenceproperties.go5
-rw-r--r--vendor/github.com/rivo/uniseg/step.go112
-rw-r--r--vendor/github.com/rivo/uniseg/width.go54
-rw-r--r--vendor/github.com/rivo/uniseg/wordproperties.go4
-rw-r--r--vendor/golang.org/x/sys/cpu/cpu_arm64.go5
-rw-r--r--vendor/golang.org/x/sys/plan9/syscall.go10
-rw-r--r--vendor/golang.org/x/sys/unix/ioctl_linux.go20
-rw-r--r--vendor/golang.org/x/sys/unix/mkall.sh9
-rw-r--r--vendor/golang.org/x/sys/unix/str.go27
-rw-r--r--vendor/golang.org/x/sys/unix/syscall.go10
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go32
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go108
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_darwin.go90
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_freebsd_386.go2
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go2
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go2
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go2
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go2
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux.go30
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_386.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_amd64.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_arm.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_arm64.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_loong64.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_ppc.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_s390x.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_solaris.go113
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_unix.go8
-rw-r--r--vendor/golang.org/x/sys/unix/sysvshm_unix.go13
-rw-r--r--vendor/golang.org/x/sys/unix/xattr_bsd.go95
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go40
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s25
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go32
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s21
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go40
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s25
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go32
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s21
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_386.go40
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go40
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go40
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go40
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go40
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go40
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go40
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go40
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go40
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go40
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go40
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go40
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go40
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go40
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go40
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go798
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s796
-rw-r--r--vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go1
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go17
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go18
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go18
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go18
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go18
-rw-r--r--vendor/golang.org/x/sys/windows/setupapi_windows.go2
-rw-r--r--vendor/golang.org/x/sys/windows/syscall.go10
-rw-r--r--vendor/golang.org/x/sys/windows/syscall_windows.go17
-rw-r--r--vendor/golang.org/x/sys/windows/types_windows.go19
-rw-r--r--vendor/golang.org/x/sys/windows/zsyscall_windows.go69
-rw-r--r--vendor/modules.txt8
88 files changed, 2747 insertions, 1444 deletions
diff --git a/vendor/github.com/gdamore/tcell/v2/README.md b/vendor/github.com/gdamore/tcell/v2/README.md
index e5efb98d2..78c76b6ad 100644
--- a/vendor/github.com/gdamore/tcell/v2/README.md
+++ b/vendor/github.com/gdamore/tcell/v2/README.md
@@ -1,16 +1,11 @@
-<a href="https://stand-with-ukraine.pp.ua">
-<img src="https://upload.wikimedia.org/wikipedia/commons/d/d2/Flag_of_Ukraine.png" height="20px" width="100%"/>
-</a>
-
<img src="logos/tcell.png" style="float: right"/>
-Please see [here](UKRAINE.md) for an important message for the people of Russia.
-
# Tcell
_Tcell_ is a _Go_ package that provides a cell based view for text terminals, like _XTerm_.
It was inspired by _termbox_, but includes many additional improvements.
+[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua)
[![Linux](https://img.shields.io/github/workflow/status/gdamore/tcell/linux?logoColor=grey&logo=linux&label=)](https://github.com/gdamore/tcell/actions/workflows/linux.yml)
[![Windows](https://img.shields.io/github/workflow/status/gdamore/tcell/windows?logoColor=grey&logo=windows&label=)](https://github.com/gdamore/tcell/actions/workflows/windows.yml)
[![Apache License](https://img.shields.io/github/license/gdamore/tcell.svg?logoColor=silver&logo=opensourceinitiative&color=blue&label=)](https://github.com/gdamore/tcell/blob/master/LICENSE)
@@ -18,6 +13,8 @@ It was inspired by _termbox_, but includes many additional improvements.
[![Discord](https://img.shields.io/discord/639503822733180969?label=&logo=discord)](https://discord.gg/urTTxDN)
[![Coverage](https://img.shields.io/codecov/c/github/gdamore/tcell?logoColor=grey&logo=codecov&label=)](https://codecov.io/gh/gdamore/tcell)
+Please see [here](UKRAINE.md) for an important message for the people of Russia.
+
NOTE: This is version 2 of _Tcell_. There are breaking changes relative to version 1.
Version 1.x remains available using the import `github.com/gdamore/tcell`.
diff --git a/vendor/github.com/jesseduffield/gocui/gui.go b/vendor/github.com/jesseduffield/gocui/gui.go
index 0c76bfee7..f02f1a93a 100644
--- a/vendor/github.com/jesseduffield/gocui/gui.go
+++ b/vendor/github.com/jesseduffield/gocui/gui.go
@@ -206,6 +206,16 @@ func NewGui(mode OutputMode, supportOverlaps bool, playMode PlayMode, headless b
return nil, err
}
+ if headless || runtime.GOOS == "windows" {
+ g.maxX, g.maxY = g.screen.Size()
+ } else {
+ // TODO: find out if we actually need this bespoke logic for linux
+ g.maxX, g.maxY, err = g.getTermWindowSize()
+ if err != nil {
+ return nil, err
+ }
+ }
+
g.outputMode = mode
g.stop = make(chan struct{})
@@ -225,15 +235,6 @@ func NewGui(mode OutputMode, supportOverlaps bool, playMode PlayMode, headless b
}
}
- if runtime.GOOS != "windows" {
- g.maxX, g.maxY, err = g.getTermWindowSize()
- if err != nil {
- return nil, err
- }
- } else {
- g.maxX, g.maxY = Screen.Size()
- }
-
g.BgColor, g.FgColor, g.FrameColor = ColorDefault, ColorDefault, ColorDefault
g.SelBgColor, g.SelFgColor, g.SelFrameColor = ColorDefault, ColorDefault, ColorDefault
diff --git a/vendor/github.com/jesseduffield/gocui/tcell_driver.go b/vendor/github.com/jesseduffield/gocui/tcell_driver.go
index 81d30fe91..ebb291f7c 100644
--- a/vendor/github.com/jesseduffield/gocui/tcell_driver.go
+++ b/vendor/github.com/jesseduffield/gocui/tcell_driver.go
@@ -84,6 +84,10 @@ func (g *Gui) tcellInitSimulation() error {
} else {
g.screen = s
Screen = s
+ // setting to a larger value than the typical terminal size
+ // so that during a test we're more likely to see an item to select in a view.
+ s.SetSize(100, 100)
+ s.Sync()
return nil
}
}
diff --git a/vendor/github.com/jesseduffield/gocui/view.go b/vendor/github.com/jesseduffield/gocui/view.go
index 95c7ef4b1..ce0aa3c48 100644
--- a/vendor/github.com/jesseduffield/gocui/view.go
+++ b/vendor/github.com/jesseduffield/gocui/view.go
@@ -1245,6 +1245,9 @@ func (v *View) SelectedLineIdx() int {
// expected to only be used in tests
func (v *View) SelectedLine() string {
+ if len(v.lines) == 0 {
+ return ""
+ }
line := v.lines[v.SelectedLineIdx()]
str := lineType(line).String()
return strings.Replace(str, "\x00", " ", -1)
diff --git a/vendor/github.com/rivo/uniseg/README.md b/vendor/github.com/rivo/uniseg/README.md
index 89fc21a3d..7e3d12e79 100644
--- a/vendor/github.com/rivo/uniseg/README.md
+++ b/vendor/github.com/rivo/uniseg/README.md
@@ -3,13 +3,13 @@
[![Go Reference](https://pkg.go.dev/badge/github.com/rivo/uniseg.svg)](https://pkg.go.dev/github.com/rivo/uniseg)
[![Go Report](https://img.shields.io/badge/go%20report-A%2B-brightgreen.svg)](https://goreportcard.com/report/github.com/rivo/uniseg)
-This Go package implements Unicode Text Segmentation according to [Unicode Standard Annex #29](https://unicode.org/reports/tr29/) and Unicode Line Breaking according to [Unicode Standard Annex #14](https://unicode.org/reports/tr14/) (Unicode version 14.0.0).
+This Go package implements Unicode Text Segmentation according to [Unicode Standard Annex #29](https://unicode.org/reports/tr29/), Unicode Line Breaking according to [Unicode Standard Annex #14](https://unicode.org/reports/tr14/) (Unicode version 14.0.0), and monospace font string width calculation similar to [wcwidth](https://man7.org/linux/man-pages/man3/wcwidth.3.html).
## Background
### Grapheme Clusters
-In Go, [strings are read-only slices of bytes](https://blog.golang.org/strings). They can be turned into Unicode code points using the `for` loop or by casting: `[]rune(str)`. However, multiple code points may be combined into one user-perceived character or what the Unicode specification calls "grapheme cluster". Here are some examples:
+In Go, [strings are read-only slices of bytes](https://go.dev/blog/strings). They can be turned into Unicode code points using the `for` loop or by casting: `[]rune(str)`. However, multiple code points may be combined into one user-perceived character or what the Unicode specification calls "grapheme cluster". Here are some examples:
|String|Bytes (UTF-8)|Code points (runes)|Grapheme clusters|
|-|-|-|-|
@@ -31,6 +31,10 @@ Sentence boundaries are often used for triple-click or some other method of sele
Line breaking, also known as word wrapping, is the process of breaking a section of text into lines such that it will fit in the available width of a page, window or other display area. This package provides tools to determine where a string may or may not be broken and where it must be broken (for example after newline characters).
+### Monospace Width
+
+Most terminals or text displays / text editors using a monospace font (for example source code editors) use a fixed width for each character. Some characters such as emojis or characters found in Asian and other languages may take up more than one character cell. This package provides tools to determine the number of cells a string will take up when displayed in a monospace font. See [here](https://pkg.go.dev/github.com/rivo/uniseg#hdr-Monospace_Width) for more information.
+
## Installation
```bash
@@ -47,6 +51,14 @@ fmt.Println(n)
// 2
```
+### Calculating the Monospace String Width
+
+```go
+width := uniseg.StringWidth("🇩🇪🏳️‍🌈!")
+fmt.Println(width)
+// 5
+```
+
### Using the [`Graphemes`](https://pkg.go.dev/github.com/rivo/uniseg#Graphemes) Class
This is the most convenient method of iterating over grapheme clusters:
diff --git a/vendor/github.com/rivo/uniseg/doc.go b/vendor/github.com/rivo/uniseg/doc.go
index 6c498ede1..0fc2d8b43 100644
--- a/vendor/github.com/rivo/uniseg/doc.go
+++ b/vendor/github.com/rivo/uniseg/doc.go
@@ -1,8 +1,9 @@
/*
-Package uniseg implements Unicode Text Segmentation and Unicode Line Breaking.
-Unicode Text Segmentation conforms to Unicode Standard Annex #29
-(https://unicode.org/reports/tr29/) and Unicode Line Breaking conforms to
-Unicode Standard Annex #14 (https://unicode.org/reports/tr14/).
+Package uniseg implements Unicode Text Segmentation, Unicode Line Breaking, and
+string width calculation for monospace fonts. Unicode Text Segmentation conforms
+to Unicode Standard Annex #29 (https://unicode.org/reports/tr29/) and Unicode
+Line Breaking conforms to Unicode Standard Annex #14
+(https://unicode.org/reports/tr14/).
In short, using this package, you can split a string into grapheme clusters
(what people would usually refer to as a "character"), into words, and into
@@ -12,8 +13,23 @@ as emojis, combining characters, or characters from Asian, Arabic, Hebrew, or
other languages. Additionally, you can use it to implement line breaking (or
"word wrapping"), that is, to determine where text can be broken over to the
next line when the width of the line is not big enough to fit the entire text.
+Finally, you can use it to calculate the display width of a string for monospace
+fonts.
-Grapheme Clusters
+# Getting Started
+
+If you just want to count the number of characters in a string, you can use
+[GraphemeClusterCount]. If you want to determine the display width of a string,
+you can use [StringWidth]. If you want to iterate over a string, you can use
+[Step], [StepString], or the [Graphemes] class (more convenient but less
+performant). This will provide you with all information: grapheme clusters,
+word boundaries, sentence boundaries, line breaks, and monospace character
+widths. The specialized functions [FirstGraphemeCluster],
+[FirstGraphemeClusterInString], [FirstWord], [FirstWordInString],
+[FirstSentence], and [FirstSentenceInString] can be used if only one type of
+information is needed.
+
+# Grapheme Clusters
Consider the rainbow flag emoji: 🏳️‍🌈. On most modern systems, it appears as one
character. But its string representation actually has 14 bytes, so counting
@@ -21,11 +37,11 @@ bytes (or using len("🏳️‍🌈")) will not work as expected. Counting runes
either: The flag has 4 Unicode code points, thus 4 runes. The stdlib function
utf8.RuneCountInString("🏳️‍🌈") and len([]rune("🏳️‍🌈")) will both return 4.
-The uniseg.GraphemeClusterCount(str) function will return 1 for the rainbow flag
-emoji. The Graphemes class and a variety of functions in this package will allow
-you to split strings into its grapheme clusters.
<