theDANE - Danish Advanced Native EditortheDANE - Danish Advanced Native Editor

A fast, native Windows code editor with syntax highlighting, intelligent code reformatting, and a built-in hex editor.

© 1999–2026 Kim Bo Madsen / Components4Developers DK. All rights reserved.


Preword

We have just released v1.0.0.5 which is the first ever release of the Danish Advanced Native Editor, which is quite a beast of a text and binary editor.

It is made available for free, and with no registration needed to download. There are no direct limitations to use of the file, or who can use it, except we retain the copyright for it, and that we will never endorse it being used for non legitimate use, criminal use or any use that strides against reasonable normal moral and ethics.

Further we do NOT accept any liabilities from using the file. If it causes you harm, its not our responsibility!

Download is available from Github at: https://github.com/KimMadsen/theDANE/tree/main

As it is our first public release, and it contains a HUGE amount of features, there most likely are bugs. If you find some, please try to make a case to replicate them and send a report by email to kbm@components4developers.com about it, so we can try to fix it for a nex trelease.

When you download make sure to follow the instructions on this page, or on Github in how to verify that the file you download is indeed the original unmodified one, as provided by Components4Developers and Kim Bo Madsen.

If the file is placed on other sites we recommend not to download from there, but if you choose to do, verify the signature!

Feature Overview

Editor — Syntax highlighting for 11 languages · context-aware code completion · bracket and pair matching · code folding · bookmarks (numbered and unnumbered) · multi-caret editing with distribute paste · smart double-click selection expansion · block indent/unindent · line operations (move, duplicate, join, delete, comment toggle) · find & replace with regex and Find All results panel · unlimited undo/redo · zoom

Code Reformatter — BNF-driven reformatter for Pascal with per-rule formatting directives · token-based reformatter for SQL, XML, JSON, HTML, JavaScript, C#, and CSS · named profiles per language with import/export · full configuration editor

Hex Editor — Dual-pane hex/ASCII view · data inspector with 24 numeric and string formats (editable) · find in hex or text · full undo/redo · pane-aware copy (hex string or text) · theming with 8 built-in style sets

Theming — 4 application themes (theDANE Dark, theDANE Light, Windows Dark, Windows Light) · per-language editor style sets (Visual Studio, Monokai, GitHub, Notepad++, and more) · all preferences remembered between sessions

Workspace — Tabbed editing with tear-off/re-dock floating windows · recent files · Windows Explorer shell integration (right-click → Open / Open as Hex) · single-instance multi-file opening · optional splash screen · SHA-256 integrity verification

Built With — Native Win32/Win64 Delphi application · no runtime dependencies · kbmVCL component suite · launches in under a second


Getting Started

A coding interface displaying a Pascal script titled 'kbmVCLSyntaxMemo.pas', with highlighted constructor method 'TkbmVCLSyntaxMemo.Create'. The code features syntax highlighting in a code editor window, along with properties and settings for a component.

When you start theDANE, a splash screen appears briefly while the application loads. Click anywhere on the splash to dismiss it early. The main window then opens with a fresh empty editor tab, ready to type. If you prefer to skip the splash entirely, toggle it off under Help → Show Splash on Startup.

To open an existing file, use File → Open (Ctrl+O). The language is auto-detected from the file extension — you can always override it from the Language menu.

Opening Files from Windows Explorer

You can register theDANE with Windows Explorer via Help → Add Explorer Integration. Once registered, right-clicking any file (or selection of files) in Explorer shows a theDANE cascading menu with two options:

  • Open in theDANE — opens the file in a text/code editor tab
  • Open as Hex in theDANE — opens the file directly in the hex editor

theDANE is a single-instance application: if it is already running, files opened from Explorer are added as new tabs in the existing window rather than spawning additional copies. This works seamlessly even when you select multiple files in Explorer and open them all at once — each file gets its own tab.

To remove the Explorer integration later, use Help → Remove Explorer Integration. No administrator rights are required for either operation.


The Screen Layout

The main window is divided into four areas, from top to bottom:

1. Toolbar Strip

A horizontal strip at the very top of the window containing three dropdown controls and a settings button:

ControlWhat it does
Profile dropdownShows the active reformatter profile for the current language, e.g. Profile (Pascal): Default *. Pick a different profile to instantly change how Reformat works.
⚙ buttonOpens the profile settings editor for the active profile.
Theme dropdownSwitches the entire application theme (window chrome, menus, dialogs, tabs, status bar). Your choice is remembered between sessions.
Style dropdownSwitches the editor color scheme for the current language. Each language has its own set of style presets (e.g. Visual Studio, Monokai, GitHub). Also remembered per-language.

2. Tab Strip

A row of document tabs directly below the toolbar. The active tab is highlighted; all others are dimmed. Each tab shows the filename, or “Untitled” for new documents. A ● dot appears before the name when the file has unsaved changes.

