| Age | Commit message (Collapse) | Author | Files | Lines | |
|---|---|---|---|---|---|
| 2020-06-28 | text: simplify remapping of original file content | Marc André Tanner | 1 | -9/+1 | |
| Use mmap with MAP_FIXED which replaces existing mappings without any race conditions between the munmap/mmap calls. | |||||
| 2020-06-22 | text: remove dead store | Marc André Tanner | 1 | -1/+0 | |
| 2020-06-22 | text: code cleanup, use local variable | Marc André Tanner | 1 | -8/+9 | |
| No functionl change. | |||||
| 2020-06-22 | text: fix typo in comments, no code change | Marc André Tanner | 1 | -4/+4 | |
| 2020-05-13 | text: introduce text_save_method, remove text_save_range | Marc André Tanner | 1 | -9/+9 | |
| This utility function is analogous to text_load_method and allows the caller to specify how the file should be saved. It is implemented as a wrapper around the lower level text_save_{begin,write,commit} primitives. The unused text_save_range function has been removed. If needed, use the aforementioned lower level functionality. | |||||
| 2020-01-26 | text: ignore fsync(2) errors on unsupported directory descriptors | Marc André Tanner | 1 | -1/+1 | |
| When saving a file by atomically renaming it to its final destination, we fsync(2) the parent directory to make sure the new directory entry is persisted. However, not all file systems support fsync on file descriptors referring to directories. As a result the save operation fails and subsequent attempts result in warnings regarding outdated file content, even though the data has most likely been successfully written. Ignoring this particular error seems fine, because it is a permanent limitation of the file system and not a temporary failure. Fixes #792 | |||||
| 2018-05-30 | text: only default to mmap for files larger than 64 MiB | Marc André Tanner | 1 | -1/+1 | |
| 2018-05-30 | text: allow to specify how the file content should be loaded | Marc André Tanner | 1 | -3/+5 | |
| 2018-05-16 | text: use mkstemp(3) for temporary file creation in atomic saves | Marc André Tanner | 1 | -6/+25 | |
| Instead of simply appending a tilde to the original file name, we now create an unique temporary file based on the pattern `.filename.vis.XXXXXX`. In case the file does not yet exist, we use 0666 & ~umask as permission, (this should match the previous `open(2)` based behavior). | |||||
| 2018-05-16 | text: do not unlink existing `file~` when saving to `file` | Marc André Tanner | 1 | -1/+3 | |
| Fail atomic save if temporary file already exists. A follow up commit will use `mkstemp(3)` for temporary file creation. | |||||
| 2017-07-05 | text: limit write(2) calls to INT_MAX bytes | Marc André Tanner | 1 | -1/+1 | |
| Otherwise this fails on macOS. Fix #578 | |||||
| 2017-05-03 | text: remove text_history_get function | Marc André Tanner | 1 | -12/+0 | |
| As currently implemented this does not properly integrate with multiple cursor support. The functionality should be provided in a layer higher up. The jumplist and changelist need to be redesigned, for now they are broken. | |||||
| 2017-05-03 | text: remove text_iterate macro | Marc André Tanner | 1 | -3/+9 | |
| 2017-05-03 | text: remove text_insert_newline function | Marc André Tanner | 1 | -4/+0 | |
| This is no longer needed because we always insert \n never \r\n. | |||||
| 2017-05-03 | text: remove count argument from text_{earlier,later} | Marc André Tanner | 1 | -10/+4 | |
| 2017-05-03 | text: rename text_sigbus to text_mmaped | Marc André Tanner | 1 | -2/+3 | |
| Add casts to uintptr_t to avoid unrelated pointer comparisons. | |||||
| 2017-05-03 | text: rename text_byte_get argument name | Marc André Tanner | 1 | -2/+2 | |
| 2017-04-11 | text: do not redefine _GNU_SOURCE | Marc André Tanner | 1 | -1/+3 | |
| Fix #536 | |||||
| 2017-04-09 | text: use MB_LEN_MAX instead of MB_CUR_MAX | Marc André Tanner | 1 | -2/+3 | |
| 2017-04-09 | vis: remove handling of \r\n line endings | Marc André Tanner | 1 | -31/+1 | |
| Use something like dos2unix(1) and unix2dos(1), if you need to edit such files. | |||||
| 2017-04-09 | text: drop special handling of \r\n line endings | Marc André Tanner | 1 | -39/+6 | |
| 2017-04-09 | text: add mem{r,}chr(3) based byte search functions | Marc André Tanner | 1 | -0/+29 | |
| These are generally implemented efficiently in libc. While memrchr(3) is non-standard, it is a common extension. If it is not available, we use a simple C implementation from musl. | |||||
| 2017-04-08 | text: adjust iterator position when switching to adjacent pieces | Marc André Tanner | 1 | -2/+4 | |
| 2017-04-08 | text: introduce text_char_get which converts \r\n to \n | Marc André Tanner | 1 | -0/+5 | |
| 2017-04-08 | text: fix iterator semantics regarding windows style newlines | Marc André Tanner | 1 | -2/+4 | |
| At some point we might drop this mess and ask users to rely upon dos2unix(1) and unix2dos(1), respectively. | |||||
| 2017-03-31 | text: Add missing va_end() when | Raúl Peñacoba | 1 | -1/+3 | |
| vsnprintf fails | |||||
| 2017-03-22 | text: use proper open(2) flags when saving inplace | Marc André Tanner | 1 | -1/+1 | |
| This was wrongly changed in commit 74085e92c095d0bf4b98e262cc07ccf9b7dfff3b. | |||||
| 2017-02-27 | Honor user's umask when saving files | Michael Forney | 1 | -2/+2 | |
| If the user wants new files to be created as 600, they will have set their umask to 077 in their environment. vis shouldn't restrict this further than the user has configured. | |||||
| 2017-02-27 | Remove unnecessary umask change in text_save_begin_inplace | Michael Forney | 1 | -2/+0 | |
| POSIX says that The mkstemp() function shall use the resulting pathname to create the file, and obtain a file descriptor for it, as if by a call to: open(pathname, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR) So this umask change didn't do anything in practice, unless the original umask was more restrictive than 0177. | |||||
| 2017-02-27 | Fix a couple typos | Michael Forney | 1 | -1/+1 | |
| 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 | |
