Files
hanzo.vim/test/vim/test_preview.vader
w0rp 41603564b7 Add :NeuralExplain
Add a new command for visual mode to explain the highlighted lines of
text. Explanations will be printed to a preview window.
2023-09-22 01:08:44 +01:00

25 lines
557 B
Plaintext

After:
unlet! g:preview_data
Execute(Preview windows should be opened correctly):
call neural#preview#Show(['a', 'b'], {'stay_here': 1})
wincmd p
let g:preview_data = {
\ 'lines': getline(1, '$'),
\ 'filetype': &filetype,
\ 'modifiable': &modifiable,
\ 'readonly': &readonly,
\}
:q
" Assert values only after closing the preview window.
" Otherwise the window will remain open.
AssertEqual
\ {
\ 'lines': ['a', 'b'],
\ 'filetype': 'neural-preview',
\ 'modifiable': 0,
\ 'readonly': 1,
\ },
\ g:preview_data