• Notepad++ doesn't delete text at the end of a document

    3
    0 Votes
    3 Posts
    362 Views
    Mark OlsonM

    @Richard-Engelschall
    This sounds like a plugin might be responsible, but nobody can be more specific than that unless you give more information about your installation. Go to ?->Debug Info... from the main menu, copy your debug info, and paste it here.

    While you’re at it, you might test if there are circumstances where you don’t have this problem; the more specific the problem, the easier troubleshooting is.

  • Missing from recent updates?

    4
    0 Votes
    4 Posts
    283 Views
    Tom StephensT

    @Alan-Kilborn Thank-you! Appreciate the response. Now if I can get the encoding correct, but that is for another post.

  • User Defined Language doesn't exclude sign in front of numbers

    2
    0 Votes
    2 Posts
    203 Views
    PeterJonesP

    @Michael-Goldsworth ,

    UDL has its limitations. + or - prefixing a number with no intervening space will always be treated as part of the number.

    If you add the EnhanceAnyLexer plugin using Plugins Admin, you can use that plugin to have a regular expression apply foreground coloring:

    0xFFFF00 = [+-](?=\d) ; for UDL, need to remove 3 from excluded styles if you want ; this new color to override the number styling excluded_styles = 1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,20,21,22,23

    I used cyan in my example (0xGGBBRR=0xFFFF00) to make it obvious:

    with EnhanceAnyLexer:
    9b1912d0-f936-49fa-90b3-0f5ef693657c-image.png

    without EnhanceAnyLexer (or with the definition commented out):
    d7d7e7a5-634b-492c-843a-dabdcc130da8-image.png

    The 24 style numbers are defined in the Notepad++ UDL source code (a similar link is present in the default EnhanceAnyLexerConfig.ini, if anyone reads the comments there…)

  • Help with search and replace code

    11
    0 Votes
    11 Posts
    490 Views
    guy038G

    Hello, @jessica-bruno, @mkupper and All,

    @mkupper, you’re right but these negative look-arounds are not intended to be used on their own but rather with a part outside the look-around(s !

    Refer to the two tables below.

    Copy the text of the first column in a new tab

    Use the Mark dialog to get the text matched by each of these 9 regexes, in a red/orange color ( tick the Purge for each search option ) !

    The results should be as below :

    •---------------------•------------------------•----------------------•----------------------•-----------------------•-----------------------• | | 12345 | 12345(?=aaaaa) | 12345(?!bbbbb) | (?<=ccccc)12345 | (?<!ddddd)12345 | •---------------------•------------------------•----------------------•----------------------•-----------------------•-----------------------• | 12345aaaaa | X | x | X | | X | | 12345bbbbb | X | | | | X | | 12345zzzzz | X | | X | | X | | ccccc12345 | X | | X | X | X | | ddddd12345 | X | | X | | | | zzzzz12345 | X | | X | | X | | ccccc12345aaaaa | X | X | X | X | X | | ccccc12345bbbbb | X | | | X | X | | ccccc12345kkkkk | X | | X | X | X | | ddddd12345aaaaa | X | X | X | | | | ddddd12345bbbbb | X | | | | | | ddddd12345zzzzz | X | | X | | | | zzzzz12345aaaaa | X | X | X | | X | | zzzzz12345bbbbb | X | | | | X | | zzzzz12345zzzzz | X | | X | | X | •---------------------•------------------------•----------------------•----------------------•-----------------------•-----------------------• •---------------------•------------------------------•--------------------------------•--------------------------------•--------------------------------• | | (?<=ccccc)12345(?=aaaaa) | (?<=ccccc)12345(?!bbbbb) | (?<!ddddd)12345(?=aaaaa) | (?<!ddddd)12345(?!bbbbb) | •---------------------•------------------------------•--------------------------------•--------------------------------•--------------------------------• | 12345aaaaa | | | X | X | | 12345bbbbb | | | | | | 12345zzzzz | | | | X | | ccccc12345 | | X | | X | | ddddd12345 | | | | | | zzzzz12345 | | | | X | | ccccc12345aaaaa | X | X | X | X | | ccccc12345bbbbb | | | | | | ccccc12345kkkkk | | X | | X | | ddddd12345aaaaa | | | | | | ddddd12345bbbbb | | | | | | ddddd12345zzzzz | | | | | | zzzzz12345aaaaa | | | X | X | | zzzzz12345bbbbb | | | | | | zzzzz12345zzzzz | | | | X | •---------------------•------------------------------•--------------------------------•--------------------------------•--------------------------------•

    Best Regards,

    guy038

  • Tiny fonts problems, menues & settings

    5
    0 Votes
    5 Posts
    1k Views
    CoisesC

    @Sofia-Engvall said in Tiny fonts problems, menues & settings:

    I have 1080 monitors so I don’t have scaling activated normally but I did activate it for this test. That’s what I meant with “sized up my windows font” for this screenshot. All other text in all other programs gets too big then and the settings text is not affected anyway.
    […]
    I know other application have these problems too. My 15 yo used mcreator to make minecraft mods. It has the same problem. All other programs I have installed have the right proportions.

    Not a high-DPI problem then. I wish I had any other guesses, but I can’t think of what it would be. Since it does happen in at least one other program, though, and most of us have never seen it, there must be something uncommon in these programs that interacts with something unusual about your system.

    I don’t mean to complain. Just to know if this problem is being looked into. If not I’ll probably give up and use another tool <3 Or make my own since I only need the functionality of notepad but with dark mode.

    Up to you, of course, but if you have the skill to make your own — and since you have the problem on your system, so you can readily reproduce the problem — perhaps you would consider looking at the code on Github and trying to find the fix? That would solve it for you and (assuming the developer accepts your pull request) others as well.

    I’m sorry I have no easier ideas, though perhaps someone else will.

  • Add line of code in entire project

    8
    0 Votes
    8 Posts
    998 Views
    Alan KilbornA

    @wonkawilly

    When you make such a post, you should also add that “this really isn’t a topic for this site (this site is only for Notepad++ discussion); to pursue these ideas you should find a more appropriate place”.

  • Search syntax help: keyword found, but also need data two lines down

    2
    0 Votes
    2 Posts
    234 Views
    PeterJonesP

    @Mike-P,

    Currently, I’m using this search string

    (?-s)^W.*?\K(\t)255(\t)RH_ANG

    Which gives this partially useful result

    W 29-Sep-20 09:01:48 255 RH_ANG <I>RH diagnostic info </I> W 29-Sep-20 12:56:12 255 RH_ANG <I>RH diagnostic info </I> W 29-Sep-20 13:56:35 255 RH_ANG <I>RH diagnostic info </I>

    Actually, that search just finds the TAB then 255 then TAB then RH_ANG. You must be doing something else/more if you were able to filter down to the “partially useful result”

    After data - the search results that I’d like to see is this:

    W 29-Sep-20 12:56:12 255 RH_ANG <I>RH diagnostic info </I> Text: (29.09.2020 12:56:13) [00453]0100: GP 120cm -67C -34R 0A 545ST 0[%] 320F 750fr no3d 1#1

    I would do it in two steps.

    To match the W line and those following, and only extract the W line then skip one then the Text line, I would do something like:
    FIND = (?-s)^(W.*?\t255\tRH_ANG.*\R).*\R(.*\R)
    REPLACE = $1$2
    SEARCH MODE = regular expression
    Fewer details than my previous explanation (you can follow the link in the previous discussion to the User Manual Regex section for exact details on each symbol): The first (...) puts the first W line (including newline) into group #1 the .*\R matches one entire line – so this is the one between the W line and the next line` the (.*\R) matches one entire line (including newline) and puts it in group #2 – this will be the second line after the W line the replacement just uses group#1 and group#2, so the first and third lines if you don’t have a newline after your last Text: line, it won’t match properly; always make sure you have a blank line at the end of files when doing complex regex with \R markers in your search. If you also want to delete any of the groups that don’t start with ^E (which your “after” example implies), I would do a second replacement:
    FIND = (?-s)^E(.*?\R)+?\R
    REPLACE = (empty field)
    SEARCH MODE = regular expression The ^E says that the first part of the match must be an E at the beginning of the line (.*?\R) will match the rest of the line, including newlin modifiying it with +? means it will match multiple lines (since the E is not inside the () group, the +? doesn’t modify that part, so only the first line needs to start with E), but non-greedily, so it will stop at the first instance of whatever comes next the last \R means it will stop the match on a blank line after the N lines that matched above. Since the previous modifier was non-greedy, it will start at the first blank line it encounters after an E-prefixed line. replacing with nothing effectively deletes that block so this will delete the E groups without deleting the W groups

    With the data you gave, I ended up with the following, after running both those steps

    W 29-Sep-20 09:01:48 255 RH_ANG <I>RH diagnostic info </I> Text: Backlog (31.12.2009 18:01:11) [00001]Read T0=0 W 29-Sep-20 12:56:12 255 RH_ANG <I>RH diagnostic info </I> Text: (29.09.2020 12:56:13) [00453]0100: GP 120cm -67C -34R 0A 545ST 0[%] 320F 750fr no3d 1#1 W 29-Sep-20 13:56:35 255 RH_ANG <I>RH diagnostic info </I> Text: (29.09.2020 13:56:36) [00001]sequence no send: 0, received: 0, state of device: 3

    Please note: while we in the forum will help people get started with regex, having one user ask a whole bunch of regex questions gets rather uninteresting to us. Since you are at least putting in an effort, showing input and desired data, and the steps you tried, you’re likely to get more help than the lazy posters… but if that’s all you ever ask, we’ll get tired, because we aren’t really a “help me with my regex” forum. As I put it for people who are pushing that limit or beyond:

    Please note: This Community Forum is not a data transformation service; you should not expect to be able to always say “I have data like X and want it to look like Y” and have us do all the work for you. If you are new to the Forum, and new to regular expressions, we will often give help on the first one or two data-transformation questions, especially if they are well-asked and you show a willingness to learn; and we will point you to the documentation where you can learn how to do the data transformations for yourself in the future. But if you repeatedly ask us to do your work for you, you will find that the patience of usually-helpful Community members wears thin. The best way to learn regular expressions is by experimenting with them yourself, and getting a feel for how they work; having us spoon-feed you the answers without you putting in the effort doesn’t help you in the long term and is uninteresting and annoying for us.

  • Clickable Link (file://) problem

    8
    0 Votes
    8 Posts
    600 Views
    rthxR

    The problem is solved - thanks to all who responded!

    Especially the tip from @PeterJones and @Coises has brought me closer to the solution, I now knew where to look.

    It was actually registry entries (from “Open Command Prompt here” Context Menu), which I have been using since Windows 7 (without the problem). And since it was so handy, of course I used that on all my systems.

    That’s where Win10 behaves differently than Win7.

    Source: Enhancing the “Open Command Prompt here” Context Menu experience

    After removing these registry entries the problem is solved.

  • Contextual search syntax

    3
    0 Votes
    3 Posts
    360 Views
    Mike PM

    @PeterJones Thank you so much Peter, that was exactly what I was looking for!! And your detailed explanation helped me understand it too!

  • Need Help to replace a text by finding other text as keyword

    4
    0 Votes
    4 Posts
    220 Views
    Mark OlsonM

    All of the above solutions are good, but they are not necessarily very robust to reformatting of the document, which appears to be YAML.

    Normally this is where I’d recommend a plugin or a PythonScript solution for working with YAML, but I don’t know of any plugins, and Python’s YAML package is not in the Python standard library, so using PythonScript for YAML isn’t a great option.

    Having said that, my general suggestion for performing these kinds of manipulations on YAML documents is to learn a scripting language (I recommend Python) and using that to write normal Python scripts. If you end up going that route, this forum will cease to be a useful resource and StackOverflow becomes one of your best friends.

  • Search results lost in offline screen

    Locked
    2
    0 Votes
    2 Posts
    176 Views
    Alan KilbornA

    @Arne-Everhard

    Please don’t create duplicate threads; ref. HERE.

    Moderator: Please lock THIS thread.

  • помогите

    3
    0 Votes
    3 Posts
    624 Views
    Mark OlsonM

    Eclipse and IntelliJ IDEA are both fine ways to inspect the contents of a .jar file. I don’t know of any others though, and in any case such discussion is outside the scope of this forum.

  • Search and replace question

    3
    2 Votes
    3 Posts
    245 Views
    Tom DirksT

    @PeterJones That worked! Thank you very much.

  • How to change color of letters of highlighted text?

    11
    0 Votes
    11 Posts
    8k Views
    fdsafds fdsafdsaF

    Settings>Style Configurator>Selected Text color

  • scroll horizontally

    6
    0 Votes
    6 Posts
    2k Views
    DomOBUD

    @PeterJones
    Thank you for your answer.
    There’s enough text to be scrolled and the View > Word Wrap is off (automatic line feedback is not activated).
    However, I don’t have the horizontal scrollbar available at the bottom of the window like on your screenshot. Perhaps there’s another parameter to consider.

    @guy038
    Thank you for your answer.
    Your solution works correctly.

    My mouse supports horizontal scrolling. It is another solution but less natural for me.
    The horizontal scrolling is a usual way on many Windows software.

  • "Edit in Notepad++" in context menu not working

    2
    0 Votes
    2 Posts
    620 Views
    HakivakatyroH

    Solved the problem by returning Windows to its original state with the removal of programs

  • Open Notepad++ in Different Workspace Without Switching

    2
    0 Votes
    2 Posts
    516 Views
    wonkawillyW

    Probably you need to play a bit with
    Menu Settings > Preferences > Multi-Instance & Date > Multi-instance settings
    and see the option that best fits your needs.

    Screenshot follows:

    47e4f287-5320-464d-b73e-2c2592a08b44-image.png

  • plugin that support auto-numbering

    23
    0 Votes
    23 Posts
    5k Views
    BobbstermanB

    Tiny improvement (IMO) for bullet list: now it only copies spaces, no punctuation:

    from Npp import editor, SCINTILLANOTIFICATION import re class NA(object): def __init__(self): self.eol = ['\r\n', '\r', '\n'][editor.getEOLMode()] editor.callback(self.callback_sci_CHARADDED, [SCINTILLANOTIFICATION.CHARADDED]) def callback_sci_CHARADDED(self, args): if chr(args['ch']) == self.eol[-1]: caret_pos = editor.getCurrentPos() curr_line_num = editor.lineFromPosition(caret_pos) if curr_line_num > 0: prev_line = editor.getLine(curr_line_num - 1) m = re.match(r'\s*(\d+)([^\w\r\n]+)', prev_line) if m: full = str(m.group(1)) + str(m.group(2)) full_prev = prev_line.rstrip('\r\n') if (len(full_prev) > len(full)): # if m: prev_number = int(m.group(1)) symbols_after = m.group(2) new_number = prev_number + 1 text_to_insert = str(new_number) + symbols_after editor.insertText(caret_pos, text_to_insert) new_caret_pos = caret_pos + len(text_to_insert) editor.setEmptySelection(new_caret_pos) return m = re.match(r'\s*(\+)([\s*]+)', prev_line) if m: full = str(m.group(1)) + str(m.group(2)) full_prev = prev_line.rstrip('\r\n') if (len(full_prev) > len(full)): # if m: bullet = m.group(1) symbols_after = m.group(2) text_to_insert = bullet + symbols_after editor.insertText(caret_pos, text_to_insert) new_caret_pos = caret_pos + len(text_to_insert) editor.setEmptySelection(new_caret_pos) return if __name__ == '__main__': try: na except NameError: na = NA()
  • Error on type anything

    Locked
    12
    0 Votes
    12 Posts
    1k Views
    PeterJonesP

    @Mark-Olson said in Error on type anything:

    @Tebi-Sa
    I’m getting ChatGPT vibes from your answer. Strongly suggest not using AI tools to answer questions in this forum

    It’s not just a strong suggestion: it is one of the rules of the forum:

    To maintain a high quality of posts, accounts which post spam and accounts which post significant technical nonsense may be banned, at the moderators’/administrators’ discretion. (Being wrong is not grounds for banning; but persisting in posting misleading or confusingly-wrong posts, or persisting in using Generative AI (like ChatGPT) or similar programs to create posts, is grounds for banning.) - https://community.notepad-plus-plus.org/topic/21965/please-read-this-before-posting
  • Copy Link in Caret /w Ctrl+P (LuaScript)

    11
    0 Votes
    11 Posts
    568 Views
    guy038G

    Hi, @mpheath and All,

    I confirm that the command npp.AddShortcut(... works ONLY when appended to startup.lua and do not work in a separate Lua file !

    And, this time, after restarting N++, the new options Copy this link Ctrl+Alt+2 and Copy this link Ctrl+Alt+3 were present in the Lua sub-menu and did the job, correctly

    Finally, as this command is already included in the contextMenu.xml, I suppose that any script, whatever it is, that mimics the Copy link function, seems useless !

    Again, thank you very much, @mpheath, for your support !

    Best Regards,

    guy038