Comments (8)
Thank you for letting me know! I can reproduce the issue and agree that it should be fixed. I will address this in the next days.
from targets.vim.
Use IB instead of iB. I is exluding whitespace whereas i is everything inside the braces. If you do not like this behaviour you can change g:targets_aiAI and switch I and i.
from targets.vim.
Should the brace be considered "inside" the brace, though? That doesn't
seem logical, not to mention breaking expected behavior with default vim.
from targets.vim.
The brace is not selected when executing >iB, but the whitespace before it in the same line is. You can canfirm this with viB. ">" does not care what is actually selected by the text object. It only operates on lines. Because the last line with the brace has the whitespace selected it is indented as well. However, I agree that the default behaviour of I and i should be switched. But this would break backwards compatibility.
from targets.vim.
Ah, I see. Thank you for explaining.
from targets.vim.
@UnrealQuester Thank you for the explanation. I was actually thinking about switching i
and I
for a while now. Most of the time excluding the whitespace seems to be more natural. However, both versions have their use case:
- when changing, whitespace should be preserved
cI}
- when deleting, whitespace should be removed
di}
I am not sure what is the more common operation. One could even think about combining i}
to work differently depending on the pending operator. But that sounds complicated and is not easy to expand when working with third party operators like vim-surround or vim-exchange.
If you want to continue this discussion, feel free to open a separate issue. 👍
from targets.vim.
@dhleong The issue is fixed with #70. Multiline selections where the last line consists only of whitespace will exclude that whitespace now. This should be compatible with default Vim.
Thanks again!
from targets.vim.
Awesome, thank you!
from targets.vim.
Related Issues (20)
- [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 2
- `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 ?
- ia do not detect outer scope when an inner scope is present in the line
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.