From 05b0d98f5502342a0d821df2e23b6721e8ae1b27 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Mon, 26 Mar 2018 22:06:31 -0400 Subject: [PATCH] cleaned up prototypes and updated TODO --- TODO.md | 62 +++--------------------------------------------------- inc/edit.h | 29 ------------------------- tide.c | 3 +-- 3 files changed, 4 insertions(+), 90 deletions(-) diff --git a/TODO.md b/TODO.md index 82d0b02..96d294a 100644 --- a/TODO.md +++ b/TODO.md @@ -2,47 +2,25 @@ Up Next: -* Implement tab completion -* synchronize title with status contents. * B2+B1 click executes command with selection as argument -* Run commands in the background and don't block the main thread. -* update man pages with new functionality -* tfetch variable expansion needs to be reworked -* rename tide to twin and tctl to tide - -* moving from tags to the gutter does not transfer focus to edit region -* implement transaction control in buf.c -* Add a way to CD using a builtin (buffers will track original dir) -* shortcut to jump to previous edit * add command line flags to toggle options (Tabs, Indent, etc..) -* move by words is inconsistent. Example: - var infoId = 'readerinfo'+reader.id; The Future: +* Wily-like rc file for registering builtins * Case insensitive search * Ctrl+Up,Down requires two undos to revert. * Ctrl+Up,Down with non line selection should track column -* 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 * tab inserts dont coalesce like one would expect * implement command diffing logic to optimize the undo/redo log -* Status line should omit characters from beginning of path to make file path fit -* pickfile directory traversal when no tags file - -Possible Shortcuts: - -* Ctrl+/ - to comment/uncomment based on syntax -* Ctrl+{,} - Move to start or end brace of block -* Ctrl+(,) - Move to start or end of paragraph -* Ctrl+' - Move to matching brace, bracket, or paren -* Ctrl+. - repeat previous operation +* move by words is inconsistent. Example: + var infoId = 'readerinfo'+reader.id; Maybe think about addressing these later: -* switch buf.c to using a mmap buffer of utf-8/binary data * add current dir to path * add support for guidefiles * Shift+Insert should insert primary selection @@ -57,33 +35,6 @@ Maybe think about addressing these later: * File browser * Acme-like window manager -# Regular Expressions - -Operators: - - c Literal character - ^ Start of string - $ End of string - . Any char - [ ] Any character in the set - [^ ] Any character not in the reange - ( ) Grouping/matching - - ? Zero or one - * Zero or more - + One or more - - {n,m} From n to m matches - | Alternative - -# tcmd Tags - -build -fetch -ls -cat -cd - # Fetch Rule Syntax include [FILE] @@ -96,10 +47,3 @@ findfile [VALUE] matches [NAME] [REGEX] exec [CMD] [ARGS...] -# Syntax Highlighting - -Label, Conditional, Repeat, Character, Number, PreProc, Float, Operator, Structure - -Keyword GROUP [WORD...] -Match GROUP REGEX -Region GROUP start=REGEX skip=REGEX end=REGEX diff --git a/inc/edit.h b/inc/edit.h index 38eb6ed..8f355e4 100644 --- a/inc/edit.h +++ b/inc/edit.h @@ -7,21 +7,11 @@ typedef struct { } FMap; size_t pagealign(size_t sz); -FMap mmap_readonly(char* path); -FMap mmap_readwrite(char* path, size_t sz); -void mmap_close(FMap file); uint64_t getmillis(void); char* stringdup(const char* str); -char* fdgets(int fd); char* chomp(char* in); uint64_t modtime(char* path); -char* getcurrdir(void); -char* dirname(char* path); -bool try_chdir(char* fpath); -char* strconcat(char* dest, ...); -bool file_exists(char* path); char* strmcat(char* first, ...); -int daemonize(void); /* Buffer management functions *****************************************************************************/ @@ -99,25 +89,6 @@ size_t buf_getln(Buf* buf, size_t off); size_t buf_getcol(Buf* buf, size_t pos); size_t buf_setcol(Buf* buf, size_t pos, size_t col); -/* Charset Handling - *****************************************************************************/ -enum { - BINARY = 0, /* binary encoded file */ - UTF_8, /* UTF-8 encoded file */ - - /* these arent used but are reserved for later */ - UTF_16BE, /* UTF-16 encoding, big-endian */ - UTF_16LE, /* UTF-16 encoding, little-endian */ - UTF_32BE, /* UTF-32 encoding, big-endian */ - UTF_32LE, /* UTF-32 encoding, little-endian */ -}; - -void filetype(Buf* buf, FMap file); -void utf8load(Buf* buf, FMap file); -void utf8save(Buf* buf, FILE* file); -void binload(Buf* buf, FMap file); -void binsave(Buf* buf, FILE* file); - /* Screen management functions *****************************************************************************/ typedef struct { diff --git a/tide.c b/tide.c index 5d46f59..76a180d 100644 --- a/tide.c +++ b/tide.c @@ -118,8 +118,7 @@ static void del_to_bow(void) { } static void backspace(void) { - bool byword = x11_keymodsset(ModCtrl); - view_delete(win_view(FOCUSED), LEFT, byword); + view_delete(win_view(FOCUSED), LEFT, x11_keymodsset(ModCtrl)); } static void cursor_bol(void) { -- 2.54.0