Navigation

    Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    double-click hyphen

    Help wanted · · · – – – · · ·
    double-click hyphen
    2
    4
    2732
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Andrew Yushkov
      Andrew Yushkov last edited by

      hi, how to select a word with a hyphen?

      .b-page__block
      

      only the “page__block” is released when you double-click

      Claudia Frank 1 Reply Last reply Reply Quote 0
      • Claudia Frank
        Claudia Frank @Andrew Yushkov last edited by

        Hello Andrew,

        depending on the language scintilla defines chars which are part of the word or not.
        To manipulate this you could use python script and function editor.setWordChars like

        chars = editor.getWordChars() + “@#_()[]”
        editor.setWordChars(chars)
        

        which would mean, that the existing chars would be extended by @#_()[]. In your case you would add the hyphen.
        If you put this in startup.py it will be automatically added each time you start npp.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • Andrew Yushkov
          Andrew Yushkov last edited by

          Thank you, the script added startup.po but it OPERATE only the current tab, how to do so when you open a new tab to run this script?

          1 Reply Last reply Reply Quote 0
          • Claudia Frank
            Claudia Frank last edited by

            Hello Andrew,

            I described here how it could be solved.
            Basically, you need to register a callback which gets called when you open a new tab or switch tabs and extend the wordchars accordingly.

            Cheers
            Claudia

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright © 2014 NodeBB Forums | Contributors