{ "issue": { "url": "https://api.github.com/repos/laurent22/joplin/issues/7778", "repository_url": "https://api.github.com/repos/laurent22/joplin", "labels_url": "https://api.github.com/repos/laurent22/joplin/issues/7778/labels{/name}", "comments_url": "https://api.github.com/repos/laurent22/joplin/issues/7778/comments", "events_url": "https://api.github.com/repos/laurent22/joplin/issues/7778/events", "html_url": "https://github.com/laurent22/joplin/pull/7778", "id": 1585600137, "node_id": "PR_kwDOBLftOs5KBT1k", "number": 7778, "title": "Desktop: Fixes #7662: Ctrl-X behaviour when no text is selected", "user": { "login": "melsonic", "id": 88551650, "node_id": "MDQ6VXNlcjg4NTUxNjUw", "avatar_url": "https://avatars.githubusercontent.com/u/88551650?v=4", "gravatar_id": "", "url": "https://api.github.com/users/melsonic", "html_url": "https://github.com/melsonic", "followers_url": "https://api.github.com/users/melsonic/followers", "following_url": "https://api.github.com/users/melsonic/following{/other_user}", "gists_url": "https://api.github.com/users/melsonic/gists{/gist_id}", "starred_url": "https://api.github.com/users/melsonic/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/melsonic/subscriptions", "organizations_url": "https://api.github.com/users/melsonic/orgs", "repos_url": "https://api.github.com/users/melsonic/repos", "events_url": "https://api.github.com/users/melsonic/events{/privacy}", "received_events_url": "https://api.github.com/users/melsonic/received_events", "type": "User", "user_view_type": "public", "site_admin": false }, "labels": [], "state": "closed", "locked": true, "assignee": null, "assignees": [], "milestone": null, "comments": 6, "created_at": "2023-02-15T10:25:14Z", "updated_at": "2023-02-17T06:30:10Z", "closed_at": "2023-02-16T14:08:28Z", "author_association": "CONTRIBUTOR", "sub_issues_summary": { "total": 0, "completed": 0, "percent_completed": 0 }, "active_lock_reason": null, "draft": false, "pull_request": { "url": "https://api.github.com/repos/laurent22/joplin/pulls/7778", "html_url": "https://github.com/laurent22/joplin/pull/7778", "diff_url": "https://github.com/laurent22/joplin/pull/7778.diff", "patch_url": "https://github.com/laurent22/joplin/pull/7778.patch", "merged_at": "2023-02-16T14:08:28Z" }, "body": "\r\n### Before : \r\n- When some text is selected and `Ctrl+X` cuts the selected text and writes the selected text to the clipboard, but it replaces the clipboard text with an empty string when nothing is selected. \r\n- In other editors, if nothing is selected and `Ctrl-X` is pressed, it either (1) does not change the clipboard, or (2) cuts the whole line and puts it in the clipboard.\r\n
\r\n\r\n\r\n### After :\r\n- when some text is selected\r\n - `Ctrl+X` cuts the selected text and writes the text to the clipboard\r\n- when nothing is selected\r\n - `Ctrl+X` cuts the entire line and writes it to the clipboard\r\n - Implementation details : \r\n - CodeMirror has a function `getCursor(n)` which returns the text string of line `n`\r\n - write the returned string to the clipboard using `clipboard.writeText(text)`\r\n - using `replaceRange(replacement: string, from: {line, ch}, to: {line, ch}, ?origin: string)` replace the current line with empty string\r\n \r\n
\r\n\r\n### Below a screen recording is attached \r\n[joplin-bug-fix-7662.webm](https://user-images.githubusercontent.com/88551650/219001408-461aaeac-d1f6-42d2-99c7-5f99f7fadf48.webm)\r\n\r\n\r\nFixes #7662 \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n", "closed_by": { "login": "laurent22", "id": 1285584, "node_id": "MDQ6VXNlcjEyODU1ODQ=", "avatar_url": "https://avatars.githubusercontent.com/u/1285584?v=4", "gravatar_id": "", "url": "https://api.github.com/users/laurent22", "html_url": "https://github.com/laurent22", "followers_url": "https://api.github.com/users/laurent22/followers", "following_url": "https://api.github.com/users/laurent22/following{/other_user}", "gists_url": "https://api.github.com/users/laurent22/gists{/gist_id}", "starred_url": "https://api.github.com/users/laurent22/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/laurent22/subscriptions", "organizations_url": "https://api.github.com/users/laurent22/orgs", "repos_url": "https://api.github.com/users/laurent22/repos", "events_url": "https://api.github.com/users/laurent22/events{/privacy}", "received_events_url": "https://api.github.com/users/laurent22/received_events", "type": "User", "user_view_type": "public", "site_admin": false }, "reactions": { "url": "https://api.github.com/repos/laurent22/joplin/issues/7778/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }, "timeline_url": "https://api.github.com/repos/laurent22/joplin/issues/7778/timeline", "performed_via_github_app": null, "state_reason": null }, "comments": [ { "url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1431094104", "html_url": "https://github.com/laurent22/joplin/pull/7778#issuecomment-1431094104", "issue_url": "https://api.github.com/repos/laurent22/joplin/issues/7778", "id": 1431094104, "node_id": "IC_kwDOBLftOs5VTMNY", "user": { "login": "github-actions[bot]", "id": 41898282, "node_id": "MDM6Qm90NDE4OTgyODI=", "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", "gravatar_id": "", "url": "https://api.github.com/users/github-actions%5Bbot%5D", "html_url": "https://github.com/apps/github-actions", "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", "type": "Bot", "user_view_type": "public", "site_admin": false }, "created_at": "2023-02-15T10:25:29Z", "updated_at": "2023-02-16T13:02:37Z", "author_association": "CONTRIBUTOR", "body": "****CLA Assistant Lite bot**** All contributors have signed the CLA ✍️ ✅", "reactions": { "url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1431094104/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }, "performed_via_github_app": null }, { "url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1431152843", "html_url": "https://github.com/laurent22/joplin/pull/7778#issuecomment-1431152843", "issue_url": "https://api.github.com/repos/laurent22/joplin/issues/7778", "id": 1431152843, "node_id": "IC_kwDOBLftOs5VTajL", "user": { "login": "melsonic", "id": 88551650, "node_id": "MDQ6VXNlcjg4NTUxNjUw", "avatar_url": "https://avatars.githubusercontent.com/u/88551650?v=4", "gravatar_id": "", "url": "https://api.github.com/users/melsonic", "html_url": "https://github.com/melsonic", "followers_url": "https://api.github.com/users/melsonic/followers", "following_url": "https://api.github.com/users/melsonic/following{/other_user}", "gists_url": "https://api.github.com/users/melsonic/gists{/gist_id}", "starred_url": "https://api.github.com/users/melsonic/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/melsonic/subscriptions", "organizations_url": "https://api.github.com/users/melsonic/orgs", "repos_url": "https://api.github.com/users/melsonic/repos", "events_url": "https://api.github.com/users/melsonic/events{/privacy}", "received_events_url": "https://api.github.com/users/melsonic/received_events", "type": "User", "user_view_type": "public", "site_admin": false }, "created_at": "2023-02-15T10:57:53Z", "updated_at": "2023-02-15T10:57:53Z", "author_association": "CONTRIBUTOR", "body": "I have read the CLA Document and I hereby sign the CLA", "reactions": { "url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1431152843/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }, "performed_via_github_app": null }, { "url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1432073329", "html_url": "https://github.com/laurent22/joplin/pull/7778#issuecomment-1432073329", "issue_url": "https://api.github.com/repos/laurent22/joplin/issues/7778", "id": 1432073329, "node_id": "IC_kwDOBLftOs5VW7Rx", "user": { "login": "laurent22", "id": 1285584, "node_id": "MDQ6VXNlcjEyODU1ODQ=", "avatar_url": "https://avatars.githubusercontent.com/u/1285584?v=4", "gravatar_id": "", "url": "https://api.github.com/users/laurent22", "html_url": "https://github.com/laurent22", "followers_url": "https://api.github.com/users/laurent22/followers", "following_url": "https://api.github.com/users/laurent22/following{/other_user}", "gists_url": "https://api.github.com/users/laurent22/gists{/gist_id}", "starred_url": "https://api.github.com/users/laurent22/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/laurent22/subscriptions", "organizations_url": "https://api.github.com/users/laurent22/orgs", "repos_url": "https://api.github.com/users/laurent22/repos", "events_url": "https://api.github.com/users/laurent22/events{/privacy}", "received_events_url": "https://api.github.com/users/laurent22/received_events", "type": "User", "user_view_type": "public", "site_admin": false }, "created_at": "2023-02-15T21:40:06Z", "updated_at": "2023-02-15T21:40:06Z", "author_association": "OWNER", "body": "recheck", "reactions": { "url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1432073329/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }, "performed_via_github_app": null }, { "url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1432757493", "html_url": "https://github.com/laurent22/joplin/pull/7778#issuecomment-1432757493", "issue_url": "https://api.github.com/repos/laurent22/joplin/issues/7778", "id": 1432757493, "node_id": "IC_kwDOBLftOs5VZiT1", "user": { "login": "laurent22", "id": 1285584, "node_id": "MDQ6VXNlcjEyODU1ODQ=", "avatar_url": "https://avatars.githubusercontent.com/u/1285584?v=4", "gravatar_id": "", "url": "https://api.github.com/users/laurent22", "html_url": "https://github.com/laurent22", "followers_url": "https://api.github.com/users/laurent22/followers", "following_url": "https://api.github.com/users/laurent22/following{/other_user}", "gists_url": "https://api.github.com/users/laurent22/gists{/gist_id}", "starred_url": "https://api.github.com/users/laurent22/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/laurent22/subscriptions", "organizations_url": "https://api.github.com/users/laurent22/orgs", "repos_url": "https://api.github.com/users/laurent22/repos", "events_url": "https://api.github.com/users/laurent22/events{/privacy}", "received_events_url": "https://api.github.com/users/laurent22/received_events", "type": "User", "user_view_type": "public", "site_admin": false }, "created_at": "2023-02-16T09:12:26Z", "updated_at": "2023-02-16T09:28:04Z", "author_association": "OWNER", "body": "Please remove all spacing changes. This should be applied via linter rules - and if the linter currently allows it, it should not be changed", "reactions": { "url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1432757493/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }, "performed_via_github_app": null }, { "url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1433058529", "html_url": "https://github.com/laurent22/joplin/pull/7778#issuecomment-1433058529", "issue_url": "https://api.github.com/repos/laurent22/joplin/issues/7778", "id": 1433058529, "node_id": "IC_kwDOBLftOs5Varzh", "user": { "login": "melsonic", "id": 88551650, "node_id": "MDQ6VXNlcjg4NTUxNjUw", "avatar_url": "https://avatars.githubusercontent.com/u/88551650?v=4", "gravatar_id": "", "url": "https://api.github.com/users/melsonic", "html_url": "https://github.com/melsonic", "followers_url": "https://api.github.com/users/melsonic/followers", "following_url": "https://api.github.com/users/melsonic/following{/other_user}", "gists_url": "https://api.github.com/users/melsonic/gists{/gist_id}", "starred_url": "https://api.github.com/users/melsonic/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/melsonic/subscriptions", "organizations_url": "https://api.github.com/users/melsonic/orgs", "repos_url": "https://api.github.com/users/melsonic/repos", "events_url": "https://api.github.com/users/melsonic/events{/privacy}", "received_events_url": "https://api.github.com/users/melsonic/received_events", "type": "User", "user_view_type": "public", "site_admin": false }, "created_at": "2023-02-16T13:04:36Z", "updated_at": "2023-02-16T13:04:36Z", "author_association": "CONTRIBUTOR", "body": "> Please remove all spacing changes. This should be applied via linter rules - and if the linter currently allows it, it should not be changed\r\n\r\nPlease check now @laurent22 ", "reactions": { "url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1433058529/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }, "performed_via_github_app": null }, { "url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1433086092", "html_url": "https://github.com/laurent22/joplin/pull/7778#issuecomment-1433086092", "issue_url": "https://api.github.com/repos/laurent22/joplin/issues/7778", "id": 1433086092, "node_id": "IC_kwDOBLftOs5VayiM", "user": { "login": "laurent22", "id": 1285584, "node_id": "MDQ6VXNlcjEyODU1ODQ=", "avatar_url": "https://avatars.githubusercontent.com/u/1285584?v=4", "gravatar_id": "", "url": "https://api.github.com/users/laurent22", "html_url": "https://github.com/laurent22", "followers_url": "https://api.github.com/users/laurent22/followers", "following_url": "https://api.github.com/users/laurent22/following{/other_user}", "gists_url": "https://api.github.com/users/laurent22/gists{/gist_id}", "starred_url": "https://api.github.com/users/laurent22/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/laurent22/subscriptions", "organizations_url": "https://api.github.com/users/laurent22/orgs", "repos_url": "https://api.github.com/users/laurent22/repos", "events_url": "https://api.github.com/users/laurent22/events{/privacy}", "received_events_url": "https://api.github.com/users/laurent22/received_events", "type": "User", "user_view_type": "public", "site_admin": false }, "created_at": "2023-02-16T13:25:31Z", "updated_at": "2023-02-16T13:25:49Z", "author_association": "OWNER", "body": "Ok that works well, thanks for implementing this @melsonic \r\n\r\nEdit: Let's wait till CI is done", "reactions": { "url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1433086092/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }, "performed_via_github_app": null } ] }