What you can do with tabs:

  • Click a tab to switch to it.
  • Right-click a tab for a popup menu: Close, Close All, Close Other Tabs, Close Tabs to the Left, Close Tabs to the Right.
  • Drag a tab out of the strip to tear it off into a floating editor window that you can position anywhere on screen.
  • Drag a floating editor window back onto the tab strip (or onto another editor) to re-dock it as a tab.

3. Editor Area

The central workspace. Depending on the file content, this is either a code editor or a hex editor.

In code editor mode, the area contains:

  • A gutter on the left — shows line numbers, bookmark indicators, fold markers (▸/▾), and search-match markers.
  • The code area — your syntax-highlighted source code with bracket matching, caret highlighting, and selection.
  • A Find Results panel (bottom, hidden by default) — appears when you use Find All, listing every match with line number and preview. Double-click a result to jump to it.

In hex editor mode, the area contains:

  • An offset column on the left — the byte address of each row.
  • A hex pane in the center — byte values shown as two-digit hexadecimal numbers.
  • An ASCII pane on the right — text representation of the bytes (non-printable bytes shown as dots).
  • A Data Inspector panel (right side, hidden by default) — toggle with Ctrl+I to see the bytes at the cursor interpreted in 24 different numeric and string formats.

4. Status Bar

Code editor mode: cursor position (line and column), insert/overwrite mode (INS or OVR), the file path (or “Untitled”), the active language name, and the current zoom level as a percentage.

Hex editor mode: byte offset (hex and decimal), insert/overwrite mode, total file size in bytes, and the file path.


Working with Files

Creating and Opening

ActionHow
New empty tabFile → New or Ctrl+N
Open a fileFile → Open or Ctrl+O
Open a file as hexFile → Open as Hex
Reopen a recent fileFile → Reopen Recent — lists the last 10 files you opened, plus a Clear Recent Files option

When you open a file, theDANE detects the language from the extension and applies the appropriate syntax highlighter, code completion set, and reformatter profile automatically.

Saving

ActionHow
SaveFile → Save or Ctrl+S
Save with a new nameFile → Save As

If you close a modified file, theDANE prompts you to save first.

Closing

ActionHow
Close current tabFile → Close or Ctrl+F4
Close all tabsRight-click any tab → Close All
Close other tabsRight-click a tab → Close Other Tabs
Close tabs to the leftRight-click a tab → Close Tabs to the Left
Close tabs to the rightRight-click a tab → Close Tabs to the Right
Exit theDANEFile → Exit

Supported File Types

LanguageExtensions
Pascal / Delphi.pas .dpr .dfm .inc
SQL.sql
XML.xml .xsd
JSON.json
HTML.html .htm
JavaScript / TypeScript.js .ts
C#.cs
CSS.css
Markdown.md .markdown
Key/Value (INI).ini .conf .properties .env

Files with unrecognized extensions open with no syntax highlighting (plain text mode). You can set the language manually from the Language menu at any time.


Menu Reference

File Menu

ItemShortcutDescription
NewCtrl+NCreate a new empty editor tab
Open…Ctrl+OOpen a file from disk
Open as Hex…Open a file directly in hex editor mode
SaveCtrl+SSave the current file
Save As…Save with a new filename
CloseCtrl+F4Close the current tab
Reopen RecentSubmenu listing the last 10 opened files, with a Clear Recent Files option at the bottom
ExitClose the application

Edit Menu

ItemShortcutDescription
UndoCtrl+ZUndo the last change
RedoCtrl+YRedo the last undone change
CutCtrl+XCut selection to clipboard
CopyCtrl+CCopy selection to clipboard
PasteCtrl+VPaste from clipboard
Select AllCtrl+ASelect the entire document

Search Menu

ItemShortcutDescription
Find…Ctrl+FOpen the Find dialog
Replace…Ctrl+HOpen the Find & Replace dialog
Find NextF3Jump to the next match
Find PreviousShift+F3Jump to the previous match
Go to Line…Ctrl+GJump to a specific line number

Format Menu

ItemShortcutDescription
ReformatCtrl+TReformat the document using the active profile
ProfilesSubmenu: New, Clone, Rename, Delete, Set as Default, Import, Export, Edit Settings
Reformatter Settings…Open the raw configuration for the active profile

View Menu

ItemShortcutDescription
Show GutterToggle the line-number gutter
Show Status BarToggle the bottom status bar
Zoom InCtrl++Increase font size
Zoom OutCtrl+-Decrease font size
Reset ZoomCtrl+Num *Return to default font size
Editor StyleSubmenu listing color schemes for the current language
Hex ViewCtrl+Shift+HToggle between code editor and hex editor for the current file

Language Menu

Lists all available languages: None, SQL, XML, JSON, HTML, Pascal, C#, JavaScript, CSS, Markdown, Key/Value. Selecting one changes the syntax highlighting, code completion, and reformatter profile for the current editor.

Help Menu

ItemDescription
About theDANE…Shows the splash image, application title, tagline, and copyright
Show Splash on StartupToggle: show or skip the splash screen on launch (checked = show)
Add Explorer Integration…Register theDANE in the Windows Explorer right-click menu for all file types
Remove Explorer IntegrationUnregister theDANE from the Explorer context menu

