Comments (13)
Removing "selectionBehavior": "character"
from dance.modes.insert
fixed it! Thank you so much 😄
from dance.
Hi, and thanks for the report! Even when you have long selections a
goes to the beginning? Are you sure that you didn't override was a
does in VS Code keybindings? I don't really know where the error can come from, I think your best shot is to clone the Dance repo, open it in VS Code, and run the extension. This will allow you to debug it (with breakpoints) and see what happens when you press a
.
from dance.
Thanks for the quick reply! When I have a long beginning, a does go to the end of that selection, but inserts the character before the last char of the selection. Maybe this is intended?
<anchor>asdfasdfasdf<cursor>
If this ^ is my selection and I press a
, this happens:
asdfasdfasd<cursor>f
but I expected this:
asdfasdfasdf<cursor>
Which made me think a
and i
did the same thing. They don't! But it still seems unusual
from dance.
And this also happens with "selectionBehavior": "caret"
? My guess is that you either have "selectionBehavior": "caret"
with "cursorStyle": "block"
, or "selectionBehavior": "character"
with "cursorStyle": "line"
.
from dance.
Oh! That clears it up!
This was my config:
"dance.modes": {
"input": {},
"insert": {
"selectionBehavior": "character"
},
"normal": {
"cursorStyle": "block",
"selectionBehavior": "character"
}
},
When using "selectionBehavior": "caret"
it works as expected!
Is this me misunderstanding how it's supposed to work/how kak works, or is this a bug with "selectionBehavior": "character"
?
For example:
"|selectionBehavior": "caret"
Pressing w
does this (I don't think saying it has two anchors is technically correct, but the whole word is definitely selected)
"<anchor>selectionBehavio|r<anchor>": "character"
But if I use "selectionBehavior": "caret"
:
"<anchor>selectionBehavior|": "character"
from dance.
Dance "character"
selection behavior is meant to work with "block"
cursor style because it internally converts a selection like selectionBehavio|r
(as seen by VS Code) into selectionBehavior|
(as seen by Dance) because with a block cursor, it looks like selectionBehavio[r]
is selected even though VS Code considers that the selection ends before r
. Perhaps a warning should be emitted that "cursorStyle": "line"
(the default) doesn't work well with "selectionBehavior": "character"
.
Note that Kakoune doesn't have that concept; "caret"
selection behavior is simply the native VS Code selection behavior, and "character"
selection behavior is an emulation of how Kakoune works for Dance commands (because in VS Code fo[o]
(with the block on the last o
) only considers fo
in the selection, whereas in Kakoune it considers foo
). Dance used to work differently (by modifying the style of the collection instead of using a "block"
character style, avoiding having to translate selections in some cases), but this led to even more issues.
from dance.
@71 I disabled "cursorStyle": "block"
just for the sake of the example -- I've posted the settings I'm usually using above :P
Again, I'm not sure how it's in Kak, but with Helix, pressing a
lands my cursor to the right side of the block. Something like this:
With Dance, it lands me to the left side of the e, with the settings I posted above (block + character)
from dance.
That's why I filed this issue in the first place, it looks just like it does with e.g. Helix (my block cursor is over the character) but when I press a
, Dance acts as if it's not
from dance.
I tried it on my end and pressing a
in your example on Dance (block + character) goes to the right side of e
as expected. I'm not sure what's going wrong on your end, so I'd suggest debugging Dance when you press a
. You can put a breakpoint here and look at various locals to see what command is being executed; in theory, its name should be dance.modes.insert.after
.
Edit: are you still using "selectionBehavior": "character"
in "insert"
mode? That might be the issue, as it should always be set to "caret"
(again, I should probably add a warning here, but Dance is designed to be easily extensible so it sounds a bit weird to me).
from dance.
That's odd. Thank you for all your help! :)
If I end up debugging it, I'll post what I've found in here
from dance.
@merlindru In case you didn't see it before replying, I edited my comment with a possible solution.
from dance.
Thanks! Missed that. Will try
from dance.
Can't believe I didn't try that first. Using character selection behavior in insert mode doesn't make any sense :P
from dance.
Related Issues (20)
- Double click behavior with block selections HOT 3
- Switching to a non-editor tab breaks registers view HOT 1
- registers view "Cannot read properties of undefined (reading 'iconName')" HOT 1
- Certain single-letter registers unexpectedly map to special registers HOT 1
- `x` and `shift+x` broken in `0.5.13` HOT 6
- Need to press undo twice after pasting HOT 1
- Pipe commands have issues in devcontainers HOT 7
- Rotate selections is order-dependent HOT 4
- Helix support HOT 2
- Can't turn off current-line highlighting(?) HOT 2
- Alt+Shift+E with character selection in normal mode narrows selection incorrectly
- What happened to the X and Shift+X commands? HOT 2
- Option to not justify current line number with relative line numbers HOT 2
- Donation HOT 2
- Dance selection not matching VSCode HOT 1
- Pipes not working HOT 1
- Non-English character input in normal mode HOT 1
- `<C-[>` for escape
- Jump to last visible line and middle visible line are incorrect when code is folded
- up/down doesn't work in command palette? HOT 3
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 dance.