Jump to content
qwert

SciTE question: are bold headings feasible?

Recommended Posts

qwert

Right off the bat, let me ask that anyone responding to refrain from:  1) asking me why in the world I would want these bolder lines ... and 2) suggesting that I use #cs/#ce, which I have already found to be an inadequate substitute for what I envision.  I'm looking for brand new capability from SciTE.  So here's the proposition:

I think I’m close to having an SciTE feature that I’ve wanted for years: 

Bolded Headings ... as "special" comments that have a display style separate from regular comments.

For example:

;HS =========== a bolded header  =============
        Sleep(1000)                                ; a bolded script statement, if possible ... but this isn't absolutely necessary
;HE ========== another bolded line ============

As I looked at SciTE’s generic properities parameter definitions, I saw that comment.stream is basically disabled by having it equated to the #cs/#ce comment.box(block) that we’re familiar with.  It looks to me like “stream” comments could be independent ... at least in the limited way I want.

As a test, I picked ;HS and ;HS as the trigger strings ... and then edited the properties files in obvious places.*

It did not work.  So things are not as forthright as they appeared ... although I see SciTE configured in many ways for different languages.

So my question is: is this really feasible for SciTE?  If so, what is the “third rail” of the mechanism ... the part that I’m obviously missing?

Thanks in advance for any help from an SciTE Expert!

* The reason they start with a semicolon is so that all Au3 processing will treat them as simple comments.  I’m only looking for SciTE to display them in a different style.

Image00062.thumb.png.9b9af1779dcc4eaad4e

Image00063.thumb.png.2b4ff27a69e56167cac

 

 

Edited by qwert

Share this post


Link to post
Share on other sites
Jos

What you are looking for is not that easy as it sounds for the simple fact that what you want is overide the settings for each of the defined Lexer options and make sure their are showing a Bold version of these settings.

As I am not allowed to ask why you want this under your rule 1, so I will refrain from asking this question and going to wish you luck in your endeavour. :)
Let me know when you have a rounded proposal.

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
guinness

Having a different colour is enough! In the IDEs I use i don't have comment blocks set to be bold.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
qwert

Jos, just a quick clarification:

you want is overide the settings for each of the defined Lexer options and make sure their are showing a Bold version of these settings

I was thinking of a simpler approach: hard code the font and weight into the properties for the comment.stream elements.  I'm willing to work with a static "feature" and keep the properties editor just as it is.

