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

Feature request: Disable automatic cursor transfer when adding the last line. #361

Open
Vmelnikoff opened this issue Jan 18, 2024 · 3 comments

Comments

@Vmelnikoff
Copy link

Vmelnikoff commented Jan 18, 2024

Visual Studio Code v.1.85 + EditorConfig extension.

Settings - "files.autoSave": "afterDelay",

Current behavior (with autosave setting):
After a second starts autosaving and a new last empty line is added at the beginning of typing, the cursor is moved, in the next string because of this, text break glitches, for example:

.red
{/* here - moved cursor from the VS extension EditorConfig */}
/* here - empty new line created by the VS extension EditorConfig */

In EditorConfig plugin (WebStorm) another, more correct behavior:
After a second starts autosaving and a new last empty line is added, but , the cursor is NOT moved. Therefore, there are no glitches with line breaks.

.red {/* here - NOT moved cursor from the VS extension EditorConfig */}
/* here - empty new line created by the WS plugin EditorConfig */

Could you do the same behavior as WebStorm plugin (the cursor is NOT moved when auto-creating a new last empty line) in the plugin EditorConfig for VSCode?

Thank you in advance.

@SunsetTechuila
Copy link

SunsetTechuila commented Jun 8, 2024

I don't think that can be fixed on the extension side

this is where the cursor goes when setting selection to Position(46, 0)

image

and this is when setting selection to Position(46, 1)

image

no way to place it between the brace and the newline

@SunsetTechuila
Copy link

it seems that vscode does the same what this extension does
so there is might be an issue with the public api

@SunsetTechuila
Copy link

p.s.

copying the value ([...activeEditor.selections]) instead of the reference here doesn't fix anything

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

No branches or pull requests

2 participants