| Age | Commit message (Collapse) | Author | Files | Lines |
|
Currently the key handling functions do not know through which mapping
they were invoked. As an example the `count` handler exploits the
implementation detail that the input queue is stored in contiguous
memory, meaning `keys[-1]` gives access to the digit being pressed.
This adds infrastructure to keep track of the two most recently processed
keys of the input queue.
The information is guaranteed to be accurate for the initial invocation
of the key handler but will be overwritten in case new keys are pushed
to the input queue (e.g. through vis_keys_feed).
|
|
|
|
Fix #372
|
|
The vis_keys_feed function is currently unaffected by this change.
It still creates individual undo points. While this is probably
undesirable from an API point of view, it keeps the lua based tests
that use undo points working.
|
|
|
|
|
|
|
|
|
|
For some reason we ended up with two identical functions: buffer_{clear,terminate}.
|
|
|
|
The handling of :unmap needs to be revisited at some point.
|
|
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`.
|
|
Properly detect unbalanced curly braces and spurious output at the
end of a group.
|
|
Move all signal handling code out of "library" code into user application.
|
|
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.
|
|
Indicating that the event is triggered *after* a successfull write.
|
|
We need to push keys individually to the input queue such that
the state machine can advance and record keys into the operator
macro if necessary.
Previously feeding the following input:
isome text<Escape>.
would not work as expected because the complete key stream
was pushed to the input queue at the same time during which
the operator macro was not yet active. Thus the dot command
at the end would have nothing to repeat.
|
|
Do not initalize curses UI before it is actually needed.
Move vis command line argument parsing logic into main.c.
This fixes `vis -v` output and exit status.
Fix #351
|
|
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.
|
|
We first try $SHELL and then fall back to the shell field of the password
file entry (/etc/passwd).
|
|
They both perform a motion before changing mode.
|
|
The language map translation should not take modifiers into account.
For example if `a` is mapped to `b` then `<M-a>` should also be mapped
to `<M-b>`.
Fix #404
|
|
The character following the `r` command in normal mode should be
treated as regular input given in insert/replace mode, that is no
tranformation should be applied. Temporarily disable the language
map for this reason.
Close #382
|
|
Do not override implicit operator macro in command mode.
Fix #334
|
|
Let vis_keys_feed always have an immediate effect. Previously,
if called from a key input handler the keys would just be added
to the input queue and processed once the current key handler
returned.
This also affects the exposed Lua API.
|
|
This is a not yet successful attempt to reduce terminal flickering
when resizing windows as is for example the case when entering
command mode.
UI related debug output can be enabled with:
$ make CFLAGS=-DDEBUG_UI=1
$ ./vis > log
|
|
Try to display a shorthand version in the status bar, this currently
only works for files below the current working directory of the editor
process.
|
|
Displaying an error might create a new window which in turn can
trigger new events (all other windows are resized+redrawn) which
might again cause errors.
There is still no sane way to exit the editor in this case, but
at least the error messages should be readable.
|
|
|
|
|
|
This caused issues on OpenBSD where it crashed the terminal.
Also on Mac OS X suspend via ^Z (Ctrl-Z) was missing a \r i.e.
the shell prompt was not properly redrawn.
While in principle user interfaces should not have to depend on
libtermkey, in practice this won't be an issue unless we are
adding a non-terminal based UI (which won't happen anytime soon).
This reverts commit 8f92b98848f9366e78c7aa824615bade83971513.
Close #311
|
|
A concrete user interface implementation should not have to depend
on libtermkey. Therefore the vis core now uses an independent instance
to parse keys.
|
|
They behave like an inclusive motion, but only if they are also
linewise (which they are by default).
This should make `yjp` and `ykp` yank both the current and
the next/previous line when the cursor is at the start of
a line.
See also 532f52e9e52b98dc5749396f7353295418e0227a and #237
|
|
|
|
|
|
This means no event handlers are run for it, hence there is no chance
for recursive errors.
|
|
|
|
|
|
|
|
Also support upper case register to append to an existing macro.
|
|
|
|
A motion function can be registered with vis_motion_register(...)
the returned id (if non negative) can then be used as an argument
to vis_motion(...)
|
|
Except for insert/replace mode keys get translated before any
key bindings are evaluated.
This is useful for non-english/latin keyboard layouts.
|
|
Since commit 197ab824206335eab7ceed774ddeccac18fafc09 visual line
and replace modes are child modes, hence we also have to consider
the window local key bindings of their respective parent modes.
For example in replace mode the key lookup chain is now as follows:
window local replace mode -> global replace mode ->
window local insert mode -> global insert mode
This fixes <Enter> behaviour in prompt for replace and visual line
modes.
|
|
This allows them to be placed into the read only ELF section.
|
|
Up until now text objects would only ever grow/expand if
applied multiple times. The new SPLIT type allows text
objects which cover a completely different range when
applied with a count.
|
|
|
|
Display Lua errors in a dedicated window/file. A typo or missing
dependency (e.g. lpeg) in visrc.lua will no longer silently fail
without any indication.
The Lua integration in view.h is not yet converted.
|
|
|