Issue #114 resolved

Deleting outer text object behaves differently than in Vim.

Titus von der Malsburg
created an issue

Consider this text:

{{{ Hello "blue" planet! }}}

In Vim putting the cursor on //blue// and typing {{{da"}}} leaves you with:

{{{ Hello planet! }}}

with one space between //Hello// and //planet//. However, in Evil two spaces are left between the words. The same happens with other text objects like parenthesis and other quotes. But sentences ({{{das}}}) work correctly. There is no such problem with the change operator because there the two spaces are the correct behavior. Yanking produces a similar problem: {{{ya"}}} on blue yanks {{{"blue"}}} (no spaces included) where in Vim it yanks {{{"blue" }}} with a space at the end. The same for visual selection ({{{va"}}}).

Comments (5)

  1. Frank Fischer repo owner
    • changed status to open

    Are you sure ca" leaves two blanks (in vim)? In my vim it leaves only one blank, too. I'm asking because that would imply another special case for the corresponding text object.

  2. Frank Fischer repo owner

    Add `evil-quote-range' possibly selecting white space around quote objects

    This function calls `evil-paren-range' to select the object itself and possibly adds trailing or preceding white space if appropriate. "a" text objects select the object plus white space, "2i" (i.e., inner with count 2) select the objects including the quotes but no additional white space. Note that the inner quote objects use `current-prefix-arg' the get the actual count because the `count' parameter itself may be set to 1 or -1 by the general text-object code (in visual state). This should be improved in future! (fixes #114)

    Wiki macro error: Changeset 61f6ba5578cb not found.

  3. Log in to comment