aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRobin Haberkorn <rhaberkorn@fmsbw.de>2026-07-25 22:37:16 +0200
committerRobin Haberkorn <rhaberkorn@fmsbw.de>2026-07-26 00:42:38 +0200
commit0b90eb1f9a9b397ebb1960f2f03409d57154f42b (patch)
tree4cf1f76836c82aa1912844aa13bbcf551799c637 /src
parenta53fa85dabdfc2c47ec0c9e6626ddda2379a8e38 (diff)
minor documentation update (sciteco(1) and sciteco(7)) and comment changes
Diffstat (limited to 'src')
-rw-r--r--src/interface-curses/curses-utils.c14
-rw-r--r--src/interface-curses/interface.c12
2 files changed, 11 insertions, 15 deletions
diff --git a/src/interface-curses/curses-utils.c b/src/interface-curses/curses-utils.c
index 3b25d56..cb57475 100644
--- a/src/interface-curses/curses-utils.c
+++ b/src/interface-curses/curses-utils.c
@@ -117,12 +117,7 @@ teco_curses_format_str(WINDOW *win, const gchar *str, gsize len, gint max_width)
chars_added++;
if (chars_added > max_width)
goto truncate;
- /*
- * FIXME: This works with UTF-8 on ncurses,
- * since it detects multi-byte characters.
- * However on other platforms wadd_wch() may be
- * necessary, which requires a widechar Curses variant.
- */
+ /* works for UTF-8 as well */
waddnstr(win, str, clen);
}
}
@@ -183,12 +178,7 @@ teco_curses_format_filename(WINDOW *win, const gchar *filename, gint max_width)
max_width = getmaxx(win) - old_x;
if (filename_len <= max_width) {
- /*
- * FIXME: This works with UTF-8 on ncurses,
- * since it detects multi-byte characters.
- * However on other platforms wadd_wch() may be
- * necessary, which requires a widechar Curses variant.
- */
+ /* works for UTF-8 as well */
waddstr(win, filename_printable);
} else if (filename_len >= truncate_len) {
const gchar *keep_post;
diff --git a/src/interface-curses/interface.c b/src/interface-curses/interface.c
index ff6a0f2..f99f413 100644
--- a/src/interface-curses/interface.c
+++ b/src/interface-curses/interface.c
@@ -977,7 +977,12 @@ teco_interface_getch(gboolean widechar)
if (!widechar || !cp)
break;
- /* doesn't work as expected when passed a null byte */
+ /*
+ * NOTE: There's also wget_wch(), but teco_interface_blocking_getch()
+ * should work for single bytes as well.
+ *
+ * Doesn't work as expected when passed a null byte
+ */
buf[i] = cp;
cp = g_utf8_get_char_validated(buf, ++i);
if (i >= sizeof(buf) || cp != -2)
@@ -2217,8 +2222,9 @@ teco_interface_event_loop_iter(void)
return;
/*
- * NOTE: There's also wget_wch(), but it requires
- * a widechar version of Curses.
+ * NOTE: There's also wget_wch(), but teco_interface_blocking_getch()
+ * should work for single bytes as well.
+ * Also, we need the key as a string anyway.
*/
keybuf[keybuf_i++] = key;
gsize len = keybuf_i;