diff options
author | Teddy Wing | 2023-12-09 00:07:39 +0100 |
---|---|---|
committer | Teddy Wing | 2023-12-09 00:20:40 +0100 |
commit | d342a9fde06ca48e8a0ca6dc75859b9417410406 (patch) | |
tree | 780e3bfba7faac181bd96e6c96aff534a906580e | |
parent | 0e40dbd6cd88228127eaec0e50290236bf573644 (diff) | |
download | dotvim-d342a9fde06ca48e8a0ca6dc75859b9417410406.tar.bz2 |
prr-ui: Remove `s:active` variable
This variable isn't necessary. The same effect can be accomplished with
the try-catch.
-rw-r--r-- | bundle/prr-ui/autoload/prr_ui.vim | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/bundle/prr-ui/autoload/prr_ui.vim b/bundle/prr-ui/autoload/prr_ui.vim index 03d39f5..c4e2afa 100644 --- a/bundle/prr-ui/autoload/prr_ui.vim +++ b/bundle/prr-ui/autoload/prr_ui.vim @@ -863,12 +863,9 @@ endfunction let s:prr_path = '' -let s:active = 0 function! prr_ui#Start() let s:prr_path = system('prr-start --print') - let s:active = 1 - return s:prr_path endfunction @@ -881,27 +878,19 @@ function! prr_ui#Submit() update !prr-submit - - let s:active = 0 endfunction " Comment on the current line. function! prr_ui#Comment() - if !s:active - let prr_path = prr_ui#Start() - execute 'argadd ' . prr_path - endif - let current_line = getline('.') try " Open the existing Prr review file in a new split. sbuffer prr catch - " TODO: Run prr-start. - echoerr 'PrrComment: No Prr buffer available' - return + let prr_path = prr_ui#Start() + execute 'split ' . prr_path endtry call search(current_line) |