• Collapse level 2 not working for python language

    Locked
    2
    1 Votes
    2 Posts
    882 Views
    PeterJonesP

    I tried on v7.5.6 32bit, and it seems to not work right for me: collapse level 2 doesn’t collapse the two def’s. When I switched to a different language (Perl), with

    sub blah { do { tertiary: { 1; } }; while(1) { } }

    I was able to properly collapse and uncollapse levels 1, 2, or 3 without difficulty in Perl; but if I switch the language to python, it will only do level 1.

    Thus, it doesn’t seem to be solely the fault of v7.5.8, and it seems to be limited to Python.

    I just searched the issues page, and found https://github.com/notepad-plus-plus/notepad-plus-plus/issues/4633 already reported … Based on what they said there (each space if indent gives a new level), I tried to collapse level 5 on your example, and the two def’s collapsed. So the bug isn’t with Notepad++, it’s with the Python-lexer that comes bundled with Scintilla that comes bundled with Notepad++. And it appears that it’s not going to be fixed, because the author disagrees that it’s a bug (it’s working as he designed it, apparently).

    So you might have to get used to calling a 4-space indent “level 5”. (sorry to be the bearer of bad news.)

  • How to find numbers and start new lines with the numbers

    9
    0 Votes
    9 Posts
    4k Views
    PeterJonesP

    (argh, typo. That should have been TIMTOWTDI… where’d my I go?)

  • 0 Votes
    4 Posts
    2k Views
    Scott SumnerS

    This question comes up rather frequently, and it is always tackled with a regular-expression solution. This is okay… but sometimes people have trouble with that, so how about this time we throw down a Pythonscript solution? [Thanks, Alan, for the hint…]

    A variant of this question is “How do I replace a list of words (and corresponding replacement values) in one document and have the replace act upon another document?”. The question in this thread is just a special case of that: Deleting is simply where a replacement value is zero length.

    So I propose that the word list should have the following form, and be present in the clipboard when the script is run, with the data file to be operated on in the active Notepad++ editor tab:

    DELIMITERsearhtextDELIMITERreplacementtext
    where replacementtext can be empty in order to do a deletion

    Here’s an example:

    Text to be copied to clipboard prior to running the script:

    :silver:golden @silently@sqwalkingly .sqwalkingly .

    I purposefully used a different delimiter character on each line to show that that is possible…hmmm, maybe this just confuses things? Oh, well…

    Text to be operated on, all by itself in a fresh editor tab:

    Six silver swans swam silently seaward

    After running the script with that editor tab active, its text should be changed to:

    Six golden swans swam seaward

    Note that in the second line of the list, silently is changed to sqwalkingly. But…in the third line, sqwalkingly followed by a space is deleted (no text follows the final delimiter, meaning change the search text to nothing, i.e., delete it).

    Hopefully the reader can follow the progression of replacements in this case.

    So…to perform the OP’s original deletion of data, one would create the word list as follows and copy it to the clipboard:

    !user3;! !user9;! !user10;! !user2;! !user30;!

    Remember, the format is: DELIMITERsearhtextDELIMITERreplacementtext where replacementtext can be empty in order to do a deletion (as we are doing here). This time I have arbitrarily used the ! character as the delimiter, and I was consistent about it in each line, as one usually would be.

    Then, running the script in the file of the original data:

    [role] rid=2000 rdesc=Members user=user100;user70;user4030;user10;user300;user33;user9;user2;user35;user290;user30;user158;user3;user893;user10;

    One obtains, with the desired users eliminated:

    [role] rid=2000 rdesc=Members user=user100;user70;user4030;user300;user33;user35;user290;user158;user893;

    Here’s the script code for ReplaceUsingListInClipboard.py:

    def RULIC__main(): if not editor.canPaste(): return cp = editor.getCurrentPos() editor.setSelection(cp, cp) # cancel any active selection(s) doc_orig_len = editor.getTextLength() editor.paste() # paste so we can get easy access to the clipboard text cp = editor.getCurrentPos() # this has moved because of the paste clipboard_lines_list = editor.getTextRange(cp - editor.getTextLength() + doc_orig_len, cp).splitlines() editor.undo() # revert the paste action, but sadly, this puts it in the undo buffer...so it can be redone editor.beginUndoAction() for line in clipboard_lines_list: try: (search_text, replace_text) = line.rstrip('\n\r')[1:].split(line[0]) except (ValueError, IndexError): continue editor.replace(search_text, replace_text) editor.endUndoAction() RULIC__main()
  • JS embedded in HTML

    Locked
    2
    0 Votes
    2 Posts
    757 Views
    Scott SumnerS

    @Gianluca-F

    i am trying to create an HTML page with one or more JS script in order integrate a survey module in a image

    We’re happy for you…but…see here.

  • Emmet not working

    14
    0 Votes
    14 Posts
    9k Views
    Jan KijlstraJ

    Sorry, but this did not work for me.

    I’ve installed HTML-Kit Tools now, this editor
    works fine with Emmet

    So I decided to leave Notepad++.

  • Notepad++ Format lost when same file opened on another computer

    Locked
    5
    0 Votes
    5 Posts
    1k Views
    Scott SumnerS

    Probably the OP is talking about lexer-based (or plugin-based) formatting for languages such a C++, Python, XML, HTML, etc. (where the content of the file is pure text and only the view of the text is formatted/colorized). Hard to advise about what might be going wrong for him/her without more detail, though.

  • Session Manager Error 7 loading the global properties file

    Locked
    2
    0 Votes
    2 Posts
    790 Views
    Claudia FrankC

    @Roger-K.

    did you check/confirm that the “global properties file” is there and is accessible?
    Maybe by using tools like sysinternals procmon?

    Cheers
    Claudia

  • How to replace the last word on the bookmark line?

    Locked
    2
    0 Votes
    2 Posts
    649 Views
    Claudia FrankC

    @Vivian-Zheng

    Did you have created the bookmarked lines manually or with a find operation?
    If the latter is the case you might be able to get what you want in one find/replace action
    but therefore more information is needed about your data.

    If the first is the case you would need to do bookmark action (menu search->bookmark)
    or using a scripting language to solve your problem.

    Cheers
    Claudia

  • Frequently use 'Find and Replace' combinations

    Locked
    7
    0 Votes
    7 Posts
    2k Views
    Terry RT

    I agree Scott that it does somewhat seem to be a failure on Notepad++ behalf that you can’t do the macro edits in a ‘proper’ manner within itself.

    To offset that, Notepad++ isn’t on it’s own in this. There are other situations where external editors are used when the app itself doesn’t perform to users expectations (slow or unwieldy).

    And Peter, agreed that is another option. The thing is though that all these ideas become messy or complicated. Maybe Notepad++ needs to have a “pretty-up” to support this functionality internally and in a correct manner, otherwise each user will resort to whatever measures they think appropriate. For me it’s using that ‘dirty and disgusting’ plain old vanilla Notepad app.

    Do you think a “I want this” question to enhance Notepad++ in this manner would get any traction. Concept of breaking the shortcuts.xml file apart and having a separate macros.xml file. That way you would only have 1 situation where the file could be overwritten, and even that could be tempered with a flag so that if you did create a macro or even edit it’s shortcut in the current session you wouldn’t be allowed to open the macro.xml file to edit.

    We can all wish!

    Terry

  • Not persisting last open tab in version x64 after v7.5.6

    Locked
    2
    0 Votes
    2 Posts
    733 Views
  • auto highlight of words/numbers multiple lines not in columns...

    Locked
    4
    2 Votes
    4 Posts
    2k Views
    dkuenzi3phD

    Thank you for the quick reply Scott. just to be clear, the auto highlight is intended only to alert the user to other instances NOT as an editing tool.

    d k

  • 0 Votes
    2 Posts
    2k Views
    guy038G

    Hello, @gary-rowswell, and All,

    To begin with, I would strongly advice anyone, to use the UTF-8 BOM encoding, in all cases. Indeed, compared to the UTF-8 encoding, current file size is just 3 bytes more, which are invisible and stands for the UTF-8 representation of the Byte Order Mark, of Unicode code point \x{FEFF}.

    As any decent editor or browser recognizes BOM, you are absolutely sure that your UTF-8 encoded text will be correctly displayed, whatever the Unicode code-point of characters, between 0 to 10FFFD ( except for the surrogates area ), assuming, of course, that the current font used can handle all the characters of your text and displays their glyphs, properly !

    For additional information, refer to :

    https://en.wikipedia.org/wiki/Byte_order_mark

    Gary, what you call utf8mb4 seems to be a MySQL encoding ( The mb4 probably means MultiBytes-4 ) and, as well as UTF-8, allows to use Unicode characters, located outside the BMP ( Basic Multilingual Plane ), that is to say with a code point > \x{FFFF}, encoded with four bytes !

    Your “🆔” character is part of the Unicode block "Enclosed alphanumeric Supplement", between 1F100 and 1F1FF. See the PDF file, below :

    http://www.unicode.org/charts/PDF/U1F100.pdf

    Now, if you persist to use the UTF-8 ( so, without BOM ), here is a work-around :

    Start Notepad++ ( I personally used the last 7.5.8 version )

    Go to Settings > Preferences… > MISC. and check the Autodetect character encoding option

    Open a new document ( Ctrl + N )

    If its current encoding is different from UTF-8, choose the option Encoding > Convert to UTF-8

    Then, insert, preferably in a comment, at least 3 NON-ASCII characters, with code-point > \x{007F} ( or > 127 in decimal ). For this matter, if you can’t type them easily, with your keyboard, you may use the Edit > Character Panel dialog, in N++

    Now, add your text containing characters, located outside the BMP, with code-point > \x{FFFF}

    Save your UTF-8 encoded file

    Close and restart N++

    => The UTF-8 encoding should have been kept ;-))

    Voilà !

    Notes :

    During tests, I noticed that these 3 chars must be inserted BEFORE any character as yours ( “🆔” ) !

    In theory, 2NON-ASCII characters seems enough to get the right behaviour !

    Best Regards,

    guy038

    P.S. :

    I should have explained why we need to add some NON-pure ASCII characters, in current text. This is because, when text contains characters with code-point > \x{007f}, it is always encoded with 1 byte, in ANSI whereas it is encoded in 2, 3 or 4 bytes, in UTF-8. So, this helps N++ to correctly detect the present encoding, even without any BOM !

  • The thread with no title idea

    Locked
    5
    1 Votes
    5 Posts
    1k Views
    Scott SumnerS

    @Terry-R

    I tend to give 'em what they ask for, let them refine it once when they realize they’ve screwed it up, then lose interest like an airplane losing altitude when they keep changing it infinitely and think I’m going to provide an equal amount of free consulting work (which is what it is). Trying to read their minds is a losing proposition. If they provide sample data, they’d better make it representative. Otherwise I point them to some regex docs and wish them well. This ISN’T a regex site, after all…

  • Lost unsaved data on open file after upgrade

    Locked
    7
    0 Votes
    7 Posts
    2k Views
    PeterJonesP

    I just added issue#4729 to ask for something that will improve the auto-save during auto-update: whether it be immediately triggering the periodic backup, and/or updating the dialog message after an auto-update, and/or asking for explicit save before starting the auto-update. I don’t know if it will happen, but it’s at least requested

  • 0 Votes
    5 Posts
    2k Views
    PeterJonesP

    I just added issue#4729 to ask for something that will improve the auto-save during auto-update: whether it be immediately triggering the periodic backup, and/or updating the dialog message after an auto-update, and/or asking for explicit save before starting the auto-update. I don’t know if it will happen, but it’s at least requested

  • Horizontal scroll using mouse

    Locked
    2
    0 Votes
    2 Posts
    921 Views
    Scott SumnerS

    @Jernej-Habjan

    You already made an issue of it…reporting it here also is overkill and is of less significance than reporting it on github.

  • PlugIn-Manager crashes when it starts

    5
    0 Votes
    5 Posts
    2k Views
    SkodaRunnerS

    Die Version habe ich. :-)

    Habe den Fehler für die Abstürze gefunden.
    Ich hatte sowohl
    CSScriptNpp.x86.dll
    als auch
    CSScriptNpp.dll
    im Ordner \plugins

  • 1 Votes
    2 Posts
    790 Views
  • NotePad ++ V [7.5... 7.5.9] (Crash & Bugs)

    Locked
    12
    0 Votes
    12 Posts
    3k Views
    PeterJonesP

    Actually, when I first saw that post, it was downvoted; I upvoted it to bring the score to 0.

    I have no knowledge of how much is in the NodeBB requirements, and how much it is just in the particular configuration of the NodeBB instance on this site… but I’m still guessing it’s set that way to avoid grudges / retaliation: if you don’t know who downvoted your post, you don’t know who to hold grudge against.

    I’m not sure I agree with the unbalanced approach – it’d be more fair to have all votes private, than to have this mix of +=public, -=private.

    From the way I see it, plus-votes could have a similar problem with favoritism: if I counted and saw that Claudia had upvoted more of my posts than you had, maybe I’d start going back and upvoting all of her posts, just to ensure that she got ahead in the reputation race. (Or, if I were really vindictive, also downvote yours.)

    Hence, why the imbalance of visibility?

    Anyway, we’ve really veered off the original topic. Fortunately, ++Vitaliy has provided the best answer possible, I think, given what’s been posted.

  • Checkboxes

    Locked
    2
    0 Votes
    2 Posts
    12k Views
    Terry RT

    I think you will need to supply a sample so we get a better idea as currently the detail is very thin.

    I will say though that Notepad++ is primarily a “text” editor. So it’s all about character sets, not adding boxes (images). In saying that though if you are wanting a webpage (html) file then Notepad could easily insert the correct html code into a list you already have. So code like:
    <form action="/action_page.php"> <input type="checkbox" name="vehicle" value="Bike"> I have a bike<br> <input type="checkbox" name="vehicle" value="Car" checked> I have a car<br> <input type="submit" value="Submit"> </form>
    is something that notepad++ could help you with.

    Terry