• Login
Community
  • Login
  1. Home
  2. General Discussion
Log in to post
Load new posts
  • Recently Replied
  • Recently Created
  • Most Posts
  • Most Votes
  • Most Views
  • T

    Hierarchical backup wanted.

    Watching Ignoring Scheduled Pinned Locked Moved backup
    12 Sep 30, 2021, 11:26 AM
    Mar 1, 2021, 2:40 PM
    0 Votes
    12 Posts
    696 Views
    V Sep 30, 2021, 11:26 AM

    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
  • G

    Add AHK language (syntax).

    Watching Ignoring Scheduled Pinned Locked Moved ahk autohotkey language
    4 Sep 30, 2021, 12:15 AM
    Sep 29, 2021, 4:31 PM
    0 Votes
    4 Posts
    8k Views
    A Sep 30, 2021, 12:15 AM

    @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

  • A

    Memory Allocation in Java and C

    Watching Ignoring Scheduled Pinned Locked Moved java c language
    2 Sep 29, 2021, 9:54 AM
    Sep 29, 2021, 9:48 AM
    0 Votes
    2 Posts
    205 Views
    E Sep 29, 2021, 9:54 AM

    @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.

  • S

    Notepadd++ dictionary help

    Watching Ignoring Scheduled Pinned Locked Moved
    5 Sep 28, 2021, 4:36 AM
    Sep 26, 2021, 10:42 AM
    0 Votes
    5 Posts
    1k Views
    S Sep 28, 2021, 4:36 AM

    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

  • T

    What is PowerEditor?

    Watching Ignoring Scheduled Pinned Locked Moved
    2 Sep 25, 2021, 11:04 PM
    Sep 25, 2021, 10:54 PM
    0 Votes
    2 Posts
    369 Views
    A Sep 25, 2021, 11:04 PM

    @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.

  • M

    Running plugin option from Windows command line

    Watching Ignoring Scheduled Pinned Locked Moved
    2 Sep 25, 2021, 1:59 PM
    Sep 25, 2021, 1:36 PM
    0 Votes
    2 Posts
    380 Views
    M Sep 25, 2021, 1:59 PM

    @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.

  • R

    NP++ won't update

    Watching Ignoring Scheduled Pinned Locked Moved
    2 Sep 23, 2021, 6:45 PM
    Sep 23, 2021, 6:29 PM
    0 Votes
    2 Posts
    301 Views
    P Sep 23, 2021, 6:45 PM

    @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.)

  • R

    Converting paginated TXT file to Table layout

    Watching Ignoring Scheduled Pinned Locked Moved
    8 Sep 23, 2021, 4:17 PM
    Sep 18, 2021, 4:07 PM
    0 Votes
    8 Posts
    4k Views
    R Sep 23, 2021, 4:17 PM

    @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.

  • M

    Tearing when dragging horizontal scroll slow

    Watching Ignoring Scheduled Pinned Locked Moved
    1 Sep 21, 2021, 10:06 PM
    Sep 21, 2021, 10:06 PM
    0 Votes
    1 Posts
    195 Views
    No one has replied
  • PaKaL600QualisP

    dot extension not well when dot in file name

    Watching Ignoring Scheduled Pinned Locked Moved
    2 Sep 20, 2021, 4:32 PM
    Sep 20, 2021, 4:24 PM
    0 Votes
    2 Posts
    344 Views
    P Sep 20, 2021, 4:32 PM

    @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

  • Moisey OysgeltM

    Verbose backup improvement

    Watching Ignoring Scheduled Pinned Locked Moved backup improvement
    7 Sep 20, 2021, 2:29 PM
    Sep 11, 2021, 2:11 AM
    0 Votes
    7 Posts
    522 Views
    M Sep 20, 2021, 2:29 PM

    @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.

  • Sashank999S

    Dark Mode for Community

    Watching Ignoring Scheduled Pinned Locked Moved dark theme community css
    3 Sep 20, 2021, 2:12 PM
    Sep 20, 2021, 1:38 PM
    0 Votes
    3 Posts
    433 Views
    Sashank999S Sep 20, 2021, 2:12 PM

    That works! Thanks.

  • Tom OT

    DSpell not recommending corrections for misspellings

    Watching Ignoring Scheduled Pinned Locked Moved
    4 Sep 20, 2021, 12:58 AM
    Sep 20, 2021, 12:36 AM
    0 Votes
    4 Posts
    341 Views
    Terry RT Sep 20, 2021, 12:58 AM

    @Terry-R said in DSpell not recommending corrections for misspellings:

    I’m trying to locate that post now.

    This is the post

    So it appears that “real” TXT files only are working correctly. So if your file isn’t a “temporary” file or a real TXT file consider making it a TXT file temporarily to see if that resolves your problem.

    Terry

  • Iton HornI

    Adding a key to "Edit/Insert/Date Time (short)" using "Settings/Shortcut Mapper..."

    Watching Ignoring Scheduled Pinned Locked Moved
    4 Sep 19, 2021, 8:43 PM
    Sep 19, 2021, 5:23 PM
    1 Votes
    4 Posts
    677 Views
    donhoD Sep 19, 2021, 8:43 PM

    @Alan-Kilborn said in Adding a key to "Edit/Insert/Date Time (short)" using "Settings/Shortcut Mapper...":

    So Notepad++ has become sort of a joke since it keeps losing developers that can code thoroughly when they add new features.
    …
    C’mon guys, when you add a new feature, support it fully.

    This feature is coding by me and other devs.

    Notepad++ devs (including me) code this project with their own time, to provide you a code editor with no charge. You can choose another editor if you’re not happy. Or you can do the PR to fix it instead of whining. We don’t ask your gratitude. Behave yourself as a civilized person here is the last thing you can do.

  • MikeTransM

    Search in selected text doesn't work

    Watching Ignoring Scheduled Pinned Locked Moved
    11 Sep 19, 2021, 6:49 PM
    Sep 19, 2021, 5:30 PM
    0 Votes
    11 Posts
    1k Views
    MikeTransM Sep 19, 2021, 6:49 PM

    Actually in my case I found a solution instead of searching for selected text. In the Mark option you can bookmark the line and in a macro you can use the F2 to jump to selected text, make instructions and then use the CTRL-F2 to delete the bookmark. Doing that way a certain type of conditional instructions can be performed without having to use scripts.
    Thank you all,
    bye.

  • darkenbD

    Multiple selection in mixed paragraph

    Watching Ignoring Scheduled Pinned Locked Moved
    9 Sep 19, 2021, 6:18 PM
    Sep 18, 2021, 8:32 PM
    0 Votes
    9 Posts
    622 Views
    darkenbD Sep 19, 2021, 6:18 PM

    @Alan-Kilborn The bookmark menu worked. It’s exactly what I wanted, thanks…

  • Jason WJ

    Embedded Parentheses (color coding for quick observation)

    Watching Ignoring Scheduled Pinned Locked Moved
    3 Sep 17, 2021, 2:50 PM
    Sep 16, 2021, 4:08 PM
    0 Votes
    3 Posts
    939 Views
    A Sep 17, 2021, 2:50 PM

    Here’s some related good information: https://community.notepad-plus-plus.org/post/256

  • Matt NelsonM

    Ctrl+Shift+Z to Redo not working in 8.1.4 ?

    Watching Ignoring Scheduled Pinned Locked Moved
    3 Sep 16, 2021, 8:59 PM
    Sep 2, 2021, 2:03 PM
    0 Votes
    3 Posts
    766 Views
    Matt NelsonM Sep 16, 2021, 8:59 PM

    @PeterJones
    Thanks for checking, Mine is working today as well, not sure when it started working again, but it’s still on 8.1.4 🤷‍♂️

    I swear it was broken for more than a few days before I reported the issue 😅

  • daryl pressleyD

    Display line number feature

    Watching Ignoring Scheduled Pinned Locked Moved
    3 Sep 16, 2021, 1:53 PM
    Sep 16, 2021, 1:32 PM
    0 Votes
    3 Posts
    2k Views
    A Sep 16, 2021, 1:53 PM

    Hard to say, but maybe OP wants something like the “ruler” feature that the ColumnTools plugin provides?:

    655af0d6-bcc5-4d54-b7b8-c870758eea78-image.png

  • Ulf SamuelssonU

    Suggested Enhancement: Handle Virtual Desktops properly

    Watching Ignoring Scheduled Pinned Locked Moved
    3 Sep 16, 2021, 11:40 AM
    Sep 16, 2021, 6:28 AM
    0 Votes
    3 Posts
    264 Views
    A Sep 16, 2021, 11:40 AM

    There are already open issues about virtual desktops on the github issue tracker. Suggest looking them up before you create something new.

The Community of users of the Notepad++ text editor.
Powered by NodeBB | Contributors