1212 let s: local_ses .= substitute (tempname (), ' /' , ' _' , ' g' )
1313endif
1414
15+ " nnn highlight groups
16+ if ! hlexists (' NnnBorder' )
17+ if hlexists (' FloatBorder' )
18+ highlight ! link NnnBorder FloatBorder
19+ else
20+ highlight ! link NnnBorder Comment
21+ endif
22+ endif
23+ if ! hlexists (' NnnNormal' )
24+ highlight ! link NnnNormal Normal
25+ endif
26+
1527function ! s: statusline ()
1628 setlocal statusline = % #StatusLineTerm #\ nnn\ % #StatusLineTermNC #
1729endfunction
@@ -115,8 +127,7 @@ function! s:popup(opts, term_opts)
115127 let col += ! has (' nvim' )
116128
117129 let l: border = get (a: opts , ' border' , ' rounded' )
118- let l: default_hl = hlexists (' FloatBorder' ) ? ' FloatBorder' : ' Comment'
119- let l: highlight = get (a: opts , ' highlight' , l: default_hl )
130+ let l: highlight = get (a: opts , ' highlight' , ' NnnBorder' )
120131
121132 if has (' nvim' )
122133 let l: borderchars = l: border == # ' none' ? ' none' : map (l: border == # ' rounded'
@@ -133,8 +144,7 @@ function! s:popup(opts, term_opts)
133144 \ ' relative' : ' editor' ,
134145 \ ' style' : ' minimal'
135146 \ })
136- call setwinvar (l: win , ' &winhighlight' , ' NormalFloat:Normal' )
137- call setwinvar (l: win , ' &colorcolumn' , ' ' )
147+ call setwinvar (l: win , ' &winhighlight' , ' NormalFloat:NnnNormal' )
138148 return { ' buf' : s: create_term_buf (a: term_opts ), ' winhandle' : l: win }
139149 else
140150 let l: buf = s: create_term_buf (extend (a: term_opts , #{ curwin: 0 , hidden : 1 }))
@@ -146,6 +156,7 @@ function! s:popup(opts, term_opts)
146156 \ col : col ,
147157 \ minwidth: width,
148158 \ minheight: height,
159+ \ highlight : ' NnnNormal' ,
149160 \ border: l: border == # ' none' ? [0 , 0 , 0 , 0 ] : [],
150161 \ borderhighlight: [l: highlight ],
151162 \ borderchars: l: borderchars ,
0 commit comments