@@ -111,11 +111,18 @@ function! s:winexists(winid) abort
111111endfunction
112112
113113function ! s: open_float (bufnr , config) abort
114+ let row = a: config .row + (a: config .anchor[0 ] == ' N' ? 1 : -1 )
115+ let col = a: config .col + (a: config .anchor[1 ] == ' W' ? 1 : -1 )
116+ if exists (' &winborder' ) && &winborder !=# ' ' && &winborder !=# ' none'
117+ let row = a: config .row
118+ let col = a: config .col
119+ end
120+
114121 let options = {
115122 \ ' relative' : ' editor' ,
116123 \ ' anchor' : a: config .anchor,
117- \ ' row' : a: config . row + ( a: config .anchor[ 0 ] == ' N ' ? 1 : -1 ) ,
118- \ ' col' : a: config . col + ( a: config .anchor[ 1 ] == ' W ' ? 1 : -1 ) ,
124+ \ ' row' : row,
125+ \ ' col' : col ,
119126 \ ' width' : a: config .width - 2 ,
120127 \ ' height' : a: config .height - 2 ,
121128 \ ' style' :' minimal' ,
@@ -124,20 +131,22 @@ function! s:open_float(bufnr, config) abort
124131 call s: init_win (winid, v: false )
125132 call floaterm#config#set (a: bufnr , ' winid' , winid)
126133
127- let bd_options = {
128- \ ' relative' : ' editor' ,
129- \ ' anchor' : a: config .anchor,
130- \ ' row' : a: config .row,
131- \ ' col' : a: config .col ,
132- \ ' width' : a: config .width,
133- \ ' height' : a: config .height,
134- \ ' focusable' : v: false ,
135- \ ' style' :' minimal' ,
136- \ }
137- let bd_bufnr = floaterm#buffer#create_border_buf (a: config )
138- let bd_winid = nvim_open_win (bd_bufnr, v: false , bd_options)
139- call s: init_win (bd_winid, v: true )
140- call floaterm#config#set (a: bufnr , ' borderwinid' , bd_winid)
134+ if ! (exists (' &winborder' ) && &winborder !=# ' ' && &winborder !=# ' none' )
135+ let bd_options = {
136+ \ ' relative' : ' editor' ,
137+ \ ' anchor' : a: config .anchor,
138+ \ ' row' : a: config .row,
139+ \ ' col' : a: config .col ,
140+ \ ' width' : a: config .width,
141+ \ ' height' : a: config .height,
142+ \ ' focusable' : v: false ,
143+ \ ' style' :' minimal' ,
144+ \ }
145+ let bd_bufnr = floaterm#buffer#create_border_buf (a: config )
146+ let bd_winid = nvim_open_win (bd_bufnr, v: false , bd_options)
147+ call s: init_win (bd_winid, v: true )
148+ call floaterm#config#set (a: bufnr , ' borderwinid' , bd_winid)
149+ end
141150 return winid
142151endfunction
143152
0 commit comments