summaryrefslogtreecommitdiff
path: root/text.h
AgeCommit message (Collapse)Author
2024-09-13support piping a buffer to an external processFlorian Fischer
Currently only Text objects can be piped to external commands. This is tedious if data not available in any file should be passed to an external process (e.g. building options and passing them to vis-menu). This adds the option to pass a buffer to _vis_pipe and provides wrapper functions for the original behavior and the new one.
2022-11-29fix miscellaneous spelling mistakesNick Hanley
2020-12-10fix typos in commentsMoesasji
2020-10-10text: provide public text_iterator_initMarc André Tanner
It can be used to initialize a (stack allocated) Iterator structure, avoiding the copying of the return value as done by text_iterator_get which depending on the implementation might be problematic.
2020-10-10text: mark return value of text_iterator_text as constMarc André Tanner
2020-10-10text: make text_snapshot return whether it succeededMarc André Tanner
Currently this can't fail, but one can imagine implementations which do.
2020-10-10text: mark text_delete_range range argument as constMarc André Tanner
2020-10-10text: mark text_save_write_range range argument as constMarc André Tanner
2020-10-10text: mark text_mmaped argument as constMarc André Tanner
2020-10-10text: mark text_write{,_range} argument as constMarc André Tanner
2020-10-10text: mark text_size argument as constMarc André Tanner
2020-10-10text: mark text_mark_get argument as constMarc André Tanner
2020-10-10text: mark text_iterator_byte_get argument as constMarc André Tanner
2020-10-10text: mark text_bytes_alloc0 argument as constMarc André Tanner
2020-10-10text: mark text_byte(s)_get argument as constMarc André Tanner
2020-10-10text: mark text_iterator_get argument as constMarc André Tanner
2020-10-10text: mark text_state argument as constMarc André Tanner
2020-10-10text: mark text_modified argument as constMarc André Tanner
2020-10-10text: mark text_stat argument as constMarc André Tanner
2020-10-10text: introduce text_iterator_textMarc André Tanner
2020-10-10text: introduce text_iterator_has_{next,prev}Marc André Tanner
Abstract away access to `it->piece` inorder to enable different implementations/backends.
2020-08-29text: provide save function taking a directory descriptorMarc André Tanner
The standard does not specify mkstempat(3). We currently implement it in a non thread safe manner, by temporarily changing the process working directory before invoking mkstemp(3).
2020-08-29text: provide load function taking a directory descriptorMarc André Tanner
2020-08-29text: move misplaced text_save documentation snippetMarc André Tanner
2020-08-01doc: fix a couple of API doc warningsMarc André Tanner
In restructured text double backquotes are used for inline literals.
2020-05-13text: introduce text_save_method, remove text_save_rangeMarc André Tanner
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.
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