Comments (3)
Thank you for your report. I can reproduce it and found that the reason for this lies in Vim itself.
To confirm, try this. Start Vim without settings and plugins:
vim -u NONE --noplugins
Enter the text \<x>
, place your cursor on x
and type di>
. Vim doesn't delete the x
. Try the same without the backslash <x>
and it works. I am using these stock text objects in targets.vim
, so this behavior gets forwarded to you.
Here are some internals I found in case you are interested:
The command di>
triggers a call stack including the following calls:
1. nv_object
2. current_block
3. findmatch
4. findmatchlimit
The findmatchlimit
call searches for the opening <
left to the cursor. It also recognizes that there is a backslash in front of the bracket \<
and basically rejects it. The cpoptions
flag M
can normally be used to ignore these backslashes and I would have advised you to try this setting. Unfortunately the calling function current_block
overwrote cpoptions="%"
before calling findmatch
to make findmatchlimit
ignore certain brackets in quoted strings. This is all reasonable, but it also means that adding M
to your cpoptions
couldn't help here.
In summary the behavior your observed is the result of Vim's very internals. I would guess that a lot of thought went into these details over the years, so I'm not sure we want to fiddle with it.
The idea behind all this is documented in :help cpo-M
and :help cpo-%
.
If you're still not convinced I would recommend to address this on vim_dev and propose to set cpoptions
to %M
or %
depending on whether or not M
was part of the original cpoptions
string. That way you could :set cpo+=M
locally and everything should work for you. But I don't know about other implications that change in Vim's core would have for everybody else.
from targets.vim.
Thanks for the digging into it. You're correct; my apologies for not trying it out on a stock setup.
from targets.vim.
No worries. I learned some new Vim internals :)
from targets.vim.
Related Issues (20)
- Question: on deleting the last element in a list plus its preceding comma HOT 1
- [Bug Report] Why does targets.vim reset my filetype?
- targets.vim causing issue with macros HOT 6
- cin' not working with \
- Disabling mappings still causes health check warnings.
- Define argument source with longer separator (multiple characters). HOT 2
- cin" doesn't target next quotes properly HOT 1
- `ia` doesn't handle nested braces when arguments are put each on it's own line HOT 4
- Square brackets argument doesn't work HOT 1
- Supporting Other Plugins HOT 1
- Unable to select pair text object with other pair on the same line HOT 1
- Stops working with "set nomagic"
- dot-repeat echoes sometimes ':call targets#do()'
- README.md has Pathogen example that uses "git://" URL instead of "https://" or "ssh://" URL
- ci( doesn't seek forward
- repeat motion in visual mode does not extend selection
- Missing mapping for r
- How to install for Intellij's ideavim HOT 1
- Mess up with di"
- [feature-request] make it possible to disable one or more omap/vmap ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from targets.vim.