• Close on exit

    3
    0 Votes
    3 Posts
    3k Views
    Charles BanksC

    Thank You!
    I would never had figured that out.

  • 0 Votes
    3 Posts
    308 Views
    fbsfatecF

    @PeterJones
    It worked, I found this styler.xml file and it was from 2015, I copied it from Windows 10 to Windows Server and colored everything.

    Thanks

  • Changing TAB equivalent in spaces

    2
    0 Votes
    2 Posts
    183 Views
    Alan KilbornA

    @Alan-Cameron

    Go to the Settings menu and choose Preferences….

    9b0dbf35-0e17-4326-90e8-6c145b57fc7a-image.png

  • Save Backup of Unnamed File - Work in Progress

    3
    0 Votes
    3 Posts
    334 Views
    Alan KilbornA

    @NN123616

    you start a new Notepad… start writing. and autosave grabs it for say unnamed1.txt

    Is this possible?

    I don’t know much about it, but maybe the AutoSave plugin will do that. I’ve never actually used that plugin.
    I think the TakeNotes plugin can do such a thing, although it has been a while since I’ve used it.

    If I were doing it for myself, I’d use the PythonScript plugin and a little script, maybe like this:

    # -*- coding: utf-8 -*- from Npp import * import os import time try: AUF__callback_npp_BUFFERACTIVATED except NameError: def AUF__callback_npp_BUFFERACTIVATED(args): if editor.getTextLength() == 0: if not os.path.isfile(notepad.getCurrentFilename()): notepad.saveAs(os.environ['TEMP'] + os.sep + time.strftime("%Y%m%d-%H%M%S", time.localtime()) + '.txt') notepad.callback(AUF__callback_npp_BUFFERACTIVATED, [NOTIFICATION.BUFFERACTIVATED])

    This will, instead of doing “unnamed1.txt”, do a timestamp for a filename; example:

    3b364c94-49ff-400d-a05c-49f19d8e91f1-image.png

    This demo puts the file in the folder where the TEMP environment variable points, but that’s easily customized to something else.

  • NPP will not finish upgrade

    2
    0 Votes
    2 Posts
    294 Views
    PeterJonesP

    @Chuck-Roberts-0 ,

    I have never seen error messages like that before. But when I was on a Notepad++ as old as NPP v7.5.6, I had never tried it with Windows Server 2012 R2, so maybe there’s something with that specific OS.

    It sounds like you have the PythonScript plugin installed, but that it might not be installed properly. I would recommend uninstalling the PythonScript plugin for now, and see if the problem goes away. If it does, then try re-installing PythonScript and see if it works better for you.

    It also surprises me that you want to upgrade to v7.5.6 – that’s years out of date at this point. Looking up Windows Server 2012, that’s apparently based on Windows 8. All recent versions of Notepad++ through v8.1.5 (and even v8.1.6-RC, which will likely release in a couple days) should still be compatible with Windows 8-and-similar editions of Windows. So you might consider installing the most recent Notepad++ rather than one that’s that old. (The one caveat: since you are starting with a Notepad++ version before v7.6.3, where the plugin organization completely changed, you will need to re-install all of your plugins if you upgrade to v8.1.5 . I suggest writing down a list of all the plugins you actually use – ignoring “Plugin Manager”, which isn’t compatible with anything newer than v7.5.9 – then install v8.1.5, then use the Plugins > Plugins Admin interface to install your desired plugins.

  • Preferences > Editing has changed.

    3
    0 Votes
    3 Posts
    242 Views
    Alan KilbornA

    @Luis-Piña-III said in Preferences > Editing has changed.:

    Now where are

    Really? This has to be spoon-fed to you?
    Look around, man! It’s not that hard!

  • How to replace text that is only exact match

    3
    0 Votes
    3 Posts
    671 Views
    Isaac GohI

    @Alan-Kilborn said in How to replace text that is only exact match:

    Index 10(?!\d)

    Thanks a million

  • upgrade cannot replace the new version file

    4
    0 Votes
    4 Posts
    717 Views
    Terry RT

    @ArchanfelTaiwan said in upgrade cannot replace the new version file:

    I think the issue is not read/write permission, and it’s a notepad++ issue. b
    In notepadd++ v7.x it’s no this issue when I change to v8.x, each version is the same problem to the current version (v8.1.5).

    So you are saying that going from a version 7.x to a 8.x is successful, but going from an older 8.x to a later 8.x does not work, or is it specifically to 8.1.5 that does not work? Is it from a specific version 8.x that you tested and found errors, if so which one?

    Is this something you have tried several times, your post suggests so? If so, is it on 1 PC, or several PCs the problem occurs on?

    I will repeat my earlier statement, I think it is unlikely the upgrade. These upgrades go through some testing by the developer who if satisfied there does not appear to be any issues, releases it for seasoned users to install (so the automatic update process is not yet triggered). If it passes the test with several users then it will be released for the general population to install via the automatic update process.

    So far there has not been any other users who have reported experiencing your problem.

    I still think it is the PC setup you have. Do you have any applications that implement version control, or security to protect applications from being changed? Even a badly developed anti-virus application may cause issues like this.

    Terry

  • Open file in the background

    2
    0 Votes
    2 Posts
    442 Views
    PeterJonesP

    @GP-User ,

    When you use Windows Explorer to open a file or list of files in Notepad++, the Windows OS brings the Notepad++ application to the foreground. That’s the way that Windows OS has been designed. The same happens when I use Windows Explorer to open a file in any other app that I can think of.

    So I don’t believe there is anything the developers could do in order to prevent Notepad++ from coming to the foreground. Sorry.

    (translated by Chrome translation, maybe for your convenience):

    Когда вы используете Windows Explorer для открытия файла или списка файлов в Notepad ++, ОС Windows выводит приложение Notepad ++ на передний план. Так была разработана ОС Windows. То же самое происходит, когда я использую проводник Windows для открытия файла в любом другом приложении, которое мне приходит в голову.

    Поэтому я не верю, что разработчики могут что-то сделать, чтобы помешать Notepad ++ выйти на передний план. Извините.

  • Notepad ++ intermittently starts with debug window viewable

    4
    0 Votes
    4 Posts
    2k Views
    William OrnellasW

    @PeterJones done! Added to the github issues tracker. Thanks!

  • Hide all then show search results

    4
    1 Votes
    4 Posts
    416 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
    740 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
    194 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
    406 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
    522 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