Re-applied the fix for bug 8835 (REGRESSION: Line moves but selection