• Help to build PythonScript plugin

    7
    1 Votes
    7 Posts
    572 Views
    EkopalypseE

    @cmeriaux

    it looks that the general environment variables are defined in
    Microsoft.Cpp.Common.props file which is located at
    ...\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets

    and the toolset specific props are read from
    ...\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Platforms\x64\PlatformToolsets

    So I assume that one of those props files point to an non-existent atl include path.

  • Transpose multiple selections

    16
    3 Votes
    16 Posts
    4k Views
    dkeenan7D
    -- Transpose selections or characters or lines. -- If there is 1 empty selection at the start or end of a line, then -- transpose the line with the one above it (the pre-existing Ctrl+T behaviour). -- If all selections are empty, then transpose the characters on either side of -- any that are not at the start or end of a line. -- If there is 1 non-empty selection, rotate its characters forward. -- If there are 2 or more selections that are not all empty, rotate the selection contents between selections. -- Useful for rotating the rows in a rectangular/column selection (Alt-select) local function transposeSelectionsOrCharactersOrLines() -- According to the Scintilla documentation, there is always at least one selection local lastIdx = editor.Selections - 1 -- Indexes for multiple selections are zero-based editor:BeginUndoAction() -- Begin the sequence of actions to be undone or redone as a unit if editor.SelectionEmpty then -- If all selections are empty, i.e. consist only of an insertion point if lastIdx == 0 and isStartOrEndOfLine(editor.CurrentPos) then -- If there is only one selection and it's at the start or end of a line editor:LineTranspose() -- Transpose the current line with the one before else -- Else multiple empty selections or a single empty selection not at the start or end of a line -- Transpose the characters on either side of each insertion point that is not at the start or end of a line for idx = 0, lastIdx do local pos = editor.SelectionNCaret[idx] if not isStartOrEndOfLine(pos) then -- If this empty selection is not at the start or end of a line transposeCharactersAt(pos) -- Transpose the characters either side of the given position -- The insertion point will now be before both characters -- Put the insertion point back in between them, allowing for different numbers of bytes per character pos = editor:PositionAfter(editor.SelectionNCaret[idx]) editor.SelectionNAnchor[idx] = pos editor.SelectionNCaret[idx] = pos end end end else -- Else selections are not all empty if lastIdx == 0 then -- If there is only 1 selection --[[ Alternative behaviour: editor:LineTranspose() -- Transpose the current line with the one before --]] -- Rotate the characters in the selection (ignores virtual space) local selStart = editor.SelectionNStart[0] local selEnd = editor.SelectionNEnd[0] rotateCharacters(selStart, selEnd) -- Restore the selection editor.SelectionNStart[0] = selStart editor.SelectionNEnd[0] = selEnd else -- Else there are 2 or more selections -- Rotate selection contents between selections local str = getSelectionNTextVirtual(lastIdx) -- Save the last selection including any virtual space for idx = lastIdx, 1, -1 do -- Shift the other selections along setSelectionNTextVirtual(idx, getSelectionNTextVirtual(idx-1)) end setSelectionNTextVirtual(0, str) -- Make the first selection be the saved last selection end end editor:EndUndoAction() -- End the sequence of actions to be undone or redone as a unit end -- Rotate selections backwards -- Useful for rotating the rows backwards in a rectangular/column selection (Alt-select) local function rotateSelectionsOrCharactersBackwards() -- According to the Scintilla documentation, there is always at least one selection local lastIdx = editor.Selections - 1 -- Indexes for multiple selections are zero-based editor:BeginUndoAction() -- Begin the sequence of actions to be undone or redone as a unit if lastIdx == 0 then -- If there is only 1 selection -- Rotate the characters backwards in the selection (ignores virtual space) local selStart = editor.SelectionNStart[0] local selEnd = editor.SelectionNEnd[0] rotateCharactersBackwards(selStart, selEnd) -- Restore the selection editor.SelectionNStart[0] = selStart editor.SelectionNEnd[0] = selEnd else -- Rotate selection contents backwards between selections local str = getSelectionNTextVirtual(0) -- Save the first selection including any virtual space for idx = 1, lastIdx do -- Shift the other selections along setSelectionNTextVirtual(idx-1, getSelectionNTextVirtual(idx)) end setSelectionNTextVirtual(lastIdx, str) -- Make the last selection be the saved first selection end editor:EndUndoAction() -- End the sequence of actions to be undone or redone as a unit end -- Reverse selections -- Useful for reversing the order of rows in a rectangular/column selection (Alt-select) local function reverseSelectionsOrCharacters() -- According to the Scintilla documentation, there is always at least one selection local lastIdx = editor.Selections - 1 -- Indexes for multiple selections are zero-based local lastSwap = editor.Selections // 2 - 1 editor:BeginUndoAction() -- Begin the sequence of actions to be undone or redone as a unit if lastIdx == 0 then -- If there is only 1 selection -- Reverse the characters in the selection (ignores virtual space) local selStart = editor.SelectionNStart[0] local selEnd = editor.SelectionNEnd[0] reverseCharacters(selStart, selEnd) -- Restore the selection editor.SelectionNStart[0] = selStart editor.SelectionNEnd[0] = selEnd else -- Else there are 2 or more selections -- Swap selection contents between opposite pairs of selections for idx = 0, lastSwap do local str = getSelectionNTextVirtual(lastIdx - idx) -- Save the later selection including any virtual space setSelectionNTextVirtual(lastIdx - idx, getSelectionNTextVirtual(idx)) -- Replace later selection with the opposite earlier selection setSelectionNTextVirtual(idx, str) -- Make the opposite earlier selection be the saved later selection end end editor:EndUndoAction() -- End the sequence of actions to be undone or redone as a unit end -- Add menu entry for transposing or rotating selections, characters or lines. -- The Ctrl+T shortcut may need to be added manually via -- Settings -> Shortcut Mapper -> Plugin commands -> Transpose Selections/Characters/Lines -> Modify. -- You can ignore the conflict with the shortcut for Scintilla SCI_LINETRANSPOSE. editor:ClearCmdKey(string.byte("T"), SCMOD_CTRL) -- This doesn't seem to work here npp.AddShortcut("Transpose Selections/Characters/Lines", "Ctrl+T", transposeSelectionsOrCharactersOrLines) -- Add menu entry for rotating selections backwards. npp.AddShortcut("Rotate Selections/Characters Backwards", "Ctrl+Alt+T", rotateSelectionsOrCharactersBackwards) -- Add menu entry for reversing selections. npp.AddShortcut("Reverse Selections/Characters", "Ctrl+Alt+Shift+T", reverseSelectionsOrCharacters)
  • 'Open folder in Notepad++' context menu entry

    4
    0 Votes
    4 Posts
    3k Views
    webketjeW

    v1.1 - Updates:

    Fixed .reg file formatting issues Changed context menu entry text to Open as workspace in Notepad++ to better align with Notepad++ terminology Tested and fixed some previously present issues with space characters in paths Added version requirement (Npp 7.8+) to readme Added license info (MIT)
  • Autosave with some features

    1
    0 Votes
    1 Posts
    207 Views
    No one has replied
  • Notepad++ Portable FTP Unable to Connect

    4
    0 Votes
    4 Posts
    536 Views
    Ronald BesdanskyR

    Thanks for your replies. I tried using ftp from a Windows command prompt to upload my file but it was blocked by the Firewall. That’s presumably why the NPP Plugin was failing, although it wasn’t saying what the problem was.

    Thanks again
    Best wishes
    Ron B

  • Scintilla script help for 'Show white space and TAB'

    7
    1 Votes
    7 Posts
    544 Views
    PeterJonesP

    @PeterJones said in Scintilla script help for 'Show white space and TAB':

    I’ll leave it at that.

    When have you known me to leave it at that? ;-)

    To set the whitespace size with a scripting language (in case you don’t want to use ExtSettings):

    PythonScript: add the following to your startup.py (or to another script you call from startup.py:

    editor1.setWhitespaceSize(0) editor2.setWhitespaceSize(0)

    NppExec:

    Plugins > NppExec > Execute, type in:

    set local x = $(FILE_NAME) npp_switch $(LEFT_VIEW_FILE) sci_sendmsg SCI_SETWHITESPACESIZE 0 npp_switch $(RIGHT_VIEW_FILE) sci_sendmsg SCI_SETWHITESPACESIZE 0 npp_switch $(x)

    Save…, pick a name (like ZeroWhitespaceSize)

    Plugins > NppExec > Advanced Options

    Execute this script when Notepad++ starts = ZeroWhitespaceSize

  • NPPM_INTERNAL_* commands

    6
    1 Votes
    6 Posts
    455 Views
    PeterJonesP

    @pnedev said in NPPM_INTERNAL_* commands:

    For example those messages might be doing only part of the job you think they are doing.

    That’s probably the best reason right there. :-)

    Thanks for the explanation.

  • Getting BufferID from ScNotificationHeader in C#

    9
    0 Votes
    9 Posts
    623 Views
    EkopalypseE

    @dinkumoil

    :-D just done, and I assume code part has been identified as well.
    Thx for confirming.

  • NPP Messages & Notifications reference?

    5
    1 Votes
    5 Posts
    566 Views
  • Rescue me from getting insane.

    9
    2 Votes
    9 Posts
    744 Views
    EkopalypseE

    @Alan-Kilborn
    But if the clickbait was chosen that good,
    then one might remember it and find it easier :-)

  • New plugin development library released

    2
    1 Votes
    2 Posts
    392 Views
    EkopalypseE

    @PeterJones - something for in-other-languages?

  • Batch: add highlighting of EQU NEQ LSS LEQ GTR GEQ as keywords

    3
    0 Votes
    3 Posts
    431 Views
    andrecool-68A

    You can add keywords for each language yourself

  • Request: GPT-2 based text generation

    3
    1 Votes
    3 Posts
    916 Views
    Victor MilovanovV

    Hi Zachary,

    I am the author of both Gradient and GPT-2 adaptation for it.
    Unless you are planning to sell your plugin, feel free to use Gradient. If you want to make it open-source, I’d be glad to provide help.

    Note though, that one would have to install Python + TensorFlow to use GPT-2.

  • multi line search and replace

    2
    0 Votes
    2 Posts
    299 Views
    Alan KilbornA

    Ummm…you can do that sort of thing already using regular expressions, but it can get unwieldy if you have a lot of data. Just thought I’d point that out.

  • Question for PythonScript users

    6
    2 Votes
    6 Posts
    591 Views
    cmeriauxC

    @Ekopalypse Thanks very much for your involvement.
    Once you’are ready for beta testing, you can contact me.

  • My plugin does not load in the newest versions

    11
    0 Votes
    11 Posts
    2k Views
    chcgC

    @Andrew-Cutforth See https://github.com/notepad-plus-plus/nppPluginList. You may want to provide a zip package which could be installed via PluginAdmin for N++ versions newer than 7.6.3.

  • bug : preference "language => replace by space" is not persisted

    5
    0 Votes
    5 Posts
    306 Views
    bozeugeneB

    my apologies, seems that this problem occured after an ugly computer shutdown (empty laptop battery or a savage windows update, no idea what occured).
    after more testing on my side, all seems to run fine now
    thanks for your time and patience

  • Feature request - Left cursor movement to stop at left margin

    25
    0 Votes
    25 Posts
    17k Views
    dinkumoilD

    I wrote a plugin that can be used to configure left cursor movement to stop at left margin. Since this relies on a Scintilla setting you have to use at least Notepad++ v7.7. Untick option Wrap cursor at line start. The plugin’s name is ExtSettings. You can download it >>> here <<<. It will also be available soon via PluginsAdmin.

  • Enabling Auto-Completion dropdown list for DSpellCheck

    1
    0 Votes
    1 Posts
    292 Views
    No one has replied
  • I am looking for a co-author to develop a plugin (easy PHP IDE)

    16
    0 Votes
    16 Posts
    2k Views
    WinterSilenceW

    @dinkumoil said:

    @WinterSilence

    As @Alan-Kilborn said I’m developing Notepad++ plugins in Delphi.

    Have a look at the GitHub repo of my NppUISpy plugin. In the folder src/Lib you’ll find my modified and extended version of the Delphi Plugin Framework, based on the work of Damjan Zobo Cvetko. It is 32 bit/64 bit capable and already adapted to the new Scintilla v4.1.4 API used since Notepad++ v7.7.

    Thanks, I see on next week!