Tab key

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

Tab key

Post by RSteinwand » Wed Apr 13, 2016 7:47 am

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
Site Admin
Posts: 3242
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Tab key

Post by Albert Wiersch » Wed Apr 13, 2016 8:22 am

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?
Image
Albert Wiersch

User avatar
RSteinwand
Rank VI - Professional
Rank VI - Professional
Posts: 573
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Re: Tab key

Post by RSteinwand » Wed Apr 13, 2016 9:40 am

Here you go.
Capture.PNG
Capture.PNG (19.05 KiB) Viewed 2152 times
Thanks.
Rick

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

Re: Tab key

Post by Albert Wiersch » Wed Apr 13, 2016 10:02 am

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.
Image
Albert Wiersch

User avatar
RSteinwand
Rank VI - Professional
Rank VI - Professional
Posts: 573
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Re: Tab key

Post by RSteinwand » Wed Apr 13, 2016 4:01 pm

Thanks Albert.
Rick

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

Re: Tab key

Post by Albert Wiersch » Fri Jun 03, 2016 2:01 pm

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!
Image
Albert Wiersch

User avatar
RSteinwand
Rank VI - Professional
Rank VI - Professional
Posts: 573
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Re: Tab key

Post by RSteinwand » Fri Jun 03, 2016 2:22 pm

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

Post Reply