Shift selects on last/first line
This commit is contained in:
@@ -293,8 +293,12 @@ Caret MoveCaret(Buffer *buffer, Caret it, int direction, bool ctrl = false, bool
|
||||
Int pos = GetPrevEmptyLineStart(buffer, it.range.min);
|
||||
it = MakeCaret(pos);
|
||||
} else if (shift) {
|
||||
Int pos = OffsetByLine(buffer, front, -1);
|
||||
it = SetFront(it, pos);
|
||||
if (PosToLine(buffer, front) == 0) {
|
||||
it = SetFront(it, 0);
|
||||
} else {
|
||||
Int pos = OffsetByLine(buffer, front, -1);
|
||||
it = SetFront(it, pos);
|
||||
}
|
||||
} else {
|
||||
if (range_size == 0) {
|
||||
Int pos = OffsetByLine(buffer, it.range.min, -1);
|
||||
@@ -312,8 +316,12 @@ Caret MoveCaret(Buffer *buffer, Caret it, int direction, bool ctrl = false, bool
|
||||
Int pos = GetNextEmptyLineStart(buffer, it.range.max);
|
||||
it = MakeCaret(pos);
|
||||
} else if (shift) {
|
||||
Int pos = OffsetByLine(buffer, front, 1);
|
||||
it = SetFront(it, pos);
|
||||
if (LastLine(buffer) == PosToLine(buffer, front)) {
|
||||
it = SetFront(it, buffer->len);
|
||||
} else {
|
||||
Int pos = OffsetByLine(buffer, front, 1);
|
||||
it = SetFront(it, pos);
|
||||
}
|
||||
} else {
|
||||
if (range_size == 0) {
|
||||
Int pos = OffsetByLine(buffer, it.range.max, 1);
|
||||
|
||||
@@ -62,4 +62,4 @@ activate_buffer
|
||||
|
||||
|
||||
|
||||
!!As little lua code as possible, but lua code should be powerful just in case of quick edits
|
||||
!!As little lua code as possible, but lua code should be powerful just in case of quick edits
|
||||
Reference in New Issue
Block a user