Re: [code] [textadept][bug] Tab width in OSX is wrong

From: Mitchell <m.att.foicica.com>
Date: Thu, 4 Sep 2014 11:31:49 -0400 (Eastern Daylight Time)

Robert,

On Thu, 4 Sep 2014, Robert Gieseke wrote:

> Am 04/09/14 um 17:06 schrieb Mitchell:
>
>> Okay, change step #6 to be:
>>
>> 6. Position the caret on a tab character and enter command
>> "=buffer:text_width(style_at[current_pos],'1234\t')"
>>
>> and change #8 to be:
>>
>> 8. Position the caret on a number and enter command
>> "=buffer:text_width(style_at[current_pos],'12341234')"
>>
>> Then compare the two results (still 57 vs 57 for me).
>>
>> Also let me know which lexer is being used too.
>>
>
> The display issue is the same for Lua or the plain text lexer.
> I get 57 all the time for Lua:
>
> print(
> buffer:text_width(20,'1234\t'),
> buffer:text_width(20,'12341234'),
> buffer:text_width(0, '1234\t'),
> buffer:text_width(0, '12341234')
> )
>
> When I run
>
> buffer.tab_width=4;
> print(buffer:text_width(20,'1234'),
> buffer:text_width(20,'\t'),
> buffer:text_width(0, '1234'),
> buffer:text_width(0, '\t')
> )
>
> I get 28 57 28 57
>
> '1234' is 28 px wide on my screen (measured using Xscope), so I don't
> know why Tabs are always given as 57 pixels wide, even when tab_width is
> set to 2.

I noticed this as well. That's why my test strings were '1234\t' or
'12341234'. That way I didn't get the "off by 2x" factor.

Cheers,
Mitchell

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Thu 04 Sep 2014 - 11:31:49 EDT

This archive was generated by hypermail 2.2.0 : Fri 05 Sep 2014 - 06:32:06 EDT