Notepad++: cursor past end of line / virtual spaces?

Sort of a hack (sends a window message directly to the Scintilla edit control on startup), but works great:

  1. Install NppExec plugin

  2. Go to Plugins -> NppExec -> Execute

  3. Enter the following code:

    // ensure console stays hidden
    NPP_CONSOLE 0
    
    // enable virtual spaces (cursor past end of line) outside column edit mode
    SCI_SENDMSG 2596 3 0
    
    // SCI_SENDMSG == send message to Scintilla edit control
    // 2596 == the message we're sending is SCI_SETVIRTUALSPACEOPTIONS
    // 3 == send the value (SCVS_RECTANGULARSELECTION | SCVS_USERACCESSIBLE)
    // the default value is 1 (just SCVS_RECTANGULARSELECTION) for
    //   virtual spaces in column select mode only
    // you can find these values by poking around the source code a bit, or
    // see http://www.scintilla.org/ScintillaDoc.html
    
  4. Click the Save button at the bottom, and give the script a name

  5. Now go to Plugins -> NppExec -> Advanced Options

  6. On the right, under "Execute this script when Notepad++ starts", select the script name you just saved

  7. Click OK, close/reopen Notepad++, and enjoy ;)

Tags:

Notepad++