• Notepad++ 7.7.1 won't default to .txt when saving

    15
    0 Votes
    15 Posts
    6k Views
    EkopalypseE

    @Viri-Davu said in Notepad++ 7.7.1 won’t default to .txt when saving:

    … and in fact, Notepad++ is based on Windows Notepad, …

    I’m curious, what makes you think this is the case?

    @Viri-Davu said in Notepad++ 7.7.1 won't default to .txt when saving:

    Even for security reasons it should be. …

    Can you explain this in more detail? Why should files be saved as .txt for security reasons? This does not make sense to me. Where is this specified?

  • Script for automatic insertion of modified rows

    8
    0 Votes
    8 Posts
    315 Views
    guy038G

    Hello, @martin-steiner, @ekopalypse and All,

    Of course, the @ekopalypse’s python script seems the best bet ! However, you can just achieve it with the native regex engine of N++ !

    I was able to download your Test_File.zip archive and extract the Cooper_CH1_Call.xml file

    Just execute each point of the method below :

    Open your Cooper_CH1_Call.xml file in N++

    Open the Mark dialog ( Ctrl + M )

    Uncheck all the box options

    Check the Wrap around option

    SEARCH (?x-si) (?<= <Text> ) .+ (?= </Text> )

    Select the Regular expression search mode

    Click on the Mark All button

    Click on the Copy Marked Text button

    Move to the very end of the file

    Add an empty new line

    Paste the bookmarked lines with Ctrl + V

    => Near the end of the XMl file, you should get this text :

    </DialogCues> <Name>Cooper_CH1_Call</Name> </DialogCueSheetData> Ahoj. Tady je opět Cooper. You cannot open that door \nwith your current version of \nthe OMNI View software. You will need to update your \nsoftware at a Daemon server. Upgrade to version 1.0 and \nyou can open this door. Then, you can get the girl to the Library. Nejbližší Daemon se nachází v jídelně, na druhé straně kolejí. I will add this waypoint to your OMNI View. I will also highlight this location on your map. I will add this waypoint to your map. ... ... ... Zobrazíš ji výběrem ikony mapy v telefonu. Buď opatrný. The girl must feel a strong sense of deja vu, but fortunately you have been down this road before, too. Each confinement room contains a power unit in case of power failure. Find the unit to open the door. It is in a different location inside every room, so check every corner in OMNI-View. Tohle je pepřový sprej značky P-Zero. Equip it with the phone, and select a guard for her to attack. Knowing the girl, she'll defend herself even without the spray equipped. But be careful, each canister has a single shot. And guards will eventually return to patrol angrier than ever.

    Note that I assume that your initial XML file does not contain any empty line !

    Now, simply add the desired translation of every line, after some space characters. For instance :

    </DialogCues> <Name>Cooper_CH1_Call</Name> </DialogCueSheetData> Ahoj. Tady je opět Cooper. Line 001 You cannot open that door \nwith your current version of \nthe OMNI View software. Line 002 You will need to update your \nsoftware at a Daemon server. Line 003 Upgrade to version 1.0 and \nyou can open this door. Line 004 Then, you can get the girl to the Library. Line 005 Nejbližší Daemon se nachází v jídelně, Line 006 na druhé straně kolejí. Line 007 I will add this waypoint to your OMNI View. Line 008 I will also highlight this location on your map. Line 009 I will add this waypoint to your map. Line 010 ... ... ... Zobrazíš ji výběrem ikony mapy v telefonu. Buď opatrný. Line 244 The girl must feel a strong sense of deja vu, but fortunately you have been down this road before, too. Line 245 Each confinement room contains a power unit in case of power failure. Line 246 Find the unit to open the door. Line 247 It is in a different location inside every room, so check every corner in OMNI-View. Line 248 Tohle je pepřový sprej značky P-Zero. Line 249 Equip it with the phone, and select a guard for her to attack. Line 250 Knowing the girl, she'll defend herself even without the spray equipped. Line 251 But be careful, each canister has a single shot. Line 252 And guards will eventually return to patrol angrier than ever. Line 253

    Then :

    Open the Replace dialog Ctrl + H

    Uncheck all the box options

    Check the Wrap around option

    SEARCH (?x-si) (?<= <Text> ) ( .+ ) (?= </Text> (?s: .+ ) ^ \R (?-s: .+ \R )* \1 \x20{2,} ( .+ ) ) | (?s) ^ \R .+

    REPLACE ?2\2

    Select the Regular expression search mode

    Click on the Replace All button

    Here you are ! All the lines <Text>..........</Text> should now contain their corresponding translation Line ### !

    Best Regards

    guy038

    P.S. :

    In case, your XML file contains empty lines, change, for instance, the uniq empty separation line with a line of @ characters and use the regex replacement :

    SEARCH (?x-si) (?<= <Text> ) ( .+ ) (?= </Text> (?s: .+ ) ^ @+ \R (?-s: .+ \R )* \1 \x20{2,} ( .+ ) ) | (?s) ^ @+ \R .+

    REPLACE ?2\2

  • Setting UDL for file names

    3
    0 Votes
    3 Posts
    188 Views
    dipaolovD

    @Ekopalypse Thanks!

  • how delete all text before word?

    2
    0 Votes
    2 Posts
    200 Views
  • User defined language and break/extra return statements

    4
    0 Votes
    4 Posts
    423 Views
    Lycan ThropeL

    @Charles-Chickering ,

    The problem here, is like Peter has mentioned. The UDL is a general parser, which makes it kind of dumb, but it does it’s job. The problem may be that you might need to rewrite your code if it’s able to be done.

    I found this problem in our UDL also, and rewrote the code instead, to reflect a better practice.

    For instance, if your language allows it, using a return in an if/endif conditional is essentially a “goto” escape clause reminiscent of early Basic. It was frowned on then as well, but did the job. If your condition in that code is accurate, then presumably you are accessing variables that you’re allowed to change in the function that is being passed to it, or it’s able to change the variable directly. If that is the case, perhaps you should just do the variable change which is the purpose of that conditional controlling.

    For instance, in that example code, Function foo is called, and the first thing it does is check if the A == 1. If it is, goes to the next if, if not, it goes to the end of A before the code before the return statement. If it does equal A, it then goes to the next conditional check if B==0, which if it is, it changes the variable x to 2. IF B is not equal to 0, it will automatically go to the else statement and change C to 3. No need for a return statement here. Your 2 if statements will end.

    Unfortunately, the way your code shows above, the return only keeps the code from continuing after x is changed to 2, where you’re trying to exit the function at that point. That’s not what you should be doing. You should be letting the function finish it’s run so it can return on it’s own.

    If the code at the end is not to be run, if the above conditions are met, then you need to add an else condition for if A<> 1, like this:

    function foo() //Simplified code if (A == 1) if (B == 0) x = 2 else C = 3 end //end b else //more code that doesn't execute if above condition is met end //end a return

    Follow the logic. those conditions have to be met. If they are met, they ignore the rest until they reach the end of the function, if you have structured them properly. At that point, you don’t need the return statement acting like a “goto” statement.

    The only other option, but the above code doesn’t seem to follow logically and it could just be junk code you provided, but a function usually returns a value, whether it is typically a 0 for success, 1 or -1 for fail (or vice versa if you have changed the return values), or a value that was computed. That’s how a return is supposed to work…so if I was writing code like that, it would return a value and that value is what you would return. For instance:

    function foo() //Simplified code if (A == 1) if (B == 0) x = 2 returnVal = x else C = 3 returnVal = C end //end else //more code that doesn't execute if above condition is met return returnVal end //end a return returnVal

    In this way, you’re returning a value, that can be interpreted at the point after the function returns. The above actually kind of looks like how a function might be overloaded to return different values depending on the code. I feel it should return one value type, not different ways depending on different variable values.

    Doing either of these two ways, would be programmitically consistent and proper, and void the issue of your folding not working properly.

  • How to add attributes in link in Notepad++

    2
    0 Votes
    2 Posts
    298 Views
    Alan KilbornA

    @ProfessorJuju

    You look for a pattern in the data, then you craft a search that will match the pattern, allowing you to replace a part of it with your additional data.

  • Need to find lines that are missing a comma at the end.

    11
    0 Votes
    11 Posts
    2k Views
    Mark OlsonM

    @Monarchia
    Looks like you got this fixed, but just wanted to chime in that JsonTools can indeed find the errors in your JSON file (as PeterJones mentioned), but you can also just turn on linting and then you can parse the JSON with any number of missing commas (as well as various other syntax errors) and pretty-print it as syntactically valid JSON.

    If your JSON file had a truly preposterous number of such syntax errors (say on the order of hundreds of thousands), the linter would probably use a lot of memory though.

  • Long line, into multiple in numerical order

    5
    0 Votes
    5 Posts
    227 Views
    Luis LucenaL

    @Alan-Kilborn @David-Brigden52

    I got it. thanks for the help.

    I am new at this and learning.

  • maarkdown udl editing

    2
    0 Votes
    2 Posts
    154 Views
    PeterJonesP

    @eglacias,

    If by “bright pink”, you mean “purple” (RGB=0x8000FF), that setting is the color for the “delimiter 1”, which is where the styling for brackets is defined.

    df22c4ee-80d6-4a10-97f1-ac77f8d4975f-image.png

  • Can I capture my saved macros so that I can move them to a new machine?

    4
    0 Votes
    4 Posts
    190 Views
    Kathi WK

    @Alan-Kilborn Thank you!!! Have a great weekend

  • 0 Votes
    8 Posts
    2k Views
    Alan KilbornA

    @Neil-Schipper

    I will have to consider your proposed functionality more deeply before offering an opinion. And that probably means: Mocking it up with a script – and quite possibly, slightly modifying the script I presented earlier in this thread.

    LATER FOLLOWUP:

    I did some thinking on the idea. Maybe it is OK…probably not a “game changer” though…

    As to quickly scripting it for experimentation, I think it can be a one-liner:

    notepad.menuCommand(MENUCOMMAND.SEARCH_SETANDFINDNEXT if not editor.getSelectionEmpty() else MENUCOMMAND.SEARCH_FINDNEXT)

  • 0 Votes
    6 Posts
    221 Views
    papahOOchP

    @PeterJones I was gonna give you the debuginfo but now the problem seems to have disappeared! I did have a windows update waiting that I installed last night before I went to bed, so maybe that was what was causing the issue. Strange, but then again, computers are just rocks tricked into doing math

  • Help! All my tabs and backups files disappeared

    4
    0 Votes
    4 Posts
    315 Views
    Neil SchipperN

    @CasualT-PlayStation

    Yesnomaybe?

    e1c7b93f-9281-4a2c-8b35-1404fc5f227f-image.png

  • NP++ and Windows Registry (Fix for FilePath Filename with blank space)

    10
    0 Votes
    10 Posts
    1k Views
    Jim VenceJ

    @Michael-Vincent That worked for me. Thank you!

  • Change colour of highlight in picklist

    8
    0 Votes
    8 Posts
    416 Views
    Michael VincentM

    @dinkumoil said in Change colour of highlight in picklist:

    @Michael-Vincent
    Do you know the version of Scintilla (or rather the version of Notepad++) that introduced this feature?

    Looking at https://www.scintilla.org/ScintillaHistory.html, it seems version 5.0.1:

    Add SCI_SETELEMENTCOLOUR and related APIs to change colours of visible elements. Implement SC_ELEMENT_LIST* to change colours of autocompletion lists.

    which methinks corresponds to Notepad++ 8.4:

    https://notepad-plus-plus.org/downloads/v8.4/

    Update Scintilla from v4.4.6 to v5.2.1 and add Lexilla v5.1.5. (Fix #10504)

    Cheers.

  • User Defined language more folding in code styles

    3
    0 Votes
    3 Posts
    2k Views
    denwithamD

    @PeterJones Thank you, just what I was looking for.

  • User Defined Language Escape Character

    2
    0 Votes
    2 Posts
    364 Views
    Anthony ShortA

    @Anthony-Short
    I think I figured it out. I simply used double quotation marks and coded it as follows in the 1st group.

    "Let's make a game!"

    No need for “&apos;” or “\',” just “Let’s.”

    Hopefully this topic helps somebody else out!

  • Invisible characters unwanted

    28
    0 Votes
    28 Posts
    30k Views
    Alan KilbornA

    Someone else found the solution for me:

    set the control character’s representation to the “zero-width space” character (so it has no visual component – but it will have a small “inverse video” artifact on-screen) set the representation appearance to plain text (to avoid the inverse video)

    Although, to script this (as I tend to do) is difficult as the set-representation-appearance Scintilla command is not yet available as an editor command in the PythonScript versions that are current as of this writing.

  • Selection highlight has disappeared from npp

    2
    0 Votes
    2 Posts
    630 Views
    PeterJonesP

    @Michel-Martin-Neuville ,

    Works just fine for me.

    Select Some:
    422a87eb-ebb7-4ec9-869f-74ef30a035b2-image.png

    Select All:
    eaf69895-bc4c-4d3c-83a6-0161dfdc97f8-image.png

    What theme do you have selected in Settings > Style Configurator? If you go to the Settings > Style Configurator > Global Styles > Selected Text Color, what colors are shown? Do you have something like trying Settings > Style Configurator > Global Styles > Global Override having any checkboxes? (Read the user manual on “Global Override” if you do… and then unchceck all the boxes, because they probably aren’t what you actually want.)

  • Toolbar doesn't remain 'fluent'

    3
    0 Votes
    3 Posts
    202 Views
    Terry RT

    @traderttt9 said in Toolbar doesn’t remain ‘fluent’:

    Anyone?

    It almost sounds like you have 2 problems.

    When opening a file that has the association, instead of opening Notepad++ first and then the file, you get 2 different results with the toolbar. This sounds like the association is opening a different (installed) version of Notepad++ on the PC. The way to identify that is to run Notepad++ each way, then check the “Debug Info” under the ? menu. It will tell you where the program is located. Alternatively one of the methods may be running Notepad++ with some commandline parameters which may be wrong. Again, see the “command line arguments” under the ? menu.

    You refer to making a change, then checking during a later session and the changes have reverted, or at least don’t appear to have changed and stuck. This could be because you are running Notepad++ in “multi instance” mode (see settings, preferences, multi instance & date). If so, then the last instance which closes will set the settings for the next time you run Notepad++. So make the changes in that instance before closing. It may also occur if you do NOT have the ability to alter the XML file holding this configuration change. So you would need to check on the XML files, stored either in the %appdata%\Notepad++ folder, or where the Notepad++ executable file is located, depending on how you run Notepad++. Check the file permissions, that you can write to the files.

    Terry

    PS, just noted @PeterJones thinks exactly the same!