When the end of the region is at the beginning of a line,
agent-shell--get-region-context includes the line following the end
of the region, in both the line numbers and the snippet that get
pasted into the shell buffer.
For example, in the LICENSE file in this repo, starting with point at
the beginning of the buffer, press:
C-n C-n C-n C-SPC C-n C-n C-n M-x agent-shell
This inserts the following text:
LICENSE:4-7
4: Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5: Everyone is permitted to copy and distribute verbatim copies
6: of this license document, but changing it is not allowed.
7:
Whereas I would have expected it to insert:
LICENSE:4-6
4: Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5: Everyone is permitted to copy and distribute verbatim copies
6: of this license document, but changing it is not allowed.
By the way, this also affects evil-mode users when using line-based
selections (V) because region-end naturally ends up at the beginning
of the line following the actual selection.
Checklist
When the end of the region is at the beginning of a line,
agent-shell--get-region-contextincludes the line following the endof the region, in both the line numbers and the snippet that get
pasted into the shell buffer.
For example, in the LICENSE file in this repo, starting with point at
the beginning of the buffer, press:
This inserts the following text:
Whereas I would have expected it to insert:
By the way, this also affects evil-mode users when using line-based
selections (V) because
region-endnaturally ends up at the beginningof the line following the actual selection.
Checklist