Issue #221 resolved

EX commands strange behaviour introduced by commit: 6c770afb7ee31e8f146a6fdcfc0deeec5cfd8d1b

Anonymous created an issue

The commit: 6c770afb7ee31e8f146a6fdcfc0deeec5cfd8d1b 'Set the region instead of visual selection for ex commands' broke interactive functions from the EX command line. When function below is called with eval-expression (call-interactively 'BUGGY_FUNC) the symbol is completed. When called from EX (:BUG<enter>) completion is not done. Prior mentioned commit both usages worked.

(defun BUGGY_FUNC (term) (interactive (list (completing-read "FOUND: " nil nil nil (thing-at-point 'symbol))) (message term))) (evil-ex-define-cmd "BUG" 'BUGGY_FUNC)

Comments (1)

  1. Frank Fischer repo owner

    Set region to ex-range only with explicit range

    If no explicit range is specified for an ex command, the command itself is responsible for determining its working range. Usual evil operators do this by the :motion property.

    But if an explicit range is specified, then the region is modified to match the region. This allows call use usual Emacs commands, which work on the region, as ex commands. This is particularly useful if the ex region is the visual region '<,'>.

    This fixes issue #221.

    → <<cset a585fecf86ff>>

  2. Log in to comment