Page 1 of 1

Trivial Leafpad bug

Posted: Tue 13 Sep 2005, 20:47
by PaulR
'Close' button in 'About' dialog doesn't work

(I told ya it was trivial!)

Puppy 1.04

Posted: Wed 14 Sep 2005, 19:11
by pakt
I've noticed another trivial but annoying bug in Leafpad. When editing a text file with the cursor at the start of a line: if I move the cursor up or down through the text and land on a empty line, the cursor jumps to the right side of the text window, ie, to the end of the empty line :?

Posted: Thu 15 Sep 2005, 02:15
by BarryK
pakt wrote:I've noticed another trivial but annoying bug in Leafpad. When editing a text file with the cursor at the start of a line: if I move the cursor up or down through the text and land on a empty line, the cursor jumps to the right side of the text window, ie, to the end of the empty line :?
er, that's a old fixed bug.

You must have XKBD support disabled when you start X. That causes the bug.
The bug should go away when I upgrade GTK, probably for 1.0.6.

Posted: Thu 15 Sep 2005, 17:38
by pakt
BarryK wrote:
pakt wrote:I've noticed another trivial but annoying bug in Leafpad. When editing a text file with the cursor at the start of a line: if I move the cursor up or down through the text and land on a empty line, the cursor jumps to the right side of the text window, ie, to the end of the empty line :?
er, that's a old fixed bug.

You must have XKBD support disabled when you start X. That causes the bug.
The bug should go away when I upgrade GTK, probably for 1.0.6.
Thanks for the info Barry, but when I searched the forum for 'the fix', I only found
BarryK wrote:Okay, it looks like for pup 1.0.5 I'll have to disable xkbd in /usr/X11R6/bin/xwin, using that "-kb" option.
And, apply the patch to the gtk source.
Is this how XKBD support is disabled?

Posted: Thu 15 Sep 2005, 22:36
by BarryK
Are you using a non-standard 1.0.5?
The X server has xkbd enabled, which should be fine.
If you are using a X server without xkbd support then there is a problem.
Or, if you disabled xkbd support at start of X then there is a problem -- you found something about -kb which is to do with that. The default xwin script should work.

Posted: Sat 17 Sep 2005, 12:52
by pakt
Took me a while to sort this out (been busy with other projects ;) ).

Got this rtl-bug when I run puppy104 rather unconventionally - indirectly through a VNC-client in Kanotix on my (infamous puppy-unfriendly) Dell laptop, and puppy running TightVNC server on an old clunker (only way to get puppy in high resolution on my laptop without using bladehunter's XFree-puppy104).

Now this may surprise you: I don't get the rtl-bug when use the old PC (the one I use as VNC-server, running puppy104) and run Leafpad. No problems. But the bug shows up when I use the VNC-client and run Leafpad... :!:

Update: Just finished downloading puppy105rc - Running it with JWM in the VNC-client gave the same symptoms as above...

A bug in leafpad loading pathnames with ':', and a fix

Posted: Mon 15 Aug 2016, 03:38
by miriam
If I have a directory name that contains ':' somewhere in the pathname then leafpad won't load the file.

I have a lot of audiobooks, mostly from Librivox. I like to collect multiple part audio files under a single directory and name the directory as the book name and the duration of all the audio files added together, for instance, I downloaded H G Wells' "The Time Machine" from Librivox ages ago (there are now 4 different readings of it on the site!!). The version I downloaded comprises 13 audio files so I put them in a folder which I named "Time Machine (reading - 13 parts) [3:20:19]" where the "3:20:19" is the cumulative duration of all the parts. (If anybody is interested in an easy way to calculate that I can post a simple script I wrote.)

So now if I have a text file in the same directory that contains information about the audio files (the download address, the name of the person reading it, and so on) and try to view or edit it in leafpad then it won't load. Leafpad simply opens empty as if I hadn't asked for a file. If I try to load it into geany it loads fine.

The way I use leafpad is from a RoxApp, so I put this code in the AppRun file inside the RoxApp:

Code: Select all

#!/bin/sh

# A bug in leafpad doesn't allow ":" in pathnames

# workaround by changing dir to where file is
cd "${@%/*}"

# then load the file from current dir
exec leafpad "${@##*/}"

The two weird filenames simply use bash's inbuilt string editing functions to snip off the filename (the final '/' and everything following it) leaving just the path for changing directory, and snipping off the path (everything up to and including the final '/') leaving just the filename to load the file from the current directory.

NOTE: this doesn't help if the filename itself contains the ':' character. In that case leafpad still won't load it.

Hope this helps someone else.

full fix

Posted: Mon 15 Aug 2016, 07:38
by miriam
I couldn't leave this alone.

The version of leafpad that I was using is Leafpad 0.8.17, which is the one that came with Slacko Puppy 6.3.2. However I just tried loading files with ':' in the pathname into a more recent version -- Leafpad 0.8.18.1, and it works fine.

So, compile version Leafpad 0.8.18.1 or later and you won't have to worry about this bug or using my workaround.

Re: A bug in leafpad loading pathnames with ':', and a fix

Posted: Mon 15 Aug 2016, 07:44
by phat7
miriam wrote:If I have a directory name that contains ':' somewhere in the pathname then leafpad won't load the file.
Knownbug. Was supposed to be fixed in 0.8.17-3. Where did you find 0.8.18.1?

Posted: Mon 15 Aug 2016, 09:03
by miriam
Thanks phat7. I searched for it but was unable to find it as a bug description.

The latest version of leafpad is at:
http://download.savannah.gnu.org/releases/leafpad/

leafpad-0.8.18.1.tar.gz is right near the bottom of the listing on that page.

Posted: Mon 15 Aug 2016, 10:42
by learnhow2code
fig os already has leafpad 0.8.18.1 -- even in puppy mode.

however you can add it to puppy with this line:

Code: Select all

wget http://http.us.debian.org/debian/pool/main/l/leafpad/leafpad_0.8.18.1-4_i386.deb ; dpkg-deb -x leafpad_0.8.18.1-4_i386.deb /
this assumes the other link requires compiling.

Posted: Mon 15 Aug 2016, 11:37
by miriam
Thanks learnhow2code.
Yes, the link I gave is to the source code, so needs to be compiled.