Improve fuzzy search
This commit is contained in:
@@ -1065,6 +1065,7 @@ void Command_ListCode(String dir = WorkDir) {
|
|||||||
JumpGarbageBuffer(&main);
|
JumpGarbageBuffer(&main);
|
||||||
ListFilesRecursive(main.buffer, dir);
|
ListFilesRecursive(main.buffer, dir);
|
||||||
main.view->fuzzy_search = true;
|
main.view->fuzzy_search = true;
|
||||||
|
main.view->update_scroll = true;
|
||||||
Command_SelectRangeOneCursor(main.view, GetEndAsRange(main.buffer));
|
Command_SelectRangeOneCursor(main.view, GetEndAsRange(main.buffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -623,6 +623,10 @@ void OnCommand(Event event) {
|
|||||||
Range range = active.view->carets[0].range;
|
Range range = active.view->carets[0].range;
|
||||||
if (GetSize(range) == 0) {
|
if (GetSize(range) == 0) {
|
||||||
Int line = PosToLine(active.buffer, range.min);
|
Int line = PosToLine(active.buffer, range.min);
|
||||||
|
if ((active.buffer->line_starts.len - 1) == line) {
|
||||||
|
line = ClampBottom(0ll, line - 1ll);
|
||||||
|
}
|
||||||
|
|
||||||
String16 string = GetLineStringWithoutNL(active.buffer, line);
|
String16 string = GetLineStringWithoutNL(active.buffer, line);
|
||||||
Int idx = 0;
|
Int idx = 0;
|
||||||
if (Seek(string, u"||", &idx)) {
|
if (Seek(string, u"||", &idx)) {
|
||||||
|
|||||||
@@ -416,6 +416,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReportConsolef("WorkDir = %.*s\n", FmtString(WorkDir));
|
||||||
InitLuaConfig();
|
InitLuaConfig();
|
||||||
if (testing) InitTests();
|
if (testing) InitTests();
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
|
|||||||
Reference in New Issue
Block a user