Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve default operation of ^D on macOS #9643

Closed
3 tasks done
qxj opened this issue Nov 13, 2023 · 14 comments
Closed
3 tasks done

Improve default operation of ^D on macOS #9643

qxj opened this issue Nov 13, 2023 · 14 comments
Assignees
Milestone

Comments

@qxj
Copy link

qxj commented Nov 13, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

macOS下编辑列表时候如果使用Ctrl-d,会导致如下<异常1>和<异常2>。

比如:

  • item1
  • item2
  • item3

此时,如果想删除item2,挪动光标到item1后,按Ctrl-d,此时列表变成如下形式,出现<异常1>的空白行

  • item1<光标>item2
  • <异常1>
  • item3

然后,在<光标>位置继续按回车,出现<异常2>列表没变化,item2也无法回到原来位置,并且 Cmd-z 也无法undo。

Expected result

如果光标位置Ctrl-d删除,再enter回车,列表能够复原。

  • item1<光标>
  • item2
  • item3

此时,按Ctrl-d

  • item1<光标>item2
  • item3

再按回车,列表复原

  • item1
  • item2
  • item3

Screenshot or screen recording presentation

No response

Version environment

- Version: v2.10.14
- Operating System: macOS 13.4
- Browser (if used):

Log file

编辑期间的log看起来没有异常

I 2023/11/13 09:43:07 repository.go:1253: synced data repo [kernel=3iyqj5p, provider=2, mode=a/false, ufc=0, dfc=1, ucc=0, dcc=0, ub=0 B, db=133 kB] in [0.70s], merge result [conflicts=0, upserts=0, removes=0]
I 2023/11/13 09:51:07 ref.go:49: got latest [46630350da0916e12b46d315eec05a7e049d2e4f, 2023-11-13 09:41:05]
I 2023/11/13 09:51:07 ref.go:49: got latest [46630350da0916e12b46d315eec05a7e049d2e4f, 2023-11-13 09:41:05]
I 2023/11/13 09:51:08 ref.go:49: got latest [46630350da0916e12b46d315eec05a7e049d2e4f, 2023-11-13 09:41:05]
I 2023/11/13 09:51:08 ref.go:49: got latest [46630350da0916e12b46d315eec05a7e049d2e4f, 2023-11-13 09:41:05]
I 2023/11/13 09:51:08 ref.go:49: got latest [46630350da0916e12b46d315eec05a7e049d2e4f, 2023-11-13 09:41:05]
I 2023/11/13 09:51:08 repository.go:1253: synced data repo [kernel=3iyqj5p, provider=2, mode=a/false, ufc=0, dfc=1, ucc=0, dcc=0, ub=0 B, db=133 kB] in [0.76s], merge result [conflicts=0, upserts=0, removes=0]
I 2023/11/13 09:55:05 index.go:133: rebuilt database for notebook [20210808180117-czj9bvb] in [0.89s], tree [count=64, size=1.2 MB]
W 2023/11/13 09:55:09 blocktree.go:532: save block tree [size=17 MB] to [/Users/qxj/SiYuan/temp/blocktree], elapsed [5.50s]
I 2023/11/13 09:55:11 index.go:206: resolved refs [32] in [5656ms]
I 2023/11/13 09:55:38 ref.go:49: got latest [46630350da0916e12b46d315eec05a7e049d2e4f, 2023-11-13 09:41:05]
I 2023/11/13 09:55:38 ref.go:49: got latest [46630350da0916e12b46d315eec05a7e049d2e4f, 2023-11-13 09:41:05]
I 2023/11/13 09:55:39 ref.go:49: got latest [46630350da0916e12b46d315eec05a7e049d2e4f, 2023-11-13 09:41:05]
I 2023/11/13 09:55:39 ref.go:49: got latest [46630350da0916e12b46d315eec05a7e049d2e4f, 2023-11-13 09:41:05]
I 2023/11/13 09:55:39 ref.go:49: got latest [46630350da0916e12b46d315eec05a7e049d2e4f, 2023-11-13 09:41:05]
I 2023/11/13 09:55:39 repository.go:1253: synced data repo [kernel=3iyqj5p, provider=2, mode=a/false, ufc=0, dfc=1, ucc=0, dcc=0, ub=0 B, db=133 kB] in [0.92s], merge result [conflicts=0, upserts=0, removes=0]

