• Hide all then show search results

    4
    1 Votes
    4 Posts
    421 Views
    Alan KilbornA

    @Mark-Stewart

    It certainly would be good to have some sort of robust hidden/shown line features like you discuss!

  • Strange processing in npp when a barcode scanner is used for input

    8
    0 Votes
    8 Posts
    2k Views
    John LiudrJ

    Thanks again @PeterJones Use whatever you have at hand to solve random questions you encounter is a great demonstration of problem solving skills! Maybe I should google how to do that in Python. I’m happy with Python. I’ve not used Perl for a very long time.

  • Replace line end symbols?

    9
    0 Votes
    9 Posts
    3k Views
    PeterJonesP

    @dail said in Replace line end symbols?:

    Newer versions of Scintilla have better support for line end representations.

    … another reason to hope that Don and team are working toward the newer Scintilla in the not-too-distant future. :-)

  • Don't start !

    4
    0 Votes
    4 Posts
    1k Views
    Renaud JACOBR

    OK

    After my new download and install it, it’s OK !

    Maybe a problem with the before file…

    Thanks

  • Is there undo history limit?

    3
    0 Votes
    3 Posts
    1k Views
    vanowmV

    Thank you for this.

    I’ve been testing NPP and Sublime in parallel, to see which one I like more (jumping ship from UEStudio, mainly because of the undo corrupting files) and encounter undo limit, wasn’t sure which one was it…

  • Find selected text via F3?

    7
    0 Votes
    7 Posts
    746 Views
    vanowmV

    Here is a Python script that does exactly as I wanted: if text selected - search for selected text, if nothing selected - execute “find next”

    if editor.getSelText() == "": notepad.menuCommand(MENUCOMMAND.SEARCH_FINDNEXT) else: notepad.menuCommand(MENUCOMMAND.SEARCH_SETANDFINDNEXT)

    To bind this to F3, first add the script as Menu item in PythonScript config:

    4d37ed6d-5f17-4313-a646-bcd0235bfffb-image.png

    Restart NPP, than in Settings -> Shortcut mapper -> Plugin commands search for your script’s filename:

    3726c612-81dd-4f9b-838d-ed8ca2c5060e-image.png

  • "Bold" & "Italic" checkboxes under "Settings/Preferences/Print"

    2
    0 Votes
    2 Posts
    196 Views
    PeterJonesP

    @Iton-Horn ,

    I see the same thing. It looks like a bug.

    Unfortunately, we cannot make changes to the codebase from the Community Forum. Could you please go to the NPP issues page on github and create a bug report. Make sure you follow the template, and give detailed report of how to replicate the problem, including your Debug Info.

    Once you do, copy the link from that issue and paste it in the reply here, so others in the Community can easily find your bug report.

  • With Dark Mode Enabled, printed text is too faint to read on printer

    3
    0 Votes
    3 Posts
    2k Views
    Robert OsorioR

    Peter,

    THANK YOU!

  • Is there a place to post useful Python scripts for NPP?

    8
    0 Votes
    8 Posts
    421 Views
    vanowmV

    @Alan-Kilborn said in Is there a place to post useful Python scripts for NPP?:

    It seems to me that if the backup action is done upon every single save, it doesn’t matter.

    It does, if you want preserve the very original code upon first save.

    But I like it “after” because then the timestamp applied to it is representative of the time the data in the saved snapshot backup was actually changed – the original data is potentially much older than the data I’m about to save (and would have its own snapshot (the previous one) that has a timestamp appropriate to its era.

    The most recent data will be at the original file location, not at the backup, but I see why someone might want have 2 identical files be at different locations.

  • Hierarchical backup wanted.

    12
    0 Votes
    12 Posts
    537 Views
    vanowmV

    Here is another version that backup file before it’s being overwritten with new data and appends date/time of the last modification date of the original file (not current date of the backup)
    i.e. file C:\blah\mycode.js will be backed up as D:\Backup\Notepad++\C\blah\mycode.js_20210928_221824.js
    It also works with network shares

    from os import makedirs from os.path import split, splitext, exists, getmtime from shutil import copyfile from time import strftime, localtime from re import sub from Npp import * def callback_FILEBEFORESAVE(args): backup_dir = "D:\\Backup\\Notepad++\\"; # backup directory, must have trailing slash _file = notepad.getBufferFilename(args['bufferID']) # get full path if not exists(_file): # new file? return with open(_file, "r") as f: # read data from file if f.read() == editor.getText(): # only save if file was modified console.write(msg + "file unchanged, no backup created\n") return file = sub("^\\\\+", "", # remove \ at beginning of the path sub('[<>"|?*:]', "_", # just a precation, replace invalid characters with _ sub("^([a-zA-Z]):", r"\1", # remove : after drive letter _file))) dir, file = split(file) # get directory and file filename, ext = splitext(file) # get filename and extension new_dir = backup_dir + dir + "\\"; new_filename = filename + ext # original filename new_filename = new_filename + str(strftime("_%Y%m%d_%H%M%S", localtime(getmtime(_file)))) + ext; # append date/time and original extension if not exists(new_dir): try: makedirs(new_dir) except Exception as err: console.write(msg + str(err).replace("\\\\", "\\") + "\n") return try: copyfile(_file, new_dir + new_filename) console.write(msg + "saved as " + new_dir + new_filename + "\n") except Exception as err: console.write(msg + str(err).replace("\\\\", "\\") + "\n") notepad.clearCallbacks([NOTIFICATION.FILEBEFORESAVE]) notepad.callback(callback_FILEBEFORESAVE, [NOTIFICATION.FILEBEFORESAVE]) msg = "[Auto backup] " # console message prefix console.write(msg + "initialized\n")

    For easy managing it’s better to save this script as a separate file i.e autobackup.py in the same directory where startup.py is
    and at the end of startup.py add this line:

    import autobackup # script's filename without extension
  • Add AHK language (syntax).

    4
    0 Votes
    4 Posts
    8k Views
    astrosofistaA

    @Gonda-Wireless

    In addition to the fine information provided by @PeterJones and in case you are not aware of this, there is a subforum on the official AutoHotkey website dedicated to everything related to Notepad++.

    In particular, I suggest you check out this post, which explains how to run a script or selection from Notepad++.

    Have fun

  • Memory Allocation in Java and C

    2
    0 Votes
    2 Posts
    189 Views
    EkopalypseE

    @Ankit-Dixit-0

    Sorry, but this forum is for Notepad++ specific questions.
    See here.

    Just a note: C does not have a new keyword like Java has, as it is not an object-oriented programming language.

  • Notepadd++ dictionary help

    5
    0 Votes
    5 Posts
    998 Views
    Swati RohatgiS

    Dear Sir

    Thank you for your illustrative example. After fresh update of Dspellcheck, it is working fine as demonstrated. Now please suggest why the newly added words are not populated in Autocomplete word windows, while typing. Currently, the standard dictionary words are auto-populated with start of specific alphabet in running order, by selecting the desired word with “TAB” key.

    Please guide.

    Appreciate your sustained support on the subject.

    Regards

  • What is PowerEditor?

    2
    0 Votes
    2 Posts
    340 Views
    Alan KilbornA

    @T-Almroth

    My guess it is just a name for the folder that some code was put into when Notepad++ was first created. Someone developing needed a folder, “hmm, what should I name it? PowerEditor!”. That’s my guess but it would be interesting to know if there is some different reason for it. Probably only @donho knows.

  • Running plugin option from Windows command line

    2
    0 Votes
    2 Posts
    332 Views
    Michael VincentM

    @Michael-Simpson

    If you want to do this from the command line, why don’t you just use jq? There is a Windows version for it.

    Cheers.

  • NP++ won't update

    2
    0 Votes
    2 Posts
    279 Views
    PeterJonesP

    @Rowan-Sylvester-Bradley ,

    This sounds like another instance of this, though that questioner never came back and reported results; and maybe also this that was posted at about the same time as yours.

    Based on your and @Oz-M 's reports, I think that the update to Windows 10 ver 20H2 changed the permissions in the C:\Program Files hierarchy, meaning that your normal user account doesn’t have write permission to that directory hierarchy anymore.

    Could you follow my advice from that post:

    Make sure that you have proper write-permissions in the C:\Program Files\Notepad++\ and C:\Program Files\Notepad++\functionList\ directories. You might have to run the installer in Run as Administrator mode to get Windows to give you those permissions, or use Windows Explorer’s right click Properties > Security > Edit (or Advanced) to give your normal user permission on those directories.

    Also, make sure that when you run the installer, you don’t have another instance of Notepad++ running, and that no other application has c.xml open. (To make sure this is true, you may want to reboot before running the installer.)

  • Converting paginated TXT file to Table layout

    8
    0 Votes
    8 Posts
    4k Views
    Robert J MelascagliaR

    @PeterJones - Understand completely. I did not say your follow-up suggestion did not or could not work; just responding to your suggestion, “It would be so much easier if you provided before and after data.” so I provided the graphics to complete the picture.

    In any event, I am proceeding with your suggestions and thank you.

  • Tearing when dragging horizontal scroll slow

    1
    0 Votes
    1 Posts
    179 Views
    No one has replied
  • dot extension not well when dot in file name

    2
    0 Votes
    2 Posts
    307 Views
    PeterJonesP

    @PaKaL600Qualis ,

    Notepad++ correctly adds the extension if you don’t provide one. Since Notepad++ version 8.0, it has even provided a checkbox in the Save As dialog so you can make sure you know whether or not it will automatically add the extension. If you are using an older version than v8.0, there were options elsewhere that would affect it, but in general, even older Notepad++ versions correctly add the extension under normal default circumstances.

    If you still believe your version is having problems:

    go to the https://www.notepad-plus-plus.org/downloads/ official download site and download a portable edition of the most recent version listed (right now, v8.1.4, but soon to be v8.1.5) and unzip to a writeable directory. Close all instances of Notepad++ and run the notepad++.exe that’s in the unzipped portable, and confirm that it works correctly on the newer version. If it does, then install the newest version in your normal Notepad++ location. if that doesn’t work, share the ?-menu’s Debug Info in the forum (for both the portable and for your installed), and give screenshots of things like the Save As dialog and the settings > preferences pages (especially MISC and Default Directory, which were the older preference locations for the checkbox that is now in the Save As dialog)

    official reference on the Save As extension: https://npp-user-manual.org/docs/preferences/#preference-toggles-in-other-dialogs

  • Verbose backup improvement

    7
    0 Votes
    7 Posts
    428 Views
    Michael VincentM

    @Moisey-Oysgelt said in Verbose backup improvement:

    Is possible to use python 3.10 or higher

    Python Script only goes to Python 3.9.6 as of now.

    Cheers.