~ubuntu-branches/ubuntu/trusty/kate/trusty-proposed

« back to all changes in this revision

Viewing changes to part/vimode/katevinormalmode.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2014-06-04 16:48:44 UTC
  • mfrom: (1.1.46)
  • Revision ID: package-import@ubuntu.com-20140604164844-dqgx2g13surkmfhd
Tags: 4:4.13.1-0ubuntu0.1
New upstream bugfix release (LP: #1318142)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1153
1153
    // block substitute can be simulated by first deleting the text
1154
1154
    // (done above) and then starting block prepend.
1155
1155
    return commandPrependToBlock();
1156
 
  } else
 
1156
  } else {
 
1157
    if (m_commandRange.startLine < m_commandRange.endLine) {
 
1158
      c.setLine(m_commandRange.startLine);
 
1159
    }
1157
1160
    c.setColumn(m_commandRange.startColumn);
 
1161
  }
1158
1162
 
1159
1163
  updateCursor(c);
1160
1164
  setCount(0); // The count was for the motion, not the insertion.
1509
1513
  m_viInputModeManager->clearCurrentChangeLog();
1510
1514
 
1511
1515
  if (doc()->undoCount() > 0) {
 
1516
    const bool mapped = m_viInputModeManager->keyMapper()->isExecutingMapping();
 
1517
 
 
1518
    if (mapped)
 
1519
      doc()->editEnd();
1512
1520
    doc()->undo();
 
1521
    if (mapped)
 
1522
      doc()->editBegin();
1513
1523
    return true;
1514
1524
  }
1515
1525
  return false;
1518
1528
bool KateViNormalMode::commandRedo()
1519
1529
{
1520
1530
  if (doc()->redoCount() > 0) {
 
1531
    const bool mapped = m_viInputModeManager->keyMapper()->isExecutingMapping();
 
1532
 
 
1533
    if (mapped)
 
1534
      doc()->editEnd();
1521
1535
    doc()->redo();
 
1536
    if (mapped)
 
1537
      doc()->editBegin();
1522
1538
    return true;
1523
1539
  }
1524
1540
  return false;
3447
3463
      for (int i = r.endLine + 1; i < lines && doc()->line(i).isEmpty(); i++) {
3448
3464
        r.endLine++;
3449
3465
      }
 
3466
      r.endColumn = 0;
3450
3467
    } else {
3451
3468
      Cursor prev = m_view->cursorPosition();
3452
3469
      Cursor c(r.endLine + 1, 0);
3465
3482
    updateCursor(Cursor(r.startLine, r.startColumn));
3466
3483
  } else {
3467
3484
    // We went too far and we're on empty lines, do nothing.
3468
 
    updateCursor(original);
3469
3485
    return KateViRange::invalid();
3470
3486
  }
3471
3487
  return r;