• 3 Votes
    3 Posts
    203 Views
    Bill MillerB

    @Coises said in Is there a way in version 8.5.8 to remove the line number column down the left side of the page? I find it to be very visually intrusive and unnecessary.:

    Coises
    @Bill Miller
    about an hour ago

    @Bill-Miller said in Is there a way in version 8.5.8 to remove the line number column down the left side of the page? I find it to be very visually intrusive and unnecessary.:

    Is there a way in version 8.5.8 to remove the line number column down the left side of the page? I find it to be very visually intrusive and unnecessary.

    Settings | Preferences… | Margins/Border/Edge | Line Number

    Uncheck Display.

    I’m glad Word Wrap worked. We’ll give you an upvote so you have reputation. I think there is work in progress to fix that limitation when it comes to replying — others who stumble on this can avoid it by removing the pre-filled quotation and just writing new reply text.

    You’re my hero Coises. Thank you for riding in to my rescue once more.

  • Setting Right Side Margin

    3
    1 Votes
    3 Posts
    738 Views
    Michael VincentM

    @Bill-Miller

    From the menu:

    View => Word wrap

    Otherwise, what you are asking is not really possible in a text editor. Try a word processor instead.

    Cheers.

  • -1 Votes
    4 Posts
    555 Views
    Alan KilbornA

    @guy038 said :

    SEARCH (?s-i)^\h*BEGIN_BOUNDARY((?!ABSENT_WORD).)+?END_BOUNDARY.*?$\R

    Maybe this is better without capturing into group1?, i.e. :

    SEARCH (?s-i)^\h*BEGIN_BOUNDARY(?:(?!ABSENT_WORD).)+?END_BOUNDARY.*?$\R

    Also, OP said nothing about what comes before the word that begins the block nor what comes after the word that ends the block (assumption is the begin-word and the end-word are different) so thus maybe this is an even better expression:

    SEARCH (?s-i)BEGIN_BOUNDARY(?:(?!ABSENT_WORD).)+?END_BOUNDARY

    It’s a pity the OP never returned to either provide more specifics (and sample data) or to say whether or not the originally proposed solution was successful.

  • Need help with regex for XML removal

    11
    0 Votes
    11 Posts
    1k Views
    Alan KilbornA

    @guy038 :

    Interesting. I hadn’t thought of it as any sort of “general” solution to a problem!

    [ But, really, there already was the makings of a general solution to half of the problem, from you (ref. HERE) ]

    A couple of notes:

    Note 1:

    IF RR = ?1$0:, the complete BSR…ESR sections, WITHOUT the FR string, are deleted

    In this variant of the replace expression, the : isn’t necessary, thus:

    IF RR = ?1$0, the complete…

    Note 2:

    Since the overall regex uses group1, it isn’t available in the BSR, ESR, FR and even the RR subexpressions.

    Thus a user of this would have to keep in mind that if he is using further grouping inside these expressions, that he has to think in terms of group2 and above.

    This is definitely unlike another templated regex solution I use a lot, ref. HERE, where the user does not have to keep this in mind.

  • Regex to Find Consecutive Uppercase Letters

    5
    0 Votes
    5 Posts
    606 Views
    Alan KilbornA

    @Dick-Adams-0 said in Regex to Find Consecutive Uppercase Letters:

    I didn’t realize the case sensitivity flags had that effect

    A number of people have argued that for regex the Match case checkbox shouldn’t apply, and, unless the (?i) flag is used in the regex, that all regexes should be case sensitive.

  • 1 Votes
    4 Posts
    564 Views
    xomxX

    @PeterJones said in Working with sessions doesn't work very well here... and also erase the session file:

    *6-There is a serious problem when I first open a session because NP++ simply deletes the content of one of the sessions, from the “.nps” file.i.e. one of the nps files runs out of content and I have to recreate it from scratch.

    Do you have an exact sequence of events that replicates this?

    I think (did not check that myself yet) that this is what these patches are intended for:
    Do not modify user created session even for inaccessible files
    Fix user created session saved on exit issue if multi-Inst is enabled
    Fix user created session modified in multiInst mode

    These patches will be in the upcoming N++ version (probably v8.5.9).

    And there will be the new read-only placeholders feature (for the momentarily inaccessible session files) as well.

  • How do I turn on the colors to improve readability.

    4
    0 Votes
    4 Posts
    1k Views
    rdipardoR

    @Peter-Smids said in How do I turn on the colors to improve readability.:

    That’s right, it’s YAML, but how do I get these colors on?

    A limited number of Notepad++ themes define styles for YAML. You can try one of these, although none of them resemble your screen capture (of Sublime Text…?):

    DansLeRuSH-Dark DarkModeDefault Deep Black Hello Kitty HotFudgeSundae Khaki MossyLawn Navajo Obsidian Solarized-light Solarized Vim Dark Blue Zenburn

    Assuming you prefer a dark theme, you can customize one from the list (e.g., “Deep Black”) using the Style Configurator:

    yaml-deep-black-styled.png

    Another option is to add the YAML file type to a theme that doesn’t have it yet. First, do some minor customization of the target theme so it gets copied into %AppData%\Notepad++\themes (if N++ is installed for all users; otherwise just look in the themes directory wherever your portable N++ is). Open the theme’s XML file and paste these definitions anywhere under the /NotepadPlus/LexerStyles path:

    <LexerType name="yaml" desc="YAML" ext=""> <WordsStyle name="DEFAULT" styleID="0" fgColor="ADDB67" bgColor="262626" colorStyle="1" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="COMMENT" styleID="1" fgColor="A0A0A0" bgColor="262626" colorStyle="1" fontName="" fontStyle="2" fontSize="" /> <WordsStyle name="IDENTIFIER" styleID="2" fgColor="82AAFF" bgColor="262626" colorStyle="1" fontName="" fontStyle="1" fontSize="" /> <WordsStyle name="INSTRUCTION WORD" styleID="3" fgColor="F08080" bgColor="262626" colorStyle="1" fontName="" fontStyle="1" fontSize="" keywordClass="instre1" /> <WordsStyle name="NUMBER" styleID="4" fgColor="FFC600" bgColor="262626" colorStyle="1" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="REFERENCE" styleID="5" fgColor="C0FFFF" bgColor="262626" colorStyle="1" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="DOCUMENT" styleID="6" fgColor="E385FF" bgColor="262626" colorStyle="1" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="TEXT" styleID="7" fgColor="93CDBA" bgColor="262626" colorStyle="1" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="ERROR" styleID="8" fgColor="CD6000" bgColor="FFCE76" colorStyle="1" fontName="" fontStyle="1" fontSize="" /> </LexerType>

    After saving the file and restarting N++, you can customize the newly YAML-aware theme in the Style Configurator.

  • Trying to get ruby's functionlist to work with .cr files

    3
    0 Votes
    3 Posts
    235 Views
    Girng RodriguezG

    Roger. Thanks so much PeterJones, have a great rest of your week!!

  • Multi selection and multi edit

    64
    2 Votes
    64 Posts
    211k Views
    donhoD

    FYI: This feature is implemented in Notepad++ core and it’ll be available in the next release.
    You may want to check the PR to see if it meets your need:
    https://github.com/notepad-plus-plus/notepad-plus-plus/pull/14313

  • HTML pages view

    10
    0 Votes
    10 Posts
    2k Views
    mkupperM

    @PeterJones and others

    I am running 8.5.8 but apparently the Run / Launch in Firefox Ctrl+Alt+Shift+X that’s available to me is a legacy thing from a previous version of npp. I usually double check a portable 8.5.8’s behavior before commenting but forgot to do that earlier in the thread. My portable 8.5.5 does not have Run / Launch in Firefox

    That made me curious… It turns out the culprit, if you want to call it that, is an entry in my shortcuts.xml file:

    <UserDefinedCommands> <Command name="Launch in Firefox" Ctrl="yes" Alt="yes" Shift="yes" Key="88">firefox &quot;$(FULL_CURRENT_PATH)&quot;</Command> </UserDefinedCommands>

    I dug further and found that up until npp v7.6.2 that the shortcuts.xml file included:

    <UserDefinedCommands> <Command name="Launch in Firefox" Ctrl="yes" Alt="yes" Shift="yes" Key="88">firefox &quot;$(FULL_CURRENT_PATH)&quot;</Command> <Command name="Launch in IE" Ctrl="yes" Alt="yes" Shift="yes" Key="73">iexplore &quot;$(FULL_CURRENT_PATH)&quot;</Command> <Command name="Launch in Chrome" Ctrl="yes" Alt="yes" Shift="yes" Key="82">chrome &quot;$(FULL_CURRENT_PATH)&quot;</Command> <Command name="Launch in Safari" Ctrl="yes" Alt="yes" Shift="yes" Key="65">safari &quot;$(FULL_CURRENT_PATH)&quot;</Command> <Command name="Get PHP help" Ctrl="no" Alt="yes" Shift="no" Key="112">http://www.php.net/$(CURRENT_WORD)</Command> <Command name="Wikipedia Search" Ctrl="no" Alt="yes" Shift="no" Key="114">https://en.wikipedia.org/wiki/Special:Search?search=$(CURRENT_WORD)</Command> <Command name="Open file in another instance" Ctrl="no" Alt="yes" Shift="no" Key="117">$(NPP_FULL_FILE_PATH) $(CURRENT_WORD) -nosession -multiInst</Command> <Command name="Send via Outlook" Ctrl="yes" Alt="yes" Shift="yes" Key="79">outlook /a &quot;$(FULL_CURRENT_PATH)&quot;</Command> </UserDefinedCommands>

    From npp v7.6.3 to v7.9.5 much of that was commented out:

    <UserDefinedCommands> <!-- The following shortcuts are dangerous if your computer is compromised. (But if your computer is compromised, EVERYTHING IS DANGEROUS!) Remove the comment and use them at your own risk!!! <Command name="Launch in Firefox" Ctrl="yes" Alt="yes" Shift="yes" Key="88">firefox &quot;$(FULL_CURRENT_PATH)&quot;</Command> <Command name="Launch in IE" Ctrl="yes" Alt="yes" Shift="yes" Key="73">iexplore &quot;$(FULL_CURRENT_PATH)&quot;</Command> <Command name="Launch in Chrome" Ctrl="yes" Alt="yes" Shift="yes" Key="82">chrome &quot;$(FULL_CURRENT_PATH)&quot;</Command> <Command name="Launch in Safari" Ctrl="yes" Alt="yes" Shift="yes" Key="65">safari &quot;$(FULL_CURRENT_PATH)&quot;</Command> <Command name="Send via Outlook" Ctrl="yes" Alt="yes" Shift="yes" Key="79">outlook /a &quot;$(FULL_CURRENT_PATH)&quot;</Command> --> <Command name="Get PHP help" Ctrl="no" Alt="yes" Shift="no" Key="112">http://www.php.net/$(CURRENT_WORD)</Command> <Command name="Wikipedia Search" Ctrl="no" Alt="yes" Shift="no" Key="114">https://en.wikipedia.org/wiki/Special:Search?search=$(CURRENT_WORD)</Command> <Command name="Open file in another instance" Ctrl="no" Alt="yes" Shift="no" Key="117">$(NPP_FULL_FILE_PATH) $(CURRENT_WORD) -nosession -multiInst</Command> </UserDefinedCommands>

    Starting with v8.0 the commented out section was removed.

  • Regex help using find for the first 15 characters only.

    2
    0 Votes
    2 Posts
    639 Views
    PeterJonesP

    @Caner-Ak ,

    Yes, using single character matches, quantifiers/multiplying operators and anchors: For example, ^.{14}U will only match “start-of-line, then 14 of any character, then a U”.

    Note: When using . to match any character, make sure you have the correct state of . Matches Newline or use the equivalent search modifier (?-s)/(?s) in the regex.

    ----

    Useful References Please Read Before Posting Template for Search/Replace Questions Formatting Forum Posts Notepad++ Online User Manual: Searching/Regex FAQ: Where to find other regular expressions (regex) documentation
  • PythonScript: Script not working

    3
    0 Votes
    3 Posts
    379 Views
    PeterJonesP

    @Fuel-DZN said in PythonScript: Script not working:

    How is it matching the contents of the file if it just closed it?

    Either a bug in your logic, or a race condition. If it’s a bug in your logic, it’s not really on-topic for a Notepad++

    But if it’s a race condition, it’s got to do with the way that Plugins ask Notepad++ to perform actions: In case you didn’t know, Notepad++ actions take time (dozens or hundreds of milliseconds are not uncommon action times), and the Plugin Communication messages that the notepad and editor objects wrap around often don’t wait until the action is complete before returning control to the plugin (which in this case is the PythonScript plugin, which then continues executing your script).

    So your script tells Notepad++ to close the file, the application says “okay, I will”, and then proceeds to take a significant fraction of a second to close the file. In the meantime, your script gets the “okay, I will” message and then says “good, I’ll continue running the next commands”.

    If you were going to continue to do something more after the file were closed, I would say that you should probably put in a 500ms - 1000ms wait after doing the close, just to make sure that Notepad++ has time to finish it.

    If you are not planning on doing anything after, then I would suggest adding in logic to exit the script (warning: exit() doesn’t do what you think it does in PythonScript [when it kills the Python interpreter, it also closes Notepad++], so you’ll want flags and if-statements to just quickly exit out of your script, or throw an exception, which PythonScript handles more gracefully (without exiting Notepad++).

    How can it have a match and also no match?

    Either because of the race condition (above) or because of another logic bug. If it’s the race condition, then it’s explained above. If it’s a logic bug on your part, that’s just part of programming, and not specific to Notepad++ or the PythonScript interface with Notepad++, so is not on topic here.

  • 0 Votes
    3 Posts
    233 Views
    Fuel DZNF

    @Alan-Kilborn Thanks, that worked. I had tried that but forgot to put it after the notepad.activateBufferID line.

  • Break Text ever x Characters (keeping sentence / paragraphs)

    3
    0 Votes
    3 Posts
    378 Views
    Andrew CaseyA

    @Coises Wow that is amazing - will save so much time thanks

  • 0 Votes
    7 Posts
    2k Views
    Alan KilbornA

    I wonder what the rationale was for allowing multiple shortcuts for the same Scintilla command, but only one shortcut for non-Scintilla commands?

    Perhaps because “Copy” (and related) command is (or used to be) very common in apps as Ctrl+Insert as well as Ctrl+c?

    I wonder how hard it would be to allow ALL commands to have multiple shortcuts. (The current workaround is to define a macro for a single command, and then assign the macro a keycombo).

  • Saving Session does not include bookmarked lines in XML file

    5
    0 Votes
    5 Posts
    290 Views
    Peter RudloffP

    THANK YOU! Version 1.5 solved all problems! Blue bullets and Mark tags are back.

  • Formatting js file

    3
    0 Votes
    3 Posts
    4k Views
    James JordanJ

    Thank you Peter. I appreciate the quick reply.

  • Dspell Check offline language installation

    2
    0 Votes
    2 Posts
    335 Views
    PeterJonesP

    @Ofer-Ton ,

    Are you using the Hunspell library in DSpellCheck Plugin? If so, the plugin downloads the dictionaries from https://github.com/LibreOffice/dictionaries , then places the .dic and .aff files into %AppData%\Notepad++\Plugins\config\Hunspell\ (or whatever directory is shown in the Plugins > DSpellCheck > Settings… > Hunspell Dictionaries Path setting)…

    So if you have grabbed an offline copy of the right dictionary files, you should be able to put them in that directory and restart Notepad++, and the DSpellCheck/Hunspell should show them as available in the plugin’s Language: pulldown.

    (Sorry, I don’t know the ASpell side of things, so I cannot give the equivalent instructions if you’re using that library instead)

  • How can I style just the number prefix?

    3
    0 Votes
    3 Posts
    495 Views
    Peter LindP

    @ PeterJones Thank you!

  • Why is this an invalid expression only in some files?

    Locked
    8
    0 Votes
    8 Posts
    1k Views
    Terry RT

    Please note that the poster’s account that started this conversation was removed. This was due to issues for new posters trying to reply to other posts, the forum’s moderators are working on a fix. Then the poster created a new (similar) account and posted another thread, with almost the same question.

    That thread is located here.

    Terry