Skip to content

Conversation

ibizaman
Copy link
Collaborator

The first two commits of this PR shows a problem and something weird with the index that insert accepts.

The problem is that inserting a line adds newlines. Looks like issue #48.

The weird thing is that it seems impossible to add a line just after a class (see first commit for that) and it seems to come from the fact that the \n after the class is still part of that class' .value (see second commit for confirmation).
It's the same thing with a "def" node.

Pierre Penninckx added 2 commits January 30, 2015 03:45
Furthermore, this shows an unexpected behaviour with the index in
a LineProxyList. The .insert(2, ...) should insert just before "class B"
but instead inserts after it. This is because the \n after "class A" is
merged with that node's value but it shouldn't.
@Psycojoker
Copy link
Member

I've fixed the whitespace stuff (at least, in a pragmatic way, forcing the diffing algorithm the handle pep8 correctly is way more work).

I'm not sure how to handle the bounding box stuff, I think that we might need to talk about it :/

@ibizaman
Copy link
Collaborator Author

ibizaman commented Feb 2, 2015

The related PR (see commit message aea6f64), is #56

Psycojoker added a commit that referenced this pull request Feb 2, 2015
Insert produces unwanted whitespaces and insert handles index weirdly
@Psycojoker Psycojoker merged commit ddb5067 into master Feb 2, 2015
@Psycojoker Psycojoker deleted the insert_whitespace branch February 2, 2015 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants