|
@@ -24,10 +24,11 @@
|
|
// TODO: Save file dialog
|
|
// TODO: Save file dialog
|
|
// Needed when ded is ran without any file so it does not know where to save.
|
|
// Needed when ded is ran without any file so it does not know where to save.
|
|
|
|
|
|
-// TODO: Jump up/down by paragraph
|
|
|
|
// TODO: An ability to create a new file
|
|
// TODO: An ability to create a new file
|
|
|
|
+// TODO: Jump up/down by paragraph
|
|
// TODO: Delete a word
|
|
// TODO: Delete a word
|
|
// TODO: Delete selection
|
|
// TODO: Delete selection
|
|
|
|
+// TODO: Jump to the beginning/end of the line
|
|
|
|
|
|
void MessageCallback(GLenum source,
|
|
void MessageCallback(GLenum source,
|
|
GLenum type,
|
|
GLenum type,
|
|
@@ -242,11 +243,11 @@ int main(int argc, char **argv)
|
|
if (editor.file_path.count > 0) {
|
|
if (editor.file_path.count > 0) {
|
|
err = editor_save(&editor);
|
|
err = editor_save(&editor);
|
|
if (err != 0) {
|
|
if (err != 0) {
|
|
- flash_error("Could not save file currently edited file: %s", strerror(err));
|
|
|
|
|
|
+ flash_error("Could not save currently edited file: %s", strerror(err));
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
// TODO: ask the user for the path to save to in this situation
|
|
// TODO: ask the user for the path to save to in this situation
|
|
- flash_error("No where to save the text");
|
|
|
|
|
|
+ flash_error("Nowhere to save the text");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
@@ -282,6 +283,19 @@ int main(int argc, char **argv)
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
+ case SDLK_TAB: {
|
|
|
|
+ // TODO: indent on Tab instead of just inserting 4 spaces at the cursor
|
|
|
|
+ // That is insert the spaces at the beginning of the line. Shift+TAB should
|
|
|
|
+ // do unindent, that is remove 4 spaces from the beginning of the line.
|
|
|
|
+ // TODO: customizable indentation style
|
|
|
|
+ // - tabs/spaces
|
|
|
|
+ // - tab width
|
|
|
|
+ // - etc.
|
|
|
|
+ for (size_t i = 0; i < 4; ++i) {
|
|
|
|
+ editor_insert_char(&editor, ' ');
|
|
|
|
+ }
|
|
|
|
+ } break;
|
|
|
|
+
|
|
case SDLK_c: {
|
|
case SDLK_c: {
|
|
if (event.key.keysym.mod & KMOD_CTRL) {
|
|
if (event.key.keysym.mod & KMOD_CTRL) {
|
|
editor_clipboard_copy(&editor);
|
|
editor_clipboard_copy(&editor);
|
|
@@ -336,7 +350,8 @@ int main(int argc, char **argv)
|
|
|
|
|
|
case SDL_TEXTINPUT: {
|
|
case SDL_TEXTINPUT: {
|
|
if (file_browser) {
|
|
if (file_browser) {
|
|
- // TODO: file browser keys
|
|
|
|
|
|
+ // Nothing for now
|
|
|
|
+ // Once we have incremental search in the file browser this may become useful
|
|
} else {
|
|
} else {
|
|
const char *text = event.text.text;
|
|
const char *text = event.text.text;
|
|
size_t text_len = strlen(text);
|
|
size_t text_len = strlen(text);
|
|
@@ -382,3 +397,4 @@ int main(int argc, char **argv)
|
|
// TODO: ability to search within file browser
|
|
// TODO: ability to search within file browser
|
|
// Very useful when you have a lot of files
|
|
// Very useful when you have a lot of files
|
|
// TODO: ability to search with the text editor
|
|
// TODO: ability to search with the text editor
|
|
|
|
+// TODO: ability to remove trailing whitespaces
|