The Explorer integration items are mutually exclusive — only the one relevant to the current state is shown.


Editing Code

Basics

theDANE behaves like any standard text editor: type to insert, use arrow keys to move, click and drag to select. A few things that make it feel productive from the start:

  • Auto-indent — press Enter and the new line indents to match the surrounding context.
  • Insert / Overwrite — toggle with the Insert key. The status bar shows INS or OVR so you always know which mode you are in.
  • Block indent / unindent — select one or more lines and press Tab to indent or Shift+Tab to unindent the entire block. The selection is preserved so you can repeat the operation.
  • Bracket matching — when the cursor is adjacent to a bracket, parenthesis, or language-level pair like begin/end, the matching counterpart is highlighted in both positions.

Selecting Text

Standard click-and-drag or Shift+Arrow selection works as expected. theDANE also offers some powerful extras:

Smart double-click — rapid successive double-clicks expand the selection through increasing scopes:

  1. Word — standard alphanumeric word (letters, digits, underscores)
  2. Extended Word — connected identifiers like MyObject.Property or path/segment
  3. Full Line — selects the entire current line (offered before inner block when the enclosing block spans multiple lines)
  4. Inner Block — content inside the nearest enclosing pair (between the brackets, not including them)
  5. Outer Block — same region but including the bracket/pair characters
  6. Next Enclosing Pair — expand outward to the next nesting level
  7. Full Line(s) — fallback: select all lines covered by the current selection
  8. Select All — the entire document

Scope selection is also available from the right-click Select Scope submenu: Expand Selection, Shrink Selection, Word, Extended Word, Inner Block, Outer Block, Line. Expand Selection uses Ctrl+W, Shrink Selection uses Ctrl+Shift+W, and Line uses Ctrl+L.

Multi-Caret Editing

Place additional cursors by holding Alt and clicking at different positions. Or create a vertical column of cursors by holding Alt+Shift and pressing Up or Down. Everything you type — characters, deletions, pastes — happens at all cursor positions simultaneously.

Distribute Paste: when pasting with multiple cursors active and the clipboard contains exactly the same number of lines as there are cursors, each clipboard line is pasted to its corresponding cursor.

Line Editing

ActionShortcut
Select entire lineCtrl+L
Delete line(s)Ctrl+Shift+K
Duplicate line or selectionCtrl+D
Move line upAlt+Up
Move line downAlt+Down
Insert blank line belowCtrl+Enter
Insert blank line aboveCtrl+Shift+Enter
Join linesCtrl+J
Toggle line commentCtrl+/
UPPERCASECtrl+Shift+U
lowercaseCtrl+U

Word and Text Deletion

ActionShortcut
Delete word to the leftCtrl+Backspace
Delete word to the rightCtrl+Delete

Pair Navigation

ActionShortcut
Jump to matching pairCtrl+B
Jump and select to matching pairCtrl+Alt+B

Ctrl+B moves the cursor to the matching counterpart without selecting anything. Ctrl+Alt+B selects the entire region between and including both pair delimiters.

This works with all paired constructs the highlighter understands: (), [], {}, begin/end, if/end, XML open/close tags, and more.

Document Navigation

ActionShortcut
Jump to start of fileCtrl+Home
Jump to end of fileCtrl+End
Select to start of fileCtrl+Shift+Home
Select to end of fileCtrl+Shift+End
Go to LineCtrl+G

Code Completion & Auto-Suggestion

theDANE provides context-aware code suggestions powered by each language’s highlighter.

How It Works

  • Press Ctrl+Space to open the suggestion popup manually at any time.
  • With Auto Trigger on Type enabled, the popup appears automatically as you type identifier characters (az, _, etc.) or after typing a . (dot).
  • The list filters live as you continue typing — only matching entries remain visible.
  • If you triggered manually and only one match remains, it is inserted automatically.

Navigating the Popup

KeyAction
Up / DownMove through the list
Page Up / Page DownScroll the list
Enter or TabAccept the selected suggestion
EscapeDismiss without accepting

Typing a non-identifier character (space, parenthesis, semicolon, etc.) also dismisses the popup.

What Gets Suggested

Each language highlighter builds its own suggestion list. For example:

  • Pascal — keywords, directives, and identifiers found in the surrounding code (±100 lines around the cursor)
  • SQL — keywords, data types, and built-in functions for the active dialect
  • C# — language keywords, common constructs, and identifiers from surrounding code
  • JavaScript / CSS — language keywords and common constructs

Enabling / Disabling

Both Code Completion and Auto Trigger on Type can be toggled from the right-click Options submenu inside the editor.


Finding & Replacing

Find (Ctrl+F)

Opens an inline find dialog. Type your search term and press Enter or click Find Next. Options:

  • Case Sensitive — match exact uppercase/lowercase
  • Whole Word — match only when surrounded by non-word characters
  • Regular Expressions — use regex pattern syntax
  • Direction — search Forward or Backward through the document

