* fix: make the error dialog caret point at the character it's blaming
Custom G-code parse errors print the offending line with a '^' under the
character that broke, positioned with spaces so it only lines up in a
fixed-width font. Since v2.3.2 these dialogs rendered entirely in the
proportional UI font, so the caret drifted left of its column and landed
on unrelated text.
Render only the code excerpts (the offending source line and its caret) in
the fixed-width face, leaving the surrounding prose in the UI font, and
reserve the horizontal scrollbar's height so a long line does not clip.
Rename the flag to has_code_excerpts to match what it now means.
Fixes#14869
* refactor(GUI): use <code> instead of <tt> for error excerpts
wxHTML maps <tt>, <code>, <kbd> and <samp> to the same fixed-width
handler, so this renders identically. <code> is the non-deprecated
tag and matches what the original code used.
* fix(GUI): align the error caret with real spaces, not
The caret line was padded with so its spaces would survive inline
HTML. wxHTML measures every glyph by its font extent, so where the fixed
font lacks a U+00A0 glyph the fallback renders it about twice as wide, and
the all- caret line outran the source, drifting the ^ to the right.
Wrap the excerpts in a small <excerpt> tag, registered on the dialog's own
parser, that switches on wxHTML literal-whitespace mode so the caret uses
real spaces that match the source column in any font. It sits inside <code>
for the fixed face; <pre> would do both but forces a blank line above it.
---------
Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
feat: add regex_replace() string transform to filename templates
The filename template language could test strings (=~, !~, one_of) but
never rewrite one, so there was no supported way to reshape a placeholder
value, such as dropping a file extension from {first_object_name}.
Add regex_replace(subject, /pattern/, replacement), reusing the existing
regex-literal syntax and boost::regex engine. Every placeholder keeps
returning its exact value and the template does the transform explicitly:
{regex_replace(first_object_name, /\.[^.]*$/, "")} strip any extension
The replacement may reference capture groups ($1, $2, ...). It is one
grammar function mirroring digits(), with the name registered as a keyword
so it is not parsed as a variable.
* Support accessing `coFloatsOrPercents` values in gcode template (OrcaSlicer/OrcaSlicer#14522)
* Vector option values are separated by comma
* Fix wrong cast used for checking nullability
1.Add sync command. Now gcode and dirrectly add time sync command
2.Add support for ceil and floor in placeholder
3.Update change filament gcode for H2D
jira: NONE
Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I6dd97cbd96bae1c2751c08357ff64947876d7471
(cherry picked from commit c99fcd454c2499b0c0e3ed9402a2182c00a9bffa)
1. support recommended filament map when print by object
2. placeholder_parser support function filament_change
3. extruder_id of filament_map is start from 1
Change-Id: Ide8019cd4a165a25972f22706ff685c3005aa031
(cherry picked from commit b42d94e1d05236b8b7b2e65b4a24810eecf040cb)