Jump to content

Can i change how Scite lexer things work?


Recommended Posts

As topic description says, #Region/#EndRegion folding isn't behaving how id like to. I even downloaded the FULL Scite to install over the cut down version... still no luck ;)

What I'd LOVE to see it do is ONLY fold up to and including the #EndRegion tag, this way i could add space so that things are a little more clear.

post-52317-12822201183613_thumb.jpg

Is this possible to do?

Link to comment
Share on other sites

a valid argument. Thank you for the information.

i'm pretty sure that's been brought up before... i'll see if i can't find the work around...

***edit***

ok, i can't find that old post but just double up your #EndRegion on the next line.

#Region
;stuff
;other stuff
#EndRegion;This one is hidden
#EndRegion;This one is not
Edited by cameronsdad
Link to comment
Share on other sites

ok, i can't find that old post but just double up your #EndRegion on the next line.

Oh thank god! It even works after the first time I do it, the SCiTE lexer must somehow understand that the second endregion doesn't have a match and is therefore sort of like a garbage comment line?

This is VERY useful as SCiTE website has no forums and is sort of useless for working out my particular issue ;)

Thanks a ton!

Link to comment
Share on other sites

Oh thank god! It even works after the first time I do it, the SCiTE lexer must somehow understand that the second endregion doesn't have a match and is therefore sort of like a garbage comment line?

This is VERY useful as SCiTE website has no forums and is sort of useless for working out my particular issue ;)

Thanks a ton!

glad to help man
Link to comment
Share on other sites

  • Developers

I have made the AutoIt3 Lexer and the folding support for Scintilla (SciTE).

At design time the decision was made to have it fold the way it does and there are no options to changes that unless the default folding is changed.

I would not use two #endregion statements because that will/could crew up folding like this example which I use in AUtoIt3Wrapper:

#region main
;
#region sub1
;
#endregion sub1
;
#region sub 2
;
#endregion sub 2

#endregion main
;

Now tell me: why is it so important to make the change you want to do? somehow I do not see any advantage yet,

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I'll let Drifter answer for himself, but here's my 2 cents. It see it as simply a matter of personal preference.

I agree with the way he would like the folding to work. I would prefer to see both the #Region and #EndRegion lines, with everything in between collapsed. Same as with Func/EndFunc, If/Endif, Select/EndSelect, etc. It's simply that I always want to see both ends of what's collapsed.

Certainly nothing I'd fight over, and it would be difficult to make a solid argument that either way is unquestionably better than the other. I'm only saying that it would be nice to have an option as to which way the folding worked.

Link to comment
Share on other sites

G'day Jos

I'd agree with jayterry.

Leaving the #EndRegion make it more uniform and allow

I was trying (just recently) to add a blank line between the folded region and the next code block. WHY? To make the code easier to read.

However, all blank lines are consumed by the fold. Even a line with a single semicolin on it is considered consumable.

Yes even though it's a simple thing I spent a far amount of time trying to get SciTE to do what I wanted it to do. ;)

EG

#region
1
2
3
4
5
#endregion
;


1
2
3
4

becomes

#region
1
2
3
4

But it's really no biggy. I can live with or without it. :)

Hope everyone has a great day!

Storm-E

aka

John Morrison

Link to comment
Share on other sites

I was trying (just recently) to add a blank line between the folded region and the next code block. WHY? To make the code easier to read.

However, all blank lines are consumed by the fold. Even a line with a single semicolin on it is considered consumable.

Yes even though it's a simple thing I spent a far amount of time trying to get SciTE to do what I wanted it to do. ;)

Jos: This is EXACTLY the reason why I wanted this. Maybe it doesn't matter to some, but when I had my first programming class (in Java) I was told to make my code very clear. This means:

  • Name all variables something that tells what they hold/do
  • Tab in appropriately (If statements, functions, etc)
  • Leave adequate comments
  • Put blank space to visually divide different areas of code, since most languages this is ignored by the compiler/interpreter

With all respect, this last item can't be achieved without an extra #EndRegion .... and so i am forced to double them up. The solution is genius as it does exactly what i wanted.

Even if it looks like a bad programming practice, I am simply coding and operating the way that I have been taught and am comfortable with. :)

Edited by Drifter
Link to comment
Share on other sites

  • Developers

With all respect, this last item can't be achieved without an extra #EndRegion .... and so i am forced to double them up. The solution is genius as it does exactly what i wanted.

Its better to just use an # in stead of #Endregion on this separation line as that is just ignored by the lexer.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Although SciTe is a good editor, I have opted to use the RJ Texted editor for scripting. It may not have all of the tools that SciTe has, but it makes up for it in being easily customizable. When I first started using it there was no syntax file for autoit3, so I wrote one, and it's now included in the official download of the editor. The great thing about this editor is that it comes with a syntax file editor so that you can change pretty much anything in regards to the type of files you're working on. The syntax files allow YOU to set where the folds will occur, and what is foldable. The editor also allows you to create your own "Tools" to use when working with scripts so that they work the way you want them to, and not how someone has decided they should work for you. You might want to check it out here.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

not how someone has decided they should work for you.

i was going to bite my tongue but decided against it. it wasn't a decision that was made arbitrarily by someone who doesn't use the language. it was a decision by one of the developers of the language, in their too often thankless effort to make life easier for the users. /rant sorry that last bit just seemed a little shitty whether you use the editor or not.
Link to comment
Share on other sites

i was going to bite my tongue but decided against it. it wasn't a decision that was made arbitrarily by someone who doesn't use the language. it was a decision by one of the developers of the language, in their too often thankless effort to make life easier for the users. /rant sorry that last bit just seemed a little shitty whether you use the editor or not.

That's your opinion, in my opinion I find having control over things that have nothing to do with the scripting language makes MY life easier. I LIKE having the ability to change the editor to my preferences because it makes things easier for me. Not being able to control that means it IS left to an arbirtray decision that I had no control over. The definition of arbitrary is subject to individual will or judgment without restriction while it may have been a group decision to have the lexer work the way it does, it still comes down to an arbitrary decision.

I have the UTMOST respect for the developers of AutoIt and the work they all do, but if disagreeing in how MY editor works is "shitty" in your opinion then I guess you and I have different opinions on what defines being shitty. The reason that there are so many different editors out there, and most editors are adaptable to the user's needs should tell you that not everyone codes the same way, whether they write in the same code or not.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

i personally don't even use the code folding usually unless it's some giant project i'm working on, or a collaboration where i hide everybody else's code. To each there own though, just seems like reinventing the wheel to me.

In this case it is a "Large" project actually. By putting that in quotes I indicate that large is something everyone defines differently, but in my case its the largest piece of code I've ever written, so I found code folding to be EXTREMELY useful in this case! ;)

Link to comment
Share on other sites

  • Developers

I have no issue with BrewManNH's way of expressing an opinion and never felt it not being fair.

The decisions were made when Valik and I had a look at how things should work and we decided to do it this way at the time.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...