insert spaces instead of tabs, makes editing templates less painfull, tho we should really have a function to insert strings rather then char's for this to work better.

This commit is contained in:
Campbell Barton 2009-11-18 01:16:49 +00:00
parent b6e015f70c
commit 5ad1563f34

@ -2368,6 +2368,16 @@ int txt_add_char (Text *text, char add)
return 1; return 1;
} }
/* insert spaces rather then tabs
* TODO, this will run an undo push each time (not nice) */
if (add == '\t') {
int totspace = 4 - (text->curl->len % 4);
while(totspace--) {
txt_add_char(text, ' ');
}
return 1;
}
txt_delete_sel(text); txt_delete_sel(text);
mrk= txt_find_marker_region(text, text->curl, text->curc-1, text->curl->len, 0, 0); mrk= txt_find_marker_region(text, text->curl, text->curc-1, text->curl->len, 0, 0);