Tab Spacing in Script Editor

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
dtaylor
Junior Coder
Posts: 46
Joined: Mon Aug 08, 2016 2:42 am

Tab Spacing in Script Editor

Post by dtaylor » Wed Aug 24, 2016 6:27 am

Sorry if this has been discussed before, but I couldn't find anything using the limited search terms.

Sometimes using the Tab key in the Script Editor moves the cursor over 2 characters positions. Other times it moves the the cursor 4 characters.

It appears that if the previous line was created using Code Builder, the previous line will have a tab of 2 characters. When Tab is inserted in the following line, it will be tabbed 2 characters.

Pressing tab on a line where the previous line is not indented, will move the cursor over 4 characters.

This is not a major issue, but I'm a bit of a neat freak and it drives me crazy to have some lines indented 2 characters while others are 4 characters.

NancyM
Pro Scripter
Posts: 66
Joined: Mon Jul 18, 2016 7:01 pm

Re: Tab Spacing in Script Editor

Post by NancyM » Wed Aug 24, 2016 8:21 pm

Yeah, this happens to me too. Makes me slightly batty.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Tab Spacing in Script Editor

Post by Marcus Tettmar » Tue Aug 30, 2016 11:10 am

I'm not sure I understand how to replicate this issue - Code Builder doesn't insert ANY tabs. It leaves you to do that. So I'm not sure why you are seeing two spaces after using code builder. As far as I can see, the Tab key always inserts 4 spaces.

Maybe what you are seeing is if you use the space bar to enter say 3 spaces before some code, when you hit return at the end of that line it will line you up in the same place - so 3 preceding spaces again.

But if you start a new line and hit tab you'll get the 4 spaces again.

This isn't an issue with the Tab key but just a result of using a different indentation with your text. The editor correctly lines up the text. If you ALWAYS use the Tab key you wouldn't have an issue, but if you mix and match tab with some other number of spaces then you might see an inconsistency. But that's down to how you choose to indent.

Or have I missed something?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

NancyM
Pro Scripter
Posts: 66
Joined: Mon Jul 18, 2016 7:01 pm

Re: Tab Spacing in Script Editor

Post by NancyM » Tue Aug 30, 2016 8:32 pm

One case where it doesn't work as I expected:

If you highlight a bunch of lines and then block indent, it only indents them 2 spaces. If you do the same and hit the tab key it also only indents them 2 spaces. You have to indent them again to match the normal indent.

Another case is when you start a subroutine and press enter. It only indents by 2 spaces.

The code builder for FindImage indents after the If>NumFound>0 only by 2 spaces.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Tab Spacing in Script Editor

Post by Marcus Tettmar » Wed Aug 31, 2016 9:01 am

Ah, you mean the wizards. Ok, got it thanks.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

NancyM
Pro Scripter
Posts: 66
Joined: Mon Jul 18, 2016 7:01 pm

Re: Tab Spacing in Script Editor

Post by NancyM » Thu Sep 01, 2016 4:56 pm

Marcus Tettmar wrote:Ah, you mean the wizards. Ok, got it thanks.
Also the indenting inside of SRT statements seems to default to 2 spaces.

Code: Select all

SRT>abc
  first indent always starts here
END>abc

NancyM
Pro Scripter
Posts: 66
Joined: Mon Jul 18, 2016 7:01 pm

Re: Tab Spacing in Script Editor

Post by NancyM » Tue Sep 13, 2016 5:06 pm

Seems to be working better with the update. Woo hoo!

dtaylor
Junior Coder
Posts: 46
Joined: Mon Aug 08, 2016 2:42 am

Re: Tab Spacing in Script Editor

Post by dtaylor » Tue Sep 13, 2016 7:32 pm

I agree, it's working great!
This is awesome for my OCD self.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts