From 1a2477ef7a34cc24c7bc18d7b6326643ce0995a2 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Fri, 18 Feb 2022 23:46:06 -0500 Subject: Implement new line editing "library" Losing tab complete and text macros, for now. This new implementation works on an instance of a struct and does not interact with the rest of catgirl, making it possible to copy into another project. Unlike existing line editing libraries, this one is entirely abstract and can be rendered externally. My goal with this library is to be able to implement vi mode. Since it operates on struct instances rather than globals, it might also be possible to give catgirl separate line editing buffers for each window, which would be a nice UX improvement. --- chat.h | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'chat.h') diff --git a/chat.h b/chat.h index 753d1a3..8a9a48f 100644 --- a/chat.h +++ b/chat.h @@ -341,31 +341,6 @@ int bufferReflow( struct Buffer *buffer, int cols, enum Heat thresh, size_t tail ); -enum Edit { - EditHead, - EditTail, - EditPrev, - EditNext, - EditPrevWord, - EditNextWord, - EditDeleteHead, - EditDeleteTail, - EditDeletePrev, - EditDeleteNext, - EditDeletePrevWord, - EditDeleteNextWord, - EditPaste, - EditTranspose, - EditCollapse, - EditInsert, - EditComplete, - EditExpand, - EditEnter, -}; -void edit(uint id, enum Edit op, wchar_t ch); -char *editBuffer(size_t *pos); -void editCompleteAdd(void); - const char *complete(uint id, const char *prefix); const char *completeSubstr(uint id, const char *substr); void completeAccept(void); -- cgit 1.4.1