Add a way to clear build errors when hiding results window
This commit is contained in:
parent
bcc21781b0
commit
eb9c12b09f
33
vimrc
33
vimrc
|
@ -241,7 +241,11 @@ map <leader>rn :sp ~/.work-files/dive-networks/files/notes/refactoring-notes.md<
|
||||||
let g:airline_section_error = airline#section#create_right(['%{g:asyncrun_status}'])
|
let g:airline_section_error = airline#section#create_right(['%{g:asyncrun_status}'])
|
||||||
|
|
||||||
" Display error highlighting in source after running GCC with AsyncRun
|
" Display error highlighting in source after running GCC with AsyncRun
|
||||||
|
" NOTE: error results can be cleared with <leader>cr or by hiding the build
|
||||||
|
" result window.
|
||||||
let g:asyncrun_auto = "make"
|
let g:asyncrun_auto = "make"
|
||||||
|
let errormarker_errortext = "E"
|
||||||
|
let errormarker_warningtext = "W"
|
||||||
|
|
||||||
" Thanks to https://forums.handmadehero.org/index.php/forum?view=topic&catid=4&id=704#3982
|
" Thanks to https://forums.handmadehero.org/index.php/forum?view=topic&catid=4&id=704#3982
|
||||||
" for the error message formats
|
" for the error message formats
|
||||||
|
@ -252,26 +256,37 @@ set errorformat+=\\\ %#%f(%l)\ :\ %#%t%[A-z]%#\ %m
|
||||||
" Microsoft HLSL compiler: fxc.exe
|
" Microsoft HLSL compiler: fxc.exe
|
||||||
set errorformat+=\\\ %#%f(%l\\\,%c-%*[0-9]):\ %#%t%[A-z]%#\ %m
|
set errorformat+=\\\ %#%f(%l\\\,%c-%*[0-9]):\ %#%t%[A-z]%#\ %m
|
||||||
|
|
||||||
function! ToggleAsyncRunWindow()
|
let g:build_window_size = 12 " in rows
|
||||||
call asyncrun#quickfix_toggle(8)
|
|
||||||
|
function! HideBuildResultsAndClearErrors()
|
||||||
|
RemoveErrorMarkers
|
||||||
|
call asyncrun#quickfix_toggle(g:build_window_size, 0)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! StopTaskAndToggleWindow()
|
function! ToggleBuildResults()
|
||||||
|
call asyncrun#quickfix_toggle(g:build_window_size)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! StopRunTask()
|
||||||
AsyncStop
|
AsyncStop
|
||||||
call ToggleAsyncRunWindow()
|
call asyncrun#quickfix_toggle(g:build_window_size, 0)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ExecuteRunScript()
|
function! ExecuteRunScript()
|
||||||
exec "AsyncRun! -post=call\\ StopTaskAndToggleWindow() ./run"
|
exec "AsyncRun! -post=call\\ StopRunTask() ./run"
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Show results window the moment the async job starts
|
" Show results window the moment the async job starts
|
||||||
augroup vimrc
|
augroup vimrc
|
||||||
autocmd User AsyncRunStart call asyncrun#quickfix_toggle(8, 1)
|
autocmd User AsyncRunStart call asyncrun#quickfix_toggle(g:build_window_size, 1)
|
||||||
augroup END
|
augroup END
|
||||||
" Toggle AsyncRun window
|
|
||||||
noremap <F9> :call ToggleAsyncRunWindow()<cr>
|
" Toggle build results
|
||||||
nnoremap <leader>bb :call ToggleAsyncRunWindow()<cr>
|
noremap <F9> :call ToggleBuildResults()<cr>
|
||||||
|
nnoremap <leader>bb :call ToggleBuildResults()<cr>
|
||||||
|
|
||||||
|
" Hide build results and clear errors
|
||||||
|
noremap <F10> :call HideBuildResultsAndClearErrors()<cr>
|
||||||
|
|
||||||
" Execute build script
|
" Execute build script
|
||||||
nnoremap <leader>b :AsyncRun! -save=2 ./build*<cr>
|
nnoremap <leader>b :AsyncRun! -save=2 ./build*<cr>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user