{"action":"created","issue":{"url":"https://api.github.com/repos/tgjones/gemini/issues/216","repository_url":"https://api.github.com/repos/tgjones/gemini","labels_url":"https://api.github.com/repos/tgjones/gemini/issues/216/labels{/name}","comments_url":"https://api.github.com/repos/tgjones/gemini/issues/216/comments","events_url":"https://api.github.com/repos/tgjones/gemini/issues/216/events","html_url":"https://github.com/tgjones/gemini/issues/216","id":166252689,"number":216,"title":"AvalonEdit UndoStack integration","user":{"login":"EchterAgo","id":922233,"avatar_url":"https://avatars.githubusercontent.com/u/922233?v=3","gravatar_id":"","url":"https://api.github.com/users/EchterAgo","html_url":"https://github.com/EchterAgo","followers_url":"https://api.github.com/users/EchterAgo/followers","following_url":"https://api.github.com/users/EchterAgo/following{/other_user}","gists_url":"https://api.github.com/users/EchterAgo/gists{/gist_id}","starred_url":"https://api.github.com/users/EchterAgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EchterAgo/subscriptions","organizations_url":"https://api.github.com/users/EchterAgo/orgs","repos_url":"https://api.github.com/users/EchterAgo/repos","events_url":"https://api.github.com/users/EchterAgo/events{/privacy}","received_events_url":"https://api.github.com/users/EchterAgo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-19T05:42:57Z","updated_at":"2016-07-19T05:45:35Z","closed_at":null,"body":"This ticket is for discussion about integrating AvalonDock undo redo functionality with Gemini.\r\n\r\nThis is to get the discussion out of the pull request.\r\n\r\nhttps://github.com/tgjones/gemini/pull/215#issuecomment-233516789"},"comment":{"url":"https://api.github.com/repos/tgjones/gemini/issues/comments/233537886","html_url":"https://github.com/tgjones/gemini/issues/216#issuecomment-233537886","issue_url":"https://api.github.com/repos/tgjones/gemini/issues/216","id":233537886,"user":{"login":"EchterAgo","id":922233,"avatar_url":"https://avatars.githubusercontent.com/u/922233?v=3","gravatar_id":"","url":"https://api.github.com/users/EchterAgo","html_url":"https://github.com/EchterAgo","followers_url":"https://api.github.com/users/EchterAgo/followers","following_url":"https://api.github.com/users/EchterAgo/following{/other_user}","gists_url":"https://api.github.com/users/EchterAgo/gists{/gist_id}","starred_url":"https://api.github.com/users/EchterAgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EchterAgo/subscriptions","organizations_url":"https://api.github.com/users/EchterAgo/orgs","repos_url":"https://api.github.com/users/EchterAgo/repos","events_url":"https://api.github.com/users/EchterAgo/events{/privacy}","received_events_url":"https://api.github.com/users/EchterAgo/received_events","type":"User","site_admin":false},"created_at":"2016-07-19T05:45:34Z","updated_at":"2016-07-19T05:45:34Z","body":"We can get basic undo redo working by implementing ICommandHandler<UndoCommandDefinition> and ICommandHandler<RedoCommandDefinition> on CodeEditorViewModel. Just derive the class from the interfaces and add these methods:\r\n\r\n```c#\r\n        void ICommandHandler<UndoCommandDefinition>.Update(Command command)\r\n        {\r\n            command.Enabled = _view.TextEditor.CanUndo;\r\n        }\r\n\r\n        Task ICommandHandler<UndoCommandDefinition>.Run(Command command)\r\n        {\r\n            _view.TextEditor.Undo();\r\n            return TaskUtility.Completed;\r\n        }\r\n\r\n        void ICommandHandler<RedoCommandDefinition>.Update(Command command)\r\n        {\r\n            command.Enabled = _view.TextEditor.CanRedo;\r\n        }\r\n\r\n        Task ICommandHandler<RedoCommandDefinition>.Run(Command command)\r\n        {\r\n            _view.TextEditor.Redo();\r\n            return TaskUtility.Completed;\r\n        }\r\n```\r\n\r\nThe problem with this is that it is not integrated with the history view. I'm not sure if there is a simple way to add this. Also the AvalonEdit undo redo stack seems to be way too granular in that undo redo operates on single characters."}}
{"actor":{"display_login":"EchterAgo"}}