Find All

Searches the entire document and displays results in a Find Results panel at the bottom of the editor. Each entry shows the line number, column, and a preview of the line. Double-click any entry to jump to it. Matches are also marked with indicators in the gutter.

Replace (Ctrl+H)

Opens the find-and-replace dialog. You can replace matches one at a time or use Replace All to replace every occurrence in the document at once. A count is shown when Replace All finishes.

Quick Navigation

ShortcutAction
F3Repeat the last search forward
Shift+F3Repeat the last search backward
Ctrl+GGo to a specific line number

Bookmarks

Bookmarks let you mark important lines so you can jump back to them quickly.

Unnumbered Bookmarks

ActionShortcut
Toggle bookmark on current lineCtrl+F2
Jump to next bookmarkF2
Jump to previous bookmarkShift+F2
Clear all bookmarksCtrl+Shift+F2

Numbered Bookmarks (0–9)

ActionShortcut
Set/clear numbered bookmark 0–9Ctrl+Shift+0 through Ctrl+Shift+9
Go to numbered bookmark 0–9Ctrl+0 through Ctrl+9

A line can have either one numbered or one unnumbered bookmark, not both. Bookmark indicators appear in the gutter. All bookmark operations are also available from the right-click Bookmarks submenu.


Code Folding

Foldable regions (functions, blocks, XML elements, etc.) are detected automatically by the language highlighter.

  • Fold markers appear in the gutter as small triangles: ▾ (expanded) or ▸ (collapsed). Click one to toggle.
  • Collapsed regions show a ⋯ indicator on the fold line; the hidden lines are simply not rendered.
  • Fold Selection — select a range of lines and fold them manually, even if they are not a natural language block.
  • Unfold Selection — expand folds within the selected range or at the caret line.
  • Collapse All — fold every detected region in the document at once.
  • Expand All — unfold every region.

All folding operations are available from the right-click Code Folding submenu.


Themes & Color Schemes

Application Themes

The theme controls the entire application appearance — window chrome, menus, common dialogs, toolbar, tabs, and status bar.

ThemeDescription
theDANE LightCustom Nordic parchment palette (default)
theDANE DarkCustom Nordic Forge dark palette
Windows DarkStandard Windows 10 dark theme
Windows LightStandard Windows light theme

Switch themes from the Theme dropdown in the toolbar. Once you select a theme it becomes your default and is restored on next launch.

Editor Style Sets

Independently from the theme, each language has its own set of style sets that control syntax coloring inside the editor. Choose from the Style dropdown in the toolbar.

Typical options across languages: Visual Studio, Visual Studio Dark, GitHub, Monokai, Notepad++, Google, theDANE, theDANE Dark. Some languages have extras — for example SQL includes an SSMS (SQL Server Management Studio) style.

Your chosen style set is stored per language and persisted between sessions. This means you can use Monokai for Pascal, GitHub for JSON, and Visual Studio Dark for SQL, and theDANE remembers all of them.

When viewing a file in hex editor mode without a syntax highlighter, the Style dropdown shows the hex editor’s own style sets (Delphi, Visual Studio, Visual Studio Dark, Monokai, theDANE, theDANE Dark, GitHub, Notepad++).


Code Reformatter

Press Ctrl+T (or Format → Reformat) to automatically reformat the current document according to configurable style rules. The reformatter settings dialog can also be opened directly with Ctrl+Shift+R from the right-click Options submenu.

Two Engines

Token-based reformatter — available for SQL, XML, JSON, HTML, JavaScript, C#, and CSS. Operates on the token stream with configurable indentation and whitespace settings.

BNF-driven reformatter — available for Pascal/Delphi. This is a significantly more powerful approach: the source is parsed into a full syntax tree using a BNF grammar, and then re-emitted according to per-rule formatting directives. This gives fine-grained control over exactly how every language construct — every begin, end, if, then, procedure — is laid out.

Pascal Reformatter: Configuration Reference

Screenshot of the Profile Settings window for Pascal, showing built-in default configuration options, including indentation options and blank line settings.

The Pascal reformatter is configured through a plain-text settings file (managed via profiles — see next section). The settings are divided into categories:

Indentation & Casing

SettingDescriptionDefault
IndentSizeSpaces per indent level2
UseTabsUse tab characters instead of spacesFalse
SmartTabAlign continuations to context (e.g. opening paren column)False
AlignToParenOnWrapAlign wrapped argument lines to opening parenthesisTrue
KeywordCaseKeyword casing: 0=No change, 1=UPPER, 2=lower, 3=Capitalize2
DirectiveCaseCompiler directive casing (same values as KeywordCase)2

Blank Lines

SettingDescriptionDefault
PreserveBlankLinesKeep blank lines from original sourceTrue
PreserveSourceLineBreaksKeep original line breaks in multi-line constructsTrue
MaxPreservedBlankLinesCollapse consecutive blank lines to at most this many2
BlankLineBeforeCommentsInsert blank line before standalone commentsFalse
StructuralBlankLinesInsert blank lines between different declaration typesFalse
BlankLineBeforeMultiLineBlocksAdd blank line before blocks that exceed the thresholdTrue
MultiLineBlockThresholdMinimum source lines to trigger the above3

