| Age | Commit message (Collapse) | Author | Files | Lines |
|
This should fix "corruptions" caused by wrong offsets when
editing the same file in multiple windows.
|
|
The problem is that a cursor movement might cause a redraw which
in turn causes the sidebar width to change thus the view to be
resized which will override the cursor position.
|
|
|
|
This cleans up the existing selection handling code and adds the
necessary bits to eventually support multiple cursors/selections.
The cursor position is kept track of using marks, which means
retrieving the cursor position is no longer a constant time operation.
Furthermore the terminal cursor is no longer used, instead the whole
window is redrawn after every cursor movement.
|
|
|
|
|
|
|
|
|
|
Takes a range and extends both ends to cover the remaining part
of the line.
|
|
|
|
By now ui-curses.[hc] are the only files dealing directly with
curses related functions. Integration of a proper mainloop is
still pending.
|
|
Recognized formats are:
CTRL-V nnn decimal value nnn
CTRL-V onnn or CTRL-V Onnn octal value nnn
CTRL-V xnn or CTRL-V Xnn hex value nn
CTRL-V unnnn Unicode codepoint nnnn
CTRL-V Unnnnnnnn Unicode codepoint nnnnnnnn
Leading zeros can be omitted, any illegal character for the given
format will be ignored and terminates the numerical code.
|
|
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
|
|
Eventually this should probably be rewritten to use an iternal
regex engine, currently it has unacceptable memory usage, it
copies the whole text.
|
|
|
|
Closes #60
|
|
For this to work make sure you have vis-open and slmenu or dmenu
somewhere in $PATH.
For now the file dialog is shown for :open, :split and :vsplit
when the argument is either . (a dot) or looks like a file pattern.
For example
:open *.[ch]
will show a listing of all C source and header files in the current
directory. Use a fuzzy search to make your choice.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dd on the last line now moves the cursor to the start of the
preceding line.
|
|
|
|
This allows to feed keyboard input from a file as in:
cat keyboard-input | vis input-file
which will be used for testing purposes.
|
|
Set umask before calling mkstemp. According to POSIX 2008 this is
not necessary since the temporary file is guaranteed to be created
with permission restricted to the current user. However this is
more secure on non-conforming systems and safe as long as we do not
use multiple threads.
Fixes Coverity CID 101333.
|
|
This should not be a problem in practice, since cell->data is large
enough anyway.
|
|
|
|
|
|
|
|
|
|
|
|
Also apply syntax rules every time the file name changes.
|
|
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.
|
|
|