mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Bump gocui
This commit is contained in:
3
vendor/github.com/go-errors/errors/README.md
generated
vendored
3
vendor/github.com/go-errors/errors/README.md
generated
vendored
@ -9,7 +9,7 @@ This is particularly useful when you want to understand the state of execution
|
||||
when an error was returned unexpectedly.
|
||||
|
||||
It provides the type \*Error which implements the standard golang error
|
||||
interface, so you can use this library interchangably with code that is
|
||||
interface, so you can use this library interchangeably with code that is
|
||||
expecting a normal error return.
|
||||
|
||||
Usage
|
||||
@ -80,3 +80,4 @@ This package is licensed under the MIT license, see LICENSE.MIT for details.
|
||||
* v1.4.0 *BREAKING* v1.4.0 reverted all changes from v1.3.0 and is identical to v1.2.0
|
||||
* v1.4.1 no code change, but now without an unnecessary cover.out file.
|
||||
* v1.4.2 performance improvement to ErrorStack() to avoid unnecessary work https://github.com/go-errors/errors/pull/40
|
||||
* v1.5.0 add errors.Join() and errors.Unwrap() copying the stdlib https://github.com/go-errors/errors/pull/40
|
||||
|
34
vendor/github.com/go-errors/errors/error_1_13.go
generated
vendored
34
vendor/github.com/go-errors/errors/error_1_13.go
generated
vendored
@ -1,3 +1,4 @@
|
||||
//go:build go1.13
|
||||
// +build go1.13
|
||||
|
||||
package errors
|
||||
@ -6,14 +7,17 @@ import (
|
||||
baseErrors "errors"
|
||||
)
|
||||
|
||||
// find error in any wrapped error
|
||||
// As finds the first error in err's tree that matches target, and if one is found, sets
|
||||
// target to that error value and returns true. Otherwise, it returns false.
|
||||
//
|
||||
// For more information see stdlib errors.As.
|
||||
func As(err error, target interface{}) bool {
|
||||
return baseErrors.As(err, target)
|
||||
}
|
||||
|
||||
// Is detects whether the error is equal to a given error. Errors
|
||||
// are considered equal by this function if they are matched by errors.Is
|
||||
// or if their contained errors are matched through errors.Is
|
||||
// or if their contained errors are matched through errors.Is.
|
||||
func Is(e error, original error) bool {
|
||||
if baseErrors.Is(e, original) {
|
||||
return true
|
||||
@ -29,3 +33,29 @@ func Is(e error, original error) bool {
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// Join returns an error that wraps the given errors.
|
||||
// Any nil error values are discarded.
|
||||
// Join returns nil if every value in errs is nil.
|
||||
// The error formats as the concatenation of the strings obtained
|
||||
// by calling the Error method of each element of errs, with a newline
|
||||
// between each string.
|
||||
//
|
||||
// A non-nil error returned by Join implements the Unwrap() []error method.
|
||||
//
|
||||
// For more information see stdlib errors.Join.
|
||||
func Join(errs ...error) error {
|
||||
return baseErrors.Join(errs...)
|
||||
}
|
||||
|
||||
// Unwrap returns the result of calling the Unwrap method on err, if err's
|
||||
// type contains an Unwrap method returning error.
|
||||
// Otherwise, Unwrap returns nil.
|
||||
//
|
||||
// Unwrap only calls a method of the form "Unwrap() error".
|
||||
// In particular Unwrap does not unwrap errors returned by [Join].
|
||||
//
|
||||
// For more information see stdlib errors.Unwrap.
|
||||
func Unwrap(err error) error {
|
||||
return baseErrors.Unwrap(err)
|
||||
}
|
||||
|
68
vendor/github.com/go-errors/errors/error_backward.go
generated
vendored
68
vendor/github.com/go-errors/errors/error_backward.go
generated
vendored
@ -1,3 +1,4 @@
|
||||
//go:build !go1.13
|
||||
// +build !go1.13
|
||||
|
||||
package errors
|
||||
@ -55,3 +56,70 @@ func Is(e error, original error) bool {
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// Disclaimer: functions Join and Unwrap are copied from the stdlib errors
|
||||
// package v1.21.0.
|
||||
|
||||
// Join returns an error that wraps the given errors.
|
||||
// Any nil error values are discarded.
|
||||
// Join returns nil if every value in errs is nil.
|
||||
// The error formats as the concatenation of the strings obtained
|
||||
// by calling the Error method of each element of errs, with a newline
|
||||
// between each string.
|
||||
//
|
||||
// A non-nil error returned by Join implements the Unwrap() []error method.
|
||||
func Join(errs ...error) error {
|
||||
n := 0
|
||||
for _, err := range errs {
|
||||
if err != nil {
|
||||
n++
|
||||
}
|
||||
}
|
||||
if n == 0 {
|
||||
return nil
|
||||
}
|
||||
e := &joinError{
|
||||
errs: make([]error, 0, n),
|
||||
}
|
||||
for _, err := range errs {
|
||||
if err != nil {
|
||||
e.errs = append(e.errs, err)
|
||||
}
|
||||
}
|
||||
return e
|
||||
}
|
||||
|
||||
type joinError struct {
|
||||
errs []error
|
||||
}
|
||||
|
||||
func (e *joinError) Error() string {
|
||||
var b []byte
|
||||
for i, err := range e.errs {
|
||||
if i > 0 {
|
||||
b = append(b, '\n')
|
||||
}
|
||||
b = append(b, err.Error()...)
|
||||
}
|
||||
return string(b)
|
||||
}
|
||||
|
||||
func (e *joinError) Unwrap() []error {
|
||||
return e.errs
|
||||
}
|
||||
|
||||
// Unwrap returns the result of calling the Unwrap method on err, if err's
|
||||
// type contains an Unwrap method returning error.
|
||||
// Otherwise, Unwrap returns nil.
|
||||
//
|
||||
// Unwrap only calls a method of the form "Unwrap() error".
|
||||
// In particular Unwrap does not unwrap errors returned by [Join].
|
||||
func Unwrap(err error) error {
|
||||
u, ok := err.(interface {
|
||||
Unwrap() error
|
||||
})
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
return u.Unwrap()
|
||||
}
|
||||
|
14
vendor/github.com/jesseduffield/gocui/gui.go
generated
vendored
14
vendor/github.com/jesseduffield/gocui/gui.go
generated
vendored
@ -1020,6 +1020,14 @@ func (g *Gui) drawTitle(v *View, fgColor, bgColor Attribute) error {
|
||||
}
|
||||
|
||||
tabs := v.Tabs
|
||||
prefix := v.TitlePrefix
|
||||
if prefix != "" {
|
||||
if len(v.FrameRunes) > 0 {
|
||||
prefix += string(v.FrameRunes[0])
|
||||
} else {
|
||||
prefix += "─"
|
||||
}
|
||||
}
|
||||
separator := " - "
|
||||
charIndex := 0
|
||||
currentTabStart := -1
|
||||
@ -1043,6 +1051,12 @@ func (g *Gui) drawTitle(v *View, fgColor, bgColor Attribute) error {
|
||||
str := strings.Join(tabs, separator)
|
||||
|
||||
x := v.x0 + 2
|
||||
for _, ch := range prefix {
|
||||
if err := g.SetRune(x, v.y0, ch, fgColor, bgColor); err != nil {
|
||||
return err
|
||||
}
|
||||
x += runewidth.RuneWidth(ch)
|
||||
}
|
||||
for i, ch := range str {
|
||||
if x < 0 {
|
||||
continue
|
||||
|
9
vendor/github.com/jesseduffield/gocui/view.go
generated
vendored
9
vendor/github.com/jesseduffield/gocui/view.go
generated
vendored
@ -122,6 +122,10 @@ type View struct {
|
||||
// If Frame is true, Title allows to configure a title for the view.
|
||||
Title string
|
||||
|
||||
// If non-empty, TitlePrefix is prepended to the title of a view regardless on
|
||||
// the the currently selected tab (if any.)
|
||||
TitlePrefix string
|
||||
|
||||
Tabs []string
|
||||
TabIndex int
|
||||
|
||||
@ -1348,7 +1352,10 @@ func (v *View) GetClickedTabIndex(x int) int {
|
||||
return 0
|
||||
}
|
||||
|
||||
charX := 1
|
||||
charX := len(v.TitlePrefix) + 1
|
||||
if v.TitlePrefix != "" {
|
||||
charX += 1
|
||||
}
|
||||
if x <= charX {
|
||||
return -1
|
||||
}
|
||||
|
Reference in New Issue
Block a user