mirror of
https://github.com/junegunn/fzf.git
synced 2025-05-19 04:40:22 -07:00
Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
4e3f9854e6 | ||
|
b27943423e | ||
|
894a1016bc | ||
|
efe6cddd34 | ||
|
f1c6bdf3e8 | ||
|
710659bcf5 | ||
|
be67775da4 | ||
|
2c6381499c | ||
|
4df842e78c | ||
|
b81696fb64 |
2
.github/workflows/linux.yml
vendored
2
.github/workflows/linux.yml
vendored
@ -1,5 +1,5 @@
|
||||
---
|
||||
name: Test fzf on Linux
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
|
33
SECURITY.md
Normal file
33
SECURITY.md
Normal file
@ -0,0 +1,33 @@
|
||||
# Security Reporting
|
||||
|
||||
If you wish to report a security vulnerability privately, we appreciate your diligence. Please follow the guidelines below to submit your report.
|
||||
|
||||
## Reporting
|
||||
|
||||
To report a security vulnerability, please provide the following information:
|
||||
|
||||
1. **PROJECT**
|
||||
- https://github.com/junegunn/fzf
|
||||
|
||||
2. **PUBLIC**
|
||||
- Indicate whether this vulnerability has already been publicly discussed or disclosed.
|
||||
- If so, provide relevant links.
|
||||
|
||||
3. **DESCRIPTION**
|
||||
- Provide a detailed description of the security vulnerability.
|
||||
- Include as much information as possible to help us understand and address the issue.
|
||||
|
||||
Send this information, along with any additional relevant details, to <junegunn.c AT gmail DOT com>.
|
||||
|
||||
## Confidentiality
|
||||
|
||||
We kindly ask you to keep the report confidential until a public announcement is made.
|
||||
|
||||
## Notes
|
||||
|
||||
- Vulnerabilities will be handled on a best-effort basis.
|
||||
- You may request an advance copy of the patched release, but we cannot guarantee early access before the public release.
|
||||
- You will be notified via email simultaneously with the public announcement.
|
||||
- We will respond within a few weeks to confirm whether your report has been accepted or rejected.
|
||||
|
||||
Thank you for helping to improve the security of our project!
|
@ -553,8 +553,15 @@ try
|
||||
let height = s:calc_size(&lines, dict.down, dict)
|
||||
let optstr .= ' --no-tmux --height='.height
|
||||
endif
|
||||
|
||||
if exists('&winborder') && &winborder !=# '' && &winborder !=# 'none'
|
||||
" Add 1-column horizontal margin
|
||||
let optstr = join(['--margin 0,1', optstr])
|
||||
else
|
||||
" Respect --border option given in $FZF_DEFAULT_OPTS and 'options'
|
||||
let optstr = join([s:border_opt(get(dict, 'window', 0)), s:extract_option($FZF_DEFAULT_OPTS, 'border'), optstr])
|
||||
endif
|
||||
|
||||
let command = prefix.(use_tmux ? s:fzf_tmux(dict) : fzf_exec).' '.optstr.' > '.temps.result
|
||||
|
||||
if use_term
|
||||
|
@ -31,9 +31,6 @@ if [[ $- =~ i ]]; then
|
||||
|
||||
###########################################################
|
||||
|
||||
# To redraw line after fzf closes (printf '\e[5n')
|
||||
bind '"\e[0n": redraw-current-line' 2> /dev/null
|
||||
|
||||
__fzf_defaults() {
|
||||
# $1: Prepend to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS
|
||||
# $2: Append to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS
|
||||
@ -328,6 +325,8 @@ __fzf_generic_path_completion() {
|
||||
else
|
||||
COMPREPLY=( "$cur" )
|
||||
fi
|
||||
# To redraw line after fzf closes (printf '\e[5n')
|
||||
bind '"\e[0n": redraw-current-line' 2> /dev/null
|
||||
printf '\e[5n'
|
||||
return 0
|
||||
fi
|
||||
@ -384,6 +383,7 @@ _fzf_complete() {
|
||||
else
|
||||
COMPREPLY=("$cur")
|
||||
fi
|
||||
bind '"\e[0n": redraw-current-line' 2> /dev/null
|
||||
printf '\e[5n'
|
||||
return 0
|
||||
else
|
||||
|
@ -1235,9 +1235,14 @@ func (t *Terminal) ansiLabelPrinter(str string, color *tui.ColorPair, fill bool)
|
||||
return nil, 0
|
||||
}
|
||||
printFn := func(window tui.Window, limit int) {
|
||||
if length > limit {
|
||||
trimmedRunes, _ := t.trimRight(runes, limit)
|
||||
window.CPrint(*color, string(trimmedRunes))
|
||||
ellipsis := []rune{}
|
||||
ellipsisWidth := 0
|
||||
if !fill {
|
||||
ellipsis, ellipsisWidth = util.Truncate(t.ellipsis, limit)
|
||||
}
|
||||
if length > limit-ellipsisWidth {
|
||||
trimmedRunes, _ := t.trimRight(runes, limit-ellipsisWidth)
|
||||
window.CPrint(*color, string(trimmedRunes)+string(ellipsis))
|
||||
} else if fill {
|
||||
window.CPrint(*color, util.RepeatToFill(text, length, limit))
|
||||
} else {
|
||||
|
@ -1859,9 +1859,9 @@ class TestCore < TestInteractive
|
||||
line = nil
|
||||
tmux.until { |lines| line = lines.index('> 1') }
|
||||
tmux.send_keys :PgDn
|
||||
tmux.until { |lines| assert_includes lines[line + 4], "> 5" }
|
||||
tmux.until { |lines| assert_includes lines[line + 4], '> 5' }
|
||||
tmux.send_keys :Space
|
||||
tmux.until { |lines| assert_includes lines[line + 2], "> 5" }
|
||||
tmux.until { |lines| assert_includes lines[line + 2], '> 5' }
|
||||
end
|
||||
|
||||
def test_no_input_query
|
||||
|
@ -992,6 +992,36 @@ class TestLayout < TestInteractive
|
||||
tmux.until { assert_block(block, it) }
|
||||
end
|
||||
|
||||
def test_label_trunction
|
||||
command = <<~CMD
|
||||
seq 10 | #{FZF} --style full --border --header-lines=1 --preview ':' \\
|
||||
--border-label "#{'b' * 1000}" \\
|
||||
--preview-label "#{'p' * 1000}" \\
|
||||
--header-label "#{'h' * 1000}" \\
|
||||
--header-label "#{'h' * 1000}" \\
|
||||
--input-label "#{'i' * 1000}" \\
|
||||
--list-label "#{'l' * 1000}"
|
||||
CMD
|
||||
writelines(command.lines.map(&:chomp))
|
||||
tmux.send_keys("sh #{tempname}", :Enter)
|
||||
tmux.until do |lines|
|
||||
text = lines.join
|
||||
assert_includes text, 'b··'
|
||||
assert_includes text, 'l··p'
|
||||
assert_includes text, 'p··'
|
||||
assert_includes text, 'h··'
|
||||
assert_includes text, 'i··'
|
||||
end
|
||||
end
|
||||
|
||||
def test_separator_no_ellipsis
|
||||
tmux.send_keys %(seq 10 | #{FZF} --separator "$(seq 1000 | tr '\\n' ' ')"), :Enter
|
||||
tmux.until do |lines|
|
||||
assert_equal 10, lines.match_count
|
||||
refute_includes lines.join, '··'
|
||||
end
|
||||
end
|
||||
|
||||
def test_header_border_no_pointer_and_marker
|
||||
tmux.send_keys %(seq 10 | #{FZF} --header-lines 1 --header-border sharp --no-list-border --pointer '' --marker ''), :Enter
|
||||
block = <<~BLOCK
|
||||
|
Loading…
x
Reference in New Issue
Block a user