From: Darko Koruga Date: Thu, 25 Oct 2001 06:01:30 +0000 (+0000) Subject: Don't wrap long URLs while composing a message. X-Git-Tag: Release_0_6_4claws12~14 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=11b602e90c0defbf3a360a5dc2d9d70081e0d71a Don't wrap long URLs while composing a message. --- diff --git a/ChangeLog.claws b/ChangeLog.claws index 533f6cf97..b989e5afe 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,12 @@ +2001-10-25 [darko] 0.6.4claws4 + + * src/compose.c + don't declare is_url_string as static function since + we need it in gtkstext.c + * src/gtkstext.c + remove unused variable + don't wrap long URLs while composing a message + 2001-10-24 [christoph] 0.6.4claws3 * src/socket.c diff --git a/configure.in b/configure.in index eb49e7e47..1d4937c82 100644 --- a/configure.in +++ b/configure.in @@ -8,7 +8,7 @@ MINOR_VERSION=6 MICRO_VERSION=4 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws3 +EXTRA_VERSION=claws4 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl diff --git a/src/compose.c b/src/compose.c index 8dc5dc105..71396b8ad 100644 --- a/src/compose.c +++ b/src/compose.c @@ -2266,7 +2266,7 @@ static gint gtkstext_strncmp(GtkSText *text, guint pos1, guint pos2, guint len, } /* return true if text at pos is URL */ -static guint is_url_string(GtkSText *text, guint start_pos, guint text_len) +guint is_url_string(GtkSText *text, guint start_pos, guint text_len) { guint len; diff --git a/src/gtkstext.c b/src/gtkstext.c index 1420d40d0..4450a22ab 100644 --- a/src/gtkstext.c +++ b/src/gtkstext.c @@ -1003,8 +1003,6 @@ gtk_stext_thaw (GtkSText *text) void gtk_stext_compact_buffer (GtkSText *text) { - GtkEditable *editable = GTK_EDITABLE (text); - g_return_if_fail (text != NULL); g_return_if_fail (GTK_IS_STEXT (text)); move_gap (text, gtk_stext_get_length(text)); @@ -5210,6 +5208,16 @@ find_line_params (GtkSText* text, /* If whole line is one word, revert to char wrapping */ if (lp.end.index == lp.start.index) { + /* SYLPHEED: don't wrap URLs */ + if (is_url_string(text, lp.end.index, + gtk_stext_get_length(text))) + { + lp.end = saved_mark; + lp.displayable_chars = saved_characters + 1; + lp.wraps = 0; + goto no_url_wrap; + } + lp.end = saved_mark; lp.displayable_chars = saved_characters; decrement_mark (&lp.end); @@ -5232,6 +5240,7 @@ find_line_params (GtkSText* text, lp.displayable_chars += 1; } +no_url_wrap: lp.font_ascent = MAX (font->ascent, lp.font_ascent); lp.font_descent = MAX (font->descent, lp.font_descent); lp.pixel_width += ch_width; diff --git a/src/gtkstext.h b/src/gtkstext.h index b7e2aad38..78cf8d015 100644 --- a/src/gtkstext.h +++ b/src/gtkstext.h @@ -249,6 +249,9 @@ void gtk_stext_set_wrap_rmargin (GtkSText *text, gint rmargin); void gtk_stext_set_cursor_type (GtkSText *text, GtkSTextCursorType cursor_type); +/* SYLPHEED */ +extern guint is_url_string (GtkSText *text, guint start_pos, guint text_len); + #define GTK_STEXT_INDEX(t, index) (((t)->use_wchar) \ ? ((index) < (t)->gap_position ? (t)->text.wc[index] : \ (t)->text.wc[(index)+(t)->gap_size]) \