static void indent(void);
static void del_indent(void);
static void add_indent(void);
+static void eol_mode(void);
static void debug_dump(void);
// Tag/Cmd Execution
};
Tag Builtins[] = {
- { .tag = "Quit", .action.noarg = quit },
- { .tag = "Save", .action.noarg = save },
- { .tag = "Cut", .action.noarg = cut },
- { .tag = "Copy", .action.noarg = copy },
- { .tag = "Paste", .action.noarg = paste },
- { .tag = "Undo", .action.noarg = undo },
- { .tag = "Redo", .action.noarg = redo },
- { .tag = "Find", .action.arg = find },
- { .tag = "Tabs", .action.noarg = tabs },
- { .tag = "Indent", .action.noarg = indent },
- { .tag = NULL, .action.noarg = NULL }
+ { .tag = "Quit", .action.noarg = quit },
+ { .tag = "Save", .action.noarg = save },
+ { .tag = "Cut", .action.noarg = cut },
+ { .tag = "Copy", .action.noarg = copy },
+ { .tag = "Paste", .action.noarg = paste },
+ { .tag = "Undo", .action.noarg = undo },
+ { .tag = "Redo", .action.noarg = redo },
+ { .tag = "Find", .action.arg = find },
+ { .tag = "Tabs", .action.noarg = tabs },
+ { .tag = "Indent", .action.noarg = indent },
+ { .tag = "Eol", .action.noarg = eol_mode },
+ { .tag = NULL, .action.noarg = NULL }
};
void (*MouseActs[MOUSE_BTN_COUNT])(enum RegionId id, size_t count, size_t row, size_t col) = {
view_indent(currview(), RIGHT);
}
+static void eol_mode(void) {
+ int crlf = getbuf(EDIT)->crlf;
+ printf("%d %d\n", crlf, !crlf);
+ getbuf(EDIT)->crlf = !crlf;
+ getbuf(TAGS)->crlf = !crlf;
+ exec(crlf ? "|dos2unix" : "|unix2dos");
+}
+
#if 0
static void dump_log(Log* log) {
for (; log != NULL; log = log->next) {