add minimap linestate for codeedit to disable minimap (#402)

This commit is contained in:
Mike Sawka
2024-03-07 12:04:17 -08:00
committed by GitHub
parent a3d2b1a54c
commit 45a3f7e721
3 changed files with 12 additions and 1 deletions
+4
View File
@@ -89,6 +89,7 @@ const (
KwArgState = "state"
KwArgTemplate = "template"
KwArgLang = "lang"
KwArgMinimap = "minimap"
)
var ColorNames = []string{"yellow", "blue", "pink", "mint", "cyan", "violet", "orange", "green", "red", "white"}
@@ -4759,6 +4760,9 @@ func CodeEditCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (scb
if langArg != "" {
lineState[sstore.LineState_Lang] = langArg
}
if _, ok := pk.Kwargs[KwArgMinimap]; ok {
lineState[sstore.LineState_Minimap] = resolveBool(pk.Kwargs[KwArgMinimap], false)
}
update, err := addLineForCmd(ctx, "/"+GetCmdStr(pk), true, ids, cmd, "code", lineState)
if err != nil {
// TODO tricky error since the command was a success, but we can't show the output