Jump to content

BETA: SciTE v5x & lua Dynamic_include and "Smart" AutoComplete for Vars/UDFs/Abbrevs


Recommended Posts

  • Developers
Posted
8 hours ago, donnyh13 said:

So far, with minimum testing, I don’t see any problems. But I look forward to your input.

Thanks, I'll have a look later to see what your change does. 🙂

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.
  :)

  • Developers
Posted (edited)
On 9/20/2025 at 3:47 AM, rcmaehl said:

Props for detecting VSC and allowing it as the default editor! 

Right...  but not sure what you expect next after this elaborate info?
One stab-in-the-dark: Did you ever manually fixed the Open-With setting?  You can check this in SciTEConfig/Other Tools/Run AutoIt3/SciTE check 

Edited by 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.
  :)

  • Developers
Posted
13 hours ago, donnyh13 said:

Good morning Jos,

I did some tinkering with your indenter, and came up with the following. I fixed a couple typo’s, and added a couple of extra checks, etc. I didn’t mark the changes, I’m supposing you can do a comparison? But if you want, I can mark them and repost. So far, this seems to work good? If “\n” is enabled for auto-complete with enter, it was still breaking the positioning of the cursor. So to fix that, I had to do the following modification to AutoItAutoComplete.lua, line 718, after

AutoItIndentFix:OnUpdateUI()

Add the following:

-- Update to new indented position.

ncarretpos = editor.SelectionNCaret[editor.MainSelection]

So far, with minimum testing, I don’t see any problems. But I look forward to your input.

Best regards,

AutoItIndentFix.lua 17.86 kB · 1 download

Thanks for the extensive update of the AutoItIndentFix.lua! I have merged your changes into my version and had a quick play, which looks good.
Also did the update in AutoItAutoComplete.lua .
They will be part of the next upload unless any issues are found.

Cheers 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.
  :)

Posted (edited)

No problem Jos. Glad to be able to hopefully repay you a bit for all your work you've done on this.

I look forward to hearing further on any of your findings. :)

Best regards.

On 9/20/2025 at 1:12 AM, Jos said:

Right...  but not sure what you expect next after this elaborate info?

I think they are saying thanks/kudos on allowing VSC to be the default editor in the install?

Quote

Props can mean compliment / respect / credit,

 

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

Spoiler

"Life is chiefly made up, not of great sacrifices and wonderful achievements, but of little things. It is oftenest through the little things which seem so unworthy of notice that great good or evil is brought into our lives. It is through our failure to endure the tests that come to us in little things, that the habits are molded, the character misshaped; and when the greater tests come, they find us unready. Only by acting upon principle in the tests of daily life can we acquire power to stand firm and faithful in the most dangerous and most difficult positions."

 

  • Developers
Posted
33 minutes ago, donnyh13 said:

I think they are saying thanks/kudos on allowing VSC to be the default editor in the install?

Quote

Props can mean compliment / respect / credit,

 

So that means I am really getting too old for all of this. :lol:   
Sorry @rcmaehl for not staying up-to-date on the "street lingo".

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.
  :)

Posted
5 minutes ago, Jos said:

too old for all of this

😂

Don't feel bad Jos, I had to google what it meant too :)

I've heard it used a few times before though.

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

Spoiler

"Life is chiefly made up, not of great sacrifices and wonderful achievements, but of little things. It is oftenest through the little things which seem so unworthy of notice that great good or evil is brought into our lives. It is through our failure to endure the tests that come to us in little things, that the habits are molded, the character misshaped; and when the greater tests come, they find us unready. Only by acting upon principle in the tests of daily life can we acquire power to stand firm and faithful in the most dangerous and most difficult positions."

 

Posted (edited)

Hi Jos,

A small update. The indenter is adding indents inside of #Regions, I fixed this by changing line 216 from

elseif Curr_firstword == "" and Curr_lastword == "" and Parent_line ~= -1 then

To

elseif Curr_firstword == "" and Curr_lastword == "" and Parent_line ~= -1 and
                string.find(',if,do,while,with,for,select,switch,func,volatile,', ',' .. fold_firstword .. ',', nil, true) ~= nil then

Sorry for the oversight.

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

Spoiler

"Life is chiefly made up, not of great sacrifices and wonderful achievements, but of little things. It is oftenest through the little things which seem so unworthy of notice that great good or evil is brought into our lives. It is through our failure to endure the tests that come to us in little things, that the habits are molded, the character misshaped; and when the greater tests come, they find us unready. Only by acting upon principle in the tests of daily life can we acquire power to stand firm and faithful in the most dangerous and most difficult positions."

 

Posted
9 hours ago, Jos said:

So that means I am really getting too old for all of this. :lol:   
Sorry @rcmaehl for not staying up-to-date on the "street lingo".

It's no problem. I'm starting to fall behind with street lingo myself. Kids these days with their "sigmas" and "mewing" and such

 

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11, MSEdgeRedirect
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Posted

Hi Jos,

I have a question regarding the Indenter.

In the following example:

Func _Test1()
;~  Local $123
;#
    ;#

        ; A Comment
        ;#
    ;#
EndFunc

Func _Test2()
;~  Local $123
    ;#

        ; An inline Comment
    ;#
EndFunc

Which function do you think demonstrates what you consider proper behaviour? _Test1 or _Test2? Each ";#" indicates where the caret is placed after pressing enter. _Test1 indicates the current behaviour which makes it convenient to write multiline comments in a neat row. _Test2 would keep things more strictly indented based on the current fold.

Or perhaps a third option of:

Func _Test3()
;~  Local $123
    ;#
    ;#

        ; A Comment
        ;#
    ;#
