File not formatting after saving in Sublime even when SublimeAstyleformatter's autoformat_on_save is true
So I tried setting up Sublime text editor for programming in cpp on mac , and to use formatter I added the sublimeAstyleformatter plugin and then followed these steps: Sublime Text > Preferences > Browse packages > SublimeAstyleformatter > SublimeAStyleFormatter.sublime-settings and inside the file I changed the autoformat_on_save to true and saved the file, but still whenver I save the cpp code, the file is not formatted. I searched but didn't find any way out, Any help would be appreciated
Solution 1:
I understand many windows users are facing the same issue on their systems too. It's probably because you may have installed fresh OS on your system. so let's get to the solving part. I am assuming if you are reading this answer you're already done with this step:
Preferences > Browse Packages > SublimeAStyleFormatter > SublimeAStyleFormatter.sublime-settings > "autoformat_on_save": true, (change false to true in line 8)
(If not then do the above step after installing AsytleFormatter package in sublime, and give it a go-to check whether it started working or not)
Now, after this, if your formatter still doesn't work there is a major chance your system doesn't have Microsoft Visual C++ 2010 x64 Redistributable - 10.040219
here is the official link : Microsoft Visual C++ 2010 x64 Redistributable-10.040219
install this software, restart your sublime editor and you are good to go. PS: For confirmation do the following (I have added snap for reference Screenshot):
- Right-click in the file on your sublime editor
- Hover over AStyleFormatter
- Now you will be able to see the "format" option (which previously was greyed out)
( Hope it helps to solve the issue :) )