jarun / buku

:bookmark: Personal mini-web in text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add/Edit issues with gedit

mikeedjohn opened this issue · comments

Ubuntu 16.04.3
Gnome Shell
Python 2.7.12
GNOME Terminal 3.18.3, bash
Problem exists for 3.3.1, which is the current master.

Gedit as EDITOR seems to have problems when adding and editing existing bookmarks if an existing gedit window is open, for example in another workspace. As you probably know Gedit is the default editor on many Ubuntus.

Gedit

michael@Compaq-CQ58:$ buku -w -z
[DEBUG] Version 3.3.1
[DEBUG] Edited content written to /tmp/buku-edit-8gtaapna
Edit aborted
michael@Compaq-CQ58:
$

This opens the template, but as you can see control immediatey returns to the command prompt. If saved, the temporary file is left in tmp permanently. This is problematic because unless you notice/understand the error message the user may think the bookmark has been added.

michael@Compaq-CQ58:~$ buku -z -w 4
[DEBUG] Version 3.3.1
[DEBUG] Edited content written to /tmp/buku-edit-tsu9upue
[DEBUG] keywords: ['api,game library,graphics,graphics library,sdl,sdl2']
[DEBUG] parsed tags: [,api,game library,graphics,graphics library,sdl,sdl2,]
[DEBUG] query: "UPDATE bookmarks SET URL = ?, tags = ?, desc = ?, metadata = ? WHERE id = ?", args: ['https://www.libsdl.org', ',api,game library,graphics,graphics library,sdl,sdl2,', 'Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.', 'Simple DirectMedia Layer - Homepage', 4]
4. Simple DirectMedia Layer - Homepage

https://www.libsdl.org

  • Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.

api,game library,graphics,graphics library,sdl,sdl2

michael@Compaq-CQ58:~$

This opens the bookmark for editing in the editor, but control immediatey returns to the command prompt after giving no error message at all. Again if saved, the temporary file is left in tmp permanently. But no edit actually takes place.

Leafpad

So far this seems to be working okay in all respects.

I have not tested any other editors.

commented

I'll check this.

commented

LoL!!!

$ sudo apt install gedit
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  gedit-common gir1.2-gtksource-3.0 gir1.2-peas-1.0 gnome-user-guide libjavascriptcoregtk-4.0-18 libpeas-1.0-0 libpeas-1.0-0-python3loader libpeas-common libwebkit2gtk-4.0-37
  libwebkit2gtk-4.0-37-gtk2 libyelp0 yelp yelp-xsl zenity
Suggested packages:
  gedit-plugins
The following NEW packages will be installed:
  gedit gedit-common gir1.2-gtksource-3.0 gir1.2-peas-1.0 gnome-user-guide libjavascriptcoregtk-4.0-18 libpeas-1.0-0 libpeas-1.0-0-python3loader libpeas-common libwebkit2gtk-4.0-37
  libwebkit2gtk-4.0-37-gtk2 libyelp0 yelp yelp-xsl zenity
0 upgraded, 15 newly installed, 0 to remove and 0 not upgraded.
Need to get 22.9 MB of archives.
After this operation, 140 MB of additional disk space will be used.
Do you want to continue? [Y/n]

I remember I removed this bloatware on purpose.

commented

Try any of the following:

export EDITOR='gedit -w'
buku -w

or

buku -w 'gedit -w'
commented

I am going to document this.

Thanks, that fixes it.