* no trimming of trailing whitespace
* use transaction processing for joining lines
-* Add tab and eol mode to window title
* implement mouse warping on search, jump to line, and focus change
* gap buffer does not handle UTF-8 currently
* no magic right click
}
void win_title(char* path) {
- XStoreName(X.display, X.self, path);
+ char title[4096] = {0};
+ if (!path) path = win_view(EDIT)->buffer.path;
+ if (!path) path = "*scratch*";
+ snprintf(title, sizeof(title)-1, "[%c%c] %s",
+ (DosLineFeed ? 'C' : 'N'),
+ (ExpandTabs ? 'S' : 'T'),
+ path);
+ XStoreName(X.display, X.self, title);
}
void win_font(char* font) {
static void tabs(char* arg) {
ExpandTabs = !ExpandTabs;
+ win_title(NULL); // force an update of title
}
static void indent(char* arg) {
CopyIndent = !CopyIndent;
+ win_title(NULL); // force an update of title
}
static void eol_mode(char* arg) {
DosLineFeed = !DosLineFeed;
+ win_title(NULL);
View* view = win_view(EDIT);
view_selectall(view);
char* txt = view_getstr(view);