Current line box

General questions about using TextPad

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

IanOfYork
Posts: 93
Joined: Sat Nov 04, 2017 11:54 am
Location: York, England

Current line box

Post by IanOfYork »

Textpad version 8.13 shows the current line in the file by displaying a box of dashed lines.

How do I disable the box completely and just use the background colour to highlight the current line?
ben_josephs
Posts: 2456
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

In Configure | Preferences... | Document Classes | <Class> | Colors
or View | Document Properties | Colors,
choose Item: Current Line (7th entry),
set Foreground to whatever colour you want
and Background to the same colour as Window background (1st entry; normally white).
IanOfYork
Posts: 93
Joined: Sat Nov 04, 2017 11:54 am
Location: York, England

Post by IanOfYork »

Yes that helps slightly, but changing the foreground colour to match the background colour just reduces how bad it looks, it does not remove the box.

Is there any way to disable / expunge / remove the box altogether?
User avatar
bbadmin
Site Admin
Posts: 786
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Post by bbadmin »

Try setting the foreground to light yellow and the background to light gray.
IanOfYork
Posts: 93
Joined: Sat Nov 04, 2017 11:54 am
Location: York, England

Explain why the box is a problem

Post by IanOfYork »

Yes that helps visually, but changing the colour of the box does not remove the box.

With a standard fixed width 10 point font - such as "Consolas" or "Courier New" - the bottom edge of the box overwrites underscore characters and makes them look like spaces. When writing code, this is a serious problem.

The effect can be mitigated by altering the font size, but 11 point "Consolas" is just too large for my screen. Changing the font can also work, but 10 point "Liberation Mono" is not very clean. 10 point "Lucida Console" has the opposite effect - the box blanks the top of tall characters. 11 point "Lucida Console" loses the tail of descenders as well as the tops.

So, I need to completely stop the box being displayed at all.

Is there any option to do that - however "dirty"?

The correct fix would be to add an option to the Document Class to disable the box effect.

A viable fix would be to make the box height (and vertical position) adjust to the current font height, so that the box edges are always positioned in the whitespace between the lines. Then we could select the box colour so that it is effectively hidden without losing parts of the characters.
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

Here's the trick:
  1. Set the Background colour to whatever you want the highlight to be.
  2. Set the Foreground colour to the same colour as the background.
  3. In the Foreground colour drop-down, click More Colors.
  4. On the Custom tab, change one of the Red, Green or Blue values by 32.
For example, if you set the background colour to 255, 255, 128, you can set the foreground colour to either 255, 255, 96 or 255, 255, 160 and the dotted lines will be imperceptible.

I noticed this doesn't help your problem if you use Courier New; the dotted box still overwrites underscore characters. But Consolas 10 point seems to be okay.
User avatar
bbadmin
Site Admin
Posts: 786
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Post by bbadmin »

This issue is an artefact of code that TextPad has had since 1995 to handle old monitors which could only display 16 or 256 colors. That code has now been excised, so setting the same foreground and background colors suppresses the box, as intended. This will be available soon. Hope nobody still has such a monitor!
IanOfYork
Posts: 93
Joined: Sat Nov 04, 2017 11:54 am
Location: York, England

Awesome

Post by IanOfYork »

Thanks!!
Looking forward to that next release, so that I can switch the font back...
Mr. Code Monkey
Posts: 22
Joined: Thu Jul 30, 2009 4:59 am

Post by Mr. Code Monkey »

Yes, please prioritize removing the dashed outline. It's seriously cramping my work flow; very annoying.

And thanks, ak47wong. That workaround does help.
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

Did you miss the announcement yesterday? The new version (8.14.0) fixes the problem. I think this is set a record in how quickly a TextPad bug has been fixed.
Mr. Code Monkey
Posts: 22
Joined: Thu Jul 30, 2009 4:59 am

Post by Mr. Code Monkey »

No it did not fix the problem. The release notes said: "When the foreground and background colors were the same, the current line should not have been highlighted with a box."

I updated TextPad and the problem was still there. Setting *BOTH* foreground and background to the highlight color worked around it -- but that makes no sense and it's only when I saw this thread that I tried it.

Normally foreground color would imply text color -- meaning that having FG and BG the same would render the text invisible, like in HTML and every other text editor.
The correct fix is for the box not to show at all. Or to be switchable via a separate option than the "highlight line" option.

It's even worse that the "highlight the line" option is global, but the color kludge-around must be done in each document class.
User avatar
bbadmin
Site Admin
Posts: 786
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Post by bbadmin »

You have misunderstood how this works for current line highlighting. If the foreground and background colors are different, the background of the current line will be painted with the selected background color and a dotted line will be drawn around it in the foreground color. The dotted line will not be drawn if both colors are the same. If you don't want any highlighting, set both colors to the window background color.
Mr. Code Monkey
Posts: 22
Joined: Thu Jul 30, 2009 4:59 am

Post by Mr. Code Monkey »

I want highlighting (color) but no box. I'm glad that that is once again possible, but the FB/BG stuff is counter-intuitive and non-standard -- hence the "misunderstanding". (Which is really a design/documentation/help error.)

But at least this thread is here now, so other people will have an easier time working around the problems.
IanOfYork
Posts: 93
Joined: Sat Nov 04, 2017 11:54 am
Location: York, England

Magic

Post by IanOfYork »

I too dislike "magic" side-effects like this.

It would be safer / friendlier / better to have a tick-box option associated with the class to turn off the box effect.

However, 8.13 was updated very quickly, the magic work-around does work and the forum does have information about resolving the issue.
WayneCa
Posts: 50
Joined: Sat Aug 16, 2014 2:13 am

Post by WayneCa »

The last version of TextPad I used before upgrading to 8.14.0 was 8.12.0. My FG/BG colors are white/black respectively. My line hilite color has been a charcoal gray since version 7. This is the first time I've had the dashed outline around the current line. Selected lines are still the way I want them, but the current line has that awful dashed outline around it. Please add a property that allows us to disable that outline.
Post Reply