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
    • Jack SkiJ

      Suggestion: change color on toolbar!

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      3
      0 Votes
      3 Posts
      33 Views
      Alan KilbornA
      Maybe what is meant here is to be able to start “styling” text on demand. E.g., now I want the text I’m going to start typing to have “Style 3”, then I type some stuff, and now I want to turn off that style and go back to normal. Just a possible interpretation of what OP wants…
    • 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
      22 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())
    • CoisesC

      Search++: A work in progress

      Watching Ignoring Scheduled Pinned Locked Moved Notepad++ & Plugin Development
      224
      7 Votes
      224 Posts
      109k Views
      guy038G
      Hello, @coises, @thomas-knoefel and All, For some obscure reasons, one day, my usual USB key for tests was just considered as containing RAW text. I did not even succeeded to reformat it ! So I threw it in the trash and from a ( not too old ) copy of that key, I was able more or less, to reconstruct the original contents of this USB drive ! Now, when I asked Google about “softwares able to search canonical and compatibility Unicode characters”, the IA answer, at the beginning, proposed, among other things, the CLI software ripgrep (rg). Although it does not seem to really treat canonical and compatibility Unicode forms AFAIK, it is quite fast and has plenty of interesting options ! Refer to https://github.com/BurntSushi/ripgrep. The last release is version 16.0 . Download, preferably, the ripgrep-16.0.0-x86_64-pc-windows-msvc.zip archive which is compatible with 64-bit Windows 11 laptops After extraction of the rg.exe software, in a CMD window, run rg -h for short descriptions or rg --help for more details ! Following my usual procedure, I searched for any file, including binary ones as well, of my new USB key, the string Fi, with this exact case, in regex mode and I got these results : Search "Fi" (32 189 hits in 624 files of 1 119 searched) [RegEx: Case] with native N++ v8.9.9.1 Search "Fi" (32 189 hits in 624 file(s)) [1 119 file(s) searched] with MultiReplace v6.2.0.38 32 189 matches in 624 of 1 118 files (Regex, match case): Fi with Search++ v0.8 (x64) And running the DOS command "rg -a --stats Fi", it displayed, at the end : 32189 matches 24492 matched lines 624 files contained matches 1118 files searched 12462212 bytes printed 498369521 bytes searched 0.173930 seconds spent searching 0.573693 seconds total As you can see, the count of matches and the files concerned are identical for these 4 tests However, the number of files analyzed varies : 1,119 for N++ and MultiReplace 1,118 for Search++ and rg.exe I figured out why ! On my D: key, I have only : One directory which is hidden : System Volume Information One file which is hidden : Thumbs.db As the Hidden folders option was unchecked, N++ and MultiReplace did not consider the folder System Volume Information but did take in account the Thumbs.db file ! Whereas, the Search++ plugin and the rg software did not consider, both, hidden files AND folders. Thus, it did not analyse the Thumbs.db, as well ! Consequently, @coises, I suppose that you have enough place to modify the label of the option from Hidden files to Hidden files and folders. Alternatively, you could also decide to add a new option Hidden folders. Do as you like ! Now, I ran the same tests again, on txt files ONLY and there are the results : •==============•==========•========•===========•===============•===============•==========================• | Software | Hits | In | Scanned | First Time | Second Time | Command | | / Plugin | | Files | Files | After Restart | Right after | | •==============•==========•========•===========•===============•===============•==========================• | Notepad++ | 10600 | 311 | 641 | 17 s 25 " | 5 s 32 " | | •--------------•----------•--------•-----------•---------------•---------------•--------------------------• | MultiReplace | 10600 | 311 | 641 | 11 s 80 " | 1 s 78 " | | •--------------•----------•--------•-----------•---------------•---------------•--------------------------• | Search++ | 10600 | 311 | 641 | 16 s 94 " | 0 s 66 " | | •--------------•----------•--------•-----------•---------------•---------------•--------------------------• | rg.exe | 10600 | 311 | 641 | 16 s 69 " | 0 s 55 " | rg -a -ttxt --stats Fi | •==============•==========•========•===========•===============•===============•==========================• Best Regards, guy038 P.S. : Please note that the tests were all conducted BEFORE I wrote this post, which, obviously, modify the results !
    • H

      Notes repeated, repeated...

      Watching Ignoring Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
      7
      0 Votes
      7 Posts
      407 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.
    • Carlos SánchezC

      [New plugin] Smart Math

      Watching Ignoring Scheduled Pinned Locked Moved Notepad++ & Plugin Development
      13
      1 Votes
      13 Posts
      3k Views
      M
      @Carlos-Sánchez Just for my couriosity. How did you manage to integrate FreeBASIC with Notepad++?