Commit ce14e874 authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

Ensure we are working with a valid cursor always

parent 7e0f6fcd
......@@ -593,12 +593,15 @@ public:
const auto coords = wid->mapTo(v, mouseEvent->pos());
const auto cur = v->coordinatesToCursor(coords);
const auto word = v->document()->wordAt(cur);
// there isn't much we can do now, just bail out
if (!cur.isValid())
return false;
// The user pressed Ctrl + Click
if (event->type() == QEvent::MouseButtonPress) {
if (mouseEvent->button() == Qt::LeftButton && mouseEvent->modifiers() == Qt::ControlModifier) {
// must set cursor else we will be jumping somewhere else!!
const auto word = v->document()->wordAt(cur);
if (!word.isEmpty()) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment