Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block cursor in command mode #19

Closed
snowiow opened this issue Nov 19, 2015 · 7 comments
Closed

Block cursor in command mode #19

snowiow opened this issue Nov 19, 2015 · 7 comments

Comments

@snowiow
Copy link
Contributor

snowiow commented Nov 19, 2015

Hi, I'm interested in implementing this feature and studied the API. I didn't find anything and asked on the official issue tracker of vscode, but no answer so far. Does someone of you know, how I can get it done, to manipulate the cursor shape?

@jpoon
Copy link
Member

jpoon commented Nov 19, 2015

Related: #13

Thanks so much for helping look into this! I couldn't find anything in the vscode documentation either; but you could potentially fake it but selecting the current character to mimic the block cursor.

@snowiow
Copy link
Contributor Author

snowiow commented Nov 19, 2015

Ok, I was already afraid of something like that. After reading their approach it looked like it isn't allowed at all for the moment, because they are going a very conservative way of extension possibilities. Hope they allow more in the future though. So long this fake selection, seems to be the only possibility.

@adriaanp
Copy link
Contributor

Would the DecorationRenderOptions with cursor property not style the cursor when setting a TextEditorDecorationType on the editor?

@adriaanp
Copy link
Contributor

Never mind after a quick test, that is the actual mouse cursor styling

@drewcassidy
Copy link

Excuse my lack of experience with javascript and web-based stuff, but didnt someone say in #18 it was possible to render things directly to the canvas? would that work to draw the block cursor?

@ThatRendle
Copy link
Contributor

Looks like the best way to do this right now is to define a single-character range in the textEditor with the backgroundColor style set, and move it with the cursor.

@jpoon
Copy link
Member

jpoon commented Dec 3, 2015

Also just tried setting mimicking the block as a selection:

let position = new vscode.Position(0, 0);
let selection = new vscode.Selection(position, position.translate(0, 1));
vscode.window.activeTextEditor.selection = selection ;

It sorta works but you still see the cursor, so....suboptimal -- css styling may be the way to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants