diff --git a/plugin/vimania_uri_rs.vim b/plugin/vimania_uri_rs.vim index c27f460..8bc131b 100644 --- a/plugin/vimania_uri_rs.vim +++ b/plugin/vimania_uri_rs.vim @@ -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() diff --git a/pythonx/vimania_uri_/vim_/vimania_manager.py b/pythonx/vimania_uri_/vim_/vimania_manager.py index 2235168..5c54db1 100644 --- a/pythonx/vimania_uri_/vim_/vimania_manager.py +++ b/pythonx/vimania_uri_/vim_/vimania_manager.py @@ -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)