vscode-center-editor-window icon indicating copy to clipboard operation
vscode-center-editor-window copied to clipboard

Centering not triggered for long files

Open fbkarsdorp opened this issue 7 years ago • 4 comments

Thanks for this useful extension. I'm not sure what the issue is, but centering doesn't seem to work for long files (I'm working on a 400k lines file).

fbkarsdorp avatar Jan 05 '18 09:01 fbkarsdorp

@fbkarsdorp Thanks for the report - and sorry for my late answer, this one slipped under my radar.

I did some tests and can reproduce the behaviour, unfortunately it happens on the VSCode side of the API I'm using. What happens is that the call for positioning the screen times out after a second. My guess is that the method/algorithm used to calculate the center is simply too slow (not even a surprise, 400k lines is quite an edge case :)

I'll dig into the VSCode source to find the causing.

kaiwood avatar Feb 01 '18 13:02 kaiwood

Try ctrl+a -> backspace -> ctrl+s. That should fix the problem. Might have some unwanted side-effects, though ;P

johndebord avatar Feb 02 '18 05:02 johndebord

No, nothing happens @johndebord , as I'm on the first line and ctrl-a is mapped to beginning of line. Sure, I know that 400k lines is quite the edge case, but trying to solve a case like that might lead to some interesting insights.

fbkarsdorp avatar Feb 05 '18 11:02 fbkarsdorp

Hahaha sorry man I had to. I was just kidding. ctrl+a would select all 400k lines. Then backspace would delete ;P

johndebord avatar Feb 07 '18 06:02 johndebord