Skip to content

Commit

Permalink
Added global vim variable 'is_cppman_active', when using vim or nvim (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
obemu authored Dec 20, 2024
1 parent af8f0a5 commit ff8a77e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cppman/lib/pager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,22 @@ case $pager_type in
[ -z "$PAGER" ] && PAGER=less
render | $PAGER
;;
vim|nvim)

vim|nvim)
render | remove_escape 3<&- | {
$pager_type -R -c "let g:page_name=\"$page_name\"" -S $vim_config /dev/fd/3 </dev/tty
$pager_type \
--cmd "let g:is_cppman_active=1" \
-R \
-c "let g:page_name=\"$page_name\"" \
-S $vim_config \
/dev/fd/3 </dev/tty
} 3<&0
;;

less)
render | less -r
;;

pipe)
render | remove_escape
esac

0 comments on commit ff8a77e

Please sign in to comment.