Line Wrapping

SettingDescriptionDefault
MaxLineLengthAuto-wrap threshold in columns (0 = disabled)0
WrapMinGainMinimum characters saved to justify a wrap10

Preprocessor Directives

SettingDescriptionDefault
IndentPreprocessorDirectivesIndent code inside {$IFDEF} blocksFalse
PreprocessorIndentSizeSpaces per preprocessor indent level (0 = use IndentSize)0

Trailing Comment Alignment

SettingDescriptionDefault
TrailingCommentAlignmentNone / Local / GlobalNone
TrailingCommentMinSpacesMinimum spaces before a trailing comment2
TrailingCommentColumnFixed column for alignment (0 = auto)0

Per-Rule Formatting

Every BNF grammar rule or keyword can have its own formatting directives. The settings file uses a simple rulename: directive, directive, ... syntax:

begin: BreakBefore, BreakAfter, IncrementIndent
end: DecrementIndent, BreakBefore, BreakAfter
if: SpaceAfter
then: SpaceBefore, BreakAfter
else: BreakBefore, BreakAfter
procedure: BreakBefore, BlankLinesBefore=1

The full set of available directives:

DirectiveWhat it does
BreakBefore / BreakAfterInsert a line break before or after
BlankLinesBefore=N / BlankLinesAfter=NInsert N blank lines
IncrementIndent / DecrementIndentChange the indent level for child content
ForceIndentLevel=NSet indent to an absolute level
SpaceBefore / SpaceAfterInsert a space
NoSpaceBefore / NoSpaceAfterSuppress automatic spacing
SmartIndent=NDynamic or fixed column offset for Smart Tab
WrapModeControl wrapping behavior for parenthesized content
AllowWrapAfter / AllowWrapBeforeMark a legal wrapping point
NoWrapPrevent wrapping here
WrapIndent=NOverride indent for wrapped continuation
SaveAlignment / RestoreAlignmentSave/restore column alignment (e.g. for try/except)
ApplyIndentToLeadingCommentsAlign comments above a construct to its indent level

Debug

Set DebugEnabled: True in the profile to write a detailed log of every reformatter decision to a file (default BNF_DEBUG.log in the application folder). Useful when fine-tuning rules to understand why a construct is formatted a certain way.


Reformatter Profiles

Profiles let you save and switch between different formatting configurations. Each language has its own independent set of profiles.

Creating and Managing Profiles

All profile operations are under Format → Profiles:

ActionDescription
New ProfileCreates a new profile with the language’s default settings
Clone ProfileDuplicates the current profile under a new name
Rename ProfileRenames the current profile
Delete ProfileRemoves the current profile
Set as DefaultMarks the current profile as the default for this language (shown with *)
Import Profile…Loads a .cfg file into the profile list
Export Profile…Saves the current profile to a .cfg file
Edit Profile Settings…Opens the raw configuration text in a dialog for full manual editing

The ⚙ button in the toolbar is a shortcut to Edit Profile Settings for the active profile.

Where Profiles are Stored

Profiles are plain-text .cfg files, one per profile, organized by language:

Documents\ReformatterProfiles\Pascal\Default.cfg
Documents\ReformatterProfiles\Pascal\My Company Style.cfg
Documents\ReformatterProfiles\SQL\Default.cfg
...

Because they are simple text files, you can easily back them up, share them with colleagues, check them into version control, or copy them between machines.

Switching Profiles

Use the Profile dropdown in the toolbar to switch between profiles for the current language. The default profile (marked with *) is applied automatically when you open a file in that language.


SQL Dialect Support

The SQL highlighter supports multiple dialects, each adding its own set of keywords, data types, and built-in functions:

DialectHighlights
ANSI SQL-92 through SQL-2016Progressive standards — core SQL, CTEs, window functions, JSON support
OraclePL/SQL blocks, PACKAGE, CURSOR, NVL, DECODE, SYSDATE, DUAL
MS SQL ServerT-SQL, TRY/CATCH, RAISERROR, TOP, NVARCHAR, TRAN
PostgreSQLPL/pgSQL, ILIKE, RETURNING, SERIAL, ARRAY, LATERAL
MySQLAUTO_INCREMENT, LIMIT, ENGINE, CHARSET, ENUM
SQLiteAUTOINCREMENT, VACUUM, PRAGMA, ATTACH, GLOB

Hex Editor

Hexadecimal code editor displaying a Pascal source file, including various binary, octal, and hexadecimal values.

Open any file in hex mode via File → Open as Hex, or toggle the current file with View → Hex View (Ctrl+Shift+H).

Layout

The hex editor has a traditional three-column layout:

  • Offset column (left) — the byte address of each row
  • Hex pane (center) — bytes shown as two-digit hexadecimal values
  • ASCII pane (right) — text representation (printable characters shown as-is, non-printable replaced with dots)

