diff options
author | nyamatongwe <unknown> | 2013-02-18 14:40:21 +1100 |
---|---|---|
committer | nyamatongwe <unknown> | 2013-02-18 14:40:21 +1100 |
commit | 3d19475f1fb7329017a243965e490f0716237516 (patch) | |
tree | cff32d32f7738d25982375e199cb2de4e657710a /src | |
parent | e9c87e958132b9f103b58e13cfb37a864f5edd02 (diff) | |
download | scintilla-mirror-3d19475f1fb7329017a243965e490f0716237516.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.cxx | 5 |
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", |