forked from VimPlug/jedi
Fix issues with error correction / newline correction.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user