Press Tab to switch the active pane between hex and ASCII. The cursor and selection appear in both panes simultaneously, but the active pane is highlighted more prominently.

Editing Bytes

  • In the hex pane: type hex digits (0–9, A–F) to overwrite byte values.
  • In the ASCII pane: type printable characters to overwrite.
  • Insert / Overwrite modes: toggle with the Insert key, just like the code editor.
  • Full undo/redo — multi-byte edits are grouped into a single undo step.
  • Cut / Copy / Paste work as expected.

Pane-Aware Copy

The right-click context menu adapts based on which pane your cursor is in:

Active Pane“Copy” produces…Second copy option
ASCII panePrintable textCopy as Hex
Hex paneHex string (e.g. 4B 42 4D)Copy as Text

Data Inspector

Toggle with Ctrl+I. A panel appears on the right side showing the bytes at the cursor position interpreted as 24 different formats:

CategoryFormats
ByteBinary, Octal, Hex, UInt8, Int8
16-bitUInt16 LE, UInt16 BE, Int16 LE, Int16 BE
32-bitUInt32 LE, UInt32 BE, Int32 LE, Int32 BE, Float32 LE, Float32 BE
64-bitUInt64 LE, UInt64 BE, Int64 LE, Int64 BE, Double LE, Double BE
StringsASCII, UTF-8, UTF-16 LE

All numeric fields are editable: type a new value and press Enter to write it back into the file. Multi-byte writes are grouped into a single undo step. The inspector panel is resizable via a splitter.

Zoom: you can adjust the font size of the Data Inspector independently — right-click inside the inspector panel and choose Increase Font Size or Decrease Font Size. This setting is persisted between sessions.

Hex Editor Shortcuts

ShortcutAction
Ctrl+Shift+HToggle hex view on/off for the current file
Ctrl+CCopy (format depends on active pane)
Ctrl+XCut
Ctrl+VPaste
Ctrl+ZUndo
Ctrl+YRedo
Ctrl+ASelect All
Ctrl+FFind (hex or text)
F3Find Next
Shift+F3Find Previous
Ctrl+GGo to Offset
Ctrl+IToggle Data Inspector panel
TabSwitch between Hex and ASCII pane
InsertToggle Insert / Overwrite mode
Ctrl++Zoom in
Ctrl+-Zoom out
Ctrl+Num *Reset zoom
Ctrl+Mouse WheelZoom in/out

Finding Bytes

Press Ctrl+F in the hex editor to open a find dialog with two search modes:

  • Hex bytes — enter space-separated hex values (e.g. 4D 5A 90 00)
  • Text (UTF-8) — enter a text string to search for in the raw byte stream

Matches are found forward from the cursor. Use F3 / Shift+F3 to repeat the search forward or backward.


Right-Click Context Menu (Code Editor)

Right-clicking inside the code editor shows a structured context menu:

Top level:

  • Copy · Cut · Paste · Undo · Redo
  • Find… · Replace…
  • Jump to Matching Pair (Ctrl+B)
  • Jump and Select to Matching Pair (Ctrl+Alt+B)

Select Scope submenu:

  • Expand Selection (Ctrl+W) · Shrink Selection (Ctrl+Shift+W)
  • Word · Extended Word · Inner Block · Outer Block · Line (Ctrl+L)

Edit submenu:

  • Delete Line(s) (Ctrl+Shift+K) · Duplicate (Ctrl+D)
  • Move Line Up (Alt+Up) · Move Line Down (Alt+Down)
  • Insert Line Below (Ctrl+Enter) · Insert Line Above (Ctrl+Shift+Enter)
  • Join Lines (Ctrl+J) · Toggle Line Comment (Ctrl+/)
  • UPPERCASE (Ctrl+Shift+U) · lowercase (Ctrl+U)
  • Go to Line (Ctrl+G)

Bookmarks submenu:

  • Toggle Bookmark (Ctrl+F2)
  • Toggle Numbered Bookmark → 0–9 (Ctrl+Shift+0..9); go to with Ctrl+0..9
  • Next Bookmark (F2) · Previous Bookmark (Shift+F2)
  • Clear All Bookmarks (Ctrl+Shift+F2)

Code Folding submenu:

  • Fold Selection · Unfold Selection
  • Collapse All · Expand All

Reformat:

  • Reformat (Ctrl+T)
  • Reformat Settings…

Options submenu:

OptionDescription
Show GutterToggle line numbers and fold markers
Show StatusToggle the status area at the bottom of the editor
Show ScrollBarsToggle scrollbar visibility
Show TabsRender tab characters as visible arrows
Show Line BreaksRender line endings as visible markers
Show SpacesRender spaces as visible dots
Show Control CharsRender control characters
Read OnlyLock the file against editing
Insert ModeToggle insert/overwrite
Code CompletionEnable or disable the suggestion popup system
Auto Trigger on TypeAutomatically show suggestions as you type
Use TabsInsert real tab characters (vs. spaces)
Tab SizeSub-menu: 2, 4, or 8
Smart TabsContext-aware indentation alignment
Configure Reformat… (Ctrl+Shift+R)Open the reformatter settings editor

