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

希望能够提供一个api,设置文档光标位置 #659

Open
wusanmao23333 opened this issue Jun 23, 2024 · 2 comments
Open

希望能够提供一个api,设置文档光标位置 #659

wusanmao23333 opened this issue Jun 23, 2024 · 2 comments

Comments

@wusanmao23333
Copy link

What problem does this feature solve?

扩展使用自定义 markdown 插件, 文档失去焦点,找不到光标所在位置,直接继续回车会报错。希望执行完自定义插件之后,调用api, 能够聚焦,继续编辑。

What does the proposed API look like?

api可以设置光标具体的位置,开始位置,结尾位置,或者其他,默认为结尾的位置。

@Hufe921
Copy link
Owner

Hufe921 commented Jun 24, 2024

你写的这个插件是将markdown转成编辑器的数据结构,然后插入编辑器吗

@wusanmao23333
Copy link
Author

我是在编辑文档回车的时候,获取到文档 main 的数据,使用正则生成文档渲染的数据格式,在数据都处理好了之后,使用 executeSetValue 命令,重新渲染文档。不知道这个方案是否合适,是想模拟 markdown 编辑的方式,实时编辑文档实时渲染,或者您有什么更好的实现方案?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants