8000 GitHub - dhucul/LumenText · GitHub
[go: up one dir, main page]

Skip to content
dhuculPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Lumen Text

A native WPF text editor and document-text reader for Windows, built with .NET 10 and AvalonEdit. Includes disk-backed large-file editing and a side-by-side, virtualized diff viewer.

Open in Visual Studio 2026

  1. Open LumenText.sln.
  2. Make LumenText.App the startup project if Visual Studio has not selected it.
  3. Choose Debug / x64, then press F5.

Required for development: Visual Studio 2026 with the .NET desktop development workload and the .NET 10 SDK. Restore NuGet packages when prompted. The solution contains the WPF application, a platform-independent document engine, automated tests, and a reproducible large-file benchmark.

Install or run

Run artifacts/installer/LumenText-Setup-1.2.3-win-x64.exe. The Inno Setup 7 installer defaults to C:\Program Files\Lumen Text (the system Program Files folder) and requests administrator permission. It creates a Start menu shortcut and an uninstaller, and offers optional desktop and File Explorer shortcuts. It does not change default file associations. The .NET runtime is included; the target machine does not need Visual Studio or a separate .NET installation.

The portable application is artifacts/publish/Release/win-x64/LumenText.exe. Keep the published folder together. Both distributions target x64 Windows 10/11. These local builds are unsigned.

Sorting uses the complete lines touched by your selection, including portions outside a paged editing window. An endpoint at the start of the next line does not include that line. Capitalization is ignored for alphabetical order but preserved in the text. Already-sorted text leaves the caret, selection, saved state, and undo/redo history unchanged. Sorting is limited to 2 Mi characters of complete selected lines; larger ranges are rejected before any change is made.

Version 1.2.1 addresses all twelve findings in the project logic audit: failed-edit recovery, sorting boundaries, export shutdown, paging transitions, Unicode paging, bounded regex output, shared preferences, forced encoding, zero-width replacement, EPUB/Word extraction, and distinct cancellation outcomes.

Features

  • Tabs, recent files, drag and drop, multiple command-line file arguments, new/open, save/save as/save all, reload, unsaved-change prompts and external-change checks.
  • Undo/redo across editing windows, cut/copy/paste, selection, indentation, automatic indentation on Enter, duplicate/delete line, case conversion, sorting selected lines alphabetically without regard to capitalization, trailing-whitespace cleanup and date/time insertion.
  • Whole-file literal find/replace, match case, whole word, forward/backward wrapped search, regular expressions, capture-group replacements and single-step undo for Replace All.
  • File-wide line numbers, go to line, line-number bookmarks, zoom, word wrap, whitespace display, syntax highlighting, dark/light themes and printing.
  • BOM detection for UTF-8/16/32, explicit Windows-1252 and Unicode opening, strict encoding conversion, and selectable CRLF/LF/CR line endings.
  • Side-by-side diff of two files or the current document including unsaved edits; insertion/removal/change colors, next/previous change, ignore whitespace, line copy, and exported text comparison reports.
  • A custom multi-resolution application/installer icon.

Spell checking (1.2.1)

Use Spelling → Check document (F7) to check the whole text document, or Spelling → Check selected text (Shift+F7) to check a selection. These work for ordinary text and extracted PDF/Office document text. In a diff window, F7 continues to navigate changes.

The spelling dialog uses installed Windows dictionaries and offers suggestions, an editable replacement, Change, Ignore once, Ignore all, and Add to dictionary. Choose a language from its language button. Personal words are stored per language in Lumen Text's preferences, not in the Windows-wide dictionary. The Personal dictionary button lets you edit or remove words. Language and ignore options are saved. Corrections update the editing buffer and can be undone with Ctrl+Z; use the usual Save command to write document changes to disk.

Checks run on a background thread in chunks of at most 16 Ki characters, preserving whole words and document-wide offsets. Large-file checking covers content beyond the currently visible editing window. Cancel/Close waits for the current small native check to finish and stops further scanning. Already-applied corrections remain in the editor. The document is locked for editing while the spelling dialog is open, so correction positions cannot become stale through normal editor use.

