summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-08-28 19:05:01 +0100
committerMaxime Coste <frrrwww@gmail.com>2013-08-28 19:05:01 +0100
commitef01cf71ff912579e29f6e74ab25588b2bb27cd6 (patch)
tree885409ca17e44aa65e752328cb9889ef031e5a94 /src
parentf908aa1b877a5ee75d0706992883d3ebf5c04f2c (diff)
tolerate empty strings (interpreted as 0) as line and column parameters in edit
Diffstat (limited to 'src')
-rw-r--r--src/commands.cc4
1 files 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 }));