Skip to content

Commit 2643723

Browse files
committed
After using the shortcut key to switch comments, move the cursor to the next line. #442
1 parent b5fa79a commit 2643723

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/renderer/components/Editor/HostsEditor.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ const HostsEditor = (props: Props) => {
8787
const toggleComment = () => {
8888
if (is_read_only || !cm_editor) return
8989
cm_editor.toggleComment()
90+
91+
// 光标移到下一行
92+
let cursor = cm_editor.getCursor()
93+
cursor.line += 1
94+
cm_editor.setCursor(cursor)
9095
}
9196

9297
const onGutterClick = (n: number) => {

0 commit comments

Comments
 (0)