parent
0de4fc75d0
commit
56a7c6e594
|
@ -247,6 +247,10 @@ Selection select_number(const Buffer& buffer, const Selection& selection, Object
|
||||||
|
|
||||||
BufferIterator first = buffer.iterator_at(selection.cursor());
|
BufferIterator first = buffer.iterator_at(selection.cursor());
|
||||||
BufferIterator last = first;
|
BufferIterator last = first;
|
||||||
|
|
||||||
|
if (not is_number(*first) and *first != '-')
|
||||||
|
return selection;
|
||||||
|
|
||||||
if (flags & ObjectFlags::ToBegin)
|
if (flags & ObjectFlags::ToBegin)
|
||||||
{
|
{
|
||||||
skip_while_reverse(first, buffer.begin(), is_number);
|
skip_while_reverse(first, buffer.begin(), is_number);
|
||||||
|
@ -257,7 +261,10 @@ Selection select_number(const Buffer& buffer, const Selection& selection, Object
|
||||||
|
|
||||||
if (flags & ObjectFlags::ToEnd)
|
if (flags & ObjectFlags::ToEnd)
|
||||||
{
|
{
|
||||||
|
if (*last == '-')
|
||||||
|
++last;
|
||||||
skip_while(last, buffer.end(), is_number);
|
skip_while(last, buffer.end(), is_number);
|
||||||
|
if (last != buffer.begin())
|
||||||
--last;
|
--last;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user