Skip to content

Commit

Permalink
fixed: 0.5.0-dev compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
skywind3000 committed Jan 30, 2022
1 parent e3e19c9 commit ba0c485
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 24 deletions.
2 changes: 1 addition & 1 deletion autoload/quickui/context.vim
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ function! s:nvim_create_context(textlist, opts)
let opts.row = pos[0] - 1
let opts.col = pos[1] - 1
endif
if has('nvim-0.5.0')
if has('nvim-0.6.0')
let opts.noautocmd = 1
endif
let winid = nvim_open_win(bid, 0, opts)
Expand Down
4 changes: 2 additions & 2 deletions autoload/quickui/input.vim
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function! s:nvim_create_input(prompt, opts)
let opts.height = hwnd.h
let opts.row = hwnd.opts.row
let opts.col = hwnd.opts.col
if has('nvim-0.5.0')
if has('nvim-0.6.0')
let opts.noautocmd = 1
endif
let winid = nvim_open_win(hwnd.bid, 0, opts)
Expand All @@ -163,7 +163,7 @@ function! s:nvim_create_input(prompt, opts)
let op.row = hwnd.opts.row - 2
let op.col = hwnd.opts.col - 2
let bordercolor = hwnd.opts.bordercolor
if has('nvim-0.5.0')
if has('nvim-0.6.0')
let op.noautocmd = 1
endif
let background = nvim_open_win(nbid, 0, op)
Expand Down
4 changes: 2 additions & 2 deletions autoload/quickui/listbox.vim
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ function! s:nvim_create_listbox(textlist, opts)
let opts.row += 1
let opts.col += 1
endif
if has('nvim-0.5.0')
if has('nvim-0.6.0')
let opts.noautocmd = 1
endif
let winid = nvim_open_win(bid, 0, opts)
Expand All @@ -521,7 +521,7 @@ function! s:nvim_create_listbox(textlist, opts)
let op.row = opts.row - 1
let op.col = opts.col - 1
let bordercolor = get(a:opts, 'bordercolor', 'QuickBorder')
if has('nvim-0.5.0')
if has('nvim-0.6.0')
let op.noautocmd = 1
endif
let background = nvim_open_win(nbid, 0, op)
Expand Down
2 changes: 1 addition & 1 deletion autoload/quickui/menu.vim
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ function! quickui#menu#nvim_open_menu(opts)
let opts.row = 0
let opts.relative = 'editor'
let s:cmenu.bufnr = bid
if has('nvim-0.5.0')
if has('nvim-0.6.0')
let opts.noautocmd = 1
endif
let winid = nvim_open_win(bid, 0, opts)
Expand Down
4 changes: 2 additions & 2 deletions autoload/quickui/preview.vim
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function! quickui#preview#display(content, opts)
else
let bid = quickui#core#scratch_buffer('preview', source)
endif
if has('nvim-0.5.0')
if has('nvim-0.6.0')
let opts.noautocmd = 1
endif
let winid = nvim_open_win(bid, 0, opts)
Expand All @@ -144,7 +144,7 @@ function! quickui#preview#display(content, opts)
let op.row = pos.row - 1
let op.col = pos.col - 1
let bordercolor = get(a:opts, 'bordercolor', color)
if has('nvim-0.5.0')
if has('nvim-0.6.0')
let op.noautocmd = 1
endif
let background = nvim_open_win(nbid, 0, op)
Expand Down
4 changes: 2 additions & 2 deletions autoload/quickui/terminal.vim
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function! quickui#terminal#create(cmd, opts)
let opts.height = h
let opts.row = hwnd.opts.line - 1 + ((border > 0)? 1 : 0)
let opts.col = hwnd.opts.col - 1 + ((border > 0)? 1 : 0)
if has('nvim-0.5.0')
if has('nvim-0.6.0')
let opts.noautocmd = 1
endif
let winid = nvim_open_win(bid, 1, opts)
Expand All @@ -109,7 +109,7 @@ function! quickui#terminal#create(cmd, opts)
let pos = nvim_win_get_config(winid)
let op.row = hwnd.opts.line - 1
let op.col = hwnd.opts.col - 1
if has('nvim-0.5.0')
if has('nvim-0.6.0')
let op.noautocmd = 1
endif
let background = nvim_open_win(nbid, 0, op)
Expand Down
4 changes: 2 additions & 2 deletions autoload/quickui/textbox.vim
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function! s:nvim_create_textbox(textlist, opts)
let opts.row += 1
let opts.col += 1
endif
if has('nvim-0.5.0')
if has('nvim-0.6.0')
let opts.noautocmd = 1
endif
let winid = nvim_open_win(bid, 0, opts)
Expand All @@ -248,7 +248,7 @@ function! s:nvim_create_textbox(textlist, opts)
let op.row = pos.row - 1
let op.col = pos.col - 1
let bordercolor = get(a:opts, 'bordercolor', 'QuickBorder')
if has('nvim-0.5.0')
if has('nvim-0.6.0')
let op.noautocmd = 1
endif
let background = nvim_open_win(nbid, 0, op)
Expand Down
12 changes: 0 additions & 12 deletions autoload/quickui/utils.vim
Original file line number Diff line number Diff line change
Expand Up @@ -434,18 +434,6 @@ function! quickui#utils#get_cursor(winid)
endfunc


"----------------------------------------------------------------------
" first line to show in window.
"----------------------------------------------------------------------
function! quickui#utils#set_firstline(winid, line)
if g:quickui#core#has_nvim == 0
call popup_setoptions(a:winid, {'firstline': a:line})
else
call nvim_win_set_cursor(a:winid, [a:line, 0])
endif
endfunc


"----------------------------------------------------------------------
" get topline in current window
"----------------------------------------------------------------------
Expand Down

0 comments on commit ba0c485

Please sign in to comment.