Sign in to follow this  
Followers 0
Jos

Scite 1.60 Update

26 posts in this topic

Have updated the http://www.autoitscript.com/fileman/users/jdeb/scite4autoit3.exe with several suggestion Jon made and lots of updates to the SciLexer.dll.

Please realize that the current au3.properties and SciteGlobal.properties will be overridden with the default files (after a copy is made to the backup directory). All changes you make to SciTe should be done in the "User Options File".

This is the list of all changes made:

*** It will now suggest install to Program Files\autoit3\Scite.

*** Automatic update the autoit3dir=.... in au3.properties to the correct AutoIt3 directory.

*** Installer will make Scite the Program for Right Mouse Click Edit function.

*** Optionally make Scite the default Open function instead of Run.

*** Updated SciLexer for AutoIt3:

1. New folding Logic based on the AutoIt statements instead of indents.

2. Added comment-block and Preprocessor-block folding.

3. Added a new Style called special which has two keywords: #region #endregion.

The lexer will create a new fold on #region and end a fold at #endregion.

4. Statement folding will still be done within a #CS - #CE block.

*** Added 2 LUA function to show what it is capable of...

*** Added a Helpfile that is linked to the Help\Scite Help which has the following topics:

1. Introduction

2. Getting started with AutoIt3

3. Editor Fonts/Colors

4. Using Tidy

5. Scite Documentation

6. LAU Functions


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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Let me be the first to say :D:huh2::)

P.S. In the second section of the help file, some of the images are (rather lossy) JPEG instead of PNG. That's my only nitpick :lol:

Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

You have really outdone yourself now...

I've been away from autoit for a few weeks, and then buried - What a great editing environment that you and Valik have put together.

Your efforts are appreciated, and thank you.


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites

If you prefer you can also use .gif, you'll lose some colors but it will appear pretty nice. Avoid .jpg for windows image. Ok? :)

Thanks! :huh2::D

Share this post


Link to post
Share on other sites

The implementation of this editor is so good I have switched to using it for AutoIt creation. The addition of the lua was neat also. It certainly is not intuitive by any means. I searched for over an hour and cannot find a list of how lua can interact with the editor. The debug msgbox was not doing what I thought it should and I changed it to:

editor:AddText("MsgBox(4096,'debug:' , \"" .. word .. "\" \& '=' \& " .. word .. ") ;### Debug MSGBOX \n" )

All the documentation I looked at seemed to go in circles, look at one, it refers to another. None clearly indicated what can be done in the editor. I think the msgbox should be put on the line following the cursor, but I cannot figure out what command does that. Is there any doc available? :huh2::D

Share this post


Link to post
Share on other sites

I finaly found a copy of the iface file by downloading the filerx add on. The place that a web search shows this file is not available at Yahoo.

Anyway I added the LineDown() and the macro now works like a charm. :D

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

The implementation of this editor is so good I have switched to using it for AutoIt creation.  The addition of the lua was neat also.  It certainly is not intuitive by any means.  I searched for over an hour and cannot find a list of how lua can interact with the editor.  The debug msgbox was not doing what I thought it should and I changed it to:

All the documentation I looked at seemed to go in circles, look at one, it refers to another.  None clearly indicated what can be done in the editor.  I think the msgbox should be put on the line following the cursor, but I cannot figure out what command does that.  Is there any doc available?   :huh2:  :D

The Scite docs added in the helpfile are the standard html files that come with Scite, I only put them in a Helpfile together with the other stuff for convenience..

There is no real Documentation for Scite-LUA .. all they have is file called Scintilla.iface which is part of the Scitilla Source code in the dir include.

For LUA itself is a pretty good help available at their site.

The LUA scripts included were just to demo its functions and get you started.

Would be happy to include other script in the installset when they are usefull for everybody...

Edited by JdeB

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

Share this post


Link to post
Share on other sites

I finaly found a copy of the iface file by downloading the filerx add on.  The place that a web search shows this file is not available at Yahoo.

Anyway I added the LineDown() and the macro now works like a charm. :D

Good suggestion... i have changed it to look like this now:

function Debug_MsgBox() 
  from = editor:WordStartPosition(editor.CurrentPos)   
  to = editor:WordEndPosition(editor.CurrentPos)
  word = editor:textrange(from, to)              -- select current word 
  editor:Home()
  editor:LineDown()
  editor:AddText("MsgBox(4096,'debug:' , \'" .. word .. "\:' & " .. word .. ");### Debug MSGBOX \n" )
  _ALERT("inserted debug msgbox.")
end

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

Share this post


Link to post
Share on other sites

@JdeB

Looks lovely.

The one thing I really miss about Crimson editor is the ability to double click a line number to create a bookmark. Is this possible with all the modifications you are making?

Share this post


Link to post
Share on other sites

@JdeB

Looks lovely.

The one thing I really miss about Crimson editor is the ability to double click a line number to create a bookmark. Is this possible with all the modifications you are making?

Double click is selecting the whole line in Scite.

Ctrl+F2 does the Bookmark toggle. TextPad and also Crimson does it the same way.

Its something build into the Editor as far as i know and don't think it can be configured.


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

Share this post


Link to post
Share on other sites

Have made to following changes to the setup file:

*** Updated Debug LUA Script to insert the msgbox below the line. (see earlier in this thread.)

*** Added LUA Manual and Scite-LUA iFACE files to Helpfile for those interested to have a closer look at LUA.

