Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

English | 简体中文

SweetEditor

Cross-Platform Code Editor Core (C++17)

A C++17 core with platform-native rendering, built for long-term editor infrastructure in IDEs, AI programming tools, cloud development workspaces, and similar products.

C++17 Targets License

Android / iOS / macOS / Windows / Swing / OHOS / Flutter / Avalonia / Web


Project Positioning

SweetEditor is a cross-platform code editor core for products that need consistent editing behavior across supported platforms.

It adopts a "C++17 core + platform-native rendering" architecture: the C++ core is responsible for document editing semantics, text layout, and the decoration model, while each integration layer handles input forwarding and rendering.

It is suited for long-term editor infrastructure in IDEs, AI programming tools, cloud development workspaces, and similar products.

Core Features

  • One unified core, reused across platforms: capabilities such as highlighting, folding, Inlay Hints, Ghost Text, and structural guides are all generated by a single C++ core
  • Separation of core and rendering: integration layers focus on input bridging and native drawing, reducing regression risk and maintenance cost across targets
  • Comprehensive advanced editing capabilities: supports code folding, snippets, linked editing, diagnostic decorations, completion extensions, and more
  • A clear performance path: built on Piece Table, incremental layout, viewport rendering, SIMD Unicode acceleration, and mmap-based large-file loading
  • Friendly integration: supports Android, Apple platforms, Windows, Swing, OHOS, Flutter, Avalonia, and Web

Implementation Status

TargetStatusRendering TechnologyUI FrameworkImplementation
AndroidImplementedCanvas + PaintAndroid ViewAndroid README
iOSImplementedCoreText + CoreGraphicsUIKit / SwiftUI (being refined)Apple README
macOSImplementedCoreText + CoreGraphicsAppKit / SwiftUI (being refined)Apple README
WindowsImplementedGDI+WinFormsWinForms README
SwingImplementedJava2DSwingSwing README
OHOSImplementedArkUI CanvasArkUIOHOS README
FlutterImplementedTextPainterFlutterFlutter README
AvaloniaImplementedDrawingContextAvaloniaAvalonia README
QtImplementedQPainterQtFinalScave/SweetEditor-Qt
Compose MultiplatformIn ProgressCompose CanvasComposelumkit/SweetEditor-Compose
WebCore bindings implementedWebAssembly-Web README
C# WinUIPlanned---

Overall Architecture

+-----------------------------------------------------------------------------------+
| Android | Apple | Swing | WinForms | OHOS | Flutter | Avalonia | Web             |
| Input / rendering / native resources / lifecycle                                 |
+-----------------------------------------------------------------------------------+
                                         |
                                         v
+-----------------------------------------------------------------------------------+
| SweetEditor Core (C++17)                                                          |
| Document / editing / layout / decorations / interaction / undo and redo           |
+-----------------------------------------------------------------------------------+

For the full architecture documentation, see Architecture

Core Capabilities

The C++ core covers document editing (Piece Table, undo/redo, large-file loading), text layout (word wrapping, incremental layout, viewport clipping), styling and decorations (syntax/semantic highlighting, Inlay Hints, Ghost Text, diagnostics, structural guides), advanced editing (code folding, snippets, linked editing), and platform extension mechanisms (DecorationProvider, CompletionProvider). Performance is built on SIMD Unicode transcoding, measurement caching, and viewport-level rendering.

For the complete capability list, see EditorCore API.

Quick Start

Build

git clone https://github.com/FinalScave/SweetEditor.git
cd SweetEditor
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . -j

For quick-start guides, start with the implementation README files below. For bridge and control API details, see the Integration API Index.

Minimal Integration Example

SweetEditor editor = new SweetEditor(context);
editor.applyTheme(EditorTheme.dark());
editor.loadDocument(new Document("Hello, SweetEditor!"));

For more examples, see the integration API documentation.

Demo Screenshots

Android
Android screenshot
macOS
macOS screenshot
Windows (WinForms)
WinForms screenshot
Swing
Swing screenshot

The original Android screenshot has a relatively low resolution, so it is displayed here at a smaller width.

Dependencies

SweetEditor follows a minimal-dependency principle. The core runtime depends only on a small set of lightweight libraries:

  • simdutf: SIMD-accelerated Unicode encoding and decoding
  • nlohmann/json: JSON debug export and internal helper structures
  • utfcpp: UTF-8 iteration and validation

Testing uses Catch2.

Documentation

DocumentDescription
ArchitectureCore architecture, module design, data flow, and rendering pipeline
EditorCore APIReference for the C++ core layer and C API
Integration API IndexEntry point for all integration API documents
Integration Implementation StandardRequired types, module structure, API contracts, and compliance rules for all integrations
ContributingRepository structure, reading entry points, and platform synchronization checkpoints

Integration Guides

TargetGuide
AndroidAndroid README
AppleApple README
AvaloniaAvalonia README
FlutterFlutter README
OHOSOHOS README
SwingSwing README
WinFormsWinForms README
WebWeb README

Contributing

SweetEditor is building an open ecosystem for cross-platform editor infrastructure, and contributions are welcome.

See Contributing Guide for details.

Community

Discord

Join Discord
QQ

QQ group QR code

QQ Group ID: 1090609035

WeChat

WeChat group QR code

License

SweetEditor is licensed under the MIT License.

关于 About

One core. Every platform. SweetEditor is an industrial-grade C++17 code editor engine delivering native, IDE-class editing on Android, iOS, macOS, Windows, Web, and Swing with blazing performance and unified behavior.

语言 Languages

C++56.0%
Java14.7%
C#12.5%
Swift6.9%
Dart5.6%
Python2.5%
PowerShell0.8%
CMake0.6%
Shell0.4%
C0.1%
Kotlin0.0%
TypeScript0.0%
Lua0.0%
Objective-C0.0%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
434
Total Commits
峰值: 114次/周
Less
More

核心贡献者 Contributors