| Age | Commit message (Collapse) | Author | Files | Lines | |
|---|---|---|---|---|---|
| 2017-02-25 | text: add iterator accessor function which translates \r\n to \n | Marc André Tanner | 1 | -0/+11 | |
| 2017-02-23 | vis: improve handling of \r\n line endings | Marc André Tanner | 1 | -6/+21 | |
| Change the text_iterator_char_{prev,next} functions to treat them as a single character, meaning cursor motions will skip both bytes at the same time. | |||||
| 2017-02-20 | text: fix some integer overflow issues | Marc André Tanner | 1 | -3/+6 | |
| 2017-02-09 | text: fix use of uninitialized variable in error path | Marc André Tanner | 1 | -2/+2 | |
| 2017-02-08 | text: clean up iterator semantics | Marc André Tanner | 1 | -44/+61 | |
| We now guarantee the existence of at least one non-sentinel piece at all time and allow iterators to recover from these delimiting pieces. | |||||
| 2017-02-08 | text: remove special case for marks at start of file | Marc André Tanner | 1 | -4/+0 | |
| Unlike EOF address 0 needs no special treatment. | |||||
| 2017-01-20 | text: fix EOF handling for text_iterator_byte_next | Marc André Tanner | 1 | -1/+1 | |
| Handle zero length pieces gracefully. At some point we should write a comprehensive set of unit tests for the iterator API. | |||||
| 2016-12-23 | text: make text_vprintf static, it is only used within text.c | Marc André Tanner | 1 | -13/+13 | |
| 2016-12-22 | text: introduce EMARK to denote an invalid mark | Marc André Tanner | 1 | -2/+2 | |
| Technically this macro name is in the reserved namespace of errno.h. The same is true for EPOS. Maybe we should rename them at some point, but for now the short names are convenient. Fix #443 Close #444 | |||||
| 2016-12-22 | text: change datatype of Mark to uintptr_t | Marc André Tanner | 1 | -4/+6 | |
| This should avoid undefined pointer comparisons. | |||||
| 2016-12-22 | text: make default block size overridable via C pre-processor | Marc André Tanner | 1 | -0/+2 | |
| This will be used for unit test purposes to force more allocations. | |||||
| 2016-12-22 | text: avoid undefined multiple accesses in expression | Marc André Tanner | 1 | -1/+2 | |
| Work around for a (bogus?) tis-interpreter warning. | |||||
| 2016-12-22 | text: do not rely on indeterminate value in a comparison | Marc André Tanner | 1 | -1/+1 | |
| 2016-12-14 | text: expose text save method to calling code | Marc André Tanner | 1 | -9/+5 | |
| There are cases where it is useful to specify how the file should be saved. | |||||
| 2016-11-10 | vis-lua: change misnamed attribute values of `file.newlines` | Marc André Tanner | 1 | -5/+5 | |
| Also rename underlying C code. | |||||
| 2016-11-01 | text: change usage of sizeof idiom for allocation of new objects | Marc André Tanner | 1 | -6/+6 | |
| The new code is preferable because it works independently of the variable type. Whereas before a change in type, but not within the sizeof expression would cause a wrongly sized allocation. | |||||
| 2016-11-01 | text: rename Buffer to Block to avoid confusion with buffer.[ch] | Marc André Tanner | 1 | -123/+123 | |
| 2016-09-25 | text: improve variable naming | Marc André Tanner | 1 | -116/+116 | |
| s/Action/Revision/g | |||||
| 2016-05-07 | text: fix bug in line break caching logic | Marc André Tanner | 1 | -1/+2 | |
| 2016-04-18 | text: when saving also fsync(2) the destination directory after rename(2) | Marc André Tanner | 1 | -1/+17 | |
| 2016-04-17 | text: add infrastructure to save non-contiguous ranges | Marc André Tanner | 1 | -113/+184 | |
| 2016-03-23 | Remove identically replicated copyright comments from source files | Marc André Tanner | 1 | -15/+0 | |
| 2016-03-15 | text: improve ENOSPC handling when saving | Marc André Tanner | 1 | -0/+3 | |
| The default atomic save method using rename(2) would correctly fail, but the calling code would wrongly assume it was because of dealing with a special (e.g. hard or symlink) file or that some other properties (e.g. POSIX ACL, SELinux labels, permissions etc) could not be restored. It would then go on to ftruncate(2) the file, if the following writes then fail (which is likely if the new file content is bigger or some other process has used up disk space in the mean time) we lose data. This should fix it for the common case i.e. regular file where the rename(2) based method is used. The problem persits when directly overwriting a file. It is unclear whether this could be improved/fixed by: 1) first appending the new file content to the old one 2) fsync the data (old||new) 3) deleteing the original file content by overwritting it with the previously appended new file content. That is essentially moving the new file content from the end of the file to the start. 4) ftruncate to the new file size 5) fsync the data (new) if during 1) or 2) an error would occur we could revert the operation by doing a ftruncate to the original file size. An error in steps 3-5 would still be fatal. Another option would be to first write a backup file somewhere. | |||||
| 2016-02-21 | Cleanup new line insertion code | Marc André Tanner | 1 | -9/+12 | |
| 2016-01-10 | text: introduce text_bytes_alloc0 utility function | Marc André Tanner | 1 | -0/+12 | |
| Heap allocates a zero terminated string of the given range. Freeing is the caller's responsibility. Checks for unsigned integer overflow i.e. passing SIZE_MAX as len will always fail because there is no room for the terminating NUL byte. This is important as EPOS is defined to be SIZE_MAX. | |||||
| 2015-12-31 | text: let text_pos_by_lineno return EPOS if given a too large line number | Marc André Tanner | 1 | -1/+1 | |
| 2015-12-31 | text: introduce text_newline_insert | Marc André Tanner | 1 | -0/+11 | |
| 2015-12-29 | Clean up build system | Marc André Tanner | 1 | -6/+6 | |
| 2015-11-23 | text: introduce functions to iterate over graphemes | Marc André Tanner | 1 | -2/+55 | |
| They currently consider any character for which wcwidth(3) return 0 as a combining character. | |||||
| 2015-11-20 | text: get modification time after replacing file content in place | Marc André Tanner | 1 | -0/+2 | |
| At the start of text_save_range we stat(2) the file to check whether we have currently mmap(2)-ed it. Then we proceed to write the new file content which changes modification time. Hence we have to stat(2) again to retrieve it. This should fix spurious warnings about file changes outside the editor when editing e.g. symlinked files. | |||||
| 2015-11-08 | Update year numbers in Copyright clause | Marc André Tanner | 1 | -1/+1 | |
| 2015-11-02 | text: return end of changed range in text_redo | Marc André Tanner | 1 | -0/+2 | |
| This affects the cursor placement when redoing changes in single cursor mode. Closes #42 | |||||
| 2015-10-22 | text: introduce text_appendf utility function | Marc André Tanner | 1 | -0/+8 | |
| 2015-10-09 | text: fix usage of va_arg in text_vprintf | David B. Lamkins | 1 | -1/+4 | |
| Closes #76 | |||||
| 2015-10-05 | text: add text_{v,}printf function | Marc André Tanner | 1 | -0/+18 | |
| Convenient way to insert formated data into a Text. | |||||
| 2015-08-08 | text: rename some functions to improve consistency | Marc André Tanner | 1 | -7/+7 | |
| 2015-08-08 | text: introduce helper function text_delete_range | Marc André Tanner | 1 | -0/+6 | |
| 2015-07-28 | text: move utility functions to separate file | Marc André Tanner | 1 | -36/+1 | |
| 2015-07-25 | text: handle marks set to 0 and text_size(...) | Marc André Tanner | 1 | -0/+8 | |
| 2015-07-25 | text: add text_range_overlap | Marc André Tanner | 1 | -0/+6 | |
| 2015-07-22 | text: introduce text_range_new | Marc André Tanner | 1 | -0/+7 | |
| 2015-07-19 | vis: handle file truncation more gracefully | Marc André Tanner | 1 | -0/+8 | |
| If we use the file / virtual memory system as cache (using mmap(2)) and another process truncates the file we are editing, we have a problem. All we can do is catch the resulting SIGBUS, close the corresponding window and print a warning message. To test this use: $ dd if=/dev/zero of=TEST bs=8M count=1 $ vis TEST :! echo TRUNCATE > TEST | |||||
| 2015-07-19 | text: move regex related functions to separate file | Marc André Tanner | 1 | -68/+0 | |
| Eventually this should probably be rewritten to use an iternal regex engine, currently it has unacceptable memory usage, it copies the whole text. | |||||
| 2015-07-19 | text: slight cleanup, add a few comments | Marc André Tanner | 1 | -17/+22 | |
| 2015-07-10 | text: upon successfull file save store new modification time | Marc André Tanner | 1 | -7/+11 | |
| 2015-07-07 | text: safer temporary file creation | Marc André Tanner | 1 | -1/+4 | |
| Set umask before calling mkstemp. According to POSIX 2008 this is not necessary since the temporary file is guaranteed to be created with permission restricted to the current user. However this is more secure on non-conforming systems and safe as long as we do not use multiple threads. Fixes Coverity CID 101333. | |||||
| 2015-07-07 | text: avoid double close in error case | Marc André Tanner | 1 | -0/+1 | |
| 2015-07-07 | text: remove left over debugging code | Marc André Tanner | 1 | -6/+0 | |
| 2015-07-06 | Warn when saving a file which has been changed outside the editor | Marc André Tanner | 1 | -1/+8 | |
| 2015-07-06 | text: remove text_load_fd and text_fd_get | Marc André Tanner | 1 | -29/+10 | |
