[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[xtext-dev] How are tabs counted in the length of a line?

How are tabs counted when calculating the length of a line (to decide whether it should autoLineWrap or not)? Do they count as 1 or 4 (1 tab = 4 spaces)?

According to FormatterTest.testIndentationAndLineWrap() in the test suite, for the input

-----
"test indentation { void func(x:int,y:int,s:javalangString, foo:javasqlDate, blupp:mylongtype, msads:adshdjkhsakdasdkslajdlsask, x:x, a:b, c:d ); }"
-----


if I use the following config:

-----
c.setAutoLinewrap(30);
// increment the indentation twice after a "{"
c.setIndentationIncrement().after(f.getTestIndentationAccess().getLeftCurlyBracketKeyword_1());
c.setIndentationIncrement().after(f.getTestIndentationAccess().getLeftCurlyBracketKeyword_1());
-----

then the actual result is as follows:

-----
test indentation {
       void func(x:int, y:int,
       s:javalangString,
       foo:javasqlDate,
       blupp:mylongtype,
       msads:adshdjkhsakdasdkslajdlsask,
       x:x, a:b, c:d);
       }
-----

But doesn't the line " void func(x:int, y:int," exceed 30 characters? By my count, that line has 31 characters and should have been wrapped. Am I miscounting?

Regards,

Mary