summaryrefslogtreecommitdiff
path: root/vis-modes.c
AgeCommit message (Collapse)Author
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-21make Selection unopaqueRandy Palamar
2020-02-04vis: make core code more robustMarc André Tanner
The core vis code was originally written under the assumption that there always exists at least one window. However, when being called from the Lua configuration file during start up this is not yet the case. In general, Lua code should always be placed within appropriate event handlers e.g. vis.events.INIT for global configuration. Invoking API functions depending on an active window from top level statements is not supported. Where before the editor simply crashed, these changes turn such code sections into NOPs. Fix #561
2017-07-14vis: use distinct mark to save last selectionsMarc André Tanner
This partially reverts f9e2b884c15919757651db8b10c033a344a19e75 further jumps after leaving visual mode should not break `gv`.
2017-07-14vis-lua: make selection first class primitives in Lua APIMarc André Tanner
2017-07-10vis: let '^ mark point to top of jump listMarc André Tanner
2017-07-04vis: implement `gv` by means of new "^ registerMarc André Tanner
This window local register holds the last active selections.
2017-06-15vis: rename uses of Cursor to SelectionMarc André Tanner
2017-06-15view: rename view_cursorsMarc André Tanner
2017-06-15view: rename view_cursors_nextMarc André Tanner
2017-06-15view: rename view_cursors_selection_startMarc André Tanner
2017-06-15view: rename view_selections_clearMarc André Tanner
2017-05-27vis-lua: expose currently active key bindings through APIMarc André Tanner
Close #563
2017-04-04vis: do not remove indentation of non-empty linesMarc André Tanner
Fix #532
2017-03-16vis: remove unnecessary status bar redrawMarc André Tanner
There is no longer a need to explicitly redraw the window status bar upon a mode change, it will happen anyway during the next UI update.
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-17vis: cleanup error paths in key action handling codeMarc André Tanner
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-26vis: do not repeat insertion while showing promptMarc André Tanner
Previously something like `5ifoo<Escape>:<Escape>` would insert foo into the command prompt.
2017-01-20vis: slightly cleanup repeat code, always set dot registerMarc André Tanner
2017-01-19vis: simplify count handling for insertionMarc André Tanner
2017-01-18vis: fix count handling for appendMarc André Tanner
Fix #371
2017-01-18vis: support count for insertion and replacementMarc André Tanner
Fix #372
2017-01-18vis: unify insert/replace mode enter handlerMarc André Tanner
2017-01-18vis: unify insert/replace mode leave handlerMarc André Tanner
2017-01-18vis: do not take undo snaphots while replaying a macroMarc André Tanner
The vis_keys_feed function is currently unaffected by this change. It still creates individual undo points. While this is probably undesirable from an API point of view, it keeps the lua based tests that use undo points working.
2017-01-16vis: change key input handling modelMarc André Tanner
Previously if you had a mapping for both `a` and `ab` the latter would in effect be unreachable because the greedy search would always match and then execute the former. With the new behavior we keep reading keys until we have a non ambigious sequence. That is after pressing `a` nothing will happen, if the next key is a `b` we will execute the `ab` mapping otherwise we will perform `a` and whatever the action is for the next key. Close #386
2017-01-15vis: do not crash when given insufficient arguments to :mapMarc André Tanner
Fix #459
2017-01-14vis-lua: allow mode changes by setting vis.modeMarc André Tanner
2017-01-06vis: simplify mode lookup for :map and :unmapMarc André Tanner
2016-12-29vis: cleanup key action lifetime managementMarc André Tanner
2016-12-29vis: unmap all conflicting bindings of a forced map commandMarc André Tanner
2016-12-27vis: properly free dynamic key bindingsMarc André Tanner
The handling of :unmap needs to be revisited at some point.
2016-11-09vis: perform undo snapshotting more rarerlyMarc André Tanner
Do not take snapshots after every operation in insert/replace mode. As an example up until now we would take a snapshot after every <Backspace>/<Delete> press, hence when undoing changes each character would be restored individually. The same applies for <C-w> and related actions. From now on we only snaphost when: - transitioning from insert/replace mode to normal mode (but not when switching to operator pending mode) - an operation takes place from normal mode - an idle time expires in normal/replace mode
2016-11-09vis: unify VIS_OP_{INSERT,REPLACE} implementationMarc André Tanner
They both perform a motion before changing mode.
2016-08-24vis: add vis_mode_get functionMarc André Tanner
2016-08-24vis: improve dot (repeat) command implmentationMarc André Tanner
Do not override implicit operator macro in command mode. Fix #334
2016-05-22vis: refactor status line handlingMarc André Tanner
Make window status bar content configurable via Lua.
2016-05-13vis: clean up key mapping implementationMarc André Tanner
2016-04-28vis: reject key mappings for which a prefix is already mappedMarc André Tanner
`<` needs a special treatment because it is used to denote symbolic keys without it the shift left operator would not work.
2016-04-06vis: fix vi filter operators ! and =Marc André Tanner
2016-02-20vis: reject obviously recursive key bindingsMarc André Tanner
This does only detect the simplest cases.
2016-02-12vis: respect window local mappings for child modesMarc André Tanner
Since commit 197ab824206335eab7ceed774ddeccac18fafc09 visual line and replace modes are child modes, hence we also have to consider the window local key bindings of their respective parent modes. For example in replace mode the key lookup chain is now as follows: window local replace mode -> global replace mode -> window local insert mode -> global insert mode This fixes <Enter> behaviour in prompt for replace and visual line modes.
2016-02-10vis: simplify modes implementationMarc André Tanner
Make replace mode a child of insert mode and visual line a child of visual mode. This means any key binding for the former is automatically available in the latter. Also keys can not be unmapped solely from the child modes.
2016-01-27vis: remove unused struct Mode member 'is_user'Marc André Tanner
2016-01-18vis: do not move cursor when entering visual line modeMarc André Tanner
Switching to character wise visual mode is still different than in vim because we do not distinguish between line wise and charwise selections. Close #149
2016-01-14vis: more cleanupsMarc André Tanner
2016-01-14vis: s/ops/vis_operators/gMarc André Tanner
2016-01-13Implement command/search prompt history as a regular fileMarc André Tanner
2016-01-13vis: add infrastructure to support per window key bindingsMarc André Tanner