TODO.done (5498B)
1 Done or canceled todos 2 ====================== 3 4 [x] Hypothetical: editing a symlink to a file which gets deleted mid-editing, 5 then a save is attempted. Bail out (current behavior)? 6 - That is not the current behavior. Currently: 7 - If the target is deleted, it is recreated. 8 - If the symlink is deleted, it is recreated as a regular file. 9 (This behavior is the same as in vim.) 10 - What if a file was on a USB flash which was pulled out? 11 - vim writes the file under /mnt/filename 12 - ENOENT is returned by fopen(3), sled bails out. 13 - Interesting, since "the file" should be "created if it 14 doesn't exist" according to fopen(3), and open(2) 15 states that ENOENT is returned only if O_CREAT is not 16 specified, or a component of the pathname is not 17 present (/mnt is still present after removing the USB 18 flash drive) 19 - Decided to leave bailing out, printing an error, present for 20 now in this case. 21 22 [x] Make backup creation able to be disabled through a command-line 23 parameter? 24 - Rationale: usage in specific privilege-restricted scenarios 25 - Added -b/-B. 26 27 [x] Errors out on st-256color -> send patch for st upstream; improve 28 termbox2 error handling 29 - Why: tb_init was returning -17 (TB_ERR_UNSUPPORTED_TERM) under 30 $TERM=st-256color 31 [/] Send patch upstream 32 - No need now? The error seemingly disappeared after updating to 33 termbox.h from upstream 34 - Nope. Found the real cuplrit though - unveil(2) on the 35 terminfo path 36 - Added unveil(2) calls in termbox.h 37 [x] Improve termbox2 error handling 38 - Add ERR_TB_ERROR and handle termbox errors 39 40 [x] Investigate: typing text (at the end of a line) sometimes erases 41 text at the end of one of the previous lines in the same paragraph?! 42 - Fixed; this pretty nasty bug was due to improper use of bounds 43 44 [x] Syntax patch: remove unused variables 45 46 [x] Bugfix: SEGV in format_codep when rereading the file 47 48 [x] Reconsider state.error; it might be better to store only the errno code a la 49 errno 50 - Should tb_shutdown be called if malloc failed? It deallocates memory, 51 potentially messing everything up 52 - Maybe it would be better to just bail out, leaving the 53 terminal as-is 54 - Yes (added the parameter deallocate). 55 - Done. 56 57 [x] Fix removing blank lines when wrapping selected text containing multiple 58 paragraphs 59 60 [x] Recognize binary files (having NUL bytes) and refuse to open them; possibly 61 make it a config.h option? 62 63 [x] Investigate wrapping further 64 [x] Avoid blanks at the beginning of lines 65 [x] Last paragraph in README 66 [x] Second paragraph in wrap.test 67 68 [x] Convert #define's in config.def.h to struct Color 69 [x] Add struct Color to master branch 70 71 [x] Check wrapping with C-J when the last line in a paragraph is longer than 72 wrap width 73 74 [x] Investigate >2-byte UTF editing (Emoji...) 75 - setlocale(LC_ALL, ""); 76 77 [x] Add shortcut key which toggles showing line numbers at runtime 78 (default state still configured in config.h) 79 80 [x] (vis-like:) Dynamically compute max line number at runtime (number 81 of digits in the number of the last line drawn on screen) 82 83 </> Make allocation errors prompt to save the file before exiting? 84 - Would this make sense? 85 86 [x] Investigate wrapping 87 88 [x] Investigate: pressing Esc in save prompt should do nothing instead of 89 exiting 90 - Fixed; strchr(str, chr) returns a non-NULL pointer for ch == 0 91 92 [x] Make y/n prompts case-insensitive 93 94 [x] Investigate: paste text longer than a line, then type in the middle 95 of it -> overwrites the text?! 96 - Fixed; "to" parameter passed to U32_SAFE_COPY was not always 97 initialized?! Odd, since create_file/load_file should have initialized 98 it to LINE_DEFAULT. Now ENSURE_SIZE also initializes it if !to 99 100 [x] *str*cpy -> memccpy? 101 102 [x] Check (and possibly remove) leftover constants 103 104 [x] Bugfix: cursor after paste when on last line 105 - [x] Bugfix: copy copies the whole line to paste buffer 106 - [x] Adjust offsets for new *str*cpy logic 107 108 [x] Bugfix: sled /; sled /etc; report "No such file or directory" 109 110 [x] Deal with long filenames (add ... at the end and leave space for *) 111 112 [x] Switch to strlcpy, strlcat; check u8_*/u32_* 113 114 [x] Change the backup method, as `crontab -e` doesn't like inode changes 115 (crontab -e with CREATE_BACKUPS gives: 116 117 crontab: crontab temp file moved, editor may create backup files\ 118 improperly 119 crontab: no changes made to crontab 120 121 - Currently: 122 mv file file~ 123 write to file 124 125 - Planned: 126 cp file file~ \ very inelegant, but the 127 <change file~ mtime?> / only way to appease crontab -e 128 write to file 129 130 [x] Investigate segfault: 131 sled README 132 C-\ 133 G 134 /backup 135 N 136 - Can't reproduce it 137 - Fixed 2024-06-08 (size_t decrement bug) 138 139 [x] Migrate from using MANDIR to using MANPREFIX like suckless programs 140 ex: 141 MANDIR=$PREFIX/share/man/man1 142 for OpenBSD: 143 MANDIR=$PREFIX/man/man1 144 and then: 145 install -Dm 0644 myman.1 $MANDIR/myman.1 146 vs: ---------------------------------------------------- 147 MANPREFIX=$PREFIX/share/man 148 for OpenBSD: 149 MANPREFIX=$PREFIX/man 150 and then: 151 install -Dm 0644 myman.1 $MANPREFIX/man1/myman.1 152 This would need to be done for all my programs. 153 154 [x] Pressing h/Left on the start of line should go to the end of previous line, 155 similar for l/Right and beginning of next line 156 157 </> CLI interface? Example: 158 sled -c '^\G$^\\nSome text at the end^\^L10\ng/text\n' file.txt 159 (wq would be assumed.) 160 - Con: this would overlap with sed(1), with far less actual features.