summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ui.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/ui.c b/ui.c
index 5b7ef5e..fd9bfab 100644
--- a/ui.c
+++ b/ui.c
@@ -563,6 +563,19 @@ static int wordWidth(const char *str) {
 	return width;
 }
 
+// XXX: ncurses likes to render zero-width characters as spaces...
+static int waddnstrnzw(WINDOW *win, const char *str, int len) {
+	wchar_t wc;
+	while (len) {
+		int n = mbtowc(&wc, str, len);
+		if (n < 1) return waddnstr(win, str, len);
+		if (wcwidth(wc)) waddnstr(win, str, n);
+		str += n;
+		len -= n;
+	}
+	return OK;
+}
+
 static int wordWrap(WINDOW *win, const char *str) {
 	int y, x, width;
 	getmaxyx(win, y, width);
@@ -601,7 +614,7 @@ static int wordWrap(WINDOW *win, const char *str) {
 			colorPair(Colors[style.fg], Colors[style.bg]),
 			NULL
 		);
-		waddnstr(win, str, len);
+		waddnstrnzw(win, str, len);
 		str += len;
 	}
 	return lines;
td>June McEnroe 2013-11-03Remove unused pluginsJune McEnroe 2013-11-03Update jellybeansJune McEnroe 2013-11-03Switch to (customized) jellybeans colorschemeJune McEnroe 2013-11-03Disable Airline whitespace extensionJune McEnroe 2013-11-02Replace vim-gitgutter with vim-signifyJune McEnroe 2013-11-02Add tagbarJune McEnroe 2013-11-02Add AirlineJune McEnroe 2013-11-02Remove powerlineJune McEnroe 2013-11-02Rehash on reloadJune McEnroe 2013-11-02Remove git prompt from titleJune McEnroe 2013-11-02Update zsh syntax highlighting and configJune McEnroe 2013-10-31Fix host in prompt, part twoJune McEnroe 2013-10-31Fix host in promptJune McEnroe 2013-10-31Wow look reorganized zsh configJune McEnroe 2013-10-30Show hostname in prompt over SSHJune McEnroe 2013-10-30Only load chruby if it existsJune McEnroe 2013-10-27Add auto-title stuff to zshJune McEnroe 2013-10-26Add gvim alias to silence stderrJune McEnroe 2013-10-26Add home.programble.me functionJune McEnroe 2013-10-14Remove unused configsJune McEnroe 2013-10-14Add therefore, because, cards compose sequencesJune McEnroe 2013-10-14Global git ignore .swo filesJune McEnroe 2013-10-14Add Heroku to zshJune McEnroe 2013-09-23Add gst git stash aliasJune McEnroe 2013-09-06Disable some options in terminalsJune McEnroe 2013-09-05Only set colorscheme for gvimJune McEnroe 2013-09-05Remove pacman stuffJune McEnroe Goodbye Arch. 2013-09-05Only alias hub if it existsJune McEnroe 2013-09-05chruby to ruby-2.0.0June McEnroe 2013-08-17Add vim-ragtagJune McEnroe 2013-08-14Add nvmJune McEnroe 2013-07-09Add title commandJune McEnroe 2013-06-09Use default client keysJune McEnroe 2013-06-09Run games in separate X serverJune McEnroe 2013-06-08Add game wrapper to kill/restart unclutterJune McEnroe 2013-06-08Update base16-vimJune McEnroe 2013-06-08Add git configJune McEnroe