mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-08 05:24:46 +08:00
Return floating_preview window id (#4828)
Make ale#floating_preview#Show more similar to popup_create and return the id of the window so it's easy to set the filetype of the resulting buffer. Update test stub version of Show() to return a win id (the current window since it's not actually creating a window). Test * both tests still pass
This commit is contained in:
@@ -21,6 +21,8 @@ function! ale#floating_preview#Show(lines, ...) abort
|
|||||||
else
|
else
|
||||||
call s:VimShow(a:lines, l:options)
|
call s:VimShow(a:lines, l:options)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
return w:preview.id
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:NvimShow(lines, options) abort
|
function! s:NvimShow(lines, options) abort
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ Before:
|
|||||||
function! ale#floating_preview#Show(lines, ...) abort
|
function! ale#floating_preview#Show(lines, ...) abort
|
||||||
let g:floating_preview_show_called = 1
|
let g:floating_preview_show_called = 1
|
||||||
let g:floated_lines = a:lines
|
let g:floated_lines = a:lines
|
||||||
|
return win_getid()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let g:ale_buffer_info = {
|
let g:ale_buffer_info = {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ Before:
|
|||||||
function! ale#floating_preview#Show(lines, ...) abort
|
function! ale#floating_preview#Show(lines, ...) abort
|
||||||
let g:floating_preview_show_called = 1
|
let g:floating_preview_show_called = 1
|
||||||
let g:floated_lines = a:lines
|
let g:floated_lines = a:lines
|
||||||
|
return win_getid()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale#lsp_linter#StartLSP(buffer, linter, callback) abort
|
function! ale#lsp_linter#StartLSP(buffer, linter, callback) abort
|
||||||
|
|||||||
Reference in New Issue
Block a user