Skip to content

Commit

Permalink
fix: bkmr integration
Browse files Browse the repository at this point in the history
  • Loading branch information
sysid committed Aug 25, 2024
1 parent cd14737 commit 899222a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
18 changes: 11 additions & 7 deletions plugin/vimania_uri_rs.vim
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,17 @@ command! -nargs=0 VimaniaThrowError call VimaniaThrowError()

function! VimaniaDeleteTwbm(args)
call TwDebug(printf("Vimania args: %s", a:args))
" Prompt the user for confirmation
let l:confirmation = input("Delete also from bkmr database? (y/n): ")
if l:confirmation ==? 'y'
python3 xUriMgr.delete_twbm(vim.eval('a:args'))
echo "Bookmark deleted."
else
echo "Deletion canceled."

" Check if vimania URI twbm integration is enabled
if exists('g:vimania_uri_twbm_integration') && g:vimania_uri_twbm_integration == 1
" Prompt the user for confirmation
let l:confirmation = input("Delete also from bkmr database? (y/n): ")
if l:confirmation ==? 'y'
python3 xUriMgr.delete_twbm(vim.eval('a:args'))
echo "Bookmark deleted."
else
echo "Bookmark not deleted from bkmr."
endif
endif
endfunction
command! -nargs=1 VimaniaDeleteTwbm call VimaniaDeleteTwbm(<f-args>)
Expand Down
1 change: 1 addition & 0 deletions pythonx/vimania_uri_/vim_/vimania_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ def delete_twbm(self, args: str):
_log.debug(f"{args=}")
if not self.twbm_integrated:
_log.debug(f"twbm not integrated. Do nothing.")
return
assert isinstance(args, str), f"Error: input must be string, got {type(args)}."
try:
urls = delete_twbm(args)
Expand Down

0 comments on commit 899222a

Please sign in to comment.