Uppercase words, words with numbers and code-like tokens (URLs, email addresses, underscored identifiers and camelCase words) can be ignored. This is on-demand spelling review, not continuous as-you-type underlining or a grammar checker. It does not parse code to isolate comments. Words longer than 128 characters are skipped; personal dictionaries allow 10,000 words per language. Selections that begin/end inside a word skip that partial word. If Windows has no spelling dictionary for a language, install its Basic typing feature in Windows Settings.

Windows API reference: https://learn.microsoft.com/en-us/windows/win32/api/spellcheck/nn-spellcheck-ispellcheckerfactory

GitHub Dark dimmed (1.1.5)

The selected appearance matches the softer GitHub Dark dimmed sample: slate backgrounds, softer foregrounds, blue interaction accents, orange active-tab rules, GitHub primary buttons, and GitHub syntax/diff colors. Enable View -> GitHub Dark dimmed to use it. The alternate light mode uses GitHub Light.

Colors are adapted from GitHub Primer Primitives 11.10.0. Font family/size controls and recent-file clearing remain available.

Use File -> Recent files -> Clear recent files to remove the saved history. This does not delete files or close open documents. An empty menu shows No recent files.

Font, menu and file support (1.1.0)

Use View → Text font to search installed Windows fonts and choose a family, size from 6–72 pt, bold and italic, with a live preview. The setting is saved and applies to open/new editor tabs, extracted document text, diff contents and printing. The comparison window also has a Font button. Changing display fonts does not add formatting to saved plain-text files. Hex rows keep a fixed-width font for alignment while following the selected size.

Menus use tighter row padding, smaller gutters and compact dropdowns while retaining the tested dark/light contrast.

The Open dialog defaults to All files and also groups documents, source/data, images and archives. Files are inspected before opening rather than restricted to .txt extensions. Drag-and-drop, recent files and command-line opening use the same format detection.

File type Opening behavior
Text, source code, logs, CSV/TSV, JSON, XML, configuration, arbitrary text extensions Editable text; original large-file paging/search/save behavior
PDF Selectable text with page headings; editable copy/export to text
DOCX, DOCM, DOTX, DOTM Word body, table paragraph, header/footer and footnote text
XLS, XLSX, XLSM, XLSB, XLTX, XLTM Sheet headings and tab-separated cell values; cached formulas only
PPTX, PPTM, PPSX, PPSM, POTX, POTM Slide text in presentation order
RTF, ODT, ODS, ODP Extracted text
EPUB Text in the book's spine/reading order
PNG, JPEG, GIF, BMP, TIFF, ICO Read-only first-frame image preview with Fit / Actual size
ZIP, JAR, NUPKG Directory listing as text; entries are never extracted to disk
Other binary formats, including legacy DOC/PPT Read-only paged hexadecimal/ASCII view

PDF and Office support is text extraction, not original-format editing or a page renderer. Original layout, images, charts and rich formatting are not reproduced; macros and embedded content are not executed. Scanned PDFs require OCR, which is not included. Password-protected documents are not supported in this version. Legacy Word .doc and PowerPoint .ppt are available in hex view; save/convert them to DOCX/PPTX in their authoring application for text extraction. Excel .xls and .xlsb text extraction is supported and tested.

Imported documents are clearly labeled. Save exports a separate text copy; the original document path and PDF/Office output extensions are blocked for these extracted-text tabs. Text comparison can also compare PDF/Office extracted text. Use File → Open in hex view to inspect any file explicitly. Hex reads only 16 KiB at a time and supports previous/next windows and Go to offset.

Document extraction is limited to 128 MiB source files, 16 Mi UTF-16 output characters, 32 MiB XML parts, 256 MiB expanded packages and 10,000 archive entries. RTF sources are limited to 16 MiB. Image previews accept sources up to 128 MiB and 128 million source pixels, decode to a maximum width of 2,048 pixels, and show the first frame/page. These limits do not apply to ordinary disk-backed text editing or paged binary inspection. A failed extraction does not open a partial result.

