Improve search
This commit is contained in:
@@ -309,6 +309,9 @@ bool GlobalCommand(Event event) {
|
|||||||
SetActiveWindow(GetLastActiveWindow());
|
SetActiveWindow(GetLastActiveWindow());
|
||||||
} else {
|
} else {
|
||||||
SetActiveWindow(search_window->id);
|
SetActiveWindow(search_window->id);
|
||||||
|
View *view = GetActiveView(search_window);
|
||||||
|
Command_SelectEntireBuffer(view);
|
||||||
|
Command_Replace(view, {});
|
||||||
}
|
}
|
||||||
run_window_command = false;
|
run_window_command = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,14 +237,6 @@ void ReplaceInfobarData() {
|
|||||||
ReplaceText(buffer, GetEndAsRange(*buffer), L"|");
|
ReplaceText(buffer, GetEndAsRange(*buffer), L"|");
|
||||||
}
|
}
|
||||||
|
|
||||||
// {
|
|
||||||
// Scratch scratch;
|
|
||||||
// uint64_t ms = SDL_GetTicks();
|
|
||||||
// double time = (double)ms / 1000.0;
|
|
||||||
// String string = Format(scratch, "%d %f %f", (int)FrameID, time, (time / (double)FrameID));
|
|
||||||
// DrawString(&MainFont, ToString16(scratch, string), {0, 0}, {255, 0, 0, 255});
|
|
||||||
// }
|
|
||||||
|
|
||||||
String s = Format(scratch, "line: %5lld col: %5lld name: %.*s wid: %d vid: %d bid: %d frame%lld", (long long)xy.line + 1ll, (long long)xy.col + 1ll, FmtString(name), (int)last_window->id.id, (int)last_view->id.id, (int)last_buffer->id.id, (long long)FrameID);
|
String s = Format(scratch, "line: %5lld col: %5lld name: %.*s wid: %d vid: %d bid: %d frame%lld", (long long)xy.line + 1ll, (long long)xy.col + 1ll, FmtString(name), (int)last_window->id.id, (int)last_view->id.id, (int)last_buffer->id.id, (long long)FrameID);
|
||||||
String16 string = ToString16(scratch, s);
|
String16 string = ToString16(scratch, s);
|
||||||
ReplaceText(buffer, replace_range, string);
|
ReplaceText(buffer, replace_range, string);
|
||||||
@@ -463,7 +455,7 @@ void WindowCommand(Event event, Window *window, View *view) {
|
|||||||
}
|
}
|
||||||
if (Alt(SDLK_RETURN)) {
|
if (Alt(SDLK_RETURN)) {
|
||||||
Command_SelectAll(seek_view, needle);
|
Command_SelectAll(seek_view, needle);
|
||||||
// SetActiveWindow(seek_window->id);
|
SetActiveWindow(seek_window->id);
|
||||||
} else if (Ctrl(SDLK_RETURN)) {
|
} else if (Ctrl(SDLK_RETURN)) {
|
||||||
Caret caret = FindInBuffer(seek_buffer, needle, seek_view->carets[0], true);
|
Caret caret = FindInBuffer(seek_buffer, needle, seek_view->carets[0], true);
|
||||||
Insert(&seek_view->carets, caret, 0);
|
Insert(&seek_view->carets, caret, 0);
|
||||||
|
|||||||
@@ -95,4 +95,6 @@ void AfterEdit(View *view, Array<Edit> edits);
|
|||||||
Scroller ComputeScrollerRect(Window *window);
|
Scroller ComputeScrollerRect(Window *window);
|
||||||
void Command_EvalLua(View *view, String16 string);
|
void Command_EvalLua(View *view, String16 string);
|
||||||
void MergeCarets(View *view, Range *mouse_selection_anchor = NULL);
|
void MergeCarets(View *view, Range *mouse_selection_anchor = NULL);
|
||||||
inline BufferID AllocBufferID();
|
inline BufferID AllocBufferID();
|
||||||
|
void Command_SelectEntireBuffer(View *view);
|
||||||
|
void Command_Replace(View *view, String16 string);
|
||||||
Reference in New Issue
Block a user