• quick one...

    7
    0 Votes
    7 Posts
    194 Views
    PeterJonesP

    @x-77-x said in quick one...:

    i dont understand what peter is talking about

    Sorry, given the proficiency that your original regex showed, I had hoped that you would understand my pointers.

    The FAQ gives the following formula for replacing within a zone of text on one line – it was meant as a “fill in the blank” so that you could use the formula even if you don’t understand the syntax used:

    SEARCH (?-s)(?-i:BSR|(?!\A)\G).*?\K(?-i:FR)
    REPLACE RR

    The FAQ also explained what BSR and FR meant.

    I also told you that BSR for your case was ^NAME= and that what you wanted to match was \b\w+\b (sorry, I thought I had told you that was FR, but apparently didn’t type that part), and that your replacement should be \u$0

    Thus, you should try SEARCH = (?-s)(?-i:^NAME=|(?!\A)\G).*?\K(?-i:\b\w+\b) and REPLACE = \u$0

    … At least, that worked for me given your example data.

  • Note able to delete a page, it restores back

    2
    0 Votes
    2 Posts
    144 Views
  • display degree symbol in N++

    9
    0 Votes
    9 Posts
    2k Views
    Alan KilbornA

    @William-C said in display degree symbol in N++:

    press alt and 0176 on the keyboard to insert the degree sign

    It isn’t about “inserting” it, it’s about “displaying” it, as the topic title text and previous discussion clearly shows.

  • v8.7 status bar appears cropped

    10
    1 Votes
    10 Posts
    426 Views
    LincolnFoxL

    It helped me, thank you so much.

  • Feature Request: Parallel Processing (Multithreading)

    10
    0 Votes
    10 Posts
    2k Views
    M

    @Harry-Brookes said in Feature Request: Parallel Processing (Multithreading):

    I think it’s simpler when people don’t try to find reasons for things being harder than they actually are.

    People constantly insist that the single-threaded nature of most core Notepad++ APIs must just be due to sheer laziness on the part of its core devs, and those people have apparently never actually looked at the codebase and tried to understand the issues involved. Refactoring anything in NPP to use multiple threads is (by my estimate) several times more difficult than creating a multithreaded version of the same thing from the ground up.

    Notepad++ has a tremendous amount of shared global state, which could only be made compatible with multithreading through extensive use of mutexes, which would then introduce dramatic performance losses in single-threaded use cases (at best) and deadlock (at worst). By the way, have you ever tried to debug a multithreaded program without extensive use of log files? Hahahahaha, good luck.

    Find-and-replace in files seems like an embarrassingly parallel operation (or at least one that can be achieved with only one or two mutexes), but the devil is in the details, and as someone who has actually read the source code for Notepad++'s implementation, there are a lot of details there.

    EDIT: AFAICT, the simplest way to even begin to implement multithreaded find-in-files in NPP would be to use multiple Scratchtillas (NPP uses _pscratchTilla as a lightweight way to run Scintilla operations like find/replace on a file without doing any graphics rendering), and use some simple task-dividing/scheduling algorithm to decide which Scratchtilla works with which file. The scariest problem that I can think of comes when the the Scratchtilla has to report its progress back to the form that shows progress. From my limited experience (I am admittedly a noob to multithreading with GUIs), there seems to be a lot of risk of deadlock whenever multiple threads contend for a lock on a GUI element. And that’s just the tip of the iceberg.

  • 🔦 menu - how to add separators?

    11
    1 Votes
    11 Posts
    2k Views
    Alan KilbornA

    @westyles said in 🔦 menu - how to add separators?:

    it closes instantly after startup

    Well, no one ever clicks on a separator.
    Hmm, maybe accidentally…

    name=“” is better for me

    Then it doesn’t look like a separator.

  • 门这个字显示有问题

    5
    0 Votes
    5 Posts
    243 Views
    PeterJonesP

    @mkupper said in 门这个字显示有问题:

    I am wondering though what the font picking logic is.

    Black magic on the part of the OS. It’s influenced by the Direct Write setting, but it can still sometimes pick an alternate font for certain glyphs, even with DW off (as you showed).

    Unfortunately, I don’t know the behind-the-scenes stuff.

    I thought there was a discussion a few years ago, where I had some knowledge then than I do not now have [it was research done at the time, but the details are long since forgotten], but I cannot seem to find the post(s) I’m thinking about for the moment –

    update 1: ah, there it is: I was thinking about the posts dealing with “CompositeFont” – so read the discussions from that search for more…


    update 2: I searched the internet for “what characters look similar to U+95E8”, and though the first SO question I found didn’t answer what looked similar, it did show a screenshot from something else that shows that the glyph that Notepad++ displays is not unheard-of for U+95E8, even outside of Notepad++.


    update 3: per this, it looks like the alternate glyph we’re seeing might be the Japanese Kanji / Ryakuji form. Ooh, and that page also looks like U+2ED4 might give the glyph you are looking for (though I cannot comment on meaning or implication of using one Unicode codepoint vs the other.)

    The two compared in Notepad++:
    55a57ad1-009d-4955-844f-97edab8f688f-image.png


    update 4: MS Notepad has the same issue with that character:
    a154b1f8-7336-44ec-ad4e-99c31b14774d-image.png

    And looking through my C:\Windows\Fonts\GlobalMonospace.CompositeFont (see the “CompositeFont” search link, above), which lists some alternate fonts that support CJK Unified range:
    939eb42e-f487-4100-9072-161cd5a259f6-image.png
    If I change to “Microsoft YaHei” as the font for Notepad++ (or MS Notepad), I can get Notepad++ to show the glyph you expect for U+95E8:
    20b89ced-d411-4b11-91ee-8a3745e1807b-image.png
    … but it’s not a monospaced font, and every once in a while (on Notepad++ display refresh, maybe?), it seems to have to do some complicated re-drawing.

    But if you can find a monospace font with the appropriate unicode slots populated that you’re willing to have as your Notepad++ font, that might work for you.


    Caveat: I don’t deal with such characters or glyphs in my personal nor professional life; I just find myself drawn in when the unexpected happens in Notepad++, and I’m trying to be helpful, based on what I can find with some research on the internet that might shed light for me or those who bother reading my posts…

  • 2 Votes
    18 Posts
    978 Views
    PeterJonesP

    @Alan-Kilborn said in Strange behavior of the sort function, with zero-length column mode selection:

    Is Peter showing his BASIC roots here by using <>?

    100 PRINT "BASIC FOREVER" 200 GOTO 100
  • Scrollable page tabs

    9
    0 Votes
    9 Posts
    6k Views
    mkupperM

    @Ian said in Scrollable page tabs:

    Just reading this now, in 2024, about eight years after thread creation.
    Atop, there are tabs of all Notepad++ files open. I can two-finger-scroll up or down to move the tabs to the right or left, respectively. I love this feature but on my Notepad++ the scrolling sensitivity is much too light. Even the slightest scroll moves the tabs so quickly I miss any tabs in the middle, between my most recently and least currently opened files. How can I slow the scrolling speed? I do not want to change my mouse scrolling speed altogether, as the speed at which I scroll webpages and notepad pages with the two-finger-scroll method is perfectly fine. It is only in the Notepad++ app, and then only when scrolling the open file tabs at the upper part of the screen.

    From the keyboard you can use Ctrl+Tab or Ctrl+Shift+Tab which will pull up the same thing that mouse right-click + mouse wheel brings up. Keep holding the Ctrl key and release the Tab key. While holding the Ctrl key down use the up/down arrow keys to scroll through the list. Using the keyboard may gives you a more fine grained control over the scrolling through the list than the mouse wheel. The mouse wheel also works for scrolling this list while the Ctrl key is being held down.

    For more about this please see https://npp-user-manual.org/docs/user-interface/#document-switcher

    FYI - the document switcher can be disabled via Preferences / MISC. / Document Switcher / Enable. If you try either the right click plus mouse wheel thing or Ctrl+Tab and “nothing happens” then check that the document switcher is enabled in preferences.

    To fix or change the specific issue @Ian brought up with mouse wheel sensitivity when in document switcher mode we would need to go through the Notepad++'s FAQ: Feature Request or Bug Report system.

  • Every time I start notepad++, the encoding of some files will be changed

    4
    0 Votes
    4 Posts
    508 Views
    CoisesC

    @Alan-Kilborn said in Every time I start notepad++, the encoding of some files will be changed:

    @Coises said in Every time I start notepad++, the encoding of some files will be changed:

    Apply to opened ANSI files

    My recollection of what this checkbox (when checkmarked) does is:

    if a file has no content (it’s 0 bytes on disk), open it as UTF-8 if a file’s entire content is “7-bit ASCII” (no bytes with highest bit set), open it as UTF-8

    This “recollection” was found in some notes I had.

    After doing my best to follow the code, I believe you are correct. The relevant routines appear to be:

    FileManager::setLoadedBufferEncodingAndEol
    and
    Utf8_16_Read::utf8_7bits_8bits

    which appear to come into play when there is no byte order mark and the file is not HTML or XML with a detected character set specification. First, utf8_7bits_8bits decides that if a file contains a null, it’s 8-bit ANSI; if it contains only bytes from 1-127, it’s 7 bit ANSI; otherwise, if it contains only character sequences that are legal UTF-8, it’s UTF-8; otherwise, it’s 8-bit ANSI. Then setLoadedBufferEncodingAndEol uses the New Document | UTF-8 | Apply to opened ANSI files to determine whether existing files that are empty or contain 7-bit ANSI should be opened as UTF-8.

    It looks like MISC | Autodetect character encoding tries to detect ANSI codepages that are not the default (corresponding to an Encoding | Character sets submenu selection, rather than Encoding | ANSI), but I haven’t attempted to follow that all the way through. I’m not sure where that fits into the sequence of decisions and how it interacts with the Apply to opened ANSI files setting.

  • toolBar Switch for PythonScript plugin

    5
    0 Votes
    5 Posts
    139 Views
    W

    @guy038 said in toolBar Switch for PythonScript plugin:

    see also my post, below :

    A good option.
    The site does not allow me to like your post without reputation.

  • Big thanks for new "silent update" feature!

    2
    0 Votes
    2 Posts
    135 Views
    William CW

    The silent update feature is a fantastic addition!

  • What Features Make Notepad++ Stand Out for Coding?

    4
    0 Votes
    4 Posts
    577 Views
    Lycan ThropeL

    @Michak said in What Features Make Notepad++ Stand Out for Coding?:

    I’m considering switching to Notepad++ for coding, but I’d like to know what specific features make it a go-to choice for developers. Does it support multiple programming languages,

    Yes, it does. Approx 80 natively, but it also has User Defined Language capability to write your own, if there isn’t an existing one. It’s somewhat limited in its abilities, versus a full blown lexer, but depending on your programming skills, you could write your own lexer to add to the existing list.

    and how customizable is it?

    In addition to what others have mentioned above and my previous mentions, you can also write or use plugins to enhance the experience.

    Also, are there any lesser-known tips or plugins that can improve coding efficiency?

    There are a lot of existing capabilities and plugins that can help you actually create your own IDE type environment to code with. Besides being able to custom color existing languages, and UDL languages, via the built in Preferences and Style Configurator, there is a plug in that helps extend those languages called EnhanceAnyLexer, that can be used and customised to handle language specific color-coding.

    There is a built in capability for existing languages that shows program Functions in a view for navigating your code, as well as Project Panels, for help in organizing code files. It’s possible to use a script to build, make, compile your code files that can be executed from NPP, etc.

    The customization is limited only by your ability and searching for an existing plugin that can do the job, or create your own.

    Looking for insights from those who use Notepad++ regularly for their projects!

    My project, was to make a language color-coded in NPP for dBASE Plus, similar in usuability to our coding community’s IDE editor, that users felt had certain limitations, and they wanted to use their chosen Text Editor (NPP) to be an alternative. During that project, I was able to create an alternate IDE as one feature I completed lead to another one and so on. With NPP’s built in capabilities, I was able to fashion an alternate for the coders that functions pretty well, with the exception of the visual elements. I also was able to point out to the community that certain plugins NPP has, could help enhance the abilities of the package I created if they wanted to add them in on their own…like the Snippets plugin for holding stock code skeletons to paste into the file, let alone the builtin Macro capability of NPP.

    Interestingly, the native IDE editor, we use, is also based on the Scintilla/Lexilla libraries that Notepad++ is based on also, but NPP is modifiable via plugins and the open source code aspect that allows for further expansion and capabilities if so desired.

    Put succinctly, Notepad++ is what you want to make of it. Period.

  • Delete all-cap words

    22
    0 Votes
    22 Posts
    967 Views
    guy038G

    Hi, @lordp666, @terry-R, @mark-olson, @coises, @peterjones and All,

    @lordp666, I’m simply blown away by the accuracy of ChatGPT’s answers. Truly amazing !

    Sincerely, the accuracy of the response is impressive. Just one small error, however:

    With our Boost regex engine, if you have used the -i modifier or if you have ticked the Match case box :

    The \l syntax represents a single lowercase Unicode letter

    The \u syntax represents a single uppercase Unicode letter

    and :

    The [[:alnum:]] syntax is a shortcut for [\d\l\u], so any Unicode letter or digit

    The \w or [[:word:]] syntaxes are a shortcut for [_\d\l\u], so any Unicode letter, digit or the underscore

    So, apart from this particular point, the rest of ChatGPT’s reply, including the summary, is completely accurate !

    Sorry, no need to give you any further explanations !

    Ah… coders everywhere : unite and fight ! In the ( very ) near future, AI is going to replace us and leave us out in the cold ;-))

    BR

    guy038

  • basic regex question

    3
    0 Votes
    3 Posts
    174 Views
    S

    Sorry, @Alan-Kilborn. I expect to find most instances where string = ‘59forum’, but I want to identify where string is something else - ‘Events’, ‘Showcase’, and string values I don’t recall. Which, is why I want to identify them!

    I tried your suggestion, and it works. Many thanks!

    Dan

  • 0 Votes
    3 Posts
    2k Views
    PeterJonesP

    Future readers: this query was answered here and here, which both point to https://github.com/notepad-plus-plus/wingup/issues/73#issuecomment-2362168716 as the official answer.

    This duplicate request locked. Discussion can continue in the first link above.

  • Stepping though search results.

    3
    0 Votes
    3 Posts
    105 Views
    MadTomTM

    @Alan-Kilborn Thanks this does help.

  • Windows 11 Notepad tabs

    2
    0 Votes
    2 Posts
    286 Views
    PeterJonesP

    @Eustace-Fril

    in v8.7: Settings > Preferences > Indentation > Indent Settings > [Default] > Indent Size defaults to 4, but you can set it to whatever you want in v8.6.9: Settings > Preferences > Language > Indent Settings > [Default] > Indent Size in previous versions: Settings > Preferences > Language > Tab Settings > [Default] > Tab Size

    User Manual on Indentation settings: https://npp-user-manual.org/docs/preferences/#indentation

  • Windows 11 compatibility

    2
  • HTML, "Default keywords"

    3
    0 Votes
    3 Posts
    141 Views
    PeterJonesP

    The User Manual’s “Themes” page has been updated to better explain how to deal with themes, including keeping them up-to-date (including a version of the procedure I shared earlier).