summaryrefslogtreecommitdiff
path: root/vis-cmds.c
AgeCommit message (Collapse)Author
2025-01-11buffer: delete pointless buffer_init functionRandy Palamar
lets not make the code harder to read for no reason
2025-01-04remove duplicated read_buffer functionsRandy Palamar
When you take a pointer to a function in C that function is going to appear in full in the final binary. This means that there were 3 sections of the final binary with the exact same code. You could argue that in very high performance programs having that function closer to the current instruction when it is needed will give a performance boost but there are so many other places to gain more significant speed ups in vis before that would be remotely relevant. In fact, removing these allows the buffer_append call to inlined so that buffer_insert can be hopped to directly instead of including a useless hop in the middle.
2024-05-24combine Win and UiWinRandy Palamar
These are not seperate things and keeping them this way makes gives this convoluted mess where both Wins and UiWins must have linked lists to the other Wins and UiWins in the program despite the fact that neither of them can exist in isolation. This, like my previous cleanup commits, is part of a larger goal of properly isolating the various subsystems in vis. Doing so is required if we ever want to be able to have a vis-server and a vis-client.
2024-05-21remove some view pointer chasingRandy Palamar
Same as previous commit each window only has a single View. No need for it to be stored elsewhere in memory.
2024-05-21remove some ui pointer chasingRandy Palamar
There only exists a single Ui so there is no need to force a pointer redirection for accessing it. The Ui member was moved down in vis-core.h to punt around an issue with the way lua checks for existing objects. It may show up again as I flatten more structs.
2024-05-21replace UiTerm with Ui & delete function pointersRandy Palamar
2024-05-21replace UiTermWin with UiWin & remove function pointersRandy Palamar
2024-05-21make Selection unopaqueRandy Palamar
2024-05-21make View unopaqueRandy Palamar
2024-04-21vis-cmd: silence gcc warning & remove strlen callMatěj Cepl
2024-02-01allow disabling of statusbarsewn
2023-08-27Make expandtab option window-localAlexey Yerin
2023-08-27Make tabwidth option window-localAlexey Yerin
2023-08-26support old option names but mark as deprecatedRandy Palamar
This is in response to a comment left on a35e7ea. Backwards compatibility is a good idea for at least a release.
2023-08-24Lua API: access and set all available optionsRandy Palamar
The first point of this commit is to allow all options to be read from lua. This has a number of uses for plugin writers. They are grouped into a couple of tables depending on what they control: `vis.options`: table with global configuration `win.options`: table with window specific configuration The second point is to allow you to set all these options as if they were simply lua variables. Technically this is already possible by using `vis:command("set ...")` but personally I think this interface is cleaner. Note that this already possible for some things like the current mode (eg. vis.mode = vis.modes.VISUAL). Examples: `vis.options.ai = true` `win.options.brk = " !?."` `win.options = { showeof = true, showtabs = true } There are a number of related issues and pull requests: closes #803: Lua API: let plugins read the values of options closes #812: Window layout property supersedes/closes #717: Add ability to access tabwidth from Lua supersedes/closes #1066: expose UI layout and allow it to be set from lua API
2023-07-28view.c: add word wrappingAndrey Proskurin
this is contolled by the wrapcolumn/wc and breakat/brk options related #142: Word wrap and line breaks related #932: Vis for Prose? related #1092: Disabling line wrapping
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