| Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
|
|
The path argument will be nil.
|
|
The first argument is the file object while the second argument denotes
the full path to which it will be written. Path might be `nil` if the
file is going to be written to stdout.
The Lua function is expected to return a boolean value indicating whether
the write operation should proceed or be aborted.
|
|
The passed path can be different from file.name for instance when
opening a file `a` and then doing `:w b` where file.name will be the
former and path the latter.
|
|
Indicating that the event is triggered *after* a successfull write.
|
|
Except for special commands like `w` and `wq` treat the cursor
as an implicit one character selection to which the command is
applied.
|
|
|
|
If the shell command is omitted, the last shell command (of any type)
is substituted. The most recently used shell command is stored in a
new register currently named `!`.
|
|
As in sam if an empty regex // is provided we substitute in the most
recently used one.
0/regexp///
Will match the second occurrence in the fie.
|
|
As in visual mode write commands have to be forced with ! if the changes
are destructive i.e. only parts of the file are written.
|
|
|
|
No functional changes.
|
|
Add another layer of indirection, move actual event generation
code to a dedicated function.
|
|
In preparation to move argument parsing code out of vis.c.
|
|
|
|
:0 < echo "Should be inserted at the start of the file"
:1 < echo "Should replace the first line"
|
|
It was the only command option which needed `=` to assign a value to.
This unifies the argument parsing logic and adds the possibility to
specify a per-option help text.
You might want to adapt your visrc.lua configuration accordingly.
|
|
|
|
We need to distinguish between an explicit given zero and an
omitted value which should default to 1.
This should fix the following constructs which rounds up/down
an existing selection to whole lines -0,+0 and -0+,+0-
|
|
Something like :{ x/pattern/ } should not leave the original
cursor around.
|
|
The following
x/example/ y/e/ i/-/
should produce `-e-xample-` where before it would wrongly
result in `-e-xample`.
|
|
Previously something like
:x/pattern
:c/replacement
would cause all cursors to disappear because the location
they were placed on was deleted beneath them.
|
|
Something like :{ x/pattern/ } should select all occurrences of pattern.
|
|
|
|
Any white space should terminate the command name.
In particular multi-line commands as part of a group
were not handled correctly.
|
|
\\ should not be treated specially when parsing regular expressions.
|