• 0 Votes
    7 Posts
    828 Views
    PeterJonesP

    @mykola-biloshytskyi ,

    So you completely ignored everything I told you – you did not use the template I gave you, you did not use the formatting buttons, you did not response to all three questions.

    However, it doesn’t matter. The command-line data that you showed proves that the problem is not with Notepad++ or with the plugin NppExec. The problem is with the syntax you are using on the command line – because you are getting the same error there that you did in NppExec. Your question is thus a Java question, not a Notepad++ or NppExec question.

    You are going to have to find a Java forum and ask your question there.

  • NppCrypt Authentification failed

    4
    0 Votes
    4 Posts
    367 Views
    PeterJonesP

    @desmond-frobisher ,

    When asking for help, it’s often better to err on the side of giving more, detailed, explicit information, rather than vague assertions.

    Please share ?-menu Debug Info from both devices Please share the Plugins > NppCrypt > About entry (or equivalent) for both Please check the NppCrypt settings on both, to make sure they match (sharing screenshots would help convince us) Please make sure nothing changed in the file during the “copy”. If it went over an FTP transfer, the line endings may have been corrupted. If it went via email attachment or what have you, maybe something got corrupted during the encoding/decoding/attach/extract process. Check the file sizes on both machines to make sure it’s the same number of bytes, etc.

    Without detailed information, our best guess is “operator error” (that is: “you are doing something wrong”), which isn’t helpful to you. If you want help, you have to help us help you.

  • Feature Request: Reopen the last Closed file

    3
    0 Votes
    3 Posts
    277 Views
    PeterJonesP

    Try Ctrl+Shift+t

    Also known as File > Restore Recent Closed File.

    And see also the related File > Open All Recent Files, which re-opens the full list shown in the recent-files-history.

  • Style Token text coloring issue

    7
    0 Votes
    7 Posts
    599 Views
    Tomáš KocourekT

    @Alan-Kilborn said in Style Token text coloring issue:

    @Tomáš-Kocourek

    It works.
    Read the release note and/or the manual when you move to a newer version of Notepad++ than the one you are used to, because…THINGS CHANGE.

    Here’s a hint, though:

    ea328cac-7dee-48f7-ad83-1460c38446f9-image.png

    @PeterJones FAQ this one?

    Thanks, this helped :-)

  • Plugin: Compare / Line Numbers

    2
    0 Votes
    2 Posts
    421 Views
    PeterJonesP

    @Ronald-Koons ,

    Sorry, I don’t believe it does.

    However, if another Compare Plugin user knows differently and can show us how, great!

  • Plugin: Compare / Set as first compare

    2
    0 Votes
    2 Posts
    2k Views
    PeterJonesP

    @Ronald-Koons ,

    I never have found the need for using “First to Compare” button. When I start my comparison, I just put my “old” file on the left and “new” file on the right, and click the “compare” button, and it works exactly as I expect it to.

    Okay, with a little experimenting: if I have all my files in the same view (so multiple tabs, none on the right), then if I click “First to Compare” in the “old” file, then “Compare” in the “new” file, it puts the one marked “first” on the left and the one where you clicked “Compare” on the right. And when i ended that compare, the “new” file moved back to the only active view with all the others. So the “First To Compare” button appears to be used only for marking the order of comparison when both files are starting from the same view.

    FYI: If you still want a change in behavior (I don’t think you need one), the author of the Compare Plugin has an issues page where such requests should be made. However, the author of the Compare plugin is no longer working on that incarnation of the plugin, and is instead working on a “ComparePlus” plugin to replace it. There has been no timeframe given for the newly-named plugin. However, the author does have issues for the Compare Plugin that are marked for ComparePlus v1, so if you put in your request through the compare plugin issues page, they might be included in the replacement plugin.

  • Customize Toolbar: Custom Fluent UI color icon don't change when disabled

    3
    0 Votes
    3 Posts
    574 Views
    Kimpa TammasK

    @artie-finkelstein Thank you for your response.

  • How to implement for marking on scroll bar and showing information

    Moved
    3
    0 Votes
    3 Posts
    800 Views
    J

    @PeterJones
    Thanks for your information
    I will get it a try

  • Option to hide nuls and other non-text

    3
    0 Votes
    3 Posts
    2k Views
    guy038G

    Helo, @victoronrust and all,

    A possible work-around would be to delete, TEMPORALLY, any character, displayed in inverse video, but the normal line endings :

    Open the Replace dialog ( Ctrl + H )

    SEARCH (?!\r|\n)[\x00-\x1F\x80-\x9F\x{2028}\x{2029}]

    REPLACE Leave EMPTY

    Tick the Wrap around option

    Select the Regular expression search mode

    Click on the Replace All button

    Press the Esc key to close the Replace dialog

    Once, you thoroughly studied your file contents, just do a Ctrl + Z action to get the initial text ;-))

    Best Regards,

    guy038

  • Header in new file

    3
    0 Votes
    3 Posts
    4k Views
    Alan KilbornA

    @Roberto-Moreno

    Here’s a way of doing it with PythonScripting (PythonScript is a plug-in):

    # -*- coding: utf-8 -*- from Npp import * try: HINF__callback_npp_BUFFERACTIVATED except NameError: def HINF__callback_npp_BUFFERACTIVATED(args): if editor.getTextLength() == 0: editor.setText('Created by Bob') notepad.callback(HINF__callback_npp_BUFFERACTIVATED, [NOTIFICATION.BUFFERACTIVATED])

    One option is to put most of that script into startup.py, or make a call to the script from startup.py if you don’t embed it.

  • Is there a GitHub Plugin

    2
    0 Votes
    2 Posts
    2k Views
    Michael VincentM

    @Firehold

    I use the Explorer plugin and have installed TortoiseGit. That gives me some integration:

    6a3b4e0c-f7cb-4cde-8da1-4cd29fe4b8bd-image.png

    Cheers.

  • NppMenuSearch version 0.9.5 available

    12
    2 Votes
    12 Posts
    699 Views
    Vitaliy DovganV

    Please find a fully-working prototype of the C++ wrapper (proxy) plugin here:
    https://drive.google.com/drive/folders/1jsz0liLzrVw9H42p0vrZO9VNMQNv8P2j
    The README file is included, if you have questions.
    I haven’t create a project on GitHub because I’m not sure about the name of the project. NppMenuSearchCpp looks logical in terms of implementation, but it does not look so good as part of Notepad++'s plugins menu.
    Any suggestions are welcome - both regarding the name and the functionality.
    Feel free to use the sources of this plugin as a base of your own wrapper, if you want to create one for some other plugin.

  • 0 Votes
    2 Posts
    204 Views
    EkopalypseE

    For me this sounds like you either have a feature request or think
    there is a bug in the interface. If that is the case, then I would
    recommend to open an issue at the official github issues page.

    If this isn’t what you want, please explain in more detail what you are looking for.

  • Announcing Perl-based automation of Notepad++

    16
    6 Votes
    16 Posts
    3k Views
    PeterJonesP
    v0.008 released to CPAN add notepad->showDocList, notepad->isDocListShown, and notepad->docListDisableColumn for working with the Document List panel (previously “Doc Switcher” panel) incorporate the new messages and menu commands thru v8.1.4 (#80) add notepad->getStatusBar(), which will get the text of one of the sections of the status bar (#65) add notepad->getDebugInfo(), which (for new-enough Notepad++) includes the ‘Command line’ entry from Debug Info (#74) add %WINMSGBOX for use with notepad->messageBox (#73)
  • NppExec v0.7.1 has been released!

    4
    5 Votes
    4 Posts
    443 Views
    Vitaliy DovganV

    @artie-finkelstein
    By default, NppExec’s Console becomes visible when any script is executed. To avoid it, npp_console ? should be used. (See NppExec Manual, section “4.1. NppExec’s Console behaviour”).
    I tried to reproduce the situation with npp_console local off under an if block within NppExec’s temporary script (Plugins -> NppExec -> Execute NppExec Script), and everything worked as expected:

    set local a = 123 if $(a) == 123 then npp_console local off // the Console becomes hidden endif strfind // produces an error "about to start a child process: "strfind"" sleep 2000 // the Console becomes visible
  • 0 Votes
    5 Posts
    320 Views
    Alan KilbornA

    @Walter-Di-Biase

    One thing to be aware of, though, with hiding lines: When you switch the active tab in Notepad++, Notepad++ itself will restore any lines you previously had hidden. So, if you want them to remain hidden (probably), you’ll have to capture the “buffer activated” event and then re-hide based on your saving of what was hidden before. Sounds a bit complicated? Yes, it is.

  • NppMenuSearch crashing as of Notepad++ commit 84c1505

    2
    1 Votes
    2 Posts
    183 Views
  • Python Script Regex replace with uppercase

    16
    0 Votes
    16 Posts
    3k Views
    EkopalypseE

    Sorry for the late and already too late reply, but I usually stay away from the computer on weekends.

    I assume that Python does its string processing before the boost::regex function gets a chance to interpret the string, but I’ve never really looked into it. The lambda or explicit function solution seem to be the way to solve this problem.

  • Capturing Scintilla notifications

    3
    0 Votes
    3 Posts
    314 Views
    S

    @dail this is exactly what I was looking for. Thank you so much!

  • PythonScript: Different behavior in script vs in immediate mode

    14
    1 Votes
    14 Posts
    1k Views
    PeterJonesP
    Status Bar Manipulation Allowing Extra Status Bar Section

    Complete example:

    implements a class for StatusBar manipulation includes a method which adds an extra StatusBar section includes an example callback to force it to a particular string
    (this could be changed so the callback puts some piece of particular
    info into the status bar) shows a 10sec example of it being used; note, because Notepad++ resets
    the status bar every time it changes tabs, you can see it flashing
    frequently. After that 10s, the callback will be cleared.

    You can take that concept and get rid of the clear-after-10s, which will mean that the status bar will continue to add that section as needed and display your information.

    Because it’s fighting Notepad++ for control of the status bar, things like toggling to a different tab or different view (or from one of the panels back to an editor tab) will cause Notepad++ to reset the status bar, then the UPDATEUI will trigger the callback to update the statusbar. This may cause unpleasant flashing of the status bar if you are changing tabs or panels frequently.0

    # encoding=utf-8 """StatusBar Manipulation !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! USER WARNING: STATUS BAR MAY FLASH DURING UPDATE !!! !!! FLASH-SENSITIVE USERS SHOULD NOT USE THIS SCRIPT !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Complete example: * implements a class for StatusBar manipulation * includes a method which adds an extra StatusBar section * includes an example callback to force it to a particular string (this could be changed so the callback puts some piece of particular info into the status bar) * shows a 10sec example of it being used; note, because Notepad++ resets the status bar every time it changes tabs, you can see it flashing frequently """ from Npp import * import ctypes from ctypes.wintypes import BOOL, HWND, WPARAM, LPARAM, UINT from struct import pack, unpack from time import sleep class _SB(object): """refer to these values as _SB.xxxx elsewhere""" LRESULT = LPARAM WNDENUMPROC = ctypes.WINFUNCTYPE(BOOL, HWND, LPARAM) WM_USER = 0x400 SB_SETPARTS = WM_USER + 4 SB_GETPARTS = WM_USER + 6 SB_SETTEXTA = WM_USER + 1 SB_SETTEXTW = WM_USER + 11 SB_GETTEXTA = WM_USER + 2 SB_GETTEXTW = WM_USER + 13 SB_GETTEXTLENGTHA = WM_USER + 3 SB_GETTEXTLENGTHW = WM_USER + 12 SBT_OWNERDRAW = 0x1000 ctypes.windll.user32.SendMessageW.restype = LRESULT ctypes.windll.user32.SendMessageW.argtypes = [ HWND, UINT, WPARAM, LPARAM ] _SB() # call it to initialize class NppStatusBar(object): """implement a class wrapper around the status bar""" def __init__(self): self._APP = None self._HANDLE = None def EnumCallback(hwnd, lparam): curr_class = ctypes.create_unicode_buffer(256) ctypes.windll.user32.GetClassNameW(hwnd, curr_class, 256) if curr_class.value.lower() == "msctls_statusbar32": self._HANDLE = hwnd #console.write("\t{:32s}0x{:08x}\n".format("sbWnd:", hwnd)) return False return True # console.write("\n" + __file__ + "::" + str(self.__class__) + "\n") self._APP = ctypes.windll.user32.FindWindowW(u"Notepad++", None) # console.write("\t{:32s}0x{:08x}\n".format("Notepad++ hWnd:", self._APP)) ctypes.windll.user32.EnumChildWindows(self._APP, _SB.WNDENUMPROC(EnumCallback), 0) # console.write("\t{:32s}0x{:08x}\n".format("StatusBar hWnd:", self._HANDLE)) self.__debugStatusBarSections() def __debugStatusBarSections(self): for sec in [STATUSBARSECTION.DOCTYPE,STATUSBARSECTION.DOCSIZE,STATUSBARSECTION.CURPOS,STATUSBARSECTION.EOFFORMAT,STATUSBARSECTION.UNICODETYPE,STATUSBARSECTION.TYPINGMODE]: self.getStatusBarText(sec) def getStatusBarText(self, sec): section = int(sec) retcode = ctypes.windll.user32.SendMessageW(self._HANDLE, _SB.SB_GETTEXTLENGTHW, section, 0) length = retcode & 0xFFFF sbtype = (retcode>>16) & 0xFFFF assert (sbtype != _SB.SBT_OWNERDRAW) text_buffer = ctypes.create_unicode_buffer(length) retcode = ctypes.windll.user32.SendMessageW(self._HANDLE, _SB.SB_GETTEXTW, section, ctypes.addressof(text_buffer)) text = '{}'.format(text_buffer[:length]) del text_buffer # console.write("\tSendMessage(0x{:08x}, 0x{:04x}, {:d}, {:d}) => 0x{:04x} 0x{:04x} \"{:s}\"\n".format(self._HANDLE, _SB.SB_GETTEXTLENGTHW, section, 0, sbtype, length, text)) return text def setStatusBarText(self, sec, txt): section = int(sec) if section <= 5: notepad.setStatusBar(STATUSBARSECTION.values[sec], txt) else: nChars = len(txt) text_buffer = ctypes.create_unicode_buffer(nChars) text_buffer[:nChars] = txt[:nChars] # console.write(repr(text_buffer)) retcode = ctypes.windll.user32.SendMessageW(self._HANDLE, _SB.SB_SETTEXTW, section, ctypes.addressof(text_buffer)) del text_buffer # console.write("\t...\n") # sleep(1) # console.write("\t... done\n") def getStatusBarNumberOfSections(self): nParts = ctypes.windll.user32.SendMessageW(self._HANDLE, _SB.SB_GETPARTS, 0, 0) return nParts & 0xFFFF def getStatusBarParts(self): nParts = ctypes.windll.user32.SendMessageW(self._HANDLE, _SB.SB_GETPARTS, 0, 0) # console.write("getStatusBarParts() -> nParts = {}\n".format(nParts)) nBytes = 4 * nParts buf = ctypes.create_string_buffer(nBytes) retcode = ctypes.windll.user32.SendMessageW(self._HANDLE, _SB.SB_GETPARTS, nParts, ctypes.addressof(buf)) #retcode = SendMessage(sb7_StatusBarCallback.STATUSBAR_HANDLE, SB_GETPARTS, nParts, buf) # console.write("\tretcode = {}\n".format(retcode)) ints = unpack('i'*nParts, buf[:nBytes]) # console.write("\tbuf = {:s} = {:s}\n".format(repr(buf[:nBytes]), ints)) del buf return ints def setStatusBarParts(self, *args): # console.write("setStatusBarParts({:s})\n".format(args)) nParts = len(args) nBytes = 4 * nParts buf = ctypes.create_string_buffer(nBytes) buf[:nBytes] = pack('i'*nParts, *args) # console.write("\tedit buf = {:s} = {:s}\n".format(repr(buf[:nBytes]), unpack('i'*nParts, buf[:nBytes]) )) retcode = ctypes.windll.user32.SendMessageW(self._HANDLE, _SB.SB_SETPARTS, nParts, ctypes.addressof(buf)) # console.write("\tretcode = {}\n".format(retcode)) def addStatusBarSection(self, text, width): # console.write("addStatusBarSection({:s})\n".format(text)) oldParts = self.getStatusBarParts() nParts = len(oldParts) subtract = int(width / nParts) scaled = map(lambda x: x-subtract, oldParts) scaled.append( oldParts[-1] ) self.setStatusBarParts( *scaled ) self.setStatusBarText( nParts, text ) def example_setSeventhSection(self, txt, width): """ If there are 7 sections, update text; if less, add a section and """ n = self.getStatusBarNumberOfSections() if n==7: self.setStatusBarText(n-1, txt) else: self.addStatusBarSection(txt, width) if __name__ == '__main__': def example_callback(args): sb.example_setSeventhSection("Example", 360) console.show() sb = NppStatusBar() editor.callback(example_callback, [SCINTILLANOTIFICATION.UPDATEUI]) example_callback(None) # call it once to update the UI manually console.write("For the next 10s, should say Example... \n") console.write("... even if you UpdateUI (change tabs, etc)\n") sleep(10) editor.clearCallbacks(example_callback) console.write("... DONE. The next UpdateUI will clear it.\n")


    edit: added if __name__ == '__main__': and indentation, to make it importable