Nux

Merge lp:~wenjoseph/nux/fix-for-bug-737752 into lp:nux

Proposed by Joseph Wen
Status: Merged
Merged at revision: 305
Proposed branch: lp:~wenjoseph/nux/fix-for-bug-737752
Merge into: lp:nux
Prerequisite: lp:~wenjoseph/nux/fix-for-bug-737726
Diff against target: 89 lines (+32/-8)
2 files modified
Nux/TextEntry.cpp (+30/-6)
Nux/TextEntry.h (+2/-2)
To merge this branch: bzr merge lp:~wenjoseph/nux/fix-for-bug-737752
Reviewer Review Type Date Requested Status
Jay Taoko (community) Approve
Review via email: mp+54906@code.launchpad.net

Description of the change

This branch fixed bug #737752

To post a comment you must log in.
Revision history for this message
Jay Taoko (jaytaoko) wrote :

Approved!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Nux/TextEntry.cpp'
--- Nux/TextEntry.cpp 2011-03-25 18:03:38 +0000
+++ Nux/TextEntry.cpp 2011-03-25 18:03:38 +0000
@@ -460,11 +460,17 @@
460 }460 }
461 else if (keyval == NUX_VK_BACKSPACE)461 else if (keyval == NUX_VK_BACKSPACE)
462 {462 {
463 BackSpace();463 if (!ctrl)
464 BackSpace(VISUALLY);
465 else
466 BackSpace(WORDS);
464 }467 }
465 else if ((keyval == NUX_VK_DELETE) && (!shift))468 else if ((keyval == NUX_VK_DELETE) && (!shift))
466 {469 {
467 Delete();470 if (!ctrl)
471 Delete(VISUALLY);
472 else
473 Delete(WORDS);
468 }474 }
469 else if ((keyval == NUX_VK_INSERT) && (!shift) && (!ctrl))475 else if ((keyval == NUX_VK_INSERT) && (!shift) && (!ctrl))
470 {476 {
@@ -1537,7 +1543,7 @@
1537// }1543// }
1538 }1544 }
15391545
1540 void TextEntry::BackSpace()1546 void TextEntry::BackSpace(MovementStep step)
1541 {1547 {
1542 if (GetSelectionBounds(NULL, NULL))1548 if (GetSelectionBounds(NULL, NULL))
1543 {1549 {
@@ -1547,11 +1553,20 @@
1547 {1553 {
1548 if (cursor_ == 0)1554 if (cursor_ == 0)
1549 return;1555 return;
1550 DeleteText(cursor_ - GetPrevCharLength(cursor_), cursor_);1556 if (step == VISUALLY)
1557 {
1558 DeleteText(cursor_ - GetPrevCharLength(cursor_), cursor_);
1559 }
1560 else if (step == WORDS)
1561 {
1562 int new_cursor;
1563 new_cursor = MoveWords(cursor_, -1);
1564 DeleteText(new_cursor, cursor_);
1565 }
1551 }1566 }
1552 }1567 }
15531568
1554 void TextEntry::Delete()1569 void TextEntry::Delete(MovementStep step)
1555 {1570 {
1556 if (GetSelectionBounds(NULL, NULL))1571 if (GetSelectionBounds(NULL, NULL))
1557 {1572 {
@@ -1561,7 +1576,16 @@
1561 {1576 {
1562 if (cursor_ == static_cast<int>(_text.length()))1577 if (cursor_ == static_cast<int>(_text.length()))
1563 return;1578 return;
1564 DeleteText(cursor_, cursor_ + GetCharLength(cursor_));1579 if (step == VISUALLY)
1580 {
1581 DeleteText(cursor_, cursor_ + GetCharLength(cursor_));
1582 }
1583 else if (step == WORDS)
1584 {
1585 int new_cursor;
1586 new_cursor = MoveWords(cursor_, 1);
1587 DeleteText(cursor_, new_cursor);
1588 }
1565 }1589 }
1566 }1590 }
15671591
15681592
=== modified file 'Nux/TextEntry.h'
--- Nux/TextEntry.h 2011-03-23 16:48:18 +0000
+++ Nux/TextEntry.h 2011-03-25 18:03:38 +0000
@@ -294,9 +294,9 @@
294 /** Paste the text in the clipboard to current offset */294 /** Paste the text in the clipboard to current offset */
295 void PasteClipboard();295 void PasteClipboard();
296 /** Delete a character before the offset of the cursor */296 /** Delete a character before the offset of the cursor */
297 void BackSpace();297 void BackSpace(MovementStep step);
298 /** Delete a character at the offset of the cursor */298 /** Delete a character at the offset of the cursor */
299 void Delete();299 void Delete(MovementStep step);
300 /** Switch between the overwrite mode and the insert mode*/300 /** Switch between the overwrite mode and the insert mode*/
301 void ToggleOverwrite();301 void ToggleOverwrite();
302//302//

Subscribers

People subscribed via source and target branches