Reporting errors, set active to console
This commit is contained in:
@@ -177,6 +177,21 @@ void ReportErrorf(const char *fmt, ...) {
|
|||||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error!", string.data, NULL);
|
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error!", string.data, NULL);
|
||||||
View *view = GetView(NullViewID);
|
View *view = GetView(NullViewID);
|
||||||
Command_Append(view, string, true);
|
Command_Append(view, string, true);
|
||||||
|
|
||||||
|
// Set console view as active
|
||||||
|
{
|
||||||
|
Window *w = GetWindowWithView(NullViewID);
|
||||||
|
if (!w) {
|
||||||
|
BSet bset = GetActiveMainSet();
|
||||||
|
w = GetNextLayoutWindow(bset.window);
|
||||||
|
|
||||||
|
Buffer *b = GetBuffer(NullBufferID);
|
||||||
|
CheckpointBeforeGoto(w);
|
||||||
|
WindowOpenBufferView(w, b->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
ActiveWindow = w->id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportConsolef(const char *fmt, ...) {
|
void ReportConsolef(const char *fmt, ...) {
|
||||||
@@ -191,6 +206,21 @@ void ReportWarningf(const char *fmt, ...) {
|
|||||||
STRING_FORMAT(scratch, fmt, string);
|
STRING_FORMAT(scratch, fmt, string);
|
||||||
View *null_view = GetView(NullViewID);
|
View *null_view = GetView(NullViewID);
|
||||||
Command_Append(null_view, string, true);
|
Command_Append(null_view, string, true);
|
||||||
|
|
||||||
|
// Set console view as active
|
||||||
|
{
|
||||||
|
Window *w = GetWindowWithView(NullViewID);
|
||||||
|
if (!w) {
|
||||||
|
BSet bset = GetActiveMainSet();
|
||||||
|
w = GetNextLayoutWindow(bset.window);
|
||||||
|
|
||||||
|
Buffer *b = GetBuffer(NullBufferID);
|
||||||
|
CheckpointBeforeGoto(w);
|
||||||
|
WindowOpenBufferView(w, b->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
ActiveWindow = w->id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Command_MoveCursorsByPageSize(Window *window, int direction, bool shift = false) {
|
void Command_MoveCursorsByPageSize(Window *window, int direction, bool shift = false) {
|
||||||
|
|||||||
Reference in New Issue
Block a user