mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Ignore caret’s “desired X” in positionForWindowUnderCaret:
For example if at column 60 on a line and moving up/down to a shorter line, we remember that column 60 is our desired column position. This would previously be used when returning a position for the caret, e.g. used with clipboard history pop-ups and bundle item disambiguation menus.
This commit is contained in:
@@ -2023,8 +2023,8 @@ static void update_menu_key_equivalents (NSMenu* menu, action_to_key_t const& ac
|
||||
|
||||
- (NSPoint)positionForWindowUnderCaret
|
||||
{
|
||||
CGRect r1 = layout->rect_at_index(editor->ranges().last().first);
|
||||
CGRect r2 = layout->rect_at_index(editor->ranges().last().last);
|
||||
CGRect r1 = layout->rect_at_index(editor->ranges().last().normalized().first);
|
||||
CGRect r2 = layout->rect_at_index(editor->ranges().last().normalized().last);
|
||||
CGRect r = r1.origin.y == r2.origin.y && r1.origin.x < r2.origin.x ? r1 : r2;
|
||||
NSPoint p = NSMakePoint(CGRectGetMinX(r), CGRectGetMaxY(r)+4);
|
||||
if(NSPointInRect(p, [self visibleRect]))
|
||||
|
||||
Reference in New Issue
Block a user