• "Keep this file in editor?"

    7
    0 Votes
    7 Posts
    7k Views
    PeterJonesP

    I know I am resurrecting an ancient topic, but since a 2021 topic referred back to this thread, I thought I would correct a misunderstanding from this thread, which hadn’t been addressed.

    I checked Notepad++ v6.6.6 from June 2014 (two years before this thread), Notepad++ v7.0 (from Sep 2016, a few months after this thread), and the most-recent Notepad++ v7.9.5 from March 2021, and all three have this feature: specifically, there is a way to turn off that dialog.

    Settings > Preferences > MISC > File Status Auto-Detection, and select Disable in the drop down (or uncheck Enable’s checkbox in v6.6.6). Once that’s disabled, Notepad++ will no longer poll the filesystem, looking for either file deletions or for updates to the file, and you won’t be prompted again. With the Auto-Detection disabled, I do not see the “This file has been modified by another program” dialog, and disabling that option also eliminated the “This file … doesn’t exist anymore”, which this topic was complaining about.

  • Style for Saved Search files?

    7
    1 Votes
    7 Posts
    412 Views
    EkopalypseE

    @Michael-Vincent

    I haven’t checked the source code, but I assume that no styles are set, probably because npp doesn’t expect the lexer to be assigned in the default views.

  • use regex to find based on 2 characters but only replace one

    3
    0 Votes
    3 Posts
    345 Views
    aworkerbA

    lookbehind and lookahead assertions … aren’t part of the “real” match

    That’s the concept I wasn’t able to name.

    Not sure why you made the comma a single thing inside the [ and ] …

    Because I barely know what I’m doing and was piecing it together from possibly applicable Stack Exchange posts.

    Anyway, thanks, you nailed it!

  • 0 Votes
    14 Posts
    17k Views
    guy038G

    Hello, @haleba-hotmail and All

    I cannot reproduce your N++ behaviour. You must run an old N++ release !

    With the v7.9.2 release ( note that the latest is v7.9.5 ) if I fold and bookmark, in any N++ XML configuration file, the <NotepadPlus> tag, then, after using the Search > Bookmark > Copy Bookmarked Lines option and pasting the clipboard contents in a new tab, I only get one line : the <NotepadPlus> line !

    Best Regards,

    guy038

  • 0 Votes
    13 Posts
    735 Views
    guy038G

    Hi, @alan-kilborn and All,

    I really should have thought a bit more, before answering ! Indeed, Alan, although the bookmarks are kept in the session.xml configuration file, there are not stored in files themselves. So, as soon as a file containing bookmarks is closed, these bookmarks are gone away the next time the file is opened, during a new N++ session !

    Sorry for all that noise !

    Cheers,

    guy038

  • Ubuntu ctrl+tab behaviour

    3
    0 Votes
    3 Posts
    404 Views
    Bill NealB

    @PeterJones Thank you Peter. You’re right, I’m running it using WINE. I also use N++ on Windows. I’ve never seen the behaviour I described above on Windows. Apart from this issue, it’s working really well on Ubuntu, and I’m very grateful that it does : )

  • Need to find string if don't have any tags

    4
    0 Votes
    4 Posts
    494 Views
    guy038G

    Hi, @ganesan-govindarajan and All,

    Ah…OK. So, whatever the contents of tags, isn’t it ?

    Then the following generic regex should work nice !

    SEARCH (?-i)<(\w+)>(?2)</\1>(*SKIP)(*F)|(\QWhatever you want\E)

    Note that the part between the \Q ( for Quote ) and \E ( for End ) is just considered as a literal range of characters !

    So, in case of a very simple text to search as, for instance, My text the \Q and \E syntaxes are not necessary and you may use this practical regex :

    SEARCH (?-i)<(\w+)>(?2)</\1>(*SKIP)(*F)|(My text)

    When tested against the text, below :

    01 <para>My text</para> 02 <blockquote>My text <!-- MISSING tag --> 03 <abc>My text</xyz> <!-- NON-regular syntax --> 04 My text <!-- MISSING tags --> 05 <ganesan>My text</ganesan> 06 <123>My text<456> <!-- NON-regular syntax --> 07 My text</blockquote> <!-- MISSING tags --> 08 <h1>My text</h1> 09 (toto)My text(/toto) <!-- NON-regular syntax --> 10 (Test)My text[/test] <!-- NON-regular syntax -->

    it would match the string My text, only in case of non-regular syntax or missing tag. So, in lines 02, 03, 04, 06, 07, 09 and 10 !

    Similarly, if you’re looking for wrong syntaxes of the This is a Notepad++ regex. sentence, it’s better to use the syntax, below, as the text, to search for, contains the + and the . signs, which are regex symbols with a special meaning :

    SEARCH (?-i)<(\w+)>(?2)</\1>(*SKIP)(*F)|(\QThis is a Notepad++ regex.\E)

    Test it against this similar sample :

    01 <para>This is a Notepad++ regex.</para> 02 <blockquote>This is a Notepad++ regex. <!-- MISSING tag --> 03 <abc>This is a Notepad++ regex.</xyz> <!-- NON-regular syntax --> 04 This is a Notepad++ regex. <!-- MISSING tags --> 05 <ganesan>This is a Notepad++ regex.</ganesan> 06 <123>This is a Notepad++ regex.<456> <!-- NON-regular syntax --> 07 This is a Notepad++ regex.</blockquote> <!-- MISSING tags --> 08 <h1>This is a Notepad++ regex.</h1> 09 (toto)This is a Notepad++ regex.(/toto) <!-- NON-regular syntax --> 10 (Test)This is a Notepad++ regex.[/test] <!-- NON-regular syntax -->

    Best Regards,

    guy038

  • 0 Votes
    12 Posts
    622 Views
    Robin CruiseR

    super answer, thank you sir @guy038

  • The Font Changes Suddenly

    3
    0 Votes
    3 Posts
    515 Views
    Olan KnightO

    @Ekopalypse
    Yes, I am editing SQL. Thank you for your suggestion, I will try it!

  • nosession behavior

    3
    0 Votes
    3 Posts
    362 Views
    PeterJonesP

    @PeterJones said in nosession behavior:

    Your description sounds a lot like [issue #9487[(https://github.com/notepad-plus-plus/notepad-plus-plus/issues/9487),

    I have added my observations and Debug Info to that issue.

    If your Debug Info is different, it would be good to add yours as well.

  • Change number size

    2
    0 Votes
    2 Posts
    1k Views
    PeterJonesP

    @Hüseyin-Bıçkın ,

    If you just want to truncate, and it’s always starting with 3-or-more digits after the decimal point, then it’s relatively easy:

    To make sure you’re counting from the decimal point, we’re going to use \. to get the literal decimal point (because regex uses . to match any character.

    The next important item is the “capture group” using parentheses (...), so that whatever is inside gets saved into memory. In the replacement, use ${1} to use the value from the first capture group, ${2} for the second, and so on…

    The third important item is using * to indicate “0 or more of the previous token”.

    These three concepts are sufficient for your task:

    Find = (\.[0-9][0-9][0-9])[0-9]*(in) this finds a literal . followed by 3 digits, then 0 or more digits then the literal in, storing the decimal and three digits into group#1 and the in into group 2 (not necessary, but good practice). Replace = ${1}${2} the first group contained the decimal and 3 digits; the second group contained the in, so this means the decimal, three digits, and in.

    However, using the “quantity modifier” aka “multiplying operator”" {ℕ} allows you to have ℕ matches of whatever token or subset comes before, which simplifies your FIND expression to

    Find = (\.[0-9]{3})[0-9]*(in)

    To simplify again, there is a character escape sequence \d which is basically equivalent to [0-9] for your purposes.

    Find = (\.\d{3})\d*(in)

    If you want to do true rounding (if the 4th digit is 5 or higher, add 1, else just truncate), there is no universal regex that will do it; depending on your number of digits, you can craft a regex that will do it, but there is so much to keep track of that you don’t want to do it in regex. If you need rounding, it’s much better to do it in a scripting language like PythonScript: see “Batch Decimal Rounding” discussion and a oneliner PythonScript in the “Rounding numbers pythonscript …” discussion for some solutions.

    ----

    Do you want regex search/replace help? Then please be patient and polite, show some effort, and be willing to learn; answer questions and requests for clarification that are made of you. All example text should be marked as literal text using the </> toolbar button or manual Markdown syntax. To make regex in red (and so they keep their special characters like *), use backticks, like `^.*?blah.*?\z`. Screenshots can be pasted from the clipboard to your post using Ctrl+V to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data. Show the data you have and the text you want to get from that data; include examples of things that should match and be transformed, and things that don’t match and should be left alone; show edge cases and make sure you examples are as varied as your real data. Show the regex you already tried, and why you thought it should work; tell us what’s wrong with what you do get. Read the official NPP Searching / Regex docs and the forum’s Regular Expression FAQ. If you follow these guidelines, you’re much more likely to get helpful replies that solve your problem in the shortest number of tries.

  • Combine 2 texts line by line

    17
    0 Votes
    17 Posts
    23k Views
    Muppi KarthickM

    @guy038 said in Combine 2 texts line by line:

    (?s)

    thanks for such a valuable post. its working for me. how to merge 3 files.

  • Exact search instead of «fuzzy search»

    2
    0 Votes
    2 Posts
    356 Views
    dinkumoilD

    @Christof-Rimle

    This is a frequently upcoming issue, for example see >> my comment in another thread <<.

    You should not expect that this behaviour will change in the future as it derives from Scintilla, the underlying edit component Notepad++ uses, which in turn applies an algorithm called Case Folding that is part of the Unicode standard when it performs a case insensitive search operation.

    The only way to get “exact” search results like you want them is to use case sensitive search (check option “Groß-/Kleinschreibung beachten”) because this prevents Scintilla from applying Case Folding.

  • Regex - fiename as parameter in search replace

    3
    0 Votes
    3 Posts
    188 Views
    Terry RT

    @RaniRani said in Regex - fiename as parameter in search replace:

    How do I do fetch the filename using regex across all site?

    I’m not sure I fully understand what you want to do however I provided a solution in this post which dealt with getting the filename of each opened file in Notepad++, saving it within the file and closing the file.

    Then a regex was used to update each file by copying that filename to selected (actually all) lines within the file. As @Alan-Kilborn stated the filename isn’t available to regex as a variable you can call on, but my first step was just a macro recording the use of menu options which then allowed a regex to complete the process.

    So take a look and see if maybe it might help. Reply back to this post if you think this can help you and you need a bit of extra help.

    I’m not on a PC currently otherwise I might have provided some more details.

    Terry

  • Regex: Find and Delete duplicate apostrophe on a html tag

    10
    0 Votes
    10 Posts
    694 Views
    Robin CruiseR

    super answer, @guy038 Thanks

  • Associate Notepad++ with .txt .log etc

    5
    1 Votes
    5 Posts
    3k Views
    Mick DawdyM

    I missed one of the options. I should have waited a day, settled down, and went at it again. Anyway, all’s good now. Thank you for the patient help :)

  • Reorder XML with Python script

    2
    0 Votes
    2 Posts
    220 Views
    EkopalypseE

    @Mark-McCall

    may I ask you what exactly you are trying to solve?
    Is it about being sure to always have a standardized xml file?
    If so, have you considered using xslt instead?
    Or do you need a generic way to reorder the tags based on your current requirements?

  • Highlighting characters based on character count

    2
    1 Votes
    2 Posts
    458 Views
    Alan KilbornA

    @Ken-aRf

    While it doesn’t highlight the character itself, I would suggest using the vertical edge feature:

    5772c6e2-7374-4588-a0bb-30035efab919-image.png

    This forms a nice “bracketing” of the columns you are interested in.

  • Plugins and Plugins Admin panel gone after update to 7.9.5

    2
    0 Votes
    2 Posts
    5k Views
    PeterJonesP

    @Ignus666 ,

    As always, showing your ?-menu Debug Info will help.

    I am assuming you used the “installer” rather than the “portable”. If this is wrong, this advice won’t work exactly as written.

    The Plugins Admin tool does ship with Notepad++ v7.9.5, so something went wrong with your installation.

    I don’t know why it wouldn’t have been installed properly, but the only way I could reproduce your problem was to get rid of the <installdir>\Plugins\Config\nppPluginList.dll (or more drastically, remove its whole containing folder – probably c:\Program Files\Notepad++\Plugins\Config\nppPluginList.dll, but it depends on 32/64-bit and whether you changed the default location.)

    If you use the normal installer, I think the easiest way to get it back would be to re-install. Make sure you get the installer from the official https://notepad-plus-plus.org/downloads/v7.9.5/ location – do not trust whatever downloader you currently have, because it messed up.

    If reinstalling from the official installer doesn’t work, the ?-menu Debug Info will give you the path for the Notepad++ executable. Go into its folder. Make sure plugins exists; make sure plugins\Config exists. If so, then download the appropriate portable version (either 32bit or 64bit, to match your normal installer bit-value), and unzip the nppPluginList.dll into the location mentioned earlier.

  • Left Gutter / Space at the begginning of a line / SCI code 2155

    7
    0 Votes
    7 Posts
    575 Views
    Adam WestA

    @PeterJones
    @Alan-Kilborn
    @dinkumoil

    Thank you all for the very detailed information and explanation of why it doesn’t work anymore. I wasn’t expecting so much.
    np++ is the best editor I’ve used in my 20 years as a PeopleSoft developer. I look forward to the left-padding setting, but will give startup.py a shot for now.
    -Adam