• Is multi-caret editing bugged?

    25
    0 Votes
    25 Posts
    5k Views
    Alan KilbornA

    I just noticed an ISSUE that seemed very relevant to this thread.

  • 0 Votes
    7 Posts
    600 Views
    Robin CruiseR

    @guy038

    I try myself to find a generic, from your regex. Works well, except doesn’t work for " (double quotes) because is repeated in the tag construction. I change those extra quotes on the content of tags, with a work, like “BOOM” and it find/replace it well beetween start and ending tag.

    These are the generic regex for your second solution. Are almost the same, short and long version. Makes the same thing, find and replace just well between start and ending tags.

    (?<!=\x20)(?<!=)FR(?!>|ESR|\x20>|\x20/>|\?>|\x20\?>|BSR)

    OR

    (?<!=\x20)(?<!=)FR(?!>|ESR|\x20>|\x20/>|\?>|\x20\?>|\x20BSR)

    OR

    (?<!=\x20)(?<!=)FR(?!>|ESR|\x20\?>|\x20BSR)

  • Copy only the not hidden text.

    4
    0 Votes
    4 Posts
    2k Views
    guy038G

    Hello @kanagi, @alan-kilborn and All,

    In addition to the Alan’s python script, I advice you to read this post first

    Then, if not confidential, you could share with us some text with possible hidden parts and we’ll probably be able to find out some regexes to bookmark the non-hidden sections or the hiden ones !

    See you later,

    Best Regards

    guy038

  • Multi-Line Indent No Longer Working in v8.3.3

    2
    0 Votes
    2 Posts
    212 Views
    PeterJonesP

    @vincil-stockdale ,

    It works for me: select multiple lines, hit TAB to move them one tabstop right, and Shift+TAB to move them one tabstop left, which is exactly what I expect:

  • select products with a certain category (tag)

    4
    0 Votes
    4 Posts
    402 Views
    PeterJonesP

    @massimo-la-terra said in select products with a certain category (tag):

    thanks for the answer, sorry for my translated English, in practice with a click I would like to display only the products of the Subcategory> SALUMERIA </Subcategory>

    Notepad++ is an editor, not an XML Presentation filter, so it will never give you exactly that. Its job is to make it easy to edit the raw text as a whole, not easy to just see filter the sub-categories you want

    My first set of instructions will allow you to hide everything, and then you just do the search (as described above) to find the next occurrence of that; after you’ve cycled through enough “Find Next”, you will have shown all the product groups with the subcategory SALUMERIA. Problem solved.

    For example,

    start with <Product> <irrelvant>...</irrelvant> <Subcategory>SALUMERIA</Subcategory> <irrelvant>...</irrelvant> </Product> <Product> <irrelvant>...</irrelvant> <Subcategory>OTHER</Subcategory> <irrelvant>...</irrelvant> </Product> <Product> <irrelvant>...</irrelvant> <Subcategory>SALUMERIA</Subcategory> <irrelvant>...</irrelvant> </Product> <Product> <irrelvant>...</irrelvant> <Subcategory>OTHER</Subcategory> <irrelvant>...</irrelvant> </Product>

    So there are two products in the SALUMERIA subcategory, and two that aren’t.
    2. Hit Alt+0 to hide everything
    5e748307-197b-4df7-9b0c-02556eafd883-image.png
    3. FIND = <Subcategory>SALUMERIA</Subcategory>
    86d57c15-5f0a-42bc-b00b-2cc2dc9e50a1-image.png
    4. FIND NEXT will show the second one as well:
    31a7eb58-9bbd-403a-89b5-8be4b4b45ed4-image.png
    5. Repeat FIND NEXT until they have all been revealed.

    It’s not a single click, but it doesn’t take all that long.

  • How do I replace a text after an = ?

    2
    0 Votes
    2 Posts
    196 Views
    Alan KilbornA

    @ezz-zee said in How do I replace a text after an = ?:

    Find: local Cooldown = \d+
    Repl: local Cooldown = 0
    Search mode: Regular expression

  • Word-wrap crashes TextFx in npp 8.4 and newer

    2
    0 Votes
    2 Posts
    339 Views
    Alan KilbornA

    @mkupper said in Word-wrap crashes TextFx in npp 8.4 and newer:

    discovered that 8.4, 8.4.1, and 8.4.2 are all broken

    Nope, it is not Notepad++ that is broken. It’s the plugin.

  • Regular replace does not work with multiple single quotes

    2
    0 Votes
    2 Posts
    262 Views
    PeterJonesP

    @mscislawin said in Regular replace does not work with multiple single quotes:

    when i copy that and paste it to n++ and do the normal find plus normal replace and want to replace all ‘’ with ’ it only replaces first occurence of the ‘’

    Did you click Replace or did you click Replace All after setting up Find what: '' and Replace With: ' ?

    Because
    76b51f95-e538-48cd-9e09-46b913b4812e-image.png
    =>
    f7fde8af-b620-4656-b355-c851309e7048-image.png

    'insert into db.table(parent_id, active, code, name) values (1, true, ''code'',''name'');' 'insert into db.table(parent_id, active, code, name) values (1, true, ''code'',''name'');' 'insert into db.table(parent_id, active, code, name) values (1, true, ''code'',''name'');' 'insert into db.table(parent_id, active, code, name) values (1, true, ''code'',''name'');' 'insert into db.table(parent_id, active, code, name) values (1, true, ''code'',''name'');'

    =>

    'insert into db.table(parent_id, active, code, name) values (1, true, 'code','name');' 'insert into db.table(parent_id, active, code, name) values (1, true, 'code','name');' 'insert into db.table(parent_id, active, code, name) values (1, true, 'code','name');' 'insert into db.table(parent_id, active, code, name) values (1, true, 'code','name');' 'insert into db.table(parent_id, active, code, name) values (1, true, 'code','name');'

    It does exactly what I’d expect

  • Add line break in paste after multi-editing

    12
    0 Votes
    12 Posts
    3k Views
    PeterJonesP

    @alan-kilborn said in Add line break in paste after multi-editing:

    wait for someone else to try it, and weigh in on how it went for them

    I installed the script, selected old text and verified it was in the clipboard by pasting. Then I selected two or three disjoint sections in multi-select mode, ran the script, and then pasted, and it pasted each section of the new multi-section data with a newline between, so worked exactly as I believe it was described.

    @Spiros-Doikas , you should look at Plugins > Python Script > Show Console after running the script, and see if it is giving you an error message.

  • How to move from the Search/replace to the edit window.

    2
    0 Votes
    2 Posts
    207 Views
    Alan KilbornA

    @george-worley

    AFAIK the only way is to press Esc which closes the “Find” window.

  • How to schedule a python scripts in plugin manager?

    2
    0 Votes
    2 Posts
    258 Views
    EkopalypseE

    @hulu2007

    What does “repeated” mean in this case?
    Time-based, event-based, or other triggers?
    Because if you are the only one editing these files it
    might be better to run the script once and then use
    another script that ensures that files from that location
    use Ansi encoding.

  • #region support for languages

    4
    0 Votes
    4 Posts
    2k Views
    Noreh ADN

    That’s a bummer. And modifying the source code for something like this seems like a hassle for me. So I’ll probably ignore it :)

    In VS Code (might need extensions though), for example, regions that are in comments (// #region and // #endregion) are supported (in languages like JS, PHP). It’d be nice to have something similar in Notepad++ too.

    I usually use VS Code when I’m working on a project, but for quick modifications, I prefer Notepad++. So I definitely want to see Notepad++ improve.

  • Problems with bidirectional text & find/replace

    7
    0 Votes
    7 Posts
    2k Views
    House EmptierH

    @alan-kilborn That is correct. I can successfully use Notepad++ to do my find/replace task… IFF I watch every term get replaced. If I use Replace All, with a long “Replace with…” string that has complex/SE Asian script in it, then there seems to be some kind of greediness problem that leads to non-matching text being deleted.

    @peterjones Yes, thanks for posting that Python script, it was very useful, and I was able to use it to skip a whole bunch of manual copy/pasting. Anyhow, w/r/t the Unicode declaration in the header: I see it now, the problem was between my chair & my keyboard. I think I deliberately excluded your discussion that was surrounded by triple quotes, which I’m guessing is the Python code-comment convention? … Yep, it is! So when I copied your code, I purposefully skipped all of your discussion-in-comments, so I missed the header entirely, due to my Python ignorance.

  • Opening and interacting with .txt files

    2
    0 Votes
    2 Posts
    1k Views
    PeterJonesP

    @binary_kitten ,

    Are you saying, “I want to use Notepad++ to type the source code for my application”? If so, then do that. I am not sure what the question is in that case.

    Are you saying “I want to use my application that I am creating to remote control Notepad++ to automate using Notepad++'s search”? Then do that: Notepad++ accepts standard Windows messages, with a documented API (noting that the documentation assumes that you are writing a plugin that’s running inside Notepad++, but the API works equally well from the outside, as I have shown with my Perl module Win32::Mechanize::NotepadPlusPlus, which allows a Perl script to send messages to Notepad++ to remote control it.

    Are you saying “Can I use Notepad++ as a command line ‘filter’ program, where I go notepad++.exe --someFindOption="searchText" FILENAME.txt and it will output just the matching lines”? If that’s what you are asking, no, from two perspectives: 1) there isn’t yet a run-the-FIND-from-command-line option (perhaps “there isn’t that option yet”: I think it’s been requested, though I don’t remember whether that request is in process or whether it was rejected), and 2) notepad++ doesn’t have a way to dump the contents of a file to the STDOUT. Notepad++ is an interactive Windows GUI program, and is intended to be used as such.

  • multi search and replace in multi files with python

    3
    0 Votes
    3 Posts
    514 Views
    Pouemes44P

    thanks will try to find

  • Notepad++ v8.4.2 (64-bit) causing "his file cannot be saved..." errors

    4
    0 Votes
    4 Posts
    666 Views
    Alan KilbornA

    @r-d-vaughan

    If you don’t get any helpful replies in this thread after a period of time…you may want to “elevate” this by posting in the release thread for 8.4.2.

  • Regex - replace subexpression in a repeated subexpression

    5
    0 Votes
    5 Posts
    553 Views
    guy038G

    Hi, @mohammad-hussain, @neil-schipper and All,

    Your active shortcuts.xml file should be located, either :

    In the %appData%\Notepad++ folder, for a standard installation with the installer

    In the Notepad++.exe folder, for a local installation

    Then :

    Start Microsoft notepad.exe

    Open the right Shortcuts.xml file

    Insert, at the end of the <macros>...</macros> mode, the following macros Macro_A, Macro_B and Macro_C :

    <Macro name="Macro_A" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?-i)(?&lt;=\\)[^\\]+\.html?|(^P:\\|^\h*\R)" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam='(?1:&lt;file name=&quot;$0&quot; mark=&quot;marked&quot;/&gt;)' /> <Action type="3" message="1702" wParam="0" lParam="768" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> </Macro> <Macro name="Macro_B" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?-is)^(.+?)\\.+\R(?:(?:(?!&lt;/).)+\R)*\1\\.+\R|^(.+?)\\&lt;file name.+\R" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam='&lt;folder name=&quot;\1\2&quot;&gt;\r\n$0&lt;/folder&gt;\r\n' /> <Action type="3" message="1702" wParam="0" lParam="768" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?-s)^(?!&lt;).+?\\(.+)" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="\1" /> <Action type="3" message="1702" wParam="0" lParam="768" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> </Macro> <Macro name="Macro_C" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="^(?!&lt;).+" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1702" wParam="0" lParam="768" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1614" sParam="" /> </Macro>

    Save the modifications

    Now, stop and restart Notepad++

    Open your INPUT file

    First, run, once only, the Macro_A macro

    Then, run several times the Macro_B macro

    From time to time, run the Macro_C macro in order to verify if the process is terminated. Note that the Find dialog must be opened to get the results !

    Remark :

    You may assign a shortcut to each of these macros :

    Use the Macro > Modify Shortcut/Delete Macro option

    Double-click on each macro and enter your preferred shortcut

    Best Regards,

    guy038

  • Sorting text

    5
    0 Votes
    5 Posts
    1k Views
    Alan KilbornA

    @lakshman-ragde

    You said:

    the lyrics in my file are separated by 4 spaces between each lyrirc

    You also said:

    The next lyric starts after 4 blank lines, the next after another 4 lines and so on

    These are different things.
    I think I know what you mean, but again, why should we guess on this point.
    You would have cleared up the confusion on this if you would have followed the Template for Search/Replace Questions that you were linked to.

  • Notepad + ansible + win_chocolatey = head scratcher

    4
    0 Votes
    4 Posts
    2k Views
    PeterJonesP

    @benoit-valenti said in Notepad + ansible + win_chocolatey = head scratcher:

    installing Notepad++ in portable mode (using /D= )

    BTW: to clarify, /D on the installer does not make it use portable mode, it just installs to a different location. To be “portable” mode (and use the local folder rather than %AppData%\Notepad++), you must create the zero-byte doLocalConf.xml in the notepad++.exe directory.

  • Cloud Sync and Themes

    2
    0 Votes
    2 Posts
    410 Views
    PeterJonesP

    @zaf9670 ,

    It sounds to me like it’s trying to read the theme off of your cloud, but that it’s having intermittent trouble reading the file from the cloud directory. If you do not have reliable connection to your cloud directory, using cloud settings is not a good idea for Notepad++.

    I might suggest turning off the “cloud” setting in Notepad++, and instead manually copy the “golden” files from your cloud location into your %AppData%\Notepad++\ hierarchy, so that Notepad++ can read it from %AppData% whether or not you currently have access to your cloud location.