Scrolling

From Notepad++ Wiki
Jump to: navigation, search
Scrolling


Scrolling means viewing a (slightly) different part of the document you are editing. This is done using some commands below, or the horizontal and vertical scroll bars.

Some applications support free scrolling about after clicking the mouse wheel - a circular mouse pointer is then displayed. As of v6.6.6, Notepad++ does not support this feature.

For synchronized scrolling involving both viesws in lockstep, see Multiple Views.

Mappable commands

Scrolling consists in moving the visual position of the current line, but not the current line proper. The following commands are available from the shortcut mapper:

Some scrolling commands
SCI_LINESCROLLDOWN Move displayed contents one line down Ctrl+Down arrow
SCI_LINESCROLLUP Move displayed contents one line up Ctrl+Up arrow
SCI_SCROLLCARET Make the current line the topmost or bottommost displayed line None
SCI_MOVECARETINSIDEVIEW Makes the topmost or bottommost displayed line the current line None

Important note: assume the current line is being displayed, and you hit Ctrl+Up arrow, or whatever you remapped SCI_LINESCROLLUP to. This will move the current line... down your display. Indeed, the command asked to display all currently displayed lines, plus the one before. As a result, there are more lines between top of display and current line, to the effect that the latter moved down. One gets used to it.

Note that a left mouse click gives you greater control than using the SCI_SCROLLCARET command.

Other commands

Other Scintilla messages are about scrolling, but are more awkward to trigger from the keyboard, mostly because they take parameters and you cannot pass parameters from the keyboard. However, when the parameters have fixed values, you can devise a macro that sends the message, and then map the macro.

When a document has very long unwrapped lines, it may or may not be convenient to compute the horizontal thumb width as a function of the longest line being displayed. The following macros give you some control over horizontal scrolling:

  • Enabling use of the longest line:
<Macro name=" useLongLine " Ctrl="yes" Alt="yes" Shift="no" Key="100">
   <Action type="0" message=" 2516 " wParam= 0_if_false_1 if true lParam="0" sParam=""/>
</Macro>
  • Setting the absolute width to use for scrolling:
<Macro name=" setHScrollWidth " Ctrl="yes" Alt="yes" Shift="no" Key="100">
   <Action type="0" message=" 2274 " wParam= amount_in_pixels lParam="0" sParam=""/>
</Macro>

The following Scintilla messages also concern scrolling and are not mapped:

  • SCI_SETHSCROLLBAR (bool show_it)
  • SCI_SETVSCROLLBAR (bool show_it)
  • SCI_LINESCROLL(int colums_signed_offest,int line_signed_offset)
  • SCI_SETSCROLLWIDTH(int in_pixels)
  • SCI_SETSCROLLWIDTHTRACKING(bool do_it)
  • SCI_SETENDATLASTLINE(bool stop_there)

For further information about what these messages do and what their ID's are, please refer to the Scintilla documentation, in ScintillaDoc.html.

Advanced scrolling

While Notepad++ does not interfere with scrolling, which is taken care of by the Scintilla component and any relevant driver, it has been reported to cause issues with certain laptop scrolling devices, specifically touchpads. Additional handling can be disabled from Settings -> Preferences -> Editing -> Disable advanced scrolling feature (if you have touchpad problem) - actually this redirects to the underlying Scintilla components messages that were eaten from it.