• Excerpt from my stylers.xml:

    <LexerType name="javascript.js" desc="JavaScript" ext=""> <WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="INSTRUCTION WORD" styleID="5" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" keywordClass="instre1" /> <WordsStyle name="TYPE WORD" styleID="16" fgColor="8000FF" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" keywordClass="type1" /> <WordsStyle name="WINDOW INSTRUCTION" styleID="19" fgColor="804000" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" keywordClass="instre2" /> <WordsStyle name="NUMBER" styleID="4" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="STRING" styleID="6" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="STRINGRAW" styleID="20" fgColor="000080" bgColor="C0C0C0" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="CHARACTER" styleID="7" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="OPERATOR" styleID="10" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" /> <WordsStyle name="VERBATIM" styleID="13" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="REGEX" styleID="14" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" /> <WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="COMMENT DOC" styleID="3" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="COMMENT LINE DOC" styleID="15" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="COMMENT DOC KEYWORD" styleID="17" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" /> <WordsStyle name="COMMENT DOC KEYWORD ERROR" styleID="18" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /> </LexerType>

    This is what I would have suggested, if I hadn’t found and confirmed what I realized while typing step 7 below. Before trying this, move down to the WHOOPS section.

    My next debug suggestion:

    Close all open instances of Notepad++ Use Windows Explorer and go to %AppData%\Notepad++ (you can just paste that into the address bar) Copy stylers.xml to keep-stylers.xml Edit stylers.xml: remove your “javascript.js” `<LexerType>, and replace it with my excerpt Save stylers.xml Close all open instances of Notepad++ Open your example test.js… (see WHOOPS below): Manually Selct Settings > Style Configurator > Select theme : “Default (stylers.xml)” It should have selected Javascript: “JavaScript file” should be in the lower-left of the status bar, and Language menu should show JavaScript selected

    Under these Exact circumstances, what do you get?

    WHOOPS

    I just noticed while typing this up that your file is named “test.php”, not “test.js”. Which means it’s likely selecting the PHP Lexer, not the Javascript Lexer. This would have been useful information at the start.

    When I take my example .js file, and manually select Language > PHP, then like you, I don’t get differentiated styling. But if I manually go back to Languages > Javascript, I get back the correct highlighting.

    Further, if I save the file as .php instead, and load it in NPP, then it defaults to the PHP lexer, and gives formatting similar to what you describe.

    LESSON

    The lesson is: it will apply the PHP lexer to PHP files. There isn’t (by default) a mixed lexer that will highlight both JS and PHP (or HTML+JS, or …) simultaneously. That would require a custom lexer. If you want to temporary apply JS lexer, you have to manually select it. If you want to always apply the JS lexer to PHP files, then use the Style Configurator and add php to the User Ext list for JavaScript

    BUG

    So, expecting PHP to properly parse and highlight JS is a poor expectation on the user’s part (IMO).

    But having the PHP parser get confused if there is embedded JS in PHP does seem like a bug in the PHP parser, to me.

    If you want to report that bug on the PHP lexer (that embedded javascript in PHP will mess up the PHP lexing), then you may do that. I believe that the PHP lexer is under the control of the Scintilla editor; it has it’s own bug tracker. But you should be forewarned: Notepad++ is somewhat behind in its version of scintilla (it doesn’t upgrade the scintilla component every time that the Scintilla project releases), so it may be that they’ve already fixed that bug; you can go through their bug tracker yourself and see. Also, even if Scintilla does fix it, there is no guarantee that the lexer will be updated in Notepad++, so the bug may stay around for a while.

    That said, you can use the workaround of manually selecting JavaScript language from the Language menu while you are editing the JS portions of your PHP.

    Possibility

    @Claudia-Frank has written up some code to create a custom lexer in PythonScript, which if I remember correctly allows you to do custom lexing with features that the builtin lexers don’t implement, but that UDL isn’t sufficient to handle. You can search the forum for her posts with “lexer” (and may find it), or wait to see if she chimes in after being @-mentioned. But you might be able to get it working to lex both PHP and JS in the same file.

  • Hi, @peter-row, @scott-sumner, @dinkumoil and All,

    Personally, I know Scott and read his posts, on N++ community, for years, and presently, we e-mail, both, about a promising Python script and I’m totally sure that he did not intend to be hurtful at all, towards you !

    As for me, I "follow" Notepad from the v4.9.2 version and, except for this very first version, I’ve always installed portable versions of N++ ( so, without the installer ) and, presently, I even have several versions of N++ on my laptop, without any problem, using them one at a time !

    A second advantage, to my mind, to install portable ( local ) configuration, in any folder you like, is that all files created by Notepad++, remain in that specific folder and its sub-folders ! Quite easy to manage ! In addition, problems of permissions/rights are not so frequent if you chose an installation folder in your user area :-))

    To end with, I agree with Scott, when he said :

    Something may not be working for you, but for me and I suspect the rest of us, themes work just great.

    You would be astonished of the lot of N++ problems, related by users, on our site, which I’ve, personally, never experimented, up to now ;-))

    Best Regards,

    guy038

  • @scott-sumner
    Added your script under https://github.com/bruderstein/PythonScript/blob/master/scripts/Samples/BracketHighlighter.py. Hope that is ok for you. If you have more example scripts to add just let me know. Would be happy to add more of them.

  • thank you guys!!!
    D.

  • first check .matches newline in order to work

    SEARCH: (<title>(.*?)<\/title>.*?)(<meta property="og:title" content=").*?(" \/>)

    REPLACE WITH: \1\3\2\4

  • @SalviaSage said:

    There is already a built-in feature which colours the bad brackets but only if the caret cursor is on that bracket

    How does this color “bad” brackets? I see it coloring matching brackets, but it makes no decisions about a bracket’s “goodness” or “badness”. What I’m getting at is “What is your algorithm for determining a ‘bad’ bracket?”

    Maybe @dinkumoil 's plugin suggestion helps you.

    There is also a Pythonscript that boxes in the containing brackets when your caret is “inside”, if that helps you. But I’m sensing it doesn’t, because you already know about that script from our previous discussion in this thread…

  • Thanks for the reply @Jim-Dailey. You have save some of my time trying to figure out a way to do it.

    However, if the above is not possible Can I have the string dd.dd.dd display under a single color. Is that possible?

  • Unfortunately for you, Notepad++ does not double as backup software with version control (by default).

    There is a microscopic chance that following the “Possible File Recovery” section of this FAQ would help you… IF you had Settings > Preferences > Backup > Backup on save = ☑ Verbose backup, then every time you hit Save in NPP, it would create a backup copy of the file with a different timestame (see NPP Wiki: Document Management, search for “verbose”) – but that’s not enabled by default. (If you had ☑ Simple backup, only the most recent version is saved.)

    Windows has an option: if you right click on a file, there’s a “Restore Previous Versions” option – if you happen to have configured Windows in the right way (I don’t know what that way is), then maybe that would help.

    The best advice (mentioned in that FAQ I linked earlier) is to proactively control your own destiny, especially with important files. If you only ever need the most recent version of a file, then most automated backup software will cover you. Some automated backup programs will even keep multiple versions of the same file, so you can go back in time to a certain extent. Some cloud file services might keep a few versions going back, as well, so if you’re editing files in your cloud folders, there might be some historical versions – see your cloud provider’s documentation. But if going back through the change history of a file is very important to you, then the best bet is version control software (like Subversion or Git) and remembering to “commit early, commit often”.

    Unfortunately, most of this advice requires that you already knew how to set up all those various options, and had decided to do so. If the hints above don’t help you recover this file, hopefully they will at least encourage you to set up a backup and file-history system that will meet your needs.

  • @Ben-S

    Automatic encoding detection is a difficult and unreliable thing. The algorithms work heuristically by inspecting the file’s content and can fail under some circumstances.

    If your file names have a special file extension you could use my AutoCodepage plugin, available via Notepad++ PluginManager.

    Otherwise there would be the following workaround:

    Open Windows Notepad. Press and hold the ALT-Key and type at the numeric block of the keyboard the sequence 0239. Press and hold the ALT-Key and type at the numeric block of the keyboard the sequence 0187. Press and hold the ALT-Key and type at the numeric block of the keyboard the sequence 0191. Save the file under the name Header.txt in the folder where your file is stored but avoid to press ENTER before saving. Open a Windows console and navigate to the folder where your file and the newly created Header.txt are stored. Execute the following command: copy /b "Header.txt" + "<Name-of-your-file>" "Result.txt"

    With this sequence you will add an UTF-8 Byte Order Mark (BOM) to the beginning of your file and store it under the name Result.txt. When you open this file in Notepad++ it should be recognized as UTF-8 encoded.

  • @james-pruett

    As a first step, perhaps turn OFF the option to treat warnings as errors…and see if that gets you further along? :-)

  • Sweet, works perfectly :)
    ty!

  • Mil gracias! Funcionó

  • @Vincitydaimo-Vincity

    See here for how to officially make a feature request.

  • Spell check software is very helpful for writing. Because lots of time we done some mistakes in writing. This help you to minimise your errors in content.
    Assignment Help Australia

  • It works for me.

    Notepad++ v7.5.8 (32-bit)
    Build time : Jul 23 2018 - 02:03:53
    Path : C:\Program Files (x86)\Notepad++\notepad++.exe
    Admin mode : OFF
    Local Conf mode : OFF
    OS : Windows 10 (64-bit)
    Plugins : ComparePlugin.dll dbgpPlugin.dll NppExec.dll NppFTP.dll NppTextFX.dll PluginManager.dll PreviewHTML.dll PythonScript.dll DSpellCheck.dll mimeTools.dll NppConverter.dll NppExport.dll

    If I copy the data you posted, create a new file, paste, and do Edit > Line Operations > Sort Lines Lexicographically Ascending, it sorts. The results are:

    Aaliyah Abigail Adam Addison Adolphe Aidenv Aisha Alberta Alexander Alexandra Alexis Ali Alice Alyssa Amelia Andrew Angus Anna Annabelle Anthony Archer Archie Aria Ariana Arlo Ashton Athena Atlas Atticus Audrey Aurora Austin Ava Ayla Beau Beazer Bella Benjamin Bertha Betty Biggest Bill Billie BiscuitBarrel Blake Blythe Bodhi Boop Bottom Bottomfeeder Braxton Brody Bush Butt Caesar Caleb Campbell Carter Carway Cecilia Charles Charlie Charlotte Chase Chelsea Chloe Christian Christianson Claire Coioton Colt Connor Constantine Cooper Crabby Daisy Dan Daniel David Deangelo Delilah Diana Dominic Donald Dork Doug Douglas Dracula Dylan Eden Edward Eleanor Eli Elijah Eliza Elizabeth Ella Ellie Eloise Elsie Emilia Emily Emma Ethan Eva Eve Evelyn Evie Fanny Fearn Felix Finn Flynn Frankenstein Frankie Franklin Gabriel Gabriella George Georgia Germbag Gertrude Grace Hamish Hannah Harley Harlow Harper Harriet Harrison Harry Harvey Hayden Hazel Headbanger Henry Hernandez Holly Hudson Hugo Hunter Hypatia Hyxxeljksser Imma Imogen Indiana Inez Isaac Isabel Isabella Isabelle Isla Ivy Jack Jackson Jacob Jake James Jane Jasmine Jason Jasper Jaxon Jayden Jesse Jessica Jim John Jonathan Jones Jordan Joseph Joshua Juniper Kai Kate Kauror Kirk Krieper Lachlan Lara Layla Leah Leo Leon Lethbridge Levi Liam Lillian Lilly Lily Lincoln Logan Lola Louis Louise Luca Lucas Lucy Luke Mackenzie Maddison Madeleine Madeline Madison Magnum Marcus Martin Maryam Mason Matilda Matt Matthew Maud Max Maxwell Maya Meyer Mia Michael Mila Molly Muhammad Nate Nathan Nathaniel Nero Nicholas Nick Noah Nora OBrien Olive Oliver Olivia Ophelia Oscar Owen Owen Paige Paige Patrick Patrick Penelope Penelope Pepper Pepper Phoebe Phoebe Piper Piper Poppy Poppy Prudence Prudence Quince Quince Rebecca Rebecca Riley Riley Rory Rory Rose Rose Ross Ross RossGerm RossGerm Ruby Ruby Ryan Ryan Ryder Ryder Samuel Samuel Sarah Sarah Savannah Savannah Scarlett Scarlett Sebastian Sebastian Services Services Sienna Sienna Smith Smith Sofia Sofia Sophia Sophia Sophie Sophie SpongeBob SpongeBob SquidWorth SquidWorth Stella Stella Stephan Stephan Steven Steven Summer Summer Super Super Tarquin Tarquin Teresa Teresa Theodore Theodore Thomas Thomas Thurman Thurman Toby Toby Trump Trump Tyler Tyler Ulysis Ulysis VanHelsing VanHelsing Venus Venus Victor Victor Victoria Victoria Violet Violet Wagering Wagering Waterton Waterton WelshHuggins WelshHuggins WhoCares WhoCares Wigglebottom Wigglebottom Wiggleworth Wiggleworth William William Willow Willow Wilson Wilson Winifred Winifred Winter Winter Wolfeschlegels Wolfeschlegels Xavier Xavier Xenophon Xenophon Yetty Yetty Zachary Zachary Zappa Zappa Zara Zara Zeno Zeno Zevon Zevon Zoe Zoe

    There’s nothing about your data that would cause it to not sort. There’s nothing about the Notepad++ v7.5.8 32-bit executable that would cause it not to sort. Either one of your plugins is interfering (try again, but use notepad++.exe -noPlugin when running, instead of your normal shortcut – you can even edit your normal shortcut to include that option; I just tried, and it still sorted just fine for me), or there is user error.

    Did you try the short list, like I showed in my screen capture movie? Does that work for you, or not?

  • Hi, @rugabunda, @scott-sumner, @dinkumoil and All,

    Ah, many thanks, Dinkumoil, for your optimization advices !

    Of course, having 17,000 messages "impossible to open File-B.txt" is rather idiot ! I did not realize this, as working on my tiny File_A.txt :-(

    Thus, appending 17,000 times, a line to File_C.txt is not very efficient, too, as you said !

    Finally :

    If you previously chose some basic filenames, without spaces, this syntax should be enough : (for /f "delims=" %L in (File_A.txt) do @(findstr /x /c:"%L" File_B.txt 1>NUL 2>NUL || echo %L)) > File_C.txt If your filenames may be long, with some space characters, the @dinkumoil solution, with the usebackq option and filenames surrounded by double quotes, is safer !

    Cheers,

    guy038

  • @SuperCPU,

    I understand the solution you and Scott were thinking of would be best. I was just trying to give you a workaround, because even if you do submit a feature request, it may be quite some time (if ever) before that request is implemented.

    The workaround does work for “Numpad 0” or “INS” or “DEL” or others: you just type the first character of the text of the menu item: for “Numpad 0”, you would hit “N” twice; for “INS”, you would hit “I” once (because the INS entry comes before the I entry); similarly type “D” for “DEL”. That’s the way it works in Notepad++, and quite a few other Windows applications with dropdown menus: if you type the first character of the option, it will go to the next option that starts with that character.

Internal error.

Oops! Looks like something went wrong!