diff options
| author | Maxime Coste <mawww@kakoune.org> | 2019-12-18 11:36:17 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2019-12-18 11:36:17 +1100 |
| commit | b68490ef11734c404f8a18f1babd8004aca2de06 (patch) | |
| tree | 82ffc4180aa05d440df4a4d79adb57871af3948b /src/buffer_utils.hh | |
| parent | cbb7f601f665e77a7ee1b338e87a413738dba43f (diff) | |
Cleanup replaced range selection logic
Do not access Buffer::m_changes to find the inserted range, return
it directly from Buffer::insert and Buffer::replace. This fixes a
wrong behaviour where replacing at eof would lose the selected end
of line (as the implementation does not actually replace that end
of line)
Diffstat (limited to 'src/buffer_utils.hh')
| -rw-r--r-- | src/buffer_utils.hh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/buffer_utils.hh b/src/buffer_utils.hh index 586cbb1d..a3e43068 100644 --- a/src/buffer_utils.hh +++ b/src/buffer_utils.hh @@ -20,7 +20,7 @@ inline BufferCoord erase(Buffer& buffer, const Selection& range) return buffer.erase(range.min(), buffer.char_next(range.max())); } -inline BufferCoord replace(Buffer& buffer, const Selection& range, StringView content) +inline BufferRange replace(Buffer& buffer, const Selection& range, StringView content) { return buffer.replace(range.min(), buffer.char_next(range.max()), content); } |
