[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/kate/view
From: Dominik Haumann <dhdev () gmx ! de>
Date: 2007-09-30 21:20:06
Message-ID: 1191187206.705660.10685.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 719309 by dhaumann:
fix: if user clicks below the last line, set line to the last line
but still honor the column. should behave correct now :)
CCMAIL: aacid@kde.org
M +5 -7 kateviewinternal.cpp
--- trunk/KDE/kdelibs/kate/view/kateviewinternal.cpp #719308:719309
@@ -2012,13 +2012,11 @@
KateTextLayout thisLine = yToKateTextLayout(p.y());
KTextEditor::Cursor c;
- if (thisLine.isValid()) {
- c = renderer()->xToCursor(thisLine, startX() + p.x(), !view()->wrapCursor());
- } else { //set to the last position in the document
- thisLine = cache()->viewLine(m_doc->lines() - 1);
- c = thisLine.end();
- }
-
+ if (!thisLine.isValid()) //set to the last position in the document
+ thisLine = cache()->textLayout(m_doc->lines() - 1, -1);
+
+ c = renderer()->xToCursor(thisLine, startX() + p.x(), !view()->wrapCursor());
+
if (c.line () < 0 || c.line() >= m_doc->lines()) {
return;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic