Jump to content

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


Recommended Posts

Posted
  On 12/27/2023 at 12:43 PM, 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 

Expand  

You are the bomb!

  • Developers
Posted
  On 1/23/2024 at 10:13 PM, 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?

Expand  

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

  • Developers
Posted

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

Posted

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

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted

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

  Reveal hidden contents

 

  • Developers
Posted
  On 1/24/2024 at 1:35 PM, 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?

Expand  

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

 

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)

This new option

  On 11/3/2023 at 11: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.
....

Expand  
Expand  

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

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted
  On 1/24/2024 at 3:09 PM, Jos said:

deselect at pressing RightMouse

Expand  

Ya, exactly. Kind of odd.

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted

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

  Reveal hidden contents

 

  • Developers
Posted
  On 1/24/2024 at 6:13 PM, donnyh13 said:

I found another strange indent behaviour.

Expand  

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

Posted

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

  Reveal hidden contents

 

Posted (edited)

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? It did seem to improve the functionality, I think. :) Don't have time to keep testing right now.

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

  • Developers
Posted

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

Posted

Right. That makes sense.

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted (edited)

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

  Reveal hidden contents

 

  • 1 month later...
Posted

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

  Reveal hidden contents

 

  • 2 weeks later...
Posted (edited)

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

  Reveal hidden contents

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

  Reveal hidden contents

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

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