mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-06-03 06:12:43 -06:00
TextDiffCtrl: Fixed selection issue #840
git-svn-id: svn://ultimatepp.org/upp/trunk@7628 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
d55a8d30de
commit
1b2ec38cf8
2 changed files with 8 additions and 6 deletions
|
|
@ -25,22 +25,23 @@ TextCompareCtrl::TextCompareCtrl()
|
|||
gutter_capture = false;
|
||||
}
|
||||
|
||||
int TextCompareCtrl::GetLineNo(int y)
|
||||
int TextCompareCtrl::GetLineNo(int y, int& ii)
|
||||
{
|
||||
int ii = scroll.Get().y + y / letter.cy;
|
||||
ii = scroll.Get().y + y / letter.cy;
|
||||
return ii >= 0 && ii < lines.GetCount() ? lines[ii].number : Null;
|
||||
}
|
||||
|
||||
void TextCompareCtrl::DoSelection(int y, bool shift)
|
||||
{
|
||||
int i = GetLineNo(y);
|
||||
int ii;
|
||||
int i = GetLineNo(y, ii);
|
||||
if(!IsNull(i)) {
|
||||
if(shift)
|
||||
cursor = i;
|
||||
else
|
||||
cursor = anchor = i;
|
||||
Refresh();
|
||||
scroll.ScrollIntoY(i);
|
||||
scroll.ScrollIntoY(ii);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +66,8 @@ void TextCompareCtrl::LeftDown(Point pt, dword keyflags)
|
|||
|
||||
void TextCompareCtrl::LeftDouble(Point pt, dword keyflags)
|
||||
{
|
||||
int i = GetLineNo(pt.y);
|
||||
int ii;
|
||||
int i = GetLineNo(pt.y, ii);
|
||||
if(!IsNull(i))
|
||||
WhenLeftDouble(i - 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue