poppopjmp / shedskin

Automatically exported from code.google.com/p/shedskin
0 stars 0 forks source link

annotations missing last character of last line #155

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. annotate anything where the last line is not empty 
2. observe the last character is missing

Fix:

annotate.py, paste function, change this line:

line = source[expr.lineno-1][:-1]

to just:

line = source[expr.lineno-1]

(there's an rstrip on the line below, so the \n gets zapped there anyway.)

(P.S. I think the general using a regex to strip the comments is also a bit 
fuzzy but it hasn't bitten me because I don't have any # inside strings)

Original issue reported on code.google.com by willvar...@gmail.com on 30 Sep 2011 at 12:53

GoogleCodeExporter commented 8 years ago
regards regex, I meant # inside comments

Original comment by willvar...@gmail.com on 30 Sep 2011 at 12:54

GoogleCodeExporter commented 8 years ago
sorry for the late reply! and thanks for the patch. hmm, this is really crufty 
old code, way back from when I was still learning python I guess.. further 
cleanups much appreciated ;-) 

I committed your change, and used str.rstrip instead of string.rstrip. thanks 
again! what name should I use for you on the front page?

Original comment by mark.duf...@gmail.com on 11 Oct 2011 at 2:55

GoogleCodeExporter commented 8 years ago
no mention on the front-page required :)

Original comment by willvar...@gmail.com on 11 Oct 2011 at 6:15