if (--itr_color->Length <= 0) {
// Move next color
++itr_color;
- // Make color update
+ // Change color
reset_color = true;
}
bool keepAnchor = ev->modifiers() & Qt::SHIFT ? true : false;
switch (ev->key()) {
case Qt::Key_Home:
+ cursor->HighNibble = true;
cursor->movePosition(0, keepAnchor, false);
break;
case Qt::Key_End:
+ cursor->HighNibble = true;
cursor->movePosition(document->length(), keepAnchor, false);
break;
case Qt::Key_Left:
+ cursor->HighNibble = true;
cursor->moveRelativePosition(-1, keepAnchor, false);
break;
case Qt::Key_Right:
+ cursor->HighNibble = true;
cursor->moveRelativePosition(1, keepAnchor, false);
break;
case Qt::Key_Up:
+ cursor->HighNibble = true;
cursor->moveRelativePosition(-16, keepAnchor, false);
break;
case Qt::Key_Down:
+ cursor->HighNibble = true;
cursor->moveRelativePosition(16, keepAnchor, false);
break;
case Qt::Key_PageUp:
+ cursor->HighNibble = true;
cursor->moveRelativePosition(-16 * 15, keepAnchor, true);
break;
case Qt::Key_PageDown:
+ cursor->HighNibble = true;
cursor->moveRelativePosition(16 * 15, keepAnchor, true);
break;
case Qt::Key_Backspace:
break;
default:
{
+ // copy from QtCreator
QString text = ev->text();
for (int i = 0; i < text.length(); i++) {
QChar c = text.at(i);
if (cursor->HighNibble) {
//changeData(m_cursorPosition, (nibble << 4) + (m_data[m_cursorPosition] & 0x0f), true);
cursor->HighNibble = false;
+ cursor->moveRelativePosition(0, false, false);
} else {
//changeData(m_cursorPosition, nibble + (m_data[m_cursorPosition] & 0xf0));
cursor->HighNibble = true;
void Cursor::movePosition(quint64 pos, bool sel, bool hold_vpos)
{
Q_ASSERT(pos <= document->length());
- // FIXME: replace drawView/drawCaret callings to udpate event
+ // FIXME: replace drawView/drawCaret callings by doc udpate event
const quint64 oldTop = Top;
const quint64 oldPos = Position;
Position = pos;
PositionAnchor = sel ? PositionAnchor : Position;
+ // Reset Nibble
+ //HighNibble = true;
+
// Redraw view
if (Top == oldTop) {
if (!sel && oldSelection) {