mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-21 16:27:12 +09:00
Use upstream updated zyedidia tcell
This commit is contained in:
@@ -3,7 +3,6 @@ package buffer
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
@@ -37,7 +36,6 @@ func (b *Buffer) Backup(checkTime bool) error {
|
||||
if checkTime {
|
||||
sub := time.Now().Sub(b.lastbackup)
|
||||
if sub < time.Duration(backupTime)*time.Millisecond {
|
||||
log.Println("Backup event but not enough time has passed", sub)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
@@ -47,13 +45,10 @@ func (b *Buffer) Backup(checkTime bool) error {
|
||||
backupdir := config.ConfigDir + "/backups/"
|
||||
if _, err := os.Stat(backupdir); os.IsNotExist(err) {
|
||||
os.Mkdir(backupdir, os.ModePerm)
|
||||
log.Println("Creating backup dir")
|
||||
}
|
||||
|
||||
name := backupdir + util.EscapePath(b.AbsPath)
|
||||
|
||||
log.Println("Backing up to", name)
|
||||
|
||||
err := overwriteFile(name, encoding.Nop, func(file io.Writer) (e error) {
|
||||
if len(b.lines) == 0 {
|
||||
return
|
||||
|
||||
@@ -2,7 +2,7 @@ package buffer
|
||||
|
||||
import (
|
||||
"github.com/zyedidia/micro/internal/config"
|
||||
"github.com/gdamore/tcell"
|
||||
"github.com/zyedidia/tcell"
|
||||
)
|
||||
|
||||
type MsgType int
|
||||
|
||||
Reference in New Issue
Block a user