From f57a4e589e873ff75b058b7cff38a2bc128b8487 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Thu, 22 Jun 2017 12:44:47 +0300 Subject: [PATCH] doc: Explain why `a` modifies the selection and `i` doesn't --- doc/manpages/faq.asciidoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/manpages/faq.asciidoc b/doc/manpages/faq.asciidoc index ed724d86..d80ffa6d 100644 --- a/doc/manpages/faq.asciidoc +++ b/doc/manpages/faq.asciidoc @@ -191,3 +191,16 @@ In order to open buffers in the same window simultaneously using `tmux` (or one of the supported multiplexers), run Kakoune in a `tmux` session, and simply use the `:new` command to spawn new clients as you would have otherwise in an X11 environment. + +Why does `a` extend the current selection, but `i` leaves it untouched ? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Selections are ranges of characters whose delimiters are an "anchor" and +a "cursor", and inserting characters is always done before the cursor in +insert mode. + +Consequently, using the append primitive (`a`) nudges the cursor forward to +make room for characters, effectively extending the current selection since +the anchor remains immobile, even when the anchor and the cursor are at the +same location. By opposition, using the insert primitive (`i`) merely adds +characters before the cursor, which never modifies the current selection.