Skip to content

Commit

Permalink
Fix issue #1915, osdn.net #46061: Treeview scrolls to the wrong posit…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
sdottaka committed Jul 1, 2023
1 parent 2065bd3 commit e499ac4
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions Src/DirView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1270,9 +1270,6 @@ void CDirView::ExpandSubdir(int sel, bool bRecursive)

m_pList->SetRedraw(FALSE); // Turn off updating (better performance)

const int top = m_pList->GetTopIndex();
const size_t num = m_listViewItems.size();

CDiffContext &ctxt = GetDiffContext();
dip.customFlags |= ViewCustomFlags::EXPANDED;
if (bRecursive)
Expand All @@ -1283,14 +1280,10 @@ void CDirView::ExpandSubdir(int sel, bool bRecursive)
int alldiffs;
RedisplayChildren(diffpos, dip.GetDepth() + 1, indext, alldiffs);

for (size_t i = 0; i < m_listViewItems.size() - num; ++i)
m_pList->InsertItem(sel + 1, nullptr);

SortColumnsAppropriately();

m_pList->SetRedraw(TRUE); // Turn updating back on
m_pList->SetItemCount(static_cast<int>(m_listViewItems.size()));
m_pList->EnsureVisible(top, TRUE);
m_pList->SetItemCountEx(static_cast<int>(m_listViewItems.size()), LVSICF_NOSCROLL);
m_pList->Invalidate();
}

Expand Down

0 comments on commit e499ac4

Please sign in to comment.