diff --git a/README.md b/README.md index d923074..5eccc60 100644 --- a/README.md +++ b/README.md @@ -376,8 +376,8 @@ Note that URL must precede tags. 4. Edit a bookmark in **editor and add**: $ buku -w - $ buku -w vim -a https://ddg.gg search engine, privacy -The second command will open vim with the URL and tags populated. + $ buku -w 'macvim -f' -a https://ddg.gg search engine, privacy +The second command will open macvim with option -f and the URL and tags populated. 5. **Update** existing bookmark at index 15012014 with new URL, tags and comments, fetch title from the web: $ buku -u 15012014 --url http://ddg.gg/ --tag web search, utilities -c Alternative search engine diff --git a/buku.1 b/buku.1 index 37e62ce..19a7ab0 100644 --- a/buku.1 +++ b/buku.1 @@ -320,11 +320,11 @@ Edit a bookmark in \fBeditor and add\R: .EX .IP .B buku -w -.B buku -w vim -a https://ddg.gg search engine, privacy +.B buku -w 'macvim -f' -a https://ddg.gg search engine, privacy .EE .PP .IP "" 4 -The second command will open vim with the URL and tags populated. +The second command will open macvim with option -f and the URL and tags populated. .IP 5. 4 \fBUpdate\fR existing bookmark at index 15012014 with new URL, tags and comments, fetch title from the web: .PP diff --git a/buku.py b/buku.py index 3296412..240f6a6 100755 --- a/buku.py +++ b/buku.py @@ -2302,14 +2302,20 @@ def edit_rec(editor, url, title_in, tags_in, desc): fp.flush() logdbg('Edited content written to %s', tmpfile) - subprocess.call([editor, tmpfile]) + cmd = editor.split(' ') + cmd.append(tmpfile) + subprocess.call(cmd) with open(tmpfile, 'r', encoding='utf-8') as f: content = f.read() os.remove(tmpfile) except FileNotFoundError: - logerr('Error opening editor or tempfile') + if os.path.exists(tmpfile): + os.remove(tmpfile) + logerr('Cannot open editor') + else: + logerr('Cannot open tempfile') return None parsed_content = parse_temp_file_content(content)