Repository navigation
Implement print and preview for script and custom-function editors - #315
Draft
PawelTroka wants to merge 1 commit into
Draft
PawelTroka wants to merge 1 commit into
PawelTroka wants to merge 1 commit into
Conversation
This was referenced Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fixes #79.
On base
fe1aba49b5f9538355ffaaa3d1683f69a23d2d9c, open a script or custom function, edit its buffer, then use File → Print or File → Print preview. Both editor branches in those commands are empty, so neither action does anything. Chart printing already has a separate implementation.Change
IPrintingcontract. Preserve chart dispatch and the existing keyboard fallback in other views.This is whole-document plain-text printing. Syntax colors, selection-only printing, page ranges and a page-setup UI are outside this change.
Validation
Reviewed and uploaded tree:
2381ad38daad96f74140983025a9b5a7e5d8a625, identical to the tested local commit. Local host: Linux x64, SDK 10.0.403 (allowed by the repository'slatestPatchpolicy).Executed
Final affected-code rerun:
29 passed, 0 failed, 0 skipped against the final production paginator, dedicated layout-error type and page-layout code. These cases cover line endings/blank lines, page continuation, measured widths, surrogate pairs/combining characters, tabs, long-line measurement bounds, invalid measurements/dimensions, progress guarantees and physical printer-margin geometry.
The full engine suite also passed 1,467 / 1,467, with no failures or skips, at preceding local commit
7c6f8d20a3f0d5a9c356e75cf78d9637c6247cda, using the same command without the filter or--no-restore. The final review then narrowed expected print errors to a dedicated exception type and added error-report deduplication; the 29 affected portable cases and both desktop builds were rerun on the final source. The 1,467 total is reported for that preceding run, not as a new full-suite execution after the review adjustment.The 18 committed command-routing cases were additionally run in a temporary
net10.0harness linking the actual productionPrintCommand/PrintPreviewCommandfiles andEditorPrintingCommandTests; only Windows UI shell/resource/interface dependencies were stubbed. Against the original commands: 6 failed / 12 passed, reproducing the missing editor actions. Against the fixed production files: 18 passed / 0 failed / 0 skipped. This verifies routing, not native dialog execution. The actual Windows Core test project also cross-built successfully below.git diff --checkpassed.Cross-built successfully; not executed natively
All three builds completed with 0 errors. The desktop/reduced Mono builds retain existing package compatibility, obsolete-member or unrelated-field/nullability warnings.
The 25 new native desktop cases compile against the real editors. They check selected/unsaved/untitled snapshots, unchanged selection/dirty flags/files, locked/deleted backing files, print-error preservation/deduplication, unexpected-error propagation, callback cancellation, pagination restart and the actual bitmap renderer. The renderer fixture attaches a first-page PNG when it executes on Windows. No native Windows test run, printer submission, screenshot or Mono GUI execution is claimed from this Linux host.
Before marking ready: run the repository's Windows Core/Desktop acceptance targets and the documented Print/Preview workflow with a configured PDF/native printer in both editor views for all three editor backends. Inspect wrapping, Unicode glyphs, page numbering and hard-margin alignment. Errors raised by native preview/print controller code outside document callbacks—for example device creation or EndPage/EndDoc during asynchronous preview, or the preview toolbar’s Print action—can still reach the application’s native error handler. Those paths, physical printer behavior and hard-margin alignment require Windows acceptance; the portable harness and cross-builds do not establish them. Actual visual captures are pending that native run.
Relationship to existing work
The issue, current implementation, open PRs and recent merged work were reviewed before this change. Existing #237 addresses chart preview, while open #310 addresses editor Find/Replace; neither implements editor printing. This PR is independently based on
master, with no dependency on another new PR. It does not modify translation catalogs owned by #306.Combined compatibility check — 2026-10-30
Also tested the final contributions in #311, #313, #314 and #315 together with the seven existing maintenance PRs (#304–#310), using the existing #312 candidate
189d28c0ec7acbf77d380f14f95ef450e7bfbd84as the local integration base.Eight shared paths required composition resolutions. These preserved all Euclid/ODE/polynomial aliases, completion and authoring registrations; Debye/unitary documentation; and Find/Replace/printing methods, test-source links and documentation entries. No feature behavior or numerical algorithm needed changing to combine the contributions. The independently published PRs remain based on master.
Combined local tree:
63225a973ea2883974a91ab26afcdc83d866e77b, SDK 10.0.403, Linux x64. The reference check used the authenticated master inventory plus current production reflection for changed entries through a portable UI shell. Native Windows tests, full native catalog execution and printer acceptance remain pending. The existing #312 PR was not changed by this local verification.