Files
openchamber-android-native/third_party/mygo/ui/editor/doc.go
T
OpenChamber 6c0ee61750 feat: port the client to MyGo native UI (0.3.0)
Switch from Asuka to MyGo, keeping the API client and the feature set:

- servers: saved servers, passwordless and password login, proxy,
  self-signed certificates, per-server device tokens (Keystore), connect
  form, instance list sheet with switch/disconnect
- sessions: virtualized list, search, new session, rename/archive/delete,
  running indicator, event stream keeps it live
- chat: pushed window with system back bar, streaming Markdown via
  ui/markdown, reasoning and tool rows with image previews, footer menu
  (read aloud via a Kotlin TTS plugin, copy, fork), user message menu
  (copy, revert, fork), context usage ring and detail sheet, attachments
  (photos/files via the document picker), permissions
- release builds allow plain http:// LAN servers (Go's net/http dials
  directly, no cleartext manifest needed)
- a local fork of MyGo (third_party/mygo) lowers the Android host's
  minSdk to 24 (Android 7.0); Go 1.27.4 via mise

Version 0.3.0.
2026-11-18 13:22:59 +08:00

30 lines
1.3 KiB
Go

// Package editor is a code editor and a diff viewer for MyGo's native UI,
// on package ui.
//
// View shows a code editor of a Buffer, as Zed's: syntax highlighting,
// several carets and selections, soft wraps, folding, finding and
// replacing, completions with editable snippets, hovers, diagnostics and
// inlay hints from the
// app or a language server, and the commands and key bindings of code
// editors:
//
// st := &editor.State{Buffer: editor.NewBuffer(src)}
// st.Buffer.SetLanguage(editor.LanguageFor("main.go"))
// // In the view:
// editor.View(c, st).Fill()
//
// DiffView shows the changes between two buffers, as Pierre's diffs:
// side by side or unified, with the words changed highlighted, unchanged
// lines collapsed, annotations under lines, and the new side editable.
//
// A Language highlights its text with a Tokenizer, a line at a time, or
// with a Highlighter of its own, as a parser's: the editor gives it the
// edits of the text and asks it for the tokens of the lines it shows,
// and uses what it knows of the text's structure (SyntaxSelector,
// Folder, BracketMatcher, Indenter) for selections, folds, brackets and
// indentation.
//
// Editors lay out and paint only the lines in view: a buffer of a million
// lines scrolls and edits as one of ten.
package editor