Overwrite the text of this object in the Vim Buffer and update its length information. If 'gtext' is None use the initial text of this object.
(self, buf, gtext)
| 112 | self.overwrite(buf, self._initial_text) |
| 113 | |
| 114 | def overwrite(self, buf, gtext): |
| 115 | """Overwrite the text of this object in the Vim Buffer and update its |
| 116 | length information. |
| 117 | |
| 118 | If 'gtext' is None use the initial text of this object. |
| 119 | |
| 120 | """ |
| 121 | # We explicitly do not want to move our children around here as we |
| 122 | # either have non or we are replacing text initially which means we do |
| 123 | # not want to mess with their positions |
| 124 | if self.current_text == gtext: |
| 125 | return |
| 126 | old_end = self._end |
| 127 | self._end = _replace_text(buf, self._start, self._end, gtext) |
| 128 | if self._parent: |
| 129 | self._parent._child_has_moved( |
| 130 | self._parent._children.index(self), |
| 131 | min(old_end, self._end), |
| 132 | self._end.delta(old_end), |
| 133 | ) |
| 134 | |
| 135 | def _update(self, done, buf): |
| 136 | """Update this object inside 'buf' which is a list of lines. |
no test coverage detected