Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: don't show quotes on default macro params #1487

Merged

Conversation

pedrolamas
Copy link
Member

@pedrolamas pedrolamas commented Aug 28, 2024

This PR makes the following changes:

  • Removes delimiter quotes (" and ') from parameter default values
  • When macro is invoked:
    • ignore any empty value parameter
    • add quotes to parameter value only if any space is found in the value

As an example consider the following test macro:

[gcode_macro TEST_MACRO]
gcode:
    {% set A = params.A | default("") %}
    {% set B = params.B | default("value") %}
    {% set C = params.C | default("the value") %}
    {% set D = params.D | default(0) %}

Before:

image

image

After:

image

image

@pedrolamas pedrolamas marked this pull request as ready for review August 29, 2024 08:17
@pedrolamas pedrolamas added the FR - Enhancement New feature or request label Aug 29, 2024
@pedrolamas pedrolamas added this to the 1.30.4 milestone Aug 29, 2024
@pedrolamas pedrolamas merged commit f0f0764 into fluidd-core:develop Aug 29, 2024
6 checks passed
@pedrolamas pedrolamas deleted the pedrolamas/unquoted-param-defaults branch August 29, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FR - Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant