Documentation
¶
Overview ¶
Command editor is a small text editor on a WidgetsApp, without Material. The left panel is a multi-line EditableText with undo and redo (Ctrl+Z, Shift+Ctrl+Z and Ctrl+Y). Ctrl+S, a Shortcuts binding that maps to a SaveIntent, writes the text to $XDG_DATA_HOME/glutter-editor/notes.txt (or ~/.local/share/...) in a goroutine with a context.Context; a failure shows in the status bar. A web page has no data directory, so on the web (foundation.IsWeb) the notes are kept in memory for as long as the page is open, and the status bar says so. The right panel is a read-only SelectableRegion with the saved file, which you can select and copy. The status bar shows the line and column of the caret, the number of lines, words and characters, and whether the text has unsaved changes. It uses only the public packages.
Run it with: go run ./examples/editor On the web: go run ./cmd/glutter-web serve ./examples/editor
Environment: GLUTTER_BACKEND=x11|wayland, GLUTTER_SCREENSHOT=<file.png>, GLUTTER_SCREENSHOT_AFTER=<duration>. In debug builds: GLUTTER_DEV_DATA_DIR=<dir> keeps the notes in that directory (instead of the data directory of the user), GLUTTER_DEV_TEXT=<text> replaces the text of the editor once the saved file is loaded (\n is a new line), and GLUTTER_DEV_SELECT=<start,end> selects that byte range of the text.