| Age | Commit message (Collapse) | Author | Files | Lines |
|
Might fix #248
|
|
|
|
Except for special cases like gn and gN vis expected that a text object
would be a function mapping a position to a range as follows:
f: pos -> [start, end] with start <= f(pos) <= end
Clearly this condition does not hold for inner text objects when the
initial position i.e. the cursor is on the opening delimiter.
This also obsoletes the need for the SPLIT text object flag which should
be removed in a later commit if the current behavior is found to be
working as expected.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The textw{,n} functions should probably be changed to not
accomodate for leading and trailing spaces. They should also
be changed to properly calculate the display width of an UTF-8
encoded string. Currently they will just return the number of
codepoints which is obviously wrong.
|
|
|
|
|
|
|
|
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
|
|
Close #326
|
|
|
|
Despite how useful realpath is, apparently it's not POSIX and isn't
part of the BSD userland.
|
|
We still don't handle filenames that contain newlines, but we're
pressing against the limits of what portable POSIX shell can do. Besides
which, we're ultimately plumbing filenames into vis-menu which uses
newlines as a delimiter *anyway*, so there's not much we can do.
|
|
|
|
|
|
Rather than try to loop manually and build up a path, this new version
exec's itself for each new directory scanned. Functional changes
include:
- We `set -e` at the top of the script, so any surprising
permission-denied errors will automatically cause the script to exit
with a helpful error message.
- We now support the GNU "--" convention for splitting options from
filename arguments, just in case somebody happens across a directory
with a file named "-h" or "-p".
- If launched with a single filename parameter, we automatically return
it - if somebody writes ":e somepattern*" and it matches exactly one
file, we might as well open it directly.
- If we select a single filename parameter, we use `realpath` to build
an absolute path for it - much more reliable than trying to build up
a path while the user is navigating around.
- If launched with a single directory parameter, we change into that
directory and re-exec ourselves with ".." and all the files in that
directory as arguments. This means we don't have to handle selection
and recursion at the same time.
- Note that if we recurse into a directory, we pass the "-f" parameter
to suppress auto-selection - otherwise recursing into an empty
directory would immediately select the ".." entry and pop you back
out, which would be confusing.
- The new version doesn't bother trying to manipulate `$VIS_MENU_ARGS`
and sometimes add a prompt to it. Setting no prompt is the same as
setting the prompt to an empty string, so we can just use an empty
string as the default value.
One specific use-case that this change cleans up is giving ":e"
a pattern that matches multiple directories (for example, running
":e *e*" in the root of the vis repo). "ls -1" would list the contents
of each directory (without a prefix, so you couldn't select those files)
but would also print the directory names as headings followed by
a colon, so you couldn't usefully select the directory names either.
We get around this by only ever running "ls -1" without any arguments,
so it only scans the current directory.
|
|
Unlike the existing vis(1) manpage, this uses the `mdoc` macro set
because it's (very slightly) more modern, and OpenBSD only supports
`mdoc` while everybody else supports both.
|
|
I'm guessing at some point slmenu's author wanted to make the various
deletion commands move text to a kill-buffer, and then Insert and
Control-Y could yank from it back into the text field.
That clearly never happened, though, so this is dead code.
|
|
|
|
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.
|
|
|
|
|
|
This is based on the implementation of text_line_width_get
from text-motions.c. There might be an opportunity for code
sharing.
|
|
If loading fails because visrc.lua is not found, then simply
display an information message. However if there is a syntax
error, display a complete stack trace.
This fixes commit 352155889aad57f8cb6d20317ffef81073fb6533.
|
|
Output will be printed to stdout and can be enabled by:
$ make debug CFLAGS=-DDEBUG_LUA=1
$ ./vis > log
This commit also tries to make object creation slightly more robust.
|
|
|
|
Light object references are used to type check, but contrary
to full object references they are not stored in the Lua
registry.
This means that they are not bound to the object lifetime of
their corresponding C object. Hence such objects must not
be used after they have been free(3)-ed by the editor core.
Such lightweight object references are always re-created,
thus custom properties will not be stored across subsequent
accesses.
For now light object references are only used for cursor objects.
This should ix the crashes introduced by the recent changes
which make heavy use of the Lua API.
|
|
This is encouraged by the ISO C99 standard.
|
|
|
|
|
|
available
|
|
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.
|
|
Make window status bar content configurable via Lua.
|
|
|
|
|
|
|
|
|
|
|
|
It is a string in `git describe` format, as reporte by `vis -v`.
|
|
|
|
|
|
|
|
|
|
|