Small improvements
This commit is contained in:
@@ -43,7 +43,14 @@ void Command_MoveCursorsByPageSize(Window *window, int direction, bool shift = f
|
|||||||
|
|
||||||
For(view.carets) {
|
For(view.carets) {
|
||||||
XY xy = PosToXY(*buffer, GetFront(it));
|
XY xy = PosToXY(*buffer, GetFront(it));
|
||||||
|
if (direction == DIR_DOWN && xy.line == buffer->line_starts.len - 1) {
|
||||||
|
Range line_range = GetLineRange(*buffer, xy.line);
|
||||||
|
xy.col = line_range.max - line_range.min;
|
||||||
|
} else if (direction == DIR_UP && xy.line == 0) {
|
||||||
|
xy.col = 0;
|
||||||
|
}
|
||||||
xy.line += y;
|
xy.line += y;
|
||||||
|
|
||||||
Int pos = XYToPos(*buffer, xy);
|
Int pos = XYToPos(*buffer, xy);
|
||||||
if (shift) {
|
if (shift) {
|
||||||
it = ChangeFront(it, pos);
|
it = ChangeFront(it, pos);
|
||||||
@@ -552,9 +559,15 @@ void ReplaceInfobarData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Scratch scratch;
|
Scratch scratch;
|
||||||
String error = {};
|
String16 buffer_string = GetString(*buffer);
|
||||||
|
|
||||||
|
Range replace_range = {0, buffer->len};
|
||||||
|
if (!Seek(buffer_string, L"|", &replace_range.max)) {
|
||||||
|
ReplaceText(buffer, GetEndAsRange(*buffer), L"|");
|
||||||
|
}
|
||||||
|
|
||||||
String s = Format(scratch, "line: %5lld col: %5lld name: %.*s", (long long)xy.line + 1ll, (long long)xy.col + 1ll, FmtString(name));
|
String s = Format(scratch, "line: %5lld col: %5lld name: %.*s", (long long)xy.line + 1ll, (long long)xy.col + 1ll, FmtString(name));
|
||||||
String16 string = ToString16(scratch, s);
|
String16 string = ToString16(scratch, s);
|
||||||
ReplaceText(buffer, {0, buffer->len}, string);
|
ReplaceText(buffer, replace_range, string);
|
||||||
Command_SelectRangeOneCursor(view, {});
|
Command_SelectRangeOneCursor(view, {});
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,6 @@
|
|||||||
#include "lua_api.cpp"
|
#include "lua_api.cpp"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
- fix pathing in open, make it predictable
|
|
||||||
- update info bar until '|' if tghere is no sign delete whole
|
- update info bar until '|' if tghere is no sign delete whole
|
||||||
|
|
||||||
- Save file (utf16->utf8)
|
- Save file (utf16->utf8)
|
||||||
|
|||||||
Reference in New Issue
Block a user