parent
cb2ff7eb5f
commit
ce2c0e54f4
|
@ -498,6 +498,10 @@ Selection selection_from_string(StringView desc)
|
|||
BufferCoord cursor{str_to_int({comma+1, dot_cursor}) - 1,
|
||||
str_to_int({dot_cursor+1, desc.end()}) - 1};
|
||||
|
||||
if (anchor.line < 0 or anchor.column < 0 or
|
||||
cursor.line < 0 or cursor.column < 0)
|
||||
throw runtime_error(format("coordinates must be >= 1: '{}'", desc));
|
||||
|
||||
return Selection{anchor, cursor};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user