Difference between revisions of "Mini Micro code editor"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "Mini Micro comes with a built-in code editor, accessed with the <c>edit</c> command. == General Usage == == Toolbar Buttons == == Search & Replace == == Customization...")
 
Line 9: Line 9:
 
== Customization ==
 
== Customization ==
  
As of Mini Micro version 1.2, you can customize the colors used by the code editor by creating a map of color names to colors, and assigning this to <c>env.editorColors</c>.  The following example shows how to use this to create a "dark mode" color theme.
+
As of Mini Micro version 1.2, you can customize the [[color]]s used by the code editor by creating a map of color names to colors, and assigning this to <c>env.editorColors</c>.  The following example shows how to use this to create a "dark mode" color theme.
  
 
<ms>// Set up a dark theme for the editor.
 
<ms>// Set up a dark theme for the editor.

Revision as of 21:37, 25 February 2023

Mini Micro comes with a built-in code editor, accessed with the edit command.

General Usage

Toolbar Buttons

Search & Replace

Customization

As of Mini Micro version 1.2, you can customize the colors used by the code editor by creating a map of color names to colors, and assigning this to env.editorColors. The following example shows how to use this to create a "dark mode" color theme.

// Set up a dark theme for the editor.
m = {}
m.codeBackground = "#333333"
m.noCodeBackground = "#000000"
m.lineNumber = "#666666"
m.caret = "#CCCCCCCC"
m.toolbarTint = "#CCCCFF"  // (keep light for best results)

m.text = {}
m.text.default = "#BBBBBB"
m.text.operator = "#AAAADD"
m.text.string = "#DDAAAA"
m.text.openString = "#FF0000"
m.text.identifier = "#BBBBBB"
m.text.comment = "#FFFFCC"
m.text.number = "#88FF88"
m.text.keyword = "#FF99FF"
m.text.colon = color.fuchsia
m.text.paren = ["#00FFFF", "#FF8800", "#CC44FF", "#00FF00"]
m.text.bracket = m.text.paren

env.editorColors = m

The above example shows all the supported color keys. Note that text.paren and text.bracket are lists of colors, rotated through to indicate deeper levels of nested parentheses or square brackets. These lists may be as long or short as you like.


This article is a stub. You can help the MiniScript Wiki by expanding it.