Jump to content
tremolux66

ScITE code highlighting with #cs/#ce

Recommended Posts

tremolux66

I've been experiencing an issue with #cs/#ce block comments and AutoIt code highlighting in ScITE. When I insert the comments-start line, the subsequent lines in the file become comment-colored (green) as expected. Much of the time, when I insert the #ce line, the lines following the comments-end revert to normal code highlighting as expected. But other times, the subsequent lines (to the end of the file) stay green until I save, close, and re-open the file. This seems to occur most often when I am using #cs/#ce to comment-out a section of code, but IIRC it can also occur in cases where I'm just inserting a large comment.

So far, I haven't noticed any pattern to this behavior. The only thing that I can think of is the way I'm entering the #cs & #ce lines when commenting-out code; I often do the following;

  1. Insert the #cs line, something like: #cs ======== Explanation for commenting-out ========
  2. Text below the line turns green
  3. Copy the entire #cs line
  4. Paste it after the code section (as #cs ...)
  5. Edit the pasted line to start with #ce instead of #cs
  6. The text below the #ce either reverts to normal ScITE/AutoIt highlighting OR remains green, in which case I have to close and reopen the file to restore normal highlighting.

I'm using ScITE Version 3.6.0 (Aug  4 2015 17:34:27).

Any thoughts or suggestions?

 


When the going gets tough, the tough start coding.

Share this post


Link to post
Share on other sites
jpm

I experience the same with the lastest SciTE with beta updates

Share this post


Link to post
Share on other sites
mLipok

This issue is a know issue and reported some time ago.

Current beta version already have some fixes in this regard and trust me current state is better then before.

Unfortunately not perfect as you found, but this is @Jos project so only he can say anything more about.

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2018-03-17

Share this post


Link to post
Share on other sites
Jos

@tremolux66,

Please try the latest available Beta SciTE.exe & Scilexer.dll combination to see if this issue still exists.
If so then I will have a look, but a quick check of the described steps don't fail on my SciTE version. 

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
tremolux66

@Jos

Thanks, will give that a try. It may take awhile to verify since the problem is intermittent; I don't know of a way to reproduce it on demand. (The possible cause I described was just a SWAG.)


When the going gets tough, the tough start coding.

Share this post


Link to post
Share on other sites
Jos

I did fix some issues form the commentblock lexing so am sure you hit on one of those, so that is why I proposed to use beta. I will need the exact steps in case you hit on another one. :)

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
jpm

Jos

JUst create a new .au3 with the Template

add some code at the end

Finally you get the pb inserting in first line a ligne starting with #test or even #AutoIt3Wrapper_*

I hope that help

I am running with the latest SciTE.exe/dll of the beta area

Good luck

Share this post


Link to post
Share on other sites
Jos
3 minutes ago, jpm said:

Finally you get the pb inserting in first line a ligne starting with #test or even #AutoIt3Wrapper_*

Which problem is that as I don't see anything irregular happening when a add 2 lines at the end en then type in the firstline: #test{enter} ?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
jpm

the code is supposed to change color loose code coloring

#Au3Stripper_Ignore_Funcs
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.15.0 (Beta)
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

MsgBox(0, "", "")

Just  add after 1st line a line

#test

when you move the cursor in the #cs area the Msgbox get green

Share this post


Link to post
Share on other sites
Jos

Thanks, I was indeed one time able to replicate the behavior, but then it kept working fine for me...  still trying to come up with a simple way to replicate it so it can be debugged. 

edit: Strike that..., found a easy way to replicate it so can do some debugging!

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Jos

I found an issue in the lexer and fixed that in the current Beta versions of SciTE.exe & SciLexer.dll.
Please check whether you can still get it to go wrong.

It is the 3.7.5 version of SciTE I updated with this. Will also look at the 4.0.2 version of SciTE.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Jos

The test version 4.0.2 now has the same update located here: https://www.autoitscript.com/autoit3/scite/download/Develop_Share/

Remember this is a major change of SciTE which isn't declared stable as yet and requires an update for all files located in this directory for SciTE to function properly. 

Jos

 


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
mLipok

using Dev SciTE4Au3 v4.0.2

Try this:

#Au3Stripper_Ignore_Funcs

#cs
#ce

MsgBox(0, "", "")

And focus #cs #ce hit few times, enter <> backspace, just play with it and you will find situaltion when MsgBox() is getting grey.

image.png.d93115d5487398b722b861ee46b32f98.png

Sorry for my dark theme.

 

Edited by mLipok
smaller repro snippet

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2018-03-17

Share this post


Link to post
Share on other sites
Jos
17 hours ago, mLipok said:

And focus #cs #ce hit few times, enter <> backspace, just play with it and you will find situaltion when MsgBox() is getting grey.

mmm..  not so much an exact replicator here :)

Anyways: it is as simple as...use this code

#Au3Stripper_Ignore_Funcs
#cs
#ce
$a=1

Insert line 2 and type any character and hit backspace and the last line becomes the color of the commentblock

Got something to debug....

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
jpm

Infact using the latest download from yesterday make me to think the same the first time I use them (replaced in the scite installed dir)

But on second run it works good

using the above repro does not produce any error on my environnment

 

strange

Jpm

Share this post


Link to post
Share on other sites
Jos

It is only the $.0.2 version that is wrong as I missed one line to merge  between the separate projects. :)

Uploaded an updated SciLexer.dll for the 4.0.2 version in Develop_Share.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
jpm

Ah,

I don't use for now this new version 

do I need to switch to?

Share this post


