xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit 9914756ae169424edc41e67a7fcef19853bf9e06

Fix :highlight command truncating some color names
When printing.
Author: xaizek
Author date (UTC): 2025-01-30 09:42
Committer name: xaizek
Committer date (UTC): 2025-02-01 11:36
Parent(s): b0f15ecec20af464a6185f1ad8ebfac6389f62ce
Signing key: 99DC5E4DB05F6BE2
Tree: ab327fde3c7658321e46ace8987cdce623af421e
File Lines added Lines deleted
ChangeLog 2 0
src/cmd_handlers.c 1 1
tests/commands/highlight.c 22 1
File ChangeLog changed (mode: 100644) (index 082c0dc4c..697ce232a)
14 14 Fixed quotes not being escaped on completion of option values via Fixed quotes not being escaped on completion of option values via
15 15 `opt=<tab>`. `opt=<tab>`.
16 16
17 Fixed output of :highlight command truncating names of some colors.
18
17 19 0.13 to 0.14-beta (2025-01-19) 0.13 to 0.14-beta (2025-01-19)
18 20
19 21 Changed --with-gtk flag to --with-glib (old name is still available). GTK Changed --with-gtk flag to --with-glib (old name is still available). GTK
File src/cmd_handlers.c changed (mode: 100644) (index e54450850..400d96a20)
... ... get_hi_str(const char title[], const col_attr_t *col)
3162 3162 static char buf[512]; static char buf[512];
3163 3163 static char gui_buf[2*sizeof(buf)]; static char gui_buf[2*sizeof(buf)];
3164 3164
3165 char fg_buf[16], bg_buf[16];
3165 char fg_buf[32], bg_buf[32];
3166 3166
3167 3167 cs_color_to_str(col->fg, sizeof(fg_buf), fg_buf, /*is_gui=*/0); cs_color_to_str(col->fg, sizeof(fg_buf), fg_buf, /*is_gui=*/0);
3168 3168 cs_color_to_str(col->bg, sizeof(bg_buf), bg_buf, /*is_gui=*/0); cs_color_to_str(col->bg, sizeof(bg_buf), bg_buf, /*is_gui=*/0);
File tests/commands/highlight.c changed (mode: 100644) (index 53ce8ce0b..b05584188)
1 1 #include <stic.h> #include <stic.h>
2 2
3 3 #include <limits.h> /* INT_MAX */ #include <limits.h> /* INT_MAX */
4 #include <stdio.h> /* snprintf() */
4 5 #include <string.h> /* strcpy() */ #include <string.h> /* strcpy() */
5 6
6 7 #include <test-utils.h> #include <test-utils.h>
 
... ... TEARDOWN()
39 40
40 41 /* General behaviour. */ /* General behaviour. */
41 42
42 TEST(all_colors_are_printed)
43 TEST(all_groups_are_printed)
43 44 { {
44 45 /* On PDCurses A_STANDOUT == (A_REVERSE | A_BOLD). */ /* On PDCurses A_STANDOUT == (A_REVERSE | A_BOLD). */
45 46 #if __PDCURSES__ #if __PDCURSES__
 
... ... TEST(all_colors_are_printed)
118 119
119 120 /* Colors. */ /* Colors. */
120 121
122 TEST(all_xterm_colors_are_printed)
123 {
124 size_t i;
125
126 for(i = 0U; i < ARRAY_LEN(XTERM256_COLOR_NAMES); ++i)
127 {
128 cfg.cs.color[WIN_COLOR].bg = i;
129 cfg.cs.color[WIN_COLOR].fg = i;
130
131 char expected[128];
132 snprintf(expected, sizeof(expected),
133 "Win cterm=none ctermfg=%-7s ctermbg=%s",
134 XTERM256_COLOR_NAMES[i], XTERM256_COLOR_NAMES[i]);
135
136 ui_sb_msg("");
137 assert_failure(cmds_dispatch("hi Win", &lwin, CIT_COMMAND));
138 assert_string_equal(expected, ui_sb_last());
139 }
140 }
141
121 142 TEST(wrong_gui_color_causes_error) TEST(wrong_gui_color_causes_error)
122 143 { {
123 144 ui_sb_msg(""); ui_sb_msg("");
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master