"os/user"
"path/filepath"
"regexp"
+ "runtime"
"strconv"
"strings"
"time"
CompileDate = "Unknown"
// Debug logging
Debug = "ON"
+ // FakeCursor is used to disable the terminal cursor and have micro
+ // draw its own (enabled for windows consoles where the cursor is slow)
+ FakeCursor = false
)
func init() {
if err != nil {
fmt.Println("Invalid version: ", Version, err)
}
+
+ if runtime.GOOS == "windows" {
+ FakeCursor = true
+ }
}
// SliceEnd returns a byte slice where the index is a rune index
return path, nil
}
-// TODO: consider changing because of snap segfault
// ReplaceHome takes a path as input and replaces ~ at the start of the path with the user's
// home directory. Does nothing if the path does not start with '~'.
func ReplaceHome(path string) (string, error) {
func ParseSpecial(s string) string {
return strings.Replace(s, "\\t", "\t", -1)
}
+
+// String converts a byte array to a string (for lua plugins)
+func String(s []byte) string {
+ return string(s)
+}