Turning off the script editor's auto-format feature

Alex Tweedly alex at tweedly.net
Sat Jul 2 17:07:30 EDT 2005


Mark Waddingham wrote:

>Hi Bob,
>
>If you go to the Script Editor pane of the Preferences panel you can
>disable the auto-format feature there.
>
>Disabling this option stops the Script Editor from attempting to auto-
>format your code as you type - including not doing auto-complete.
>
>However, there is still one caveat, if you press tab then it auto-
>formats the current handler, rather than putting a 'tab-level' indent
>in.
>  
>
And if you want it to turn off completely (as I think it should), you 
ought to

1. ensure there is a BZ enhancement request to that effect

2. go to where you installed Rev / components / properties palettes
(e.g. in my case, c:/Program Files/Revolution 2.6/components/properties 
palettes/

3. Make a safe copy of the stack file  revscripteditor.rev

4. Make another safe copy of it somewhere else :-)

5. Start up rev, and open this stack, then use the application browser 
to select card "revscript" within it

6. find the field "script" in the right hand pane, and right-click on it 
to edit its script

7. Find the handler    on tabKey

8. insert immediately after the header line for the handler the 
following two lines

> global gREVAutoFormat
> if not gREVAutoFormat then exit tabKey
>
9. Apply this change, save the stack

10. Exit Rev and restart it.

11. Make sure that auto-format is not selected (Edit / Preferences  /  
Script Editor and uncheck auto-format)

and now you should find that TAB no longer auto-formats for you if you 
happen to type it by mistake).

(Done and tested on 2.6 recent - I can't remember how to find the build 
number)

I could make a stack to do this automatically, but it's probably better 
to do it yourself so you know what has gone on. If you wanted you could 
easily do something like
   if not gREVAutoFormat then
      beep
      exit tabKey
   end if

just to get a reminder that the tab didn't do what you might have 
expected.  I thought about making it insert a "space" or even insert 
multiple spaces intelligently - but decided that looked complicated 
enough that I would need to do a lot of testing - and it just doesn't 
seem that important for something that (I hope) will change in some 
fairly near-future release.

-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.8/35 - Release Date: 30/06/2005




More information about the use-livecode mailing list