mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-17 06:20:28 +00:00
parent
8d1618692e
commit
a6ee75a9cf
5 changed files with 27 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ Delete
|
|||
Center
|
||||
InsertTab
|
||||
Save
|
||||
SaveAll
|
||||
SaveAs
|
||||
Find
|
||||
FindNext
|
||||
|
|
|
|||
Loading…
Reference in a new issue