Skip to content

Commit

Permalink
Added line number checking to backspace and delete keys.
Browse files Browse the repository at this point in the history
Refs #7575
  • Loading branch information
Samuel Jackson committed Aug 1, 2013
1 parent 49f0dc0 commit eb38e3a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Code/Mantid/MantidPlot/src/CommandLineInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ bool CommandLineInterpreter::handleKeyPress(QKeyEvent* event)
else if (key == Qt::Key_Delete)
{
cursorToEnd = false;
handled = (indexOfCursorLine() != indexOfLastLine());
}
if(cursorToEnd && key != Qt::Key_Control &&
(indexOfCursorLine() != indexOfLastLine() || event->matches(QKeySequence::Paste)))
Expand All @@ -694,7 +695,7 @@ bool CommandLineInterpreter::handleBackspace()
getCursorPosition(&dummy, &index);

//check if the cursor is > the start of the line
return (index == 0);
return (index == 0 || indexOfCursorLine() != indexOfLastLine());
}
}

Expand Down

0 comments on commit eb38e3a

Please sign in to comment.