Up Next:
+* ctrl+d with no selection does word selection instead of context
+* add config option to change default tab style
+* Diagnostic messages should order options so most frequent is closest to cursor
+* get rid of edit wrapper script
+* Add a way to CD using a builtin
+* Ctrl+Shift+N to set a mark, Ctrl+N to jump to a mark
* Make Fn keys execute nth command in the tags buffers
* move by words is inconsistent. Example:
var infoId = 'readerinfo'+reader.id;
-* Add a way to CD using a builtin
-* diagnostic messages should steal focus.
-* Ctrl+Shift+N to set a mark, Ctrl+N to jump to a mark
+* rename to tide
The Future:
+* Ctrl+Shift+g to jump to undo a goto line action
+* Shortcut to warp cursor to middle of current screen.
+* Find shortcut should select previous word if current char is newline
+* diagnostic messages can stack up if deselected and not resolved
+* highlight all matches of search term
+* Ctrl+Shift+Enter copies indent of wrong line
+
* use transaction ids to only mark buffer dirty when it really is
* refactor selection handling to buf.c to prepare for multiple selections.
* 100% coverage with unit and unit-integration tests
* implement command diffing logic to optimize the undo/redo log
* Status line should omit characters from beginning of path to make file path fit
-* Ctrl+Shift+g to jump to undo a goto line action
-* Shortcut to warp cursor to middle of current screen.
-* Find shortcut should select previous word if current char is newline
-* diagnostic messages can stack up if deselected and not resolved
-* highlight all matches of search term
-
# Auxillary Programs
* Visual diff tool
static void initialize(void) {
ShellCmd[0] = "/bin/sh";
- win_window("edit", onerror);
+ win_window("edit", ondiagmsg);
XDisplay = XOpenDisplay(NULL);
win_setkeys(Bindings);
//win_setmouse(&MouseHandlers);
TEST(Save should save changes to disk with crlf line endings) {
setup_view(TAGS, "", CRLF, 0);
- view_init(win_view(EDIT), "testdocs/crlf.txt", onerror);
+ view_init(win_view(EDIT), "testdocs/crlf.txt", ondiagmsg);
CHECK(verify_text(EDIT, "this file\r\nuses\r\ndos\r\nline\r\nendings\r\n"));
exec("Save");
- view_init(win_view(EDIT), "testdocs/crlf.txt", onerror);
+ view_init(win_view(EDIT), "testdocs/crlf.txt", ondiagmsg);
CHECK(verify_text(EDIT, "this file\r\nuses\r\ndos\r\nline\r\nendings\r\n"));
}
TEST(Save should save changes to disk with lf line endings) {
setup_view(TAGS, "", CRLF, 0);
- view_init(win_view(EDIT), "testdocs/lf.txt", onerror);
+ view_init(win_view(EDIT), "testdocs/lf.txt", ondiagmsg);
CHECK(verify_text(EDIT, "this file\nuses\nunix\nline\nendings\n"));
exec("Save");
- view_init(win_view(EDIT), "testdocs/lf.txt", onerror);
+ view_init(win_view(EDIT), "testdocs/lf.txt", ondiagmsg);
CHECK(verify_text(EDIT, "this file\nuses\nunix\nline\nendings\n"));
}
/* Action Callbacks
******************************************************************************/
-static void onerror(char* msg) {
+static void ondiagmsg(char* msg) {
view_append(win_view(TAGS), msg);
+ win_setregion(TAGS);
}
static void trim_whitespace(void) {
exit(0);
#endif
} else {
- view_append(win_view(TAGS),
- "File is modified. Repeat action twice quickly to quit.");
+ ondiagmsg("File is modified. Repeat action twice quickly to quit.");
}
before = now;
}
static bool changed_externally(Buf* buf) {
bool modified = (buf->modtime != modtime(buf->path));
- if (modified) {
- view_append(win_view(TAGS),
- "File modified externally: Reload, Overwrite, or {SaveAs }");
- }
+ if (modified)
+ ondiagmsg("File modified externally: Reload, Overwrite, or {SaveAs }");
return modified;
}
win_setregion(EDIT);
} else {
if (!buf->path && !buf->modified) {
- view_init(win_view(EDIT), pick, onerror);
+ view_init(win_view(EDIT), pick, ondiagmsg);
} else {
OpenCmd[1] = chomp(pick);
cmdrun(OpenCmd, NULL);
void onfocus(bool focused) {
/* notify the user if the file has changed externally */
- (void)changed_externally(win_buf(EDIT));
+ if (focused)
+ (void)changed_externally(win_buf(EDIT));
}
void onupdate(void) {
if (!ShellCmd[0]) ShellCmd[0] = getenv("SHELL");
if (!ShellCmd[0]) ShellCmd[0] = "/bin/sh";
/* Create the window and enter the event loop */
- win_window("edit", onerror);
+ win_window("edit", ondiagmsg);
char* tags = getenv("EDITTAGS");
win_settext(TAGS, (tags ? tags : DefaultTags));
win_setruler(RulePosition);
- view_init(win_view(EDIT), (argc > 1 ? argv[1] : NULL), onerror);
+ view_init(win_view(EDIT), (argc > 1 ? argv[1] : NULL), ondiagmsg);
win_setkeys(Bindings);
win_loop();
return 0;