Fix #3847#3854
Conversation
fendor
left a comment
There was a problem hiding this comment.
Hi, thank you for the fix!
Could you include a unit test for extractTextInRange that demonstrates the issue?
|
@fendor Sure! I'll do it this weekend. |
fendor
left a comment
There was a problem hiding this comment.
Thanks, this looks good to me!
| extractTextInRange (Range (Position sl sc) (Position el ec)) s = newS | ||
| where | ||
| focusLines = take (fromIntegral $ el - sl + 1) $ drop (fromIntegral sl) $ T.lines s | ||
| -- NOTE: Always append an empty line to the end to ensure there are |
There was a problem hiding this comment.
This is a little short - it's okay but it would be helpful to say why we don't have enough lines otherwise. You did all that reasoning in the ticket but now we're losing it all!
There was a problem hiding this comment.
@michaelpj
Oh yes, I thought the ticket could be enough. Should I simply give a link to that ticket or briefly describe the issue in the NOTE?
There was a problem hiding this comment.
Well, how would someone find the ticket? The way I think about it is: what would you want to read if you were encountering this code for the first time and you had no idea about the history?
|
As @michaelpj suggested, I described the issue briefly in the comment, and gave a link to the ticket for details. |
|
Great, thanks! |
No description provided.