More information

No response

@88250
Copy link
Member

88250 commented Nov 13, 2023

你好,默认的 Ctrl+D 快捷键应该是重复块吧?

@qxj
Copy link
Author

qxj commented Nov 13, 2023

你好,默认的 Ctrl+D 快捷键应该是重复块吧?

我查了一下Ctrl-d没有绑定任何快捷键?而且我也没有修改过快捷键。
image

@qxj
Copy link
Author

qxj commented Nov 13, 2023

重复块是指“重复”吗?我看绑定在Cmd-d
image

@qxj
Copy link
Author

qxj commented Nov 14, 2023

打开开发者工具发现按完ctrl-d再回车,出现null报错,如下图 @88250
image

@88250
Copy link
Member

88250 commented Nov 14, 2023

收到,稍后 @Vanessa219 排查看看。

@Vanessa219
Copy link
Member

我对段落块操作是正常的,是有什么特殊的操作么?

QQ20231114-223148-HD.mp4

@qxj
Copy link
Author

qxj commented Nov 15, 2023

我对段落块操作是正常的,是有什么特殊的操作么?

不是段落块呢,我报的是列表块使用Ctrl-d后异常。 @Vanessa219

@Vanessa219
Copy link
Member

抱歉,按照正文 ctrl+D 的话,会重复块 1 ,并不会出现这个问题

  • item1<光标>item2
  • <异常1>
  • item3
QQ20231115-112339-HD.mp4

@qxj
Copy link
Author

qxj commented Nov 15, 2023

抱歉,按照正文 ctrl+D 的话,会重复块 1 ,并不会出现这个问题

请问录屏环境是Win还是Mac呢? @Vanessa219

你这里看起来是ctrl-d绑定了“重复”,但macOS“重复”默认是cmd-d,而ctrl-d是未绑定的,默认行为是delete。

duplicate: {default: "⌘D", custom: "⌘D"},

@Vanessa219
Copy link
Member

Vanessa219 commented Nov 15, 2023

哦,macOS 中 ⌃D 是等于 fn⌫,还是说有细微的差别?

那把 ⌃D 的实现同 fn⌫ 保持一致并禁止快捷键设置为 ⌃D 应该就可以解决这个问题了。

@qxj
Copy link
Author

qxj commented Nov 15, 2023

哦,macOS 中 ⌃D 是等于 fn⌫,还是说有细微的差别?

那把 ⌃D 的实现同 fn⌫ 保持一致并禁止快捷键设置为 ⌃D 应该就可以解决这个问题了。

没有太看懂,这是需要code fix吗?

^D的逻辑就是Delete one charactor,相当于Windows下按delete键。

@Vanessa219
Copy link
Member

^Dfn⌫ 是等价的功能,你可以在 item1 后试一下 fn⌫。后续修改的效果和 fn⌫ 一致。

按照以上修改的话,在快捷键设置中就无法将快捷键设置为 ^D 了。

@Vanessa219 Vanessa219 added this to the 2.10.16 milestone Nov 15, 2023
@Vanessa219 Vanessa219 changed the title macOS下编辑列表时,Ctrl-d 会导致列表异常 Improve default operation of ^D on the Mac Nov 15, 2023
@qxj
Copy link
Author

qxj commented Nov 15, 2023

^Dfn⌫ 是等价的功能,你可以在 item1 后试一下 fn⌫。后续修改的效果和 fn⌫ 一致。

按照以上修改的话,在快捷键设置中就无法将快捷键设置为 ^D 了。

理解了。不过我试了fn⌫也不太符合预期,不过至少不会报null错误了(打开开发者工具观察),先这么fix也行。

BTW:不太符合预期说明
image
fn⌫后:
image
预期结果是:
image
不过我目前没有Windows系统,回头我试试Windows下按Delete是不是也同样表现。

@Vanessa219
Copy link
Member

这个是为了和在 2 前面 保持一致。

Vanessa219 added a commit that referenced this issue Nov 15, 2023
@88250 88250 changed the title Improve default operation of ^D on the Mac Improve default operation of ^D on macOS Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants