Comments (8)
Works as expected. vi,
selects between commas. a
is not between any commas, so it can not be selected with vi,
.
Adding linebreaks to the mix makes it impossible to select multiline entries separated by comma (like function argument lists with one argument per line).
Adding the beginning and end of the buffer seems would be such a special case that I don't think it makes much sense to break consistency here.
So what do you suggest?
from targets.vim.
I think this should be fixed:
- current behaviour unexpected
- current behaviour has problems
- significantly more useful if fixed
Given a document containing multiple lists in multi-line style, attempting to select the first or last elements instead selects multiple lists:
List Style 1:
a ,
b ,
cccccc ,
d ,
e
List Style 2:
a
, b
, ccccccc
, d
, e
List Style 3:
a, b, ccccc, d, e
List Style 4: (3&1 or 3&2):
a, b,
c
, d,
e, f, g
The beginning of a multi-line list can't be accurately determined in style#1. The end of a multi-line list can't be accurately determined in style#2. However a list-boundary condition needs to exist, if only to prevent the aforementioned selection problem.
The simplest boundary condition is to stop on lines without the selected delimiter. However I think this might be more effective:
- Move in direction X to next line
- Get line contents
- Strip out comments (requires filetype support, but isn't dependent on any particular filetype)
- Continue (to 1) if:
- Line contains whitespace (\s) only
- Line is empty after stripping but not empty before (entire line was a comment)
- Stop. Selection includes starting line only (ignore lines in 4)
Single-line lists should be relatively simple to fix.
from targets.vim.
I think this should be fixed
...
I think as @orbisvicis this is more usefull and expected when fixed, see also #116
from targets.vim.
I would like to have this (or #84) since it would allow to select things like the left and right sides of an assignment, or multi-line hashes in several languages.
from targets.vim.
This seems to be an issue that multiple people have found unexpected.
However, I understand fixing it would be a backwards incompatible change.
So what about making this a configurable option. There are a multitude of ways of implementing this, one has already been described above. A simplest one would be to just consider BOL and EOL as an instance of whatever delimiter is being used.
from targets.vim.
Opt-in sounds like a good compromise.
from targets.vim.
this issue affects more than just beginning/end of line, for instance:
fn(a, b)
targets.vim
cannot delete a
or b
with di,
. i think a general solution is an ANY
delimiter: in this example, placing the cursor on a
would seek left to the first delimiter and find (
, seeking right would find ,
. in the OP example, ANY
would seek left to find BOL
, seek right to find ,
.
from targets.vim.
@aeosynth: Your specific example is covered by the argument text objects. Try daa
or cina
.
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.