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:
David Briscoe 2024-10-19 08:13:50 -07:00 committed by GitHub
parent 2e5f135836
commit 0b4c665840
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,8 @@ function! ale#floating_preview#Show(lines, ...) abort
else
call s:VimShow(a:lines, l:options)
endif
return w:preview.id
endfunction
function! s:NvimShow(lines, options) abort

View File

@ -12,6 +12,7 @@ Before:
function! ale#floating_preview#Show(lines, ...) abort
let g:floating_preview_show_called = 1
let g:floated_lines = a:lines
return win_getid()
endfunction
let g:ale_buffer_info = {

View File

@ -25,6 +25,7 @@ Before:
function! ale#floating_preview#Show(lines, ...) abort
let g:floating_preview_show_called = 1
let g:floated_lines = a:lines
return win_getid()
endfunction
function! ale#lsp_linter#StartLSP(buffer, linter, callback) abort