Community
    • Login
    1. Home
    2. Popular
    Log in to post
    • All Time
    • Day
    • Week
    • Month
    • All Topics
    • New Topics
    • Watched Topics
    • Unreplied Topics

    • All categories
    • CoisesC

      Search++: A work in progress

      Watching Ignoring Scheduled Pinned Locked Moved Notepad++ & Plugin Development
      229
      7 Votes
      229 Posts
      115k Views
      guy038G
      Hello, @coises and All, Could you enlighten me of a weird behaviour within your two plugins ColumnsPlusPlus and Search++ ? we’ll try to use the (?s)^xyz.+|^abc.+ regex against this text, pasted in a new tab : This is a test abc with some text to see xyz if everything works properly Place the caret at beginning of the 5th line to see Use the Replace All After in Whole Document option => The third last lines are deleted => OK Now, use the Replace All Before in Whole Document option => Message No match found before current position ! Why ? to my mind, the (?s)^xyz.+|^abc.+ regex should have matched the 3 lines : abc with some text to see Of course, if we use, instead, the Replace All in Whole Document option, it does delete these three lines ! A similar behaviour occurs with the ColumnPlusPlus plugin. I use this layout : [image: 1796111675502-35f2aab7-60eb-48cc-be10-7ab68e9458f8-image.jpeg] Place the caret at beginning of the 5th line to see Use the Replace After option => The third last lines are deleted, all the remaining text is colored with the custom style and the message One replacement made is displayed => OK Now, use the Replace Before option => we get the message No match found, with all text still in custom style [image: 1796111704342-34368dea-f211-416d-a596-bf2328335155-image.jpeg] Of course, if we use, instead, the Replace All option it does delete the three lines from string abc Best Regards, guy038 P.S. : See also the end of this post : https://community.notepad-plus-plus.org/post/106889
    • Thomas KnoefelT

      [New Plugin] MultiReplace

      Watching Ignoring Scheduled Pinned Locked Moved Notepad++ & Plugin Development
      94
      3 Votes
      94 Posts
      101k Views
      guy038G
      Hi, @thomas-knoefel and All, First of all, I’d like to apologize for not congratulating you for this important release, in my previous post ! I confirm that, with your new build, the search does go though all the matches and not only to the first hit of the lines. Nice ! You said in your last post :: A double-click jumps to the hit you click on, and F4 / Shift+F4 go on from there. After a new search, F4 starts with its hits. And in your documentation, you also said : Additionally, three navigation commands are available from the Plugins > MultiReplace menu and can be assigned to custom keyboard shortcuts via Settings > Shortcut Mapper > Plugin Commands: But adding the F4 and Shift + F4 shortcuts for your two commands, Next Search Results and Previous Search Results, via the Shortcut Mapper has the drawback of triggering the message CONFLICT FOUND Could you, like @coises, to insert these shortcuts within your code ? For example, with the Search++ plugin : After you ran the Plugins > Search++ > Search... option, then the Ctrl + F shortcut opens the Search in Files window of the plugin But if you switch back to the current document, a Ctrl + F shortcut opens the usual N++ Find dialog Using this way allows simultaneous shortcuts in both plugin and native N++. No need to use the Shortcut Mapper ! You said : The option is now called “Find All, Replace All, Mark: start at cursor”. A (?) next to it says when it applies … In this new build, I did see the (?) indication which shows the calltip Only when 'Wrap around' is off and not for runs over open documents of files. However, I did not see the new mane of the option Find All, Replace All, Mark: start at cursor but still the old name Find: Search from cursor position Note that I downloaded the MultiReplace-Release-x64.zip archive. I don’t know if this matters ! To my mind, the best is to always check this option in MultiReplace > Settings... > Search and Replace dialog. In this case : When the Wrap around option is not checked, process goes from cursor position to end of file When the Wrap around option is checked, process goes from the beginning of current file to its end You can verify this assumption, using the regex (?s)^xyz.+|^abc.+ against this text : This is a test abc with some text to see xyz if everything works properly Place the caret at beginning of the 5th line to see When the Wrap around option is OFF, a Replace All action, with Notepad++ or MultiReplace, deletes the third last lines ONLY When the Wrap around option is ON, a Replace All action, with Notepad++ or MultiReplace, deletes everything from string abc in 1 replacement This clearly shows that the process goes from the very start of file when the Wrap around option is checked ! If the process would have started from current position, then started again from beginning of file, once the end reached, we shoud have gotten the N++ message : Replace All: 2 occurrences were replaced in entire file ( first, using the (?s)^xyz.+ regex and then, using the (?s)^abc.+ regex ) Best Regards, guy038
    • Jack SkiJ

      Suggestion: change color on toolbar!

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      4
      0 Votes
      4 Posts
      383 Views
      L
      I get why you’d want it, but I agree with PeterJones here, plain text just has nowhere to store a colour. What I do instead is use the Style Configurator to set up a theme I like, and for marking bits of text I use the bookmark feature or just add a short comment line. Not the same as coloured text, but it keeps everything in the file itself, which is the whole point of a text editor for me.
    • K

      Notepad++ context menu removal

      Watching Ignoring Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
      2
      0 Votes
      2 Posts
      91 Views
      PeterJonesP
      @KitMcGuire , The User Manual “Right Click Context Menu” (Shell Extension) section at https://npp-user-manual.org/docs/shell-extension/#manual-installation--registration has the instructions on how to “unregister” the DLL that provides that context menu entry
    • C

      Can't access notepad++ website or use the update function within Notepad++ from our Azure Virtual Desktop environment

      Watching Ignoring Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
      3
      0 Votes
      3 Posts
      307 Views
      PeterJonesP
      @Charles-Guray , Sorry that no regular here ever replied to you in the last month. I know nothing about Azure itself, so didn’t feel qualified to answer. But my guess is that the recent reply won’t be overly helpful, especially as regards trying to contact the Notepad++ team via contact info. Unfortunately for you, as far as I am aware, the Notepad++ developer (who runs the official website) doesn’t block any IPs. If there is a block, it would be either coming from his service provider, or there’s a block somewhere between your VDI and the Notepad++ website’s service provider. Along that vein, it should be noted that many sites make use of CloudFlare or similar protections, and they are often now injecting javascript “puzzles” to make uses prove they are using a real browser, rather than an AI/bot, because bot traffic is killing the internet through using up bandwidth and connections from the constant training of AIs and other such abuses of the intention of the internet. I seem to rememer that even from individual PCs, sometimes people have had to manually go to the update URL, tell cloudflare that they are a human, and then after that, your IP will be able to get through. The developer tried to turn off that check for the download-checking URL, but I cannot guarantee his ISP is still honoring that. So obviously, you could choose to email the developer to ask, but I don’t think he has final control of whether or not your automated machine can access the website, given modern protections. That said, if you don’t want to worry about Notepad++'s fancy version check, the actual download for the Notepad++ installer is from the github releases page (the update checker replies with the github URL, if it’s needed), so if your virtual desktop environment is able to check https://github.com/notepad-plus-plus/notepad-plus-plus/releases/latest , you could have your own update script that checks the releases/latest, and if the results there have changed from the last one you downloaded, then download from github, bypassing the block.
    • Carlos SánchezC

      [New plugin] Smart Math

      Watching Ignoring Scheduled Pinned Locked Moved Notepad++ & Plugin Development
      14
      1 Votes
      14 Posts
      3k Views
      Vitalii DovganV
      @matsnorberg FreeBasic is compiled to a native DLL file, and the code uses “header” files “Notepad_plus_msgs. bi”, “PluginInterface. bi” and “Scintilla. bi” which are partial ports of the corresponding C/C++ headers. So, we have a native dynamic-link library file that follows Notepad++'s and Scintilla’s API, as well as WinAPI. Generally speaking, it should not matter which programming language was used for that. It could be FreePascal, for example. By the way, since FreeBasic uses GCC under the hood, the generated DLL is very close to the one generated from C code :)
    • Jack SkiJ

      Suggestion: toolbar dropdown feature to select custom text colors while typeing

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      2
      0 Votes
      2 Posts
      115 Views
      PeterJonesP
      @Jack-Ski , There is a post queue for users who have not earned a couple upvotes yet – when you typed both your messages, you were told there was a post queue before you hit the X so you could type. Your other post about colors was already waiting in line. No need to post twice. Regarding feature requests specifically, our FAQ on Feature Requests explains where to make feature requests. But as I replied to your first post, a “manually color my text” selector is a feature of word processors, not of text editors. (Locking this topic; discussion should continue in the other.)
    • Alan KilbornA

      Linked text to open other files into Notepad++

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      30
      4 Votes
      30 Posts
      27k Views
      J
      Also, I modified the initial script to fit my needs because I only needed to get to specific line within document. # -*- coding: utf-8 -*- from Npp import * import os import re def jump_to_match(m): # m.start() gives the exact character offset where the match begins pos = m.start() # Convert the character position to a 0-based line number line = editor.lineFromPosition(pos+4) # Move the cursor to that line and scroll it into view editor.gotoLine(line) editor.setFirstVisibleLine(editor.visibleFromDocLine(line)) class UIAC(object): def __init__(self): self.URL_INDIC = 8 # URL_INDIC is used in N++ source code self.ALT_MODIFIER = 4 self.backslash = '\\' ; self.two_backslashes = self.backslash * 2 self.alt_held_at_click = False self.installed = False self.install() def install(self): if not self.installed: # https://www.scintilla.org/ScintillaDoc.html#SCN_INDICATORCLICK editor.callback(self.indicator_click_callback, [SCINTILLANOTIFICATION.INDICATORCLICK]) # https://www.scintilla.org/ScintillaDoc.html#SCN_INDICATORRELEASE editor.callback(self.indicator_release_callback, [SCINTILLANOTIFICATION.INDICATORRELEASE]) self.installed = True def uninstall(self): if self.installed: editor.clearCallbacks(self.indicator_click_callback) editor.clearCallbacks(self.indicator_release_callback) self.installed = False def is_installed(self): return self.installed def mb(self, msg, flags=0, title=''): return notepad.messageBox(msg, title, flags) def get_indicator_range(self, indic_number): # similar to ScintillaEditView::getIndicatorRange() in N++ source # https://github.com/notepad-plus-plus/notepad-plus-plus/blob/8f38707d33d869a5b8f5014dbb18619b166486a0/PowerEditor/src/ScitillaComponent/ScintillaEditView.h#L562 curr_pos = editor.getCurrentPos() indic_mask = editor.indicatorAllOnFor(curr_pos) if (indic_mask & (1 << indic_number)) != 0: start_pos = editor.indicatorStart(indic_number, curr_pos) end_pos = editor.indicatorEnd(indic_number, curr_pos) if curr_pos >= start_pos and curr_pos <= end_pos: return (start_pos, end_pos) return (0, 0) def indicator_click_callback(self, args): # example: INDICATORCLICK: {'position': 12294, 'idFrom': 0, 'modifiers': 4, 'code': 2023, 'hwndFrom': 1577146} #print('UriIndicatorAltClick indicator click callback') self.alt_held_at_click = (args['modifiers'] & self.ALT_MODIFIER) != 0 def indicator_release_callback(self, args): # example: INDICATORRELEASE: {'position': 12294, 'idFrom': 0, 'modifiers': 0, 'code': 2024, 'hwndFrom': 1577146} #print('UriIndicatorAltClick indicator release callback') if not self.alt_held_at_click: return self.alt_held_at_click = False (start_pos, end_pos) = self.get_indicator_range(self.URL_INDIC) if start_pos == end_pos: return # if click on indicator that is not URL_INDIC uri_text = editor.getTextRange(start_pos, end_pos) (uri_scheme, _, uri_path) = uri_text.partition(':') uri_path = uri_path.replace('%20', ' ').replace('%24', '$').replace('/', self.backslash) ### custom modification myclass=re.search(r'~(.*)$', uri_path).group()[1:] editor.research(r'^\s*{}\b'.format(myclass), jump_to_match, 0, 0, editor.getLength(), 1) ### custom modification # check for optional syntax at end: edit:....txt(L127,C12) goto_line = goto_col = 0 m = re.search(r'\(L(-?\d+)(?:,C(\d+))?\)$', uri_path) if m: uri_path = uri_path[:-len(m.group())] goto_line = int(m.group(1)) if m.group(2): goto_col = int(m.group(2)) if not os.path.isfile(uri_path): # look for a relative path, relative to currently active document try: (valid_dir_of_active_doc, _) = notepad.getCurrentFilename().rsplit(os.sep, 1) except ValueError: # we started out in a "new 1" file, no path on that whatsoever self.mb('Cannot find file:\r\n\r\n{}'.format(uri_path)) return test_path_in_active_doc_dir = valid_dir_of_active_doc + os.sep + uri_path if os.path.isfile(test_path_in_active_doc_dir): uri_path = test_path_in_active_doc_dir else: (test_dir, test_filename) = test_path_in_active_doc_dir.rsplit(os.sep, 1) if os.path.isdir(test_dir): expanded_test_dir = os.path.abspath(test_dir) if expanded_test_dir != test_dir: self.mb('Cannot find file:\r\n\r\n{}\r\n\r\nLooked in this dir:\r\n\r\n{}'.format(test_filename, expanded_test_dir)) return return notepad.open(uri_path) if goto_line != 0: if goto_line == -1: goto_line = editor.getLineCount() goto_line -= 1 if goto_col != 0: goto_col_pos = editor.findColumn(goto_line, goto_col) editor.gotoPos(goto_col_pos) else: editor.gotoLine(goto_line) if __name__ == '__main__': if 'uiac' not in globals(): uiac = UIAC() # will automatically "install" it else: # each running the script toggles install/uninstall: uiac.uninstall() if uiac.is_installed() else uiac.install() print('uiac installed?:', uiac.is_installed())
    • H

      Notes repeated, repeated...

      Watching Ignoring Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
      7
      0 Votes
      7 Posts
      732 Views
      H
      @PeterJones Forgive me, you’re right. I made a mistake—perhaps my debugging could have been useful, but I just lost my patience (nothing on this damn PC ever works properly; there’s a new problem or annoyance every single day!) In any case, it seems my personal settings had become corrupted; after uninstalling, performing a deep clean, and reinstalling, everything worked as expected—so there’s nothing left to investigate or fix. I apologize for taking up your time unnecessarily. Thanks to everyone.
    • Troglo37T

      Is there a way to find both alphabets, with and without accents, at the same time, when searching?

      Watching Ignoring Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
      15
      0 Votes
      15 Posts
      2k Views
      PeterJonesP
      @DanielCollins said: if you only need it occasionally. In the Find dialog, set Search Mode to Regular expression and write each accented letter as a small character class, for example Rene as R[eéèêë]n[eéèêë] (and add the capital variants at the start if the name can be capitalised). If it’s just occasional then use @coises solution from the very first reply : [[=r=]][[=e=]][[=n=]][[=e=]] … That doesn’t require you to know every possible accented variant, nor need to remember that n can be accented, too, which you forgot. Just manually put the brackets and equals around all the characters.