diff options
-rw-r--r-- | doc/ScintillaDoc.html | 13 | ||||
-rw-r--r-- | include/Scintilla.h | 2 | ||||
-rw-r--r-- | include/Scintilla.iface | 6 | ||||
-rw-r--r-- | src/Editor.cxx | 10 |
4 files changed, 30 insertions, 1 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index d39d95165..7a8f03e88 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -79,7 +79,7 @@ <h1>Scintilla Documentation</h1> - <p>Last edited 2/July/2011 NH</p> + <p>Last edited 19/July/2011 NH</p> <p>There is <a class="jump" href="Design.html">an overview of the internal design of Scintilla</a>.<br /> @@ -4419,6 +4419,12 @@ struct Sci_TextToFind { <td><code>SCI_MOVESELECTEDLINESDOWN</code></td> </tr> + + <tr> + <td><code>SCI_SCROLLTOSTART</code></td> + + <td><code>SCI_SCROLLTOEND</code></td> + </tr> </tbody> </table> @@ -4445,6 +4451,11 @@ struct Sci_TextToFind { as appropriate for <code>SCI_[[VC]HOME|LINEEND]*</code>. </p> + <p>The <code>SCI_SCROLLTO[START|END]</code> commands scroll the document to the start + or end without changing the selection. This is the expected behaviour of the <code>home</code> and + <code>end</code> keys on OS X. + </p> + <h2 id="KeyBindings">Key bindings</h2> <p>There is a default binding of keys to commands that is defined in the Scintilla source in diff --git a/include/Scintilla.h b/include/Scintilla.h index 99100d11c..403c0dce7 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -816,6 +816,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_RGBAIMAGESETHEIGHT 2625 #define SCI_MARKERDEFINERGBAIMAGE 2626 #define SCI_REGISTERRGBAIMAGE 2627 +#define SCI_SCROLLTOSTART 2628 +#define SCI_SCROLLTOEND 2629 #define SCI_STARTRECORD 3001 #define SCI_STOPRECORD 3002 #define SCI_SETLEXER 4001 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index 28273f012..95e784e19 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -2168,6 +2168,12 @@ fun void MarkerDefineRGBAImage=2626(int markerNumber, string pixels) # It has the width and height from RGBAImageSetWidth/Height fun void RegisterRGBAImage=2627(int type, string pixels) +# Scroll to start of document. +fun void ScrollToStart=2628(,) + +# Scroll to end of document. +fun void ScrollToEnd=2629(,) + # Start notifying the container of all key presses and commands. fun void StartRecord=3001(,) diff --git a/src/Editor.cxx b/src/Editor.cxx index 78b2ac475..a94089e9f 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4797,6 +4797,8 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lPar case SCI_VERTICALCENTRECARET: case SCI_MOVESELECTEDLINESUP: case SCI_MOVESELECTEDLINESDOWN: + case SCI_SCROLLTOSTART: + case SCI_SCROLLTOEND: break; // Filter out all others like display changes. Also, newlines are redundant @@ -5536,6 +5538,12 @@ int Editor::KeyCommand(unsigned int iMessage) { StartEndDisplayLine(sel.MainCaret(), false), 1), Selection::selStream); SetLastXChosen(); break; + case SCI_SCROLLTOSTART: + ScrollTo(0); + break; + case SCI_SCROLLTOEND: + ScrollTo(MaxScrollPos()); + break; } return 0; } @@ -8507,6 +8515,8 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_DOCUMENTSTARTEXTEND: case SCI_DOCUMENTEND: case SCI_DOCUMENTENDEXTEND: + case SCI_SCROLLTOSTART: + case SCI_SCROLLTOEND: case SCI_STUTTEREDPAGEUP: case SCI_STUTTEREDPAGEUPEXTEND: |