sled

Једноставни уређивач текста
git clone https://git.sr.ht/~strahinja/sled
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

TODO.done (5901B)


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