• Help with replace expression

    3
    0 Votes
    3 Posts
    352 Views
    asaan hamdyA

    Thank you so much

  • 0 Votes
    7 Posts
    888 Views
    PeterJonesP

    @ljhmily said in settings--preference--language style setting--bash--instruction word,is the keywords has number or word limit?:

    i added some keywords, like su wget api ssh, but only su wget ssh worked, the api and others not.

    su and wget are already keywords (INSTRUCTION WORD), so you don’t need to add them.

    And when I add api ssh to the list, they immediately start highlighting:

    But, as @Terry-R said,

    further test seems to show only the word against the margin will highlight if amongst the user added words

    It’s more nuanced than that, as shown by my screenshot:

    d5b9e1be-2492-4aca-a09c-f6d917a84620-image.png

    cat api only marks cat as a keyword because in the grammar of bash, cat is in the location of a command, but api is not (it’s the argument, not the instruction). But api blah at the beginning of the line will allow api to be recognized as an INSTRUCTION WORD, because it is grammatically where an instruction should be. Further, on my examples with | pipes and & or ; separators, the first word after the separator can also be recognized as an INSTRUCTION WORD, too… because they are instructions.

    You might try to argue that something like
    edec2c4f-2917-4462-b8a3-0e881bd569c9-image.png
    should highlight the ls as well as the ssh, because ls is also a command… but really, it’s not a command in terms of the bash script running on the local machine – it’s only a command once it’s sent all the way to the remote connection.

    similarly, ansible -vv api -m copy has -vv, api, -m, and copy as arguments, not as instructions, so only the ansible is a potential instruction word… and since it’s not a builtin keyword nor in my list of user-defined keywords, it is not highlighted.

    So, personally, I consider the bash/unix-shell syntax highlighter to be working correctly; according to the grammar that’s built into the lexer, it is highlighting the builtin or user-defined keywords when they are grammatically being used as instruction words, and only then. If you consider that a bug (I do not), this forum is not the right place to report it; in fact, the Notepad++ project is even the wrong place to report it, because the bash lexer is defined/coded in the Scintilla project which Notepad++ uses for that feature. You would have to go report that bug to Scintilla; once/if they fix it, you would then have to ask Notepad++ to upgrade to the newer Scintilla.

    However, you can add extra highlighting to a builtin lexer (like the bash/unix-shell lexer) using regexes via the script EnhanceAnyLexer.py that @Ekopalypse shares in his github repo. Those regexes wouldn’t be limited by the bash/unix-shell grammatical constraints, so if you defined a regex like \b(api|ssh|ansible)\b, it would highlight those words under the scripts color definitions whenever they were found, not just in grammatically instruction-word locations.

  • Help coding text errors

    4
    0 Votes
    4 Posts
    2k Views
    caryptC

    this is my poor attempt to help . it might contain error possibilities : so be careful . i havent concerned line-breaks (end of line) in my try . please correct me if you know . i would also suggest to use the search /mark funktion and then manually correct the mistakes step by step .

    i see one problem-case always has quotes at start and end , and sometimes ongoing sentence , also upper and lower case .
    search phrases example 1(period into comma) : ("\u.*)(\.)(")( \u.*)(\.) replace : $1,$3$4$5 . (the brackets define arguments and $number define the numbered backreferences for the former arguments , dot is any character , * means repetion , . (escaped dot) means the real dot-character ,\u means upper case character , \l lower case character, \s is space character)
    example 2 (missing comma) : s: ("\u.*)(")(\u.*)(\.) r: $1,$2$3$4 .
    example 3 (comma into period) s: ("\u.*)(,)(") r : $1.$3 .
    example 4 s: ("\u.*)(\.)(")(\u.*)(,)("\u.*)(\.)(") r: $1,$3$4.$6$7$8 .
    example 5 (finding missing period) s : (\u.*)(\s\u.*\.) r : $1.$2 .

  • Issues with npftp and ionos (1and1) sftp

    3
    0 Votes
    3 Posts
    639 Views
    PeterJonesP

    @asirota said in Issues with npftp and ionos (1and1) sftp:

    something special that’s changed in a recent version of Notepad++

    Please note that NppFTP is a separate entity from Notepad++. The “problem” is likely in the plugin, not in Notepad++ itself (because Notepad++ itself knows nothing about SFTP or any other such protocol).

    Sometimes, due to the OpenSSL library used by NppFTP plugin, the encryptions/etc that NppFTP knows about is different from the encryptions/etc that your server is willing to use. I have that problem with at least one server.

    However, based on the error messages, it appears your host doesn’t want password authentication. My guess is that in FileZilla, you have that host set to use an SSH key to log in, rather than a password, but that you aren’t trying SSH key with NppFTP. You might have to enable the private key checkbox and fill in the private key file location for the IONOS profile:
    0af9b7cb-38a9-4677-9c37-5122c5aaaf05-image.png
    (I think at one point, I also had NppFTP working with pageant or a pageant-equivalent SSH key agent, but I don’t currently have an example of that working available right now, so I don’t remember how it all worked together – but I think it had the checkbox enable but no keyfile in the text box in those settings.)

    If that doesn’t help you, I’m not sure how much more we’ll be able to help you here.

    If you look on your Plugins > NppFTP > About,
    adc919e0-ce33-410a-887c-ca6d1085abb9-image.png
    … you will see the Visit NppFTP site which then links to the NppFTP issue tracker, which is where you would go for help specifically on NppFTP. I would recommend, since you can successfully connect to that site using FileZilla, but not with NppFTP, that you share you NppFTP profile settings and the FileZilla profile settings in that issue you create over there. (If you do create an issue with NppFTP issue tracker, it’s generally considered polite to paste a link to the issue you create in this thread, so that anyone who reads your request here can follow it to its conclusion over there.)

    As a workaround for sites that I couldn’t get to work in NppFTP (in the days before my IT department uninstalled FileZilla for me), I would set up FZ to use Notepad++ for the editor, and then I would use FileZilla’s remote-edit feature to edit remote files through FZ using Notepad++. Using FZ+NPP vs NPP+NppFTP were very similar workflows for me, and it didn’t bother me to switch between the two.

  • Override Default Style Colors in Custom Language

    6
    1 Votes
    6 Posts
    2k Views
    ArkadiuszMichalskiA

    I remember having a similar problem in the past, I wanted the default colors everywhere except my UDL. Thanks for the tip above, I will check later if it works for me.

  • line by line modification using macro

    9
    0 Votes
    9 Posts
    1k Views
    TroshinDVT

    @Alan-Kilborn said in line by line modification using macro:

    A script feels a bit “heavy” for this simple operation.

    This is if we mean only this operation.
    In fact, there are many possibilities as the brackets are customizable.
    Often it is necessary, for example: to complete the lines on the right or left.

  • How to add an new entry in the "FunctionList"?

    14
    0 Votes
    14 Posts
    3k Views
    Magnus BerglundM

    @PeterJones
    Hello Peter,
    What a fantastic zipfile! :-)
    It works even for me, jippy!

    Thanks for the support!
    Have a great Christmas together with your family

  • Copy Find Result

    9
    0 Votes
    9 Posts
    9k Views
    caryptC

    Aaaahhhh ! yes , thats it . shame on me , i was not updated to 7.9.1 . i beg your pardon , but there is no excuse . shame on me

  • Limit display to lines with content to the left of "x".

    6
    0 Votes
    6 Posts
    690 Views
    fred339F

    @PeterJones Thank you! That works nicely. It appears that a “level” is defined by the appearance of a curly bracket - which is fine.

  • Ciao a tutti, ho una domanda credo facile

    2
    0 Votes
    2 Posts
    119 Views
    Alan KilbornA

    @Livio-Panuello said in Ciao a tutti, ho una domanda credo facile:

    I have a text file:
    ‘723’,
    ‘722’,
    ‘721’,
    ‘720’,
    ‘719’,
    ‘718’,
    ‘717’,
    I can quickly get a format like this:
    ‘723’,‘722’,‘721’,
    ‘720’,‘719’,‘718’,
    ‘717’,
    Thanks
    Hello

    I might try it like this:

    find: ^(.\d+.,)\R(.\d+.,)\R(.\d+.,\R)
    repl: \1 \2 \3
    search mode: regular expression

    I used a . for the single quote, since it could truly be one of several types of single-quote characters.

  • i want new option

    4
    0 Votes
    4 Posts
    119 Views
    Alan KilbornA

    @carypt

    Maybe a reasonable supposition.
    But why not let the OP say more?
    Replying to such a post only encourages questioners to put the minimum effort in.
    Instead it should be if GI then GO.

  • NP++ does not show me the message on the console

    2
    0 Votes
    2 Posts
    209 Views
    dinkumoilD

    @Alejandra-Bernal

    I don’t know how to use g++ from the command line, but I guess if you call it like you did it will create an executable file with some kind of default name and then terminates. Thus, the message regarding the started process with PID 5744 from your screenshot is about g++ itself and not about the created executable.

    Try to add the following as the last line of your NppExec script:

    $(CURRENT_DIRECTORY)\$(NAME_PART).exe

    If this doesn’t work, add some command line options to the line where g++ is called to tell the compiler where to create the output file and which name to use.

  • Invisible spaces

    10
    0 Votes
    10 Posts
    7k Views
    caryptC

    @Alan-Kilborn oh yes , i see , i forgot that i made that special setting for my npp-search, thus ctrl-f couldnt work as intended . sry for trouble . on the other hand i want to say that i might have not the time or knowledge to pile up a fully complete solution for a problem , but still wanting to share the results of my research (time consuming too) as "hints"even if it might need tweaking . thats why its called unprooven , to not cause messing up the tidyness of thoughts

  • My Notepad++ can't read style correctly

    2
    0 Votes
    2 Posts
    2k Views
    PeterJonesP

    @Huanying04 ,

    Your JSON is showing as styled, so Notepad++ is properly behaving as designed, and styling the JSON correctly.

    However, I think what you’re commenting on is that stylers.model.xml lists 14 different styles, but your Style Configurator only shows 6.

    That’s because a default installation of Notepad++ uses %AppData%\Notepad++\stylers.xml as the Style Configurator config file. The stylers.model.xml you found in the Notepad++ program directory is what Notepad++ uses to re-create %AppData%\Notepad++\stylers.xml if there isn’t one found. So, my guess is that you’ve updated Notepad++ on this computer, so that its stylers.model.xml is newer than your %AppData%\Notepad++\stylers.xml. If you opened %AppData%\Notepad++\stylers.xml (File | Open, and paste that string in), I believe it would only show the 6 styles that you can see.

    To fix this, you have two options:

    Delete and Re-create stylers.xml: WARNING: if you had customized any of your colors in the style configurator, this method will delete those customizations and you will have to redo them. I do not recommend this method if you want to keep your custom colors; try method#2 instead. Close all open Notepad++ windows Go to %AppData%\Notepad++\ and delete the stylers.xml file Open Notepad++. It will re-create %AppData%\Notepad++\stylers.xml Style Configurator > JSON should show all 14 styles now. Manually merge the two WARNING: Do not change any Notepad++ settings until after step #6. Close all open Notepad++ windows. Open a single Notepad++ window. Open the files stylers.model.xml in one view, and %AppData%\Notepad++\stylers.xml in the other If you have the Compare plugin, you can compare the two files to find where differences are; otherwise, you can just manually compare the two, and copy rows from stylers.model.xml to stylers.xml that were missing in stylers.xml. Close Notepad++ without changing any other settings Open Notepad++. Style Configurator > JSON should show all 14 styles now.


    PS: For more on %AppData%\Notepad++ folder, see “FAQ Desk: What is %AppData%”

  • 1 Votes
    6 Posts
    990 Views
    PeterJonesP

    Tangent:

    I was curious what SCI_DELETEBACKNOTLINE did differently than the normal backspace behavior, so since I had it mapped in that fresh portable, I tried it. If you have text on the line you are editing, that command will erase normally. But if you are at the first character of the line, where a normal backspace would delete the previous line’s EOL characters and take you to the end of the previous line, the SCI_DELETEBACKNOTLINE will not erase the EOL characters or take you to the end of the previous line – it will just stop at the beginning of the line you’re at.

    Interesting. I don’t know that I’ve ever had a desire for the editor to stop me from accidentally backspacing to the previous line… but I guess it’s good to know such a feature exists. :-)

  • All versions crash at startup

    13
    0 Votes
    13 Posts
    1k Views
    github4mosesG

    @github4moses Here I am again, having swapped the motherboard into one with a better CPU that can SSE2 now. The board takes all Windows Updates (that the previous one crashed upon) and runs even the most recent Notepad++ now. So I’m happy with the working tool and have to thank all the contributors having tried to help me.

  • How can I see the "Replaced files" after search and replace?

    11
    0 Votes
    11 Posts
    461 Views
    Alan KilbornA

    And, of course, the above advice was totally ignored. :-)

    https://github.com/notepad-plus-plus/notepad-plus-plus/issues/9275

  • Notepad++ can't find the words that still exist

    3
    0 Votes
    3 Posts
    175 Views
    Robin CruiseR

    I made something about it. I put the cursor somewhere else, then I check and search “Backward direction” Seems that my search was forward, that is why.

    thanks

  • JSON Styles Broken on v7.9.1

    4
    0 Votes
    4 Posts
    912 Views
    Daniel FuchsD

    Just to add to that, JSON by design does not have comments. It is a data only file type. Some if not most parsers error upon finding comments, so I guess Notepad++ is right here.

    See also https://stackoverflow.com/questions/244777/can-comments-be-used-in-json

  • can a wordpress website coding reaten in Notepad++?

    3
    -1 Votes
    3 Posts
    185 Views
    satta king balckS

    yes you can do. I also write the code of my website. After modification, i have again posted in wordpress files.