mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-25 18:07:07 +09:00
@@ -148,13 +148,13 @@ func (t *TabList) Display() {
|
|||||||
var Tabs *TabList
|
var Tabs *TabList
|
||||||
|
|
||||||
func InitTabs(bufs []*buffer.Buffer) {
|
func InitTabs(bufs []*buffer.Buffer) {
|
||||||
multiMode := config.GetGlobalOption("multimode").(string)
|
multiopen := config.GetGlobalOption("multiopen").(string)
|
||||||
if multiMode == "tab" {
|
if multiopen == "tab" {
|
||||||
Tabs = NewTabList(bufs)
|
Tabs = NewTabList(bufs)
|
||||||
} else {
|
} else {
|
||||||
Tabs = NewTabList(bufs[:1])
|
Tabs = NewTabList(bufs[:1])
|
||||||
for _, b := range bufs[1:] {
|
for _, b := range bufs[1:] {
|
||||||
if multiMode == "vsplit" {
|
if multiopen == "vsplit" {
|
||||||
MainTab().CurPane().VSplitBuf(b)
|
MainTab().CurPane().VSplitBuf(b)
|
||||||
} else { // default hsplit
|
} else { // default hsplit
|
||||||
MainTab().CurPane().HSplitBuf(b)
|
MainTab().CurPane().HSplitBuf(b)
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ var optionValidators = map[string]optionValidator{
|
|||||||
"colorcolumn": validateNonNegativeValue,
|
"colorcolumn": validateNonNegativeValue,
|
||||||
"fileformat": validateLineEnding,
|
"fileformat": validateLineEnding,
|
||||||
"encoding": validateEncoding,
|
"encoding": validateEncoding,
|
||||||
"multimode": validateMultiMode,
|
"multiopen": validateMultiOpen,
|
||||||
}
|
}
|
||||||
|
|
||||||
func ReadSettings() error {
|
func ReadSettings() error {
|
||||||
@@ -334,7 +334,7 @@ var DefaultGlobalOnlySettings = map[string]interface{}{
|
|||||||
"infobar": true,
|
"infobar": true,
|
||||||
"keymenu": false,
|
"keymenu": false,
|
||||||
"mouse": true,
|
"mouse": true,
|
||||||
"multimode": "tab",
|
"multiopen": "tab",
|
||||||
"parsecursor": false,
|
"parsecursor": false,
|
||||||
"paste": false,
|
"paste": false,
|
||||||
"pluginchannels": []string{"https://raw.githubusercontent.com/micro-editor/plugin-channel/master/channel.json"},
|
"pluginchannels": []string{"https://raw.githubusercontent.com/micro-editor/plugin-channel/master/channel.json"},
|
||||||
@@ -494,11 +494,11 @@ func validateEncoding(option string, value interface{}) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func validateMultiMode(option string, value interface{}) error {
|
func validateMultiOpen(option string, value interface{}) error {
|
||||||
val, ok := value.(string)
|
val, ok := value.(string)
|
||||||
|
|
||||||
if !ok {
|
if !ok {
|
||||||
return errors.New("Expected string type for multimode")
|
return errors.New("Expected string type for multiopen")
|
||||||
}
|
}
|
||||||
|
|
||||||
switch val {
|
switch val {
|
||||||
|
|||||||
@@ -223,8 +223,8 @@ Here are the available options:
|
|||||||
|
|
||||||
default value: `true`
|
default value: `true`
|
||||||
|
|
||||||
* `multimode`: specifies how to layout multiple files opened at startup.
|
* `multiopen`: specifies how to layout multiple files opened at startup.
|
||||||
Most useful as a command-line option, like `-multimode vsplit`. Possible
|
Most useful as a command-line option, like `-multiopen vsplit`. Possible
|
||||||
values correspond to commands (see `> help commands`) that open files:
|
values correspond to commands (see `> help commands`) that open files:
|
||||||
* `tab`: open each file in a separate tab.
|
* `tab`: open each file in a separate tab.
|
||||||
* `vsplit`: open files side-by-side.
|
* `vsplit`: open files side-by-side.
|
||||||
|
|||||||
Reference in New Issue
Block a user