summaryrefslogtreecommitdiff
path: root/main.c
AgeCommit message (Collapse)Author
2017-03-22vis: fix wrap around with <C-n>Marc André Tanner
Do not create an invalid cursor when no further match exists.
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-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-14Restructure display codeMarc André Tanner
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.
2017-03-05vis: remove word and file name completion from editor coreMarc André Tanner
2017-03-04vis: process command line options when reading from stdinMarc André Tanner
Previously the following had no effect: $ echo foo | vis +"set syntax markdown" - Fix #512
2017-02-25vis: add vis- prefix to pseudo editor keysMarc André Tanner
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: remove `gf` and `<C-w>gf` functionalityMarc André Tanner
This can also be implemented using Lua, if desired.
2017-02-23vis: remove number increment/decrement functionalityMarc André Tanner
By now we should have the necessary Lua API to implement this as an extension.
2017-02-22vis: simplify `r` implementation and fix cursor positioningMarc André Tanner
2017-02-15vis: use single function call to print version informationMarc André Tanner
This results in a slightly smaller binary while still avoiding #ifdefs. Close #494
2017-02-15vis: remove motion and text objects related to C functionsMarc André Tanner
These do not really belong into the editor core. If desired they could be implemented in Lua instead.
2017-02-15text-motions: remove unused text_line_lastcharMarc André Tanner
2017-02-14vis: add compile time features to version outputMarc André Tanner
2017-02-10vis: make r handle special keys like <Tab>Marc André Tanner
Unlike vim we do not respect `:set expandtab` here.
2017-02-10vis: make t, T, f and F work for special keysMarc André Tanner
Fix #491
2017-02-08vis: make `ga` and `g8` more robustMarc André Tanner
Fixes CID 141179
2017-02-06Disable keymap for movement_key characterMichael Forney
The character following a movement_key command should not be subject to keymap translation since it is used to find characters in the document.
2017-02-04view: do not let new cursors automatically become primaryMarc André Tanner
We currently have the invariant that the primary cursor is always placed within the visisble viewport. Previously view_cursors_new would automatically make the new cursor primary. This in turn causes the viewport to be adjusted triggering lots of unnecessary redraws. As a result commands creating many new selections might become unbearably slow. Instead the caller has to explicitly make the new cursor primary.
2017-02-02Slight code cleanups, use buffer API where appropriateMarc André Tanner
2017-02-01vis: fix repetition of O when given a countMarc André Tanner
The cursor needs to be adjusted after every insertion, not just the first one. The implementation is currently rather ugly because it clobbers the dot register with pseudo keys.
2017-01-28vis: deindent blank autoindented lines when leaving insert modeMarc André Tanner
Does not work for the current implementation of `O` because the "lookbehind" i.e. second to last processed key is `<Up>` and not `<Enter>`. Fix #383
2017-01-27vis: do not set count when handling 0 motionMarc André Tanner
A count of zero is different than specifying no count. This fixes `0G` which previously moved to the start of the file. Fix #474
2017-01-19vis: make <C-n> in visual mode wrap aroundMarc André Tanner
Strictly speaking we actually not wrap around, but search backwards starting from the first cursor. This is seems more useful when for example renaming a local variable but not starting from its declaration. Close #305
2017-01-19vis: remove <C-o> mapping in insert modeMarc André Tanner
This was never really implemented properly and is not really needed anyway. Close #345
2017-01-18vis: support count for insertion and replacementMarc André Tanner
Fix #372
2016-12-26fix help text for next/prev matchErlend Fagerheim
2016-12-21vis: implement `gh` and `gl` to move by relative byte offsetsMarc André Tanner
2016-12-21vis: implement `go` to move to absolute byte positionMarc André Tanner
2016-12-21vis: implement g8Marc André Tanner
Shows hex values up to the next UTF-8 encoded character.
2016-12-20vis: improve literal insertion via <C-v> in insert modeMarc André Tanner
2016-12-20vis: improve gaMarc André Tanner
2016-12-19vis: introduce vis_register_from utility functionMarc André Tanner
2016-12-09Remove useless variable assignmentMarc André Tanner
Fixes CID 139067.
2016-12-09vis-lua: expose input key event in insert and replace modesMarc André Tanner
2016-12-08vis: rename some internal C function pointersMarc André Tanner
2016-11-28vis: move mark description into core codeMarc André Tanner
2016-11-27vis: cleanup signal handling codeMarc André Tanner
Move all signal handling code out of "library" code into user application.
2016-11-26vis: re-open /dev/tty read-writeableMarc André Tanner
libtermkey's initialization routine tries to write to the underlying file descriptor which fails with EBADF if it is opened read only. This was a problem in the terminal restore code called after a shell command is executed. It should fix the following: $ echo foo | vis - > bar :!/bin/sh exit where before vis would no longer accept any input.
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-lua: introduce pre-save hookMarc André Tanner
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.
2016-11-21vis-lua: rename file_save event to file_save_postMarc André Tanner
Indicating that the event is triggered *after* a successfull write.
2016-11-16sam: use default shell command for <, >, | and ! when applicapleMarc André Tanner
If the shell command is omitted, the last shell command (of any type) is substituted. The most recently used shell command is stored in a new register currently named `!`.
2016-11-15vis: defer UI initialization and overhaul argument parsingMarc André Tanner
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
2016-11-09vis: handle cancelation of `r` commandMarc André Tanner
Do not alter the text if <Escape> is pressed instead of a regular replacement character.
2016-11-09vis: improve `r` in normal and replace modeMarc André Tanner
In normal mode `r<key>` was previously implemented as `R<key><Escape>`. However this does not work when the replacement key is `<Enter>` to insert a new line, because in replace mode new lines are not overwritten. The count is now also respected. Also properly support `r` in visual mode where before it was aliased to `c`. Fix #190
2016-11-09vis: unify VIS_OP_{INSERT,REPLACE} implementationMarc André Tanner
They both perform a motion before changing mode.
2016-10-12Only complete up to cursor positionMarc André Tanner
2016-10-11File completion updatesRichard Burke