Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fzf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
fzf
Commits
446df07b
Unverified
Commit
446df07b
authored
5 years ago
by
Junegunn Choi
Browse files
Options
Downloads
Patches
Plain Diff
[vim] Border style for popup window (rounded | sharp | horizontal)
parent
8583b150
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README-VIM.md
+2
-2
2 additions, 2 deletions
README-VIM.md
doc/fzf.txt
+2
-2
2 additions, 2 deletions
doc/fzf.txt
plugin/fzf.vim
+21
-8
21 additions, 8 deletions
plugin/fzf.vim
with
25 additions
and
12 deletions
README-VIM.md
+
2
−
2
View file @
446df07b
...
...
@@ -204,7 +204,7 @@ following options are allowed:
-
`yoffset`
[float default 0.5 range [0 ~ 1]]
-
`xoffset`
[float default 0.5 range [0 ~ 1]]
-
`highlight`
[string default
`'Comment'`
]: Highlight group for border
-
`
roun
de
d
`
[
boolean
default
`
v:true`
]: Use rounded border
-
`
bor
de
r
`
[
string
default
`
rounded`
]: Border style (
`rounded`
|
`sharp`
|
`horizontal`
)
`fzf#wrap`
----------
...
...
@@ -300,7 +300,7 @@ The latest versions of Vim and Neovim include builtin terminal emulator
" - xoffset [float default 0.0 range [0 ~ 1]]
" - yoffset [float default 0.0 range [0 ~ 1]]
" - highlight [string default 'Comment']: Highlight group for border
" -
roun
de
d
[
boolean
default
v:true]: Use rounded border
" -
bor
de
r
[
string
default
'rounded']: Border style ('rounded' | 'sharp' | 'horizontal')
let
g:fzf_layout
=
{
'window'
:
{
'width'
:
0
.
9
,
'height'
:
0
.
6
}
}
```
...
...
This diff is collapsed.
Click to expand it.
doc/fzf.txt
+
2
−
2
View file @
446df07b
...
...
@@ -223,7 +223,7 @@ following options are allowed:
- `xoffset` [float default 0.0 range [0 ~ 1]]
- `yoffset` [float default 0.0 range [0 ~ 1]]
- `highlight` [string default `'Comment'`]: Highlight group for border
- `
roun
de
d
` [
boolean
default `
v:true`]: Use rounded border
- `
bor
de
r
` [
string
default `
rounded`]: Border style (`rounded` | `sharp` | `horizontal`)
FZF#WRAP
...
...
@@ -315,7 +315,7 @@ Starting fzf in a popup window~
" - xoffset [float default 0.5 range [0 ~ 1]]
" - yoffset [float default 0.5 range [0 ~ 1]]
" - highlight [string default 'Comment']: Highlight group for border
" -
roun
de
d
[
boolean
default
v:true]: Use rounded border
" -
bor
de
r
[
string
default
'rounded']: Border style ('rounded' | 'sharp' | 'horizontal')
let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } }
<
...
...
This diff is collapsed.
Click to expand it.
plugin/fzf.vim
+
21
−
8
View file @
446df07b
...
...
@@ -854,20 +854,33 @@ function! s:popup(opts) abort
let
row
+=
!
has
(
'nvim'
)
let
col
+=
!
has
(
'nvim'
)
" Border
let
edges
=
get
(
a:opts
,
'rounded'
,
1
)
?
[
'╭'
,
'╮'
,
'╰'
,
'╯'
]
:
[
'┌'
,
'┐'
,
'└'
,
'┘'
]
let
bar
=
repeat
(
'─'
,
width
-
2
)
let
top
=
edges
[
0
]
..
bar
..
edges
[
1
]
let
mid
=
'│'
..
repeat
(
' '
,
width
-
2
)
..
'│'
let
bot
=
edges
[
2
]
..
bar
..
edges
[
3
]
let
border
=
[
top
]
+
repeat
([
mid
],
height
-
2
)
+
[
bot
]
" Border style
let
style
=
get
(
a:opts
,
'border'
,
'rounded'
)
if
!
has_key
(
a:opts
,
'border'
)
&&
!
get
(
a:opts
,
'rounded'
,
1
)
let
style
=
'sharp'
endif
if
style
==
'horizontal'
let
hor
=
repeat
(
'─'
,
width
)
let
mid
=
repeat
(
' '
,
width
)
let
border
=
[
hor
]
+
repeat
([
mid
],
height
-
2
)
+
[
hor
]
let
margin
=
0
else
let
edges
=
style
==
'sharp'
?
[
'┌'
,
'┐'
,
'└'
,
'┘'
]
:
[
'╭'
,
'╮'
,
'╰'
,
'╯'
]
let
bar
=
repeat
(
'─'
,
width
-
2
)
let
top
=
edges
[
0
]
..
bar
..
edges
[
1
]
let
mid
=
'│'
..
repeat
(
' '
,
width
-
2
)
..
'│'
let
bot
=
edges
[
2
]
..
bar
..
edges
[
3
]
let
border
=
[
top
]
+
repeat
([
mid
],
height
-
2
)
+
[
bot
]
let
margin
=
2
endif
let
highlight
=
get
(
a:opts
,
'highlight'
,
'Comment'
)
let
frame
=
s:create_popup
(
highlight
,
{
\
'row'
:
row
,
'col'
:
col
,
'width'
:
width
,
'height'
:
height
,
'border'
:
border
\
})
call
s:create_popup
(
'Normal'
,
{
\
'row'
:
row
+
1
,
'col'
:
col
+
2
,
'width'
:
width
-
4
,
'height'
:
height
-
2
\
'row'
:
row
+
1
,
'col'
:
col
+
margin
,
'width'
:
width
-
margin *
2
,
'height'
:
height
-
2
\
})
if
has
(
'nvim'
)
execute
'autocmd BufWipeout <buffer> bwipeout '
..
frame
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment