From b710f6a01db827a6a6ea9f74894a6d3dec330734 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 25 Sep 2015 11:29:53 +0200 Subject: curses UI: properly truncate q-register and file names * format_str() will now automatically right-truncate strings (with formatted control characters) exceeding the window width (or provided maximum width of formatted characters). This means that Q-Register names in the info line are now properly truncated. * introduced format_filename() which takes care of canonicalizing control characters in a given filename and truncate the filename if necessary. Filenames are currently left-truncated since the file name proper and the directory containing it is more significant than the directory names closer to the root. On Windows, we make sure that the drive letter is not truncated. The truncation rules may have to be further tweaked later. This feature properly truncated file names in the info line and in the auto-completion popup. --- src/interface-curses.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/interface-curses.h') diff --git a/src/interface-curses.h b/src/interface-curses.h index 9bb17cd..ed228ee 100644 --- a/src/interface-curses.h +++ b/src/interface-curses.h @@ -103,6 +103,10 @@ typedef class InterfaceCurses : public Interface { FILE *screen_tty; WINDOW *info_window; + enum { + INFO_TYPE_BUFFER = 0, + INFO_TYPE_QREGISTER + } info_type; gchar *info_current; WINDOW *msg_window; -- cgit v1.2.3