summaryrefslogtreecommitdiff
path: root/text.c
AgeCommit message (Collapse)Author
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
2014-10-19Preserve file permissions when savingStephen Paul Weber
2014-10-17Make editor usable as a filter: echo foo | vis - | catMarc André Tanner
The terminal output is by default redirected to stderr, making stdout available for communications purposes. If a file is "opened" from stdin (i.e. vis is given '-' as argument) and a subsequent write without a filename is performed as in ":wq" the output is written to stdout.
2014-10-17Read stdin when given - as filenameMarc André Tanner
2014-09-28More helpful error when trying to open a non fileMarc André Tanner
This is not really correct e.g. vis /dev/zero will print a misleading error.
2014-09-28Make '.' repeat last insertionMarc André Tanner
2014-09-28Fix typo in piece table caching layerMarc André Tanner
This resulted in uneccesary pieces of size 1.
2014-09-28Improve argument validation in text_insertMarc André Tanner
2014-09-22Add support for the '<', '>' marksMarc André Tanner
2014-09-19This fixes warning with latest glibc (>= 2.19.90), which deprecated _BSD_SOURCEChristian Hesse
warning: _BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE Commit 4f537d8e4bd9707a0048289f296510b76ce6d642 just fixed one of three cases. Fix the remaining.
2014-09-19Remove some TODO itemsMarc André Tanner
2014-09-19Support files with Windows style newlines \r\nMarc André Tanner
2014-09-19Windows style newlines are actually \r\n not \n\rMarc André Tanner
This is fiddely stuff, hopefully it doesn't break too much
2014-09-16Fix editing of files with length 0Gregor Best
Signed-off-by: Gregor Best <gbe@unobtanium.de>
2014-09-14Fix save to absolute pathsMarc André Tanner
The save logic still needs changes to restore file permissions, ownership (if run as root) etc.
2014-09-14Make byte based iterator API handle the whole range [0, size]Marc André Tanner
Before this commit the valid range was [0, size) which represents the file content. For the position at EOF (=size) a NUL byte is returned which is not actually part of the underlying file. This should fix various movements / editing operations at the end of the file. For example Ctrl+w at the end of the command prompt.
2014-09-14Use EPOS where appropriateMarc André Tanner
2014-09-14All *_free(...) functions should accept a NULL argumentMarc André Tanner
2014-09-14Fix clang static analyzer warningsMarc André Tanner
2014-09-13Introduce some helper functions dealing with FilerangeMarc André Tanner
2014-09-13Rename text_insert_raw to text_insertMarc André Tanner
2014-09-13Introduce and use EPOS instead of (size_t)-1Marc André Tanner
2014-09-12Make sure that the state is consistent after an undo operationMarc André Tanner
When performing an undo operation, further changes should not be accounted to the then active action. Therefore take a snapshot which resets txt->current_action to NULL.
2014-09-12Remove outdated commentsMarc André Tanner
2014-09-12Introduce text_filename_setMarc André Tanner
This can be used to associate a given filename to a currently unnamed text.
2014-09-12Rename text_filename to text_filename_getMarc André Tanner
2014-09-12Restore cursor position after an undo/redoMarc André Tanner
2014-09-11Avoid segfault if no previous search has been performedMarc André Tanner
2014-09-10If text has been created from an empty file, store filename upon first saveMarc André Tanner
2014-09-10Add comments where appropriateMarc André Tanner
2014-09-09Fix a few memory leaksMarc André Tanner
2014-09-08Hook up search as a movementMarc André Tanner
2014-09-08Unify variable namingMarc André Tanner
Only textual substitution no functional changes.