From bfdd58281f5a3e78558e4eaeb07453d9923e3fff Mon Sep 17 00:00:00 2001 From: Martin Price Date: Tue, 30 Jul 2024 09:29:04 +0100 Subject: [PATCH 1/5] Add columns environment variable --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index afc7861a..193db716 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,6 +13,9 @@ on: - '.gitignore' - 'images/**' +env: + COLUMNS: 120 + jobs: tests: runs-on: ubuntu-latest From b6eb1d80755afcccdeb64169f057d6962bdc121c Mon Sep 17 00:00:00 2001 From: Martin Price Date: Tue, 30 Jul 2024 09:35:11 +0100 Subject: [PATCH 2/5] Try a different place in the config --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 193db716..ae65c9b6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,12 +13,12 @@ on: - '.gitignore' - 'images/**' -env: - COLUMNS: 120 jobs: tests: runs-on: ubuntu-latest + env: + COLUMNS: 120 steps: # Checks-out repo under $GITHUB_WORKSPACE. - uses: actions/checkout@v3 From 8afba02c994c79810767afa97143078f72f94a60 Mon Sep 17 00:00:00 2001 From: Martin Price Date: Tue, 30 Jul 2024 09:39:35 +0100 Subject: [PATCH 3/5] Try at the top --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ae65c9b6..e6e7c672 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,3 +1,5 @@ +env: + COLUMNS: 120 on: # Trigger on pull request events. Also trigger on push events for feature branches. push: @@ -17,8 +19,6 @@ on: jobs: tests: runs-on: ubuntu-latest - env: - COLUMNS: 120 steps: # Checks-out repo under $GITHUB_WORKSPACE. - uses: actions/checkout@v3 From 0b5784f15ab09144e82955b07e2830765e5f83b8 Mon Sep 17 00:00:00 2001 From: Martin Price Date: Tue, 30 Jul 2024 09:50:09 +0100 Subject: [PATCH 4/5] Test if the tables used in bee_messages is problem. --- .github/workflows/tests.yml | 3 --- includes/render.inc | 41 ++++++++++++++++++++++--------------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e6e7c672..afc7861a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,5 +1,3 @@ -env: - COLUMNS: 120 on: # Trigger on pull request events. Also trigger on push events for feature branches. push: @@ -15,7 +13,6 @@ on: - '.gitignore' - 'images/**' - jobs: tests: runs-on: ubuntu-latest diff --git a/includes/render.inc b/includes/render.inc index 9d476d47..bad3e3c1 100644 --- a/includes/render.inc +++ b/includes/render.inc @@ -15,6 +15,9 @@ function bee_print_messages() { return; } + // Add a new line before starting. + echo "\n"; + // Style each type of message differently. foreach ($_bee_messages as $type => $type_messages) { // Skip 'log' messages if `debug` mode is disabled. @@ -26,25 +29,31 @@ function bee_print_messages() { // Prepare `$rows` array for table output. foreach ($type_messages as $message) { - $rows[] = array( - array( - 'value' => $symbol, - '#color' => $color, - '#bold' => TRUE, - ), - array('value' => $message), - ); + bee_render_text(array( + 'value' => "$symbol $message", + ), TRUE); + // $rows[] = array( + // array( + // 'value' => $symbol, + // '#color' => $color, + // '#bold' => TRUE, + // ), + // array('value' => $message), + // ); } } - // Render messages in a table. - echo "\n"; - bee_render_table(array( - 'rows' => $rows, - 'delimiter' => ' ', - 'delimiter_left' => ' ', - 'delimiter_right' => ' ', - )); + // Add a new line after the messages. + echo "\n"; + + // // Render messages in a table. + // echo "\n"; + // bee_render_table(array( + // 'rows' => $rows, + // 'delimiter' => ' ', + // 'delimiter_left' => ' ', + // 'delimiter_right' => ' ', + // )); } /** From 8537c39e2b1e1be223fa5b18b99057a8ef37bd2a Mon Sep 17 00:00:00 2001 From: Martin Price Date: Tue, 30 Jul 2024 11:09:31 +0100 Subject: [PATCH 5/5] Tidy up the code for bee_print_messages --- includes/render.inc | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/includes/render.inc b/includes/render.inc index bad3e3c1..2aeb4e20 100644 --- a/includes/render.inc +++ b/includes/render.inc @@ -27,33 +27,17 @@ function bee_print_messages() { list($symbol, $color) = bee_message_type_info($type); - // Prepare `$rows` array for table output. + // Output the symbol and text for each message. foreach ($type_messages as $message) { - bee_render_text(array( - 'value' => "$symbol $message", - ), TRUE); - // $rows[] = array( - // array( - // 'value' => $symbol, - // '#color' => $color, - // '#bold' => TRUE, - // ), - // array('value' => $message), - // ); + echo bee_format_text(" $symbol", $color) . " $message"; + + // Add a newline after each message. + echo "\n"; } } - // Add a new line after the messages. - echo "\n"; - - // // Render messages in a table. - // echo "\n"; - // bee_render_table(array( - // 'rows' => $rows, - // 'delimiter' => ' ', - // 'delimiter_left' => ' ', - // 'delimiter_right' => ' ', - // )); + // Add a new line after the messages. + echo "\n"; } /**