14.11. Editor
Prev | Chapter 14. Lua Debugger | Next

## 14.11. Editor

The right-hand pane of the dialog is a multi-tab script editor. Each tab hosts one `.lua` file. Standard text-editor behaviors are all there: Find (`Ctrl+F`) with Find Next / Find Previous / Replace / Replace All (case-sensitive, wraps); Go to Line (`Ctrl+G`); Undo (`Ctrl+Z`), Redo (`Ctrl+Y` / `Ctrl+Shift+Z` (macOS)), Cut / Copy / Paste, Select All; a context menu mirroring those plus Add / Remove Breakpoint and Run to this Line; tabs marked with a trailing `*` for unsaved changes plus a save / discard prompt on close; a monospace font that follows Wireshark’s main-window zoom so `Ctrl++ or Ctrl+=` / `Ctrl+-` adjust the editor text size too. `Esc` first hides any visible find / go-to-line bar; if neither is shown, it queues a close of the dialog.

The debugger-specific behaviors:

- Breakpoint gutter. Clicking the gutter toggles a breakpoint on that line; see Section 14.8, “Breakpoints” for the full set of gutter behaviors, including the `Shift`-click variants for "toggle active" and "add disabled".
- Paused-line bar. The line where execution is paused is drawn with a yellow stripe across the full width and a yellow right-pointing triangle in the gutter (overlaid on top of the breakpoint circle if one is set on that line); the cursor is moved to that line on pause.
- Lua-aware syntax highlighting using the active code-view theme; see Section 14.11.1, “Color theme” below.
- Add Watch. The editor context menu’s Add Watch uses the current selection if there is one, otherwise the Lua identifier under the cursor. The selection is taken verbatim, so a path (`pinfo.src`) becomes a path watch and an expression (`tostring(pinfo.src)`) becomes an expression watch — see Section 14.6, “Watch”. When the debugger is not paused the new row’s value column shows a muted em dash until the next pause.
- Keyboard shortcuts. With the script editor focused, Add Breakpoint `Ctrl+Shift+B`, Add Watch `Ctrl+Shift+W`, and Run to this line `Ctrl+F10` (available when debugger is paused).

### 14.11.1. Color theme

The code-view theme has three modes: Auto (follow color scheme), Dark, and Light. The setting affects only the code editor (syntax coloring, background, cursor-line stripe); the tree panels use the normal Wireshark palette. The Dark and Light palettes are VS Code Dark+ / Light+ inspired so that Lua source colors match what most developers see in their primary editor. Auto resolves against the current Wireshark color scheme and reacts to palette changes in real time.

The choice is remembered across Wireshark restarts.

Prev | Up | Next
14.10. Evaluate | Home | 14.12. Architecture