fix: f, g, and h no longer impact behavior of / #2043
Closed
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.
This pull request removes special treatment of f, g, and h as implicit functions while typing in expressions. The main side affect of the old behavior was that the divide command (typing /) worked differently for variables containing f, g, or h as compared to those without f, g, or h. Fixes #1869
In EngineeringPaper.xyz, the user needs to type in unit names, many of which contain f, g, or h. When typing a unit name with one of these letters, the divide command behavior is surprising, see the screen recording below:
old.mov
After this change, the behavior is consistent as with variables names that don't contain f, g, or h:
new.mov
In this pull request, I simply removed the special treatment of f, g, and h. All of the current tests still pass. There doesn't seem to be other side affects besides the change in the behavior of the divide command. For example, the math json output doesn't seem to be impacted.
There's the possibility, of course, that I'm missing a side affect of this change. In that case, it may be desirable to keep the current behavior as the default and to provide the user the option to change which characters are treated as implicit functions. If you would like me to implement this as an option, let me know, and I would be happy to implement. I was thinking it would be best to add to the
InlineShortcutsOptions
object as maybeimplicitFunctions
.