| Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
This sould fix a clang analyzer warning and make the code more robust.
The problem could actually not occur in practice because the X and Y
commands always have the internal cmd_select as intermediate node in
the execution tree.
In general the multiple file support will need more design work.
Fix #551
|
|
As currently implemented this will only work for operations which are
individually fast, but repeated many times (e.g. `1000000itext<Escape>`).
|
|
|
|
|
|
|
|
|
|
|
|
The current implementation will also reject consecutive hyphens.
|
|
|
|
https://mentors.debian.net/package/vis
|
|
|
|
|
|
It is no longer possible to change the used syntax by assigning to the
`win.syntax = name` field, instead the function win:set_syntax(name)`
should be called.
The distinction between filetype and syntax lexer to use should probably
be clarified/cleaned up at some point.
|
|
|
|
It does not really fit into the style of the rest of
the command language. Eventually we should be able
to express this kind of thing using a looping construct
based on the `X` and `Y` commands.
|
|
Fix #505
|
|
$ ./configure --disable-help
shrinks the binary by about 20K on a x86_64 system.
|
|
Take a snapshot before and after processing the transcript.
|
|
|
|
Strictly speaking this is a compiler bug:
https://llvm.org/bugs/show_bug.cgi?id=22062
The C11 standard section 6.4.4.3 says:
"An identifier declared as an enumeration constant has type int."
and 6.7.2.2:
"Each enumerated type shall be compatible with char, a signed
integer type, or an unsigned integer type. The choice of type is
implementation-defined, but shall be capable of representing
the values of all the members of the enumeration."
So while `err` can store a value larger than that of any enumeration
member, it could also be of signed type, resulting in a warning about
comparing integers of different signs.
Converting it to size_t before the range check and array indexing,
should fix both warnings.
Fix #478
|
|
In an ideal world this should never happen. However,
if for some reason all cursors/selections become
invalid, default to an empty range. This at least
allows to terminate the editor gracefully whereas
before the command would silently be ignored.
|
|
|
|
The argument needs to be a valid regular expression. It currently
clobbers the last used search term and hence allows repeated searches
using `n` and `N` respectively.
|
|
|
|
|
|
This esentially performs an insertion sort. Rather than iterating the list
from the start every time keep track of the latest change and optmize for
monotonically increasing file positions.
|
|
Terminal.app sets $TERM=xterm-256color and ships a corresponding
terminfo description advocating that it is capable of color changes
to the 256 color palette when in fact it can not.
We introduce a new boolean option "change-256colors" which is
true by default but can be used to disable color changes. It is
automatically set if Terminal.app is detected using $TERM_PROGRAM.
This should fix display artifacts as described in #456.
|
|
This should fix segfaults for commands like `:{ q i/foo/ }` or
`:x/pattern/ q` where a command invalidates the current window.
The checks are a bit too strict, for example a destructive command at the
end of a non-nested group would be fine, but is currently also rejected.
|
|
The manual was already mentioning that.
Fix #468
|
|
When encountering a parsing error within a { } command group do not
set the error cause to unmatched brace.
|
|
They are roughly equivalent, instead of
s/pattern/replacement/
to replace the first occurrence of pattern you can specify an address
to the change command:
/pattern/ c/replacement/
the only difference being that the first command is restricted to the
current line.
-+x/pattern/ c/replacement/
also restrictes matches to the current line, but performs the substitution
on the whole line not only the first match. Currently it is not possible
to only replace the n-th match as `s2/pattern/replacement/` would do
in sam(1).
A possible alternative syntax generalizing this concepts and applying
it to the `x` and `g` commands will be investigated in the future.
Global substitution as in
%s/pattern/replacement/g
can be performed using
x/pattern/ c/replacement/
|
|
Before the i, a, c commands would fail when given an empty text //.
|
|
& refers to the most recent complete match and \1 - \9
refer to the last sub-expression matches.
|
|
These are currently only updated for `x` and `y` sam commands,
whether they should be updated for other search related activities
(`/`, `?`, `n`, `N`, `*`, `#` etc.) needs to be investigated.
|
|
This is akin to sam where dot is set to the result of a command.
|
|
|
|
|
|
|
|
|
|
The same Command struct might be used for multiple command executions.
An example is `:X wq` which is roughly equivalent to `:wqa` in vim.
|
|
These are never used because there is always an implicit select command
prepended.
|
|
This is not really used, but commands can expect to have argv[0] set
to something. Also "s" is ambigious with the substitute command.
|
|
Specifies how the current file should be saved, `atomic` which uses
rename(2) to atomically replace the file, `inplace` which truncates the
file and then rewrites it or `auto` which tries the former before falling
back to the latter. The rename method fails for symlinks, hardlinks,
in case of insufficient directory permissions or when either the file
owner, group, POSIX ACL or SELinux labels can not be restored.
The option defaults to `auto`.
|
|
There are cases where it is useful to specify how the file should be saved.
|
|
Only accept numbers in range [0, INT_MAX]. Reject trailing garbage,
where before something like `:set cc 50NaN` worked it will now cause
an error.
Close #418
|
|
|
|
Properly detect unbalanced curly braces and spurious output at the
end of a group.
|
|
The `:!` command did redirect stdout to a pipe which was used by
`vis-menu` to return the selected entry. However, this breaks
other interactive commands such as `:!/bin/sh` where command
output was never displayed. Instead we modified `vis-menu` to
re-open /dev/tty for its user interface which makes it work
as a regular filter `:|`
This patch also obsoletes the interactive flag previously passed
to the vis_pipe function. Interactive mode is instead enabled
by piping an invalid range.
|
|
Make the delay used to distinguish between an <Escape> key and
other terminal escape sequences such as for the Meta key run
time configurable. The value is given in miliseconds and defaults
to 50ms.
Notice that terminal multiplexers like dvtm or tmux might also
induce some delay which has to be configured independently.
|