Up Next:
-* fix crash on saving read-only file
-* Run commands in the background and don't block the main thread.
+* refactor x11.c and win.c
+* Add a GoTo tag for ctags lookup and line number jump (or right click magic?)
+* Add keyboard shortcut to highlight the thing under the cursor
* Make Fn keys execute nth command in the tags buffer
-
+* Run commands in the background and don't block the main thread.
* check for file changes on save
* check for file changes when window regains focus
* 100% coverage with unit and unit-integration tests
-* Add a SaveAs tag that takes an argument for the filename to save as
-* Add a GoTo tag for ctags lookup and line number jump (or right click magic?)
-* Add keyboard shortcut to highlight the thing under the cursor
* right click to fetch file or line
* Status line should omit characters from beginning of path to make file path fit
Straight-up Bugs:
+* fix crash on saving read-only file
+* fix crash on save to file that can't be created
* tab inserts dont coalesce like one would expect
-* off by one error on scrolling up with wrapped lines
-* Ctrl+u with a selection clears to bol *before* selected text
The Future:
Toggle the line\-ending style for the buffers contents between LF and CRLF
.
.TP
-\fBFind\fR
+\fBFind [term]\fR
Find the next occurrence of the selected text\.
.
.TP
Save the contents of the buffer to disk\.
.
.TP
+\fBSaveAs [path]\fR
+Save the contents of the buffer to disk\. If a path argument is provided, the buffer will be saved to the new path\.
+.
+.TP
\fBTabs\fR
Toggle the expand tabs featuer on or off\.
.
Copy the selection to the X11 CLIPBOARD selection.
* `Eol`:
Toggle the line-ending style for the buffers contents between LF and CRLF
-* `Find`:
+* `Find [term]`:
Find the next occurrence of the selected text.
* `Indent`:
Toggle the autoindent feature on or off.
Redo the last undone change.
* `Save`:
Save the contents of the buffer to disk.
+* `SaveAs [path]`:
+ Save the contents of the buffer to disk. If a path argument is provided, the
+ buffer will be saved to the new path.
* `Tabs`:
Toggle the expand tabs featuer on or off.
* `Undo`:
view_redo(win_view(FOCUSED));
}
+static void tag_save(char* arg) {
+ if (arg) {
+ char* path = win_buf(EDIT)->path;
+ win_buf(EDIT)->path = stringdup(arg);
+ buf_save(win_buf(EDIT));
+ free(path);
+ }
+}
+
static void tag_undo(void) {
view_undo(win_view(EDIT));
}
static Tag Builtins[] = {
{ .tag = "Quit", .action.noarg = quit },
{ .tag = "Save", .action.noarg = save },
+ { .tag = "SaveAs", .action.arg = tag_save },
{ .tag = "Cut", .action.noarg = cut },
{ .tag = "Copy", .action.noarg = copy },
{ .tag = "Paste", .action.noarg = paste },