forked from bartvdbraak/blender
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:
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user