aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2013-02-18 14:40:21 +1100
committernyamatongwe <devnull@localhost>2013-02-18 14:40:21 +1100
commitcdc1fd4eecc8cd59997e1995c91790fba45fff4f (patch)
treefa727e8e4fda61f5b17150d34566b05327a7cba8 /src
parent8fe79e81ff75d1f7d28ae5497b9b6842e26a6161 (diff)
downloadscintilla-mirror-cdc1fd4eecc8cd59997e1995c91790fba45fff4f.tar.gz
Don't draw line numbers before start of document.
For elastic over-shoot scrolling, Scintilla was drawing lines with 0, -1, ... in the margin.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index c72c6acff..0c1336aa0 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1947,8 +1947,9 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
rcMarker.bottom = yposScreen + vs.lineHeight;
if (vs.ms[margin].style == SC_MARGIN_NUMBER) {
if (firstSubLine) {
- char number[100];
- sprintf(number, "%d", lineDoc + 1);
+ char number[100] = "";
+ if (lineDoc >= 0)
+ sprintf(number, "%d", lineDoc + 1);
if (foldFlags & SC_FOLDFLAG_LEVELNUMBERS) {
int lev = pdoc->GetLevel(lineDoc);
sprintf(number, "%c%c %03X %03X",