Tab key

For technical support and bug reports for all editions of CSS HTML Validator, including htmlval for Linux and Mac.
Post Reply
User avatar
RSteinwand
Rank VI - Professional
Posts: 596
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Tab key

Post by RSteinwand »

Hi Albert,

I'm pretty OCD about indenting and white space. Indenting helps me keep track of opening and closing tags.

Today for the first time I noticed a problem in the editor. Indenting one line works as expected, I get a tab char for every time I press the "tab" key.

However, if I select multiple lines that all start at the left edge, I get a tab char the first time and just spaces after that.

Then it gets goofier. If I uncheck "smart indent", then I get just spaces for tab and ctrl tab, even tho "Use tab char" is checked.

And I don't understand why a tab would get me tab characters, but ctrl tab would move back one space at a time. I think something has changed in the editor.

Probably time to wake up the editor control developer. :D
Rick
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Tab key

Post by Albert Wiersch »

Thanks Rick. I'll ask the editor developers.

By the way, this is one reason I have moved away from using actual tab characters in my documents. It seems to be more trouble than it's worth. I only use space characters to indent. There seems to be a big controversy about the tab character but I think many people agree that while using the tab character may be a good idea in theory, in practice it can cause problems.

Also, would it be possible to post a screenshot of the settings you are using in the 'Other Editor' page of the Editor Options?
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
RSteinwand
Rank VI - Professional
Posts: 596
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Re: Tab key

Post by RSteinwand »

Here you go.
Capture.PNG
Capture.PNG (19.05 KiB) Viewed 6350 times
Thanks.
Rick
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Tab key

Post by Albert Wiersch »

Thanks for the screenshot showing your settings.

One thing to note is that if you have selected text then pressing Tab (or Shift+Tab to unindent) becomes an indent operation (instead of simply inserting a tab character at the cursor) and the "Indent width" setting takes effect. In order to manage indenting it seems that the editor component doesn't like actual tab characters (probably because of the issue of how many spaces they are (the tab width) and the ability to control precise indenting with indent widths that are not even multiples of the tab width), so in some cases the editor may turn tabs into space characters (like when unindenting). Perhaps there is some way to manage this better and preserve tab characters when possible and only use space characters for finer grain indenting control.

Anyway, let's see what the editor developers say. Hopefully I'm just missing something and the editor already provides a solution to this.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
RSteinwand
Rank VI - Professional
Posts: 596
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Re: Tab key

Post by RSteinwand »

Thanks Albert.
Rick
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Tab key

Post by Albert Wiersch »

Hi RIck,

In CSE HTML Validator v16.04+ it should handle tabs better when the 'Use Tab Character' option is checked, there is selected text (like selected lines), and Tab or Shift+Tab is pressed or the indent/unindent button/function is used. Please let me know how it works after you get a chance to try it.

Thanks!
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
RSteinwand
Rank VI - Professional
Posts: 596
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Re: Tab key

Post by RSteinwand »

Sounds like a fun update. Can't wait.
Rick
Post Reply