Commit Graph

448 Commits

Author SHA1 Message Date
Adria Arrufat
80ae73c665 Fix typo for indent key 2022-12-17 10:08:33 +11:00
Maxime Coste
91d45a100a Merge remote-tracking branch 'krobelus/undo-selection-change' 2022-11-10 08:56:42 +11:00
Olivier Perret
84379f4466 Add a %val{selection_count} expansion 2022-11-04 19:16:38 +01:00
Maxime Coste
ca6a701b80 Add -to-shell-script echo switch
This feature simplifies various small use cases and is a good
companion to the existing -to-file switch.
2022-11-04 16:40:07 +11:00
Maxime Coste
98b84f2b05 Kakoune 2022.10.31 2022-10-31 09:05:58 +11:00
Tim Allen
cc66237bf5 command-parsing: Put balanced string examples in the right section.
Addressing code-review comments.
2022-10-25 16:51:26 +11:00
Tim Allen
1b8381461d command-parsing: You *cannot* escape the delimiters of balanced strings.
Originally the page said:

> No other escaping takes place in balanced strings.

...but in the course of a general readability rewrite (56287da) this was
changed to:

> Characters may be escaped in the same manner as those for quoted strings.

...which is not actually true; probably this change made it in because there
were a lot of good changes in those commits and we didn't read them all closely
enough.

