Skip to content

Commit 25f3d4b

Browse files
committed
SignifyHunkDiff: use full window width
1 parent 7ca8e00 commit 25f3d4b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

autoload/sy/util.vim

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,18 @@ function! sy#util#popup_create(hunkdiff) abort
138138
let height += scroll
139139
endif
140140

141+
let padding = repeat(' ', offset - 1)
142+
141143
if exists('*nvim_open_win')
142144
call sy#util#popup_close()
143145
let buf = nvim_create_buf(0, 1)
144146
call nvim_buf_set_option(buf, 'syntax', 'diff')
145-
call nvim_buf_set_lines(buf, 0, -1, 0, a:hunkdiff)
147+
call nvim_buf_set_lines(buf, 0, -1, 0, map(a:hunkdiff, 'v:val[0].padding.v:val[1:]'))
146148
let s:popup_window = nvim_open_win(buf, v:false, {
147149
\ 'relative': 'win',
148150
\ 'row': winline,
149-
\ 'col': offset - 1,
150-
\ 'width': winwidth('%') - offset + 1,
151+
\ 'col': 0,
152+
\ 'width': winwidth('%'),
151153
\ 'height': height,
152154
\ })
153155
call nvim_win_set_option(s:popup_window, 'cursorline', v:false)
@@ -158,9 +160,9 @@ function! sy#util#popup_create(hunkdiff) abort
158160
call nvim_win_set_option(s:popup_window, 'wrap', v:true)
159161
autocmd CursorMoved * ++once call sy#util#popup_close()
160162
elseif exists('*popup_create')
161-
let s:popup_window = popup_create(a:hunkdiff, {
163+
let s:popup_window = popup_create(map(a:hunkdiff, 'v:val[0].padding.v:val[1:]'), {
162164
\ 'line': 'cursor+1',
163-
\ 'col': offset,
165+
\ 'col': 0,
164166
\ 'minwidth': winwidth('%'),
165167
\ 'maxheight': height,
166168
\ 'moved': 'any',

0 commit comments

Comments
 (0)