summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxificurC <xificurC@gmail.com>2015-06-30 16:06:49 +0200
committerxificurC <xificurC@gmail.com>2015-06-30 16:06:49 +0200
commitfbb216d2eddee99787e87de9c22a8e4780dccf12 (patch)
treec1180d9b57b20a5784875bfc66a2402d22a2394b
parent670d8f7d1ebbe5a1eb6cc6a37691c2e2a791c578 (diff)
commands starting with horizontal whitespace don't go into the history
-rw-r--r--README.asciidoc4
-rw-r--r--src/input_handler.cc2
2 files changed, 4 insertions, 2 deletions
diff --git a/README.asciidoc b/README.asciidoc
index f76330b4..2915621b 100644
--- a/README.asciidoc
+++ b/README.asciidoc
@@ -466,7 +466,9 @@ Commands
When pressing `:` in normal mode, Kakoune will open a prompt to enter a command.
Commands are used for non editing tasks, such as opening a buffer, writing the
-current one, quitting, etc.
+current one, quitting, etc. You can cycle through the command history with
+`<c-p>` and `<c-n>`. Commands starting with horizontal whitespace (e.g. a
+space) will not be saved in the command history.
Basic Commands
~~~~~~~~~~~~~~
diff --git a/src/input_handler.cc b/src/input_handler.cc
index 5e11bfa6..30c14110 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -842,7 +842,7 @@ private:
static void history_push(History& history, StringView entry)
{
- if(entry.empty())
+ if(entry.empty() or is_horizontal_blank(entry[0_byte]))
{
return;
}