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

History file gets very big #969

Open
noughtmare opened this issue Jan 20, 2017 · 8 comments
Open

History file gets very big #969

noughtmare opened this issue Jan 20, 2017 · 8 comments

Comments

@noughtmare
Copy link
Member

Due to testing killling and yanking a lot of text (600KB multiple times) my killring has grown to about 40MB. This should probably not be saved to file. Maybe we could filter very large strings or alternatively adaptively change the amount of history we save based on the size of the history.

@ghost
Copy link

ghost commented Jan 21, 2017

Better to have a config option on the amount of history to save.

@Fuuzetsu
Copy link
Member

Definitely -1 on simply filtering large strings: if you select a large amount of text by accident then kill it, you can't put it back…

@noughtmare
Copy link
Member Author

noughtmare commented Jan 30, 2017

@Fuuzetsu I mean filter the large strings when saving to the history file. I agree that filtering the killring while it is in memory is not be a good idea.

I think a better option would be to compress the history file so that the file doesn't take much space even if somebody kills the same big text multiple times.

But now I'm thinking about this more, I realize that this will probably not be a problem for normal usage of the editor. Just a warning somewhere would be enough.

@ethercrow
Copy link
Member

When in doubt, look at vim and emacs, what do they do with their history files?

@noughtmare
Copy link
Member Author

noughtmare commented Jan 30, 2017

I just tried it in vim and it filters out large yanks from its history. I opened a large file and yanked its contents and then closed vim opened vim again and tried to paste, but nothing happened. Doing the same with small files will work as expected.

I don't know what the threshold is, because I don't really know where to look for this in official documentation.

Edit: just tried emacs and the same happens. My emacs (which is the default) doesn't save the killring at all.

@Fuuzetsu
Copy link
Member

emacs should save the killring (I think) but the undo-history is separate; I think it only stores some amount (10MB by default I think?) amount of stuff in there and if you're doing something on a big file, it plasters a big fat warning in a whole new buffer about it.

@noughtmare
Copy link
Member Author

I tested emacs by doing C-SPC -> C-n -> M-w and then close emacs and open emacs again and then tried to C-y but nothing happens.

@Fuuzetsu
Copy link
Member

Oh. killring in emacs is not saved by default, sorry

Seems I got confused as to what this was about.

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

3 participants