• How to replace only one period or dot and skip the others ?

    9
    -1 Votes
    9 Posts
    1k Views
    dr ramaanandD

    @guy038 I was trying to skip finding/matching the dots and periods (full stops) that I understood were necessary and find the rest.
    I finally found just two or three unnecessary ones out of a folder containing 300+files using this Regular expression:-

    (<link[\S\s]*?<\/h1>)(*SKIP)(*F)|(<div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;">[\S\s]*?<div class="left">)(*SKIP)(*F)|(<!--[\S\s}*?\-->)(*SKIP)(*F)|(<[\S\s]*?>)(*SKIP)(*F)|(Note:[\S\s]*?<\/span>)(*SKIP)(*F)|(\.\s*\w)(*SKIP)(*F)|(<ul[^<>]*+>[\S\s]*?</ul>)(*SKIP)(*F)|(<style[^<>]*+>[\S\s]*?</style>)(*SKIP)(*F)|(for\s*any\s*questions\/\s*treatment\s*\.)(*SKIP)(*F)|(Efficacy\s*studies\s*\.)(*SKIP)(*F)|(All\s*rights\s*reserved\s*\.)(*SKIP)(*F)|(a\.m\.)(*SKIP)(*F)|(p\.m\.)(*SKIP)(*F)|(\.\s*\[)(*SKIP)(*F)|(\.\s*\()(*SKIP)(*F)|(\]\.)(*SKIP)(*F)|(etc\.)(*SKIP)(*F)|(C\.V\.S\.)(*SKIP)(*F)|(C\.V\.A\.)(*SKIP)(*F)|(C\.N\.S\.)(*SKIP)(*F)|(G\.I\.T\.)(*SKIP)(*F)|(\.\])(*SKIP)(*F)|(\.\))(*SKIP)(*F)|(B\.P\.)(*SKIP)(*F)|(\.\s*&lt;)(*SKIP)(*F)|(\.\s*&gt;)(*SKIP)(*F)|(\.\s*')(*SKIP)(*F)|(\.\s*&quot;\w)(*SKIP)(*F)|(\.,\s*\w)(*SKIP)(*F)|(\.\s*")(*SKIP)(*F)|(M\.D\.)(*SKIP)(*F)|(R\.S\.)(*SKIP)(*F)|(identity\.)(*SKIP)(*F)|\.

    Thanks a lot guys! Please keep helping people who ask questions here, I don’t know who else will. Thanks again!

  • UDL token cannot be both folding indicator and operator/delimiter.

    8
    0 Votes
    8 Posts
    456 Views
    Lycan ThropeL

    @HalfOffHell said in UDL token cannot be both folding indicator and operator/delimiter.:

    If you don’t know any workarounds, can you point me to where in the source code the coloring/folding/UDL happens? You seem like a well-informed person.

    Thanks, but I’m not that guy…I just spent a year and half wrestling with the different parts to come up with my own UDL package leaning heavily on the more expert users here.

    I’m not sure if you’re working backwards from the normal process, as most people create the color highlighting UDL, first, using the rules of the UDL 2.1 language to implement their chosen language, and then enhance color processing with the EnhanceAnyLexer plugin that the UDL didn’t. Then they implement the FunctionList functionality or the Autocomplete functionality to get a somewhat more complete IDE type environment.

    You sound like you started with EnhanceAnyLexer and are now trying to force the UDL to work with those things. Like I always say, more complexity leads to more problems. I still don’t understand why you need that multi-faceted use out of a single keyword or keyword/pair. Are you actually doing a language or just experimenting with the capabilities of doing something short of writing a plugin or submitting changes to the Notepad++ base code?

    The UDL is a part of the source code of Notepad++, and is located on NPP’s GitHub Repository. Any changes except for your own use, would have to be submitted to the developer for approval of inclusion to the base code.

    In addition, Notepad++ uses the Scintilla/Lexilla libraries for the editor’s capabilities.

    @HalfOffHell said in UDL token cannot be both folding indicator and operator/delimiter.:

    I don’t see why or how operators and delimiters would interfere with folding, they are just for color I think?

    They do because they are being searched differently. To use the open keyword as an Operator, it has to go into Operator 2, which uses a backward searching capability, and the Delimiters and Code Folding uses the Forward search.

    You should read more of the manual, and the UDL 2.1 spec layed out in both the Online User Manual and the Ivan Radic documentation, and try to see how everything works together as is.

    I don’t think the system as is, is going to work the way you want. You might need to employ using the PythonScript capabilty, or writing your own parser as a plugin. All of these are going to involve becoming familiar with the capabilities and functions of the Scintilla libraries and there are much more knowledgeable individuals here that can help you further, if you start posting actual information rather than just screenshots and vague statements about what you’re doing.

    Edit: I just noted that your screenshot states it’s a C++ UDL, so my guess is, that you’re trying to further expand C++, which is beyond my ability to help, as originally I tried using the C++ FunctionList as an example for mine and went quickly down a rabbit hole, just barely able to get out before I lost my mind. :-)

  • 0 Votes
    2 Posts
    175 Views
    PeterJonesP

    @lkbuaa said in Notepad++ doesn't display some characaters well like ㊤ ㊦:

    I am not sure what the root cause is

    Notepad++ itself is not restricted from showing glyphs for those characters:

    f157a7da-5c5d-4fcd-b3ba-37a617be421a-image.png

    Either your font doesn’t support it, or you need to try to toggle your setting for the Settings > Preferences > MISC > Use DirectWrite and restart Notepad++

  • Few Questions about selection, copy & masked paste

    14
    0 Votes
    14 Posts
    951 Views
    Dean-CorsoD

    Hello @Terry-R,

    thanks again for that new detailed info’s about RegEx. I was testing a little around and now I see what you mean about that selection thing I would like to do. So it means I just can do it with a RegEx pattern only without any manually mouse move / key buttons. I also did notice that the entire pattern / data I do paste in the search mask gets also saved like that if I record a macro. So before I thought it would be just save every single key press or combo only. That’s a good news for me. Now it’s working to make the selection between 2 markers and do anything with it.

    @Alan-Kilborn
    What do you mean? Just wanna know and find out answers to the question I have you know.

  • 0 Votes
    24 Posts
    32k Views
    Eugene TenenbaumE

    @Alan-Kilborn,
    Since when making Notepad++ resistant to file saving failures does not add value to it? Since when making products less prone to failure by any legal means possible is not adding value to them? Since when an employee who does one thing cannot do another, easier one? Is it beneath the dignity of a software developer?

    Do you subscribe to the famous line from “Oliver Twist”: “Please, sir, I want some more”? We do not live in the 1830s of Charles Dickens anymore. I found a solution and generously shared it with all. Do you want more charity from me? Didn’t I do enough already?

    Good luck with starting thinking, like businessmen aiming at perfecting their products, esp. by easy contacting someone to contribute to that in his own interest and not doing it by themselves. Too much?
    –Eugene

  • Comments in function list

    9
    0 Votes
    9 Posts
    685 Views
    PeterJonesP

    @Demetrio-Foti said in Comments in function list:

    I’d like just to know if the fix is planned in the very next releases or not

    It is not planned, no. The bug has been known about for at least 7 years, so if it’s been around that long, it’s not likely to get fixed in the near future.

  • Replace-All can only replace up to 2046 characters long

    6
    0 Votes
    6 Posts
    503 Views
    Jim HarrisJ

    As @mkupper said, anchors and regular expressions are the magic spells that I use to untangle lines - or even files, (like blobs of downloaded bank data) - that are hopelessly mangled together.

    Depending on how mangled the data is, it may take several tries - with a number of mistakes - before you get things the way you want them.

    It can be a process and don’t forget to make periodic backup saves in case you have to “undo” a search-and-replace.

    In my case I use Notepad++ to untangle downloaded bank data for tax purposes and, (depending on the size of the file and how mangled it is), it can take days to complete.

    Be patient. Print out a regular expression cheat-sheet if you need one. (I did) And don’t give up even if it seems like you’re going backwards.

  • posting help

    5
    0 Votes
    5 Posts
    504 Views
    Alan KilbornA

    @Bob-Smith said in posting help:

    so I could share pictures

    If you’re trying to share screenshots illustrating your Notepad++ problem, just copy them to the clipboard and paste directly into your posting.

  • NON utf-8

    6
    0 Votes
    6 Posts
    680 Views
    CoisesC

    @dr-ramaanand said in NON utf-8:

    I have the same problem. How to make those Chinese and other characters readable again like before?

    Based on the original poster’s comment, I don’t think it is the same problem. The original poster apparently wanted to identify characters that wouldn’t save properly in non-Unicode files so he could remove or replace them. My solution is only partial (it doesn’t take into account what non-ASCII characters are available in his default code page, and therefore perhaps would not need to be removed), but we’ll have to wait to see if he responds to know if he needs more ideas.

    I recommend you post this as a new question, as it appears to be different from the problem under discussion here. In any case, we will need more information. Since you write “like before,” part of that information should be what changed between “before” and “now.” Please be sure to include the information from ? | Debug Info… | Copy debug info to clipboard when you post.

  • 0 Votes
    33 Posts
    17k Views
    Maria BenichM

    @Maria-Benich Thank you! It worked perfect!

  • UI hangs when doing a large search-in-files

    3
    2 Votes
    3 Posts
    539 Views
    Alan KilbornA

    @James-John-McGuire

    Maybe give an example of the search you’re attempting.
    Probably only knowing the circumstances better can others offer advice on how to possibly improve things for you.

  • How to find out what txt files were open in the last session?

    10
    0 Votes
    10 Posts
    2k Views
    Richard HydrickR

    First, open the Sessions.xml within the below folder and it will show you all the files that were open. In my case it was just before my computer crashed as I just recovered from a failed TPM on my computer but the drive was still good.
    (*C:\Users\Username\AppData\Roaming\Notepad++*)

    If you can gain access to your old drive copy the folder backup and move to your new instance of Notepad++ copying to the same file location above, then select all documents within and open with Notepad++ and you will have all your saved and unsaved notes.

    Hope this helps.
    Richard

  • Smart Highlight not working

    11
    0 Votes
    11 Posts
    921 Views
    Lycan ThropeL

    @Ekopalypse ,
    Bingo, we have a winner. I have no idea why that color was selected as the same background, or…it was by default and then when I changed my background color to what it is now, the conflict occurred. I never noticed it, but I’ve changed it to a cyan, and it does show up now.

    Thanks for that catch.

    Thanks to all for their suggestions, and maybe the OP can now check his settings to solve his problem.

    OP, might have the same problem. If you notice, the first with has different coloring than the others, I suspect the result of the current selection color choice being melded with the SmartHighlighting background color.

    871HighlightFix.PNG

  • Odd (?) caret placement with auto-indent

    18
    3 Votes
    18 Posts
    1k Views
    CoisesC

    @Alan-Kilborn said in Odd (?) caret placement with auto-indent:

    In theory I would turn basic auto-indent on for “normal” text files, to get the benefits of a “fix” for such files. However, for Python and C++ files, I want/need advanced auto-indent. But, I can’t do this (again, it’s global: basic OR advanced).

    The code for Auto-indent: Advanced splits into three cases: C-like languages, Python and everything else; everything else uses the same code as Basic. The same change I proposed for Basic could be made there.

    The reason I separated the two cases is that what I propose doing to Basic is simple and straightforward. I want to ignore the configured indent settings and just duplicate the indentation of the previous line. I was able, with reasonable confidence, to devise a commit which I believe implements that without causing side-effects.

    The code for Advanced (except when it falls back to Basic) is far more complex, and of course it can’t ignore the indentation settings. The reason I didn’t suggest applying my change for Basic to Advanced when it falls back to Basic is that Advanced doesn’t just copy the existing indentation, it recomputes it, whether it is changing or not, according to the indentation settings (tabs or spaces). I thought it might be bizarre to have Auto-indent: Advanced sometimes change the indentation style to match the configuration and sometimes not.

    I suggested something as to how Auto-indent: Advanced could be changed to fix the specific problem you mentioned, but I did not give an example commit, because I have not yet been successful at creating one. So far, for each attempt I’ve made I’ve quickly found some unwanted side-effect.

    Part of the difficulty, also, is that after some experimentation with the unmodified version, there are some corner cases for which I do not follow the logic of the current behavior (or if some of that might be unintended). Example:
    void func() { return; }
    Start with that in language C++. The results of placing the caret after { and pressing Enter, then placing the caret after ; and pressing Enter are not the same as the results of placing the caret after ; and pressing Enter, then placing the caret after { and pressing Enter. In the latter order, the blank in “; }” is not absorbed; however, if you start with the line indented one level and do the same thing, the blank is absorbed. Either way, the caret winds up at the beginning of the line, as per your initial complaint.

  • Shortcut or menu path to "Rotate to right/left"

    18
    1 Votes
    18 Posts
    4k Views
    deleeleeD

    @Ekopalypse said in Shortcut or menu path to "Rotate to right/left":

    @deleelee

    UPDATED VERSION

    from ctypes import wintypes, WinDLL from Npp import notepad class ViewRotator(): def __init__(self): self.LOWORD_LEFT = 2000 self.LOWORD_RIGHT = 2001 self.WM_COMMAND = 0x111 self.toggle_rotating_direction = False self.npp_hwnd = WinDLL("user32").FindWindowW(u'Notepad++', None) self.splitter_hwnd = WinDLL("user32").FindWindowExW(self.npp_hwnd, None, u'splitterContainer', None) self.send = WinDLL("user32").SendMessageW self.send.argtypes = [wintypes.HWND, wintypes.UINT, wintypes.WPARAM, wintypes.LPARAM] self.send.restype = wintypes.LPARAM # LRESULT def rotate(self): if not notepad.isSingleView(): if self.toggle_rotating_direction: self.send(self.splitter_hwnd, self.WM_COMMAND, self.LOWORD_RIGHT, 0) else: self.send(self.splitter_hwnd, self.WM_COMMAND, self.LOWORD_LEFT, 0) self.toggle_rotating_direction = not self.toggle_rotating_direction if not hasattr(notepad, "rotateSplitView"): notepad.rotateSplitView = ViewRotator().rotate notepad.rotateSplitView()

    Wowsers!!! That is perfect. Thank you so much.

  • ChatGPT failed to help me replace....

    3
    0 Votes
    3 Posts
    427 Views
    Pulamea PulataP

    @Coises I found the solution before my post was even allowed by the moderation team , I make websites my client is an official partner of x website and is allowed to sell their products , and is way faster to scrape them and import them than ask them for the exported products since the sites are made in different platforms

  • separate to a NEW file

    4
    0 Votes
    4 Posts
    296 Views
    PeterJonesP

    @Mostafa-Kamal ,

    if it’s a one-time action, @Terry-R’s suggestion is spot on, and you don’t need to read my post.

    However, if it’s an action you are going to take a lot, I would suggest recording a macro:

    Macro > Start Recording Search > Mark FIND WHAT: \d{3}$ (this assumes it’s always a digit, like in your example; if it is just the last three characters, whether it’s digit or not, then .{3}$ instead Uncheckmark Bookmark line Checkmark Purge for each search Mark All Copy Marked Text Clear all marks Close File > New Edit > Paste Macro > Stop Recording Macro > Save Current Recorded Macro Give it a name that makes sense to you (CopyLastDigitsToNewFile or something) Give it a keyboard shortcut if desired.

    From now on, you can run the macro to copy those last digits/characters to a new file.

  • Trouble downloading Notepad++

    2
    0 Votes
    2 Posts
    790 Views
    PeterJonesP

    @Alex-Martin said in My First Taste Of HTML Code:

    How on earth do you download Notepad plus plus?

    You go to the official downloads page, find the most recent version (at the top, currently v8.7.1), and on the page for that, click the “installer” link (which for v8.7.1 is here). Once you have the installer, you have to run it.

    Ive tried it 3 times, the last 2 versions, and nothing
    shows up on windows.

    Sounds like user error to me.

    Zed Shaws book ruby the hard way, page 7. Stuck on 1. Where is the program???

    Finding the table of contents for that book online, and seeing that it’s the “getting things setup” instructions, I am assuming it suggests Notepad++ (which is awesome). But I have no idea what instructions it might give, or why you are having difficulty following those instructions.

    BTW: Your question had nothing to do with the blog post you replied to; you should have created a new question in “Help Wanted” instead of replying to an unrelated discussion. As a result, I moved it from there to here.

  • duble space like tabulate add/delete

    2
    0 Votes
    2 Posts
    171 Views
    dr ramaanandD

    @kuzduk-kuzduk one of us can help you do that with a regular expression (add or delete anything with one click) if you mention the beginning of these paragraphs and if they are unique.

  • ANSI X12/EDIFACT document viewing

    10
    0 Votes
    10 Posts
    14k Views
    PeterJonesP

    @mkupper ,

    The image has inexplicably disappeared off the server: I don’t know why. (And if you refresh your browser on the full URL, I think it will be 404 as well) I might have to try to regenerate it…