
# LN Code Editor
**A modern, lightweight mobile code editor and portable IDE built for Android**
[](https://flutter.dev)
[](https://dart.dev)
[-green.svg)](https://gitea.lzxnone.cloud/lzxnone/LN-Code-Editor)
[](LICENSE)
[](https://gitea.lzxnone.cloud/lzxnone/LN-Code-Editor)
[็ฎไฝไธญๆ](README.md) | **English**
---
## ๐ Introduction
**LN Code Editor** is a high-performance mobile code editor and pocket IDE crafted for Android. Fully optimized for touch-screen workflows, it features multi-language syntax highlighting, smart code completion and real-time diagnostics, a visual Git conflict resolver, and a **rootless built-in Linux container with a full PTY shell**, enabling developers to read, write, and debug code seamlessly on phones and tablets.
---
## โจ Key Features
### 1. ๐ Professional Code Editing Experience
- **Multi-Language Syntax Highlighting**: Powered by `re_editor` and `re_highlight` for fast, accurate lexical coloring.
- **Smart Completion & Real-Time Diagnostics**:
- Real-time auto-completion suggestions for variables, functions, and keywords.
- Inline wavy underlines for syntax errors and gutter indicators by line number.
- **Master toggle + independent Completion / Diagnostics switches** to fit both distraction-free reading and rapid coding.
- **Pinch-to-Zoom & Typography**: Smooth two-finger pinch zoom for font sizing, bundled with JetBrains Mono and Fira Code Nerd Fonts.
### 2. ๐ฟ Visual Git Conflict Resolver
- **Automatic Conflict Detection**: Detects all `<<<<<<<`, `=======`, and `>>>>>>>` conflict blocks in a file.
- **Inline Diff Comparison**: Highlights current and incoming changes clearly side by side.
- **Quick Resolution Actions**:
- *Accept Current*
- *Accept Incoming*
- *Accept Both*
- *Manual Edit*
- **Mobile-Friendly Interaction**: Overflow-safe horizontal scrolling and coordinated menu/drawer dismissal during conflict editing.
### 3. ๐ง Rootless Built-in Linux Container & Terminal
- **Real Shell Environment**: Wraps a lightweight Alpine Linux container via PRoot (and optional Chroot mode when Root is available) to provide native Linux CLI capabilities without requiring Root.
- **Smooth Terminal Interaction**: Built on a customized `xterm.dart` and `flutter_pty` with long-press and gesture text selection, crisp typography, and virtual shortcut keys.
- **Rich CLI Ecosystem**: Run `git`, `apk`, `curl`, `python`, and other standard Linux tools directly on Android.
### 4. ๐จ Swiss Minimalist Design
- Immersive dark theme designed to keep the focus on your code.
- High-contrast dual-tone Swiss minimalist icon with full Android 8.0+ Adaptive Icon support.
### 5. ๐ Full Internationalization (l10n)
- Native support for Simplified Chinese (`zh`) and English (`en`), following your system locale or manual selection.
---
## ๐ ๏ธ Tech Stack & Architecture
| Module | Stack | Description |
| :--- | :--- | :--- |
| **Framework** | Flutter 3.x / Dart 3.x | High-performance cross-platform rendering engine |
| **Code Editor** | `re_editor` / `re_highlight` | High-performance mobile code editor and syntax highlighter |
| **Terminal Emulator** | `xterm` / `flutter_pty` | Enhanced terminal selection and PTY pseudo-terminal bridge |
| **Container Sandbox** | PRoot + Alpine Linux / Shims | Native C/C++ cross-architecture compatibility layer & runtime |
| **App Icons** | `flutter_launcher_icons` | Automated generation of Android mipmaps and adaptive icons |
| **State & Storage** | `provider` / `shared_preferences` | Reactive state management and persistent preferences |
---
## ๐ Installation & Build
### Option 1: Install Release APK Directly (Recommended)
Download the release APK from the [Gitea Releases](https://gitea.lzxnone.cloud/lzxnone/LN-Code-Editor/releases) page (or check `releases/`):
* **`LN-Code-Editor-