Jump to content

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


Jos
 Share

Recommended Posts

On 12/27/2023 at 7:43 AM, Jos said:

Updated the initial post with a link to the latest updated SciTE4AutoIt3 beta installer and portable zip file. These contain all the current/latest versions so no need for other stuff after the update. Don't forget to make a Backup first to ensure there is an easy rollback in case of issues. :) 

Jos 

You are the bomb!

Link to comment
Share on other sites

  • Developers
9 hours ago, donnyh13 said:

I would think the short name should be at the top, no? Though I don't know if it can be improved, since lua does the sorting?

I will have a look, but sorting is not as straightforward as simply sorting an array: the logic adds an key in front of the keyword to determine the priority depending on the start position of the found typed string in the keyword. :)    

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

  • Developers

I need to test a bit more but you could test the change  I think is the reason for this by replacing line 821 in AutoItAutoComplete.lua with:

table.insert(tStartKeywords, ddsort .. ' ~#~' .. ddentry)

... adding a space before the tiled sign forcing the ddsort keyword to end with an space for proper sorting.

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

Thanks Jos, I'll give it a shot and get back to you.

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."

 

Link to comment
Share on other sites

One other question, more related to, I think, Neil's side of things? In trying out the new right click menu option to drop a selection, I notice upon right clicking all selections are lost. Am I missing a key combination? Or is this a bug?

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."

 

Link to comment
Share on other sites

  • Developers
42 minutes ago, donnyh13 said:

In trying out the new right click menu option to drop a selection, I notice upon right clicking all selections are lost. Am I missing a key combination? Or is this a bug?

New option ?  .....   or do you the below new option which is in version Scintilla 5.4.1 and thus not yet in my version?:

Quote
  • Ctrl-click on a selection deselects it in multiple selection mode.

 

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

This new option

On 11/3/2023 at 5:54 AM, Jos said:

Next version of SciTE will be out soon (SciTE 5.3.9) with:
 

Quote

Add "Drop Selection" to the context menu to deselect one piece of a multiple selection.
....

Although your new-new option will solve my problem :)

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."

 

Link to comment
Share on other sites

  • Developers

Ok...  is see which option you refer to. No idea why that works the way it does as it simply seems to deselect at pressing RightMouse.

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

29 minutes ago, Jos said:

deselect at pressing RightMouse

Ya, exactly. Kind of odd.

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."

 

Link to comment
Share on other sites

Hi again Jos,

I found another strange indent behaviour.

If  you click after "UBound($asFonts) - 1" and push enter once, then right away press ";" to insert a comment, it inserts another line break after the semicolon.

Local $asFonts[0]
Local $bTest

For $i = 0 To UBound($asFonts) - 1
$bTest = False
Next

 

Local $asFonts[0]
Local $bTest

For $i = 0 To UBound($asFonts) - 1
;

$bTest = False
Next

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."

 

Link to comment
Share on other sites

  • Developers
2 hours ago, donnyh13 said:

I found another strange indent behaviour.

That whole Ident-fix routine is still on my todo list to fix/review/rewrite....

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

Okay, thanks. Wasn't sure if this was one of those indent problems you wanted reported or not.

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."

 

Link to comment
Share on other sites

  • Developers

It's good to report these quirks so I can check them, but just to have a period of time to sit down a go over this whole indent function.

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

Hi Jos, I’ve been playing with your indentation script some, and I found, in my eyes, a partial fix for my just reported issue. When running indentation on any "For", "While", etc. lines the indenter was placing the caret half way through the tab mark, i.e. the end of the tab should be position 3114, it places it in position 3112. The reason for this was this part

(currindentpos - previndentpos)

on Line 78 (My lines might be off -- Added several print statements)

editor.SelectionNCaret[editor.MainSelection] = editor.SelectionNCaret[editor.MainSelection] + (currindentpos - previndentpos)

returns a -1 on For, While, etc lines, but a 0 on regular lines. But I "fixed" this by switching that last portion around,

(previndentpos - currindentpos)

and changed line 78 to:

editor.SelectionNCaret[editor.MainSelection] = editor.SelectionNCaret[editor.MainSelection] + (previndentpos - currindentpos)

I’ve tried it in a few places and it seems to work well now (for "If", "While", "For",) and for regularly indented stuff. But it still fails on unindented "While", "For" etc. lines. I haven’t had time yet to test why this is, but maybe this will help some? And of course, I am far from understanding of the proper indentation for these things. But it did improve the functionality, I think. :) Don't have time to keep testing right now.

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."

 

Link to comment
Share on other sites

  • Developers

I think the issue starts with setting previndentpos to the indent of the wrong line. The Caret position seems to be set between the CR & LF as it doesn't display it at all and adds that extra new line when you start typing. 

 

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

Right. That makes sense.

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."

 

Link to comment
Share on other sites

Changing

