From 8a62263409f5d222ac0d0ccf7bf0e7e0261224a8 Mon Sep 17 00:00:00 2001 From: Neil Hodgson Date: Sat, 5 Nov 2016 20:32:17 +1100 Subject: Add options to choose between the locations of a position when there are multiple locations for one position. The main current use is to find the location at the end of a line or display line when the commonly used location is at the start of the next line. --- src/Editor.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/Editor.cxx') diff --git a/src/Editor.cxx b/src/Editor.cxx index 62bc60a09..6950ac66e 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -363,14 +363,14 @@ SelectionPosition Editor::ClampPositionIntoDocument(SelectionPosition sp) const } } -Point Editor::LocationFromPosition(SelectionPosition pos) { +Point Editor::LocationFromPosition(SelectionPosition pos, PointEnd pe) { RefreshStyleData(); AutoSurface surface(this); - return view.LocationFromPosition(surface, *this, pos, topLine, vs); + return view.LocationFromPosition(surface, *this, pos, topLine, vs, pe); } -Point Editor::LocationFromPosition(int pos) { - return LocationFromPosition(SelectionPosition(pos)); +Point Editor::LocationFromPosition(int pos, PointEnd pe) { + return LocationFromPosition(SelectionPosition(pos), pe); } int Editor::XFromPosition(int pos) { @@ -3150,6 +3150,12 @@ void Editor::ParaUpOrDown(int direction, Selection::selTypes selt) { } while (!cs.GetVisible(lineDoc)); } +Range Editor::RangeDisplayLine(int lineVisible) { + RefreshStyleData(); + AutoSurface surface(this); + return view.RangeDisplayLine(surface, *this, lineVisible, vs); +} + int Editor::StartEndDisplayLine(int pos, bool start) { RefreshStyleData(); AutoSurface surface(this); -- cgit v1.2.3