Menu

#2275 Several problems with the functionality of abbreviations

Bug
closed-fixed
nobody
5
2021-09-22
2021-08-15
No
  1. GTK only: The Insert Abbreviation dialog is not closed by pressing the Enter key inside the Abbreviation field.

  2. GTK only: Pressing the Esc key inside the Insert Abbreviation dialog inserts the abbreviation that was inserted the last time. If you click the Cancel button in the dialog, then this problem disappears.

  3. If you insert an abbreviation that contains a tab before the "|" character, the cursor will not be positioned correctly.

Try this abbreviation: test={\n\t|\n}

  1. When using the Expand Abbreviation command, if the abbreviation begins with a tab and indent.automatic = 0, the original line indent will be removed.

Try this abbreviation: test2=\t{\n\t\t|\n\t}

On a new line, press TAB 2 times, type "test2" and press Ctrl+B.

  1. When using the Expand Abbreviation command, if there are spaces after the caret, the indentation will be incorrect.

On a new line, press TAB 2 times, type "test", press TAB again, place the cursor after the word "test" and press Ctrl+B.

  1. When using the Insert Abbreviation command, there is a problem similar to the previous one.

On a new line, press TAB 3 times, place the cursor before last tab, press Ctrl+Shift+R and insert the abbreviation "test".

1 Attachments

Related

Feature Requests: #1552

Discussion

  • Neil Hodgson

    Neil Hodgson - 2021-08-17

    There are multiple changes here and it would be better to separate some parts.

    (1) and (2) appear to be causing all the changes to SciTEBase.h, SciTEGTK.cxx, SciTEWin.h, SciTEWinDlg.cxx, and the StartInsertAbbreviation removal and IDM_INS_ABBREV case in SciTEBase.cxx. These are reasonably straightforward.

    There's no rationale for removing wEditor.Cancel() in IDM_INS_ABBREV. Autocompletion lists and other Scintilla modes could cause problems so they are cancelled before abbreviation expansion.

    Committed the changes for (1) and (2) as [ba4b73].

    That leaves the attached patch containing the changes to PerformInsertAbbreviation and StartExpandAbbreviation for later consideration.

     

    Related

    Commit: [ba4b73]

  • Neil Hodgson

    Neil Hodgson - 2021-08-18

    The new PerformInsertAbbreviation doesn't preserve selected text like the old version and one of the temporary '|' survives. With the abbreviation:

    ff=for ()
    

    Type "more", select it then InsertAbbreviation | ff. The old version produced

    for ()more
    

    The changed version produces

    for ()ore|
    
     
  • Andrey Moskalyov

    This error occurs when the caret position is not explicitly specified in the abbreviation. Fixed.

     
  • Neil Hodgson

    Neil Hodgson - 2021-08-21
    • labels: --> scite, abbreviation, gtk
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2021-08-21

    Committed as [c30553] with a minor change making selStart const to avoid a warning from MSVC code analysis.

     

    Related

    Commit: [c30553]

  • Neil Hodgson

    Neil Hodgson - 2021-09-22
    • status: open-fixed --> closed-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2021-09-22

    Committed as [c30553] with a minor change making selStart const to avoid a warning from MSVC code analysis.

     

    Related

    Commit: [c30553]


Log in to post a comment.

MongoDB Logo MongoDB