SlickEdit Community
SlickEdit Product Discussion => SlickEdit® => Topic started by: rowbearto on February 14, 2019, 04:09:42 PM
-
To reproduce, look for tab_to_space_issue.tar.gz on support and follow the instructions in the README file.
-
Same issue occurs if I press <ENTER> after the printf statement and on the next line do "if<space>", then get tabs instead of spaces.
It seems like the same issue I previously reported in Java - https://community.slickedit.com/index.php/topic,16686.msg64422.html#msg64422
So maybe it wasn't really fixed? Or only fixed for Java and not C++?
I'm using 23.0.0.11 Linux x64 Centos 7.2, hotfix 3
-
I'll take a look at it today. If I remember correctly, the previous hotfix was general to any language that has a beautifier, so I don't have a good guess of what's going here yet.
-
Patrick: Were you able to reproduce it?
-
Yes. I did have to add a step after turning tabs on to do a single edit on the file before calling setIndentToSpace. I think this is hot-fixable.
For some reason, when you change the indent via LanguageSettings, the cached beautifier settings aren't being invalidated. If you need to, you can temporarily work around it by adding the following to the end of the setIndentWithTabsOrSpacesLang() function:
_beautifier_cache_clear(bufId.p_LangId);
You'll also need to import beautifier.e at the top of your utils file.
-
Thanks Patrick!
Would it hurt anything if I always kept the " _beautifier_cache_clear(bufId.p_LangId);" in my macro even after you make the hotfix?
Rob
-
No, it's a cheap operation, and there's no harm in it being done twice in a row.