summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1525d2b)
raw | patch | inline | side by side (parent: 1525d2b)
author | Kalle Wallin <kaw@linux.se> | |
Tue, 28 Mar 2006 08:40:56 +0000 (08:40 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Tue, 28 Mar 2006 08:40:56 +0000 (08:40 +0000) |
ChangeLog | patch | blob | history | |
doc/ncmpc.1 | patch | blob | history | |
src/list_window.c | patch | blob | history | |
src/screen.c | patch | blob | history | |
src/support.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index b4d0f5522aa1321ce5f83ac2603798f5e9de42b0..13a46c7b6a3de964757894b51bdae505b18634d5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
2006-03-28 Kalle Wallin <kaw@linux.se>
* wreadln.c: fixed TAB completion support when built with libcursesw
(path from René van Bevern)
+ * unicode fixes from Dmitry Baryshkov
* added galician translation from Johám-Luís Miguéns Vila
* configure.ac: check for recv/send/gethostbyname/socket/connect in
-lsocket -lnsl (Tonnerre)
diff --git a/doc/ncmpc.1 b/doc/ncmpc.1
index f87caa4a4294712159f89624689f7103727247bd..39cb82e00775d66bcf6f5d310a94cbfeec2da797 100644 (file)
--- a/doc/ncmpc.1
+++ b/doc/ncmpc.1
.TP
Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options.
.SH "CONFIGURATION"
-When ncmpc start it tries to read user setting from the ~/.ncmpc/config file. If no user configuration is found ncmpc tries to load global settings from $SYSCONFDIR/ncmpc/config (the actual path is displayed on the help screen). An example configuration file (config.sample) should be provided with ncmpc.
+When ncmpc start it tries to read user setting from the ~/.ncmpc/config. If no user configuration is found ncmpc tries to load global settings from $SYSCONFDIR/ncmpc/config (the actual path is displayed on the help screen). An example configuration file (config.sample) should be provided with ncmpc.
Base colors are: black, red, green, yellow, blue, magenta, cyan and white.
diff --git a/src/list_window.c b/src/list_window.c
index 5ee81d0697e90ce05ecdd68832348589fee4bf79..05f5630e9b4e5d6228132a16edcd736a17c71278 100644 (file)
--- a/src/list_window.c
+++ b/src/list_window.c
if( show_cursor && selected )
wattron(lw->w, A_REVERSE);
- waddnstr(lw->w, label, lw->cols);
+ //waddnstr(lw->w, label, lw->cols);
+ waddnstr(lw->w, label);
if( fill && len<lw->cols )
mvwhline(lw->w, i, len, ' ', lw->cols-len);
diff --git a/src/screen.c b/src/screen.c
index 72bdaff36247abf03e1d211db075b38d2fbace58..0a3b2f7215a93b2f1a48bbf9185102917dcc92c7 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
static int prev_header_len = -1;
WINDOW *w = screen->top_window.w;
- if(prev_header_len!=strlen(header))
+ if(prev_header_len!=my_strlen(header))
{
- prev_header_len = strlen(header);
+ prev_header_len = my_strlen(header);
clear = 1;
}
g_snprintf(buf, 32, _(" Volume %d%%"), c->status->volume);
}
colors_use(w, COLOR_TITLE);
- mvwaddstr(w, 0, screen->top_window.cols-strlen(buf), buf);
+ mvwaddstr(w, 0, screen->top_window.cols-my_strlen(buf), buf);
flags[0] = 0;
if( c->status->repeat )
if( str )
{
waddstr(w, str);
- x += strlen(str)+1;
+ x += my_strlen(str)+1;
}
/* create time string */
if( (IS_PLAYING(status->state) || IS_PAUSED(status->state)) )
{
char songname[MAX_SONGNAME_LENGTH];
- int width = COLS-x-strlen(screen->buf);
+ int width = COLS-x-my_strlen(screen->buf);
if( song )
strfsong(songname, MAX_SONGNAME_LENGTH, STATUS_FORMAT, song);
colors_use(w, COLOR_STATUS);
/* scroll if the song name is to long */
- if( strlen(songname) > width )
+ if( my_strlen(songname) > width )
{
static scroll_state_t st = { 0, 0 };
char *tmp = strscroll(songname, " *** ", width, &st);
g_strlcpy(songname, tmp, MAX_SONGNAME_LENGTH);
g_free(tmp);
}
- mvwaddnstr(w, 0, x, songname, width);
+ //mvwaddnstr(w, 0, x, songname, width);
+ mvwaddnstr(w, 0, x, songname);
}
/* display time string */
diff --git a/src/support.c b/src/support.c
index ade5ee4eb93e36bf281376aedcc0cf7978b197ab..847178d9c32e5938e831ecc8f00587bd4d7203da 100644 (file)
--- a/src/support.c
+++ b/src/support.c
}
#endif /* HAVE_STRCASESTR */
+// FIXME: utf-8 length
char *
strscroll(char *str, char *separator, int width, scroll_state_t *st)
{
tmp = g_malloc(size);
g_strlcpy(tmp, str, size);
g_strlcat(tmp, separator, size);
- len = strlen(tmp);
+ len = my_strlen(tmp);
if( st->offset >= len )
st->offset = 0;
/* create the new scrolled string */
size = width+1;
- buf = g_malloc(size);
- g_strlcpy(buf, tmp+st->offset, size);
- if( strlen(buf) < width )
- g_strlcat(buf, tmp, size);
-
+ if (g_utf8_validate(tmp, -1, NULL) )
+ {
+ int ulen;
+ buf = g_malloc(size*6);// max length of utf8 char is 6
+ g_utf8_strncpy(buf, g_utf8_offset_to_pointer(tmp,st->offset), size);
+ if( (ulen = g_utf8_strlen(buf, -1)) < width )
+ g_utf8_strncpy(buf+strlen(buf), tmp, size - ulen - 1);
+ }
+ else
+ {
+ buf = g_malloc(size);
+ g_strlcpy(buf, tmp+st->offset, size);
+ if( strlen(buf) < width )
+ g_strlcat(buf, tmp, size);
+ }
if( time(NULL)-st->t >= 1 )
{
st->t = time(NULL);