regexec_safe()
- Rename to safe_regexec() for consistency. (DLR)
- winio.c:
+ titlebar()
+ - Make sure that the (mv)?waddnstr() calls take the proper
+ number of bytes when using multibyte characters, so that
+ multibyte strings aren't prematurely cut off. (DLR, found by
+ Jordi)
+ - Allow the "View" state to be displayed when a filename is
+ passed in, in case we're in multibuffer mode and inside the
+ file browser. (DLR)
help_line_len()
- Make the text display more flexible, and closer to what nano
1.2.x does. (DLR)
assert(COLS >= 0);
wattron(topwin, A_REVERSE);
-
blank_titlebar();
if (COLS <= 5 || COLS - 5 < verlen)
if (ISSET(MODIFIED))
state = _("Modified");
- else if (path == NULL && ISSET(VIEW_MODE))
+ else if (ISSET(VIEW_MODE))
state = _("View");
else {
if (space > 0)
state = &hblank[COLS - statelen];
}
statelen = strnlenpt(state, COLS);
+
/* We need a space before state. */
if ((ISSET(MODIFIED) || ISSET(VIEW_MODE)) && statelen < COLS)
statelen++;
assert(statelen < space);
prefixlen = strnlenpt(prefix, space - statelen);
+
/* If newfie is FALSE, we need a space after prefix. */
if (!newfie && prefixlen + statelen < space)
prefixlen++;
else
space = 0;
/* space is now the room we have for the file name. */
+
if (!newfie) {
size_t lenpt = strlenpt(path), start_col;
/* There is room for the whole filename, so we center it. */
waddnstr(topwin, hblank, (space - exppathlen) / 3);
- waddnstr(topwin, prefix, prefixlen);
+ waddnstr(topwin, prefix, actual_x(prefix, prefixlen));
if (!newfie) {
assert(strlenpt(prefix) + 1 == prefixlen);
}
} else {
/* We will say something like "File: ...ename". */
- waddnstr(topwin, prefix, prefixlen);
+ waddnstr(topwin, prefix, actual_x(prefix, prefixlen));
if (space <= -3 || newfie)
goto the_end;
waddch(topwin, ' ');
free(exppath);
if (COLS <= 1 || statelen >= COLS - 1)
- mvwaddnstr(topwin, 0, 0, state, COLS);
+ mvwaddnstr(topwin, 0, 0, state, actual_x(state, COLS));
else {
assert(COLS - statelen - 2 >= 0);
mvwaddch(topwin, 0, COLS - statelen - 2, ' ');
- mvwaddnstr(topwin, 0, COLS - statelen - 1, state, statelen);
+ mvwaddnstr(topwin, 0, COLS - statelen - 1, state,
+ actual_x(state, statelen));
}
wattroff(topwin, A_REVERSE);