Menu

ctrl+del to delete next word

TXS - Help
Thiago
2013-03-14
2013-03-14
  • Thiago

    Thiago - 2013-03-14

    It is a powerful tool to use ctrl+del to delete the whole word after the cursor.

    I don't know if this is a bug but everytime when I use this for a word followed by a command, the backslash is removed also.

    For example, ctrl+del with the cursor as below

    foo |faa \textit{fee}

    produces

    foo textit{fee}.

    Is it possible to avoid deleting the backslash?

     

    Last edit: Thiago 2013-03-14
    • Jan  Sundermeyer

      Jan Sundermeyer - 2013-03-14

      fixed in latest svn revision

      On 14.03.2013 02:26, Thiago wrote:

      It is a powerful tool to use |ctrl+del| to delete the whole word after
      the cursor.

      I don't know if this is a bug but everytime when I use this for a word
      followed by a command, the backslash is removed also.

      For example, |ctrl+del| with the cursor as below

      |foo |faa \textit{fee}|

      produces

      |foo textit{fee}|.

      Is it possible to avoiddeleting the backslash?
      

      ctrl+del to delete next word
      https://sourceforge.net/p/texstudio/discussion/907840/thread/092ef3e2/?limit=25#5422


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/texstudio/discussion/907840/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/prefs/

       
  • Tim Hoffmann

    Tim Hoffmann - 2013-03-14

    Well, not with the current mechanism. It's provided by the editor component, which doesn't know that the backslash has a special meaning.

    However, it should be quite simple to write a user script perfoming this action and reassign the shortcut:

    Something like this may work (untested and possibly not handling all corner cases correctly):

    %SCRIPT
    cursor.movePosition(1, cursorEnums.NextWord, cursorEnums.KeepAnchor)
    if (cursor.previousChar() == '\\')
        cursor.movePosition(1, cursorEnums.Left, cursorEnums.KeepAnchor)
    cursor.removeSelectedText()    
    

    You can find more on scripting in the user manual.

     

Log in to post a comment.