Link to post
Share on other sites
mLipok

Will check later.


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2018-03-17

Share this post


Link to post
Share on other sites
mLipok

@Jos

Better now ... but I notice some problem with  folding.

image.png.0cb0ef1c8aef31b62762be3d9c81dcca.png

 

Try this simple repro snippet:

#Au3Stripper_Ignore_Funcs
#cs
#ce
MsgBox(0, "", "")

#cs
#ce

MsgBox(0, "", "")

HOWTO: 

GoTo 3,1 and hit Enter ... and Backspace

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2018-03-17

Share this post


Link to post
Share on other sites
Jos
3 hours ago, jpm said:

do I need to switch to?

That is up to you. I have made the new SciTE 4.0.2 available as a separate setup. Neil doesn't deem this yet as production so have done this merge separate and will not move it into the production thread until that changes, so it is there for those that what to have a go.  Many things changed, including the LUA scripts, so there is no simple switch between the 2 versions.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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

  • Similar Content

    • FrancescoDiMuro
      By FrancescoDiMuro
      Good evening everyone
      I was trying to insert function header to the functions of my script, but, in the SciTE console, this appears:
      Function or struct definition not found, unable to insert header. @Jos Any suggestion?
      Thanks in advance.

      Best Regards.
    • cheeroke
      By cheeroke
      Hi I am not sure how to call it properly, but for those of you who use SciTE, when you typing built in function and about to pass parameters to it you can see popup with all the ones which can be passed.
      Question: how to create something like that for my own functions?
       
      Thanks
    • therks
      By therks
      Does SciTE have string or number ids for the recent file menu items?
      I was hoping to add shortcuts (using the user.shortcuts properties) to the most recent item, but the documentation doesn't list any id's for those items (unless I overlooked?).
      Also, did anyone else notice that the index listing for the SciTE doc doesn't work properly?
      It appears it's linking to this: mk:@MSITStore:C:\Program%20Files\AutoIt3\SciTE\Scite4AutoIt3.chm::/SciTEDocumentation.html
      When it should be this? mk:@MSITStore:C:\Program%20Files\AutoIt3\SciTE\Scite4AutoIt3.chm::/Scitedoc/SciTEDoc.html
    • BrewManNH
      By BrewManNH
      I was looking for a toolbar modification for SciTE and I was checking various versions of SciTE that were available on the internet. They all had some problems for how I wanted to use the editor, so I looked here to see if there were any toolbar modifications for Scite. I found one very old script by YogiBear (Volly) from 2006 that looked promising, though there were issues with it. I decided to see what I could do to modify this script, and make some improvements to it if possible. This script is the result of that work.

      It's not perfect and definitely could use some tweaking, but I thought that it had matured enough, and was mostly stable enough to release the updated version.

      Changelog:
      Version 2.0.1
      Minor update to remove all the old Obfuscator directives and replaced them with #Au3Stripper directives instead. I also corrected a minor bug that only showed up for me on one computer I tried this on, and caused the tool bar to crash for others as well.
      SciTE toolbar version 2.0
      Changed the settings values to use constants instead of 'magic numbers' The icons on the toolbar weren't lining up with the separator characters or with the toolbar GUI because they weren't set with the resize setting for the icons, only for the separators. Changed to using arrays for everything, it makes it a lot easier to loop through the controls Added a line to use an alternate path to the SciTE program, so you can start it using, for example, the portable version instead of installed version for those that don't install AutoIt and/or SciTE4AutoIt3. It will accept a commmand line parameter that points to the SciTE executable. Removed a lot of Global variables by moving the GUI creation and monitoring to the Main function and passing variables from it. I embedded the icon files into the script so that there isn't a separate download of the icon files used here. Saves download time and makes the package smaller. Modification of tools is easier because the icon names, tooltip text, and SciTE command codes are saved in the INI file upon first start up. These can be modified after the script has been run once, even after it's been compiled, by changing the ini file information, you can modify this script to automate it, or you can change it manually in any text editor. The icon files are now using, in just my opinion, better looking icons, after all it's been 7 years and icon files have matured. I have included a file with all of the constants that SciTE uses for its menu commands which comes from the SciTE source file "scite.h", so you can use this file to help you modify the commands that the toolbar works with, by figuring out what each of these values represent in SciTE. The core of the script is pretty much the same, I've just fixed a couple of issues that it had, tweaked a few things, added some new functionality and "prettied" it up a bit.

      If anyone has any suggestions as to improvements, bugs/bugfixes, etc. please let me know.

       
      scitetoolbar.zip
    • Aguilucho
      By Aguilucho
      Greetings to the AutoIt community.
      I hope that nobody considers my question insulting but I searched 'SciTEConfig.exe' and I did not find it anywhere;
      although it is mentioned, it seems like a myth, I can not see if it exists.
      On the other hand, I have downloaded the compressed archive (from ... autoit-script-editor/downloads) 'SciTEConfig_Source.zip'
      Does not contain any .exe either but does have a 'SciteConfig.au3' which, I suppose, has replaced the .exe because on the internet I only find it as malware.
      My problem is: My applications to unzip .zip archives, they can see what files SciTEConfig_Source.zip have but they can not unzip it: 'Unknown method' says WinRar.
          I have downloaded it again, in case it had been damaged but the result is always the same.

      My question is: Is the archive 'SciTEConfig_Source.zip' damaged or does it have any other method of compression?
      I need it to learn how to configure SciTE (lite).
      Thankful to the developers of AutoIt and to the community.
      Regards
       
×