Added logic so that when a link appears at the beginning of a line, and the cursor is moved to the beginning of the line, the link is selected rather than positioning the cursor at the end of the previous line.

This commit is contained in:
Rich 2010-12-16 20:43:20 +00:00
parent 10f06a5e9c
commit 580ace24ad

View File

@ -1128,8 +1128,15 @@ namespace Volian.Controls.Library
{
if (SelectionStart >= 7)
{
DebugPrint("HSC===================>ll Insert: Sel {0}, Length {1}, Link Start {2}, Link Length {3}", SelectionStart, SelectionLength, ll.Start, ll.Length);
SelectionStart = ll.Start - 7;
// If the cursor is at the beginning of the line and a link is at the beginning of the line
// then select the link rather than postitioning the cursor at the end of the previous line
if (GetFirstCharIndexOfCurrentLine() == SelectionStart)
SetSelection(ll);
else
{
DebugPrint("HSC===================>ll Insert: Sel {0}, Length {1}, Link Start {2}, Link Length {3}", SelectionStart, SelectionLength, ll.Start, ll.Length);
SelectionStart = ll.Start - 7;
}
}
}
else if (SelectionStart + SelectionLength > ll.End) // Beyond the end of the starting link