santaclose / ImGuiColorTextEdit

Colorizing text editor for ImGui
MIT License
67 stars 18 forks source link

Compilation errors with Clang #18

Closed goossens closed 1 year ago

goossens commented 1 year ago

I can’t compile the current version due to errors in the rewrite of FindWordStart and FindWordEnd. When those methods were changed in commit https://github.com/santaclose/ImGuiColorTextEdit/commit/6ee401bd5477da9a894a10d372c8c375dc74a842 to use the new Move method, the aFront calling parameters is changed although it’s declared as a const reference. I’m surprised the Windows compiler allowed it (even with the type cast).

The offending lines in FindWordStart and FindWordEnd are the ones with the Move calls like:

while (Move((int)aFrom.mLine, charIndex, true, true))

My simple fix was to use the same pattern that was already used in the (now deleted) FindNextWord method. You can see my change at https://github.com/goossens/ImGuiColorTextEdit/commit/583fc70fbb1f58b33c628db24cb0c51cb505a642.

santaclose commented 1 year ago

that's good to know, thank you for reporting the issue. My understanding was that the value is being copied when i do the (int) casting and that's why it compiles correctly.

santaclose commented 1 year ago

let me know if https://github.com/santaclose/ImGuiColorTextEdit/commit/62490a207dae0b05b462205279e90b72778e2271 fixes the issue

goossens commented 1 year ago

Thanks, problem is now fixed. Closing issue.