summaryrefslogtreecommitdiff
path: root/vis-cmds.c
AgeCommit message (Collapse)Author
2023-07-18Add fullscreen param to vis_pipe_collect() and Lua API vis:pipe()Jörg Bakker
This enables restoring the terminal from a fullscreen command like curses based program. Use cases are e.g. a file picker based on some external program like nnn (https://github.com/jarun/nnn).
2023-07-18fix warning about field width not being an intRandy Palamar
this slipped through in commit 6be370d
2023-07-17Print keybindings containing space correctlyMax Schillinger
Fixes #1060 - :help doesn't display mappings starting with <Space> correctly Co-authored-by: Randy Palamar <palamar@ualberta.ca>
2023-02-12Do tilde expansion only for the tilde character at the beginning of the pattern.Matěj Cepl
2020-11-13vis: use localtime_r(3) instead of localtime(3)Marc André Tanner
This makes it thread safe. While it is unlikely that we use threads in the near future, it is sensible to avoid unnecessary global state.
2020-09-19Add ignorecase optionEvan Gates
Add a global ignorecase boolean option. When set add REG_ICASE to cflags when calling text_regex_compile().
2020-02-10vis: omit error message when vis-menu(1) is cancelledMarc André Tanner
2020-01-28vis: support an optional exit status in :q and :qall commandsMarc André Tanner
This can for example be used to abort git commit messages with :q! 1.
2019-05-23Add layout optionKarl Schultheisz
This introduces a new `set` option for setting the layout to vertical or horizontal, which previously could not be done without creating a new window (via `split` or `vsplit`). Now, `set layout|lay h|v` will control this without creating a new window.
2018-05-30vis: add loadmethod optionMarc André Tanner
Valid values are `read`, `mmap` or `auto`.
2017-06-27Merge branch 'show-eof' of https://github.com/p-e-w/visMarc André Tanner
Conflicts: view.c view.h
2017-06-15vis: rename uses of Cursor to SelectionMarc André Tanner
2017-06-04Add option to hide EOF markerPhilipp Emanuel Weidmann
2017-05-06vis: add doxygen commentsMarc André Tanner
Rename some structures, add typedefs for function pointers, remove unused arguments from vis_run.
2017-05-03text: remove count argument from text_{earlier,later}Marc André Tanner
2017-03-21vis: reject invalid option namesMarc André Tanner
This should fix the ressource leak as found by CID 142510.
2017-03-19Move :set horizon option implementaiton to luaMarc André Tanner
2017-03-19Move :set theme option implementation to luaMarc André Tanner
2017-03-19Move :set syntax option implementation to luaMarc André Tanner
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.
2017-03-19vis: add infrastructure to dynamically add :set optionsMarc André Tanner
2017-03-14Add experimental raw vt100 UI backendMarc André Tanner
The intention of this is not to slowly reimplement curses but to provide a minimal working terminal UI backend which can also be used for debugging, fuzzing and in environments where curses is not available. Currently no attempt is made to optimize terminal output. The amount of flickering will depend on the smartness of your terminal emulator.
2017-03-02vis: remove :bdelete commandMarc André Tanner
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.
2017-02-27vis: allow useage of file dialog for :read commandMarc André Tanner
Fix #505
2017-02-24vis: make help texts optional to produce a smaller binaryMarc André Tanner
$ ./configure --disable-help shrinks the binary by about 20K on a x86_64 system.
2017-02-23vis: unify error path of command registration functionsMarc André Tanner
2017-02-08vis: fix cursor positioning after :helpMarc André Tanner
2017-02-05vis: add file argument to vis_pipeMarc André Tanner
2017-02-02vis: support rudimentary help search using :help patternMarc André Tanner
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.
2017-01-31vis: add workaround for broken color handling in Terminal.appMarc André Tanner
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.
2017-01-19text-regex: add regex backend based on libtreMarc André Tanner
While memory consumption should be improved, backward searches will still be slow, because they are implemented in terms of repeated forward searches. It needs to be investigated whether the underlying automaton can have its transitions reversed and essentially run backwards, as is the case in sam.
2017-01-15vis: show error messages for failed :map/:unmap commandsMarc André Tanner
Close #458
2017-01-10vis: add register description to :help outputMarc André Tanner
2017-01-10vis: add valid marks to :help outputMarc André Tanner
2017-01-10vis: add process id to :help outputMarc André Tanner
2017-01-06vis: simplify mode lookup for :map and :unmapMarc André Tanner
2016-12-31vis: allow user registered :-commands to specify a help textMarc André Tanner
2016-12-31vis: typedef function type not pointer to functionMarc André Tanner
2016-12-28vis: do not free right hand side of mapping twiceMarc André Tanner
Fix #447
2016-12-27vis: properly free dynamic key bindingsMarc André Tanner
The handling of :unmap needs to be revisited at some point.
2016-12-17vis: allow boolean :set options to be toggledMarc André Tanner
Boolean options can be toggled by appending `!` to the option name. Close #435
2016-12-16vis: add section about compile time configuration to :help outputMarc André Tanner
2016-12-15vis: more informative error message for :set optionJosh Wainwright
Close #433
2016-12-14vis: add new :set savemethod auto|atomic|inplace optionMarc André Tanner
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`.
2016-12-03vis: improve :set option number parsingMarc André Tanner
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
2016-11-30vis: avoid inconsistent state after file reloading with :eMarc André Tanner
When a file is opened in multiple windows we could end up in an inconsistent state by doing: $ vis some-file :spl :e At this point the two windows were referencing different file objects thus changes in one would not affect the other although they have the same path. Another option would be to reload all windows currently displaying the file being reloaded. We opt for the simpler fix for now.
2016-11-25vis: fix I/O redirection bugs, cleanup vis_pipeMarc André Tanner
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.
2016-11-22vis: add `:set escdelay nn` optionMarc André Tanner
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.
2016-11-22vis: populate :set option map at startupMarc André Tanner
2016-11-15vis: generalize special stdin handlingMarc André Tanner
In preparation to move argument parsing code out of vis.c.
2016-11-11vis: cleanup `:set option` argument parsing logicMarc André Tanner
No longer accept "no" prefix for boolean options. Reject too many option values (use proper quoting to specify values containing spaces).