mirror of
https://github.com/Hopiu/micro.git
synced 2026-05-10 07:44:43 +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
|
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
|
// Save the buffer to disk
|
||||||
func (v *View) Save(usePlugin bool) bool {
|
func (v *View) Save(usePlugin bool) bool {
|
||||||
if usePlugin && !PreActionCall("Save", v) {
|
if usePlugin && !PreActionCall("Save", v) {
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ var bindingActions = map[string]func(*View, bool) bool{
|
||||||
"Delete": (*View).Delete,
|
"Delete": (*View).Delete,
|
||||||
"InsertTab": (*View).InsertTab,
|
"InsertTab": (*View).InsertTab,
|
||||||
"Save": (*View).Save,
|
"Save": (*View).Save,
|
||||||
|
"SaveAll": (*View).SaveAll,
|
||||||
"SaveAs": (*View).SaveAs,
|
"SaveAs": (*View).SaveAs,
|
||||||
"Find": (*View).Find,
|
"Find": (*View).Find,
|
||||||
"FindNext": (*View).FindNext,
|
"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 {
|
} else {
|
||||||
str += " "
|
str += " "
|
||||||
}
|
}
|
||||||
str += t.views[t.CurView].Buf.GetName()
|
buf := t.views[t.CurView].Buf
|
||||||
|
str += buf.GetName()
|
||||||
|
if buf.IsModified {
|
||||||
|
str += " +"
|
||||||
|
}
|
||||||
if i == curTab {
|
if i == curTab {
|
||||||
str += "]"
|
str += "]"
|
||||||
} else {
|
} else {
|
||||||
str += " "
|
str += " "
|
||||||
}
|
}
|
||||||
indicies[len(str)-1] = i + 1
|
indicies[Count(str)-1] = i + 1
|
||||||
str += " "
|
str += " "
|
||||||
}
|
}
|
||||||
return str, indicies
|
return str, indicies
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ Delete
|
||||||
Center
|
Center
|
||||||
InsertTab
|
InsertTab
|
||||||
Save
|
Save
|
||||||
|
SaveAll
|
||||||
SaveAs
|
SaveAs
|
||||||
Find
|
Find
|
||||||
FindNext
|
FindNext
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue