From 2113b829df79f1c7427a368c84d3ffdf3d6328ae Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 12 Nov 2015 13:57:14 +0000 Subject: [PATCH] Show an info box explaining that spaces disable history recording in command prompt Fixes #477 --- src/normal.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/normal.cc b/src/normal.cc index 8d557dbf..2b279ace 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -351,10 +351,14 @@ void command(Context& context, NormalParams) context.ui().info_hide(); if (event == PromptEvent::Change and context.options()["autoinfo"].get() > 0) { + Face face = get_face("Information"); + if (cmdline.length() == 1 and is_horizontal_blank(cmdline[0_byte])) + context.ui().info_show("prompt", "commands preceded by a blank wont be saved to history", + CharCoord{}, face, InfoStyle::Prompt); + auto info = CommandManager::instance().command_info(context, cmdline); - Face col = get_face("Information"); if (not info.first.empty() and not info.second.empty()) - context.ui().info_show(info.first, info.second, CharCoord{}, col, InfoStyle::Prompt); + context.ui().info_show(info.first, info.second, CharCoord{}, face, InfoStyle::Prompt); } } if (event == PromptEvent::Validate)