summaryrefslogtreecommitdiff
path: root/text.h
AgeCommit message (Collapse)Author
2018-05-30text: allow to specify how the file content should be loadedMarc André Tanner
2018-05-16text: use mkstemp(3) for temporary file creation in atomic savesMarc André Tanner
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).
2017-07-11vis: cleanup register related APIMarc André Tanner
Also expose all register slots through the Lua API.
2017-05-03text: remove text_history_get functionMarc André Tanner
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-03text: remove text_iterate macroMarc André Tanner
2017-05-03text: remove text_insert_newline functionMarc André Tanner
This is no longer needed because we always insert \n never \r\n.
2017-05-03text: remove count argument from text_{earlier,later}Marc André Tanner
2017-05-03text: add miscellaneous documentation sectionMarc André Tanner
2017-05-03text: rename text_sigbus to text_mmapedMarc André Tanner
Add casts to uintptr_t to avoid unrelated pointer comparisons.
2017-05-03text: convert comments to doxygen formatMarc André Tanner
2017-04-09vis: remove handling of \r\n line endingsMarc André Tanner
Use something like dos2unix(1) and unix2dos(1), if you need to edit such files.
2017-04-09text: drop special handling of \r\n line endingsMarc André Tanner
2017-04-09text: add mem{r,}chr(3) based byte search functionsMarc André Tanner
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-08text: introduce text_char_get which converts \r\n to \nMarc André Tanner
2017-02-25text: add iterator accessor function which translates \r\n to \nMarc André Tanner
2016-12-23Apply format string attribute to printf style functionsMarc André Tanner
Not strictly C99 conform, but widely supported and easy enough to NOP for compilers which do not support it. Besides it was already used to mark certain functions as noreturn.
2016-12-23text: make text_vprintf static, it is only used within text.cMarc André Tanner
2016-12-22text: remove Filepos typedefMarc André Tanner
The idea might be good, but it was almost unused.
2016-12-22text: introduce EMARK to denote an invalid markMarc André Tanner
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-22text: change datatype of Mark to uintptr_tMarc André Tanner
This should avoid undefined pointer comparisons.
2016-12-14text: expose text save method to calling codeMarc André Tanner
There are cases where it is useful to specify how the file should be saved.
2016-11-10vis-lua: change misnamed attribute values of `file.newlines`Marc André Tanner
Also rename underlying C code.
2016-04-17text: add infrastructure to save non-contiguous rangesMarc André Tanner
2016-02-21Cleanup new line insertion codeMarc André Tanner
2016-01-10text: introduce text_bytes_alloc0 utility functionMarc André Tanner
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-31text: introduce text_newline_insertMarc André Tanner
2015-11-23text: introduce functions to iterate over graphemesMarc André Tanner
They currently consider any character for which wcwidth(3) return 0 as a combining character.
2015-10-22text: introduce text_appendf utility functionMarc André Tanner
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: 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-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-03Remove text dump debugging codeMarc André Tanner
Instead use the text-dump git branch if necessary.
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-27Core undo tree changesRyan Chipman
2015-04-22Cleanup line ending type detection and insertionMarc André Tanner
2015-04-21Remove redundant RegexMatch definitionMarc 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-01-06Rudimentary change list (accessible via g; and g,)Marc André Tanner
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