• How to save without comments?

    Locked Jul 16, 2017, 5:40 PM
    0 Votes
    2 Posts
    2k Views

    @Andrew-Tommy

    It is certainly easy enough to get rid of your comments, but it seems as if you’d want to end up with TWO versions of your file–one with comments (your worked hard to put the comments in, why not retain them!), and one without comments. Thus it might be wise to do a “Save A Copy As…” or “Save As…” and then remove the comments from the copy.

    As to removing the comments, a simple regular expression Replace-All operation should suffice:

    Find-what box: (?s)#.+?#
    Replace-with box: make sure this box is empty!
    Search mode: Regular expression

    You didn’t say if your comments could span lines or not, so the regular expression allows this (the (?s) part). Otherwise, the expression looks for a # character, followed by one or more characters (the .+? part), followed by another #. It replaces any matches with nothing effectively deleting the comment.

    You could record the Replace-All part as a macro, certainly. However, if you like the save-a-copy part, that doesn’t lend itself to macro-izing too well.

    If this (or ANY) posting was useful, don’t post a “thanks”, just upvote ( click the ^ in the ^ 0 v area on the right ).

  • 0 Votes
    2 Posts
    1k Views

    @hexsha

    for me it isn’t clear what you trying to do. As you started your post with hallo
    I assume you are German so maybe you wanna describe in German what your goal is?

    Cheers
    Claudia

  • 0 Votes
    2 Posts
    1k Views

    @Jeppe-Porse-Johnsen

    might be that the used font has been corrupted.
    Try another font by using Settings->Style Configurator->Global Styles->Global Override
    check enable global font and choose a different font.
    You should see the result immediately.

    Cheers
    Claudia

  • 'Insert File' in Current Document

    Locked Jul 14, 2017, 10:04 PM
    0 Votes
    6 Posts
    8k Views

    For commands, like merge in file and save selection to disk, that aren’t in NPP, I use the spectacularly good keyboard macro language: Autohotkey (autohotkey.com). It is a real scripting language and can be as simple or complex as you want. I have over 1,000 lines of AHK code. And, naturally, you can make each macro be specific to whatever program, NPP or whatever, that is active.

  • 0 Votes
    7 Posts
    3k Views

    Bingo - you’re right!

    I had Settings / Preferences / Auto-Completion / Auto-Insert ( )
    “ON” and the phantom ( ) appeared - causing me Auto - Confusion.
    I’ve unchecked the boxes and now I’m happy!

    Frank
    Simple is good.

  • 0 Votes
    2 Posts
    2k Views

    @Richdev-Boston

    I assume you are looking for $(FULL_CURRENT_PATH) variable.
    In addition, you might want to execute python in a cmd instance with paramter /K
    to see the output.

    cmd /K python $(FULL_CURRENT_PATH)

    But there is an alternative which offers additional features.
    I’ve posted it here.

    Cheers
    Claudia

  • 0 Votes
    6 Posts
    3k Views

    I found some deficiencies in PasteAsTrueRectBlock.py. There are situations where the desired rectangular blocking can’t be known at paste time, but only at copy time. So I wrote CopyAsTrueRectBlock.py. Running this new script on a single selection, be it a normal selection or a column-based one, will result in a truly rectangular block in the clipboard, which can subsequently be pasted via a normal paste (e.g., ctrl+v). As a bonus, the logic for this script is simpler and shorter than the earlier script. :-)

    Here’s CopyAsTrueRectBlock.py:

    def CATRB__main(): # (C)opy (A)s (T)rue (R)ectangular (B)lock if not editor.getSelectionEmpty(): if editor.selectionIsRectangle() or editor.getSelections() == 1: line_ending = [ '\r\n', '\r', '\n' ][notepad.getFormatType()] lines_list = editor.getSelText().split(line_ending) if len(lines_list[-1]) == 0: lines_list.pop() # if text ended with line_ending, need to remove empty element at end of list rect_width = 0 if editor.selectionIsRectangle(): rect_anchor = editor.getColumn(editor.getRectangularSelectionAnchor()) rect_anchor += editor.getRectangularSelectionAnchorVirtualSpace() rect_caret = editor.getColumn(editor.getRectangularSelectionCaret()) rect_caret += editor.getRectangularSelectionCaretVirtualSpace() rect_width = abs(rect_anchor - rect_caret) longest_line_length = max([ len(line) for line in lines_list ] + [ rect_width ]) # pad shorter lines out to length of longest: truly_rectangular_lines_list = [ line + ' ' * (longest_line_length - len(line)) for line in lines_list ] remember_active_file = notepad.getCurrentFilename() notepad.new() editor.addText(line_ending.join(truly_rectangular_lines_list) + line_ending) editor.setSel(0, (longest_line_length + len(line_ending)) * len(truly_rectangular_lines_list)) editor.setSelectionMode(SELECTIONMODE.RECTANGLE) editor.copy() editor.undo() notepad.close() notepad.activateFile(remember_active_file) CATRB__main()
  • 0 Votes
    2 Posts
    1k Views

    @Антон-Примако

    can you show some screenshots and debug-info?
    To add the screenshot to the post use the following syntax
    ![](url_of_uploaded_screenshot)

    Cheers
    Claudia

  • 0 Votes
    7 Posts
    6k Views

    You might want to contact support for that server, and see if it needs a reboot or something. :-)

  • Coding problem

    Locked Jul 14, 2017, 1:41 AM
    0 Votes
    2 Posts
    1k Views

    This forum is about Notepad++, a text editor. For information about writing HTML see https://www.w3schools.com/ for example.

    But you may try to write <img src=“filename.jpg”>.

  • 0 Votes
    3 Posts
    20k Views

    Hello, @Rana-jawad,

    An equivalent regex to the Scott’s one would be :

    SEARCH (?-s)(?<=\|).*

    REPLACE Leave EMPTY !

    Notes :

    The first part (?-s) is a modifier, which forces the regex engine to interpret the dot regex character as standing for any single standard character ( not End of Line characters )

    The last part .* tries to match any range, even empty, of standard characters

    The middle part (?<=\|) is a positive look-behind, that is to say a condition which must be true for an overall match

    This condition implies that the matched range of characters must be preceded by a literal vertical bar ( | ), which have to be escaped with an \, because the | character is the regex symbol for alternation

    And, due to the empty replacement box, this range of characters, located after the | character, is simply deleted

    However, just note that, with my regex or Scott regex, if some of your lines contains several | characters, any text after the first | character, will be deleted. For instance, the text, below :

    string1 | string2 | string3 string4001 | string2668 | string1234 string201 | string202 | string203

    would be changed into this one :

    string1 | string4001 | string201 |

    Best Regards,

    guy038

  • open selected file

    Locked Jul 13, 2017, 3:15 PM
    0 Votes
    4 Posts
    2k Views

    @kfonda

    What I did was to use the Logitech SetPoint software to set the function key to ‘Launch a Program’

    OK, I guess this doesn’t work as long as the SetPoint program hasn’t a functionality to communicate with explorer/shell objects.

    I guess what I need is a way to access the name of the currently selected file from the command line.

    I didn’t use it myself but maybe AutoIt (or similar sw) might be helpful in such a case.
    Afaik AutoIt has the possibility to work with COM objects, if so it should be possible
    to get the running explorer and shell instance and get the selected file.

    Cheers
    Claudia

  • Change Language in multiple files

    Locked Jul 13, 2017, 4:59 PM
    0 Votes
    2 Posts
    1k Views

    @Vasile-Caraus

    npp uses the file extension to decide which lexer(language) should be used.
    In your situation it looks like this extension is bound to BaanC.
    In order to change this you can either use Settings->StyleConfigurator
    and then remove from BaanC and add to HTML lexer or (in case it’s the default extension)
    edit langs.xml file directly.

    Cheers
    Claudia

  • 0 Votes
    5 Posts
    4k Views

    @Alan-Kilborn said:

    how to make hitting a simple “print” statement in a script also re-show a currently hidden PS console window

    If you don’t mind changing your print statements into print() function calls, you should be able to adapt the technique shown here: https://stackoverflow.com/questions/550470/overload-print-python

    into something like this (put it in startup.py):

    from __future__ import print_function import __builtin__ def print(*args, **kwargs): notepad.runPluginCommand('Python Script', 'Show Console') return __builtin__.print(*args, **kwargs)

    …could be a bit redundant, running the show-console command, even when already shown…

  • Try, Np++ join

    Locked Jul 13, 2017, 5:42 AM
    0 Votes
    1 Posts
    965 Views
    No one has replied
  • Hide comment

    Jul 4, 2017, 2:55 PM
    0 Votes
    7 Posts
    5k Views

    Thanks a lot.
    It works fine.
    I will modify it for some other functions.

  • 0 Votes
    1 Posts
    802 Views
    No one has replied
  • Inserting and image

    Locked Jul 12, 2017, 3:03 AM
    0 Votes
    3 Posts
    34k Views

    Thank you so much!!! this solved my problem

  • 0 Votes
    5 Posts
    2k Views

    Would like the feature to be merely a check box or option in preferences to save all before run.
    One option would be to just have it as an option when you are saving a run command where you get to name it and set an accelerator for the shortcut.

    Below is ver info…
    Notepad++ v7.4.2 (64-bit)
    Build time : Jun 18 2017 - 23:38:43
    Path : C:\Program Files\Notepad++\notepad++.exe
    Admin mode : ON
    Local Conf mode : OFF
    OS : Windows 10 (64-bit)
    Plugins : mimeTools.dll NppConverter.dll

  • Help with assets file code

    Locked Jul 12, 2017, 5:28 PM
    0 Votes
    2 Posts
    2k Views

    A quick search for endless space assets file format led me to a github issue on unpacking/repacking asset files, with a mention of Endless Space, so this “Disunity” tool might be able to extract readable information from the asset file.

    Most likely (ie, I don’t know how Unity or Endless Space do it, but this is my guess based on the Disunity page), the asset bundle is a binary-encoded and/or compressed data file.

    Notepad++ is a text editor. (Yes, it’s possible to look at more than text, and if someone were to write a plugin-wrapper for disunity or write a plugin that duplicates the functionality of disunity, you might be able to use Notepad++… but if it’s not a text file, it’s not in Notepad++'s mainstream use case.)

    Without a dedicated plugin, or using the results of a tool like Disunity to convert the file to text before editing: You could using the HEX Editor plugin for Notepad++ (download thru plugin manager), and might be able to edit the non-text data directly, but you’d have to do the interpreting of the individual bytes yourself. (And the last time I tried, HEX Editor was pretty buggy/crashy; your results may vary.)