Remove non-implemented feature
This commit is contained in:
@@ -88,12 +88,6 @@ void ToggleConsole() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct GotoCrumb {
|
|
||||||
BufferID buffer_id;
|
|
||||||
Caret caret;
|
|
||||||
};
|
|
||||||
Array<GotoCrumb> GotoCrumbs;
|
|
||||||
|
|
||||||
void CheckpointBeforeGoto() {
|
void CheckpointBeforeGoto() {
|
||||||
Window *window = GetWindow(GetLastActiveWindow());
|
Window *window = GetWindow(GetLastActiveWindow());
|
||||||
View *view = GetView(window->active_view);
|
View *view = GetView(window->active_view);
|
||||||
|
|||||||
@@ -140,8 +140,8 @@ int LuaOpenBigBuffer(lua_State *L) {
|
|||||||
// @todo: ViewOpenBuffer - new or old view for specified buffer
|
// @todo: ViewOpenBuffer - new or old view for specified buffer
|
||||||
Buffer *buffer = CreateBuffer(GetSystemAllocator(), "big", 2500000 * 4);
|
Buffer *buffer = CreateBuffer(GetSystemAllocator(), "big", 2500000 * 4);
|
||||||
LoadBigTextAndBigLine(buffer);
|
LoadBigTextAndBigLine(buffer);
|
||||||
View *view = CreateView(buffer->id);
|
View *view = CreateView(buffer->id);
|
||||||
SetActiveView(window, view->id);
|
window->active_view = view->id;
|
||||||
|
|
||||||
SetActiveWindow(window->id);
|
SetActiveWindow(window->id);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -20,9 +20,10 @@ WindowID ConsoleWindowID;
|
|||||||
// Remember that WindowCommand works on window handed it down from HandleEvent
|
// Remember that WindowCommand works on window handed it down from HandleEvent
|
||||||
// just because we don't have NextActiveWindow doesn't mean that we work on new
|
// just because we don't have NextActiveWindow doesn't mean that we work on new
|
||||||
// window all of a sudden in that function call!
|
// window all of a sudden in that function call!
|
||||||
WindowID ActiveWindow;
|
WindowID ActiveWindow;
|
||||||
Array<WindowID> WindowSwitchHistory; // @todo: probably better as a circular buffer
|
Array<WindowID> WindowSwitchHistory; // @todo: probably better as a circular buffer
|
||||||
Int CaretChangeID;
|
Array<GotoCrumb> GotoCrumbs;
|
||||||
|
Int CaretChangeID;
|
||||||
|
|
||||||
Window *ScrollbarSelected = NULL;
|
Window *ScrollbarSelected = NULL;
|
||||||
Window *DocumentSelected = NULL;
|
Window *DocumentSelected = NULL;
|
||||||
@@ -126,11 +127,6 @@ void SetActiveWindow(WindowID window) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetActiveView(Window *window, ViewID view_id) {
|
|
||||||
window->active_view = view_id;
|
|
||||||
Add(&window->view_history, view_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
Window *GetWindowWithView(ViewID view_id) {
|
Window *GetWindowWithView(ViewID view_id) {
|
||||||
ForItem(window, Windows) {
|
ForItem(window, Windows) {
|
||||||
if (window.active_view.id == view_id.id) {
|
if (window.active_view.id == view_id.id) {
|
||||||
@@ -258,14 +254,14 @@ View *WindowOpenBufferView(Window *new_parent_window, String name) {
|
|||||||
|
|
||||||
View *view = FindViewWithBufferName(name);
|
View *view = FindViewWithBufferName(name);
|
||||||
if (!view) {
|
if (!view) {
|
||||||
View *result = OpenBufferView(name);
|
View *result = OpenBufferView(name);
|
||||||
SetActiveView(new_parent_window, result->id);
|
new_parent_window->active_view = result->id;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Window *window = GetWindowWithView(view->id);
|
Window *window = GetWindowWithView(view->id);
|
||||||
if (!window) {
|
if (!window) {
|
||||||
SetActiveView(new_parent_window, view->id);
|
new_parent_window->active_view = view->id;
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
if (window == new_parent_window) {
|
if (window == new_parent_window) {
|
||||||
|
|||||||
@@ -59,9 +59,8 @@ struct View {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct Window {
|
struct Window {
|
||||||
WindowID id;
|
WindowID id;
|
||||||
ViewID active_view;
|
ViewID active_view;
|
||||||
CircularArray<ViewID> view_history; // @todo: use this
|
|
||||||
|
|
||||||
WindowID title_bar_window;
|
WindowID title_bar_window;
|
||||||
Int title_bar_last_buffer_change_id;
|
Int title_bar_last_buffer_change_id;
|
||||||
@@ -96,6 +95,11 @@ struct Scroller {
|
|||||||
Int line_count;
|
Int line_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct GotoCrumb {
|
||||||
|
BufferID buffer_id;
|
||||||
|
Caret caret;
|
||||||
|
};
|
||||||
|
|
||||||
// @WARNING: be careful about using this, should only be used for debugging
|
// @WARNING: be careful about using this, should only be used for debugging
|
||||||
// the problem with this is that we want events to be reproducible.
|
// the problem with this is that we want events to be reproducible.
|
||||||
// We eat as many events as we can in a frame, we abstract the frame and so on.
|
// We eat as many events as we can in a frame, we abstract the frame and so on.
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ Window *CreateInfobar(Window *parent_window) {
|
|||||||
Buffer *b = CreateBuffer(sys_allocator, name);
|
Buffer *b = CreateBuffer(sys_allocator, name);
|
||||||
View *v = CreateView(b->id);
|
View *v = CreateView(b->id);
|
||||||
window->active_view = v->id;
|
window->active_view = v->id;
|
||||||
SetActiveView(window, v->id);
|
|
||||||
|
|
||||||
parent_window->title_bar_window = window->id;
|
parent_window->title_bar_window = window->id;
|
||||||
window->title_bar_window = parent_window->id;
|
window->title_bar_window = parent_window->id;
|
||||||
@@ -71,10 +70,10 @@ Int GetTitleBarSize(Window *window) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AddColumnWindow() {
|
void AddColumnWindow() {
|
||||||
Window *window = CreateWindow();
|
Window *window = CreateWindow();
|
||||||
window->is_column = true;
|
window->is_column = true;
|
||||||
View *view = OpenBufferView("*scratch*");
|
View *view = OpenBufferView("*scratch*");
|
||||||
SetActiveView(window, view->id);
|
window->active_view = view->id;
|
||||||
CreateInfobar(window);
|
CreateInfobar(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,8 +81,8 @@ void AddRowWindow() {
|
|||||||
Window *window = CreateWindow();
|
Window *window = CreateWindow();
|
||||||
WindowID window_id = window->id;
|
WindowID window_id = window->id;
|
||||||
|
|
||||||
View *view = OpenBufferView("*scratch*");
|
View *view = OpenBufferView("*scratch*");
|
||||||
SetActiveView(window, view->id);
|
window->active_view = view->id;
|
||||||
CreateInfobar(window);
|
CreateInfobar(window);
|
||||||
|
|
||||||
Window *active_window = GetActiveWindow();
|
Window *active_window = GetActiveWindow();
|
||||||
@@ -123,7 +122,6 @@ void InitWindows(View *null_view) {
|
|||||||
LoadUnicode(buffer);
|
LoadUnicode(buffer);
|
||||||
// LoadBigTextAndBigLine(buffer, 10000000);
|
// LoadBigTextAndBigLine(buffer, 10000000);
|
||||||
window->active_view = view->id;
|
window->active_view = view->id;
|
||||||
SetActiveView(window, view->id);
|
|
||||||
CreateInfobar(window);
|
CreateInfobar(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,8 +132,9 @@ void InitWindows(View *null_view) {
|
|||||||
|
|
||||||
Buffer *buffer = CreateBuffer(sys_allocator, "*console*");
|
Buffer *buffer = CreateBuffer(sys_allocator, "*console*");
|
||||||
// buffer->no_history = true;
|
// buffer->no_history = true;
|
||||||
View *view = CreateView(buffer->id);
|
View *view = CreateView(buffer->id);
|
||||||
SetActiveView(window, view->id);
|
window->active_view = view->id;
|
||||||
|
|
||||||
CreateInfobar(window);
|
CreateInfobar(window);
|
||||||
SetVisibility(window, false);
|
SetVisibility(window, false);
|
||||||
|
|
||||||
@@ -153,11 +152,10 @@ void InitWindows(View *null_view) {
|
|||||||
window->visible = false;
|
window->visible = false;
|
||||||
buffer->no_history = true;
|
buffer->no_history = true;
|
||||||
View *view = CreateView(buffer->id);
|
View *view = CreateView(buffer->id);
|
||||||
window->active_view = view->id;
|
|
||||||
window->z = 2;
|
window->z = 2;
|
||||||
SetActiveView(window, view->id);
|
window->active_view = view->id;
|
||||||
Window *titlebar = CreateInfobar(window);
|
Window *titlebar = CreateInfobar(window);
|
||||||
titlebar->z = 2;
|
titlebar->z = 2;
|
||||||
SetVisibility(window, false);
|
SetVisibility(window, false);
|
||||||
DebugWindowID = window->id;
|
DebugWindowID = window->id;
|
||||||
}
|
}
|
||||||
@@ -175,8 +173,8 @@ void InitWindows(View *null_view) {
|
|||||||
View *v = CreateView(b->id);
|
View *v = CreateView(b->id);
|
||||||
v->fuzzy_search = true;
|
v->fuzzy_search = true;
|
||||||
|
|
||||||
SetActiveView(w, v->id);
|
w->active_view = v->id;
|
||||||
w->z = 1;
|
w->z = 1;
|
||||||
|
|
||||||
Window *titlebar = CreateInfobar(w);
|
Window *titlebar = CreateInfobar(w);
|
||||||
titlebar->z = 1;
|
titlebar->z = 1;
|
||||||
@@ -196,7 +194,8 @@ void InitWindows(View *null_view) {
|
|||||||
w->deactivate_on_escape = true;
|
w->deactivate_on_escape = true;
|
||||||
Buffer *b = CreateBuffer(sys_allocator, "*search*");
|
Buffer *b = CreateBuffer(sys_allocator, "*search*");
|
||||||
View *v = CreateView(b->id);
|
View *v = CreateView(b->id);
|
||||||
SetActiveView(w, v->id);
|
w->active_view = v->id;
|
||||||
|
|
||||||
CreateInfobar(w);
|
CreateInfobar(w);
|
||||||
SetVisibility(w, false);
|
SetVisibility(w, false);
|
||||||
|
|
||||||
@@ -216,7 +215,8 @@ void InitWindows(View *null_view) {
|
|||||||
Buffer *b = CreateBuffer(sys_allocator, "*popup*");
|
Buffer *b = CreateBuffer(sys_allocator, "*popup*");
|
||||||
b->no_history = true;
|
b->no_history = true;
|
||||||
View *v = CreateView(b->id);
|
View *v = CreateView(b->id);
|
||||||
SetActiveView(w, v->id);
|
w->active_view = v->id;
|
||||||
|
|
||||||
Window *infobar = CreateInfobar(w);
|
Window *infobar = CreateInfobar(w);
|
||||||
infobar->z = 2;
|
infobar->z = 2;
|
||||||
SetVisibility(w, false);
|
SetVisibility(w, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user