aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-07-06Make selection contiguous over whitespace symbolsMarc André Tanner1-2/+3
2015-07-06Warn when saving a file which has been changed outside the editorMarc André Tanner5-2/+24
2015-07-06text: remove text_load_fd and text_fd_getMarc André Tanner5-64/+33
2015-07-06Move filename from Text to FileMarc André Tanner8-65/+58
Also apply syntax rules every time the file name changes.
2015-07-06text: overhaul file load implementationMarc André Tanner1-3/+34
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é Tanner2-39/+207
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-05make: only call uname once in config.mkMarc André Tanner1-6/+8
2015-07-05text: store buffer allocation type (mmap or malloc)Marc André Tanner1-16/+33
2015-07-03Add movements to next/previous character within same lineMarc André Tanner3-0/+25
These movements always keep the cursor on the same line and do not move over newlines.
2015-07-03Do not take a snapshot in text_range_writeSilvan Jegen1-2/+0
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é Tanner2-19/+0
Instead use the text-dump git branch if necessary.
2015-07-03Fix handling of multibyte characters (at start of display area)David B. Lamkins1-1/+3
Previously a sequence of Unicode REPLACEMENT CHARACTER was displayed. Use an explicitly initialized mbstate_t object in the call to mbrtowc(). While this should not strictly be necessary, it works around a bug in certain implementations. Closes #56.
2015-07-03Add :show command to display special symbols for whitespacesMarc André Tanner6-17/+149
Enable/disable by setting to 0/1 respectively: :set show spaces=0 tabs=0 newlines=1
2015-06-30Fix segfault in cmd_filterMarc André Tanner1-3/+3
Using FD_ISSET on negative file descriptors results in breakage. Closes #55.
2015-06-30Perform character prev/next movements based on Text not ViewMarc André Tanner3-44/+2
While it is slower, it allows to move to characters which are currently not visible. This will be handy when experimenting with multiple cursors.
2015-06-30Cleanup insert/replace mode input handlingMarc André Tanner6-120/+69
View should only display the file content, but not modify it.
2015-06-28Do not take address of variables which go out of scopeMarc André Tanner1-4/+4
This is a bit of a hack, since now the callers range is modified. The various cmd_* functions should probably take a const Filerange pointer as argument and modify a local Filerange variable if needed.
2015-06-28Mark intentional case statement fall throughMarc André Tanner1-3/+3
2015-06-28Fix copy/paste error in text_restoreMarc André Tanner1-1/+1
This really needs some unit tests.
2015-06-28Replace a->time with a->seq in history_traverse_toRyan Chipman1-3/+3
2015-06-28Add seq field to Action structRyan Chipman1-0/+8
2015-06-27Add more thorough description of history to READMERyan Chipman1-11/+16
2015-06-27Make :earlier and :later accept arguments similar to vimMarc André Tanner4-31/+90
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é Tanner1-4/+4
2015-06-27Edit README to reflect new history implementationRyan Chipman1-6/+10
2015-06-27Hook up :-commands & keybindings for earlier/laterRyan Chipman2-0/+45
2015-06-27Core undo tree changesRyan Chipman2-50/+132
2015-06-24fixed some typos in commentsRyan Chipman1-2/+2
2015-06-04Use $(MAKE) instead of directly calling `make`Michael Reed1-1/+1
This fixes `make debug` on OpenBSD (and possibly other systems) where /usr/bin/make isn't GNU make.
2015-05-17Implement :substitute by invoking sed as a filterMarc André Tanner1-2/+5
2015-05-17Implement :r and :r! in terms of filter commandsMarc André Tanner2-26/+21
2015-05-17Filter command :!Marc André Tanner3-0/+219
If no range is given then stdin is passed through which allows interactive usage as in :!ls -1 *.c | slmenu For this to work the command needs to use stderr for its user interface and write any data for vis to stdout.
2015-05-16Release macro dataMarc André Tanner2-1/+5
2015-05-16Cleanup general purpose buffer APIMarc André Tanner6-21/+30
Introduce buffer_init to initialize a stack allocated buffer. Rename buffer_{alloc,free} functions because they do something different than the usual convention. They operate on the underlying buffer data but do not allocate/free an actual Buffer struct.
2015-05-16Let each :-command decide what to do if no range is specifiedMarc André Tanner1-1/+2
2015-05-16Improve parsing of :-command name and parametersSilvan Jegen1-8/+16
2015-05-14In command mode make the '.' range specifier match the current lineMarc André Tanner1-1/+5
2015-05-07Add '--' as end of optionsMatias Linares2-1/+8
Now it works properly, `vis -- -v` edit a file named `-v`. Also added the proper info to the man page.
2015-05-06Use the command name without the Filerange in argvSilvan Jegen1-1/+1
Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
2015-04-29Move redrawing out of operator implementationsMarc André Tanner1-13/+15
Note that currently all windows are redrawn, this could be further optimized to only redraw the affected windows.
2015-04-29Make operators return new cursor positionMarc André Tanner2-37/+42
2015-04-23Update header include guard to match file nameMarc André Tanner1-2/+2
2015-04-22Cleanup line ending type detection and insertionMarc André Tanner3-11/+33
2015-04-22Fix echo foo | vis -Marc André Tanner1-6/+8
A single '-' indicates read from stdin. Also adjust coding style.
2015-04-22for editor command compare string, not just first characterChristian Hesse1-1/+1
Signed-off-by: Christian Hesse <mail@eworm.de>
2015-04-22make vis print version with command option -vChristian Hesse1-3/+6
The man page states this is possible, so add the code. Signed-off-by: Christian Hesse <mail@eworm.de>
2015-04-22get version from gitChristian Hesse1-1/+8
Signed-off-by: Christian Hesse <mail@eworm.de>
2015-04-22Rename window.[ch] to view.[ch]Marc André Tanner6-7/+7
2015-04-22Yet more renames (EditorWin -> Win)Marc André Tanner3-52/+52
2015-04-22More renames, no functional changesMarc André Tanner8-530/+530
Win -> View, window_* -> view_*