All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 let g:ale_floating_preview = 0
3 let g:ale_hover_to_floating_preview = 0
4 let g:ale_detail_to_floating_preview = 0
6 runtime autoload/ale/floating_preview.vim
8 let g:floated_lines = []
9 let g:floating_preview_show_called = 0
11 " Stub out so we can track the call
12 function! ale#floating_preview#Show(lines, ...) abort
13 let g:floating_preview_show_called = 1
14 let g:floated_lines = a:lines
18 let g:ale_buffer_info = {
24 \ 'bufnr': bufnr('%'),
26 \ 'linter_name': 'notalinter',
30 \ 'text': "Missing semicolon.\r",
31 \ 'detail': "Every statement should end with a semicolon\nsecond line",
37 call ale#linter#Reset()
38 call ale#linter#PreventLoading('javascript')
43 let g:ale_floating_preview = 0
44 let g:ale_hover_to_floating_preview = 0
45 let g:ale_detail_to_floating_preview = 0
49 let g:ale_buffer_info = {}
51 " Close the preview window if it's open.
52 if &filetype is# 'ale-preview'
56 call ale#linter#Reset()
59 Given javascript(A file with warnings/errors):
61 var x = 5*2 + parseInt("10");
64 Execute(Floating preview is used with ALEDetail when g:ale_floating_preview set):
65 let g:ale_floating_preview = 1
71 let expected = ["Every statement should end with a semicolon", "second line"]
73 AssertEqual 1, g:floating_preview_show_called
74 AssertEqual expected, g:floated_lines
76 Execute(Floating preview is used with ALEDetail when g:ale_detail_to_floating_preview set):
77 let g:ale_detail_to_floating_preview = 1
83 let expected = ["Every statement should end with a semicolon", "second line"]
85 AssertEqual 1, g:floating_preview_show_called
86 AssertEqual expected, g:floated_lines
88 Execute(Floating preview is not used with ALEDetail by default):
93 AssertEqual 0, g:floating_preview_show_called