mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-30 14:47:16 +09:00
Merge pull request #233 from schollz/master
Flag to start at specified line/column number (#224)
This commit is contained in:
@@ -87,6 +87,13 @@ func LoadInput() []*Buffer {
|
||||
// We go through each file and load it
|
||||
for i := 1; i < len(os.Args); i++ {
|
||||
filename = os.Args[i]
|
||||
|
||||
// Check if +LINE,COL was passed, and send this to the flagLineColumn
|
||||
if string(filename[0]) == "+" && strings.Contains(filename, ",") {
|
||||
flagLineColumn = filename
|
||||
continue
|
||||
}
|
||||
|
||||
// Check that the file exists
|
||||
if _, e := os.Stat(filename); e == nil {
|
||||
// If it exists we load it into a buffer
|
||||
@@ -197,6 +204,9 @@ func RedrawAll() {
|
||||
// Passing -version as a flag will have micro print out the version number
|
||||
var flagVersion = flag.Bool("version", false, "Show the version number")
|
||||
|
||||
// Passing +LINE,COL will start the cursor at position LINE,COL
|
||||
var flagLineColumn = ""
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
if *flagVersion {
|
||||
|
||||
Reference in New Issue
Block a user