Selecting a phrase, number or expression

Art Joe
  • Art Joe

    Art Joe - 2010-08-19

    I am trying to modify or tweak how notepad++ selects a phrase, word, number or an expression when using mouse. This is not specific to any language rather in normal text file.

    For example in case of an IP address; if I double click on it using mouse it only selects 10 or 1. I would like to change that so that by double clicking I can select whole IP Address in one go.

    After quite a bit of search I found following post. As I am complete novice I don’t know who to make this work.

    I’ll appreciate if some one can help me with this.

  • cchris

    cchris - 2010-08-19

    Don's answer doesn't seem to solve your problem, and Notepad++ doesn't handle it at this point.
    What you'd need is to ad some chaacter (the dot) to the list of the characters Scintilla considers as part of a word. This is possible using a script run through NppExec - unless you prefer using some other scripting language.
    Or you may wish to ask for customised word character sets in user defined languages, that could be another route. But you'll have to request it on IdeaTorrent, and to hope it gets implemented.


  • Art Joe

    Art Joe - 2010-08-20

    Thank you very much for your reply and clarification.

  • Dave Brotherstone

    You can enable this in Python Script - if you add it the following to the startup script, it will work for both views.  Change the drop down from the "Configuration" menu option to "ATSTARTUP" to get it to run when Notepad++ starts.


    Obviously you can tweak the characters with this.


  • Art Joe

    Art Joe - 2010-09-06

    This works perfectly and will save me lot of time daily.

    Thank you so much…

  • Art Joe

    Art Joe - 2010-09-09

    Is it possible to tweak this script so it will be enabled on all Tabs. What I noticed is that script is active only on initial Tab. I have to run the script for every other tab that I open.

  • Dave Brotherstone

    That's odd - I wouldn't imagine N++ sets the word chars for each file, but anyway, the answer is yes… :)

    def set_word_chars(args):
    notepad.callback(set_word_chars, [NOTIFICATION.BUFFERACTIVATED])

    I've not got time at the moment to test this actually works, but it should do.


  • cchris

    cchris - 2010-09-10

    N++ does not update the word character set, which is a problem sometimes. I haveplans for tewaking this on a per language basis - it already works for UDLs in my modified version.


  • Sing

    Sing - 2011-08-18

    @ davegb3
    The script you post worked randomly.
    If you open some  files, and switch between them, some times, the word chars is using the notepad++'s default.

    i am using notepad++ 5.9.3 & Python Script


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks