1
0
forked from VimPlug/jedi

Fix issues with error correction / newline correction.

This commit is contained in:
Dave Halter
2015-01-27 12:24:54 +01:00
parent 62e45aa42b
commit 5e8f8f7a8d
4 changed files with 40 additions and 13 deletions

View File

@@ -156,6 +156,17 @@ class Leaf(Base):
def start_pos(self):
return self._start_pos[0] + self.position_modifier.line, self._start_pos[1]
@start_pos.setter
def start_pos(self, value):
# TODO I think this is wrong, because the position_modifier.line needs
# to be looked at as well. Probably it needs to be substracted.
self._start_pos = value
@property
def end_pos(self):
return (self._start_pos[0] + self.position_modifier.line,
self._start_pos[1] + len(self.value))
def get_previous(self):
"""
Returns the previous leaf in the parser tree.
@@ -178,17 +189,6 @@ class Leaf(Base):
except AttributeError: # A Leaf doesn't have children.
return node
@start_pos.setter
def start_pos(self, value):
# TODO I think this is wrong, because the position_modifier.line needs
# to be looked at as well. Probably it needs to be substracted.
self._start_pos = value
@property
def end_pos(self):
return (self._start_pos[0] + self.position_modifier.line,
self._start_pos[1] + len(self.value))
def get_code(self):
return self.prefix + self.value