**Merge #2268 before this pull**
* Whilst compiling, enable the *Next/Prev Error* menu items only when the first error is found. Before it enabled them for any compiler tab messages. * The above has been handled in build.c rather than msgwindow.c, as it has more build-related information (and these menu items are already handled there). This allows the `GeanyBuildFixedMenuItems` enum to be moved to build.c, as it doesn't need to be exposed elsewhere - this change depends on #2268. * Once a build command is complete, `build_menu_update` is called - this pull makes that function only enable *Next/Prev Error* menu items when there actually were error lines. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2269
-- Commit Summary --
* build.h: Move GBO_TO_* macros to build.c * build.c: Only set next/prev error menu items sensitive on first error * Move GeanyBuildFixedMenuItems enum to build.c * build_menu_update: Only enable next/prev error items when errors found
-- File Changes --
M src/build.c (112) M src/build.h (42) M src/keybindings.c (58) M src/msgwindow.c (4)
-- Patch Links --
https://github.com/geany/geany/pull/2269.patch https://github.com/geany/geany/pull/2269.diff
@ntrel pushed 1 commit.
5eede24f5f14098783ff94107cb5f4e6646f7f93 Move GBG_FIXED and build_get_menu_items to build.c
elextr approved this pull request.
Fixing when the menu items are enabled is fine, but this PR also includes changes not relevant to that and I am not seeing where the actual fix is.
@@ -158,6 +158,9 @@ widgets;
static guint build_groups_count[GEANY_GBG_COUNT] = { 3, 4, 2 }; static guint build_items_count = 9;
+/* include the fixed widgets in an array indexed by groups */ +#define GBG_FIXED GEANY_GBG_COUNT
Would be better to define in the enum in the header, or if you don't want it in the enum at least next to it so all GBG_* declarations are in the same place.
@ntrel pushed 1 commit.
8dc5f7963ff0b4b830be3a41f9c3c5dffb1b8e03 Revert moving GBG_FIXED
ntrel commented on this pull request.
@@ -158,6 +158,9 @@ widgets;
static guint build_groups_count[GEANY_GBG_COUNT] = { 3, 4, 2 }; static guint build_items_count = 9;
+/* include the fixed widgets in an array indexed by groups */ +#define GBG_FIXED GEANY_GBG_COUNT
I've reverted moving GBG_FIXED. It was protected by GEANY_PRIVATE unlike the GEANY_GBG_* enums.
@elextr Thanks for looking at this.
this PR also includes changes not relevant to that
It moves GeanyBuildFixedMenuItems and makes build_get_menu_items static. Those changes could be submitted separately, they depend on this pull though. Do you want me to split them out?
and I am not seeing where the actual fix is.
The 2 fixes now check `build_info.message_count`. The first commit is while a build command is executing. The other one is for build_menu_update.
@elextr
this PR also includes changes not relevant to that
I've taken those commits out and will submit them separately. OK to merge this?
Merged #2269 into master.
github-comments@lists.geany.org