• How can I unmark any seperated word?

    18
    0 Votes
    18 Posts
    3k Views
    Alan KilbornA

    Similar topic HERE.

  • Windows 11 24H2 compability?

    2
    1 Votes
    2 Posts
    205 Views
    Snabel42S

    Hej!

    Have a look here , which in fairness just says “Current Version”.

    24H2 is new enough that likely the user base is somewhat limited.
    But people are running it and it looks like very few reports of actual explosions :)

  • Paste text without jumping to cursor

    8
    0 Votes
    8 Posts
    556 Views
    Alan KilbornA

    @Coises said:

    The necessary function already exists: SCI_INSERTTEXT

    Good eye.
    I would have thought that function also does things to “jolt the screen”, but apparently not.

    @PeterJones

    Very similar, but simpler and less “raw”:

    from Npp import * try: editor3h # third editor, hidden except NameError: editor3h = notepad.createScintilla() def get_stream_text_from_clipboard(): retval = '' editor3h.clearAll() editor3h.paste() if editor3h.getLength() > 0: retval = editor3h.getText() return retval editor.insertText(editor.getCurrentPos(), get_stream_text_from_clipboard())

    Note that the extra effort to get the clipboard text is because PythonScript doesn’t support a way to get current clipboard contents. It can paste the contents with editor.paste(), but if you want to avoid side effects from paste (as we do here) or you want to modify the clipboard text before inserting it, there’s no super simple (i.e. function call way to do it).

    Note also that my get_stream_text_from_clipboard() function only works with non-column block data (as its name implies).

    BTW, there was a PythonScript request that such a function be created, see HERE, but it seems to be an issue that isn’t going anywhere.

  • 0 Votes
    6 Posts
    320 Views
    guy038G

    Hello, @DSperber1, @mark-olson, @mkupper and All,

    @@DSperber1, I’m pleased that you’ve got the right program ( mrcdat2txt.exe ) to edit your .mrcdat log files :-))

    Now, before your last reply, I tried to guess the similarities between some parts of your .mrcdat file and, indeed, I’ve found some !

    As you can see on the picture below :

    Each row of your table seems to begin with the FFFE sequence

    Each row of your table seems to end with the db01 sequence

    A four zero-byte sequence occurs in middle of each section

    The Yellow sequence looks like a valid UTF 16 LE BOM sequence of characters. Thus, to my mind, I thought to get valid strings after suppression of all zero bytes, in these lines …

    … And bingo ! You can verify that each Mauve/Pale Violet line, below, correspond to the File Name part of each line of your table !

    97218bb2-d0e7-4fca-a0f9-b03c9b833074-Clipboard_10-16-2024_01.png

    Best Regards,

    guy038

  • Find & Replace

    8
    0 Votes
    8 Posts
    388 Views
    Terry RT

    @guy038 said in Find & Replace:

    When the Regular expression search mode is set, running the Boost regex engine :

    And
    Sixthly, you may use \Q$\E which allows any characters within the \Q and \E to be accepted as literals within a regular expression. In this example the $ is the literal character.

  • Full file Path to Clipboard with forward slash

    7
    0 Votes
    7 Posts
    913 Views
    mkupperM

    To closer-replicate what @keep2000 was asking for I took @Alan-Kilborn’s code and created a new scriptlet

    editor.copyText("file://" + str(notepad.getCurrentFilename().replace('\\', '/')))

    and then assigned the keyboard shortcut Alt+/ to it. Alt+/ now loads the current forward slash formatted file path into the copy/paste buffer.

    In my case also I wanted the file:// prefix as part of the results.

  • How do I disable this really annoying popup ?

    3
    0 Votes
    3 Posts
    164 Views
    Joey MammaJ

    @PeterJones Thank you so much !!! I found the plugin. It’s called Programmer’s Pal. I tried every setting I could think of and it wouldn’t disable. Once I uninstalled PP I’m golden. I appreciate the help !!!

  • Printing multiple pages per sheet? How???

    2
    0 Votes
    2 Posts
    210 Views
    CoisesC

    @Hans-J-Albertsson said in Printing multiple pages per sheet? How???:

    Even the lowly Windows Notepad can do that… so why can’t NPP do that???

    On Windows 10, with a Brother HL-L2395DW printer, I’m not seeing any difference between Notepad and Notepad++. In both programs, multiple page printing is controlled in the printer driver, not the program. So, click File | Print…, then select the correct printer/driver in the Windows Print dialog, then click the Preferences… button. From there on, the details are specific to your printer driver.

  • Does NPP have selective box editing?

    13
    0 Votes
    13 Posts
    396 Views
    Alan KilbornA

    @PeterJones

    Is it worth some additional text in the manual, e.g. …

    Normally the caret is confined to positions on its line to the left of the line-ending character(s) [side note: not sure even if line-ending stuff is defined adequately in the manual]. When virtual space is enabled, the caret is freed from its confinement and can be placed to the right of line-endings. This has no real effect unless it is followed by the typing of some character, at which point the virtual space is filled with actual space characters to the left of the caret, to fill from the existing line entry to the column of the caret. The new line-ending is then placed to the right of the character entered.

    …or…some…such. :-)

    I mean, well, I’m clear on the virtual space concept, but new users might not be, so maybe more treatment in the manual is justified.

  • 0 Votes
    7 Posts
    1k Views
    Madhav VasanthM

    @xomx Thanks for the info

  • Does NPP have selective line editing?

    5
    0 Votes
    5 Posts
    166 Views
    Alan KilbornA

    @bofhlusr said in Does NPP have selective line editing?:

    Can npp hide all the lines in a file, and then unhide and display only the lines found in search?

    Short answer: No (again).

    There have been ideas proposed before about a Find All in Current Document search having a checkbox parameter to show only the lines with search hits (and thus hiding all others), but – I think I said this before – the hide/show lines feature in Notepad++ is not robust, so I’d think that anything based on the idea of hiding/showing lines conditionally is going to be flawed.

  • trocar ponto por vírgula na string numérica

    3
    0 Votes
    3 Posts
    519 Views
    Alan KilbornA

    @Carlos-Zucareli-Renó said in trocar ponto por vírgula na string numérica:

    change period to comma in numeric string
    Is it possible to configure in notepad ++?

    Not only are you wasting everyone’s time by not posting in English, your topic title (“replace semicolon with comma in numeric string”) doesn’t even match your posting content (“change period to comma in numeric string”).

    I won’t even try to answer, nor think about what you’re trying to ask. I’ll just “move on” unless you put some effort behind it on your end, in the form of a reformulated posting.

  • Setting Notepad++ as the default PRINT for .bat files

    2
    0 Votes
    2 Posts
    139 Views
    PeterJonesP

    @Soapboy ,

    That’s because /p is not Notepad++'s command-line option for printing (or for anything else, which is why it tries to open a file called /p). The ?-menu’s Command Line Arguments… dialog will show all the command-line options, or you can look in the Online User Manual’s Command Line Arguments page. Specifically, -quickPrint is the way to be able to make Notepad++ print the document from the command-line

  • How to move copy and replace some text ?

    4
    0 Votes
    4 Posts
    204 Views
    EkopalypseE

    @PeterJones

    Thanks, but that’s weird because I tried just dragging and dropping it because I was sure that would work, and I’m pretty sure it did in the past, but it hadn’t worked again, so I used imgur … hmm … was I hallucinating?

  • 1 Votes
    5 Posts
    494 Views
    guy038G

    Hello, @francesco-vespari, @mkupper, @peterjones and all,

    Here is my alternate solution :

    SEARCH (?-is)^(?:(?!data).)+\R|(?:(?!data).)+|(database\.schema\.[A-Za-z]{3}[0-9]{3})

    REPLACE ?1$1

    This solution keeps any empty line which already exists in the present text :

    So, for example, given this INPUT text :

    SELECT * FROM database.schema.ABC123 INNER JOIN database.schema.def456 on id1 = id2 LEFT JOIN database.schema.ghi789 on id2 = id3 WHERE 1=1 SELECT * FROM database.schema.ABC123 INNER JOIN database.schema.def456 on id1 = id2 LEFT JOIN database.schema.ghi789 on id2 = id3 WHERE 1=1 SELECT * FROM database.schema.ABC123 INNER JOIN database.schema.def456 on id1 = id2 LEFT JOIN database.schema.ghi789 on id2 = id3 WHERE 1=1

    we would get this OUTPUT one :

    database.schema.ABC123 database.schema.def456 database.schema.ghi789 database.schema.ABC123 database.schema.def456 database.schema.ghi789 database.schema.ABC123 database.schema.def456 database.schema.ghi789

    Notes :

    The first part of the search regex, after the modifiers (?-is) is ^(?:(?!data).)+\R which matches any complete line, with its line-break, ONLY IF it does NOT contain the string data, with this case, at any position of current line

    The second alternative (?:(?!data).)+ matches any part of line, which does NOT contain the string data, with this case

    Until now, just note that no group has been defined because of the two non-capturing syntaxes (?:...

    Finally, the third alternative is the string that we want to keep, i.e. the string (database\.schema\.[A-Za-z]{3}[0-9]{3}), with this exact case, which is stored as group 1

    As we use a conditional replacement ?1$1, which means : ONLY rewrite the group 1 if this group is defined, we are just left with the expected text !

    Best Regards,

    guy038

  • Open with Notepad++

    2
    0 Votes
    2 Posts
    111 Views
    PeterJonesP

    @Kevin-Burton ,

    In general, it shouldn’t go away, unless something weird happened (or maybe you upgraded your OS).

    Reinstall might work. And the User Manual has a whole page on the right-click “Edit with Notepad++” at https://npp-user-manual.org/docs/shell-extension/ – so you should read that page if the reinstall doesn’t solve it for you.

  • not able to see the search results windows in notepad++

    Locked
    35
    1 Votes
    35 Posts
    77k Views
    PeterJonesP
    Locking This Thread

    This issue has come up multiple times. To keep the discussion in one place, please read the v8.7 Search Results section of the missing-panel FAQ, and then continue any discussion in the v8.7 Search Results Missing topic.

  • v8.7 search results window not showing

    Locked
    11
    0 Votes
    11 Posts
    529 Views
    PeterJonesP
    Locking This Thread

    This issue has come up multiple times. To keep the discussion in one place, please read the v8.7 Search Results section of the missing-panel FAQ, and then continue any discussion in the v8.7 Search Results Missing topic.

  • Comparing and editing files

    7
    1 Votes
    7 Posts
    187k Views
    William CW

    Compare plugin in notepad ++ is fantastic for highlighting file difference, and multi edit makes it simultaneous changes easy.

  • Yet Another Selection Colours Question?

    9
    0 Votes
    9 Posts
    369 Views
    guy038G

    Hello, @penskeguy, @peterjones and All,

    Five years ago, I wrote the post, below, to @dinkumoil, where I asked him about some hints, advices and possible improvements. May be, you’ll be interested by some parts of my post :-)

    https://community.notepad-plus-plus.org/topic/18214/new-plugin-extsettings/32

    At this time, the Selection text color setting did not exist ( BTW, I confirm your findings about this specific setting, whether the ExtSettings dialog is opened or not : it does trigger the text color to the chosen one, only when you click on the Close button or hit the ESC key ! )

    From this post, I also extracted the part regarding the Selection Alpha setting, that I reproduced and completed which should be of some interest for you !

    If we consider, in RGB mode :

    The default current text foreground color (0,0,0)

    The default current text background (255,255,255)

    The default selection color (192,192,192)

    The default current line background color (232,232,255)

    Then, the alpha option allows you to change, BOTH, the color of background and foreground ( text ) of the resulting selection, according to the two general formulas :

    • RESULTING Selection Background = α × SELECTION Background + ( 1 - α ) × CURRENT Background with α in range [0,1] • RESULTING Selection Foreground = α × SELECTION Foreground + ( 1 - α ) × CURRENT Foreground with α in range [0,1]

    In other words, with an α transparency, transposed in range [0-255], we get :

    Resulting Bg Red = ( α × 192 + ( 255 - α ) × 255 ) / 255 for part of selection NOT in CURRENT line ¯¯¯ Resulting Bg Green = ( α × 192 + ( 255 - α ) × 255 ) / 255 for part of selection NOT in CURRENT line ¯¯¯ Resulting Bg Blue = ( α × 192 + ( 255 - α ) × 255 ) / 255 for part of selection NOT in CURRENT line ¯¯¯ Resulting Bg Red = ( α × 192 + ( 255 - α ) × 232 ) / 255 for part of selection within CURRENT line ¯¯¯¯¯¯ Resulting Bg Green = ( α × 192 + ( 255 - α ) × 232 ) / 255 for part of selection within CURRENT line ¯¯¯¯¯¯ Resulting Bg Blue = ( α × 192 + ( 255 - α ) × 255 ) / 255 for part of selection within CURRENT line ¯¯¯¯¯¯ And : Resulting Fg Red = ( α × 192 + ( 255 - α ) × 0 ) / 255 = α × 192 / 255 WHATEVER the location of the SELECTION ¯¯¯¯¯¯¯¯ Resulting Fg Green = ( α × 192 + ( 255 - α ) × 0 ) / 255 = α × 192 / 255 WHATEVER the location of the SELECTION ¯¯¯¯¯¯¯¯ Resulting Fg Blue = ( α × 192 + ( 255 - α ) × 0 ) / 255 = α × 192 / 255 WHATEVER the location of the SELECTION ¯¯¯¯¯¯¯¯

    As α value increases towards 255, the gray colors of selected text and the background converge, reducing contrast between them and, when α = 255, color of Fg = color of Bg = (192,192,192), leading to an invisible selected text !!

    On the contrary, as α value decreases towards 0, the selection background becomes more and more transparent and, when α = 0, color of Fg = (0,0,0) and color of Bg = (255,255,255), except for the part within current line where color of Bg = (232,232,255)

    When the α value has the median value 128 :

    The RGB values of the background part of selection NOT in current line are 223,223,223 ≈ ( 128 × 192 + 127 × 255 ) / 255

    The RGB values of the background part of selection WITHIN the current line are 212,212,223 ≈ ( 128 × 192 + 127 × ( 232 | 232 | 255) ) / 255

    the RGB values of the foreground ( text ) of the selection are 96,96,96 ≈ 128 × 127 / 255

    So, in the end, the values between 120 and 140 and, of course, 256 seem only interesting. And value 128, in the middle, is the good compromise !

    In the specific case of α = 256, the transparency on BOTH foreground and background colors is desactiveted. However, we can consider that the resulting selection is a blend of a foreground and background opaque selection with an existing default black text on a default white background. Thus, using the above formulas and 256 as α value, we get :

    Resulting Selection Background = ( 256 × 192 + ( 255 - 256 ) × 255 ) / 255 ≈ 191,75… => Background selection color = 192,192,192

    Resulting Selection Foreground = ( 256 × 0 + ( 255 - 256 ) × 0 ) / 255 = 0 => Foreground selection color = 0,0,0

    Best Regards,

    guy038