Glitch? Tabbing within single quotes bumps trailing text.

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
blahblahmeh
Posts: 2
Joined: Wed Nov 23, 2016 7:12 pm

Glitch? Tabbing within single quotes bumps trailing text.

Post by blahblahmeh »

First, I'm a long time user and admirer of TextPad, since 4.4 anyway. I use it every day. Still wish it had some of the features I see bragged about in other software, but oh well... I like TextPad, and will likely stick with it until x128 hardware comes out, and it doesn't run on it any more. ;-)

I've noticed over the years an issue that I can find no reference to by searching in the forum (Forgive me if I didn't search well enough.)

The issue deals with tabbing inside/within single quotes, and is demonstrated with a screen capture/video here, using a new document: http://reliberate.com/textpad/tabissue.html Eventually this video link probably won't work, so I'll try to describe the problem for future generations still using TextPad...

Say you have some text like this...

Code: Select all

'tabbing inside single quotes' will bump this text instead
As described, placing your cursor anywhere inside/within the single quotes, then hitting the Tab key on the keyboard ends up bumping over (though, doesn't appear to be a full tab stop) the "will bump..." text. And, if you keep hitting tab, the cursor will eventually pass up the bumped text. It's strange, and even enabling Visible Spaces doesn't reveal any indication of what is actually happening.

I just updated to the latest 8.1.1 x64 release, and the problem still persists. I'm using Windows 8.1, running TextPad in portable mode. If anyone knows how I might fix this issue (if it's even possible), I'd greatly appreciate it, as it gets kind of annoying if you happen to forget about the glitch.

Thanks.
User avatar
AmigoJack
Posts: 499
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

Re: Glitch? Tabbing within single quotes bumps trailing text

Post by AmigoJack »

blahblahmeh wrote:http://reliberate.com/textpad/tabissue.html Eventually this video link probably won't work, so I'll try to describe the problem for future generations
That is no video link. Instead, it's an HTML site insisting that my internet browser does not support video playback. It also requires Flash (talking about outdated things). So I read thru its source and the XML configuration file just to find out it's an MP4 which should have been offered me directly as a link instead of all this. Alas, I was able to watch the video.
blahblahmeh wrote:placing your cursor anywhere inside/within the single quotes, then hitting the Tab key on the keyboard ends up bumping over (...) the "will bump..." text.
You omitted essential details:
  1. Syntax highlighting is used: the text inside the single quotes (including the quote characters) use a different color.
  2. Does it happen somewhere else?
With a blank document (speak: text file) I was unable to reproduce this behaviour. However, using JAVA or JAVASCRIPT syntax highlighting this can be reproduced. It can also be reproduced in HTML syntax highlighting when using this pattern:

Code: Select all

&char; tab between ampersand and semicolon
So I looked into the SYN files and discovered they all used

Code: Select all

CharStart = 
CharEnd = 
with appropriate characters. Even when I define a CSS document class which then uses the CSS.SYN this behaviour can be reproduced. In both 8.1.1x64 and 7.1.3x64 on Win7x64.



So this is a syntax highlighting problem, especially about the CharStart and CharEnd definitions (StringStart and StringEnd does nowhere behave unexpectedly - likewise with double quotes you can't reproduce this behaviour). Disable syntax highlighting or delete the mentioned two lines from your SYN file(s) and the "problem" should be gone.

I should have noticed this one as well, as I deal with lots of files having single quotes and using syntax highlighting. But I never had a reason to insert a TAB character inside a literal.
blahblahmeh
Posts: 2
Joined: Wed Nov 23, 2016 7:12 pm

Post by blahblahmeh »

Thanks for your reply... I guess. I don't know whether to feel exonerated (with respect to the glitch) or ashamed that my explanation of it was apparently such poor quality. To point out that I've not linked directly to a video file, but to an HTML file that happens to load player controls for a video file... is just petty. If I'd have known how my first post to this forum would be received, I wouldn't have bothered signing up for the "Community" to report this in the first place. Fortunately, "Amigo" (speak: friend) hasn't changed my opinion of TextPad - it is still a great piece of software.

To respond to your comments/questions...
1. Syntax highlighting is used...
Yes, it is. As a standard feature of TextPad, I didn't think to mention this "essential detail" in my textual explanation of the issue. Nor did I mention that I also had the Document Selector open at the time, and also a tool bar or two present. All of which I would never have imagined might have an effect on the behavior of the TAB key. (?!?!?) (Sorry for the sarcasm, I really am. Just finding it very difficult to govern it at the moment.)
2. "Does it happen somewhere else?
This is the only example scenario in which I have noticed such behavior. Had I noticed such behavior in other scenarios, I would have mentioned it, as it would have obviously been related to the issue.


I am pleased you were able to reproduce the behavior, even if doing so in a different manor than I noticed in my current configuration.

I actually use a combined SYN file, having both HTML and PHP syntax defined, as that's what I find myself developing in most often. Within this syntax file, I do have the following lines...

Code: Select all

CharStart = '
CharEnd = '
When removing the single quotes from the above, the behavior changes, and the TAB key works as expected (though, the highlighting of strings defined with single-quotes is now disabled).
So this is a syntax highlighting problem...
Yes, I to would still consider it a "problem" (speak: bug/glitch/whatever). Surely by any development standard, something like syntax highlighting shouldn't have an effect on the behavior of the TAB key. If anything, I would think the effect would be the other way around (tab effects highlighting).

... I never had a reason to insert a TAB character inside a literal.
Neither have I. But simply because I've brought to light unexpected behavior doesn't mean I'm doing something strange, or outside the scope of the program's intended capabilities. In PHP and HTML, anyway, double and single quotes are used quite often to define strings - and the usage of one or the other effects how inline variables are interpreted by PHP. In my case, if one was to even accidentally hit the TAB key while within such characters, it creates some very strange results when trying to remove the visual space that's created immediately preceding the bumped text.

Good day, Amigo.
User avatar
AmigoJack
Posts: 499
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

Post by AmigoJack »

I also want to add that it only happens with single quotes on the same line. Single quotes over multiple lines (as allowed in i.e. PHP or JS) won't trigger this glitch.

blahblahmeh wrote:Fortunately, "Amigo" (speak: friend) hasn't changed my opinion of TextPad
I wonder how I could be able to ever achieve this in the first place, as I'm not associated with TextPad in any way (other than using it).
Post Reply