mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-04 06:02:04 -07:00
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
af4917dbb6 | ||
|
d9404fcce4 | ||
|
5c01fee5a9 | ||
|
9b27d68a37 | ||
|
b99d884e57 | ||
|
587df594b8 | ||
|
b896e0d314 | ||
|
559fb7ee45 | ||
|
62545cd983 | ||
|
c50812518e | ||
|
4cc5609d8b |
@@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
version: 2
|
||||||
project_name: fzf
|
project_name: fzf
|
||||||
|
|
||||||
before:
|
before:
|
||||||
@@ -6,60 +7,9 @@ before:
|
|||||||
- go mod download
|
- go mod download
|
||||||
|
|
||||||
builds:
|
builds:
|
||||||
- id: fzf-macos
|
|
||||||
binary: fzf
|
|
||||||
goos:
|
|
||||||
- darwin
|
|
||||||
goarch:
|
|
||||||
- amd64
|
|
||||||
flags:
|
|
||||||
- -trimpath
|
|
||||||
ldflags:
|
|
||||||
- "-s -w -X main.version={{ .Version }} -X main.revision={{ .ShortCommit }}"
|
|
||||||
hooks:
|
|
||||||
post: |
|
|
||||||
sh -c '
|
|
||||||
cat > /tmp/fzf-gon-amd64.hcl << EOF
|
|
||||||
source = ["./dist/fzf-macos_darwin_amd64_v1/fzf"]
|
|
||||||
bundle_id = "junegunn.fzf"
|
|
||||||
sign {
|
|
||||||
application_identity = "Developer ID Application: Junegunn Choi (Y254DRW44Z)"
|
|
||||||
}
|
|
||||||
zip {
|
|
||||||
output_path = "./dist/fzf-{{ .Version }}-darwin_amd64.zip"
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
gon /tmp/fzf-gon-amd64.hcl
|
|
||||||
'
|
|
||||||
|
|
||||||
- id: fzf-macos-arm
|
|
||||||
binary: fzf
|
|
||||||
goos:
|
|
||||||
- darwin
|
|
||||||
goarch:
|
|
||||||
- arm64
|
|
||||||
flags:
|
|
||||||
- -trimpath
|
|
||||||
ldflags:
|
|
||||||
- "-s -w -X main.version={{ .Version }} -X main.revision={{ .ShortCommit }}"
|
|
||||||
hooks:
|
|
||||||
post: |
|
|
||||||
sh -c '
|
|
||||||
cat > /tmp/fzf-gon-arm64.hcl << EOF
|
|
||||||
source = ["./dist/fzf-macos-arm_darwin_arm64/fzf"]
|
|
||||||
bundle_id = "junegunn.fzf"
|
|
||||||
sign {
|
|
||||||
application_identity = "Developer ID Application: Junegunn Choi (Y254DRW44Z)"
|
|
||||||
}
|
|
||||||
zip {
|
|
||||||
output_path = "./dist/fzf-{{ .Version }}-darwin_arm64.zip"
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
gon /tmp/fzf-gon-arm64.hcl
|
|
||||||
'
|
|
||||||
|
|
||||||
- id: fzf
|
- id: fzf
|
||||||
goos:
|
goos:
|
||||||
|
- darwin
|
||||||
- linux
|
- linux
|
||||||
- windows
|
- windows
|
||||||
- freebsd
|
- freebsd
|
||||||
@@ -89,6 +39,42 @@ builds:
|
|||||||
- goos: openbsd
|
- goos: openbsd
|
||||||
goarch: arm64
|
goarch: arm64
|
||||||
|
|
||||||
|
# .goreleaser.yaml
|
||||||
|
notarize:
|
||||||
|
macos:
|
||||||
|
- # Whether this configuration is enabled or not.
|
||||||
|
#
|
||||||
|
# Default: false.
|
||||||
|
# Templates: allowed.
|
||||||
|
enabled: "{{ not .IsSnapshot }}"
|
||||||
|
|
||||||
|
# Before notarizing, we need to sign the binary.
|
||||||
|
# This blocks defines the configuration for doing so.
|
||||||
|
sign:
|
||||||
|
# The .p12 certificate file path or its base64'd contents.
|
||||||
|
certificate: "{{.Env.MACOS_SIGN_P12}}"
|
||||||
|
|
||||||
|
# The password to be used to open the certificate.
|
||||||
|
password: "{{.Env.MACOS_SIGN_PASSWORD}}"
|
||||||
|
|
||||||
|
# Then, we notarize the binaries.
|
||||||
|
notarize:
|
||||||
|
# The issuer ID.
|
||||||
|
# Its the UUID you see when creating the App Store Connect key.
|
||||||
|
issuer_id: "{{.Env.MACOS_NOTARY_ISSUER_ID}}"
|
||||||
|
|
||||||
|
# Key ID.
|
||||||
|
# You can see it in the list of App Store Connect Keys.
|
||||||
|
# It will also be in the ApiKey filename.
|
||||||
|
key_id: "{{.Env.MACOS_NOTARY_KEY_ID}}"
|
||||||
|
|
||||||
|
# The .p8 key file path or its base64'd contents.
|
||||||
|
key: "{{.Env.MACOS_NOTARY_KEY}}"
|
||||||
|
|
||||||
|
# Whether to wait for the notarization to finish.
|
||||||
|
# Not recommended, as it could take a really long time.
|
||||||
|
wait: true
|
||||||
|
|
||||||
archives:
|
archives:
|
||||||
- name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
|
- name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
|
||||||
builds:
|
builds:
|
||||||
@@ -100,18 +86,12 @@ archives:
|
|||||||
files:
|
files:
|
||||||
- non-existent*
|
- non-existent*
|
||||||
|
|
||||||
checksum:
|
|
||||||
extra_files:
|
|
||||||
- glob: ./dist/fzf-*darwin*.zip
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
github:
|
github:
|
||||||
owner: junegunn
|
owner: junegunn
|
||||||
name: fzf
|
name: fzf
|
||||||
prerelease: auto
|
prerelease: auto
|
||||||
name_template: '{{ .Version }}'
|
name_template: '{{ .Version }}'
|
||||||
extra_files:
|
|
||||||
- glob: ./dist/fzf-*darwin*.zip
|
|
||||||
|
|
||||||
snapshot:
|
snapshot:
|
||||||
name_template: "{{ .Version }}-devel"
|
name_template: "{{ .Version }}-devel"
|
||||||
|
22
CHANGELOG.md
22
CHANGELOG.md
@@ -1,6 +1,28 @@
|
|||||||
CHANGELOG
|
CHANGELOG
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
0.54.3
|
||||||
|
------
|
||||||
|
- Fixed incompatibility of adaptive height specification and 'start:reload'
|
||||||
|
```sh
|
||||||
|
# A regression in 0.54.0 would cause this to fail
|
||||||
|
fzf --height '~100%' --bind 'start:reload:seq 10'
|
||||||
|
```
|
||||||
|
- Environment variables are now available to `$FZF_DEFAULT_COMMAND`
|
||||||
|
```sh
|
||||||
|
FZF_DEFAULT_COMMAND='echo $FZF_QUERY' fzf --query foo
|
||||||
|
```
|
||||||
|
|
||||||
|
0.54.2
|
||||||
|
------
|
||||||
|
- Fixed incorrect syntax highlighting of truncated multi-line entries
|
||||||
|
- Updated GoReleaser to 2.1.0 to simplify notarization of macOS binaries
|
||||||
|
- macOS archives will be in `tar.gz` format instead of `zip` format since we no longer notarize the zip files but binaries
|
||||||
|
- (Windows) Reverted a mintty fix in 0.54.0
|
||||||
|
- As a result, mouse may not work on mintty in fullscreen mode. However, fzf will correctly read non-ASCII input in fullscreen mode (`--no-height`).
|
||||||
|
- fzf unfortunately cannot read non-ASCII input when not in fullscreen mode on Windows. So if you need to input non-ASCII characters, add `--no-height` to your `$FZF_DEFAULT_OPTS`.
|
||||||
|
- Any help in fixing this issue will be appreciated (#3799, #3847).
|
||||||
|
|
||||||
0.54.1
|
0.54.1
|
||||||
------
|
------
|
||||||
- Updated [fastwalk](https://github.com/charlievieth/fastwalk) dependency for built-in directory walker
|
- Updated [fastwalk](https://github.com/charlievieth/fastwalk) dependency for built-in directory walker
|
||||||
|
6
install
6
install
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
set -u
|
set -u
|
||||||
|
|
||||||
version=0.54.1
|
version=0.54.3
|
||||||
auto_completion=
|
auto_completion=
|
||||||
key_bindings=
|
key_bindings=
|
||||||
update_config=2
|
update_config=2
|
||||||
@@ -168,8 +168,8 @@ archi=$(uname -sm)
|
|||||||
binary_available=1
|
binary_available=1
|
||||||
binary_error=""
|
binary_error=""
|
||||||
case "$archi" in
|
case "$archi" in
|
||||||
Darwin\ arm64) download fzf-$version-darwin_arm64.zip ;;
|
Darwin\ arm64) download fzf-$version-darwin_arm64.tar.gz ;;
|
||||||
Darwin\ x86_64) download fzf-$version-darwin_amd64.zip ;;
|
Darwin\ x86_64) download fzf-$version-darwin_amd64.tar.gz ;;
|
||||||
Linux\ armv5*) download fzf-$version-linux_armv5.tar.gz ;;
|
Linux\ armv5*) download fzf-$version-linux_armv5.tar.gz ;;
|
||||||
Linux\ armv6*) download fzf-$version-linux_armv6.tar.gz ;;
|
Linux\ armv6*) download fzf-$version-linux_armv6.tar.gz ;;
|
||||||
Linux\ armv7*) download fzf-$version-linux_armv7.tar.gz ;;
|
Linux\ armv7*) download fzf-$version-linux_armv7.tar.gz ;;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
$version="0.54.1"
|
$version="0.54.3"
|
||||||
|
|
||||||
$fzf_base=Split-Path -Parent $MyInvocation.MyCommand.Definition
|
$fzf_base=Split-Path -Parent $MyInvocation.MyCommand.Definition
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
..
|
..
|
||||||
.TH fzf\-tmux 1 "Jul 2024" "fzf 0.54.1" "fzf\-tmux - open fzf in tmux split pane"
|
.TH fzf\-tmux 1 "Jul 2024" "fzf 0.54.3" "fzf\-tmux - open fzf in tmux split pane"
|
||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
fzf\-tmux - open fzf in tmux split pane
|
fzf\-tmux - open fzf in tmux split pane
|
||||||
|
@@ -21,7 +21,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
..
|
..
|
||||||
.TH fzf 1 "Jul 2024" "fzf 0.54.1" "fzf - a command-line fuzzy finder"
|
.TH fzf 1 "Jul 2024" "fzf 0.54.3" "fzf - a command-line fuzzy finder"
|
||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
fzf - a command-line fuzzy finder
|
fzf - a command-line fuzzy finder
|
||||||
|
@@ -58,7 +58,6 @@ const (
|
|||||||
const (
|
const (
|
||||||
EvtReadNew util.EventType = iota
|
EvtReadNew util.EventType = iota
|
||||||
EvtReadFin
|
EvtReadFin
|
||||||
EvtReadNone
|
|
||||||
EvtSearchNew
|
EvtSearchNew
|
||||||
EvtSearchProgress
|
EvtSearchProgress
|
||||||
EvtSearchFin
|
EvtSearchFin
|
||||||
|
42
src/core.go
42
src/core.go
@@ -146,8 +146,25 @@ func Run(opts *Options) (int, error) {
|
|||||||
// Process executor
|
// Process executor
|
||||||
executor := util.NewExecutor(opts.WithShell)
|
executor := util.NewExecutor(opts.WithShell)
|
||||||
|
|
||||||
|
// Terminal I/O
|
||||||
|
var terminal *Terminal
|
||||||
|
var err error
|
||||||
|
var initialEnv []string
|
||||||
|
initialReload := opts.extractReloadOnStart()
|
||||||
|
if opts.Filter == nil {
|
||||||
|
terminal, err = NewTerminal(opts, eventBox, executor)
|
||||||
|
if err != nil {
|
||||||
|
return ExitError, err
|
||||||
|
}
|
||||||
|
if len(initialReload) > 0 {
|
||||||
|
var temps []string
|
||||||
|
initialReload, temps = terminal.replacePlaceholderInInitialCommand(initialReload)
|
||||||
|
initialEnv = terminal.environ()
|
||||||
|
defer removeFiles(temps)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Reader
|
// Reader
|
||||||
reloadOnStart := opts.reloadOnStart()
|
|
||||||
streamingFilter := opts.Filter != nil && !sort && !opts.Tac && !opts.Sync
|
streamingFilter := opts.Filter != nil && !sort && !opts.Tac && !opts.Sync
|
||||||
var reader *Reader
|
var reader *Reader
|
||||||
if !streamingFilter {
|
if !streamingFilter {
|
||||||
@@ -155,12 +172,7 @@ func Run(opts *Options) (int, error) {
|
|||||||
return chunkList.Push(data)
|
return chunkList.Push(data)
|
||||||
}, eventBox, executor, opts.ReadZero, opts.Filter == nil)
|
}, eventBox, executor, opts.ReadZero, opts.Filter == nil)
|
||||||
|
|
||||||
if reloadOnStart {
|
go reader.ReadSource(opts.Input, opts.WalkerRoot, opts.WalkerOpts, opts.WalkerSkip, initialReload, initialEnv)
|
||||||
// reload or reload-sync action is bound to 'start' event, no need to start the reader
|
|
||||||
eventBox.Set(EvtReadNone, nil)
|
|
||||||
} else {
|
|
||||||
go reader.ReadSource(opts.Input, opts.WalkerRoot, opts.WalkerOpts, opts.WalkerSkip)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Matcher
|
// Matcher
|
||||||
@@ -212,7 +224,7 @@ func Run(opts *Options) (int, error) {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}, eventBox, executor, opts.ReadZero, false)
|
}, eventBox, executor, opts.ReadZero, false)
|
||||||
reader.ReadSource(opts.Input, opts.WalkerRoot, opts.WalkerOpts, opts.WalkerSkip)
|
reader.ReadSource(opts.Input, opts.WalkerRoot, opts.WalkerOpts, opts.WalkerSkip, initialReload, initialEnv)
|
||||||
} else {
|
} else {
|
||||||
eventBox.Unwatch(EvtReadNew)
|
eventBox.Unwatch(EvtReadNew)
|
||||||
eventBox.WaitFor(EvtReadFin)
|
eventBox.WaitFor(EvtReadFin)
|
||||||
@@ -234,8 +246,7 @@ func Run(opts *Options) (int, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Synchronous search
|
// Synchronous search
|
||||||
sync := opts.Sync && !reloadOnStart
|
if opts.Sync {
|
||||||
if sync {
|
|
||||||
eventBox.Unwatch(EvtReadNew)
|
eventBox.Unwatch(EvtReadNew)
|
||||||
eventBox.WaitFor(EvtReadFin)
|
eventBox.WaitFor(EvtReadFin)
|
||||||
}
|
}
|
||||||
@@ -244,18 +255,14 @@ func Run(opts *Options) (int, error) {
|
|||||||
go matcher.Loop()
|
go matcher.Loop()
|
||||||
defer matcher.Stop()
|
defer matcher.Stop()
|
||||||
|
|
||||||
// Terminal I/O
|
// Handling adaptive height
|
||||||
terminal, err := NewTerminal(opts, eventBox, executor)
|
|
||||||
if err != nil {
|
|
||||||
return ExitError, err
|
|
||||||
}
|
|
||||||
maxFit := 0 // Maximum number of items that can fit on screen
|
maxFit := 0 // Maximum number of items that can fit on screen
|
||||||
padHeight := 0
|
padHeight := 0
|
||||||
heightUnknown := opts.Height.auto
|
heightUnknown := opts.Height.auto
|
||||||
if heightUnknown {
|
if heightUnknown {
|
||||||
maxFit, padHeight = terminal.MaxFitAndPad()
|
maxFit, padHeight = terminal.MaxFitAndPad()
|
||||||
}
|
}
|
||||||
deferred := opts.Select1 || opts.Exit0 || sync
|
deferred := opts.Select1 || opts.Exit0 || opts.Sync
|
||||||
go terminal.Loop()
|
go terminal.Loop()
|
||||||
if !deferred && !heightUnknown {
|
if !deferred && !heightUnknown {
|
||||||
// Start right away
|
// Start right away
|
||||||
@@ -322,9 +329,6 @@ func Run(opts *Options) (int, error) {
|
|||||||
err = quitSignal.err
|
err = quitSignal.err
|
||||||
stop = true
|
stop = true
|
||||||
return
|
return
|
||||||
case EvtReadNone:
|
|
||||||
reading = false
|
|
||||||
terminal.UpdateCount(0, false, nil)
|
|
||||||
case EvtReadNew, EvtReadFin:
|
case EvtReadNew, EvtReadFin:
|
||||||
if evt == EvtReadFin && nextCommand != nil {
|
if evt == EvtReadFin && nextCommand != nil {
|
||||||
restart(*nextCommand, nextEnviron)
|
restart(*nextCommand, nextEnviron)
|
||||||
|
@@ -2964,17 +2964,18 @@ func ParseOptions(useDefaults bool, args []string) (*Options, error) {
|
|||||||
return opts, nil
|
return opts, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opts *Options) reloadOnStart() bool {
|
func (opts *Options) extractReloadOnStart() string {
|
||||||
// Not compatible with --filter
|
cmd := ""
|
||||||
if opts.Filter != nil {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if actions, prs := opts.Keymap[tui.Start.AsEvent()]; prs {
|
if actions, prs := opts.Keymap[tui.Start.AsEvent()]; prs {
|
||||||
|
filtered := []*action{}
|
||||||
for _, action := range actions {
|
for _, action := range actions {
|
||||||
if action.t == actReload || action.t == actReloadSync {
|
if action.t == actReload || action.t == actReloadSync {
|
||||||
return true
|
cmd = action.a
|
||||||
|
} else {
|
||||||
|
filtered = append(filtered, action)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
opts.Keymap[tui.Start.AsEvent()] = filtered
|
||||||
}
|
}
|
||||||
return false
|
return cmd
|
||||||
}
|
}
|
||||||
|
@@ -111,18 +111,19 @@ func (r *Reader) readChannel(inputChan chan string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ReadSource reads data from the default command or from standard input
|
// ReadSource reads data from the default command or from standard input
|
||||||
func (r *Reader) ReadSource(inputChan chan string, root string, opts walkerOpts, ignores []string) {
|
func (r *Reader) ReadSource(inputChan chan string, root string, opts walkerOpts, ignores []string, initCmd string, initEnv []string) {
|
||||||
r.startEventPoller()
|
r.startEventPoller()
|
||||||
var success bool
|
var success bool
|
||||||
if inputChan != nil {
|
if inputChan != nil {
|
||||||
success = r.readChannel(inputChan)
|
success = r.readChannel(inputChan)
|
||||||
|
} else if len(initCmd) > 0 {
|
||||||
|
success = r.readFromCommand(initCmd, initEnv)
|
||||||
} else if util.IsTty(os.Stdin) {
|
} else if util.IsTty(os.Stdin) {
|
||||||
cmd := os.Getenv("FZF_DEFAULT_COMMAND")
|
cmd := os.Getenv("FZF_DEFAULT_COMMAND")
|
||||||
if len(cmd) == 0 {
|
if len(cmd) == 0 {
|
||||||
success = r.readFiles(root, opts, ignores)
|
success = r.readFiles(root, opts, ignores)
|
||||||
} else {
|
} else {
|
||||||
// We can't export FZF_* environment variables to the default command
|
success = r.readFromCommand(cmd, initEnv)
|
||||||
success = r.readFromCommand(cmd, nil)
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
success = r.readFromStdin()
|
success = r.readFromStdin()
|
||||||
|
@@ -728,7 +728,7 @@ func NewTerminal(opts *Options, eventBox *util.EventBox, executor *util.Executor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if fullscreen {
|
if fullscreen {
|
||||||
if !tui.IsLightRendererSupported() {
|
if tui.HasFullscreenRenderer() {
|
||||||
renderer = tui.NewFullscreenRenderer(opts.Theme, opts.Black, opts.Mouse)
|
renderer = tui.NewFullscreenRenderer(opts.Theme, opts.Black, opts.Mouse)
|
||||||
} else {
|
} else {
|
||||||
renderer, err = tui.NewLightRenderer(ttyin, opts.Theme, opts.Black, opts.Mouse, opts.Tabstop, opts.ClearOnExit,
|
renderer, err = tui.NewLightRenderer(ttyin, opts.Theme, opts.Black, opts.Mouse, opts.Tabstop, opts.ClearOnExit,
|
||||||
@@ -2275,6 +2275,7 @@ func (t *Terminal) printHighlighted(result Result, colBase tui.ColorPair, colMat
|
|||||||
|
|
||||||
finalLineNum := lineNum
|
finalLineNum := lineNum
|
||||||
topCutoff := false
|
topCutoff := false
|
||||||
|
skipLines := 0
|
||||||
wrapped := false
|
wrapped := false
|
||||||
if t.multiLine || t.wrap {
|
if t.multiLine || t.wrap {
|
||||||
// Cut off the upper lines in the 'default' layout
|
// Cut off the upper lines in the 'default' layout
|
||||||
@@ -2287,7 +2288,7 @@ func (t *Terminal) printHighlighted(result Result, colBase tui.ColorPair, colMat
|
|||||||
wrapped = true
|
wrapped = true
|
||||||
}
|
}
|
||||||
|
|
||||||
lines = lines[len(lines)-maxLines:]
|
skipLines = len(lines) - maxLines
|
||||||
topCutoff = true
|
topCutoff = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2323,6 +2324,10 @@ func (t *Terminal) printHighlighted(result Result, colBase tui.ColorPair, colMat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
from += len(line)
|
from += len(line)
|
||||||
|
if lineOffset < skipLines {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
actualLineOffset := lineOffset - skipLines
|
||||||
|
|
||||||
var maxe int
|
var maxe int
|
||||||
for _, offset := range offsets {
|
for _, offset := range offsets {
|
||||||
@@ -2333,7 +2338,7 @@ func (t *Terminal) printHighlighted(result Result, colBase tui.ColorPair, colMat
|
|||||||
|
|
||||||
actualLineNum := lineNum
|
actualLineNum := lineNum
|
||||||
if t.layout == layoutDefault {
|
if t.layout == layoutDefault {
|
||||||
actualLineNum = (lineNum - lineOffset) + (numItemLines - lineOffset) - 1
|
actualLineNum = (lineNum - actualLineOffset) + (numItemLines - actualLineOffset) - 1
|
||||||
}
|
}
|
||||||
t.move(actualLineNum, 0, forceRedraw)
|
t.move(actualLineNum, 0, forceRedraw)
|
||||||
|
|
||||||
@@ -2348,13 +2353,13 @@ func (t *Terminal) printHighlighted(result Result, colBase tui.ColorPair, colMat
|
|||||||
marker = markerTop
|
marker = markerTop
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if lineOffset == 0 { // First line
|
if actualLineOffset == 0 { // First line
|
||||||
if topCutoff {
|
if topCutoff {
|
||||||
marker = markerMiddle
|
marker = markerMiddle
|
||||||
} else {
|
} else {
|
||||||
marker = markerTop
|
marker = markerTop
|
||||||
}
|
}
|
||||||
} else if lineOffset == numItemLines-1 { // Last line
|
} else if actualLineOffset == numItemLines-1 { // Last line
|
||||||
if topCutoff || !overflow {
|
if topCutoff || !overflow {
|
||||||
marker = markerBottom
|
marker = markerBottom
|
||||||
} else {
|
} else {
|
||||||
@@ -2941,6 +2946,10 @@ type replacePlaceholderParams struct {
|
|||||||
executor *util.Executor
|
executor *util.Executor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t *Terminal) replacePlaceholderInInitialCommand(template string) (string, []string) {
|
||||||
|
return t.replacePlaceholder(template, false, string(t.input), []*Item{nil, nil})
|
||||||
|
}
|
||||||
|
|
||||||
func (t *Terminal) replacePlaceholder(template string, forcePlus bool, input string, list []*Item) (string, []string) {
|
func (t *Terminal) replacePlaceholder(template string, forcePlus bool, input string, list []*Item) (string, []string) {
|
||||||
return replacePlaceholder(replacePlaceholderParams{
|
return replacePlaceholder(replacePlaceholderParams{
|
||||||
template: template,
|
template: template,
|
||||||
|
Reference in New Issue
Block a user