Modify

#3751 closed Bug (Fixed)

Abbreviation Manager with abbreviation [

Reported by: Nine Owned by: Melba23
Milestone: Component: SciTE4AutoIt
Version: 3.3.14.5 Severity: None
Keywords: Cc:

Description

Creating an abbreviation with character [ generates all sort of problems. Unable to delete, to rename, to edit. Only way to get rid of it is to go directly into the au3UserAbbrev.properties file and delete the line.

Attachments (0)

Change History (7)

comment:1 by mLipok, on Mar 3, 2020 at 7:42:05 AM

Component: AutoItSciTE4AutoIt
Owner: set to Jos

comment:2 by Melba23, on Mar 4, 2020 at 9:30:23 AM

Owner: changed from Jos to Melba23
Status: newassigned

comment:3 by Melba23, on Mar 4, 2020 at 10:41:04 AM

After some testing I take it you are referring to using the "[" character in the NAME of the abbreviation and not in the text to be inserted when the abbreviation is expanded. I will look into why this is the case.

M23

comment:4 by Melba23, on Mar 4, 2020 at 11:02:52 AM

The problem is in the RegEx used to match the abbreviation name to the list of existing abbreviations - it fails to match if there is a "[" character in the name. I imagine it is because the "[" character has a special meaning within a RegEx pattern.

I will see what I can do to get around this.

M23

comment:5 by Melba23, on Mar 4, 2020 at 11:20:21 AM

I have removed the offending RegEx and used a less elegant, but functioning(!) StringInStr in its place. Please try this version of the _SearchArray function - you will need to replace the existing function in "Your_Path\AutoIt3\SciTE\SciTEConfig\AbbrevMan.au3":

Func _SearchArray($aArray, $sAbbrev_Name)

		For $i = 1 To $aArray[0]

			Local $iIndex = StringInStr($aArray[$i], "=")
			If $iIndex <> 0 Then
				If StringLeft($aArray[$i], $iIndex - 1) = $sAbbrev_Name Then
					Return $i
				EndIf
			EndIf

		Next
		Return -1

	EndFunc   ;==>_SearchArray

If you are unsure of just what to do, please send me a PM and I will explain in more detail and/or send you a whole new AbbrevMan file.

M23

Edit: Sorry, just seen who raised the ticket - no intent to suggest you do not know what you are doing!

Last edited on Mar 4, 2020 at 12:35:27 PM by Melba23 (previous) (diff)

comment:6 by anonymous, on Mar 5, 2020 at 10:52:17 PM

No offense M23. It works perfect, thank you very much.

comment:7 by Melba23, on Mar 6, 2020 at 8:54:33 AM

Resolution: Fixed
Status: assignedclosed

Modify Ticket

Action
as closed The owner will remain Melba23.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.