*** Updated Gettingstarted page in helpfile with better quality pictures.

Interested in just the helpfile update --> http://www.autoitscript.com/fileman/users/jdeb/scite4autoit3.chm


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

Share this post


Link to post
Share on other sites

JdeB, can you keep the source (At least) and SciLexer.dll posted seperately, too? I don't need to download the whole setup package because I use CVS builds of SciTE/Scintilla (Which is why I would like the source available) and have configured the other stuff how I like them as well.

Share this post


Link to post
Share on other sites

JdeB, I don't know if you have these or not, but here are 2 Lua functions I wrote (to make posting to the forum easy for myself). One converts tabs to spaces and the other spaces to tabs (Based on the tabsize property). It does the entire document, not what's highlighted or some other range. Here is the code:

function ReplaceTabsWithSpaces()
    s = editor:textrange(0, editor.Length)
    s, n = string.gsub(s, "\t", string.rep(" ", editor.TabWidth))
    editor.TargetStart=0
    editor.TargetEnd=editor.Length
    _ALERT("Converting tabs to spaces: " .. n .. " tabs converted")
    editor:ReplaceTarget(s)
end

function ReplaceSpacesWithTabs()
    s = editor:textrange(0, editor.Length)
    s, n = string.gsub(s, string.rep(" ", editor.TabWidth), "\t")
    editor.TargetStart=0
    editor.TargetEnd=editor.Length
    _ALERT("Converting spaces to tabs: " .. n .. " tabs inserted")
    editor:ReplaceTarget(s)
end

And the additions to the Tools menu (No shortcut keys and available for all file types):

command.name.13.*=Replace Tabs With Spaces
command.subsystem.13.*=3
command.13.*=ReplaceTabsWithSpaces
command.save.before.13.*=2

command.name.14.*=Replace Spaces With Tabs
command.subsystem.14.*=3
command.14.*=ReplaceSpacesWithTabs
command.save.before.14.*=2

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

JdeB, can you keep the source (At least) and SciLexer.dll posted seperately, too?  I don't need to download the whole setup package because I use CVS builds of SciTE/Scintilla (Which is why I would like the source available) and have configured the other stuff how I like them as well.

Sure.. http://www.autoitscript.com/fileman/users/jdeb/test/lexau3.cxx

Was intending to sent it to Neil at the end of the week when there are no reports of any bugs in the new lexer code...

Edited by JdeB

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

Share this post


Link to post
Share on other sites

Thanks. Too bad you didn't get it in sooner. Neil is about to release 1.61 soon. After that comes out, he said he will fix the problem with colon's in CallTips. Hopefully by then I'll have gotten a good iface parser written and can get the API file out for Lua.

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

JdeB, I don't know if you have these or not, but here are 2 Lua functions I wrote (to make posting to the forum easy for myself).  One converts tabs to spaces and the other spaces to tabs (Based on the tabsize property).  It does the entire document, not what's highlighted or some other range.  Here is the code:

function ReplaceTabsWithSpaces()
    s = editor:textrange(0, editor.Length)
    s, n = string.gsub(s, "\t", string.rep(" ", editor.TabWidth))
    editor.TargetStart=0
    editor.TargetEnd=editor.Length
    _ALERT("Converting tabs to spaces: " .. n .. " tabs converted")
    editor:ReplaceTarget(s)
end

function ReplaceSpacesWithTabs()
    s = editor:textrange(0, editor.Length)
    s, n = string.gsub(s, string.rep(" ", editor.TabWidth), "\t")
    editor.TargetStart=0
    editor.TargetEnd=editor.Length
    _ALERT("Converting spaces to tabs: " .. n .. " tabs inserted")
    editor:ReplaceTarget(s)
end

And the additions to the Tools menu (No shortcut keys and available for all file types):

command.name.13.*=Replace Tabs With Spaces
command.subsystem.13.*=3
command.13.*=ReplaceTabsWithSpaces
command.save.before.13.*=2

command.name.14.*=Replace Spaces With Tabs
command.subsystem.14.*=3
command.14.*=ReplaceSpacesWithTabs
command.save.before.14.*=2
Maybe is a good plan to compile a list of these function and update the included AutoIt3.LUA in the installset.

I don't use it myself since i run Tidy before posting and have that set to space... :D

EDIT: Do you only replace leading TAB/Spaces with these functions?

Edited by JdeB

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

Share this post


Link to post
Share on other sites

string.gsub is the equivalent to AutoIt's StringReplace() so I assume it replaces every tab it can find no matter where it is. The same holds true for spaces. Any 4 spaces (4 by my settings, it may be higher or lower for different users) are replaced by a tab character.

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

string.gsub is the equivalent to AutoIt's StringReplace() so I assume it replaces every tab it can find no matter where it is.  The same holds true for spaces.  Any 4 spaces (4 by my settings, it may be higher or lower for different users) are replaced by a tab character.

... i guess i knew the answer but wanted to give a hint .... :D

Ofcourse i meant to say : shouldn't it only do the leading spaces / tabs because you now have the risk that some of the literals will be screwed up...

Edited by JdeB

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

Share this post


Link to post
Share on other sites

Well, I never imbed tabs, I use @Tab, so it wasn't something I considered. This was really meant to be just a quick conversion and not something permanent or anything.

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
Sign in to follow this  
Followers 0