• add block comments in langs.xml?

    2
    0 Votes
    2 Posts
    2k Views
    PeterJonesP

    @mathlete2 ,

    It’s not working because commentEnd must be non-blank if you want commentStart to work. If I set it to <Language name="batch" ext="bat cmd nt" commentLine="REM" commentStart="::" commentEnd="::REM">, save, exit, reload, then load a file in Batch, the Ctrl+Shift+Q will block-mode, where it puts :: at the beginning of the current selection and ::REM at the end of the current selection; but if I set commentEnd="", it will instead just use the commentLine for the block-comment commands as well, ignoring both commentStart and commentEnd. I tried some experiments, and even if you did something as simple as commentEnd=" " (where it uses a single space in the attribute value), it will use :: for the beginning and a space for the end.

    But please note, if you do get it working that way: block comments are meant to allow for multi-line, and abusing cmd.exe’s label syntax (which is actually what :: is for) to be a pseudo-comment will not create a multi-line comment in cmd.exe syntax. It would just put :: at the beginning of the selection and whatever non-empty text you chose for the commentEnd at the end. Which means, if you have more than one line selected, only the first line would be commented out.

    If you want to use :: as your line comment, then you should just change commentLine="::", and then line-comment will always use that (and block comments will instead apply the line-comment individually to all selected lines). But you cannot set it up in a way soas to have two different single-line comment syntaxes, as that is not how the comment-feature was designed.

    (we literally just added the text These attributes can only define one type of line and block comments; if your language has multiple types of either, you will have to choose the _one_ type that you'd like Comment/Uncomment to work with. to the user manual: it hasn’t even had time to be released to the website yet. but it will be in the next revision of the website.)

  • Error starting Notepad in virtual WIN-XP ver 8.2.1

    3
    0 Votes
    3 Posts
    251 Views
    Lewis SchwartzL

    @peterjones THX :)

  • Identation

    3
    0 Votes
    3 Posts
    304 Views
    Catrin BrooksC

    @peterjones Thanks!

  • Opened files VS Open files

    11
    0 Votes
    11 Posts
    2k Views
    Catrin BrooksC

    Because they both indicate the same thing and are grammatically correct in this context, they are interchangeable. The phrase “opened files” has the past participle form of the verb “opened,” but the phrase “opened files” contains the adjective “opened.”

  • 1 Votes
    9 Posts
    604 Views
    V

    @alan-kilborn That worked. Thank you so much! image_2022-01-24_084149.png

  • Installer needs to honor existing installation settings

    3
    0 Votes
    3 Posts
    263 Views
  • Raro Número de líneas

    3
    0 Votes
    3 Posts
    1k Views
    Adolfo GimenezA

    @peterjones muchas gracias compañero, me sirvió bastante ya lo logré solucionar. Un abrazo. Mil gracias.

  • Context Menu's Style Token should be in File Edit menu too.

    2
    0 Votes
    2 Posts
    246 Views
    PeterJonesP

    @jabcreations

    It’s in the Search menu, not the Edit menu. (probably in that menu because searching and marking and bookmarking are all intertwined in Notepad++, whereas coloring text has nothing to do with editing, because it doesn’t make changes to the file when saved)

    633a8e25-19af-40cb-93e1-6e943e86e85f-image.png

  • Understanding about project files.

    7
    0 Votes
    7 Posts
    530 Views
    Carol LawrenceC

    Thanks! You help me a lot

  • New to notepad ++

    7
    0 Votes
    7 Posts
    1k Views
    Carol LawrenceC

    In the start menu, you can make a new shortcut to notepad++ that runs it with the command line arguments -multiInst -nosession. When you click on that shortcut, it will open a new multi-instance window without the current session, but it won’t change the open-with-notepad++ behavior.

    Non-multi-instance instances (like those opened with open-with) and those that open with a shortcut will confuse your settings, because depending on which one you exit last, it may save your settings in a state that doesn’t match what you want. This may or may not be what you want, though.

  • Toolbar, medium?

    3
    0 Votes
    3 Posts
    297 Views
    Carol LawrenceC

    @real-cat I’m inclined to agree with you. When writing code, developers have to weigh several trade-offs before settling on a final product. My guess is that this is one of them. I can handle it.

  • I have to type in UTF-8 code rather than words

    2
    0 Votes
    2 Posts
    681 Views
    PeterJonesP

    @hadock987 said in I have to type in UTF-8 code rather than words:

    I suspect that when typing in Chinese words in Notepad++, Notepad++ do not encode them in UTF-8 code.
    Is my guess true? How can I resolve it?

    I suspect you’re wrong. It’s really easy to check: the status bar on the bottom of Notepad++ will show whether or not it is editing in UTF-8 mode.

    [somesection] HoldToSpawn = 按住~y~Backspace~s~來讓~b~

    7062d455-995f-4a46-a6e6-510cf9577800-image.png

    D:\Users\Peter\Downloads\NppCommunity>xxd uni.ini 00000000: 5b73 6f6d 6573 6563 7469 6f6e 5d0d 0a48 [somesection]..H 00000010: 6f6c 6454 6f53 7061 776e 203d 20e6 8c89 oldToSpawn = ... 00000020: e4bd 8f7e 797e 4261 636b 7370 6163 657e ...~y~Backspace~ 00000030: 737e e4be 86e8 ae93 7e62 7e0d 0a s~......~b~..

    The e68c89 is the UTF-8 3-byte encoding for the one you have shown as &#x6309; in the later example, so Notepad++ is doing the right thing with Unicode characters properly entered when Notepad++ believes it is in UTF-8 mode.

    Though I just realized: do you think that typing &#x6309; in Notepad++ will save the unicode character 按 in the bytes of the ini file? If you think that, you are sorely mistaken. Notepad++ saves the characters you type. And unlike HTML/XML, Notepad++ doesn’t translate XML/HTML entities into their actual characters when you save or display the file. So if your ini is really

    [somesection] HoldToSpawn=&#x6309;&#x4F4F;~y~Backspace~s~&#x4F86;&#x8B93;~b~...

    Then you are getting exactly what you should: you typed a bunch of ascii characters, including ampersand, number sign, ex, six, three, zero, nine, semicolon, and that’s what your game is seeing.

    looking again at your post, where you compare the failing screenshot with extra box bytes in the top screenshot, compared to the one below which seems to be correct where you give it enties, maybe you really did type the Chinese characters in the first example. So I crossed out the entity paragraph.

    If your game isn’t really expecting the .ini file to be in UTF-8, or if it only believes it is UTF-8 if it has the BOM, you may need to change to Encoding > UTF-8-BOM instead of Encoding > UTF-8 to better convince your game to process the .ini file as UTF-8.

    So, to sum up: most likely, either you don’t actually have Notepad++ editing in UTF-8 mode (in which case, you just need to change the encoding in Notepad++), or your game doesn’t recognize an .ini file as UTF-8 without the BOM (in which case, you need to change to UTF-8-BOM in Notepad++ so it saves the BOM character), or your game doesn’t accept UTF-8 for the .ini, despite your assertion that it does.

  • Find in files resulted in a frozen Npp

    1
    1 Votes
    1 Posts
    223 Views
    No one has replied
  • Find / Replace swap in 8.2.1

    1
    6 Votes
    1 Posts
    884 Views
    No one has replied
  • How can i put notepad++ as default editor on Windows 2016 ?

    2
    0 Votes
    2 Posts
    815 Views
    PeterJonesP

    @eric-bret ,

    The same way you do with any other Windows application: There are a plethora of ways; you can search the internet for “associate txt with another application”, since we cannot be expected to be experts in all versions of Windows and Windows Server, and what config options you are comfortable with. As a hint, I usually use Right Click > Open With and check make-default, and/or directly edit the registry; GPO might do it, but I’m not a GPO expert.

    Also, if you run Notepad++ as administrator, the Settings > Preferences > File Association dialog will allow you to try to set associations.

    You can search this forum for “association” to find more discussion on file association, including some gotchas and difficulties with various methods.

  • Right-Mouse Click to Line/Sort

    3
    0 Votes
    3 Posts
    384 Views
    jose isaias cabreraJ

    @alan-kilborn Thank you, sire. This is what I was looking for. I appreciate your effort.

    josé

  • Enhance UDL lexer

    41
    4 Votes
    41 Posts
    12k Views
    EkopalypseE

    @c-siebester

    The only pitfall I see at the moment might be that your UDL name is not ml but something else.
    When you run the script, do you see any errors in the console?
    I assume you copied the whole script and not just the part you mentioned here, right?
    If you click on the script from the Python script menu while holding down the CTRL key, will the expected script open in Npp?

  • New instance of NPP starts with NppFTP window hidden

    1
    0 Votes
    1 Posts
    466 Views
    No one has replied
  • feature request: search with "accent match" (without Regular expression)

    8
    0 Votes
    8 Posts
    563 Views
    conky77C

    @alan-kilborn
    I inserted the Issue #11028

  • How can a user browser for the Run menu be configured?

    2
    0 Votes
    2 Posts
    506 Views
    PeterJonesP

    @michael-albry ,

    What ancient version of Notepad++ are you using? View > Current File in > Edge has existed for years now – it was added in v7.6.5 in September 2019. It was only versions before that in which you used the Run > Launch In XXX entries.

    And if you still need to add some other browser, then yes, you can add any external application you want, as long as you know the command line; it’s really easy: Run > Run…, type the path of the application to run (and maybe use the variables described in the Config Files > User Defined Commands section of the user manual, like using c:\path\to\otherbrowser.exe "$(FULL_CURRENT_PATH)" to run the currently-active file in otherbrowser – then Save that user-defined command.

    (Those Run > Launch In entries were removed a little earlier than the alternative was developed, in v7.6.3. This was part of the EU-FOSSA effort to avoid security compromise vectors from being distributed by default.)