mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-21 00:07:16 +09:00
Add parsecursor option for file:line:col syntax
This option is disabled by default, and when enabled causes micro to parse `:line:col` as a location for the cursor rather than as part of the filename. Closes #1650 Closes #1685
This commit is contained in:
@@ -197,7 +197,11 @@ type Buffer struct {
|
||||
// and an error if the file is a directory
|
||||
func NewBufferFromFile(path string, btype BufType) (*Buffer, error) {
|
||||
var err error
|
||||
filename, cursorPos := util.GetPathAndCursorPosition(path)
|
||||
var cursorPos []string
|
||||
filename := path
|
||||
if config.GetGlobalOption("parsecursor").(bool) {
|
||||
filename, cursorPos = util.GetPathAndCursorPosition(path)
|
||||
}
|
||||
filename, err = util.ReplaceHome(filename)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user