Skip to content

Commit

Permalink
Merge pull request #1619 from beru/PageUp_PageDown_fix1
Browse files Browse the repository at this point in the history
タイプ別設定の「カーソル位置縦線」を有効時に、カーソルが先頭行にある状態で PageUp キーを押した後にカーソル左右移動するとカーソル位置縦線が残る問題を修正
  • Loading branch information
beru authored Apr 11, 2021
2 parents f62f209 + af457d3 commit 26d6eda
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sakura_core/cmd/CViewCommander_Cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,13 +745,15 @@ 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 );
m_pCommanderView->SyncScrollV(nScrolled);
m_pCommanderView->SetDrawSwitch(bDrawSwitchOld);
// カーソル位置が変化しなかった、かつ、スクロール行数が0だった場合、描画を省く
if (prevCaretPos == currCaretPos && nScrolled == 0) {
// タイプ別設定の「カーソル位置縦線」有効時には省かない
if (bNoDispCursorVLine && prevCaretPos == currCaretPos && nScrolled == 0) {
return;
}
m_pCommanderView->RedrawAll();
Expand Down Expand Up @@ -780,13 +782,15 @@ 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 );
m_pCommanderView->SyncScrollV(nScrolled);
m_pCommanderView->SetDrawSwitch(bDrawSwitchOld);
// カーソル位置が変化しなかった、かつ、スクロール行数が0だった場合、描画を省く
if (prevCaretPos == currCaretPos && nScrolled == 0) {
// タイプ別設定の「カーソル位置縦線」有効時には省かない
if (bNoDispCursorVLine && prevCaretPos == currCaretPos && nScrolled == 0) {
return;
}
m_pCommanderView->RedrawAll();
Expand Down

0 comments on commit 26d6eda

Please sign in to comment.