Is that a "rounded proposal"?  (I'm not familiar with the term.)

Share this post


Link to post
Share on other sites
Jos

Maybe I am not totally understanding it yet:
Not sure why you would need a ;HS and ;HE when you only what the line starting with this option should be bold.

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
qwert

The pairing was just to make use of the already-existing comment.stream parameters.  I was going for a minimalist implementation.  But a bonus would have been if any bracketed lines took on the header font and bold look.

I can certainly live with a one-shot trigger that would affect a single line and keep this strictly for "special" comments.  My assumption is that it would have to start with ";" in order to avoid Au3 complications ... so something like ";H" could be the trigger.

Share this post


Link to post
Share on other sites
czardas

I don't agree that ';H' should be a trigger because it takes away the option of a normal commented ';H'. Why a bold comment is so important to you I'm unsure. It has some aesthetic value, but that seems to be about all it has.

Edited by czardas

Share this post


Link to post
Share on other sites
qwert

I really didn't think I would need to explain why another style of comment would be worthwhile, but let me offer this example of use:

Consider the chapters of a book ... and how the table of contents emphasizes each chapter apart from other material.  In much the same way, scripts of any length have Sections ... like Initialization ... GUI Definition ... Processing ... Supporting Functions ... etc.

I want the section headings of my scripts to stand out clearly.  A larger font ... maybe bolded ... maybe colored ... will do that.  In fact, I find it difficult to believe that after 30 years of refinement of source code editors that this isn't a standard feature.  

Regarding the ;H, it was just a placeholder choice to get this going.  I was probably going to change it to something like ;: or ;= for my own use.

Anyway, that's the backstory.  The reason I even started exploring this was the following note in an SciTE help site:

You can set up comment formats for a language and use the Block, Box or Stream Comment functions from the menu to automatically generate symbols that denote comments for a particular language. Below is an example for HTML comments.

comment.box.start.hypertext=<!--

comment.box.middle.hypertext=

comment.box.end.hypertext= -->

I still think Header Comments are feasible and worth doing.  But, working on my own, it may take me a while.

 

TOC_Example.thumb.png.319d52bb486182af69

Share this post


Link to post
Share on other sites
jchd

You seem to be confusing a programming language source code editor with LaTeX2e output.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
qwert

I don't see it that way at all.  It's like the difference between editing a text document with NotePad or WordPad. 

SciTE has 50 features for visually enhancing the character strings of the source code.

All I'm looking for is Feature #51.

 

Share this post


Link to post
Share on other sites
jchd

Then why not ask SciTE devs?


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
czardas

The way I see it is that comments are like a necessary evil: they (should really) have no influence on the code but a language needs to incorporate them into its syntax. How different elements within the code are displayed by an editor is a different concern, and I also understand the desire for greater flexibility. A relevant question would be - how much of a language's syntax resources should be devoted to creating complexity within comments?

Edited by czardas

Share this post


Link to post
Share on other sites
qwert

You can set up comment formats for a language and use the Block, Box or Stream Comment functions from the menu to automatically generate symbols that denote comments for a particular language. Below is an example for HTML comments.

comment.box.start.hypertext=<!--

comment.box.middle.hypertext=

comment.box.end.hypertext= -->

Again, SciTE seems built (with forethought) to handle just this kind of thing (more than one style of comment).

I'm just trying to decipher the related parameters and constructs.  Au3 properties has box comments and stream comments equated, both to #cs/#ce.  My minimum implementation would be:

1.  hard code the font and weight into the properties for the comment.stream elements.

2.  define a trigger character pair ( something like ;= ) to cause SciTE to display a line as a stream comment

That's it.

Share this post


Link to post
Share on other sites
Zip

If I get what you ask, what you are looking for already exists, not sure why no one mentioned it.
you can use the Keyword '#Region' '#EndRegion' for this.
 

Edited by Zip

Share this post


Link to post
Share on other sites
Jos

#Region-#EndRegion is really made to define sections of code which you can fold.
As to the OP's original request: A new AU3Lexer Style will have to be created and the logic will have to be made in LEXAU3.cxx to scan for this new Comment type and apply the new style to it.

Is it doable:Yes
Will I be working on it: Not until this would really serve a purpose for a larger group of people.

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
qwert

Thanks to everyone who has taken a look at this.

Jos is right, of course, about what it takes for a full implementation (I went to the well on this one and found the same definitive answer). I’d like to think that others will see the advantages of having a second style of comment lines and it can become a standard feature.

In the mean time, I’ve fashioned a solution that is working for me. I’m getting the kind of effect I wanted, with only a small distracting ‘artifact’ (unwanted “cs/ce” characters in the lines ... which are minor, all things considered).

I’ve attached a small section of a script that shows the effect.

If anyone is interested, I can post instructions in a few days.

 

Small_example.thumb.png.9275742469ede9cf

 

Share this post


Link to post
Share on other sites
guinness

I don't see how it adds value to what we already have.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
czardas

I don't think it's such a bad idea, but I also don't think it is worth adding as a language feature. I don't know of other languages that differentiate between bold and normal code, in comments or otherwise. Such formatting can be done separately - not as a language feature - using various methods.

Edited by czardas

Share this post


Link to post
Share on other sites
JLogan3o13

Looking at that code for a long period of time would make me    :puke:

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Jos

I don't think it's such a bad idea, but I also don't think it is worth adding as a language feature. I don't know of other languages that differentiate between bold and normal code, in comments or otherwise. Such formatting can be done separately - not as a language feature - using various methods.

This request is more a Editor/Lexer feature than a AutoIt3 Language feature.

Just in general:
Actually adding it would be trivial and documenting it would be more work than updating the Lexer code, but I do not want to bloat the code with stuff that is never used by the majority of people. There are 2 Comment styles already for commentlines (;) and commentblocks (#CS - #CE) which is what you find in most languages and supported by most Editors.

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

×