From 086d3d3649a34db36180769efb210f6945770f83 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 6 Dec 2023 00:03:57 +0100 Subject: prr-ui: Implement `PrrComment` The idea is to open the Prr file at the line corresponding to the current line in the real source file. This makes it easy to comment on a line while looking at the source, rather than the diff. --- bundle/prr-ui/autoload/prr_ui.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bundle') diff --git a/bundle/prr-ui/autoload/prr_ui.vim b/bundle/prr-ui/autoload/prr_ui.vim index 8e35a50..341df3c 100644 --- a/bundle/prr-ui/autoload/prr_ui.vim +++ b/bundle/prr-ui/autoload/prr_ui.vim @@ -864,4 +864,14 @@ endfunction " Comment on the current line. function! prr_ui#Comment() + let current_line = getline('.') + + " Open the existing Prr review file in a new split. + sbuffer prr + + call search(current_line) + + " Put the cursor in place to add a comment on the line. + call append('.', ['', '', '']) + call cursor(line('.') + 2, 0) endfunction -- cgit v1.2.3