Commit d01cd475 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by hjk
Browse files

BinEditor: update correct lines when selection becomes empty...

and when selecting multiple lines at once

Place the cursor somewhere in the middle, shift+down, shift+up

Change-Id: Iacfab3c16f30c21116f47c65e4a6977597393de2
Reviewed-by: default avatarhjk <>
parent bc533c2c
......@@ -940,19 +940,18 @@ void BinEditor::setCursorPosition(int pos, MoveMode moveMode)
pos = qMin(m_size-1, qMax(0, pos));
int oldCursorPosition = m_cursorPosition;
bool hasSelection = m_anchorPosition != m_cursorPosition;
bool hadSelection = hasSelection();
m_lowNibble = false;
if (!hasSelection)
if (!hadSelection)
m_cursorPosition = pos;
if (moveMode == MoveAnchor) {
if (hasSelection)
if (hadSelection)
updateLines(m_anchorPosition, oldCursorPosition);
m_anchorPosition = m_cursorPosition;
hasSelection = m_anchorPosition != m_cursorPosition;
updateLines(hasSelection ? oldCursorPosition : m_cursorPosition, m_cursorPosition);
updateLines(hadSelection || hasSelection() ? oldCursorPosition : m_cursorPosition, m_cursorPosition);
emit cursorPositionChanged(m_cursorPosition);
Markdown is supported
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