> ## Documentation Index
> Fetch the complete documentation index at: https://012e27a-docs-2.manicule.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://012e27a-docs-2.manicule.dev/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://012e27a-docs-2.manicule.dev/api/mcp.
> Every agent surface: https://012e27a-docs-2.manicule.dev/.well-known/llms-manifest.json

# Code Editor & Highlight-to-Ask AI (/desktop/code-editor)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 523 · updated: 2026-11-12 -->
Related: [Desktop Workspace Overview](/desktop/overview.md), [Agentic Canvas Mode](/desktop/agentic-mode.md), [Multi-File Visual Diff Viewer](/desktop/diff-viewer.md), [Transparency Dock & Approval Gates](/desktop/transparency.md), [Integrated PTY Terminal](/desktop/terminal.md)

> CodeMirror 6 editing with inline selection actions and multi-file navigation.

BhaiCode Desktop ships a responsive code editor powered by **CodeMirror 6**, with
contextual AI actions attached to whatever you select.

## Ask AI on selection

Highlight any lines and a contextual action bar appears under the selection:

```ts title="src/payments/process.ts"
export async function processPayment(orderId: string) {
  const order = await db.order.findUnique({ where: { id: orderId } });
  if (!order) throw new Error("Order not found");

  const res = await dodoPayments.charges.create({
    amount: order.totalAmount,
    currency: "INR",
  });
  return res;
}
```

With lines 5–8 selected, the bar offers **Ask AI**, **Explain**, **Refactor**, and **Add
tests**.

| Action             | Shortcut               | What it does                                                  |
| ------------------ | ---------------------- | ------------------------------------------------------------- |
| **Ask AI**         | `Cmd + K` / `Ctrl + K` | Opens a prompt attached to the selection                      |
| **Explain**        | —                      | Logic, complexity, and edge cases, in your preferred language |
| **Refactor**       | —                      | Readability, modern framework patterns, or performance        |
| **Add unit tests** | —                      | Tests matching your framework (Vitest, Jest, PyTest, Go test) |
| **Fix**            | —                      | Resolves a linter warning or compiler diagnostic on the line  |

## Editor features

* **Language support**: highlighting, bracket matching, and indentation for 100+ languages
  (TypeScript, JavaScript, Python, Rust, Go, SQL, HTML, CSS, JSON, YAML, Markdown).
* **Split panes and tabs**: keep implementations and their tests side by side.
* **Minimap and breadcrumbs**: navigate large files by structure.
* **Find and replace**: regex project search with case-sensitivity toggles.

<Tip>Every AI edit to a file still goes through the [diff viewer](/desktop/diff-viewer) unless you
accept it inline.</Tip>
