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

insertion of several new lines at once extremely slow #30

Open
gh-salt opened this issue May 25, 2020 · 1 comment
Open

insertion of several new lines at once extremely slow #30

gh-salt opened this issue May 25, 2020 · 1 comment
Labels
bug Something isn't working workaround the bug is not fixed, but there is a way around it

Comments

@gh-salt
Copy link
Collaborator

gh-salt commented May 25, 2020

When pressing Enter continuously to insert several new lines, the insertion is extremelly slow. It seems to be due to the need to refresh the position of the cursor for each inserted line so it is probably linked with automatic indentation.

@m-fleury
Copy link
Owner

Work-around: C-j (line break without indenting)

The deep problem here is that the indentation is non-local. To indent a given line, you need to go back to the previous line that starts with a command.

What does that mean? Well assume you start with

lemma True
  by auto

and insert 10 lines afterwards. Each time, emacs moves the cursor back to by auto to know how deep it should be indented, yielding roughly ~55 cursor moves.

I have to implement some sort of caching. I will try to understand how other modes are doing it…

@m-fleury m-fleury added bug Something isn't working workaround the bug is not fixed, but there is a way around it labels May 25, 2020
@m-fleury m-fleury changed the title insertion of several new lines at once extremelly slow insertion of several new lines at once extremely slow May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working workaround the bug is not fixed, but there is a way around it
Projects
None yet
Development

No branches or pull requests

2 participants