mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-31 07:12:39 -06:00
ide: Diff now jumps to the line in editor on double-click
git-svn-id: svn://ultimatepp.org/upp/trunk@7481 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
677b99baac
commit
cec6ed072d
5 changed files with 42 additions and 13 deletions
|
|
@ -25,19 +25,22 @@ TextCompareCtrl::TextCompareCtrl()
|
|||
gutter_capture = false;
|
||||
}
|
||||
|
||||
void TextCompareCtrl::DoSelection(int y, bool shift)
|
||||
int TextCompareCtrl::GetLineNo(int y)
|
||||
{
|
||||
int ii = scroll.Get().y + y / letter.cy;
|
||||
if(ii >= 0 && ii < lines.GetCount()) {
|
||||
int i = lines[ii].number;
|
||||
if(!IsNull(i)) {
|
||||
if(shift)
|
||||
cursor = i;
|
||||
else
|
||||
cursor = anchor = i;
|
||||
Refresh();
|
||||
scroll.ScrollIntoY(i);
|
||||
}
|
||||
return ii >= 0 && ii < lines.GetCount() ? lines[ii].number : Null;
|
||||
}
|
||||
|
||||
void TextCompareCtrl::DoSelection(int y, bool shift)
|
||||
{
|
||||
int i = GetLineNo(y);
|
||||
if(!IsNull(i)) {
|
||||
if(shift)
|
||||
cursor = i;
|
||||
else
|
||||
cursor = anchor = i;
|
||||
Refresh();
|
||||
scroll.ScrollIntoY(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +65,9 @@ void TextCompareCtrl::LeftDown(Point pt, dword keyflags)
|
|||
|
||||
void TextCompareCtrl::LeftDouble(Point pt, dword keyflags)
|
||||
{
|
||||
|
||||
int i = GetLineNo(pt.y);
|
||||
if(!IsNull(i))
|
||||
WhenLeftDouble(i - 1);
|
||||
}
|
||||
|
||||
void TextCompareCtrl::MouseMove(Point pt, dword flags)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue