From 3a73b61f648f0e202dfb2633a03eb6e6e32766d7 Mon Sep 17 00:00:00 2001 From: katsuhisa yuasa Date: Fri, 30 Apr 2021 05:48:57 +0900 Subject: [PATCH] =?UTF-8?q?=E5=85=88=E9=A0=AD=E8=A1=8C=E3=81=A7PageUp?= =?UTF-8?q?=E3=83=BB=E6=9C=AB=E5=B0=BE=E8=A1=8C=E3=81=A7PageDown=E3=81=97?= =?UTF-8?q?=E3=81=9F=E5=BE=8C=E3=81=AE=E3=82=AB=E3=83=BC=E3=82=BD=E3=83=AB?= =?UTF-8?q?=E7=A7=BB=E5=8B=95=E3=81=A7=E4=B8=8B=E7=B7=9A=E3=81=8C=E6=AE=8B?= =?UTF-8?q?=E3=82=8B=E4=B8=8D=E5=85=B7=E5=90=88=E3=81=AB=E5=AF=BE=E5=87=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/cmd/CViewCommander_Cursor.cpp | 6 ++---- sakura_core/view/CCaret.cpp | 5 +++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sakura_core/cmd/CViewCommander_Cursor.cpp b/sakura_core/cmd/CViewCommander_Cursor.cpp index 2f0ea2a32d..1f574021d1 100644 --- a/sakura_core/cmd/CViewCommander_Cursor.cpp +++ b/sakura_core/cmd/CViewCommander_Cursor.cpp @@ -745,7 +745,6 @@ void CViewCommander::Command_1PageUp( bool bSelect, CLayoutYInt nScrollNum ) } auto& caret = GetCaret(); auto prevCaretPos = caret.GetCaretLayoutPos(); - bool bNoDispCursorVLine = m_pCommanderView->m_pTypeData->m_ColorInfoArr[COLORIDX_CURSORVLINE].m_bDisp == false; caret.Cursor_UPDOWN( -nScrollNum, bSelect ); auto currCaretPos = caret.GetCaretLayoutPos(); CLayoutInt nScrolled = m_pCommanderView->ScrollAtV( nViewTopLine - nScrollNum ); @@ -753,7 +752,7 @@ void CViewCommander::Command_1PageUp( bool bSelect, CLayoutYInt nScrollNum ) m_pCommanderView->SetDrawSwitch(bDrawSwitchOld); // カーソル位置が変化しなかった、かつ、スクロール行数が0だった場合、描画を省く // タイプ別設定の「カーソル位置縦線」有効時には省かない - if (bNoDispCursorVLine && prevCaretPos == currCaretPos && nScrolled == 0) { + if (prevCaretPos == currCaretPos && nScrolled == 0) { return; } m_pCommanderView->RedrawAll(); @@ -782,7 +781,6 @@ void CViewCommander::Command_1PageDown( bool bSelect, CLayoutYInt nScrollNum ) } auto& caret = GetCaret(); auto prevCaretPos = caret.GetCaretLayoutPos(); - bool bNoDispCursorVLine = m_pCommanderView->m_pTypeData->m_ColorInfoArr[COLORIDX_CURSORVLINE].m_bDisp == false; caret.Cursor_UPDOWN( nScrollNum, bSelect ); auto currCaretPos = caret.GetCaretLayoutPos(); CLayoutInt nScrolled = m_pCommanderView->ScrollAtV( nViewTopLine + nScrollNum ); @@ -790,7 +788,7 @@ void CViewCommander::Command_1PageDown( bool bSelect, CLayoutYInt nScrollNum ) m_pCommanderView->SetDrawSwitch(bDrawSwitchOld); // カーソル位置が変化しなかった、かつ、スクロール行数が0だった場合、描画を省く // タイプ別設定の「カーソル位置縦線」有効時には省かない - if (bNoDispCursorVLine && prevCaretPos == currCaretPos && nScrolled == 0) { + if (prevCaretPos == currCaretPos && nScrolled == 0) { return; } m_pCommanderView->RedrawAll(); diff --git a/sakura_core/view/CCaret.cpp b/sakura_core/view/CCaret.cpp index 05a3cb055f..90cb59f087 100644 --- a/sakura_core/view/CCaret.cpp +++ b/sakura_core/view/CCaret.cpp @@ -964,6 +964,11 @@ CLayoutInt CCaret::Cursor_UPDOWN( CLayoutInt nMoveLines, bool bSelect ) bVertLineDoNotOFF = false; } GetAdjustCursorPos( &ptTo ); + + if (ptTo == ptCaret) { + return CLayoutInt(0); + } + if( bSelect ) { /* 現在のカーソル位置によって選択範囲を変更 */ m_pEditView->GetSelectionInfo().ChangeSelectAreaByCurrentCursor( ptTo );