Now the documentation is correct again, and I've added some examples covering
the problems people occasionally ask about (see #2760).
2022-10-20 23:11:20 +11:00
Tim Allen
7b095a6465 command-parsing: Link to Balanced Strings when we mention that section. 2022-10-20 23:02:25 +11:00
Jakub Wasilewski
69f4d1261b Correct and unify descriptions of normal mode C key behavior
Fixes #4747
2022-10-11 08:39:34 +02:00
Johannes Altmanninger
c2ab5d4694 Allow to undo and redo selection changes
From the issue:

> It often happens to me that I carefully craft a selection with multiple
> cursors, ready to make changes elegantly, only to completely mess it
> up by pressing a wrong key (by merging the cursors for example). Being
> able to undo the last selection change (even if only until the previous
> buffer change) would make this much less painful.

Fix this by recording selection changes and allowing simple linear
undo/redo of selection changes.

The preliminary key bindings are <c-h> and <c-k>.
Here are some other vacant normal mode keys I considered

	X Y
	<backspace> <minus>
	# ^ =
	<plus> '

unfortunately none of them is super convenient to type.  Maybe we
can kick out some other normal mode command?

---

This feature has some overlap with the jump list (<c-o>/<c-i>) and
with undo (u) but each of the three features have their moment.

Currently there's no special integration with either peer feature;
the three histories are completely independent.  In future we might
want to synchronize them so we can implement Sublime Text's "Soft
undo" feature.

Note that it is possible to restore selections that predate a buffer
modification. Depending on the buffer modification, the selections
might look different of course. (When trying to apply an old buffer's
selection to the new buffer, Kakoune computes a diff of the buffers
and updates the selection accordingly. This works quite well for
many practical examples.)

This makes us record the full history of all selections for each
client. This seems wasteful, we could set a limit. I don't expect
excessive memory usage in practice (we also keep the full history of
buffer changes) but I could be wrong.

Closes #898
2022-09-02 02:59:47 +02:00
Johannes Altmanninger
ce985062bc doc keymap: update for <space>/, swap 2022-08-17 00:48:12 +02:00
Johannes Altmanninger
02058e0427 Clarify changelog on user mode prompt history
This wording was valid for an old version of that patch that foolishly
add a switch to "map" to allow recording history.  Happily we found
a better solution. Now commands inside user mappings never add to
prompt history (unless you use "set-register"), so be clear about that.
2022-08-17 00:48:12 +02:00
Maxime Coste
31e9fc3cef Merge remote-tracking branch 'krobelus/history-in-mappings' 2022-08-03 20:37:44 +10:00
Maxime Coste
fa209a9a97 Merge remote-tracking branch 'krobelus/document-history-registers' 2022-08-03 19:51:22 +10:00
Johannes Altmanninger
c335712e4e doc registers: document prompt history registers
So far they have only been talked about in source code
(HistoryRegister), not in documentation.

Let's give them an official name so users can find them better;
"prompt history register" seems better than "history register" since
the former gives more context. OTOH, in future other registers (like @)
could grow into history registers, so I'm not sure.

State that the history registers are only changed by _interactive_
prompts; that's not quite true yet for user modes but I'll push a
separate fix for that.
2022-08-01 10:15:52 +02:00
Johannes Altmanninger
395f438378 Remove unnecessary leading space in prompt from mappings
We often use the pattern «map global normal ": foo"».  The space
after the colon is unnecessary since execution of the mapping won't
add to history anyway, since 217dd6a1d (Disable history when executing
maps, 2015-11-10).
With the parent commit, the space is no longer necessary for user
mappings, so there is no reason to continue the cargo-cult.

Remove the space from mappings to set a good example.
2022-08-01 07:37:02 +02:00
Johannes Altmanninger
a36473f4bb Do not record prompt history when executing user mode mappings
Commit 217dd6a1d (Disable history when executing maps, 2015-11-10)
made it so with

	map global normal X %{:echo 123<ret>}

X does not add to prompt history (%reg{:}).

Unfortunately this behavior was not extended to mappings in the "user"
keymap, nor to mappings in custom user modes.
In my experience, not adding to history is almost always the expected
behavior for mappings. Most users achieve this by adding a leading space:

	map global user X %{: echo 123<ret>}

but that's awkward. We should have good defaults (no nnoremap)
and map should work the same way across all modes.

Fix this by also disabling history when executing user mappings. This
is a breaking change but I think it only breaks hypothetical scenarios.

I found some uses where user mappings add to history but none of them
looks intentional.

f702a641d1/.config/kak/kakrc (L169)
604ef1c1c2/kakrc (L96)
d22e7d6f68/kak/kakrc (L71)
https://grep.app/search?q=map%20%28global%7Cbuffer%7Cwindow%29%20user%20.%2A%5B%21%3A/%5D%5B%5E%20%5D.%2A%3Cret%3E&regexp=true
2022-08-01 07:37:02 +02:00
Johannes Altmanninger
f435b2b70a doc execeval: mention that the colon register is saved by default 2022-08-01 07:15:08 +02:00
Johannes Altmanninger
487056daf7 doc registers: fix asciidoc syntax for <a-*>
GitHub renders this as

	*, <a->*, s

while :doc renders it as

	*, <a->, *s

with this fix it's

	*, <a-*>, s
2022-07-30 22:18:37 +02:00
Johannes Altmanninger
545c8429e0 doc keys: avoid pleonasm 2022-07-30 22:18:37 +02:00
Maxime Coste
f137ee6595 Merge remote-tracking branch 'Pound-Hash/docs_faces' 2022-07-28 21:19:52 +10:00
Pound_Hash
12c2b53105 Made changes suggested by krobelus 2022-07-26 13:42:28 -07:00
Pound_Hash
9364796033 [faces.asciidoc] Amended English mechanics and styling for correctness
and clarity.
2022-07-15 19:12:57 -07:00
Alan
f5763aaeff
Update doc/pages/execeval.asciidoc
Co-authored-by: Screwtapello <thristian@gmail.com>
2022-07-13 23:22:55 -07:00
Pound_Hash
0bbab694be Amended the documentation for grammatical correctness, neatness, uniformity,
and clarity.
2022-07-13 19:41:42 -07:00
Johannes Altmanninger
52688509b3 doc changelog: update with some breaking changes 2022-07-10 23:07:46 +02:00
Maxime Coste
2d8456db10 Move user mappings to <space> and keep/remove selection to , 2022-07-05 08:43:40 +10:00
Maxime Coste
ef8a11b3db Make x just select the full lines
`x` is often criticized as hard to predict due to its slightly complex
behaviour of selecting next line if the current one is fully selected.

Change `x` to use the previous `<a-x>` behaviour, and change `<a-x>` to
trim to fully selected lines as `<a-X>` did.

Adapt existing indentation script to the new behaviour
2022-07-05 08:43:40 +10:00
Maxime Coste
d13b3f41cb Merge remote-tracking branch 'potatoalienof13/fixdoc' 2022-06-30 19:52:43 +10:00
Maxime Coste
d87ee212ba Insert all register values in prompt after <c-r> when Alt-modified
`<c-r><a-.>` will insert all selections joined by space instead of only
the main one as `<c-r>.` would.
2022-06-30 16:39:18 +10:00
potatoalienof13
810071a6ee Finish broken sentence 2022-06-28 18:27:00 -04:00
Maxime Coste
21b17aa265 Merge remote-tracking branch 'Pound-Hash/doc_buffers' 2022-06-14 08:45:20 +10:00
Sidharth Kshatriya
5a5fc50c12 highlighter doc: some clarificatory edits 2022-05-23 16:52:30 +05:30
Pound_Hash
3a661bd27c Amended grammar, punctuation, and word choice. 2022-05-17 10:39:06 -07:00
Maxime Coste
860be32ddd Merge branch 'command_parsing' of http://github.com/Pound-Hash/kakoune 2022-05-16 19:46:58 +10:00
Pound_Hash
a3c0665acc 1) Modified some wording to be more precise
2) Reformatted paragraphs to wrap at column 80
3) Added periods are the end of several lines for overall consistency
2022-05-10 09:53:03 -07:00
Dan Rosén
3b0f69a6d6
Fix documentation for %val{window_range}
Makes line and column be the right way around in the docs.
2022-04-22 21:26:15 +02:00
Pound_Hash
56287daac0 Fixed English mechanics: grammar, punctuation, and wording 2022-04-16 12:08:24 -07:00
Maxime Coste
b2c6bc4690 Merge branch 'doc-buffers' of http://github.com/Pound-Hash/kakoune 2022-04-11 19:55:34 +10:00
Pound_Hash
dbc88281c7 Fixed grammar; rendered the construction parallel. 2022-04-10 21:49:54 -07:00
Johannes Altmanninger
7c43a4b51b doc: fix dead links to doc pages 2022-04-09 15:29:54 +02:00
Johannes Altmanninger
0f0f2b126d doc commands: fix names of complete-command's completion_type arguments 2022-03-08 22:10:28 +01:00
Maxime Coste
d95d351cbe Document ! and <a-!> breaking change 2022-03-06 10:13:14 +11:00
Frank LENORMAND
85b78dda2e src: Select the data inserted by ! and <a-!>
Closes #1468
2022-03-06 10:13:14 +11:00
Maxime Coste
7061001728 Add a complete-command command to configure command completion
This makes it possible to change command completion in hooks and
paves the way to more flexibility in how custom commands can be
completed
2022-03-06 10:13:14 +11:00
Coleman McFarland
0b5ed7613f Update module description in response to code review 2022-02-14 10:20:10 -05:00
Coleman McFarland
f206640abc Grammar correction options.asciidoc 2022-02-13 21:27:31 -05:00
Coleman McFarland
c682f30ab6 Change "edition" to "editing" in keys.asciidoc 2022-02-13 21:18:35 -05:00
Coleman McFarland
11f98dc0f1
Add brief modules explanation
In lieu of adding a whole docs page for modules, a brief introduction can
be added above the provide-module and require-module command docs.
2022-02-13 15:15:07 -05:00
Johannes Altmanninger
c120063da9 doc options: more detail on how completions options are handled
Cross-reference the "completers" option, and explain how filtering works.

Originally submitted as part of #4418

Helped-by: Tim Allen <screwtape@froup.com>
2022-01-10 08:59:30 +11:00