aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Kurtis Rader <krader@skepticism.us>2016-06-14 17:16:18 -0700
committerGravatar Kurtis Rader <krader@skepticism.us>2016-06-14 17:17:31 -0700
commitd70be18c4255829b3b6bc3d71b791740a9bba6ac (patch)
treea4d2ef5bc7a3753654ae68a42508dcf2a8a09617
parent1be3fe66330ed8a603413ed3ee61fdb65f029851 (diff)
use fish_wcwidth rather than wcwidth
Minor cleanup related to issue #2199.
-rw-r--r--src/common.cpp4
-rw-r--r--src/pager.cpp8
-rw-r--r--src/screen.cpp6
3 files changed, 9 insertions, 9 deletions
diff --git a/src/common.cpp b/src/common.cpp
index d0fdccb6..49f53fb5 100644
--- a/src/common.cpp
+++ b/src/common.cpp
@@ -471,10 +471,10 @@ wchar_t *quote_end(const wchar_t *pos) {
void fish_setlocale() {
// Use ellipsis if on known unicode system, otherwise use $.
- ellipsis_char = (wcwidth(L'\x2026') > 0) ? L'\x2026' : L'$';
+ ellipsis_char = (fish_wcwidth(L'\x2026') > 0) ? L'\x2026' : L'$';
// U+23CE is the "return" character
- omitted_newline_char = (wcwidth(L'\x23CE') > 0) ? L'\x23CE' : L'~';
+ omitted_newline_char = (fish_wcwidth(L'\x23CE') > 0) ? L'\x23CE' : L'~';
}
bool contains_internal(const wchar_t *a, int vararg_handle, ...) {
diff --git a/src/pager.cpp b/src/pager.cpp
index d9411362..1603ce8e 100644
--- a/src/pager.cpp
+++ b/src/pager.cpp
@@ -67,15 +67,15 @@ static int print_max(const wcstring &str, highlight_spec_t color, int max, bool
for (size_t i = 0; i < str.size(); i++) {
wchar_t c = str.at(i);
- if (written + wcwidth(c) > max) break;
- if ((written + wcwidth(c) == max) && (has_more || i + 1 < str.size())) {
+ if (written + fish_wcwidth(c) > max) break;
+ if ((written + fish_wcwidth(c) == max) && (has_more || i + 1 < str.size())) {
line->append(ellipsis_char, color);
- written += wcwidth(ellipsis_char);
+ written += fish_wcwidth(ellipsis_char);
break;
}
line->append(c, color);
- written += wcwidth(c);
+ written += fish_wcwidth(c);
}
return written;
}
diff --git a/src/screen.cpp b/src/screen.cpp
index 08fca25d..54037d1a 100644
--- a/src/screen.cpp
+++ b/src/screen.cpp
@@ -1180,9 +1180,9 @@ void s_reset(screen_t *s, screen_reset_mode_t mode) {
wcstring abandon_line_string;
abandon_line_string.reserve(screen_width + 32); // should be enough
- // Don't need to check for wcwidth errors; this is done when setting up omitted_newline_char
- // in common.cpp.
- int non_space_width = wcwidth(omitted_newline_char);
+ // Don't need to check for fish_wcwidth errors; this is done when setting up
+ // omitted_newline_char in common.cpp.
+ int non_space_width = fish_wcwidth(omitted_newline_char);
if (screen_width >= non_space_width) {
bool has_256_colors = output_get_color_support() & color_support_term256;
if (has_256_colors) {