aboutsummaryrefslogtreecommitdiff
path: root/evil-states.el
AgeCommit message (Collapse)Author
2025-09-29Fix evil-cleanup-insert-state in flyspell enabled bufferhiecaq
2024-07-21Remove unnecessary post-command hook runTom Dalziel
2024-06-19Make combine-change-calls end more accurateTom Dalziel
2024-06-18Correct fix for combine-change-calls endTom Dalziel
2024-06-18Fix comp warning for goto-lineTom Dalziel
2024-06-16Pause hooks and undos during blockwise (bulk) insertTom Dalziel
2024-06-14Track (and restore) previous visual selection, point, mark for gvTom Dalziel
2024-05-13Chosing register keeps eol anchoring in visual block stateTom Dalziel
2024-04-13Add keyboard escape quit to commands which exit visual stateTom Dalziel
Fixes #1886
2023-08-20(evil-with-delay): New macro, extracted from `evil-delay`Stefan Monnier
Save some kittens by using a macro instead of using `eval`. This also exposes more code to the compiler, so should result in more efficient code and potentially better compiler warnings. * evil-common.el (evil-unquote): Delete unused function. (evil--with-delay): New function, extracted from `evil-delay`. (evil-with-delay): New macro, extracted from `evil-delay`. (evil-delay): Redefine using `evil-with-delay` and declare obsolete. * evil-states.el (evil-visual-activate-hook): * evil-core.el (evil-define-key): * evil-commands.el (evil-execute-in-normal-state): Use `evil-with-delay`.
2023-08-13Urgent revert of recent commits while evil is brokenTom Dalziel
Some of these commits can be almost immediately restored, once the time is found to do so. Revert "Fix evil-with-delay with dynamic binding" This reverts commit 1e9b2434264529fe0dd964b68fe89236a4abeac3. Revert "Some cleanups" This reverts commit 0cbd61f2de104fab16602d0418605cd0513b16f3. Revert "Misc minor changes" This reverts commit b291039b0c6ffc3b2f3c9f02b8ad2f0041127b12. Revert "Merge evil-with-delay condition and body lambdas" This reverts commit 1b56ffcc102b4c5f8b015e760b5f9cf5932622af. Revert "(evil-with-delay): New macro, extracted from `evil-delay`" This reverts commit 3d7faadf30016a8c20699a5fb1b5731b8a49dcd2. Revert "Make evil-search-wrap-ring-bell work with evil-search" This reverts commit 5e72cf5b6d57b785ea229236bb5c4638db2c9a05. Revert "Stop the '</'> and '[/'] marks from intertwining" This reverts commit 26db9441a13ebedb2481d7ada4c3b5e60ec22795. Revert "Remove redundant `:group` args" This reverts commit 6e30037fdc6a275d78d6b82d89bd8e47bcf4d4e3. Revert "Avoid eval in evil-test-buffer" This reverts commit 27d81ad406d2d3e07591b927357d2354ef5b5c65. Revert "Use lexical-binding everywhere" This reverts commit 44c7f301468c264a781be4ee8ae879fe1b457e60.
2023-08-12(evil-with-delay): New macro, extracted from `evil-delay`Stefan Monnier
Save some kittens by using a macro instead of using `eval`. This also exposes more code to the compiler, so should result in more efficient code and potentially better compiler warnings. * evil-common.el (evil-unquote): Delete unused function. (evil--with-delay): New function, extracted from `evil-delay`. (evil-with-delay): New macro, extracted from `evil-delay`. (evil-delay): Redefine using `evil-with-delay` and declare obsolete. * evil-states.el (evil-visual-activate-hook): * evil-core.el (evil-define-key): * evil-commands.el (evil-execute-in-normal-state): Use `evil-with-delay`.
2023-07-14Format Normal mode "!" prompt as ".,.+N!"Axel Forsman
2023-07-02Remove evil-repeat-start-hookAxel Forsman
It was a no-op since (evil-repeat-type this-command t) does not returns t, and otherwise the call to evil-repeat-start would overwrite changes done by (funcall repeat-type 'pre) in evil-repeat-pre-hook.
2023-05-29Fix pasting in visual block mode (#1786)Axel Forsman
Co-authored-by: Tom Dalziel <tom_dl@hotmail.com>
2023-02-03Restore penultimate replacement on <BS>Axel Forsman
Previously if a character was overwritten many times from Replace state, backspacing over it would restore it to its original value, unlike in Vim.
2023-02-03Track composite changes to current insertion textAxel Forsman
The implementation of evil-track-last-insertion introduced in commit 477fe8e83e58739215ea3b601098ee134484114f assumed that all relevant changes look like atomic insertions/deletions, but e.g. remove-yank-excluded-properties upon yanking causes a single substitution change. This commit fixes that. A change not centered around the end of the previous insertion is also made to start a new range, like in Vim. Fixes #1759
2023-01-10Fix Fundamental mode hackAxel Forsman
This commit fixes some issues surrounding the initialization of Evil. First of all, since GNU Emacs 26.1 major mode hooks actually do run in Fundamental mode buffers. In any case, manually enabling fundamental-mode correctly instead of turn-on-evil-mode (by setting major-mode default) successfully enables evil-local-mode, as major mode hooks then run. The major-mode variable also never needed to be reset; it is the job of the major mode to set it, as it starts off as fundamental-mode regardless of its default value. Secondly, while some hooks and variables set up by evil-local-mode were marked as permanent, this did not matter as evil-initialize unconditionally reinitialized evil-local-mode whenever the major mode changed. Fixed by marking them all as permanent and not executing evil-local-mode if it is already enabled. Closes #1268, closes #1561
2022-12-29Remove some unnecessary evil-normalize-position:sAxel Forsman
All Emacs functions that take positions as arguments such as goto-char already do the normalization performed by evil-normalize-position. The only case where it would be necessary is when a marker that may be mutated is stored. Therefore it would probably be a good idea to replace evil-normalize-position with conditional marker-position altogether.
2022-12-29Remove str-conversions in evil-visual-block-cornerAxel Forsman
2022-12-29Make visual block selection after j/k match VimAxel Forsman
Vim only extends the visual block selection to the temporary goal column if tracking EOL. Consider [a]bc a When entering Visual block mode with "C-v", going to the "c" in "abc" and then to the next line with "fcj", the selection should only include the two "a":s, and not "bc". Contrast this with when "$" is executed.
2022-11-15Don't post-command deactivate visual when not in transient mark mode (#1718)Tom Dalziel
Fixes #1122
2022-11-09Revert "Make sure visual markers are up to date in evil-visual-range"Tom Dalziel
This reverts commit 71332209386e431ae13442f20468b2edb59f727b.
2022-10-24evil transient mouse selection (#1706)Tom Dalziel
2022-08-16Make sure visual markers are up to date in evil-visual-rangeJustin Burkett
With composed characters in the buffer, such as with prettify-symbol-mode active, emacs may adjust point after the post-command-hook is run. In this case, evils visual markers do not get updated prior to say evil-delete and the deleted region does not agree with what is seen visually (only part of the composed characters are deleted). Forcing a last update using evil-visual-refresh in evil-visual-range resolves this issue.
2022-08-06Clear `evil-this-register` when leaving visual stateTom Dalziel
Fixes #1645
2022-07-31Add `evil-enter-replace-state` & support replace repetitionTom Dalziel
2022-04-25Bump version to 1.15.0Tom Dalziel
2021-12-19Replace state pastingTom Dalziel
2021-12-19Replace state evil digraphsTom Dalziel
2021-11-16Refactor `evil-visual-update-x-selection`, remove docstringTom Dalziel
Docstring should be generated by sphinx, not manually
2021-11-16Add option to stop updating X PRIMARY selection with the current visual regionChen Bin
Vim user can select a region in visual mode and press the key `p` to replace the selected text. But in GUI Emacs, the selected text might not be replaced when: - `select-enable-primary` is `t` - Third plugins override `interprogram-paste-function` (xclip.el, for example) - Clipboard managers syncronise data between PRIMARY and CLIPBOARD selection It's because the visual commands automatically insert the content of visually selected region into X PRIMARY selection. But paste commands call the api `current-kill` which calls `interprogram-paste-function`. Value of `interprogram-paste-function` is `gui-selection-value` which might return CLIPBOARD or PRIMARY selection.
2021-07-13evil-maybe-remove-spaces works for cc<escape> (#1493)Tom Dalziel
2020-03-04Bump version to 1.14.01.14.0Eivind Fonn
2020-02-03Clean up compilation warnings from lexical bindingEivind Fonn
2020-01-29Re-enable lexical bindingEivind Fonn
This reverts commit e9391ae769bee189ef6144b8861b117d5c948a80, and removes spurious debug messages.
2020-01-28Revert "Enable lexical binding"Eivind Fonn
This reverts commit c6086a7b0b44963071096e3ed7545f617de88915.
2020-01-28Enable lexical bindingEivind Fonn
2019-12-30Different mode line tags per visual state typeEivind Fonn
Fix #1180
2019-12-18Bump version to 1.13.0Eivind Fonn
Version 1.2.15 was accidentally tagged as 1.12.15, and released as such by MELPA Stable, so now I guess we have to run with it.
2019-12-11Bump version to 1.3.0-snapshotEivind Fonn
2019-12-11Bump version to 1.2.151.2.15Eivind Fonn
2019-11-19Declare documentation stringsAlexander Shukaev
2019-11-19Make more commands support visual-line-modeJustin Burkett
when evil-respect-visual-line-mode is non-nil, including evil-change-line, evil-delete-line, and evil-yank-line. Most of the work is done through the motions evil-line-or-visual-line and evil-end-of-line-or-visual-line. These motions use visual lines when visual-line-mode and evil-respect-visual-line-mode are non-nil, and revert back to standard lines otherwise. Visual selection via visual lines in the sense of visual-line-mode is supported by adding a new screen-line type (named to avoid confusion with visual state).
2019-11-05Unwed evil-move-beyond-eol and evil-move-cursor-backJustin Burkett
The docstring of evil-cursor-back only mentions that it applies to moving the cursor back when exiting insert state, but in many cases it was tied to also moving the cursor when reaching the end of the line. We have evil-move-beyond-eol to control that behavior, and there doesn't seem to be a good reason that the two must be tied together. Fixes #1178
2019-01-04Bump version to 1.2.141.2.14Eivind Fonn
2018-01-22Ensure buffer is alive in `evil-visual-update-x-selection`Hans-Peter Deifel
Since `evil-visual-update-x-selection` is ran from a timer, the buffer argument could have been killed in the meantime.
2018-01-11Copy text to PRIMARY, not CLIPBOARD in visual modeHans-Peter Deifel
Previously, the selected text in visual mode was copied to the X CLIPBOARD, while 'normal' Emacs copies the active region to the PRIMARY selection (controlled by `select-active-regions`). The latter is also what the major X toolkits do by default. This changes evil-visual-update-x-selection to use the PRIMARY selection and also... - Uses the wrapper `evil-set-selection` instead of the obsolete `x-select-text` - Tests for `display-selections-p` instead of boundness of `x-select-text` or `ns-initialized`
2017-10-03Escape parentheses and space characters properlyVasilij Schneidermann
2017-10-02update version to 1.2.131.2.13Eivind Fonn