struct Theme_Color {
Style_Tag tag;
diff --git a/4coder_custom_api.h b/4coder_custom_api.h
index a6ed9295..45c7282e 100644
--- a/4coder_custom_api.h
+++ b/4coder_custom_api.h
@@ -19,6 +19,8 @@
#define GET_VIEW_NEXT_SIG(n) void n(Application_Links *app, View_Summary *view, Access_Flag access)
#define GET_VIEW_SIG(n) View_Summary n(Application_Links *app, View_ID view_id, Access_Flag access)
#define GET_ACTIVE_VIEW_SIG(n) View_Summary n(Application_Links *app, Access_Flag access)
+#define OPEN_VIEW_SIG(n) View_Summary n(Application_Links *app, View_Summary *view_location, View_Split_Position position)
+#define CLOSE_VIEW_SIG(n) bool32 n(Application_Links *app, View_Summary *view)
#define SET_ACTIVE_VIEW_SIG(n) bool32 n(Application_Links *app, View_Summary *view)
#define VIEW_SET_SETTING_SIG(n) bool32 n(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t value)
#define VIEW_SET_SPLIT_PROPORTION_SIG(n) bool32 n(Application_Links *app, View_Summary *view, float t)
@@ -67,6 +69,8 @@ extern "C"{
typedef GET_VIEW_NEXT_SIG(Get_View_Next_Function);
typedef GET_VIEW_SIG(Get_View_Function);
typedef GET_ACTIVE_VIEW_SIG(Get_Active_View_Function);
+ typedef OPEN_VIEW_SIG(Open_View_Function);
+ typedef CLOSE_VIEW_SIG(Close_View_Function);
typedef SET_ACTIVE_VIEW_SIG(Set_Active_View_Function);
typedef VIEW_SET_SETTING_SIG(View_Set_Setting_Function);
typedef VIEW_SET_SPLIT_PROPORTION_SIG(View_Set_Split_Proportion_Function);
@@ -118,6 +122,8 @@ struct Application_Links{
Get_View_Next_Function *get_view_next;
Get_View_Function *get_view;
Get_Active_View_Function *get_active_view;
+ Open_View_Function *open_view;
+ Close_View_Function *close_view;
Set_Active_View_Function *set_active_view;
View_Set_Setting_Function *view_set_setting;
View_Set_Split_Proportion_Function *view_set_split_proportion;
@@ -171,6 +177,8 @@ app_links->get_view_first = Get_View_First;\
app_links->get_view_next = Get_View_Next;\
app_links->get_view = Get_View;\
app_links->get_active_view = Get_Active_View;\
+app_links->open_view = Open_View;\
+app_links->close_view = Close_View;\
app_links->set_active_view = Set_Active_View;\
app_links->view_set_setting = View_Set_Setting;\
app_links->view_set_split_proportion = View_Set_Split_Proportion;\
diff --git a/4coder_default_bindings.cpp b/4coder_default_bindings.cpp
index b7b1672f..e5df52ac 100644
--- a/4coder_default_bindings.cpp
+++ b/4coder_default_bindings.cpp
@@ -125,9 +125,9 @@ CUSTOM_COMMAND_SIG(seek_whitespace_down_end_line){
}
HOOK_SIG(my_start){
- exec_command(app, cmdid_open_panel_vsplit);
+ exec_command(app, open_panel_vsplit);
exec_command(app, hide_scrollbar);
- exec_command(app, cmdid_change_active_panel);
+ exec_command(app, change_active_panel);
exec_command(app, hide_scrollbar);
app->change_theme(app, literal("4coder"));
@@ -246,9 +246,9 @@ void
default_keys(Bind_Helper *context){
begin_map(context, mapid_global);
- bind(context, 'p', MDFR_CTRL, cmdid_open_panel_vsplit);
- bind(context, '_', MDFR_CTRL, cmdid_open_panel_hsplit);
- bind(context, 'P', MDFR_CTRL, cmdid_close_panel);
+ bind(context, 'p', MDFR_CTRL, open_panel_vsplit);
+ bind(context, '_', MDFR_CTRL, open_panel_hsplit);
+ bind(context, 'P', MDFR_CTRL, close_panel);
bind(context, 'n', MDFR_CTRL, cmdid_interactive_new);
bind(context, 'o', MDFR_CTRL, cmdid_interactive_open);
bind(context, ',', MDFR_CTRL, change_active_panel);
@@ -298,7 +298,7 @@ default_keys(Bind_Helper *context){
bind(context, '=', MDFR_CTRL, write_increment);
bind(context, 't', MDFR_ALT, write_allen_todo);
bind(context, 'y', MDFR_ALT, write_allen_note);
- bind(context, 'r', MDFR_ALT, write_allen_note);
+ bind(context, 'r', MDFR_ALT, write_allen_doc);
bind(context, '[', MDFR_CTRL, open_long_braces);
bind(context, '{', MDFR_CTRL, open_long_braces_semicolon);
bind(context, '}', MDFR_CTRL, open_long_braces_break);
diff --git a/4coder_default_include.cpp b/4coder_default_include.cpp
index 78d46f42..666f3058 100644
--- a/4coder_default_include.cpp
+++ b/4coder_default_include.cpp
@@ -857,7 +857,54 @@ CUSTOM_COMMAND_SIG(hide_scrollbar){
}
//
+// Panel Management
//
+
+CUSTOM_COMMAND_SIG(change_active_panel_regular){
+ View_Summary view = app->get_active_view(app, AccessAll);
+ app->get_view_next(app, &view, AccessAll);
+ if (!view.exists){
+ view = app->get_view_first(app, AccessAll);
+ }
+ if (view.exists){
+ app->set_active_view(app, &view);
+ }
+}
+
+// TODO(allen): This is a bit nasty. I want a system for picking
+// the most advanced and correct version of a command to bind to a
+// name based on which files are included.
+#ifndef CHANGE_ACTIVE_PANEL
+# define CHANGE_ACTIVE_PANEL 1
+#elif CHANGE_ACTIVE_PANEL <= 1
+# undef CHANGE_ACTIVE_PANEL
+# define CHANGE_ACTIVE_PANEL 1
+#endif
+
+#if CHANGE_ACTIVE_PANEL <= 1
+# ifdef change_active_panel
+# undef change_active_panel
+# endif
+# define change_active_panel change_active_panel_regular
+#endif
+
+CUSTOM_COMMAND_SIG(close_panel){
+ View_Summary view = app->get_active_view(app, AccessAll);
+ app->close_view(app, &view);
+}
+
+CUSTOM_COMMAND_SIG(open_panel_vsplit){
+ View_Summary view = app->get_active_view(app, AccessAll);
+ app->open_view(app, &view, ViewSplit_Right);
+}
+
+CUSTOM_COMMAND_SIG(open_panel_hsplit){
+ View_Summary view = app->get_active_view(app, AccessAll);
+ app->open_view(app, &view, ViewSplit_Bottom);
+}
+
+//
+// Open File In Quotes
//
static int
@@ -898,7 +945,7 @@ CUSTOM_COMMAND_SIG(open_file_in_quotes_regular){
String file_name = make_fixed_width_string(file_name_);
if (file_name_in_quotes(app, &file_name)){
- exec_command(app, cmdid_change_active_panel);
+ exec_command(app, change_active_panel_regular);
View_Summary view = app->get_active_view(app, AccessAll);
view_open_file(app, &view, expand_str(file_name), false);
}
@@ -1296,7 +1343,7 @@ CUSTOM_COMMAND_SIG(execute_previous_cli){
}
CUSTOM_COMMAND_SIG(open_in_other_regular){
- exec_command(app, cmdid_change_active_panel);
+ exec_command(app, change_active_panel_regular);
exec_command(app, cmdid_interactive_open);
}
@@ -1494,28 +1541,6 @@ CUSTOM_COMMAND_SIG(build_search_regular){
#endif
-CUSTOM_COMMAND_SIG(change_active_panel_regular){
- exec_command(app, cmdid_change_active_panel);
-}
-
-// TODO(allen): This is a bit nasty. I want a system for picking
-// the most advanced and correct version of a command to bind to a
-// name based on which files are included.
-#ifndef CHANGE_ACTIVE_PANEL
-# define CHANGE_ACTIVE_PANEL 1
-#elif CHANGE_ACTIVE_PANEL <= 1
-# undef CHANGE_ACTIVE_PANEL
-# define CHANGE_ACTIVE_PANEL 1
-#endif
-
-#if CHANGE_ACTIVE_PANEL <= 1
-# ifdef change_active_panel
-# undef change_active_panel
-# endif
-# define change_active_panel change_active_panel_regular
-#endif
-
-
//
// Common Settings Commands
//
@@ -1530,6 +1555,7 @@ CUSTOM_COMMAND_SIG(toggle_line_wrap){
}
app->view_set_setting(app, &view, ViewSetting_WrapLine, unwrapped);
+ app->buffer_set_setting(app, &buffer, BufferSetting_WrapLine, unwrapped);
}
CUSTOM_COMMAND_SIG(toggle_show_whitespace){
diff --git a/4coder_types.h b/4coder_types.h
index 82033f2d..2aa85ca0 100644
--- a/4coder_types.h
+++ b/4coder_types.h
@@ -72,23 +72,9 @@ ENUM(uint64_t, Command_ID){
/* DOC(cmdid_to_uppercase makes all the alphabetic characters in the cursor/mark range lowercase.) */
cmdid_to_lowercase,
-#if 0
- /* DOC(cmdid_toggle_line_wrap toggles the line wrap setting of the active view. ) */
- cmdid_toggle_line_wrap,
- /* DOC(cmdid_toggle_line_wrap toggles the show whitespace setting of the active view.) */
- cmdid_toggle_show_whitespace,
-#endif
-
/* DOC(cmdid_clean_all_lines deletes extra whitespace out the currently active buffer.) */
cmdid_clean_all_lines,
-#if 0
- /* DOC(cmdid_eol_dosify sets the currently active buffer to dos save mode where the end of a line is "\r\n") */
- cmdid_eol_dosify,
- /* DOC(cmdid_eol_nixify sets the currently active buffer to nix save mode where the end of a line is "\n") */
- cmdid_eol_nixify,
-#endif
-
/* DOC(cmdid_interactive_new begins an interactive dialogue to create a new buffer.) */
cmdid_interactive_new,
/* DOC(cmdid_interactive_open begins an interactive dialogue to open a file into a buffer.) */
@@ -115,15 +101,15 @@ ENUM(uint64_t, Command_ID){
/* DOC(cmdid_open_debug opens the debug information viewer mode.) */
cmdid_open_debug,
+#if 0
/* DOC(cmdid_open_panel_vsplit splits the current panel into two with a vertical divider.) */
cmdid_open_panel_vsplit,
/* DOC(cmdid_open_panel_hsplit splits the current panel into two with a horizontal divider.) */
cmdid_open_panel_hsplit,
/* DOC(cmdid_close_panel closes the active panel.) */
cmdid_close_panel,
- /* DOC(cmdid_change_active_panel cycles to the next open panel.) */
- cmdid_change_active_panel,
-
+#endif
+
// count
cmdid_count
};
@@ -325,6 +311,19 @@ ENUM(int32_t, Buffer_Seek_Type){
buffer_seek_line_char
};
+/* DOC(A View_Split_Position specifies where a new view should be placed as a result of
+a view split operation.) */
+ENUM(int32_t, View_Split_Position){
+ /* DOC(This value indicates that the new view should be above the existing view.) */
+ ViewSplit_Top,
+ /* DOC(This value indicates that the new view should be below the existing view.) */
+ ViewSplit_Bottom,
+ /* DOC(This value indicates that the new view should be left of the existing view.) */
+ ViewSplit_Left,
+ /* DOC(This value indicates that the new view should be right of the existing view.) */
+ ViewSplit_Right
+};
+
/* DOC(
Generic_Command acts as a name for a command, and can name an
internal command or a custom command.
diff --git a/4ed.cpp b/4ed.cpp
index 272b3221..c2fe5976 100644
--- a/4ed.cpp
+++ b/4ed.cpp
@@ -659,14 +659,6 @@ COMMAND_DECL(toggle_line_wrap){
view_set_relative_scrolling(view, scrolling);
}
-#if 0
-COMMAND_DECL(toggle_show_whitespace){
- REQ_READABLE_VIEW(view);
-
- view->file_data.show_whitespace = !view->file_data.show_whitespace;
-}
-#endif
-
COMMAND_DECL(toggle_tokens){
#if BUFFER_EXPERIMENT_SCALPEL <= 0
USE_MODELS(models);
@@ -737,24 +729,6 @@ COMMAND_DECL(clean_all_lines){
view_clean_whitespace(system, models, view);
}
-#if 0
-COMMAND_DECL(eol_dosify){
- REQ_READABLE_VIEW(view);
- REQ_FILE(file, view);
-
- file->settings.dos_write_mode = 1;
- file->state.last_4ed_edit_time = system->now_time_stamp();
-}
-
-COMMAND_DECL(eol_nixify){
- REQ_READABLE_VIEW(view);
- REQ_FILE(file, view);
-
- file->settings.dos_write_mode = 0;
- file->state.last_4ed_edit_time = system->now_time_stamp();
-}
-#endif
-
COMMAND_DECL(open_panel_vsplit){
USE_VARS(vars);
USE_MODELS(models);
@@ -1066,11 +1040,6 @@ setup_command_table(){
SET(clean_all_lines);
- SET(open_panel_vsplit);
- SET(open_panel_hsplit);
- SET(close_panel);
- SET(change_active_panel);
-
SET(open_color_tweaker);
SET(open_config);
SET(open_menu);
diff --git a/4ed_api_implementation.cpp b/4ed_api_implementation.cpp
index 57abcd59..c2a37000 100644
--- a/4ed_api_implementation.cpp
+++ b/4ed_api_implementation.cpp
@@ -453,11 +453,11 @@ DOC_SEE(get_buffer_next)
API_EXPORT void
Get_Buffer_Next(Application_Links *app, Buffer_Summary *buffer, Access_Flag access)/*
-DOC_PARAM(buffer, The buffer summary pointed to by buffer is iterated to the next buffer or to a null summary if this is the last buffer. )
+DOC_PARAM(buffer, The Buffer_Summary pointed to by buffer is iterated to the next buffer or to a null summary if this is the last buffer.)
DOC_PARAM(access, The access parameter determines what levels of protection this call can access. The buffer outputted will be the next buffer that is accessible.)
DOC
(
-This call steps a buffer summary to the next buffer in the global buffer order.
+This call steps a Buffer_Summary to the next buffer in the global buffer order.
The global buffer order is kept roughly in the order of most recently used to least recently used.
If the buffer outputted does not exist, the loop is finished.
@@ -830,7 +830,7 @@ DOC_RETURN(This call returns the summary of the created buffer.)
DOC
(
Tries to create a new buffer and associate it to the given filename. If such a buffer already
-exists the existing buffer is returned in the buffer summary and no new buffer is created.
+exists the existing buffer is returned in the Buffer_Summary and no new buffer is created.
If the buffer does not exist a new buffer is created and named after the given filename. If
the filename corresponds to a file on the disk that file is loaded and put into buffer, if
the filename does not correspond to a file on disk the buffer is created empty.
@@ -1021,7 +1021,7 @@ DOC
(
This call begins a loop across all the open views.
-If the view summary returned is a null summary, the loop is finished.
+If the View_Summary returned is a null summary, the loop is finished.
Views should not be closed or opened durring a view loop.
)
DOC_SEE(Access_Flag)
@@ -1040,11 +1040,11 @@ DOC_SEE(get_view_next)
API_EXPORT void
Get_View_Next(Application_Links *app, View_Summary *view, Access_Flag access)/*
-DOC_PARAM(view, pointer to the loop view originally returned by get_view_first)
+DOC_PARAM(view, The View_Summary pointed to by view is iterated to the next view or to a null summary if this is the last view.)
DOC_PARAM(access, The access parameter determines what levels of protection this call can access. The view outputted will be the next view that is accessible.)
DOC
(
-This call steps a view summary to the next view in the global view order.
+This call steps a View_Summary to the next view in the global view order.
If the view outputted does not exist, the loop is finished.
Views should not be closed or opened durring a view loop.
@@ -1101,6 +1101,164 @@ DOC_SEE(Access_Flag)
return(view);
}
+API_EXPORT View_Summary
+Open_View(Application_Links *app, View_Summary *view_location, View_Split_Position position)/*
+DOC_PARAM(view_location, The view_location parameter specifies the view to split to open the new view.)
+DOC_PARAM(position, The position parameter specifies how to split the view and where to place the new view.)
+DOC_RETURN(If this call succeeds it returns a View_Summary describing the newly created view, if it fails it
+returns a null summary.)
+DOC(4coder is built with a limit of 16 views. If 16 views are already open when this is called the
+call will fail.)
+DOC_SEE(View_Split_Position)
+*/{
+ Command_Data *cmd = (Command_Data*)app->cmd_context;
+ System_Functions *system = cmd->system;
+ Models *models = cmd->models;
+ View *vptr = imp_get_view(cmd, view_location);
+ Panel *panel = vptr->panel;
+ View_Summary result = {0};
+
+ if (models->layout.panel_count < models->layout.panel_max_count){
+ b32 vsplit = ((position == ViewSplit_Left) || (position == ViewSplit_Right));
+ b32 grtsplit = ((position == ViewSplit_Bottom) || (position == ViewSplit_Right));
+
+ Split_Result split = layout_split_panel(&models->layout, panel, vsplit);
+
+ Panel *grtpanel = split.panel;
+ Panel *lsrpanel = panel;
+
+ if (!grtsplit){
+ Swap(i32, panel->which_child, split.panel->which_child);
+ Swap(Panel*, grtpanel, lsrpanel);
+ }
+
+ split.panel->screen_region = panel->screen_region;
+ if (vsplit){
+ i32 x_pos = ROUND32(lerp((f32)lsrpanel->full.x0,
+ split.divider->pos,
+ (f32)lsrpanel->full.x1));
+
+ grtpanel->full.x0 = x_pos;
+ grtpanel->full.x1 = lsrpanel->full.x1;
+ lsrpanel->full.x1 = x_pos;
+ }
+ else{
+ i32 y_pos = ROUND32(lerp((f32)lsrpanel->full.y0,
+ split.divider->pos,
+ (f32)lsrpanel->full.y1));
+
+ grtpanel->full.y0 = y_pos;
+ grtpanel->full.y1 = lsrpanel->full.y1;
+ lsrpanel->full.y1 = y_pos;
+ }
+
+ panel_fix_internal_area(panel);
+ panel_fix_internal_area(split.panel);
+ split.panel->prev_inner = split.panel->inner;
+
+ models->layout.active_panel = (i32)(split.panel - models->layout.panels);
+ panel_make_empty(system, cmd->vars, split.panel);
+ }
+
+ update_command_data(cmd->vars, cmd);
+
+ return(result);
+}
+
+API_EXPORT bool32
+Close_View(Application_Links *app, View_Summary *view)/*
+DOC_PARAM(view, The view parameter specifies which view to close.)
+DOC_RETURN(This call returns non-zero on success.)
+DOC(
+If the given view is open and is not the last view, it will be closed.
+If the given view is the active view, the next active view in the global
+order of view will be made active.
+If the given view is the last open view in the system, the call will fail.
+)
+*/{
+ Command_Data *cmd = (Command_Data*)app->cmd_context;
+ System_Functions *system = cmd->system;
+ Models *models = cmd->models;
+ View *vptr = imp_get_view(cmd, view);
+ Panel *panel = vptr->panel;
+ bool32 result = false;
+
+ Divider_And_ID div, parent_div, child_div;
+ i32 child;
+ i32 parent;
+ i32 which_child;
+ i32 active;
+
+ if (models->layout.panel_count > 1){
+ live_set_free_view(system, models->live_set, vptr);
+ panel->view = 0;
+
+ div = layout_get_divider(&models->layout, panel->parent);
+
+ // This divider cannot have two child dividers.
+ Assert(div.divider->child1 == -1 || div.divider->child2 == -1);
+
+ // Get the child who needs to fill in this node's spot
+ child = div.divider->child1;
+ if (child == -1) child = div.divider->child2;
+
+ parent = div.divider->parent;
+ which_child = div.divider->which_child;
+
+ // Fill the child in the slot this node use to hold
+ if (parent == -1){
+ Assert(models->layout.root == div.id);
+ models->layout.root = child;
+ }
+ else{
+ parent_div = layout_get_divider(&models->layout, parent);
+ if (which_child == -1){
+ parent_div.divider->child1 = child;
+ }
+ else{
+ parent_div.divider->child2 = child;
+ }
+ }
+
+ // If there was a child divider, give it information about it's new parent.
+ if (child != -1){
+ child_div = layout_get_divider(&models->layout, child);
+ child_div.divider->parent = parent;
+ child_div.divider->which_child = div.divider->which_child;
+ }
+
+ // What is the new active panel?
+ active = -1;
+ if (child == -1){
+ Panel *panel_ptr = 0;
+ Panel *used_panels = &models->layout.used_sentinel;
+ for (dll_items(panel_ptr, used_panels)){
+ if (panel_ptr != panel && panel_ptr->parent == div.id){
+ panel_ptr->parent = parent;
+ panel_ptr->which_child = which_child;
+ active = (i32)(panel_ptr - models->layout.panels);
+ break;
+ }
+ }
+ }
+ else{
+ Panel *panel_ptr = panel->next;
+ if (panel_ptr == &models->layout.used_sentinel) panel_ptr = panel_ptr->next;
+ Assert(panel_ptr != panel);
+ active = (i32)(panel_ptr - models->layout.panels);
+ }
+
+ Assert(active != -1 && panel != models->layout.panels + active);
+ models->layout.active_panel = active;
+
+ layout_free_divider(&models->layout, div.divider);
+ layout_free_panel(&models->layout, panel);
+ layout_fix_all_panels(&models->layout);
+ }
+
+ return(result);
+}
+
API_EXPORT bool32
Set_Active_View(Application_Links *app, View_Summary *view)/*
DOC_PARAM(view, The view parameter specifies which view to make active.)
diff --git a/4ed_layout.cpp b/4ed_layout.cpp
index d8776f39..3b5463b6 100644
--- a/4ed_layout.cpp
+++ b/4ed_layout.cpp
@@ -188,25 +188,22 @@ layout_split_panel(Editing_Layout *layout, Panel *panel, b32 vertical){
div.divider->which_child = panel->which_child;
if (vertical){
div.divider->v_divider = 1;
- //div.divider->pos = (panel->full.x0 + panel->full.x1) / 2;
- div.divider->pos = 0.5f;
}
else{
div.divider->v_divider = 0;
- //div.divider->pos = (panel->full.y0 + panel->full.y1) / 2;
- div.divider->pos = 0.5f;
}
-
+ div.divider->pos = 0.5f;
+
new_panel = layout_alloc_panel(layout);
panel->parent = div.id;
panel->which_child = -1;
new_panel.panel->parent = div.id;
new_panel.panel->which_child = 1;
-
+
result.divider = div.divider;
result.panel = new_panel.panel;
- return result;
+ return(result);
}
internal void
diff --git a/README.txt b/README.txt
index 9ab48f1b..8189b338 100644
--- a/README.txt
+++ b/README.txt
@@ -1,4 +1,4 @@
-Distribution Date: 3.7.2016 (dd.mm.yyyy)
+Distribution Date: 4.7.2016 (dd.mm.yyyy)
Thank you for contributing to the 4coder project!
diff --git a/SUPERREADME.txt b/SUPERREADME.txt
index ce004739..d31dd804 100644
--- a/SUPERREADME.txt
+++ b/SUPERREADME.txt
@@ -1,4 +1,4 @@
-Distribution Date: 3.7.2016 (dd.mm.yyyy)
+Distribution Date: 4.7.2016 (dd.mm.yyyy)
Thank you for contributing to the 4coder project!
diff --git a/TODO.txt b/TODO.txt
index bf123c30..c53e3b61 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -104,6 +104,7 @@
; [] generate documentation for custom API
; [] OS font rendering
; [] support full length unicode file names
+; [] switch based word complete
;
; [] file status in custom API
; [] user file bar string
diff --git a/power/4coder_default_building.cpp b/power/4coder_default_building.cpp
index 0f3113a0..641e8570 100644
--- a/power/4coder_default_building.cpp
+++ b/power/4coder_default_building.cpp
@@ -35,7 +35,7 @@ CUSTOM_COMMAND_SIG(build_in_build_panel){
}
if (!build_view.exists){
- exec_command(app, cmdid_open_panel_hsplit);
+ exec_command(app, open_panel_hsplit);
exec_command(app, hide_scrollbar);
build_view = app->get_active_view(app, AccessAll);
app->view_set_split_proportion(app, &build_view, .2f);
@@ -69,13 +69,13 @@ CUSTOM_COMMAND_SIG(build_in_build_panel){
CUSTOM_COMMAND_SIG(close_build_panel){
Buffer_Summary buffer = GET_COMP_BUFFER();
+ View_Summary build_view = get_first_view_with_buffer(app, buffer.buffer_id);
- if (buffer.exists){
- View_Summary build_view = get_first_view_with_buffer(app, buffer.buffer_id);
+ if (build_view.exists){
View_Summary original_view = app->get_active_view(app, AccessAll);
app->set_active_view(app, &build_view);
- exec_command(app, cmdid_close_panel);
+ exec_command(app, close_panel);
app->set_active_view(app, &original_view);
}
}
@@ -99,18 +99,18 @@ CUSTOM_COMMAND_SIG(change_active_panel_build){
View_Summary view = app->get_active_view(app, AccessAll);
int prev_view_id = view.view_id;
- exec_command(app, cmdid_change_active_panel);
+ exec_command(app, change_active_panel_regular);
view = app->get_active_view(app, AccessAll);
for (;(view.view_id != prev_view_id &&
build_view.view_id == view.view_id);){
prev_view_id = view.view_id;
- exec_command(app, cmdid_change_active_panel);
+ exec_command(app, change_active_panel_regular);
view = app->get_active_view(app, AccessAll);
}
}
else{
- exec_command(app, cmdid_change_active_panel);
+ exec_command(app, change_active_panel_regular);
}
}