• Partially Synchronized Scrolling

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Claudia FrankC

    @Michael-Hardesty

    assign a shortcut to vertical and/or horizontal scrolling and you can toggle it.
    Settings->Shortcut mapper->Main Menu->Synchronize Vertical Scrolling (Line194)

    Cheers
    Claudia

  • How to HTML beautify ?

    Locked
    7
    0 Votes
    7 Posts
    63k Views
    Claudia FrankC

    @Florent-Pagès

    just by accident I found out that there is a plugin called tidy2.

    Maybe that’s helpful to you.

    Cheers
    Claudia

  • How to restore grouping in the 'Language' drop down?

    Locked
    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Lorem ipsum plugin not working

    4
    0 Votes
    4 Posts
    9k Views
    srmahmud2S

    But emmet is extremely slow, how did you make it fast @Dawid-Niepsuj ?

  • Why application that i compiled cant't work correctly?

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    Claudia FrankC

    @Codingandlearning

    check if notepad++.exe and scilexer.dll are in the same folder.

    Cheers
    Claudia

  • 0 Votes
    11 Posts
    8k Views
    guy038G

    Hello, Claudia, Justin and Scott,

    Justin, in addition to the Python script and the native N++ column editor feature, here is a regex S/R equivalent :-))

    So, let’s suppose that we start with the original text, below :

    BEGINNING This is a test A line with 25 characters an another try + a COMPLETE line of 34 characters_1 END

    Open the Replace dialog

    In the Find what : field, type :

    (?-s)^(?!.{34}( |1))(.+)|^.{34}\K +

    In the Replace with : field, type :

    ?2\2 1 , with 34 SPACES, between \2 and the digit 1, that should be ADDED

    Select the Regular expression search mode

    Click, TWICE, on the Replace All button ( IMPORTANT )

    You should obtain the modified text, below :

    BEGINNING 1 This is a test 1 A line with 25 characters 1 an another try 1 + 1 a COMPLETE line of 34 characters_11 END 1

    NOTES :

    The (?-s) syntax ensures that the dot ( . ) will stand for standard characters, only !

    The ^ is the assertion beginning of line, which must be verified

    The negative look-ahead ( (?!.{34}( |1)) ) verifies if the condition NO space NOR the 1 digit, at position 35, is true. This case occurs, ONLY, on the original text, before any S/R

    So, the regex catches, first, all the standard characters ( .+ ), of any non-empty line, stored in group 2

    In replacement, as group 2 exists, it rewrites the current line, then adds a minimum of 34 spaces and the final digit 1

    When you click a second time, on the Replace all button, the left part of the alternative cannot be achieved, as the look-ahead condition is, this time, false

    So, the regex engine tries to match the right part of the alternative ( ^.{34}\K + )

    The first part ( ^.{34} ) select the first 34 characters of each line

    Due to \K syntax, this range is forgotten and the regex engine, now, matches any consecutive non-null range of space characters ( + ), from the 35th position, included

    In replacement, as the group 2 is not used any more and that the conditional replacement, ?2... , do not have an ELSE part, these space characters are simply deleted !

    REMARKS :

    The nice thing is that you may add, as many spaces, as you want, after the 34 first spaces, in the replacement field !

    And, any additional click, after the second one, on the Replace all button, does not match anything else :-))

    Cheers,

    guy038

  • Select bookmarked lines

    26
    1 Votes
    26 Posts
    21k Views
    guy038G

    Hi, abuali huma,

    Not very difficult to achieve !

    EXAMPLE 1 :

    SEARCH ^(.+)\|(.+)

    REPLACE \2|\1

    Notes :

    This first regex separates the two parts of text, before and after the symbol | , which must be escaped ( \| ) as this symbol, in search regexes, stands for the normal alternation symbol !

    The part, before the symbol, is stored as group 1 and the part, located after, is stored as group 2

    In replacement, we just reverse the order of these two groups

    EXAMPLE 2

    SEARCH ^(.+?)\|(.+)\|(.+)

    REPLACE \3|\2|\1

    Notes :

    This second regex separates the three parts of text, created by the symbol |, which are stored as group 1, group 2 and group 3

    The first part ^(.+?)\|, tries to match, from beginning of line ( ^) , the shortest non-null range of characters, till the FIRST separation symbol ( \| ), because of the lazy quantifier ( +?)

    Note that if we would have written this first part ^(.+)\|, it would have matched the string this is text number three|this is text number two. Indeed, due to the greedy quantifier ( + ), it would have matched the tallest non-null range of characters, till the SECOND separation symbol !

    Then for the two remaining parts, of the regex, (.+)\|(.+) just refer to the previous regex for explanations

    In replacement, we just perform a permutation of these three groups

    Cheers,

    guy038

  • 2 search strings in a group of files with the search function

    3
    0 Votes
    3 Posts
    3k Views
    guy038G

    Hello, Andrea,

    What you, really, like to, is not clearly defined, in your post ! So I tried to guess ;-)

    Seemingly, you’re looking for, either, the string Word1 OR the string Word2, in several files

    As I supposed that these files may contain many occurrences of the string Word1 AND/OR many occurrences of the string Word2 you would prefer to get only ONE result, per file, wouldn’t you ?

    But, as it’s likely that most of them contain the TWO strings Word1 and Word2, do you prefer :

    A) : ONE result, per file, containing ONE of the two strings, whatever it is

    B) : TWO results, per file, with a first line containing ONE of the strings, and a second line containing the OTHER string

    Anyway, I’ll give you the solution for the two cases A) and B ;-))

    Initially, when I built these two regexes, for cases A) et B), I tried them on a dozen, or so, of files, and, unfortunately, I noticed that, when the current file scanned, has an important size, the regex might cause a catastrophic backtracking, ending to a global wrong match of the full contents of this file :-((

    As I was unable to find out other correct regexes, yet, which could avoid search failure, I, then, decided to take advantage of a new N++ feature, implemented since the 6.9.2 version : The new option Find in this finder…, when you right-click inside the Find result panel !

    So, I split the problem in two parts :

    Firstly, output, only, the lines, of each scanned file, which contain, either, the string Word1 and/or Word2, in the Find result panel

    Secondly, from that found restricted list, use my original regexes to get the right results !

    So, follow these preliminary steps, below :

    Open the Find in Files dialog ( Ctrl + Shift + F )

    Type, in the Find what: field, the simple regex (?-i)Word1|Word2

    Type, in the Replace with Field, the regex $0 ( SECURITY ! )

    Type, in the Filters field, your list of files to be scanned

    Type, in the Directory: field, the absolute path of the folder, containing your files

    Click on the Find All button

    => The Find result panel should appear, with all the concerned lines, from all your files to be scanned !

    Notes :

    The (?-i) modifier forces the regex search to be performed in a sensitive way. Use, instead, the (?i) syntax, if you prefer to run the search, in a insensitive way !

    Although we’re just searching something, and not replacing anything, it’s a good habit to, always, put the form $0, which stands for the complete current matched string. Indeed, just suppose that you clicked, by mistake, on the Replace in Files button and that you confirmed the replacement, by clicking on the OK button of the validation dialog, this S/R would simply replace any matched string by this same string itself :-)) Quite at ease, isn’t it ?

    Now, we are going to exploit the restricted text, of the Find result panel :

    Case A) :

    This regex search looks for the last line, in the Find result panel, containing, indifferently, the string Word1 or Word2, in that EXACT case :

    Right-click, inside the Find result panel, and choose the Find in this finder… option

    In the Find what: field, type (?s-i).*\K(?:Word1|Word2)

    Check the Search only on found lines option

    Uncheck the Match whole word only option

    Select the Regular expression search mode

    Click on the Find All button

    => A second “Find result” panel appears, with the indication - Line Filter Mode: only display the filtered results. This new panel should contain, only, ONE line, per file, with, indifferently, the string Word1 or the string Word2 !

    Notes :

    The first part, (?s-i).* , looks for any amount, even empty or multi-lines, of any character ( standard or EOL ) till the last occurrence, in the file, of the string Word1 or Word2, with its exact case, stored in a non-capturing group (?:...|...)

    Due to the \K syntax, the the location of the regex match is reset and the regex engine just matches the string Word1 or Word2

    Case B) :

    This regex search looks for the TWO last lines, in the Find result panel, containing the string Word1, first, then, the string Word2 OR the string Word2, first, then, the string Word1, ans all, in that EXACT case :

    Select, again, the MAIN Find result panel ( IMPORTANT )

    Right-click, inside, and choose, again, the Find in this finder… option

    In the Find what: field, type the regex (?s-i).*\K(?:(Word1)(?=.*(?2))|(Word2)(?=.*(?1)))|.*\K(?:(?1)|(?2))

    Check the Search only on found lines option

    Uncheck the Match whole word only option

    Select the Regular expression search mode

    Click on the Find All button

    => A third “Find result” panel appears, with the indication - Line Filter Mode: only display the filtered results. This new panel should contain TWO lines, per file, with, for each file :

    A first line, containing the string Word1 and a second line, containing the string Word2, in that exact case

    OR

    A first line, containing the string Word2 and a second line, containing the string Word1, in that exact case

    NOTES :

    If a scanned file contains the string Word1 or Word2, ONLY, this unique occurrence is, also, outputted !

    This search regex is quite difficult to understand, because it uses some expressions, called subroutine calls (?n), which point out, by reference, to the groups 1 and 2. Not easy to explain correctly this regex ! I started with the more simple regex, below :

    (?s-i).*\K(?:Word1(?=.*Word2)|Word2(?=.*Word1))|.*\K(?:Word1|Word2)

    After matching the longest range of any character, which is forgotten, due to the \K syntaxt, the regex engine tries to find, either :

    The string Word1, ONLY IF it’s followed, further on, with the string Word2 ( case C )
    OR
    - The string Word2, ONLY IF it’s followed, further on, with the string Word1 ( case D )

    Then, after matching, again, a longest range of any character, which is reset, due to the \K form, the regex engine tries, this time, to find, either :

    The other string Word2 ( case C )
    OR The other string Word1 ( case D )

    The inconvenient of this regex (?s-i).*\K(?:Word1(?=.*Word2)|Word2(?=.*Word1))|.*\K(?:Word1|Word2) is that you must repeat the two strings, to look for, three times to get the overall regex to work ! By using some subroutine calls, we need to enter these two strings ONCE, only, instead of three times !

    In short, the syntax (?n) of a subroutine call, represents the exact contents of group n, which can be located, before, or after, its reference (?n]. So :

    (?1) is equivalent to the group 1, (Word1)

    (?2) is equivalent to the group 2, (Word2)

    Therefore, from the original regex form (?s-i).*\K(?:Word1(?=.*Word2)|Word2(?=.*Word1))|.*\K(?:Word1|Word2), we may change the regex into this final one, below, which is, as correct as the other one, although a bit more difficult to understand :-(. However, you’ll just need to write the two strings to search, only ONCE !

    (?s-i).*\K(?:(Word1)(?=.*(?2))|(Word2)(?=.*(?1)))|.*\K(?:(?1)|(?2))

    Best Regards,

    guy038

    Additional info :

    1) Concerning the new Find in this finder option of the Search result panel :

    If you do NOT check the Search only on found lines option, the search is performed on all the contents of the different files, listed in the Search result panel

    if you check the Search only on found lines option, the search is performed, ONLY, on all the lines, listed in the Search result panel

    2) The main difference between a subroutine call and a back-reference is that:

    A back-reference \n refers to the present value of the group n

    A subroutine call (?n) refers to the present template of the group n

    So, if we consider these four lines :

    123 ABC 123 123 ABC 789 789 ABC 123 789 ABC 789

    The regex (\d+) ABC \1 would match lines 1 and 4, whereas the regex (\d+) ABC (?1) would match the four lines

    In other words, the regexes (\d+) ABC (?1) and (\d+) ABC (\d+) are strictly equivalent

    3) Note that, when a subroutine call is used INSIDE its group, to which it refers, it becomes a recursive sub-pattern reference :

    For instance, in the regex :(\{[^\{\}]+\}(?1)?), the group 1 is the overall regex, which does contain its reference (?1). So (?1) is a recursive sub-pattern reference

    But, in the regex (\{[^\{\}]+\})(?1)?, the group 1 is (\{[^\{\}]+\}) and its reference (?1), located outside the group 1, is just a subroutine call

    These two regexes looks for, either, a single string {....} surrounded by curly braces or two consecutive strings {....}{....}

    You may test these regexes, with the example text, with contains a well-balanced amount of curly braces :

    {This}{is}{a small}{text}{{in order{to {test}{this}}}{{regex}}}
  • Guidance needed - "Bullet Journal" idea for language / plugin

    6
    0 Votes
    6 Posts
    3k Views
    Bob ThomasB

    Thanks for the info guys! I think I have what I need to proceed.

  • Notepad++ inserts text on carriage return

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Claudia FrankC

    @Atul-Vaidya

    first thing I would try is to start npp without plugins and see if problem still exists.
    Either by renaming the plugin directory or by starting npp with parameter -noPlugin.

    Cheers
    Claudia

  • how to change line spacing

    2
    0 Votes
    2 Posts
    2k Views
    Claudia FrankC

    @Carol-Granger-Umberger-King

    you need to be more specific about what you want to do
    and keep in mind that notepad++ is an editor and not a
    word processor like libre office writer or MS Office Word.

    Cheers
    Claudia

  • Chardet methods integration in a VS C# Project

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    Claudia FrankC

    @EuGeNiO-ChIoDo
    maybe this will help?

    Cheers
    Claudia

  • want Edge not IE in RUN - Launch

    8
    0 Votes
    8 Posts
    5k Views
    Jim Gerland243J

    This works for me:

    Download the MicrosoftEdgeLauncher.exe from https://github.com/MicrosoftEdge/edge-launcher/releases/tag/1.0.0.0 to your C:\Program Files (x86) folder Edit your C:/Users/<put your username here>/AppData/Roaming/Notepad++/shortcuts.xml file In the <UserCommand> secton add this line:
    <Command name=“Launch in Edge” Ctrl=“yes” Alt=“yes” Shift=“yes” Key=“83”>“C:\Program Files (x86)\MicrosoftEdgeLauncher.exe” "$(FULL_CURRENT_PATH)</Command> Exit and reload Notepad++ Open an HTML file and try it.
    Jim…
  • 0 Votes
    15 Posts
    45k Views
    Cecilia DalzellC

    Go raibh maith agat, a guy038! Thank you so much, guy038! Notepad++ has been one of my go-to places to type in Irish (Gaeilge)text without the craziness you get in Microsoft when attempting a bilingual document. I could find nothing about how to reactivate the spellchecker and keyboard in Notepad++'s help, and it was definitely there before my computer was reimaged. Your instructions are most helpful. For the record, I have it working in English and Irish on Notepad++ 7.2.2 64 bit, windows 7 64 bit.

  • Function list with PHP with abstract functions

    7
    0 Votes
    7 Posts
    3k Views
    Florent PagèsF

    Nice!

    RE seem to be so powerful.

  • Ruby Syntax highlight issue

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    dereiusD

    @gstavi I brought this into attention of the Ruby Lexer dev within Scintilla. Hopefully it will be corrected.
    Thanks for the suggestions.

  • Frequently forgetting the current session

    5
    0 Votes
    5 Posts
    2k Views
    gstaviG

    If you want a fix, do your part of debugging. Tinker enough until you come up with a short sequence that reproduces the problem and perhaps then someone will try to fix it in the code.
    Otherwise it is just your problem and nobody cares.

  • Allow to download and install plugin for a non admin user ?

    4
    0 Votes
    4 Posts
    4k Views
    dailD

    When installing Notepad++ (which needs admin access of course) you can tell it to load plugins from the user’s %APPDATA% directory. That way N++ can then be executed by a non-admin user and install plugins (normally through the plugin manager) and the plugins and their config files get stored in the user’s own writeable directory.

    Keep in mind this works for most plugins but not all since some need to have files in the same directory as notepad++.exe (e.g. PythonScript).

  • when i doing new line with enter is writing me on the line:LF CR.

    Locked
    8
    0 Votes
    8 Posts
    3k Views
    Scott SumnerS

    @Florent-Pagès

    Yes, that will work, too, if one has the patience to count 20 items rather than use the View menu approach first proposed. :-)

    Or one could just describe that toolbar button as the one with a “paragraph marker” symbol on it. A backwards P with double vertical line.

  • signs instead of numbers

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    נועם יאגודייבנ

    thanks alot, i fixed that by changing the font,

    the bugged font is “courier new”