Selaa lähdekoodia

Merge branch 'master' of github.com:johron/moose

Johan Rong 13 tuntia sitten
vanhempi
sitoutus
0b4bf26595

+ 0 - 2
internal/editor/config.go

@@ -54,5 +54,3 @@ func DefaultConfig() Config {
 
 	return config
 }
-
-

+ 3 - 3
internal/editor/draw.go

@@ -87,7 +87,7 @@ func (m *Model) DrawPalette(rect layout.Rect) {
 	strWorkspaces := make([]string, len(populatedWorkspaces))
 
 	for i, v := range populatedWorkspaces {
-	    strWorkspaces[i] = strconv.Itoa(v)
+		strWorkspaces[i] = strconv.Itoa(v)
 	}
 
 	workspacesStr := strings.Join(strWorkspaces, " ")
@@ -95,8 +95,8 @@ func (m *Model) DrawPalette(rect layout.Rect) {
 	m.Screen.PutStrStyled(1, rect.Y, workspacesStr, m.Config.StyleDefault.Foreground(tcell.GetColor(m.Config.Colors.WorkspaceForeground)).Background(tcell.GetColor(m.Config.Colors.WorkspaceBackground)))
 
 	for idx, workspace := range populatedWorkspaces {
-		if workspace == m.LM.ActiveIdx + 1 {
-			m.Screen.SetContent(idx * 2 + 1, rect.Y, '0' + rune(m.LM.ActiveIdx + 1), nil, m.Config.StyleDefault.Background(tcell.GetColor(m.Config.Colors.WorkspaceBackgroundActive)).Foreground(tcell.GetColor(m.Config.Colors.WorkspaceForegroundActive)))
+		if workspace == m.LM.ActiveIdx+1 {
+			m.Screen.SetContent(idx*2+1, rect.Y, '0'+rune(m.LM.ActiveIdx+1), nil, m.Config.StyleDefault.Background(tcell.GetColor(m.Config.Colors.WorkspaceBackgroundActive)).Foreground(tcell.GetColor(m.Config.Colors.WorkspaceForegroundActive)))
 		}
 	}
 

+ 2 - 1
internal/editor/model.go

@@ -1,9 +1,10 @@
 package editor
 
 import (
-	"github.com/gdamore/tcell/v3"
 	"moose/internal/buffer"
 	"moose/internal/layout"
+
+	"github.com/gdamore/tcell/v3"
 )
 
 type Model struct {

+ 4 - 4
internal/extension/highlight/registry.go

@@ -14,11 +14,11 @@ import "C"
 
 import (
 	"fmt"
-	"sync"
-	"unsafe"
+	"path/filepath"
 	"strings"
+	"sync"
 	"unicode"
-	"path/filepath"
+	"unsafe"
 
 	sitter "github.com/tree-sitter/go-tree-sitter"
 )
@@ -103,4 +103,4 @@ func (r *Registry) GetLanguage(langName string) (*LanguageSpec, bool) {
 	defer r.mu.RUnlock()
 	spec, ok := r.languages[langName]
 	return spec, ok
-}
+}

+ 3 - 2
internal/extension/syntax.go

@@ -1,8 +1,9 @@
 package extension
 
 import (
-	lua "github.com/yuin/gopher-lua"
 	"moose/internal/extension/highlight"
+
+	lua "github.com/yuin/gopher-lua"
 )
 
 func GetSyntaxTable(em *ExtensionManager) *lua.LTable {
@@ -40,4 +41,4 @@ func luaRegisterLanguage(L *lua.LState) int {
 	}
 
 	return 0
-}
+}