vscode-center-editor-window
vscode-center-editor-window copied to clipboard
Centering not triggered for long files
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 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.
Try ctrl+a -> backspace -> ctrl+s. That should fix the problem. Might have some unwanted side-effects, though ;P
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.
Hahaha sorry man I had to. I was just kidding. ctrl+a would select all 400k lines. Then backspace would delete ;P