editor.SelectionNCaret[editor.MainSelection] = editor.SelectionNCaret[editor.MainSelection] + (currindentpos - previndentpos)

To

editor.SelectionNCaret[editor.MainSelection] = editor:FindColumn(line, previndent)

Fixes most of the troubles, but it still doesn’t work when auto-completeing with autocomplete.au3.on.enter= set to \n

Maybe I'll leave it to the professional. :)

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."

 

Link to comment
Share on other sites

  • 1 month later...

Hi Jos, hope you are well,
It was frustrating me why the above fix wasn’t working completely, so I took another look at the indenting script, and figured out why it doesn’t work when autocomplete.au3.on.enter=\n is set. In the AutoItAutoComplete.lua, where it manually calls the Indenter (AutoItIndentFix:OnUpdateUI()), ncarretpos wasn’t being updated after fixing the indents, therefore it was losing the new indent position. So at about line 700, I added the following to AutoItAutoComplete.lua:

AutoItIndentFix:OnUpdateUI()
                        ncarretpos = editor.SelectionNCaret[editor.MainSelection]--+

Everything now works great, as best as I can tell.

I made one other addition to the AutoItIndentFix.lua. It was annoying me, that when I press enter on a blank line (with indentation removed after a save), that the indenter wasn’t recognizing there needed to sometimes be an indent added, so I changed line 84 (approximately) from:

previndent = editor.LineIndentation[line - 1]

To:

previndent = 0
                for j = line - 1, 0, -1 do
                    if editor:LineLength(j) > 2 then
                        previndent = editor.LineIndentation[j]
                        break  
                    end
                end

It now searches for the last non-empty line to get the indent value from instead.

Thought I would pass this along in case it gives you any ideas/help.

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."

 

Link to comment
Share on other sites

  • Developers

I will take a look at this when I have the urge to pick up that function again and do some real re-coding. :) 

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

  • 2 weeks later...

I think the Tools -> Trace: Add Trace Lines tool is broken.
 

Spoiler
Global Enum $TOKENPRIMARY = 1, $TOKENIMPERSONATION
Global Enum $TOKENUSER = 1, $TOKENGROUPS, $TOKENPRIVILEGES, $TOKENOWNER, $TOKENPRIMARYGROUP, $TOKENDEFAULTDACL, $TOKENSOURCE, $TOKENTYPE, $TOKENIMPERSONATIONLEVEL, $TOKENSTATISTICS, $TOKENRESTRICTEDSIDS, $TOKENSESSIONID, $TOKENGROUPSANDPRIVILEGES, $TOKENSESSIONREFERENCE, $TOKENSANDBOXINERT, $TOKENAUDITPOLICY, $TOKENORIGIN, $TOKENELEVATIONTYPE, $TOKENLINKEDTOKEN, $TOKENELEVATION, $TOKENHASRESTRICTIONS, $TOKENACCESSINFORMATION, $TOKENVIRTUALIZATIONALLOWED, $TOKENVIRTUALIZATIONENABLED, $TOKENINTEGRITYLEVEL, $TOKENUIACCESS, $TOKENMANDATORYPOLICY, $TOKENLOGONSID
Global Const $TOKEN_ASSIGN_PRIMARY = 0x00000001
Global Const $TOKEN_DUPLICATE = 0x00000002
Global Const $TOKEN_IMPERSONATE = 0x00000004

 

when using it on the code above, it produces this for me and stops inserting trace lines:

