From 3d19475f1fb7329017a243965e490f0716237516 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 18 Feb 2013 14:40:21 +1100 Subject: Don't draw line numbers before start of document. For elastic over-shoot scrolling, Scintilla was drawing lines with 0, -1, ... in the margin. --- src/Editor.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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", -- cgit v1.2.3