{"action":"created","issue":{"url":"https://api.github.com/repos/fdorg/flashdevelop/issues/647","labels_url":"https://api.github.com/repos/fdorg/flashdevelop/issues/647/labels{/name}","comments_url":"https://api.github.com/repos/fdorg/flashdevelop/issues/647/comments","events_url":"https://api.github.com/repos/fdorg/flashdevelop/issues/647/events","html_url":"https://github.com/fdorg/flashdevelop/pull/647","id":66117340,"number":647,"title":"Move the caret / selection in SelectionDuplicate","user":{"login":"Gama11","id":2620907,"avatar_url":"https://avatars.githubusercontent.com/u/2620907?v=3","gravatar_id":"","url":"https://api.github.com/users/Gama11","html_url":"https://github.com/Gama11","followers_url":"https://api.github.com/users/Gama11/followers","following_url":"https://api.github.com/users/Gama11/following{/other_user}","gists_url":"https://api.github.com/users/Gama11/gists{/gist_id}","starred_url":"https://api.github.com/users/Gama11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gama11/subscriptions","organizations_url":"https://api.github.com/users/Gama11/orgs","repos_url":"https://api.github.com/users/Gama11/repos","events_url":"https://api.github.com/users/Gama11/events{/privacy}","received_events_url":"https://api.github.com/users/Gama11/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-03T09:48:02Z","updated_at":"2015-04-03T20:56:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/fdorg/flashdevelop/pulls/647","html_url":"https://github.com/fdorg/flashdevelop/pull/647","diff_url":"https://github.com/fdorg/flashdevelop/pull/647.diff","patch_url":"https://github.com/fdorg/flashdevelop/pull/647.patch"},"body":"Like FD, IntelliJ IDEA also has a Ctrl+D shortcut to duplicate the current selection (or line if the selection is empty), but it also\r\n- moves the caret down one line if a line is duplicated\r\n- moves the selection to the duplicated text if the selection is duplicated\r\n\r\nI think this is convenient, so I implemented the same behavior here.\r\n\r\nIt does seem a little counter-intuitive when you undo the duplication, because the selection doesn't go back to what it was before. I tried `Begin` / `EndUndoAction()`, but Scintilla doesn't care about selection changes in the undo history.\r\nThe [docs](http://www.scintilla.org/ScintillaDoc.html) say:\r\n\r\n>Scintilla saves actions that change the document. Scintilla does not save caret and selection movements, view scrolling and the like.\r\n\r\nI'm not sure how this behavior could be emulated either, there are undo / redo event listeners, but I don't know how you would be able to tell that what's being undone / redone is a SelectionDuplicate action."},"comment":{"url":"https://api.github.com/repos/fdorg/flashdevelop/issues/comments/89417602","html_url":"https://github.com/fdorg/flashdevelop/pull/647#issuecomment-89417602","issue_url":"https://api.github.com/repos/fdorg/flashdevelop/issues/647","id":89417602,"user":{"login":"Meychi","id":2213937,"avatar_url":"https://avatars.githubusercontent.com/u/2213937?v=3","gravatar_id":"","url":"https://api.github.com/users/Meychi","html_url":"https://github.com/Meychi","followers_url":"https://api.github.com/users/Meychi/followers","following_url":"https://api.github.com/users/Meychi/following{/other_user}","gists_url":"https://api.github.com/users/Meychi/gists{/gist_id}","starred_url":"https://api.github.com/users/Meychi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Meychi/subscriptions","organizations_url":"https://api.github.com/users/Meychi/orgs","repos_url":"https://api.github.com/users/Meychi/repos","events_url":"https://api.github.com/users/Meychi/events{/privacy}","received_events_url":"https://api.github.com/users/Meychi/received_events","type":"User","site_admin":false},"created_at":"2015-04-03T20:56:23Z","updated_at":"2015-04-03T20:56:23Z","body":"3rd party plugins. :)"}}