• FORUM: Posting Queue

    Pinned
    9
    12 Votes
    9 Posts
    608 Views
    PeterJonesP

    @donho ,

    Makes sense.

    Since deleting posts was tedious for me, I had recently been looking into whether I could use the API that the forum offers to write a script to automate some of the cleanup (like with purging the deleted posts/topics), but that will take some time to develop.

    update: As of Nov 9, the purge automation is working, and it will run once a week. (Along with purging deleted posts/topics, it will also delete user accounts that are more than a year old where the user never posted and never logged in after the first day – nearly half of the 30000 accounts were in this category)

  • Please Read This Before Posting

    Pinned Locked
    1
    5 Votes
    1 Posts
    3k Views
    No one has replied
  • Column Editor incrementetion is not working

    4
    1 Votes
    4 Posts
    101 Views
    Peter 1966P

    Thank you

  • New User Questions?

    2
    0 Votes
    2 Posts
    69 Views
    mkupperM

    @grievousangel-wtj Have you seen the gcode add-on for Notepad++ https://ncnetic.com/notepad-gcode-plugin/

    It’s for G-code while you mentioned G/M-code. I don’t know if that makes a difference.

    As I don’t have a CNC I don’t know if the plugin offers the coding help features you are looking for.

  • Two buffer-activated notifications instead of just one

    7
    3 Votes
    7 Posts
    250 Views
    Alan KilbornA

    I noticed a workaround; consider the following script:

    # -*- coding: utf-8 -*- from __future__ import print_function # Python2 vestige! # see https://community.notepad-plus-plus.org/topic/26799 "Two buffer-activated notifications instead of just one" from Npp import notepad, NOTIFICATION last_known_doc_index_by_view = [ notepad.getCurrentDocIndex(0), notepad.getCurrentDocIndex(1) ] def find_docindex_from_buffer_id_via_enumeration(test_buffer_id, must_be_in_this_view): for (pathname, buffer_id, index, view) in notepad.getFiles(): if view != must_be_in_this_view: continue # needed to find the right doc in case of cloned doc if buffer_id == test_buffer_id: return index return -1 # never happens def bufferactivated_callback(args): cfn = notepad.getCurrentFilename().rsplit('\\', 1)[-1] # only the filename, no directory print('BUFFERACTIVATED:', cfn, 'args=', args) current_view = notepad.getCurrentView() current_doc_index = notepad.getCurrentDocIndex(current_view) curr_doc_index_via_enumerating = find_docindex_from_buffer_id_via_enumeration(args['bufferID'], current_view) if current_doc_index != curr_doc_index_via_enumerating: print(' NOT A NEEDED ACTIVATION NOTIFICATION!!!!!!') return print(' HANDLING A REAL ACTIVATION NOTIFICATION!') if last_known_doc_index_by_view[current_view] == current_doc_index: print(' note: THIS DOC WAS ALREADY ACTIVE IN THE ITS VIEW -- so was an activation notify really necessary?') else: last_known_doc_index_by_view[current_view] = current_doc_index notepad.callback(bufferactivated_callback, [NOTIFICATION.BUFFERACTIVATED])

    This workaround works because the “index” reported with the bogus notification is also bogus, and the correct index can be found by looking through the entire tab list for the right buffer id.

    A subtle point of the script is that it can also detect when the active tab in the inactive view is activated by the user.

  • Notepad++ and NUL characters

    11
    0 Votes
    11 Posts
    345 Views
    mkupperM

    @Alan-Kilborn said in Notepad++ and NUL characters:

    So, to be clear, I meant this as a limitation when considering Notepad++ being an “editor” and not just a “text editor”.

    It is possible to work around this. When an application loads stuff into the Windows copy/paste buffer the application provides the information in multiple formats. For example, if you are using a web browser and copy something from a web page then the web browser will be uploading various forms of plain text and also various forms of HTML, and usually more.

    When you use “paste” in an application the code examines the list of available formats and picks the one that seems like the best fit. Notepad++ picks one of the plain text formats. Notepad++'s Edit / Paste Special menu has options for grabbing an HTML format blob and another option for grabbing an RTF format blob and dropping the results into Notepad++'s editing area.

    The workaround is that applications are allowed to define their own formats, including ones that generated on the fly. Notepad++ can take advantage of this by creating a npp_binary_text format. If the text being copied contains a NUL then upload the data as the binary blob format and also upload npp_binary_text with the string value true. On pasting, Notepad++ would examine the list of available formats and if npp_binary_text is there and it’s set to true then grab the binary data format. This would allow Notepad++ to signal to itself that we are dealing with a Notepad++ to Notepad++ copy/paste while maintaining compatibility with older versions of Notepad++ and other applications.

    Microsoft Office uses internal to itself formats that allow for a richer experience when copy/pasting within Office applications. For example, there are format blobs that contain metadata about what is available in the normal well-known formats. You can copy data from an Office application and it’ll still look good if you paste into a non-Office application. If you paste the same thing into an Office application then you get extras such as the document’s original time stamps, the name(s) of the document creators and editors, etc.

  • How do I add a macro to toolbar

    8
    0 Votes
    8 Posts
    119 Views
    Leszek HelakL

    @PeterJones
    Thanks, I understand

  • 0 Votes
    2 Posts
    67 Views
    PeterJonesP

    @Code-with-Pritam ,

    Notepad++ is a text editor. You type your C++ code in there, and the syntax highlighting in Notepad++ will make it easier to visually parse the code you are typing. Then you use an external compiler to compile your source code, then you run the executable. In a bog-standard approach, all Notepad++ is used for is typing.

    If you have a plugin like the NppExec plugin, you can help automate some of the steps. For example, I have written a script for NppExec plugin that I call gcc-CompileAndRun, which saves the active file, runs gcc on that file to create an executable with the same name, then runs the executable in the NppExec console window:

    NPP_SAVE cd "$(CURRENT_DIRECTORY)" gcc -o "$(NAME_PART)" "$(FILE_NAME)" $(NAME_PART)

    (This script only works on a self-contained, single-file c program. if you used g++ instead of gcc, it would work on a self-contained, single-file c++ program. You could have a similar script which runs your own copy of make – or similar, as appropriate to what C++ compiler and build system you have: the Notepad++ source code, when you are building it with mingw-based g++, uses mingw32-make; strawberryperl comes with a mingw-based gcc/g++ compiler setup, uses gmake (which might be just a rebranded mingw32-make, but I’m not sure); and I know I’ve heard that some c++ setups on Windows can use CMake – but, anyway, if you have a makefile with your project, you could easily do a similar NppExec script that would run the right flavor of make with an appropriate target, rather than directly compiling one c/c++ file and running its executable.

    (Personally, I stick with NppExec for the single-file programs, but for anything more complex, I’m more likely to just do the code editing in Notepad++ and then go to a Windows command-line-prompt to run makefiles and the like. And for C++ apps built with the VisualStudio ecosystem, I have given in and started to use that full IDE environment, because debugging is more convenient that way.)

    This forum actually has a FAQ entry on how to Compile using an external compiler from Notepad++, which reiterates some of what I told you above, and also has a bit more on the specifics of the NppExec plugin.

    This forum is not really the best resource for learning C++, because C++ is just one of the 90+ languages that Notepad++ knows how to syntax highlight, and this forum is focused on the Notepad++ aspects, not on the specific coding language you want to use or programming tasks you want to accomplish. There are tons of websites out there dedicated to helping you learn C++; and there are other forums (like stackexchange) that are better suited to getting answers to coding questions, so you’ll get better answers to coding questions someplace like that than you will here.

    So, if you have specific questions about the use of Notepad++ and its plugins that the FAQ and my brief introduction to using NppExec for compiling C++ code didn’t cover, feel free to ask, because questions specific to Notpead++ is the reason this Forum exists and most of the regulars come to answer questions.

  • Where to find shortcut keys for special characters ! & $ ( )- = , / \\ :.

    2
    0 Votes
    2 Posts
    83 Views
    PeterJonesP

    @GuFengEn0d ,

    Where can I find shortcut keys for special characters?

    Do you mean: “how do I type those characters in my file?” You use your keyboard. If your keyboard doesn’t have those, you would enter the characters the same way you would in any text eidtor or normal typing application on your computer.

    Do you mean: “how do I use those characters for keyboard shortcuts?” You use Settings > Shortcut Mapper, double click on the command whose shortcut you want to change, and pick the “special character” from the drop-down list – note that a character on its own cannot be a shortcut; you need to use a modifier (like Ctrl or Alt) along with it. Please note:
    - In v8.7.6 or newer, the keys specific to your keyboard should be listed in the Shortcut Mapper’s character pulldown
    - In v8.7.5-and-earlier, the mapper only shows the US-EN keys, and you might need to read this FAQ for how to map ~ [ ] ; ' \ / <> and Num . (numeric keypad .) to what keys they actually are on your keyboard: it gives some example mappings for a handfull of keyboards, and shows you a website where you cand

    Do you mean: “how do i search through the Shortcut Mapper to see whether those keys are used in any existing shortcuts?” Use the Filter: ____ field on each page of the Shorcut Mapper.

    See the User Manual’s Shortcut Mapper section for more.

  • Android Version

    4
    0 Votes
    4 Posts
    133 Views
    PeterJonesP

    @Anderson-Silva ,

    Nope. I haven’t used a notepad-style app on Android in years (and the one that I used to use now gets horrible reviews, so I won’t be naming/recommending it, in case it’s as bad as they say).

    Somebody might be able to get you a quick recommendation if they have one, but this isn’t really the best place for discussing the pros and cons of specific Android apps: searching the internet for “best android notepad app” and then visiting reputable app-review sites to find reasonable (non-SEO) results is probably your best bet.

  • Copy & past if copy is null

    3
    0 Votes
    3 Posts
    69 Views
    mathlete2M

    For those who want to update their back-up configuration files with this setting: in config.xml, look for GUIConfig name="ScintillaPrimaryView" and add the entry lineCopyCutWithoutSelection="no".

  • rereplace help

    3
    1 Votes
    3 Posts
    116 Views
    TreyT

    @Alan-Kilborn I had to re-add ‘.*’ to the middle section, but I got it working now and can use variables the way I want now, thanks!!

  • [FORK] Tangential Discussion about what advice is "on topic"

    34
    1 Votes
    34 Posts
    800 Views
    donhoD

    @Alan-Kilborn

    Given his level of participation here, I’d have to guess that Don doesn’t care.

    Sorry for not being able to spend more time here, and thank you (and others) to be here for helping people. I do care the proper functioning of the forum though.

    By “non-Notepad++ solutions”, I thought it was kind of spam disguised as a solution.
    Even if someone provides a brief reply such as “Notepad++ doesn’t have the feature you want, try VS Code/Sublime Text/UltraEdit/vi/emacs/…etc”, I think it’s tolerable. The most important thing is that users come here to find a solution, and he/she has got one - be it python, batch, run menu or not run menu, whatever - even if it’s not within Notepad++.

    @guy038
    Thank you for pinging me.

    As @donho created this forum, it seems to me that Don is the only person which has authority to tell us what we should speak of or not in our forum !

    The community/forum is not about any specific individual, but about people.
    If I used my privilege to silence others by imposing my will, instead of following the rules, I would be the only one left in this place.

    Regarding the rules about this tangential discussion, I find Peter’s point to be very fair:
    https://community.notepad-plus-plus.org/topic/26783/fork-tangential-discussion-about-what-advice-is-on-topic/5?_=1745252343263

    Not trying to enlighten anyone, just sharing my 2 cents as part of community.

  • Persistencia de Styles Tokens

    Locked
    3
    0 Votes
    3 Posts
    97 Views
    PeterJonesP

    Please continue the conversation in the original. This topic is locked

  • create links to FTP files

    5
    0 Votes
    5 Posts
    117 Views
    Lhuillier SébastienL

    @PeterJones yes. thanks a lot

  • Cloned file status breaks after N++ restart

    9
    2 Votes
    9 Posts
    268 Views
    xomxX

    @Mark-Olson

    Thanks, I used that info while fixing: x64 Release binary for testing

  • N++ behavior when Windows Update does an unattended restart

    11
    2 Votes
    11 Posts
    418 Views
    Alan KilbornA

    @xomx

    I’ll leave Windows updates on (for now) and see if the N++ situation recurs.

  • Show Off Your Custom Icons in the Toolbar Buttons - STAR WAR Theme!

    7
    3 Votes
    7 Posts
    319 Views
    Lycan ThropeL

    @Amit ,
    Do keep doing your videos, though @Amit . I think it’s very helpful the way you tackle only one aspect at a time to show & tell about a subject relating to Notepad++.

  • Replace A name for 300 others in the list and save.

    11
    0 Votes
    11 Posts
    279 Views
    PeterJonesP

    In the fork, @mathlete2 informed me:

    While there may well be a ready-made solution somewhere within those search results, the post that contains the solution is not identifiable at a glance…

    Sorry, I had intended my link to make things reasonably easy, though requiring a little effort of reading some pre-existing posts. If this had been Stack Exchange, I would have been expected to just “close as duplicate”, since the question is already answered somewhere else, but I think that’s harsh; but maybe my expecting someone to search the forum is also too harsh. (I guess even SE’s close-as-duplicate link to the original; it’s apparently time for me to stop just giving people the keywords to search for and instead just finding the exact post myself.)

    is not identifiable at a glance.

    I thought that the post that the preview shows as “Let’s call the script MailMerge.py” would be easily noticed by looking through those results… but I guess not.

    9ffaa2ae-482b-4d13-9c78-6c3c8b46a508-image.png

    So here is the post I was intending for @Claudio-Raphael or anyone else to find – it presents a fully-working PythonScript solution; for those who don’t know how to make use of a solution using the PythonScript plugin, this FAQ explains the steps needed.

    Sometimes these scripts for the PythonScript plugin get multiple versions, depending on customizations that people request; I don’t remember whether MailMerge has been customized one or more times in other of the search results; so if the one I linked to is not exactly the solution desired, checking out some of the other posts in that search might find alternate versions of the script which will work better in your circumstances.

    TL;DR

    The MailMerge.py script is here – sorry for any confusion.

  • Notepad++ Using two or more desktops

    3
    0 Votes
    3 Posts
    174 Views
    PeterJonesP

    There was just a spammer who actually posted reasonable advice for a workaround:
    “A workaround is to run multiple instances using the -multiInst option. Create a shortcut with notepad++.exe -multiInst to open files in the current desktop.”

    (the original post had a random word converted into a link to some spammy website that had nothing to do with the question or Notepad++, hence the original poster – now banned for spamming – is not going to get credit for the solution.)

    It doesn’t solve the underlying problem, but -multiInst does seem a reasonable workaround for someone who finds themselves in a multi-desktop environment. But I don’t know that it would solve Explorer > Double-Click or Explorer > Open With Notepad++ – I don’t know whether, if there’s an open Notepad++ in the current desktop, whether that instance will get preference over another Desktop’s instance, or whether the OpenWithNotepad++ will just always go to the first instance, regardless of one being open on the active desktop.

    it might be something to experiment with, until such time as a solution is implemented.