Old 07-02-2019, 04:28 AM   #1
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: Southern Vermont
Posts: 864
Default How to change the ReaScript Compiler indent amount?

Just a quick question:

One one or two of my scripts, when I edit them in the ReaScript compiler, I press 'tab' and the indent amount is double the usual amount. I actually like it. I'm thinking that I probably accidentally hit some combination of keys that increased the indent percentage, and I would like to be able to duplicate this action.

Any help would be great!

Signed,

Dafarkias Wominus Maxipadus (the 3rd)
__________________

Support my feature request!
Dafarkias is offline   Reply With Quote
Old 07-02-2019, 12:44 PM   #2
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Can you send me those scripts? I'll look into that and see, if I canfind that out...
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 07-02-2019, 02:05 PM   #3
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: Southern Vermont
Posts: 864
Default

Quote:
Originally Posted by mespotine View Post
Can you send me those scripts? I'll look into that and see, if I canfind that out...
Sure!

I wish I had details I could provide you with, but unfortunately I don't...

The script I've included is one of the scripts I have where when I press the 'tab' key, it creates an indent equivalent to two normal 'tab' presses in ReaScript. I have no idea if this behavior will follow the script over to you upon download, but I could always record a ultra-short video displaying this behavior--I just kinda assumed a more experienced REAPER scripter might have encountered this before.
__________________

Support my feature request!
Dafarkias is offline   Reply With Quote
Old 07-02-2019, 02:17 PM   #4
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

On which most recent Reaper-version could you find this behavior?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 07-02-2019, 02:20 PM   #5
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Confirmed, works here as well!

I see, if I can nail it down. Probably some kind of UTF8-thingy...
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 07-02-2019, 02:24 PM   #6
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: Southern Vermont
Posts: 864
Default

Quote:
Originally Posted by mespotine View Post
On which most recent Reaper-version could you find this behavior?
On the newest non-beta--5.979.

It was also doing it with the last two versions though... Only for the certain scripts (like the one I sent you) but never any others. That's why I kinda just assumed that I had accidentally pressed some kinda key-combination that changes the indent-strength of ReaScript.

Quote:
Originally Posted by mespotine View Post
Confirmed, works here as well!

I see, if I can nail it down. Probably some kind of UTF8-thingy...
That's wild! I actually kinda assumed it wouldn't carry over.. I'm glad it did though..
__________________

Support my feature request!
Dafarkias is offline   Reply With Quote
Old 07-02-2019, 02:26 PM   #7
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Do you always use the built-in-IDE? Or do you also use another editor?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 07-02-2019, 02:32 PM   #8
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: Southern Vermont
Posts: 864
Default

Quote:
Originally Posted by mespotine View Post
Do you always use the built-in-IDE? Or do you also use another editor?
For a while I was using Notepad++, which I think is better overall, but lately I've just been using the ReaScript compiler, I think it's kinda convenient.

Really, probably one of my top gripes for the built-in IDE would be the small indent size, which is why I thought it would be cool if it could be figured out to how change it's default amount.

I can't remember if I ever used the Notepad++ on the specific script I included in this post, I think that I probably would have.
__________________

Support my feature request!
Dafarkias is offline   Reply With Quote
Old 07-02-2019, 02:35 PM   #9
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Ok, my current finding: it has something to do, with the way the file was encoded.

The following part

Quote:

--Find the point/position (sample) in which multiple audio tracks conjunctively contain the lowest signal point in a time selection of audio
(which will hereafter be reffered to as the "zero-cross"). The script can either end after this step, or continue on to the next portion
at the user's leisure.
triggers this effect, if it's stored in NotePad++
Means, I deleted as much as I could from the file and somewhere in these lines, the trigger is existing.
It's lost, when I copy these lines into a new script.

Will look further into the binary-representation of the files.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 07-02-2019, 02:40 PM   #10
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: Southern Vermont
Posts: 864
Default

Quote:
Originally Posted by mespotine View Post
Ok, my current finding: it has something to do, with the way the file was encoded.

The following part



triggers this effect, if it's stored in NotePad++
Means, I deleted as much as I could from the file and somewhere in these lines, the trigger is existing.
It's lost, when I copy these lines into a new script.

Will look further into the binary-representation of the files.
Huh!

You are incredible. I feel like a caveman with a stick when I use a computer.
__________________

Support my feature request!
Dafarkias is offline   Reply With Quote
Old 07-02-2019, 02:45 PM   #11
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Ok, here's my theory.

Reaper itself stores tabs using two spaces. But if Reaper finds a normal tab in there, it will alter the way the tab-key works to four spaces.

I think it has probably something to do with the basic features of the IDE to make indenting text easy to do in the style the code was written with an earlier editor. Two spaces when completely written using solely the ReaScript-IDE, or 4 spaces, when written with another editor supporting tabs.

That means: add a tab(using NotePad++) into the script and re-load it in ReaScript.
Voila: Tab is 4 spaces long, not 2.

Edit: experiment with the attached file. Should work.
Attached Files
File Type: lua testtab.lua (10 Bytes, 80 views)
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 07-02-2019, 02:47 PM   #12
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: Southern Vermont
Posts: 864
Default

Quote:
Originally Posted by mespotine View Post
Ok, here's my theory.

Reaper itself stores tabs using two spaces. But if Reaper finds a normal tab in there, it will alter the way the tab-key works to four spaces.

I think it has probably something to do with the basic features of the IDE to make indenting text easy to do in the style the code was written with an earlier editor.

That means: add a tab(using NotePad++) into the script and re-load it in ReaScript.
Voila: Tab is 4 spaces long, not 2.

Edit: experiment with the attached file. Should work.
Ha! Thank you!

You are a genius.
__________________

Support my feature request!
Dafarkias is offline   Reply With Quote
Old 07-02-2019, 02:50 PM   #13
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Thanks to you for pointing this out. Didn't know that of the IDE in the first place.
Might be helpful for others as well.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:55 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.