• Find in Files does not find nor display Umlauts

    7
    0 Votes
    7 Posts
    1k Views
    EkopalypseE

    @ungesundes-halbwissen

    from my short test it looks like it is working for utf8 encoded but not for “ansi”
    encoded files if those files haven’t been loaded into the current session.

  • Search and Replace with Regex

    8
    0 Votes
    8 Posts
    26k Views
    guy038G

    Hello, @jens-ubert, @ekopalypse, @alan-kilborn, @peterjones, and All,

    Jens, welcome to the N++ community !

    Seemingly, I understand that your goal is to obtain the B) syntax, leaving the C) and D syntaxes untouched. In other words, you just would like that any A) syntax be replaced with the B syntax, wouldn’t you ?

    Thus, we have to grab any A syntax, specifically, and change it into the B one

    Comparing all syntaxes, it comes that only the A syntax does not contain any single quote character, ' nor the $ symbol, between square brackets. We can add the rule that the variable name, before the square brackets does not contain any single quote, too !

    On the other hand, the part before square brackets does not change, when moving from the A to the B syntax. So, we just need to store the text, between square brackets, and surround it with single quotes, during replacement !

    So, a possible regex would be :

    SEARCH \s\$[^'\r\n]+\[\K([^'$\r\n]+)(?=\])

    REPLACE '\1'

    Notes :

    The beginning of the regex \s searches for the general kind of space character ( the Space or Tabulation chars, the \n or \r line break chars and some others… )

    Then the part \$ looks for the literal regex symbol $

    Now, the syntax [^'\r\n]+\[ searches the greatest non-null range of consecutive characters, different from a single quote and line-breaks chars, followed by a literal opening square bracket

    The special syntax \K cancels any match and resets the regex engine working position

    Thus, the part ([^'$\r\n]+) tries, now, to match the greatest non-null range of consecutive characters, either different from a single quote, a dollar and line-breaks chars, stored as group 1, due to the outer parentheses

    But ONLY IF  the look-ahead (?=\]) is true, i.e. if this range is followed with an ending literal square bracket !

    Finally, in replacement, the \1 syntax represents all group 1 contents, surrounded with single quotes

    Best Regards,

    guy038

  • 0 Votes
    8 Posts
    1k Views
    mvancleave99M

    @Ekopalypse

    No worries! People (especially newbies) never post their actual question. Instead they post what they think their question is, so your original answer was quite reasonable. :-)

    Yeah. I think I’ll live with what is a minor anomaly for me. The scripting solution will be above my head … ;-)

  • NPP+ keyboard & Mouse shortcuts line no longer works

    9
  • Notepad++/Visual Studio 2019/Python

    6
    0 Votes
    6 Posts
    1k Views
    Michael VincentM

    @Alan-Kilborn said:

    Michael left wrapping double quotes out of that, even though the OP had them there in 2 places

    purely an oversight - thanks. Corrected below:

    <Command name="Run Python" Ctrl="no" Alt="no" Shift="no" Key="0">"C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python" "$(FULL_CURRENT_PATH)"</Command>
  • How to start?

    14
    0 Votes
    14 Posts
    2k Views
    guy038G

    Hi, @alan-kilborn,

    Just congratulate your great aunt to be such a modern person !! To be honest, I’m pretty sure I’ll be uncomfortable with most of new objects of that time, that is…, in 23 years ;-))

    BR

    guy038

  • How do I see the full line in Find results window?

    4
    1 Votes
    4 Posts
    3k Views
    Alan KilbornA

    Oh, and BTW before anyone asks, since the Find-result panel is just another Scintilla window, I turned on visible whitespace and line wrapping for it, to aid in showing the above analysis.

  • N++ selection in edit mode

    2
    0 Votes
    2 Posts
    377 Views
    Alan KilbornA

    @hachelle

    You provide little detail, but I’ll guess that a technique that might satisfy is to do a regular expression search something like the following:

    (?s)starttag.*?endtag

    where you would supply the text for the starttag and endtag parts.

  • macro search between <section>fixed & changing characters</section>

    3
    0 Votes
    3 Posts
    416 Views
    Fedor AlphenaarF

    @Ekopalypse many thanks, that indeed works and it basically removes it. saves a lot of time

  • Bold text

    3
    0 Votes
    3 Posts
    783 Views
  • 0 Votes
    3 Posts
    587 Views
    EkopalypseE

    @Steven-Haymes

    not exactly, you missed one duplicate line ;-)

    @gurikbal-singh

    it only works on consecutive lines, meaning
    if you have something like

    a a b b c c

    you get

    a b c

    BUT if there are other lines in between like empty lines or different lines
    then it doesn’t do anything. It basically checks always the previous line with the current line and if those are the same it will delete the current line.

  • Macro that changes file encoding and then saves?

    5
    0 Votes
    5 Posts
    1k Views
    Clay GibneyC

    The NppExec plugin did the trick! Just two simple lines were all I needed:
    npp_menucommand Encoding\Convert to UTF-8
    NPP_SAVEAS: c:\users\clay\downloads\people.csv

  • Replace adding

    3
    0 Votes
    3 Posts
    427 Views
    Stanisa AvdalovicS

    Yes, that is what I looking for.
    Thanks.

  • Editor font too thin/light

    5
    0 Votes
    5 Posts
    2k Views
    EkopalypseE

    @jhudis

    there is a known issue open, maybe you suffering from the same.

  • Everything I Paste is in Italics

    2
  • How to remove the last digit of an specific string

    4
    0 Votes
    4 Posts
    1k Views
    PeterJonesP

    @Steven-Haymes said:

    How about:

    And I thought my response was making some assumptions. :-)

  • how to change or delete proposal list?

    5
    0 Votes
    5 Posts
    704 Views
    PeterJonesP

    those were the docs for the auto-completion preferences; eventually, more details will be at http://notepad-plus-plus.github.io/npp-usermanual/content/auto-completion/ – or in an equivalent location at whatever the final URL for the new NPP documentation suite is.

  • NPP has error in Slovenian Language!

    1
    0 Votes
    1 Posts
    289 Views
    No one has replied
  • Regex start of line doesn't work as expected

    10
    0 Votes
    10 Posts
    4k Views
    Alan KilbornA

    @PeterJones said:

    if the user tried a couple of single "replace"s to make sure it was working, and then hit “replace all”, and the behavior changed, that would be disturbing

    Ha! I’m surprised that @guy038 hasn’t jumped in yet to talk about how exactly this sort of thing can and does happen!! :)

  • Tortoise SVN missing from Plugin Manager

    6
    0 Votes
    6 Posts
    2k Views
    David HiggsD

    @PeterJones Many thanks – creating sub directory and moving .dll is the solution – all working now. :+)
    Tortoise SVN plugin not available any longer via plugin manager but (as per Michael Vincent’s post ) available at http://www.incrediblejunior.com/npp_plugins/
    Thanks