focus-editor / focus

A simple and fast text editor
GNU General Public License v3.0
1.82k stars 99 forks source link

Float literals with only one digit before the decimal point are incorrectly highlighted in HLSL #367

Closed fbjerno closed 6 months ago

fbjerno commented 6 months ago

Describe the bug Floats are incorrectly highlighted in HLSL.

To Reproduce Create a file with the .hlsl extension and enter a floating point literal with only one digit before the decimal point (e.g 0.0f or 3.7f). The decimal point and the 'f' at the end are not highlighted as part of the number (the digits before and after the decimal points are recognized as different number literals). I think this is related to a similar bug in the C parser which was fixed in this commit: https://github.com/focus-editor/focus/commit/c80f1fbb7484e236f52c3ff67cc336f60ef69f81

Expected behavior Float literals highlight the decimal point and 'f' suffix.

Screenshots image

focus-editor commented 6 months ago

Should be fixed in the next nightly. Please close the ticket if it all works as expected