My .cxx files have 8-character indentation, while .cpp files have 4-character one. They have exact same modes enabled:
My auto-mode-alist has the following c++ lines:
("\\.ii\\'" . c++-mode)
("\\.h\\'" . c-or-c++-mode)
("\\.c\\'" . c-mode)
("\\.\\(CC?\\|HH?\\)\\'" . c++-mode)
("\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\'" . c++-mode)
("\\.\\(cc\\|hh\\)\\'" . c++-mode)
How can I fix the .cxx files?

.cxxfiles indented with tabs? – nega Mar 21 '20 at 18:48tab-widthto 4 and that did not change anything – honey_badger Mar 21 '20 at 19:14M-x+indent-region(C-M-\), saved and now it opens properly. Also, when I copy new code into new.cxxfile it opens with 4-character indentation. Could you please turn your comment into an answer for me to accept it? Thank you for your help! – honey_badger Mar 22 '20 at 12:45