[dasher: 72/217] More fixes for edit commands and next word, sentence and paragraph distances.



commit 698a23a1a04f961b5ce7dcd32bcc302de43c04be
Author: ipomoena <amajorek google com>
Date:   Fri Oct 16 16:24:25 2015 -0700

    More fixes for edit commands and next word, sentence and paragraph distances.
    
    I should have tested it better the first time :-(

 Src/Win32/Widgets/Edit.cpp |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/Src/Win32/Widgets/Edit.cpp b/Src/Win32/Widgets/Edit.cpp
index 2382cd0..c4415ec 100644
--- a/Src/Win32/Widgets/Edit.cpp
+++ b/Src/Win32/Widgets/Edit.cpp
@@ -346,10 +346,7 @@ int _findAfterChars(const wchar_t* str, const wchar_t* chrs, int startPos) {
 
 int _findBeforeChars(const wchar_t* str, const wchar_t* chrs, int startPos) {
   const wchar_t* ptr = str + startPos;
-  // over non separators
-  while (ptr > str && !wcschr(chrs, *ptr)) {
-    --ptr;
-  }
+
   // over separators
   while (ptr > str && wcschr(chrs, *ptr)) {
     --ptr;
@@ -451,7 +448,7 @@ int CEdit::Move(bool bForwards, CControlManager::EditDistance iDist) {
 int CEdit::Delete(bool bForwards, CControlManager::EditDistance iDist) {
   int iStart = 0;
   int iEnd = 0;
-  SendMessage(EM_GETSEL, (WPARAM)iStart, (LPARAM)iEnd);
+  SendMessage(EM_GETSEL, (WPARAM)&iStart, (LPARAM)&iEnd);
   if (iStart == iEnd) // Ignore distance if text is selected. 
     GetRange(bForwards, iDist, &iStart, &iEnd);
   SendMessage(EM_SETSEL, (WPARAM)iStart, (LPARAM)iEnd);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]