summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-02-19 13:59:44 +0000
committerMaxime Coste <mawww@kakoune.org>2017-02-19 13:59:44 +0000
commit9fdbcf761d60f1c87744ae94bd3778d35acc5687 (patch)
tree03646272a5a33e480a0a763fc6b54386698864a6 /src
parent9271f0a87d0e772f9aa2647367ddfba9dfffd72b (diff)
Display an info box on startup with recent breaking changes
Diffstat (limited to 'src')
-rw-r--r--src/main.cc34
1 files changed, 25 insertions, 9 deletions
diff --git a/src/main.cc b/src/main.cc
index 618bd249..9d98468e 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -36,6 +36,15 @@
namespace Kakoune
{
+static const char* startup_info =
+"Kakoune recent breaking changes:\n"
+" * <a-'> (rotate selection contents) is now <a-\">,\n"
+" <a-'> is rotate selections backwards.\n"
+" * The `identifier` face has been replaced with `variable`,\n"
+" `function` and `module`, update your custom colorschemes\n"
+" * BufNew and BufOpen hooks have been renamed to BufNewFile\n"
+" and BufOpenFile.\n";
+
struct startup_error : runtime_error
{
using runtime_error::runtime_error;
@@ -467,10 +476,11 @@ struct convert_to_client_mode
enum class ServerFlags
{
- None = 0,
+ None = 0,
IgnoreKakrc = 1 << 0,
- Daemon = 1 << 1,
- ReadOnly = 1 << 2,
+ Daemon = 1 << 1,
+ ReadOnly = 1 << 2,
+ StartupInfo = 1 << 3,
};
template<> struct WithBitOps<ServerFlags> : std::true_type {};
@@ -570,14 +580,19 @@ int run_server(StringView session,
try
{
if (not (flags & ServerFlags::Daemon))
+ {
local_client = client_manager.create_client(
create_local_ui(ui_type), get_env_vars(), init_cmds, init_coord);
- if (local_client and startup_error)
- local_client->print_status({
- "error during startup, see *debug* buffer for details",
- get_face("Error")
- });
+ if (startup_error)
+ local_client->print_status({
+ "error during startup, see *debug* buffer for details",
+ get_face("Error")
+ });
+
+ if (flags & ServerFlags::StartupInfo)
+ local_client->info_show("Welcome to Kakoune", startup_info, {}, InfoStyle::Prompt);
+ }
while (not terminate and (not client_manager.empty() or (flags & ServerFlags::Daemon)))
{
@@ -891,7 +906,8 @@ int main(int argc, char* argv[])
{
auto flags = (parser.get_switch("n") ? ServerFlags::IgnoreKakrc : ServerFlags::None) |
(parser.get_switch("d") ? ServerFlags::Daemon : ServerFlags::None) |
- (parser.get_switch("ro") ? ServerFlags::ReadOnly : ServerFlags::None);
+ (parser.get_switch("ro") ? ServerFlags::ReadOnly : ServerFlags::None) |
+ (argc == 1 ? ServerFlags::StartupInfo : ServerFlags::None);
return run_server(session, init_cmds, init_coord, flags, ui_type, files);
}
catch (convert_to_client_mode& convert)