• More space at the left of the first column

    13
    0 Votes
    13 Posts
    1k Views
    Alan KilbornA

    @guy038 said in More space at the left of the first column:

    And to get the very end of current line, in all cases, affect a shortcut to the Scintilla command SCI_LINEEND

    That reminds me of some related discussion as part of this thread: https://community.notepad-plus-plus.org/topic/23381

  • How do I move bookmarks to a copy of the same file?

    20
    0 Votes
    20 Posts
    2k Views
    Paul WormerP

    @Paul-Wormer
    I prepared a pedestrian script that mimicks the all command of Xedit and Kedit. Just like those two editors (that both date from before color screens came into existence) my script doesn’t do any coloring. I hope that the bug in the Scintilla routine hideLines is circumvented by invoking it twice. [During my writing of the script, it indeed happened several times that not all lines were hidden after issuing editor.hideLines(0, int(editor.getLineCount())-1 )].

    Here comes the script:

    # -*- coding: utf-8 -*- from __future__ import print_function # Python 2.7 from Npp import * def disp_only_lines(string_to_show): ''' Display only the lines that contain `string_to_show`. ''' Lines_to_show = set() def handle(m): Lines_to_show.add(editor.lineFromPosition(m.start())) # Loop over whole file, calling `handle` for each find: editor.search(string_to_show, handle) # Sort numbers of lines containing `string_to_show`: Lines_to_show_sorted = sorted(list(Lines_to_show)) # Hide all lines (twice because of bug in Scintilla): editor.hideLines(0, int(editor.getLineCount())-1 ) editor.hideLines(0, int(editor.getLineCount())-1 ) # Actual showing of lines to be shown: for line_shown in Lines_to_show_sorted: editor.showLines(line_shown, line_shown) def tab_callback(args): ''' Called after return from other tab. ''' global save_bufferID, display_all, string_to_show if save_bufferID == args['bufferID'] and not display_all: disp_only_lines(string_to_show) #### Main #### save_bufferID = notepad.getCurrentBufferID() notepad.clearCallbacks(tab_callback) notepad.callback(tab_callback, [NOTIFICATION.BUFFERACTIVATED]) # Role of boolean `display_all`: # if true all lines are displayed, else some lines are hidden. try: if display_all: string_to_show = editor.getSelText() editor.setEmptySelection(editor.getCurrentPos()) # Undo selection except NameError: # First time in, `display_all` does not exist display_all = True string_to_show = editor.getSelText() editor.setEmptySelection(editor.getCurrentPos()) # Undo selection if len(string_to_show) == 0 and display_all: notepad.messageBox('No string selected', 'all.py') else: if display_all: disp_only_lines(string_to_show) display_all = False # Not all lines are displayed else: editor.showLines(0, int(editor.getLineCount())-1 ) display_all = True # All lines are displayed string_to_show = ''
  • replacing a specific text from a another file

    14
    0 Votes
    14 Posts
    4k Views
    fenzek1F

    Thank you guys.
    For your feedback to me.
    I will study the subject of “regular expressions” in more detail.

    If it applies to my work and makes it VERY easy, then I must know something about it right.

    I’ve looked at your answers before, and they’ve helped me with other obvious things, but obviously I didn’t understand anything about coding,
    Still, your altruism and help made sense to me.
    And the way you help people is nothing but respect.
    Thank you from the bottom of my heart.

    I understand that old-timers are willing to give a year, a couple of years, or even a decade to learn.
    And then someone like me shows up and “help me do it for me,” no, that’s not it, and that’s not the plan I had when I started my thread.

    You showed me, and for that I want to say thank you.

  • Fold/Unfold is acting inconsistently.

    3
    1 Votes
    3 Posts
    280 Views
    ludamo 0L

    Yes I noticed something like this recently. I folded a few functions in a large AHK file (over 3000 lines), then started to add a new function below the folded ones and seemed to lose the folded functions? Fortunately multiple undoes saved me from starting from a backup.
    I tried it again just now but couldn’t replicate it. I am using version 8.4.8.

  • user defined languaje dialog, multiline comments

    3
    0 Votes
    3 Posts
    351 Views
    carlos CharlyC

    @PeterJones Thank you! Using EnhanceAnyLexer plugin In 10 minutes I colored my special multiline comments! Good solution!

  • Custom IntelliSense For Objects

    2
    0 Votes
    2 Posts
    565 Views
    EkopalypseE

    @pgSystemTester

    Npp is a general purpose editor and has no reflection/inspection built in for any programming language. But it does have the ActiveX plugin that allows JavaScript to manipulate Scintilla’s calltip and autocomplete objects at runtime.
    Another option would be to use my LSP client, but that means you need to have an LSP server running for JavaScript, since I don’t work with Java/JavaScript I haven’t tested/investigated that.

  • Problems with printing from Notepad++

    6
    0 Votes
    6 Posts
    7k Views
    Alan KilbornA

    @R-W said in Problems with printing from Notepad++:

    I got it to work by:
    Goto Preferences
    Margins/Boarder/Edge
    Uncheck Display Change History

    This thread predates the existence of Change History as a feature, so of course the posts above don’t mention it. More on Change History, including interaction with printing, can be found in its FAQ entry.

  • Hating document switching window hotkey

    6
    0 Votes
    6 Posts
    288 Views
    Alan KilbornA

    @Владислав-Пестриков said in Hating document switching window hotkey:

    i cant disable its invocation by mouse.

    How are you invoking that popup window via the mouse?

  • deleting whole lines

    2
    0 Votes
    2 Posts
    155 Views
    Alan KilbornA

    @kracovwolf

    Match lines containing an open parenthesis (somewhere) followed by a closing parenthesis (somewhere after the opening one) with:

    Find what: ^.*?\(.*?\).*\R
    Search mode: Regular expression

  • Help about prefix and quotes

    5
    0 Votes
    5 Posts
    753 Views
    Pablo Hugo RedaP

    @Ekopalypse Thank’s !!

  • Need Help Comparing Two Text Files

    2
    0 Votes
    2 Posts
    767 Views
    datatraveller1D

    @usamarslan I’m afraid Notepad++ isn’t the right tool to do your task. It sounds like you need a tool for joining CSV files like the freeware command line tools xsv (https://github.com/BurntSushi/xsv) orlistcompare (https://mg-tools.weebly.com/). However, probably no tool can do exactly what you want. In this case, you need to write a script (e.g. in Python) to fulfil your requirements.

  • Functionlist parsing issues, language specifics.

    4
    0 Votes
    4 Posts
    399 Views
    Lycan ThropeL

    @swegmike ,

    Putting this as delicately as I can, when I was developing my UDL, I ran into the same problem. Solution: Do it the way the functionList regex(boost) does it. Which means, learn the boost or rather, the NPP way of doing it. Stop trying to compare apples and oranges to get what you want done by insisting on shoehorning some other tool into it.

    Regex101.com is a great resource for someone learning regex and trying things out to interactively see how different combinations help to achieve results…but since they even have mutiple ‘flavors’ of regex, that should tell you something right there. There is no one only option. You take the good with the bad…and in this case, they don’t offer their site with a boost version. Unfortunately for you, they also don’t write Notepad++, and currently, NPP uses the Boost regex engine for whatever reason the developers chose to use it. Since Regex101.com doesn’t offer you a way to write a functionList for NPP…you’re stuck having to learn the tool this tool chose to use or forego the tool.
    I get it, it was a setback for me also and I had to learn to use the NPP/Boost, and I had a lot of help from these folks here on how to get it to work to do what I wanted, but that’s because they’re familiar with this tool, using these tools, and have developed similar things also. So…best advise, is to buckle down and start using the present tools, rather than dream of a perfect world. :) No sense wishing, when you can make a suggstion for future use, but presently use and learn the tools available. I’m still a newbie regex user, and regex101.com is my choice for interactive development of a regex, but at the end of the day, it helps me get 90% of the way there, but I still have to finish it in Boost…so…I do.
    Happy New Year to you and all the fine folks here who are willing to help you use the tools available NOW. :)

  • How can I turn off Change History

    22
    1 Votes
    22 Posts
    10k Views
    Alan KilbornA

    @Bigfootmech

    if I launch the old one, the “off” setting gets reset on the new version, turning display history back on

    This situation causes both to use the same settings, because there is only one copy of the settings on your PC.

  • How to stop Notepad++ intercepting back/forward keypresses?

    6
    0 Votes
    6 Posts
    3k Views
    Alan KilbornA

    @Alan-Kilborn said in How to stop Notepad++ intercepting back/forward keypresses?:

    The “forward” button does the “find next” and the “backward” button does the “find previous”.

    I’ve decided that to me tying the functionalities this way doesn’t make sense. The “forward” button on the mouse is toward the top of the mouse, with the “backward” button closer to me. So, my thinking is that the further button should do the find-previous and the closer button should do the find-next. Thus, I’ve changed the code to swap the functionalities.

    BTW, my fancy new mouse also has a horizontal scroll wheel, in addition to the normal vertical one:

    7f541264-85bd-4d1e-b9c6-4056b029e868-image.png

    When I try this h-wheel with Notepad++ (and other apps), I find that the scroll direction is the opposite of what I expect! (And that the scrolling isn’t “fast enough” but that’s a different thing). So, another script took care of “fixing” the h-scroll direction…for N++ at least (don’t see myself using h-scroll in other apps).

    Probably installing the add-on s/w for the mouse allows me to configure such things; I don’t normally do that but with this mouse’s advanced features, I just might.

  • please help me let my chat control my game

    2
    0 Votes
    2 Posts
    398 Views
    PeterJonesP

    @Gabr-Care said in please help me let my chat control my game:

    i am trying to learn how to use the notepad++

    You open a file in Notepad++ and start typing. If you want to do advanced stuff, go to the ? menu and choose the Online User Manual. If you have specific questions, feel free to ask them here.

    Hello i am new to coding …

    https://community.notepad-plus-plus.org/topic/15958/faq-desk-you-ve-asked-your-question-in-the-wrong-place

  • Fusing all Lines not starting with a Specific string with the line above.

    3
    0 Votes
    3 Posts
    223 Views
    guy038G

    Hello, @nili-30000, @dinkumoil and All,

    Here is my solution which :

    Rewrite the line-break if it is followed with a line having not more than 10 chars followed with a ) character

    Replace the line-break with a space character, in all the other cases

    Let’s begin :

    Do a normal selection of a range of lines that you want to modify, without including the last line-break

    Open the Replace dialog ( Ctrl + H )

    Untick all options

    Tick the In selection option ( IMPORTANT )

    Delete any text in the Find what: zone

    Replace it with the expression (?x-s) (\R) (?= .{1,10} \) ) | \R

    Write the expression ?1$1:\x20 in the Replace with: zone

    Choose the Regular expression search mode

    Click once only on the Replace All button ( Do not use the Replace button ! )

    From your INPUT text, where I added some pure blank lines :

    N09-M06) Welche Maßnahme n hat der Aufsichtführende vor Arbeitsaufnahme unter Anseilschutz un ter anderem zu ergreifen? a) Die Anzahl der vor handenen Sicherheitsgeschirre sind zu erfassen b) Die Benutzer sind name ntlich zu erfassen c) Die Benutzer sind zu unterwei sen und die Anschlagpunkte sind vo rzugeben d) Es sind keine besonderen Maßnahmen zu ergreifen, da die Arbeit u nproblematisch ist für Führungskräfte der operativen Ebene

    You should get your expected OUTPUT text :

    N09-M06) Welche Maßnahme n hat der Aufsichtführende vor Arbeitsaufnahme unter Anseilschutz un ter anderem zu ergreifen? a) Die Anzahl der vor handenen Sicherheitsgeschirre sind zu erfassen b) Die Benutzer sind name ntlich zu erfassen c) Die Benutzer sind zu unterwei sen und die Anschlagpunkte sind vo rzugeben d) Es sind keine besonderen Maßnahmen zu ergreifen, da die Arbeit u nproblematisch ist für Führungskräfte der operativen Ebene

    Best regards

    guy038

  • Notepad++ change characters while open a file?

    5
    0 Votes
    5 Posts
    2k Views
    PeterJonesP

    @Arí-Ricardo-Ody said in Notepad++ change characters while open a file?:

    There is a cobol program on an IBM mainframe that requires the data it handles to have a hex x’0D’ after the last byte of each line.
    I’m just trying to prepare a text file in Notepad++ that will be transmitted to the mainframe.

    As @Alan-Kilborn said, that means your mainframe is expecting Macintosh-style line endings.

    In case you don’t understand line endings (most Windows users do not – though I would think anyone who was working on a Windows machine for an IBM mainframe would), there are three common sets of bytes that refer to the end of a line for text/source-code files:

    Unix/Linux: uses a line feed (ASCII 10, aka x’0A’ in your hex-based nomenclature, aka LF) Old Macintosh (and apparently IBM mainframe cobol compilers): uses a carriage return (ASCII 13, aka x’0D’, aka CR) Windows: uses a carriage return followed by a linefeed (ASCII 13 then ASCII 10, aka x’0D’ x’0A’, aka CRLF)

    Notepad++ defaults to using Windows line endings… unless you are opening a file that already has a Linux or Mac style line ending consistently used throughout, in which case it will auto-detect the right ending.

    So this means you are creating a new file from scratch, and thus it defaulted to Windows CRLF endings. Use the method Alan showed (or right clicking on the “Windows (CRLF)” on the lower-right of the Notepad++ status bar) to change the line endings.
    f268559d-77b7-4293-80ee-55a4016969bc-image.png

    Also, if you are using FTP to get the cobol source code from the Windows PC to your mainframe, you will have to pay attention to ASCII vs BINARY transfer mode: BINARY will transmit the bytes as-is; ASCII will convert CRLF on your PC to the native line-ending format of the destination machine, and vice versa, as long as the FTP server on the other end is configured correctly. Make sure you understand how your FTP client (or whatever file-transfer protocol you use: rcp, sftp, ftps, going across a SAMBA server, or whatever) deals with line endings, because no matter how careful you are in your text editor, if your transfer protocol changes things, you will get more confused.

    I didn’t understand your censure when you say that I’m doing it wrong, without knowing the reason why I’m doing it.

    His censure was because you were going about it wrong. (And more over, his actual phrasing was “don’t do what you are attempting… unless you can provide sound reason for doing so”. There was a sound reason for wanting x’0D’ as the line ending (because your IBM mainframe Cobol compiler wants that line ending)… but you were just going about the process in the wrong way when trying to get a necessary line ending (or at least, what you described yourself as doing was wrong; I cannot know whether you were actually doing it right and just didn’t describe it correctly).

    To clarify why the way you described is the wrong way: just arbitrarily adding the x’0D` byte to the end of lines that already have x’0D’ x’0A’ as the line ending won’t do what you want… because then the bytes will be either x’0D’ x’0D’ x’0A’ or x’0D’ x’0A’ x’0D’ (depending on where on the “end” of the line you added the x’0D’), which will not be what your compiler would want. The way you described things, you were fighting against the way that both KEDIT and Notepad++ deal with line endings, and hoping it would come out right, rather than understanding line endings and the tools you were using to get them to natively use the right line endings.

    So your end goal was reasonable. And Alan and I have now explained how to make Notepad++ give you your end-goal in the correct manner.

  • mark a line using a single button with macro or any feature.

    3
    0 Votes
    3 Posts
    402 Views
    PeterJonesP

    @Shekhar said in mark a line using a single button with macro or any feature.:

    highlight a line by pressing a single key or by highlight a line by using a macro function.

    By “highlight”, I assume you mean “select”, like what is accomplished by triple-clicking a line. Unfortunately, triple-click is not macro-recordable, and there is no single “scintilla command” that you can assign a shortcut to (that I am aware of).

    However, using Scintilla command IDs, you can craft your own macro:

    Edit %AppData%\Notepad++\shortcuts.xml * * Insert the following into the <Macros> section <Macro name="HomeShiftEnd" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="0" message="2312" wParam="0" lParam="0" sParam="" /> <Action type="0" message="2315" wParam="0" lParam="0" sParam="" /> </Macro> Save. Restart Notepad++

    Now you have a macro called “HomeShiftEnd” which will do what i think you want. You can assign a keyboard shortcut to that, just like any macro.

  • Updating to V8.4.7, lost all my previous tabs

    3
    0 Votes
    3 Posts
    244 Views
    Bob KinzettB

    @PeterJones Thanks Peter… gives me some direction to work with

  • How to set "Find" Background colour?

    32
    0 Votes
    32 Posts
    10k Views
    Lycan ThropeL

    @Angga-Setia-Budi ,

    Mind you, your question doesn’t really apply to this thread’s discussion, however to move you along, here’s the steps needed. Go to the menu bar Preferences->Style Configurator->Language: Global Styles and then Style: Default Style. You’ll then see the two color selectable boxes to the right in the Colour Style Section of the Dialog box. You can set the colors there for whatever you want for the non-focusing line colors, and then go down to Style: Current line background and again, look to the right to see the color selection boxes to choose the colors from there. Now mind you, if it’s a predefined language you’re using, that will change the colors for all the language.
    See Below:
    StyleConfiguratorSelection.PNG