Subject: Re: [sup-devel] [issue53] Error if the composed text has tabs in the first character

From: Mark Alexander <[email-masked]>
Date: Wed, 27 Jan 2010 16:57:33 -0500

I've been noticing this problem for a long time now.
I think it happens with tabs anywhere in the
message, or perhaps at the beginning of lines,
but I haven't played with it enough to know for sure.
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Anirudh Sanjeev <[email-masked]>
Date: Wed, 27 Jan 2010 21:11:48 +0000

New submission from Anirudh Sanjeev <[email-masked]>:

Steps to reproduce:
1. Compose message with a tab as a first character
2. View composed message in the compose-mode

It looks like this in my text editor:
http://imgur.com/NH2Rz.png

Here's how it looks like in compose mode. Note how the last few characters of
the compose mode is truncated.
http://imgur.com/xdL0U.png

----------
messages: 124
nosy: anirudhs
priority: bug
ruby_version: 1.8
status: unread
sup_version: next
title: Error if the composed text has tabs in the first character

_________________________________________
Sup issue tracker <[email-masked]>
<http://masanjin.net/sup-bugs/issue53>
_________________________________________
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Rich Lane <[email-masked]>
Date: Wed, 27 Jan 2010 17:29:09 -0500

> but I haven't played with it enough to know for sure.

Sup assumes that 1 codepoint == 1 screen cell. This also causes problems
with double-width Chinese(?) characters. William has suggested using
wc[s]width, and now that we've got our own fork of ncurses-ruby we might
as well stick it in there. I looked at it briefly and iirc the
troublesome part was getting a wchar_t from the bytes in a Ruby string.

Tabs are funny because their width depends on their position. I say
replace all tabs with 2 spaces before calling ncurses.
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Tero Tilus <[email-masked]>
Date: Thu, 28 Jan 2010 00:15:19 +0200

> 2. View composed message in the compose-mode

Looks like tabs are counted as 1 (instead of 8) when calculating
string display width.  Dunno why this did not affect thread-view-mode
thought.  Patch attached.

-- 
Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel