| Age | Commit message (Collapse) | Author | Files | Lines |
|
When the shell cannot find any matching files, the glob is not expanded,
and vis-open will return the absolute path of the current working
directory (because dirname outputs '.'), followed by the filename,
followed by a literal '*'. This commit checks that the final path
actually exists, and if not, exits with status 1.
It also uses text_object_longword for the range to match, so that
absolute paths are accepted, and replaced properly (else it only works
back to the first '/').
|
|
|
|
This for example skips the command prompt window.
|
|
Some marks (only '^ right now) are window specific while others
have file file scope. This distinction is currently hidden in
the API. Before this commit file.marks[...] would always operate
on the currently active window.
|
|
This should also fix coverity issue 157024.
|
|
|
|
Also expose all register slots through the Lua API.
|
|
|
|
We now use ' to refer to marks. Mark a is set using 'am and restored
using 'aM while this is slightly harder to type than ma and 'a it is
consistent with register usage for yank/put and allows a default
mark to be used which is handy for quick selection manipulation
primitives.
|
|
The key binding remain the same, but the selections are now stored on
a per-buffer basis.
|
|
Conflicts:
view.c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Also fix compilation with ./configure --disable-help.
|
|
|
|
Close #563
|
|
This is no longer needed because we always insert \n never \r\n.
|
|
Now that register.h is no longer used by view.h we can move the struct
and function declarations to vis-core.h.
|
|
Use something like dos2unix(1) and unix2dos(1), if you
need to edit such files.
|
|
|
|
Currently the only "internal window" with a status bar is the information
window used to display Lua stack traces. We do not want to trigger events
for it, because that could result in further Lua errors. Nonetheless its
status bar should be properly redrawn to avoid display artifacts. That is
why we fall back to the built-in default status bar as used by non-Lua
builds.
|
|
The intention here is to catch any errors in unprotected mode,
close the lua state and jump back to the mainloop to give the
user the opportunity to take care of unsaved changes.
We abuse the infrastructure Lua provides for custom memory
allocators to associate our vis instance pointer with the lua
state. In the panic handler we can then use lua_getallocf to
get our context back. The actual memory allocater is equivalent
to the one used by default and just forwards everything to the
libc.
|
|
|
|
While the invoked Lua functions are executed in protected mode,
the validation of the return values currently happens in unprotected
mode. Thus an invaid return value triggers a lua error and because
we currently do not have a global panic handler registered this will
terminate the editor process.
This commit changes the return value validation to silently fall
back to default values instead of raising errors. If we want to provide
user friendly stack traces showing the origin of the offending value
we would have to move the validation into the Lua code.
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
This is only the case during editor startup before the first window is created.
|
|
|
|
|
|
Use pull instead of push based model for display code. Previously view.c
was calling into the ui frontend code, with the new scheme this switches
around: the necessary data is fetched by the ui as necessary.
The UI independent display code is moved out of view.c/ui-curses.c into
vis.c. The cell styles are now directly embedded into the Cell struct.
New UI styles are introduced for:
- status bar (focused / non-focused)
- info message
- window separator
- EOF symbol
You will have to update your color themes.
The terminal output code is further abstracted into a generic ui-terminal.c
part which keeps track of the whole in-memory cell matrix and #includes
ui-terminal-curses.c for the actual terminal output. This architecture
currently assumes that there are no overlapping windows. It will also
allow non-curses based terminal user interfaces.
|
|
The same functionality is available using vis:command and :open.
If we decide a distinct API is useful, we should probably also
provide a corresponding close method.
|
|
|
|
|
|
|
|
|
|
It remains to be seen whether that is a good idea, but at least
it will reveal possible bugs.
|
|
|
|
Returning true from the event handler, indicating that the
keys were consumed, should now prevent insertion as mentioned
in the documentation.
vis.events.subscribe(vis.events.INPUT, function(key)
if key == ' ' then
-- do something fancy here
return true
end
end)
|