t9md / atom-cursor-history

Cursor position history manager
https://atom.io/packages/cursor-history
MIT License
59 stars 7 forks source link

Dont use onDidChangeCursorPosition #10

Closed t9md closed 8 years ago

t9md commented 8 years ago

Currently history preservation is far from complete.
The reason is cursor position is changed internally. Ex. symbols-view:toggle-file-symbols move cursor position to achieve preview feature.

I don't want to save this internal movement to history.
I did very dirty workaround specifically for symbols-view on #3.
But this approach is far from ideal and never complete.

Noticed, atom.command.onWillDispatch and onDidDispatch hook. I can use this hook to check cursor position change at pre/post-command execution.

Or simply I can use to lock history saving for specific command ( I can get command name by event.type).