Currently 'Convert to -> Tabs (from spaces)' replaces every X spaces with a tab, but IMO it is reasonable to do this only for leading spaces.
The reason is that if someone loads your spaces-to-tabs converted source into his/her editor that has a different 'spaces in tab' number set - the identation changes would be fine, but in-text identation will be corrupted.
Suppose we have this code:
#include "header.h" /* some comment*/
#include "another_header.h" /* some comment*/
#include <stdlib.h> /* some comment */
if (abc) {
foo = bar;
}
Here's what happens if user set 4 spaces in tab, converted spaces to tabs and loaded the converted file with 8 spaces in tab setting:
#include "header.h" /* some comment*/
#include "another_header.h" /* some comment*/
#include <stdlib.h> /* some comment */
if (abc) {
foo = bar;
}
If 'Convert to -> Tabs (from spaces)' would convert only leading spaces - such corruption could be avoided.