Complete Keyboard Shortcut Reference

File

ShortcutAction
Ctrl+NNew file
Ctrl+OOpen file
Ctrl+SSave
Ctrl+F4Close tab

Editing

ShortcutAction
Ctrl+ZUndo
Ctrl+YRedo
Ctrl+XCut
Ctrl+CCopy
Ctrl+VPaste
Ctrl+ASelect All
Ctrl+LSelect Line
Ctrl+DDuplicate line/selection
Ctrl+JJoin lines
Ctrl+/Toggle line comment
Ctrl+Shift+UUPPERCASE
Ctrl+Ulowercase
Ctrl+Shift+KDelete line(s)
Ctrl+BackspaceDelete word left
Ctrl+DeleteDelete word right
Alt+UpMove line up
Alt+DownMove line down
Ctrl+EnterInsert line below
Ctrl+Shift+EnterInsert line above
TabIndent selection / insert tab
Shift+TabUnindent selection
InsertToggle Insert / Overwrite
Shift+InsertPaste (alternative)
Ctrl+InsertCopy (alternative)
Ctrl+WExpand Selection (progressive scope)
Ctrl+Shift+WShrink Selection

Navigation

ShortcutAction
Ctrl+GGo to Line
Ctrl+BJump to matching pair
Ctrl+Alt+BJump and select to matching pair
Ctrl+HomeJump to start of file
Ctrl+EndJump to end of file
Ctrl+Shift+HomeSelect to start of file
Ctrl+Shift+EndSelect to end of file

Find & Replace

ShortcutAction
Ctrl+FFind
Ctrl+HReplace
F3Find Next
Shift+F3Find Previous

Bookmarks

ShortcutAction
Ctrl+F2Toggle bookmark
Ctrl+Shift+0..9Toggle numbered bookmark
Ctrl+0..9Go to numbered bookmark
F2Next bookmark
Shift+F2Previous bookmark
Ctrl+Shift+F2Clear all bookmarks

Zoom

ShortcutAction
Ctrl++Zoom in
Ctrl+-Zoom out
Ctrl+Num *Reset zoom
Ctrl+Mouse WheelZoom in/out

Code Completion

ShortcutAction
Ctrl+SpaceOpen suggestion popup
Enter or TabAccept suggestion
EscapeDismiss popup
Up / DownNavigate suggestions
Page Up / Page DownScroll suggestions

Reformatting

ShortcutAction
Ctrl+TReformat document
Ctrl+Shift+ROpen reformatter settings

Hex Editor

ShortcutAction
Ctrl+Shift+HToggle hex view
Ctrl+IToggle Data Inspector
TabSwitch hex/ASCII pane

Settings & Persistence

theDANE remembers your preferences automatically:

SettingWhere stored
Application themeWindows Registry (HKCU\Software\theDANE)
Editor style set per languageWindows Registry
Recent files (last 10)Windows Registry
Hex inspector font sizeWindows Registry
Show splash on startupWindows Registry
Explorer shell integrationWindows Registry (HKCU\Software\Classes)
Reformatter profilesDocuments\ReformatterProfiles\ (portable .cfg files)

No configuration files need to be edited manually to get started — everything is managed through the UI.


Verifying File Integrity

Each release of theDANE is accompanied by a theDANE.sha256 file containing the SHA-256 hash of the executable. This lets you confirm that the .exe you downloaded is the exact file that was published — unmodified and uncorrupted.

Open a terminal in the folder containing theDANE.exe and run one of the following commands:

PowerShell:

(Get-FileHash theDANE.exe -Algorithm SHA256).Hash

Command Prompt:

certutil -hashfile theDANE.exe SHA256

Compare the output with the contents of theDANE.sha256. If the two strings match exactly, the file is authentic.


Advanced: Under the Hood

This section is for those curious about the technology and architecture behind theDANE.

Built With

theDANE is written entirely in Object Pascal (Delphi) using the VCL (Visual Component Library) framework. It compiles to a native Win32/Win64 executable with no external runtime dependencies.

kbmVCL Components

The editing engine, syntax highlighters, and reformatter are provided by the kbmVCL component suite from Components4Developers. The key components used are:

ComponentRole
TkbmVCLSyntaxMemoThe core editor control — handles text editing, multi-caret, undo/redo, selection, code folding, bracket matching, code completion, bookmarks, and rendering
TkbmVCLHexEditorThe hex editor control — dual-pane byte editing, data inspector, find, and undo
kbmSyntaxMemoTypesTiered line storage layer — adaptive string/rope representation per line, tiered list for the line collection

Syntax highlighters (one per language):