EndFunc

Where the indent is corrected on the next line to proper indentation only after comments with ";~", and not ";".

Or perhaps its fine as it stands?
Thanks,

Best regards,

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

Spoiler

"Life is chiefly made up, not of great sacrifices and wonderful achievements, but of little things. It is oftenest through the little things which seem so unworthy of notice that great good or evil is brought into our lives. It is through our failure to endure the tests that come to us in little things, that the habits are molded, the character misshaped; and when the greater tests come, they find us unready. Only by acting upon principle in the tests of daily life can we acquire power to stand firm and faithful in the most dangerous and most difficult positions."

 

  • Developers
Posted

I've tried to simply follow the rules that Tidy uses when it comes to indentation. In that case neither is perfect as this is the result with my tidy settings:

Func _Test1()
;~  Local $123
    ;#
    ;#

    ; A Comment
    ;#
    ;#
EndFunc   ;==>_Test1

Func _Test2()
;~  Local $123
    ;#

    ; An inline Comment
    ;#
EndFunc   ;==>_Test2

 

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.
  :)

Posted

Hi Jos,

Not sure if you are wishing for a fix to the comments. But if so:

I added to ~Line  105:

if string.find(editor:GetLine(Parent_line), "^%s*;") then
                self:DebugPrint('! Parent Line is a Comment, finding real parent.', "Old Parent line: " .. Parent_line, "New Parent Line: " .. editor.FoldParent[Parent_line])
                Parent_line = editor.FoldParent[Parent_line]

            end

And to ~line 228, after:

elseif Curr_firstword == "" and Curr_lastword == "" and Parent_line ~= -1 and
                        string.find(',if,do,while,with,for,select,switch,func,volatile,', ',' .. fold_firstword .. ',', nil, true) ~= nil then
                    -- Empty line in a fold, update indent to appropriate parent fold level.
                    editor.LineIndentation[line + 1] = editor.LineIndentation[Parent_line] + editor.Indent
                    self:DebugPrint('- Empty line in a keyword, update indent to Parent + 1 --', editor.LineIndentation[line + 1])

Added the following:

elseif (string.find(Curr_firstword, "^;") ~= nil) and Curr_lastword == "" then
                    -- Correct Indent after a comment which may be in the wrong indentation position.
                    if (Parent_line ~= -1) and
                        string.find(',if,do,while,with,for,select,switch,func,volatile,', ',' .. fold_firstword .. ',', nil, true) ~= nil then
                    editor.LineIndentation[line + 1] = editor.LineIndentation[Parent_line] + editor.Indent
                    self:DebugPrint('- New line after a comment, update indent to Parent + 1 --', "New Indent Level: " .. editor.LineIndentation[line + 1])
                    else
                    editor.LineIndentation[line + 1] = 0
                    self:DebugPrint('- New line after a comment outside of a fold, update indent to 0 --', "New Indent Level: " .. editor.LineIndentation[line + 1])
                    end

If you're not concerned. You can ignore this. :)

Best regards,

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

Spoiler

"Life is chiefly made up, not of great sacrifices and wonderful achievements, but of little things. It is oftenest through the little things which seem so unworthy of notice that great good or evil is brought into our lives. It is through our failure to endure the tests that come to us in little things, that the habits are molded, the character misshaped; and when the greater tests come, they find us unready. Only by acting upon principle in the tests of daily life can we acquire power to stand firm and faithful in the most dangerous and most difficult positions."

 

  • Developers
Posted
8 hours ago, donnyh13 said:

Hi Jos,

Not sure if you are wishing for a fix to the comments. But if so:

I added to ~Line  105:

if string.find(editor:GetLine(Parent_line), "^%s*;") then
                self:DebugPrint('! Parent Line is a Comment, finding real parent.', "Old Parent line: " .. Parent_line, "New Parent Line: " .. editor.FoldParent[Parent_line])
                Parent_line = editor.FoldParent[Parent_line]

            end

And to ~line 228, after:

elseif Curr_firstword == "" and Curr_lastword == "" and Parent_line ~= -1 and
                        string.find(',if,do,while,with,for,select,switch,func,volatile,', ',' .. fold_firstword .. ',', nil, true) ~= nil then
                    -- Empty line in a fold, update indent to appropriate parent fold level.
                    editor.LineIndentation[line + 1] = editor.LineIndentation[Parent_line] + editor.Indent
                    self:DebugPrint('- Empty line in a keyword, update indent to Parent + 1 --', editor.LineIndentation[line + 1])

Added the following:

elseif (string.find(Curr_firstword, "^;") ~= nil) and Curr_lastword == "" then
                    -- Correct Indent after a comment which may be in the wrong indentation position.
                    if (Parent_line ~= -1) and
                        string.find(',if,do,while,with,for,select,switch,func,volatile,', ',' .. fold_firstword .. ',', nil, true) ~= nil then
                    editor.LineIndentation[line + 1] = editor.LineIndentation[Parent_line] + editor.Indent
                    self:DebugPrint('- New line after a comment, update indent to Parent + 1 --', "New Indent Level: " .. editor.LineIndentation[line + 1])
                    else
                    editor.LineIndentation[line + 1] = 0
                    self:DebugPrint('- New line after a comment outside of a fold, update indent to 0 --', "New Indent Level: " .. editor.LineIndentation[line + 1])
                    end

If you're not concerned. You can ignore this. :)

Best regards,

Just PM me or attach the updated LUA file when you have fixes, and I will merge them into my local version for the next upload. 🙂

 

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.
  :)

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
  • Recently Browsing   0 members

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