mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-28 22:08:12 +09:00
Allow overwriting options with flags
Fixes #258 Also related to #233, this commit also changes how +LINE,COL works. Now it is micro -startpos LINE,COL file.
This commit is contained in:
@@ -89,9 +89,9 @@ func NewBuffer(txt []byte, path string) *Buffer {
|
||||
// Put the cursor at the first spot
|
||||
cursorStartX := 0
|
||||
cursorStartY := 0
|
||||
// If +LINE,COL was passed, use start position LINE,COL
|
||||
if len(flagLineColumn) > 0 {
|
||||
positions := strings.Split(flagLineColumn[1:], ",")
|
||||
// If -startpos LINE,COL was passed, use start position LINE,COL
|
||||
if len(*flagStartPos) > 0 {
|
||||
positions := strings.Split(*flagStartPos, ",")
|
||||
if len(positions) == 2 {
|
||||
lineNum, errPos1 := strconv.Atoi(positions[0])
|
||||
colNum, errPos2 := strconv.Atoi(positions[1])
|
||||
|
||||
Reference in New Issue
Block a user