Auto-completing brackets and quotations

Auto-completing brackets and quotations

Cerpin Taxt

    Dec 12, 2005#1

    Hello all.
    I'm demoing UEStudio, and I'm having a lot of trouble getting it to do some simple things.

    When I type a left bracket, left parenthesis, or single/double quote, I'd like it to type the opposing symbol and put my caret in the center of the two, like this:

    Typing { causes {|} to occur. It would seem that the Advanced - Configuration setting Auto complete One-Symbol List would do this, but checking it does not cause it to work.Is there something I can place in my configuration file to allow this to work?

    6,688586
    Grand MasterGrand Master
    6,688586

      Jan 06, 2006#2

      Instead of using auto-complete, you can do this with a set of macros saved in a macro file which is automatically loaded during start of UEStudio. For example the macro for { could be:

      Macro property:

      Show cancel dialog for this macro: unchecked
      Continue if search string not found: unchecked
      Hotkey: Alt+Ctrl+7

      Alt+Ctrl+7 must be entered for { on a German keyboard. Simply press the key for { in the macro property dialog to get correct keyboard code for your keyboard.

      Macro code:

      Code: Select all

      IfExtIs "c"
      "{}"
      Key LEFT ARROW
      ExitMacro
      EndIf
      IfExtIs "cpp"
      "{}"
      Key LEFT ARROW
      ExitMacro
      EndIf
      IfExtIs "h"
      "{}"
      Key LEFT ARROW
      ExitMacro
      EndIf
      "{"
      I mainly use this technique for inserting German umlauts according to extension. For example for Ä:

      Show cancel dialog for this macro: unchecked
      Continue if search string not found: unchecked
      Hotkey: Shift+Ä

      Code: Select all

      IfExtIs "html"
      "Ä"
      ExitMacro
      EndIf
      IfExtIs "htm"
      "Ä"
      ExitMacro
      EndIf
      IfExtIs "asm"
      "Ae"
      ExitMacro
      EndIf
      IfExtIs "c"
      "Ae"
      ExitMacro
      EndIf
      IfExtIs "h"
      "Ae"
      ExitMacro
      EndIf
      IfExtIs "inc"
      "Ae"
      ExitMacro
      EndIf
      "Ä"
      Update 1: UEStudio has at Advanced - Configuration - IDE - IntelliTips - Miscellaneous some settings for auto-completion of brackets. So no macro is needed for automatic completion of { or [ or {.

      Update 2: The settings related to auto-completion of brackets moved from Advanced - Configuration - IDE - IntelliTips - Miscellaneous to Advanced - Settings or Configuration - Editor - Braces / strings with UEStudio v16.20 because of this feature became available also in UltraEdit for Windows v23.20.
      Best regards from an UC/UE/UES for Windows user from Austria

      cocentaina
      cocentaina

        Jan 18, 2006#3

        This is great. These are my macros for completion of the following chars: ", ', (, [, {.

        Code: Select all

        """"
        Key LEFT ARROW

        Code: Select all

        "''"
        Key LEFT ARROW

        Code: Select all

        "()"
        Key LEFT ARROW

        Code: Select all

        "[]"
        Key LEFT ARROW

        Code: Select all

        "{}"
        Key LEFT ARROW
        Hotkeys are ", ', (, [, {. Very simple, very useful.

        Now the only thing I need is snippet expansion like in TextMate - expand a keyword+<tab> to a snippet. For example, when you type

        Code: Select all

        inc<tab>
        you get:

        Code: Select all

        #include "|.h"

        6,688586
        Grand MasterGrand Master
        6,688586

          Jan 18, 2006#4

          Similar to "snippet expansion" is Auto Completion which can be by default activated with Ctrl+Space after entering for example #inc. See help of UEStudio about Auto Completion. But it is not possible to insert a phrase with auto completion and set the cursor automatically anywhere inside the phrase. The cursor will be always at the end of the auto-completed string. Using templates and macros could help here also for certain phrases which are used very often.
          Best regards from an UC/UE/UES for Windows user from Austria