summaryrefslogtreecommitdiff
path: root/text.c
AgeCommit message (Collapse)Author
2015-10-22text: introduce text_appendf utility functionMarc André Tanner
2015-10-09text: fix usage of va_arg in text_vprintfDavid B. Lamkins
Closes #76
2015-10-05text: add text_{v,}printf functionMarc André Tanner
Convenient way to insert formated data into a Text.
2015-08-08text: rename some functions to improve consistencyMarc André Tanner
2015-08-08text: introduce helper function text_delete_rangeMarc André Tanner
2015-07-28text: move utility functions to separate fileMarc André Tanner
2015-07-25text: handle marks set to 0 and text_size(...)Marc André Tanner
2015-07-25text: add text_range_overlapMarc André Tanner
2015-07-22text: introduce text_range_newMarc André Tanner
2015-07-19vis: handle file truncation more gracefullyMarc André Tanner
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-19text: move regex related functions to separate fileMarc André Tanner
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-19text: slight cleanup, add a few commentsMarc André Tanner
2015-07-10text: upon successfull file save store new modification timeMarc André Tanner
2015-07-07text: safer temporary file creationMarc André Tanner
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-07text: avoid double close in error caseMarc André Tanner
2015-07-07text: remove left over debugging codeMarc André Tanner
2015-07-06Warn when saving a file which has been changed outside the editorMarc André Tanner
2015-07-06text: remove text_load_fd and text_fd_getMarc André Tanner
2015-07-06Move filename from Text to FileMarc André Tanner
Also apply syntax rules every time the file name changes.
2015-07-06text: overhaul file load implementationMarc André Tanner
Files smaller than 8M are now copied into an internal buffer upon load. Thus they can be safely truncated. Larger files are memory mapped and use the file/virtual memory system as caching layer. Hence truncating them will corrupt the file content. Eventually the resulting SIGBUS should be handled gracefully.
2015-07-06text: overhaul save implemenationMarc André Tanner
Try to do an atomic save using rename(2) unless * the file is a symbolic link * the file is a hard link * file ownership can not be preserved * file group can not be preserved * POSXI ACL can not be preserved (if enabled) * SELinux security context can not be preserved (if enabled) in which case the file is overwritten in place. However a failure to do so results in data loss. Closes #47.
2015-07-05text: store buffer allocation type (mmap or malloc)Marc André Tanner
2015-07-03Do not take a snapshot in text_range_writeSilvan Jegen
Since text_range_write is called several times in cmd_filter, the undo command does not undo the whole filter operation but only up to the last call of text_range_write. Removing the snapshot-taking code solves this issue.
2015-07-03Remove text dump debugging codeMarc André Tanner
Instead use the text-dump git branch if necessary.
2015-06-28Fix copy/paste error in text_restoreMarc André Tanner
This really needs some unit tests.
2015-06-28Replace a->time with a->seq in history_traverse_toRyan Chipman
2015-06-28Add seq field to Action structRyan Chipman
2015-06-27Make :earlier and :later accept arguments similar to vimMarc André Tanner
Currently the following arguments are accepted: {count} Go to older text state {count} times. {N}s Go to older text state about {N} seconds before. {N}m Go to older text state about {N} minutes before. {N}h Go to older text state about {N} hours before. {N}d Go to older text state about {N} days before
2015-06-27Mark internal undo tree functions as staticMarc André Tanner
2015-06-27Core undo tree changesRyan Chipman
2015-06-24fixed some typos in commentsRyan Chipman
2015-04-22Cleanup line ending type detection and insertionMarc André Tanner
2015-04-05Introduce new struct VisTextMarc André Tanner
This adds yet another layer of indirection and stores vi related stuff which is associated with a given text but shared among all windows displaying it (e.g. marks). This will also help if one wants to keep texts arround which aren't currently displayed.
2015-02-03Fix :nnn where nnn > maximal number of linesMarc André Tanner
2015-01-18Do not leak memory in repeated text_filename_set callsMarc André Tanner
2015-01-16Print debug output to stdoutMarc André Tanner
Stderr is used for the editor output to make usage as a filter possible.
2015-01-16Avoid possible double close when savingMarc André Tanner
We want close(2) to happen before rename(2). At some point the save implementation will have to be overhauled.
2015-01-11More useful error message when opening non regular filesMarc André Tanner
2015-01-06Rudimentary change list (accessible via g; and g,)Marc André Tanner
2015-01-03Fix size_t specifiers in format stringsMatthias Braun
2015-01-02Rip out insertion repeating infrastructureMarc André Tanner
2015-01-01Introduce externally managed marksMarc André Tanner
2015-01-01Rename mark related functionsMarc André Tanner
2014-10-25Treat file read from stdin as unmodifiedMarc André Tanner
2014-10-25Introduce text_range_sizeMarc André Tanner
2014-10-25Support partial writesMarc André Tanner
2014-10-25Support partial savesMarc André Tanner
2014-10-25Change return type of text_saveMarc André Tanner
2014-10-24Do not crash when given an invalid search patternMarc André Tanner
2014-10-23Move feature test macros to config.mkMarc André Tanner