Skip to content

Commit

Permalink
feat: Add ElinCycleFunctionAndTest command for vim
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidz committed Nov 16, 2024
1 parent fe43a55 commit c0ee9fb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions doc/elin-mapping.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ ElinCycleSourceAndTest
Calls `elin.handler.navigate/cycle-source-and-test` handler.
Key is mapped to |<Plug>(elin_cycle_source_and_test)|.

*ElinCycleFunctionAndTest*
ElinCycleFunctionAndTest
Calls `elin.handler.navigate/cycle-function-and-test` handler.
Key is mapped to |<Plug>(elin_cycle_function_and_test)|.

*ElinToggleInfoBuffer*
ElinToggleInfoBuffer
Calls `elin#internal#buffer#info#toggle()`.
Expand Down Expand Up @@ -338,6 +343,10 @@ MAPPINGS *elin-mappings*
<Plug>(elin_cycle_source_and_test)
Same as |ElinCycleSourceAndTest|.

*<Plug>(elin_cycle_function_and_test)*
<Plug>(elin_cycle_function_and_test)
Same as |ElinCycleFunctionAndTest|.

*<Plug>(elin_toggle_info_buffer)*
<Plug>(elin_toggle_info_buffer)
Same as |ElinToggleInfoBuffer|.
Expand Down Expand Up @@ -385,6 +394,7 @@ n <Leader>tn <Plug>(elin_test_in_ns)
n <Leader>tl <Plug>(elin_test_last)
n <Leader>tr <Plug>(elin_test_last_failed)
n tt <Plug>(elin_cycle_source_and_test)
n TT <Plug>(elin_cycle_function_and_test)
n <Leader>ss <Plug>(elin_toggle_info_buffer)
n <Leader>sl <Plug>(elin_clear_info_buffer)
n <Leader><Esc> <Plug>(elin_clear_virtual_texts)
Expand Down
3 changes: 3 additions & 0 deletions plugin/elin.vim
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ command! ElinTestInNs call elin#notify('elin.handler.test/run-tests-in-ns', [])
command! ElinTestLast call elin#notify('elin.handler.test/rerun-last-tests', [])
command! ElinTestLastFailed call elin#notify('elin.handler.test/rerun-last-failed-tests', [])
command! ElinCycleSourceAndTest call elin#notify('elin.handler.navigate/cycle-source-and-test', [])
command! ElinCycleFunctionAndTest call elin#notify('elin.handler.navigate/cycle-function-and-test', [])

" Misc
command! ElinToggleInfoBuffer call elin#internal#buffer#info#toggle()
Expand Down Expand Up @@ -189,6 +190,7 @@ nnoremap <silent> <Plug>(elin_test_in_ns) <Cmd>ElinTestInNs<CR>
nnoremap <silent> <Plug>(elin_test_last) <Cmd>ElinTestLast<CR>
nnoremap <silent> <Plug>(elin_test_last_failed) <Cmd>ElinTestLastFailed<CR>
nnoremap <silent> <Plug>(elin_cycle_source_and_test) <Cmd>ElinCycleSourceAndTest<CR>
nnoremap <silent> <Plug>(elin_cycle_function_and_test) <Cmd>ElinCycleFunctionAndTest<CR>
" Misc
nnoremap <silent> <Plug>(elin_toggle_info_buffer) <Cmd>ElinToggleInfoBuffer<CR>
Expand Down Expand Up @@ -269,6 +271,7 @@ function! s:default_key_mappings() abort
call s:define_mapping('nmap', '<Leader>tl', '<Plug>(elin_test_last)')
call s:define_mapping('nmap', '<Leader>tr', '<Plug>(elin_test_last_failed)')
call s:define_mapping('nmap', 'tt', '<Plug>(elin_cycle_source_and_test)')
call s:define_mapping('nmap', 'TT', '<Plug>(elin_cycle_function_and_test)')

" Misc
call s:define_mapping('nmap', '<Leader>ss', '<Plug>(elin_toggle_info_buffer)')
Expand Down

0 comments on commit c0ee9fb

Please sign in to comment.