diff options
author | Teddy Wing | 2023-12-07 22:24:36 +0100 |
---|---|---|
committer | Teddy Wing | 2023-12-07 22:40:23 +0100 |
commit | fbc9060f8aa60132c3562ff01b79c48686122f51 (patch) | |
tree | 6d959b099fca0f886aa50d46f714055aca6de21b | |
parent | 96d7056b5cac4c510e44783c2af7b1f50fd3ea00 (diff) | |
download | dotvim-fbc9060f8aa60132c3562ff01b79c48686122f51.tar.bz2 |
prr-ui: Comment: Exit early when Prr buffer doesn't exist
If `PrrStart` hasn't been run yet, we should error and stop execution so
we don't insert newlines and start insert mode in the current buffer.
Eventually, we should set it up so `PrrStart` is called automatically
from `PrrComment` if it hasn't been already.
-rw-r--r-- | bundle/prr-ui/autoload/prr_ui.vim | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bundle/prr-ui/autoload/prr_ui.vim b/bundle/prr-ui/autoload/prr_ui.vim index f3a6ea7..1d3246a 100644 --- a/bundle/prr-ui/autoload/prr_ui.vim +++ b/bundle/prr-ui/autoload/prr_ui.vim @@ -866,8 +866,14 @@ endfunction function! prr_ui#Comment() let current_line = getline('.') - " Open the existing Prr review file in a new split. - sbuffer prr + 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 + endtry call search(current_line) |