Syntax coloring

Menus, nested menus and right-click menus use explicit theme colors, including shortcut labels, check marks, highlighting and disabled items. Menu text is 13 DIPs.

Syntax coloring is selected automatically from the filename. C (.c), C++ (.cpp, .cc, .cxx, .h, .hpp, .hh, .hxx, .ipp, .inl, .tpp, .ixx, .cppm, .C) and assembly (.asm, .s, .S, .inc, .nasm, .masm, .gas, .arm) have dedicated palettes for dark and light themes. C/C++ distinguish keywords, types, control flow, comments, strings, numbers, preprocessor directives and function calls. Assembly also distinguishes common instructions, registers and labels. Existing C#, Python, JavaScript, JSON, XML/HTML, CSS, SQL and other bundled AvalonEdit definitions remain available.

Use View → Syntax language to choose a language manually or turn coloring off with Plain text. Choose Automatic to return to filename detection. Manual choices survive saving and theme changes. The status bar shows the active language. Header files default to C++; choose C manually for a C-only header. Assembly uses general-purpose rules, not a complete dialect parser. In paged files, coloring is limited to the visible editing window; multiline constructs beginning outside the window may not retain their earlier context.

Large-file behavior

Opening streams text into a UTF-16 temporary disk store while building sparse piece and newline metadata. A disk-backed piece table retains original and added text; edits and undo records refer to pieces rather than copying the whole file. The original file is not held open after loading. File operations run away from the WPF UI thread and can be cancelled.

Documents up to 2 million characters normally have a continuous editing view. Larger documents use windows of up to 128 Ki characters. Very long lines detected during the initial inspection use 32 Ki-character windows. Use Alt+Page Up/Down to move between windows, Ctrl+G to jump to any line, or Ctrl+Home/End to reach the beginning/end of the file. Global line numbers stay visible in the gutter. Search, Replace All, undo, save, and comparison operate on the whole document. Ctrl+A and clipboard selection apply to the current editing window.

The buffer uses 64-bit character offsets. Memory still grows with piece metadata, undo history and the number of open documents, but file contents and comparison rows are kept on disk. The backing store needs roughly twice the decoded character count in bytes, plus appended edits. A comparison snapshots both inputs and writes 52 bytes per aligned row. Saving temporarily needs room for another encoded copy beside the destination. The store is deleted when its document closes; unsaved documents are not recovered after a crash.

Defined limits and tradeoffs

  • Regular expressions operate on documents up to 8 Mi characters, with a two-second regex timeout. Replace All streams expanded output to disk with a 64 Mi-charact 7CAE er output limit; single replacement expansions are limited to 8 Mi characters. Exceeding a limit leaves the document and its undo history unchanged. Literal search and replace remain available on larger files.
  • Diff uses a 128-line synchronization window. This bounds comparison memory and time per mismatch. It is not a globally minimal edit script: long moves or large insertions can be grouped as replacements. It compares normalized text, so BOM, encoding and line-ending differences do not count as changes. The viewer is read-only; it is not a three-way merge tool.
  • Diff previews show at most 4,096 characters per line; Copy retrieves up to one million characters. Reports contain labeled previews, not patches. Change navigation retains the first 100,000 change groups; every comparison row remains scrollable. A comparison supports up to Int32.MaxValue aligned rows.
  • Printing whole documents is limited to 500,000 characters. Select a range in a large document to print that range. Line bookmarks refer to line numbers.
  • Newlines are normalized internally. A mixed-newline input is flagged when opened; saving normalizes it to the selected line ending. Invalid decoding, unrepresentable output characters and binary NUL bytes produce an error rather than silent loss.
  • There are up to 500 undo records. Added text remains in the backing store until the document closes. Search text is limited to one million characters.

Save safety

