#484 \ as a key replacement does not trigger autocompletion

None
open
nobody
None
1
2013-06-25
2013-06-20
thomas
No

Hi,
I would like to have "\" as a key replacement, since it is not a regular key on a german keyboard.
So I have a macro replacing "ß" with "\". The problem with that is, that the replacement does not trigger the autocompletion.
This makes sense if your macro ads a full latex command.
I use the same approace for "{" and here the key replacement triggers the autocompletion of closing backets.
I use Texstudio 2.6.

Discussion

  • Ticket moved from /p/texstudio/bugs/750/

     
  • you do not need the triggers for single keys, there you can just set a shortcut for the macro on the shortcut config page.

    (if you cannot write \ in the shortcut box, write it in the editor and copy it there)

     
  • thomas
    thomas
    2013-06-21

    Sorry I do not understand your solution.
    I am not talking about a trigger for the macro.

    I have a macro with a shortcut, the shortcut is "ß".
    The macro is "\". Because "\" would regulary be "AltGr ß" on my keyboard.

    So I would like to type ßcite which gives \cite in the editor, but this triggers not the autocompletion list for the \cite command.

     
  • seems we did not understand the question...

    You can use

    %SCRIPT
    editor.write("\"+triggerMatches[1]);
    app.NormalCompletion();

    with trigger ß([a-z]) to do this

     
  • thomas
    thomas
    2013-06-25

    Thanks for your reply.
    Unfurtunately thats not working.
    editor.write("\"+triggerMatches[1]);
    gives and error
    'Uncaught exception at line 1: SyntaxError: Parse error
    Backtrace <anonymous>()@:1'

    If I replace
    editor.write("\"+triggerMatches[1]);
    with
    editor.write("\\"+triggerMatches[1]);

    Ok funny the forum editor here makes '\\' to '\', so maybe your example was right but the forum did strange things with it.

    Jeah, its working now. Thanks a lot.

     
    Last edit: thomas 2013-06-25