Problems with tab expansion in codestriker

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problems with tab expansion in codestriker

Chris Welch
Using Codestriker 1.9.10 with SVN 1.6, getting tab expansion problems.  See the following:


458            if( attempt_num < 4 )
459                         ++attempt_num;
460           else
461                     TSK_sleep( ticks_per_attempt );
462          } while( PRD_getticks() < end_tick );

The tab expansion setting is at 8 for this display.  I did an od dump of the patch looking at the data representing lines 459 and 461 that they both have three tab chars and nothing else before the text, yet they have unequal tab expansion.

This patch has the following white space prior to the text on the lines:

Line 458 two tab lead in, nothing else
Line 459 three tab lead in, nothing else
Line 460 two tab lead in, nothing else
Line 461 three tab lead in, nothing else
Line 462 one tab lead in, nothing else

Changing the display setting to 4 spaces per tabs yields:

458        if( attempt_num < 4 )
459             ++attempt_num;
460       else
461             TSK_sleep( ticks_per_attempt );
462      } while( PRD_getticks() < end_tick );

Any ideas what the problem is?

Tx,

Chris

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Codestriker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/codestriker-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problems with tab expansion in codestriker

David Sitsky
Administrator
Hi Chris,

This is the problem with tabs.. and why in my work place, our IDEs
specifically are setup to not use them.  What you are seeing is quite
normal, if you load your file into an editor with different tab-stops
(8 instead of 4), you'll see the same behaviour.

Cheers,
David

On Thu, Mar 1, 2012 at 2:30 AM, Chris Welch <[hidden email]> wrote:

> Using Codestriker 1.9.10 with SVN 1.6, getting tab expansion problems.  See the following:
>
>
> 458            if( attempt_num < 4 )
> 459                         ++attempt_num;
> 460           else
> 461                     TSK_sleep( ticks_per_attempt );
> 462          } while( PRD_getticks() < end_tick );
>
> The tab expansion setting is at 8 for this display.  I did an od dump of the patch looking at the data representing lines 459 and 461 that they both have three tab chars and nothing else before the text, yet they have unequal tab expansion.
>
> This patch has the following white space prior to the text on the lines:
>
> Line 458 two tab lead in, nothing else
> Line 459 three tab lead in, nothing else
> Line 460 two tab lead in, nothing else
> Line 461 three tab lead in, nothing else
> Line 462 one tab lead in, nothing else
>
> Changing the display setting to 4 spaces per tabs yields:
>
> 458        if( attempt_num < 4 )
> 459             ++attempt_num;
> 460       else
> 461             TSK_sleep( ticks_per_attempt );
> 462      } while( PRD_getticks() < end_tick );
>
> Any ideas what the problem is?
>
> Tx,
>
> Chris
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Codestriker-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/codestriker-user

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Codestriker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/codestriker-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problems with tab expansion in codestriker

Chris Welch
I had the same initial impression of the problem and did a drill down into the source data.  The source data was consistent in its use of tabs and displays fine with several different editors.  

In this case it is a bug with Codestriker.  The code views fine everywhere but in Codestriker.  

Only Codestriker fails to display the source properly.

Yes I agree mixed white space is evil and I set up coding standards elsewhere to avoid the problem, however, it is not a requirement here.

I've provided details of the data below as examining the generated display from Codestriker showed that Codestriker is not expanding tabs consistently and is definitely a bug in Codestriker.

The problem seems to be something interfering with correct tab expansion logic when a line has parenthesis '(' or ')' in them.  Lines with a parenthesis in them do not have correct tab expansion of 4 or 8 spaces.

Please review the data I originally presented to see the problem.  There are no mixed space/tab lines yet the tabs get unevenly substituted for spaces.

This is also reflected in the 4 space expansion I've provided.  Once again there is irregular tab expansion on lines ith parenthesis on them.

Bye for now,

Chris

-----Original Message-----
From: David Sitsky [mailto:[hidden email]]
Sent: Sunday, March 04, 2012 7:11 PM
To: Chris Welch
Cc: [hidden email]
Subject: Re: [Codestriker-user] Problems with tab expansion in codestriker

Hi Chris,

This is the problem with tabs.. and why in my work place, our IDEs
specifically are setup to not use them.  What you are seeing is quite
normal, if you load your file into an editor with different tab-stops
(8 instead of 4), you'll see the same behaviour.

Cheers,
David

On Thu, Mar 1, 2012 at 2:30 AM, Chris Welch <[hidden email]> wrote:

> Using Codestriker 1.9.10 with SVN 1.6, getting tab expansion problems.  See the following:
>
>
> 458            if( attempt_num < 4 )
> 459                         ++attempt_num;
> 460           else
> 461                     TSK_sleep( ticks_per_attempt );
> 462          } while( PRD_getticks() < end_tick );
>
> The tab expansion setting is at 8 for this display.  I did an od dump of the patch looking at the data representing lines 459 and 461 that they both have three tab chars and nothing else before the text, yet they have unequal tab expansion.
>
> This patch has the following white space prior to the text on the lines:
>
> Line 458 two tab lead in, nothing else
> Line 459 three tab lead in, nothing else
> Line 460 two tab lead in, nothing else
> Line 461 three tab lead in, nothing else
> Line 462 one tab lead in, nothing else
>
> Changing the display setting to 4 spaces per tabs yields:
>
> 458        if( attempt_num < 4 )
> 459             ++attempt_num;
> 460       else
> 461             TSK_sleep( ticks_per_attempt );
> 462      } while( PRD_getticks() < end_tick );
>
> Any ideas what the problem is?
>
> Tx,
>
> Chris
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Codestriker-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/codestriker-user
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Codestriker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/codestriker-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problems with tab expansion in codestriker

