diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2024-01-07 19:44:19 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2024-01-19 10:47:21 +1100 |
commit | 24a4302c528e3a11b30855c006669de1adf9e1d4 (patch) | |
tree | 4b8053168746c2978c2b47968bae1576d3718bcf /vendor | |
parent | e887a2eb3c0ece1d2be78b869ff936a0703a3940 (diff) |
Add range selection ability on list contexts
This adds range select ability in two ways:
1) Sticky: like what we already have with the staging view i.e. press v then use arrow keys
2) Non-sticky: where you just use shift+up/down to expand the range
The state machine works like this:
(no range, press 'v') -> sticky range
(no range, press arrow) -> no range
(no range, press shift+arrow) -> nonsticky range
(sticky range, press 'v') -> no range
(sticky range, press arrow) -> sticky range
(sticky range, press shift+arrow) -> nonsticky range
(nonsticky range, press 'v') -> no range
(nonsticky range, press arrow) -> no range
(nonsticky range, press shift+arrow) -> nonsticky range
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/github.com/jesseduffield/gocui/keybinding.go | 48 | ||||
-rw-r--r-- | vendor/github.com/jesseduffield/gocui/tcell_driver.go | 8 | ||||
-rw-r--r-- | vendor/github.com/jesseduffield/gocui/view.go | 150 | ||||
-rw-r--r-- | vendor/golang.org/x/sys/unix/mkerrors.sh | 37 | ||||
-rw-r--r-- | vendor/golang.org/x/sys/unix/zerrors_linux.go | 54 | ||||
-rw-r--r-- | vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go | 2 | ||||
-rw-r--r-- | vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go | 2 | ||||
-rw-r--r-- | vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go | 2 | ||||
-rw-r--r-- | vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go | 2 | ||||
-rw-r--r-- | vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go | 2 | ||||
-rw-r--r-- | vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go | 2 | ||||
-rw-r--r-- | vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go | 2 | ||||
-rw-r--r-- | vendor/golang.org/x/sys/windows/syscall_windows.go | 1 | ||||
-rw-r--r-- | vendor/golang.org/x/sys/windows/zsyscall_windows.go | 9 | ||||
-rw-r--r-- | vendor/modules.txt | 6 |
15 files changed, 241 insertions, 86 deletions
diff --git a/vendor/github.com/jesseduffield/gocui/keybinding.go b/vendor/github.com/jesseduffield/gocui/keybinding.go index bee180aea..e2b931d7e 100644 --- a/vendor/github.com/jesseduffield/gocui/keybinding.go +++ b/vendor/github.com/jesseduffield/gocui/keybinding.go @@ -143,7 +143,9 @@ var translate = map[string]Key{ "Pgup": KeyPgup, "Pgdn": KeyPgdn, "ArrowUp": KeyArrowUp, + "ShiftArrowUp": KeyShiftArrowUp, "ArrowDown": KeyArrowDown, + "ShiftArrowDown": KeyShiftArrowDown, "ArrowLeft": KeyArrowLeft, "ArrowRight": KeyArrowRight, "CtrlTilde": KeyCtrlTilde, @@ -203,28 +205,30 @@ var translate = map[string]Key{ // Special keys. const ( - KeyF1 Key = Key(tcell.KeyF1) - KeyF2 = Key(tcell.KeyF2) - KeyF3 = Key(tcell.KeyF3) - KeyF4 = Key(tcell.KeyF4) - KeyF5 = Key(tcell.KeyF5) - KeyF6 = Key(tcell.KeyF6) - KeyF7 = Key(tcell.KeyF7) - KeyF8 = Key(tcell.KeyF8) - KeyF9 = Key(tcell.KeyF9) - KeyF10 = Key(tcell.KeyF10) - KeyF11 = Key(tcell.KeyF11) - KeyF12 = Key(tcell.KeyF12) - KeyInsert = Key(tcell.KeyInsert) - KeyDelete = Key(tcell.KeyDelete) - KeyHome = Key(tcell.KeyHome) - KeyEnd = Key(tcell.KeyEnd) - KeyPgdn = Key(tcell.KeyPgDn) - KeyPgup = Key(tcell.KeyPgUp) - KeyArrowUp = Key(tcell.KeyUp) - KeyArrowDown = Key(tcell.KeyDown) - KeyArrowLeft = Key(tcell.KeyLeft) - KeyArrowRight = Key(tcell.KeyRight) + KeyF1 Key = Key(tcell.KeyF1) + KeyF2 = Key(tcell.KeyF2) + KeyF3 = Key(tcell.KeyF3) + KeyF4 = Key(tcell.KeyF4) + KeyF5 = Key(tcell.KeyF5) + KeyF6 = Key(tcell.KeyF6) + KeyF7 = Key(tcell.KeyF7) + KeyF8 = Key(tcell.KeyF8) + KeyF9 = Key(tcell.KeyF9) + KeyF10 = Key(tcell.KeyF10) + KeyF11 = Key(tcell.KeyF11) + KeyF12 = Key(tcell.KeyF12) + KeyInsert = Key(tcell.KeyInsert) + KeyDelete = Key(tcell.KeyDelete) + KeyHome = Key(tcell.KeyHome) + KeyEnd = Key(tcell.KeyEnd) + KeyPgdn = Key(tcell.KeyPgDn) + KeyPgup = Key(tcell.KeyPgUp) + KeyArrowUp = Key(tcell.KeyUp) + KeyShiftArrowUp = Key(tcell.KeyF62) + KeyArrowDown = Key(tcell.KeyDown) + KeyShiftArrowDown = Key(tcell.KeyF63) + KeyArrowLeft = Key(tcell.KeyLeft) + KeyArrowRight = Key(tcell.KeyRight) ) // Keys combinations. diff --git a/vendor/github.com/jesseduffield/gocui/tcell_driver.go b/vendor/github.com/jesseduffield/gocui/tcell_driver.go index a3153d4c7..96f24390f 100644 --- a/vendor/github.com/jesseduffield/gocui/tcell_driver.go +++ b/vendor/github.com/jesseduffield/gocui/tcell_driver.go @@ -300,6 +300,14 @@ func (g *Gui) pollEvent() GocuiEvent { mod = 0 ch = rune(0) k = tcell.KeyCtrlSpace + } else if mod == tcell.ModShift && k == tcell.KeyUp { + mod = 0 + ch = rune(0) + k = tcell.KeyF62 + } else if mod == tcell.ModShift && k == tcell.KeyDown { + mod = 0 + ch = rune(0) + k = tcell.KeyF63 } else if mod == tcell.ModCtrl || mod == tcell.ModShift { // remove Ctrl or Shift if specified // - shift - will be translated to the final code of rune diff --git a/vendor/github.com/jesseduffield/gocui/view.go b/vendor/github.com/jesseduffield/gocui/view.go index 51c968b14..6bfc4c487 100644 --- a/vendor/github.com/jesseduffield/gocui/view.go +++ b/vendor/github.com/jesseduffield/gocui/view.go @@ -41,6 +41,14 @@ type View struct { wx, wy int // Write() offsets lines [][]cell // All the data outMode OutputMode + // The y position of the first line of a range selection. + // This is not relative to the view's origin: it is relative to the first line + // of the view's content, so you can scroll the view and this value will remain + // the same, unlike the view's cy value. + // A value of -1 means that there is no range selection. + // This value can be greater than the selected line index, in the event that + // a user starts a range select and then moves the cursor up. + rangeSelectStartY int // readBuffer is used for storing unread bytes readBuffer []byte @@ -284,6 +292,14 @@ func (v *View) FocusPoint(cx int, cy int) { v.cy = cy - v.oy } +func (v *View) SetRangeSelectStart(rangeSelectStartY int) { + v.rangeSelectStartY = rangeSelectStartY +} + +func (v *View) CancelRangeSelect() { + v.rangeSelectStartY = -1 +} + func calculateNewOrigin(selectedLine int, oldOrigin int, lineCount int, viewHeight int) int { if viewHeight > lineCount { return 0 @@ -349,19 +365,20 @@ func (l lineType) String() string { // newView returns a new View object. func newView(name string, x0, y0, x1, y1 int, mode OutputMode) *View { v := &View{ - name: name, - x0: x0, - y0: y0, - x1: x1, - y1: y1, - Visible: true, - Frame: true, - Editor: DefaultEditor, - tainted: true, - outMode: mode, - ei: newEscapeInterpreter(mode), - searcher: &searcher{}, - TextArea: &TextArea{}, + name: name, + x0: x0, + y0: y0, + x1: x1, + y1: y1, + Visible: true, + Frame: true, + Editor: DefaultEditor, + tainted: true, + outMode: mode, + ei: newEscapeInterpreter(mode), + searcher: &searcher{}, + TextArea: &TextArea{}, + rangeSelectStartY: -1, } v.FgColor, v.BgColor = ColorDefault, ColorDefault @@ -428,11 +445,17 @@ func (v *View) setRune(x, y int, ch rune, fgColor, bgColor Attribute) error { if x < 0 || x >= maxX || y < 0 || y >= maxY { return ErrInvalidPoint } - var ( - ry, rcy int - err error - ) - if v.Highlight { + + if v.Mask != 0 { + fgColor = v.FgColor + bgColor = v.BgColor + ch = v.Mask + } else if v.Highlight { + var ( + ry, rcy int + err error + ) + _, ry, err = v.realPosition(x, y) if err != nil { return err @@ -442,20 +465,28 @@ func (v *View) setRune(x, y int, ch rune, fgColor, bgColor Attribute) error { if err == nil { rcy = rrcy } - } - if v.Mask != 0 { - fgColor = v.FgColor - bgColor = v.BgColor - ch = v.Mask - } else if v.Highlight && ry == rcy { - // this ensures we use the bright variant of a colour upon highlight - fgColorComponent := fgColor & ^AttrAll - if fgColorComponent >= AttrIsValidColor && fgColorComponent < AttrIsValidColor+8 { - fgColor += 8 + rangeSelectStart := rcy + rangeSelectEnd := rcy + if v.rangeSelectStartY != -1 { + _, realRangeSelectStart, err := v.realPosition(0, v.rangeSelectStartY-v.oy) + if err != nil { + return err + } + + rangeSelectStart = min(realRangeSelectStart, rcy) + rangeSelectEnd = max(realRangeSelectStart, rcy) + } + + if ry >= rangeSelectStart && ry <= rangeSelectEnd { + // this ensures we use the bright variant of a colour upon highlight + fgColorComponent := fgColor & ^AttrAll + if fgColorComponent >= AttrIsValidColor && fgColorComponent < AttrIsValidColor+8 { + fgColor += 8 + } + fgColor = fgColor | AttrBold + bgColor = bgColor | v.SelBgColor } - fgColor = fgColor | AttrBold - bgColor = bgColor | v.SelBgColor } // Don't display NUL characters @@ -468,6 +499,20 @@ func (v *View) setRune(x, y int, ch rune, fgColor, bgColor Attribute) error { return nil } +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + // SetCursor sets the cursor position of the view at the given point, // relative to the view. It checks if the position is valid. func (v *View) SetCursor(x, y int) error { @@ -1388,7 +1433,31 @@ func (v *View) SelectedLine() string { if len(v.lines) == 0 { return "" } - line := v.lines[v.SelectedLineIdx()] + + return v.lineContentAtIdx(v.SelectedLineIdx()) +} + +// expected to only be used in tests +func (v *View) SelectedLines() []string { + v.writeMutex.Lock() + defer v.writeMutex.Unlock() + + if len(v.lines) == 0 { + return nil + } + + startIdx, endIdx := v.SelectedLineRange() + + lines := make([]string, 0, endIdx-startIdx+1) + for i := startIdx; i <= endIdx; i++ { + lines = append(lines, v.lineContentAtIdx(i)) + } + + return lines +} + +func (v *View) lineContentAtIdx(idx int) string { + line := v.lines[idx] str := lineType(line).String() return strings.Replace(str, "\x00", "", -1) } @@ -1399,6 +1468,25 @@ func (v *View) SelectedPoint() (int, int) { return cx + ox, cy + oy } +func (v *View) SelectedLineRange() (int, int) { + _, cy := v.Cursor() + _, oy := v.Origin() + + start := cy + oy + + if v.rangeSelectStartY == -1 { + return start, start + } + + end := v.rangeSelectStartY + + if start > end { + return end, start + } else { + return start, end + } +} + func (v *View) RenderTextArea() { v.Clear() fmt.Fprint(v, v.TextArea.GetContent()) diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index 6202638ba..c6492020e 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -248,6 +248,7 @@ struct ltchars { #include <linux/module.h> #include <linux/mount.h> #include <linux/netfilter/nfnetlink.h> +#include <linux/netfilter/nf_tables.h> #include <linux/netlink.h> #include <linux/net_namespace.h> #include <linux/nfc.h> @@ -283,10 +284,6 @@ struct ltchars { #include <asm/termbits.h> #endif -#ifndef MSG_FASTOPEN -#define MSG_FASTOPEN 0x20000000 -#endif - #ifndef PTRACE_GETREGS #define PTRACE_GETREGS 0xc #endif @@ -295,14 +292,6 @@ struct ltchars { #define PTRACE_SETREGS 0xd #endif -#ifndef SOL_NETLINK -#define SOL_NETLINK 270 -#endif - -#ifndef SOL_SMC -#define SOL_SMC 286 -#endif - #ifdef SOL_BLUETOOTH // SPARC includes this in /usr/include/sparc64-linux-gnu/bits/socket.h // but it is already in bluetooth_linux.go @@ -319,10 +308,23 @@ struct ltchars { #undef TIPC_WAIT_FOREVER #define TIPC_WAIT_FOREVER 0xffffffff -// Copied from linux/l2tp.h -// Including linux/l2tp.h here causes conflicts between linux/in.h -// and netinet/in.h included via net/route.h above. -#define IPPROTO_L2TP 115 +// Copied from linux/netfilter/nf_nat.h +// Including linux/netfilter/nf_nat.h here causes conflicts between linux/in.h +// and netinet/in.h. +#define NF_NAT_RANGE_MAP_IPS (1 << 0) +#define NF_NAT_RANGE_PROTO_SPECIFIED (1 << 1) +#define NF_NAT_RANGE_PROTO_RANDOM (1 << 2) +#define NF_NAT_RANGE_PERSISTENT (1 << 3) +#define NF_NAT_RANGE_PROTO_RANDOM_FULLY (1 << 4) +#define NF_NAT_RANGE_PROTO_OFFSET (1 << 5) +#define NF_NAT_RANGE_NETMAP (1 << 6) +#define NF_NAT_RANGE_PROTO_RANDOM_ALL \ + (NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PROTO_RANDOM_FULLY) +#define NF_NAT_RANGE_MASK \ + (NF_NAT_RANGE_MAP_IPS | NF_NAT_RANGE_PROTO_SPECIFIED | \ + NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PERSISTENT | \ + NF_NAT_RANGE_PROTO_RANDOM_FULLY | NF_NAT_RANGE_PROTO_OFFSET | \ + NF_NAT_RANGE_NETMAP) // Copied from linux/hid.h. // Keep in sync with the size of the referenced fields. @@ -603,6 +605,9 @@ ccflags="$@" $2 ~ /^FSOPT_/ || $2 ~ /^WDIO[CFS]_/ || $2 ~ /^NFN/ || + $2 !~ /^NFT_META_IIFTYPE/ && + $2 ~ /^NFT_/ || + $2 ~ /^NF_NAT_/ || $2 ~ /^XDP_/ || $2 ~ /^RWF_/ || $2 ~ /^(HDIO|WIN|SMART)_/ || diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index c73cfe2f1..a5d3ff8df 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -2127,6 +2127,60 @@ const ( NFNL_SUBSYS_QUEUE = 0x3 NFNL_SUBSYS_ULOG = 0x4 NFS_SUPER_MAGIC = 0x6969 + NFT_CHAIN_FLAGS = 0x7 + NFT_CHAIN_MAXNAMELEN = 0x100 + NFT_CT_MAX = 0x17 + NFT_DATA_RESERVED_MASK = 0xffffff00 + NFT_DATA_VALUE_MAXLEN = 0x40 + NFT_EXTHDR_OP_MAX = 0x4 + NFT_FIB_RESULT_MAX = 0x3 + NFT_INNER_MASK = 0xf + NFT_LOGLEVEL_MAX = 0x8 + NFT_NAME_MAXLEN = 0x100 + NFT_NG_MAX = 0x1 + NFT_OBJECT_CONNLIMIT = 0x5 + NFT_OBJECT_COUNTER = 0x1 + NFT_OBJECT_CT_EXPECT = 0x9 + NFT_OBJECT_CT_HELPER = 0x3 + NFT_OBJECT_CT_TIMEOUT = 0x7 + NFT_OBJECT_LIMIT = 0x4 + NFT_OBJECT_MAX = 0xa + NFT_OBJECT_QUOTA = 0x2 + NFT_OBJECT_SECMARK = 0x8 + NFT_OBJECT_SYNPROXY = 0xa + NFT_OBJECT_TUNNEL = 0x6 + NFT_OBJECT_UNSPEC = 0x0 + NFT_OBJ_MAXNAMELEN = 0x100 + NFT_OSF_MAXGENRELEN = 0x10 + NFT_QUEUE_FLAG_BYPASS = 0x1 + NFT_QUEUE_FLAG_CPU_FANOUT = 0x2 + NFT_QUEUE_FLAG_MASK = 0x3 + NFT_REG32_COUNT = 0x10 + NFT_REG32_SIZE = 0x4 + NFT_REG_MAX = 0x4 + NFT_REG_SIZE = 0x10 + NFT_REJECT_ICMPX_MAX = 0x3 + NFT_RT_MAX = 0x4 + NFT_SECMARK_CTX_MAXLEN = 0x100 + NFT_SET_MAXNAMELEN = 0x100 + NFT_SOCKET_MAX = 0x3 + NFT_TABLE_F_MASK = 0x3 + NFT_TABLE_MAXNAMELEN = 0x100 + NFT_TRACETYPE_MAX = 0x3 + NFT_TUNNEL_F_MASK = 0x7 + NFT_TUNNEL_MAX = 0x1 + NFT_TUNNEL_MODE_MAX = 0x2 + NFT_USERDATA_MAXLEN = 0x100 + NFT_XFRM_KEY_MAX = 0x6 + NF_NAT_RANGE_MAP_IPS = 0x1 + NF_NAT_RANGE_MASK = 0x7f + NF_NAT_RANGE_NETMAP = 0x40 + NF_NAT_RANGE_PERSISTENT = 0x8 + NF_NAT_RANGE_PROTO_OFFSET = 0x20 + NF_NAT_RANGE_PROTO_RANDOM = 0x4 + NF_NAT_RANGE_PROTO_RANDOM_ALL = 0x14 + NF_NAT_RANGE_PROTO_RANDOM_FULLY = 0x10 + NF_NAT_RANGE_PROTO_SPECIFIED = 0x2 NILFS_SUPER_MAGIC = 0x3434 NL0 = 0x0 NL1 = 0x100 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index a1d061597..9dc42410b 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index 5b2a74097..0d3a0751c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go index f6eda1344..c39f7776d 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go index 55df20ae9..57571d072 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go index 8c1155cbc..e62963e67 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go index 7cc80c58d..00831354c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go index 0688737f4..79029ed58 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index 47dc57967..ffb8708cc 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -194,6 +194,7 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys GetComputerName(buf *uint16, n *uint32) (err error) = GetComputerNameW //sys GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) = GetComputerNameExW //sys SetEndOfFile(handle Handle) (err error) +//sys SetFileValidData(handle Handle, validDataLength int64) (err error) //sys GetSystemTimeAsFileTime(time *Filetime) //sys GetSystemTimePreciseAsFileTime(time *Filetime) //sys GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) [failretval==0xffffffff] diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index 146a1f019..e8791c82c 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -342,6 +342,7 @@ var ( procSetDefaultDllDirectories = modkernel32.NewProc("SetDefaultDllDirectories") procSetDllDirectoryW = modkernel32.NewProc("SetDllDirectoryW") procSetEndOfFile = modkernel32.NewProc("SetEndOfFile") + procSetFileValidData = modkernel32.NewProc("SetFileValidData") procSetEnvironmentVariableW = modkernel32.NewProc("SetEnvironmentVariableW") procSetErrorMode = modkernel32.NewProc("SetErrorMode") procSetEvent = modkernel32.NewProc("SetEvent") @@ -2988,6 +2989,14 @@ func SetEndOfFile(handle Handle) (err error) { return } +func SetFileValidData(handle Handle, validDataLength int64) (err error) { + r1, _, e1 := syscall.Syscall(procSetFileValidData.Addr(), 2, uintptr(handle), uintptr(validDataLength), 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func SetEnvironmentVariable(name *uint16, value *uint16) (err error) { r1, _, e1 := syscall.Syscall(procSetEnvironmentVariableW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), 0) if r1 == 0 { diff --git a/vendor/modules.txt b/vendor/modules.txt index 1121027e0..071b257ad 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -173,7 +173,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.20240103192639-2874168c14db +# github.com/jesseduffield/gocui v0.3.1-0.20240118234343-2d41754af383 ## explicit; go 1.12 github.com/jesseduffield/gocui # github.com/jesseduffield/kill v0.0.0-20220618033138-bfbe04675d10 @@ -314,13 +314,13 @@ 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.15.0 +# golang.org/x/sys v0.16.0 ## explicit; go 1.18 golang.org/x/sys/cpu golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows -# golang.org/x/term v0.15.0 +# golang.org/x/term v0.16.0 ## explicit; go 1.18 golang.org/x/term # golang.org/x/text v0.14.0 |