diff options
| author | Teddy Wing | 2023-12-06 00:03:57 +0100 | 
|---|---|---|
| committer | Teddy Wing | 2023-12-06 00:51:47 +0100 | 
| commit | 086d3d3649a34db36180769efb210f6945770f83 (patch) | |
| tree | 644d7eadb5cfef0f2e9197f4a15677c4000a5660 | |
| parent | 0a2e1a11da108edb13d057feb4ccdfdf20a9fe80 (diff) | |
| download | dotvim-086d3d3649a34db36180769efb210f6945770f83.tar.bz2 | |
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.
| -rw-r--r-- | bundle/prr-ui/autoload/prr_ui.vim | 10 | 
1 files changed, 10 insertions, 0 deletions
| 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 | 
