Editor: clamp coordinates in select(BufferCoord)
This commit is contained in:
parent
0ba1ab04f0
commit
1388c0d540
|
@ -62,7 +62,7 @@ public:
|
||||||
void keep_selection(int index);
|
void keep_selection(int index);
|
||||||
void remove_selection(int index);
|
void remove_selection(int index);
|
||||||
void select(const BufferCoord& c, SelectMode mode = SelectMode::Replace)
|
void select(const BufferCoord& c, SelectMode mode = SelectMode::Replace)
|
||||||
{ select(Selection{ c, c }, mode); }
|
{ select(Selection{ buffer().clamp(c) }, mode); }
|
||||||
void select(const Selection& sel,
|
void select(const Selection& sel,
|
||||||
SelectMode mode = SelectMode::Replace);
|
SelectMode mode = SelectMode::Replace);
|
||||||
void select(const Selector& selector,
|
void select(const Selector& selector,
|
||||||
|
|
|
@ -56,6 +56,7 @@ using CaptureList = std::vector<String>;
|
||||||
// A selection is a Range, associated with a CaptureList
|
// A selection is a Range, associated with a CaptureList
|
||||||
struct Selection : public Range
|
struct Selection : public Range
|
||||||
{
|
{
|
||||||
|
explicit Selection(const BufferCoord& pos) : Range(pos,pos) {}
|
||||||
Selection(const BufferCoord& first, const BufferCoord& last,
|
Selection(const BufferCoord& first, const BufferCoord& last,
|
||||||
CaptureList captures = {})
|
CaptureList captures = {})
|
||||||
: Range(first, last), m_captures(std::move(captures)) {}
|
: Range(first, last), m_captures(std::move(captures)) {}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user