UnitLanguage
kbmSyntaxHighlighterPascalPascal / Delphi — includes a full BNF grammar and reformatter
kbmSyntaxHighlighterSQLSQL — multi-dialect keyword sets (ANSI, Oracle, MSSQL, PostgreSQL, MySQL, SQLite)
kbmSyntaxHighlighterXMLXML — tags, attributes, entities, CDATA, DOCTYPE, processing instructions
kbmSyntaxHighlighterJSONJSON — keys, strings, numbers, booleans, escape sequences
kbmSyntaxHighlighterHTMLHTML — with embedded CSS/JS awareness
kbmSyntaxHighlighterJavaScriptJavaScript / TypeScript — template literals, regex, JSX-aware
kbmSyntaxHighlighterCSharpC#
kbmSyntaxHighlighterCSSCSS — selectors, properties, values, units
kbmSyntaxHighlighterMarkdownMarkdown
kbmSyntaxHighlighterKeyValueINI / Properties / .env files

Reformatter infrastructure:

UnitRole
kbmSyntaxHighlighterReformatterThe BNF-driven and token-based reformatter engines
kbmSyntaxHighlighterReformatterProfilesProfile management (load, save, import, export, clone)
kbmSyntaxHighlighterReformatterSettingsReformatter settings editor UI and style sets

Application Units

UnitRole
theDANE.dprMain project file — startup sequence, single-instance management, VCL style resource linking
uMain.pasMain form — tab management, menus, toolbar, profile system, theme switching, shell integration, single-instance file handoff
uEditor.pasEditor frame — wraps TkbmVCLSyntaxMemo, manages file I/O, status updates
uThemeManager.pasVCL style loading, switching, and runtime color queries for legacy controls
uProfileSettings.pasProfile configuration editor dialog
uSplash.pasSplash screen with timed display, fade-out animation, and optional quick-start mode

Performance: Handling Large Files

theDANE is designed to remain responsive even with very large files and extremely long lines. Several architectural decisions make this possible:

Viewport-only rendering. The paint cycle only processes lines that are actually visible on screen. The editor tracks a TopLine (the first visible line) and computes how many lines fit in the current window height. Only those lines — plus a small buffer — are measured, styled, and drawn. Scrolling simply updates TopLine and repaints. This means a 100,000-line file renders no slower than a 100-line file, because only ~40–60 lines are painted per frame regardless of file size.

Incremental syntax highlighting. The lexer does not re-tokenize the entire file on every keystroke. Instead, each line caches its end-of-line lexer state (e.g. “inside a block comment”, “inside a string”). When a line is edited, only that line and any following lines whose start-state might have changed are re-lexed. For typical edits deep in a file, this means just 1–3 lines are re-processed. A full re-lex is only triggered when switching languages or loading a new file.

On-demand fold scanning. Code folding regions are scanned within a configurable window around the viewport (default: 500 lines above and below). Folds outside this window are not tracked, keeping memory use and scan time bounded. The scan range shifts as you scroll, and previously scanned regions are cached until the viewport moves beyond a threshold.

Tiered line storage. Internally, lines are managed by a unified storage layer that adapts its representation to the content. Short, ordinary lines are stored as simple native strings with reference-counted copy-on-write semantics — insertions and deletions are just list splices with minimal overhead. When a line grows beyond a configurable threshold (default 4 KB), the storage transparently promotes it to a tiered rope-like structure, which keeps insert, delete, and substring operations efficient even on extremely long lines (e.g. minified JavaScript or large single-line JSON). If the line later shrinks below half the threshold, it is automatically demoted back to a simple string to avoid unnecessary overhead. The same tiered principle is applied to the line list itself, so inserting or deleting lines in the middle of a million-line file does not trigger large block moves. This dual-tier approach means theDANE handles both typical source files and pathological edge cases — huge files, enormous single lines — without requiring any manual configuration.

Limitations at Scale

While the editor handles large files well, a few features have inherent scaling characteristics worth knowing about:

Pair matching searches the entire file when looking for a matching bracket or begin/end. For files with tens of thousands of deeply nested constructs, a pair match at the top of a very large file may take a noticeable moment. In practice this is rarely an issue because most pair jumps involve nearby constructs.

Code folding is bounded by the fold scan distance (default 500 lines around the viewport). Fold markers for regions that start or end far outside this window may not appear until you scroll closer. You can increase the scan distance if needed, at the cost of slightly higher CPU use during scrolling.

Find All searches the entire file linearly and highlights every match in the gutter. On very large files (hundreds of thousands of lines), Find All may take a moment to complete.

Theme System

The four application themes are implemented as VCL Style packages (.vsf files). The VCL style engine skins every standard control — including common dialogs like File Open and File Save — through TStyleManager.SystemHooks.

Custom .vsf files can be deployed in two ways:

  1. External: place .vsf files in a styles subfolder next to the .exe. They are discovered and loaded automatically at startup.
  2. Embedded: compile .vsf files into a Windows resource (.res) and link them into the executable at build time.

A handful of legacy controls that the VCL style engine cannot reach (the TTabSet control and some programmatically created labels) are themed manually by querying color values from the active style at runtime through helper functions in uThemeManager.


theDANE — the Danish Advanced Native Editor · forged by kbm · Components4Developers

Loading

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.