Skip to content
Permalink
Browse files

Fix osdn.net issue #39664: Unexpected behavior when moving caret with…

… CTRL+arrow keys
  • Loading branch information...
sdottaka committed Oct 9, 2019
1 parent 119cd17 commit f37fd16d585c49fe379f06d0a835652233325d0a
Showing with 3 additions and 14 deletions.
  1. +3 −14 Externals/crystaledit/editlib/ccrystaltextview2.cpp
@@ -148,7 +148,6 @@ MoveRight (bool bSelect)
void CCrystalTextView::
MoveWordLeft (bool bSelect)
{
int nLength = GetLineLength(m_ptCursorPos.y);
PrepareSelBounds ();
if (m_ptDrawSelStart != m_ptDrawSelEnd && !bSelect)
{
@@ -158,16 +157,14 @@ MoveWordLeft (bool bSelect)

if (m_ptCursorPos.x == 0)
{
if (m_ptCursorPos.y == 0)
return;
m_ptCursorPos.y--;
m_ptCursorPos.x = nLength;
MoveLeft (bSelect);
return;
}

if (m_ptCursorPos.x > 0)
{
const TCHAR *pszChars = GetLineChars(m_ptCursorPos.y);
m_iterWord.setText(reinterpret_cast<const UChar *>(pszChars), nLength);
m_iterWord.setText(reinterpret_cast<const UChar *>(pszChars), GetLineLength(m_ptCursorPos.y));
int nPos = m_iterWord.preceding(m_ptCursorPos.x);
if (xisspace(pszChars[nPos]))
nPos = m_iterWord.preceding(nPos);
@@ -192,14 +189,6 @@ MoveWordRight (bool bSelect)
return;
}

if (m_ptCursorPos.x == GetLineLength (m_ptCursorPos.y))
{
if (m_ptCursorPos.y == GetLineCount () - 1)
return;
m_ptCursorPos.y++;
m_ptCursorPos.x = 0;
}

int nLength = GetLineLength (m_ptCursorPos.y);
if (m_ptCursorPos.x == nLength)
{

0 comments on commit f37fd16

Please sign in to comment.
You can’t perform that action at this time.