catch errors when opening files given on command line

This commit is contained in:
Maxime Coste 2013-04-29 13:50:13 +02:00
parent 4a0aa96160
commit ba562367f0

View File

@ -248,7 +248,7 @@ int main(int argc, char* argv[])
global_hooks.run_hook("KakBegin", "", empty_context); global_hooks.run_hook("KakBegin", "", empty_context);
} }
if (parser.positional_count() != 0) if (parser.positional_count() != 0) try
{ {
// create buffers in reverse order so that the first given buffer // create buffers in reverse order so that the first given buffer
// is the most recently created one. // is the most recently created one.
@ -259,6 +259,10 @@ int main(int argc, char* argv[])
new Buffer(file, Buffer::Flags::New | Buffer::Flags::File); new Buffer(file, Buffer::Flags::New | Buffer::Flags::File);
} }
} }
catch (Kakoune::runtime_error& error)
{
write_debug("error while opening command line files: "_str + error.what());
}
else else
new Buffer("*scratch*", Buffer::Flags::None); new Buffer("*scratch*", Buffer::Flags::None);