Saves stream into a new file in the destination directory, flush it, then replace the destination. Cancellation or encoding failures leave the original file intact. The file size and modification timestamp are checked before and immediately before publishing a save. If another application changed the destination, reload it or save your edits under another name. File permissions and read-only errors are reported to the user.

Keyboard shortcuts

Action Shortcut
New / open / save Ctrl+N / Ctrl+O / Ctrl+S
Save as / save all Ctrl+Shift+S / Ctrl+Alt+S
Close / next tab Ctrl+W / Ctrl+Tab
Undo / redo Ctrl+Z / Ctrl+Y or Ctrl+Shift+Z
Find / replace Ctrl+F / Ctrl+H
Next / previous match F3 / Shift+F3
Go to line Ctrl+G
First / last file position Ctrl+Home / Ctrl+End
Previous / next editing window Alt+Page Up / Alt+Page Down
Duplicate / delete line Ctrl+D / Ctrl+Shift+K
Toggle / next / previous bookmark Ctrl+F2 / F2 / Shift+F2
Insert date/time F5
Compare active document Ctrl+Shift+D
Next / previous diff change F7 / Shift+F7
Zoom / reset zoom Ctrl+mouse wheel / Ctrl+0
Help F1
Check whole document / selection F7 / Shift+F7 (editor window)

Build and validate

From the solution directory in PowerShell:

dotnet build LumenText.sln -c Release
dotnet test LumenText.sln -c Release
.\scripts\Test-Ui.ps1
dotnet run --project tools\LumenText.Benchmarks -c Release -- 256 artifacts\benchmarks
.\scripts\Build-Installer.ps1

Build-Installer.ps1 tests the solution, publishes a self-contained x64 build, and invokes Inno Setup 7 from Program Files. Supply -InnoCompiler to use a different ISCC.exe path. Create-Icon.ps1 repackages the included artwork into ICO sizes 16, 24, 32, 48, 64, 128 and 256.

The installer builder accepts Release only, enables optimization, excludes PDB files, and checks the app and core assemblies' actual build configuration before packaging. artifacts/publish/Release/win-x64/release-build.json records the verified configuration and assembly hashes. The installer test also checks that the installed assemblies match those Release hashes. To run the packaging test when Lumen Text is not installed, use .\scripts\Test-Installer.ps1; it installs into an isolated artifacts folder, runs the application's diagnostics, then uninstalls the test copy. The test uses an explicit /CURRENTUSER command-line override to avoid changing Program Files or machine-wide registration. Normal installation defaults to the administrator/Program Files configuration, which the test also checks in the installer definition. No installation-mode selection is shown in the normal wizard.

The WPF diagnostic mode verifies real editing, save/reopen, cross-window undo, global paging, and diff virtualization, and renders dark/light/editor/diff previews to artifacts/ui-tests. It runs only when explicitly invoked with --smoke-test. Benchmarks create deterministic files, validate edits after saving, reopen and compare the saved output, record timings and process memory, then delete test data. Results are specific to the machine and filesystem cache state, not guarantees.

Source map

  • src/LumenText.Core: disk-backed buffer, encoding/safe-save layer, search and diff.
  • src/LumenText.App: WPF views, paged editor, preferences and UI diagnostics.
  • tests/LumenText.Tests: randomized editing, round trips, save safety, Unicode, cancellation, search boundaries and comparison tests.
  • tools/LumenText.Benchmarks: large-file performance and correctness checks.
  • installer/LumenText.iss: Inno Setup 7 installer source.
  • scripts: repeatable build, icon and UI verification commands.

Settings and recent paths are stored in %LocalAppData%\LumenText\settings.json. Preference writes merge changes under a cross-process lock; an older running window does not restore cleared history or discard another window's personal dictionary edits. Temporary document and diff storage is under %TEMP%\LumenText.

Editor component: AvalonEdit. Installer documentation: Inno Setup 7. See LICENSE.txt and THIRD-PARTY-NOTICES.md for licensing information.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0