diff --git a/src/ui/entry.cpp b/src/ui/entry.cpp index 936d5c050..31d5bb48a 100644 --- a/src/ui/entry.cpp +++ b/src/ui/entry.cpp @@ -520,10 +520,13 @@ int Entry::getCaretFromMouse(MouseMessage* mousemsg) int i = MIN(m_scroll, lastPos); for (; i bounds().x2() - border().right()) { if (x >= bounds().x2() - border().right()) { @@ -531,14 +534,8 @@ int Entry::getCaretFromMouse(MouseMessage* mousemsg) break; } } - else { - if (x > mouseX) { - // Previous char is the selected one - if (i > m_scroll) - --i; - break; - } - } + else if (x > mouseX) + break; } return MID(0, i, lastPos);