]> git.lizzy.rs Git - micro.git/commit
Fix -startpos flag being ignored (#1129)
authorDimitar Borislavov Tasev <dimtasev@gmail.com>
Mon, 4 Jun 2018 16:27:27 +0000 (17:27 +0100)
committerZachary Yedidia <zyedidia@gmail.com>
Mon, 4 Jun 2018 16:27:27 +0000 (12:27 -0400)
commitaa74b1233cfababe477a35f39ed73443ddfc5ed5
tree4553719dc4c87aad89126320411578264b0ee096
parent61baa73d70750fc3cb235a2a806a64709605542b
Fix -startpos flag being ignored (#1129)

* Refactored cursor location login into a function. Fixed buffer overflow when line position is 1 more than file lines

* Fixed crash when -startpos has an invalid argument

* Adapted tests to new interface

* Fixed bug where -startpos with lines 0 and 1 would both be on the first line

* Changed Fatalf format back to digits

* Fixed issues with buffer cursor location. Added tests for new function

* ParseCursorLocation will now return an error when path doesnt contain line/col

* Fixed off-by-one line error

* Fixed tests to account for subtracting 1 from the line index
cmd/micro/buffer.go
cmd/micro/buffer_test.go [new file with mode: 0644]
cmd/micro/util.go
cmd/micro/util_test.go