| Age | Commit message (Collapse) | Author |
|
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.
|
|
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.
|
|
|
|
|
|
These movements always keep the cursor on the same line and do
not move over newlines.
|
|
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.
|
|
Instead use the text-dump git branch if necessary.
|
|
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.
|
|
Enable/disable by setting to 0/1 respectively:
:set show spaces=0 tabs=0 newlines=1
|
|
Using FD_ISSET on negative file descriptors results in breakage.
Closes #55.
|
|
While it is slower, it allows to move to characters which are
currently not visible. This will be handy when experimenting
with multiple cursors.
|
|
View should only display the file content, but not modify it.
|
|
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.
|
|
|
|
This really needs some unit tests.
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
This fixes `make debug` on OpenBSD (and possibly other systems) where
/usr/bin/make isn't GNU make.
|
|
|
|
|
|
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.
|
|
|
|
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.
|
|
|
|
|
|
|
|
Now it works properly, `vis -- -v` edit a file named `-v`. Also added the
proper info to the man page.
|
|
Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
|
|
Note that currently all windows are redrawn, this could be
further optimized to only redraw the affected windows.
|
|
|
|
|
|
|
|
A single '-' indicates read from stdin.
Also adjust coding style.
|
|
Signed-off-by: Christian Hesse <mail@eworm.de>
|
|
The man page states this is possible, so add the code.
Signed-off-by: Christian Hesse <mail@eworm.de>
|
|
Signed-off-by: Christian Hesse <mail@eworm.de>
|
|
|
|
|
|
Win -> View, window_* -> view_*
|
|
|
|
Therefore vis->win->text->data becomes vis->win->file->text.
|
|
|
|
This fixes a segmentation fault when opening a directory.
Also, opening a file you are not permitted to read, will now give an
error, instead of showing the file as empty.
Based on a patch by Willem van de Krol.
|