mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-26 02:17:05 +09:00
@@ -705,6 +705,24 @@ func (v *View) InsertTab(usePlugin bool) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// SaveAll saves all open buffers
|
||||
func (v *View) SaveAll(usePlugin bool) bool {
|
||||
if usePlugin && !PreActionCall("SaveAll", v) {
|
||||
return false
|
||||
}
|
||||
|
||||
for _, t := range tabs {
|
||||
for _, v := range t.views {
|
||||
v.Save(false)
|
||||
}
|
||||
}
|
||||
|
||||
if usePlugin {
|
||||
return PostActionCall("SaveAll", v)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Save the buffer to disk
|
||||
func (v *View) Save(usePlugin bool) bool {
|
||||
if usePlugin && !PreActionCall("Save", v) {
|
||||
|
||||
@@ -41,6 +41,7 @@ var bindingActions = map[string]func(*View, bool) bool{
|
||||
"Delete": (*View).Delete,
|
||||
"InsertTab": (*View).InsertTab,
|
||||
"Save": (*View).Save,
|
||||
"SaveAll": (*View).SaveAll,
|
||||
"SaveAs": (*View).SaveAs,
|
||||
"Find": (*View).Find,
|
||||
"FindNext": (*View).FindNext,
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -89,13 +89,17 @@ func TabbarString() (string, map[int]int) {
|
||||
} else {
|
||||
str += " "
|
||||
}
|
||||
str += t.views[t.CurView].Buf.GetName()
|
||||
buf := t.views[t.CurView].Buf
|
||||
str += buf.GetName()
|
||||
if buf.IsModified {
|
||||
str += " +"
|
||||
}
|
||||
if i == curTab {
|
||||
str += "]"
|
||||
} else {
|
||||
str += " "
|
||||
}
|
||||
indicies[len(str)-1] = i + 1
|
||||
indicies[Count(str)-1] = i + 1
|
||||
str += " "
|
||||
}
|
||||
return str, indicies
|
||||
|
||||
Reference in New Issue
Block a user