Spoiler
Global Enum $TOKENPRIMARY = 1, $TOKENIMPERSONATION
ConsoleWrite('>Error code: ' & @error & @CRLF & @CRLF & '@@ Trace(3) :    Global Enum $TOKENUSER = 1, $TOKENGROUPS, $TOKENPRIVILEGES, $TOKENOWNER, $TOKENPRIMARYGROUP, $TOKENDEFAULTDACL, $TOKENSOURCE, $TOKENTYPE, $TOKENIMPERSONATIONLEVEL, $TOKENSTATISTICS, $TOKENRESTRICTEDSIDS, $TOKENSESSIONID, $TOKENGROUPSANDPRIVILEGES, $TOKENSESSIONREFERENCE, $TOKENSANDBOXINERT, $TOKENAUDITPOLICY, $TOKENORIGIN, $TOKENELEVATIONTYPE, $TOKENLINKEDTOKEN, $TOKENELEVATION, $TOKENHASRESTRICTIONS, $TOKENACCESSINFORMATION, $TOKENVIRTUALIZATIONALLOWED, $TOKENVIRTUALIZATIONENABLED, $TOKENINTEGRITYLEVEL, $TOKENUIACCESS, $TOKENMANDATORYPOLICY, $TOKENLOGONSID'  & @CRLF) ;### Trace Console
ConsoleWrite('>Error code: ' & @error & @CRLF & @CRLF & '@@ Trace(4) :    Global Enum $TOKENUSER = 1, $TOKENGROUPS, $TOKENPRIVILEGES, $TOKENOWNER, $TOKENPRIMARYGROUP, $TOKENDEFAULTDACL, $TOKENSOURCE, $TOKENTYPE, $TOKENIMPERSONATIONLEVEL, $TOKENSTATISTICS, $TOKENRESTRICTEDSIDS, $TOKENSESSIONID, $TOKENGROUPSANDPRIVILEGES, $TOKENSESSIONREFERENCE, $TOKENSANDBOXINERT, $TOKENAUDITPOLICY, $TOKENORIGIN, $TOKENELEVATIONTYPE, $TOKENLINKEDTOKEN, $TOKENELEVATION, $TOKENHASRESTRICTIONS, $TOKENACCESSINFORMATION, $TOKENVIRTUALIZATIONALLOWED, $TOKENVIRTUALIZATIONENABLED, $TOKENINTEGRITYLEVEL, $TOKENUIACCESS, $TOKENMANDATORYPOLICY, $TOKENLOGONSID'  & @CRLF) ;### Trace Console
ConsoleWrite('>Error code: ' & @error & @CRLF & @CRLF & '@@ Trace(5) :    Global Enum $TOKENUSER = 1, $TOKENGROUPS, $TOKENPRIVILEGES, $TOKENOWNER, $TOKENPRIMARYGROUP, $TOKENDEFAULTDACL, $TOKENSOURCE, $TOKENTYPE, $TOKENIMPERSONATIONLEVEL, $TOKENSTATISTICS, $TOKENRESTRICTEDSIDS, $TOKENSESSIONID, $TOKENGROUPSANDPRIVILEGES, $TOKENSESSIONREFERENCE, $TOKENSANDBOXINERT, $TOKENAUDITPOLICY, $TOKENORIGIN, $TOKENELEVATIONTYPE, $TOKENLINKEDTOKEN, $TOKENELEVATION, $TOKENHASRESTRICTIONS, $TOKENACCESSINFORMATION, $TOKENVIRTUALIZATIONALLOWED, $TOKENVIRTUALIZATIONENABLED, $TOKENINTEGRITYLEVEL, $TOKENUIACCESS, $TOKENMANDATORYPOLICY, $TOKENLOGONSID'  & @CRLF) ;### Trace Console
ConsoleWrite('>Error code: ' & @error & @CRLF & @CRLF & '@@ Trace(6) :    Global Enum $TOKENUSER = 1, $TOKENGROUPS, $TOKENPRIVILEGES, $TOKENOWNER, $TOKENPRIMARYGROUP, $TOKENDEFAULTDACL, $TOKENSOURCE, $TOKENTYPE, $TOKENIMPERSONATIONLEVEL, $TOKENSTATISTICS, $TOKENRESTRICTEDSIDS, $TOKENSESSIONID, $TOKENGROUPSANDPRIVILEGES, $TOKENSESSIONREFERENCE, $TOKENSANDBOXINERT, $TOKENAUDITPOLICY, $TOKENORIGIN, $TOKENELEVATIONTYPE, $TOKENLINKEDTOKEN, $TOKENELEVATION, $TOKENHASRESTRICTIONS, $TOKENACCESSINFORMATION, $TOKENVIRTUALIZATIONALLOWED, $TOKENVIRTUALIZATIONENABLED, $TOKENINTEGRITYLEVEL, $TOKENUIACCESS, $TOKENMANDATORYPOLICY, $TOKENLOGONSID'  & @CRLF) ;### Trace Console
Global Enum $TOKENUSER = 1, $TOKENGROUPS, $TOKENPRIVILEGES, $TOKENOWNER, $TOKENPRIMARYGROUP, $TOKENDEFAULTDACL, $TOKENSOURCE, $TOKENTYPE, $TOKENIMPERSONATIONLEVEL, $TOKENSTATISTICS, $TOKENRESTRICTEDSIDS, $TOKENSESSIONID, $TOKENGROUPSANDPRIVILEGES, $TOKENSESSIONREFERENCE, $TOKENSANDBOXINERT, $TOKENAUDITPOLICY, $TOKENORIGIN, $TOKENELEVATIONTYPE, $TOKENLINKEDTOKEN, $TOKENELEVATION, $TOKENHASRESTRICTIONS, $TOKENACCESSINFORMATION, $TOKENVIRTUALIZATIONALLOWED, $TOKENVIRTUALIZATIONENABLED, $TOKENINTEGRITYLEVEL, $TOKENUIACCESS, $TOKENMANDATORYPOLICY, $TOKENLOGONSID
Global Const $TOKEN_ASSIGN_PRIMARY = 0x00000001
Global Const $TOKEN_DUPLICATE = 0x00000002
Global Const $TOKEN_IMPERSONATE = 0x00000004

 

EDIT: This probably only happens if you set wrap=1 in scite.properties as it works properly if I zoom out all the way.. so for now a workaround is to disable line wrapping in scite!

Edited by paw
more information
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...