Chris Welch
To let other folks know who encounter this problem, it is indeed a bug with Codestriker and Neeta's patch works to fix it.

Thanks very much Neeta!

Bye for now,

Chris

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: Monday, March 05, 2012 10:06 AM
To: Chris Welch; [hidden email]
Subject: RE: [Codestriker-user] Problems with tab expansion in codestriker

We had the same problem and I had to really work to fix it. Here is the change that was finally approved. The change is in TabToNbspLineFilter.pm file in Codestriker.
You can try it out to see if it gets better. It did somewhat for us, but people still complain.
Thanks,
Neeta
sub _filter {
    my ($self, $text) = @_;
    my $filtered_lines;
    my $tabwidth = $self->{tabwidth};
    my @pre_filtered_lines = split  /\n/,$text;   #split the delta first
    for ( my $i = 0; $i <= $#pre_filtered_lines; $i++) {    #go through each line in delta
        my $text_to_be_altered = $pre_filtered_lines[$i] . "\n";  #need to add the end of line character now
        # The following is hard to understand.. so here goes .. go through the line, replace tab by
        # space times (number of tabs times tabwidth - modulo chars that come before tab by tabwidth)
        1 while $text_to_be_altered =~ s/\t+/' ' x
        (length($&) * $tabwidth - length($`) % $tabwidth)/eo;
        $filtered_lines .= "$text_to_be_altered"; #concatenate the altered line to rebuild delta
    }
    return "$filtered_lines";

-----Original Message-----
From: Chris Welch [mailto:[hidden email]]
Sent: Monday, March 05, 2012 9:27 AM
To: [hidden email]
Subject: Re: [Codestriker-user] Problems with tab expansion in codestriker

I had the same initial impression of the problem and did a drill down into the source data.  The source data was consistent in its use of tabs and displays fine with several different editors.  

In this case it is a bug with Codestriker.  The code views fine everywhere but in Codestriker.  

Only Codestriker fails to display the source properly.

Yes I agree mixed white space is evil and I set up coding standards elsewhere to avoid the problem, however, it is not a requirement here.

I've provided details of the data below as examining the generated display from Codestriker showed that Codestriker is not expanding tabs consistently and is definitely a bug in Codestriker.

The problem seems to be something interfering with correct tab expansion logic when a line has parenthesis '(' or ')' in them.  Lines with a parenthesis in them do not have correct tab expansion of 4 or 8 spaces.

Please review the data I originally presented to see the problem.  There are no mixed space/tab lines yet the tabs get unevenly substituted for spaces.

This is also reflected in the 4 space expansion I've provided.  Once again there is irregular tab expansion on lines ith parenthesis on them.

Bye for now,

Chris

-----Original Message-----
From: David Sitsky [mailto:[hidden email]]
Sent: Sunday, March 04, 2012 7:11 PM
To: Chris Welch
Cc: [hidden email]
Subject: Re: [Codestriker-user] Problems with tab expansion in codestriker

Hi Chris,

This is the problem with tabs.. and why in my work place, our IDEs
specifically are setup to not use them.  What you are seeing is quite
normal, if you load your file into an editor with different tab-stops
(8 instead of 4), you'll see the same behaviour.

Cheers,
David

On Thu, Mar 1, 2012 at 2:30 AM, Chris Welch <[hidden email]> wrote:

> Using Codestriker 1.9.10 with SVN 1.6, getting tab expansion problems.  See the following:
>
>
> 458            if( attempt_num < 4 )
> 459                         ++attempt_num;
> 460           else
> 461                     TSK_sleep( ticks_per_attempt );
> 462          } while( PRD_getticks() < end_tick );
>
> The tab expansion setting is at 8 for this display.  I did an od dump of the patch looking at the data representing lines 459 and 461 that they both have three tab chars and nothing else before the text, yet they have unequal tab expansion.
>
> This patch has the following white space prior to the text on the lines:
>
> Line 458 two tab lead in, nothing else
> Line 459 three tab lead in, nothing else
> Line 460 two tab lead in, nothing else
> Line 461 three tab lead in, nothing else
> Line 462 one tab lead in, nothing else
>
> Changing the display setting to 4 spaces per tabs yields:
>
> 458        if( attempt_num < 4 )
> 459             ++attempt_num;
> 460       else
> 461             TSK_sleep( ticks_per_attempt );
> 462      } while( PRD_getticks() < end_tick );
>
> Any ideas what the problem is?
>
> Tx,
>
> Chris
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Codestriker-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/codestriker-user
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Codestriker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/codestriker-user
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Codestriker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/codestriker-user
Loading...