From ef01cf71ff912579e29f6e74ab25588b2bb27cd6 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 28 Aug 2013 19:05:01 +0100 Subject: [PATCH] tolerate empty strings (interpreted as 0) as line and column parameters in edit --- src/commands.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands.cc b/src/commands.cc index 0b27d278..988550c4 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -122,10 +122,10 @@ void edit(CommandParameters params, Context& context) context.change_editor(manager.get_unused_window_for_buffer(*buffer)); } - if (param_count > 1) + if (param_count > 1 and not parser[1].empty()) { int line = std::max(0, str_to_int(parser[1]) - 1); - int column = param_count > 2 ? + int column = param_count > 2 and not parser[2].empty() ? std::max(0, str_to_int(parser[2]) - 1) : 0; context.editor().select(context.buffer().clamp({ line, column }));