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

能不能增加大纲功能? #298

Open
harvey-git opened this issue Oct 18, 2019 · 13 comments
Open

能不能增加大纲功能? #298

harvey-git opened this issue Oct 18, 2019 · 13 comments

Comments

@harvey-git
Copy link

Please provide the following information

Madedit-Mod version (or branch):
MadEdit-Mod 0.4.17
platform/architecture:
Ubuntu/x86_x64
compiler and compiler version:
GCC 7.3.0 wxWidgets 3.0.4 build 13:27:40 Jul 20 2019
please describe what symptom you see, what you would expect to see instead and how to reproduce it.
如题,希望能有个大纲栏,然后文字内容按顶格或缩进的不同自动把顶格那行作为大纲显示出来,这样编辑内容时可以迅速通过点击大纲定位。当前的只能通过搜索功能近似达到类似效果,然而最近发现搜索输出浮动窗口不知道啥情况,偶尔会莫名其妙得消失,而且如果中间编辑过搜索出的内容,再点击搜索栏之前的定位就无效了。
ps能不能把linux版改回使用0.4.16內建wxWidgets的版本,0.4.17的外置wxWidgets版本界面性能太差了!最恼火的就是大于100k的文件用鼠标选择一段文本时,要么卡住,要么选择区域乱飞,要么变成拖动选择区域文字乱飞。

@gli-spirent
Copy link
Contributor

”如果中间编辑过搜索出的内容,再点击搜索栏之前的定位就无效了“这个搜索定位其实实现的挺原始的,只是存了snapshot的静态位置,所以你更新文档后就失效了。目前没有什么好的思路去解决这个问题,如果随着编辑更新会影响性能,可能会产生卡顿效果。

我还真不知道”外置wxWidgets版本界面“会有这些问题。之所以改成外置是因为跟wxWdigets官方论坛一些老鸟们讨论跨平台编译的时候,这些人说内置的可能导致一些库冲突,而且我在FreeBSD上遇到了这个问题,就改了。你遇到的问题我怀疑是wxWdigets 3.0的问题,内置的用的是wxWidets 3.1.2。

大纲的问题也是一个老问题,跟搜索定位类似,没想好怎么解决,也许有一天有好办法了,或者你发现什么开源的能做得好让我来借鉴一下,两个能一起解决

@harvey-git
Copy link
Author

感谢提醒,我刚刚将ubuntu的内置wxWdigets3.0,升级到了https://www.wxwidgets.org/downloads/提供的 3.1版本,果然界面性能问题(包括鼠标乱跳)的问题消失了。再次感谢。

@harvey-git
Copy link
Author

关于支持大纲功能的开源项目,我觉得这个你可能用得上:https://github.com/aleray/mdx_outline
我发现绝大多数支持大纲的功能都是用markdown解析器来完成的!

@LiMinggang
Copy link
Owner

你这找错方向了,这倒无所谓。你找的这个是静态生成大纲的,其实跟madedit搜索结果是一回事,这个东西主要难点在于动态更新

@harvey-git
Copy link
Author

那这个呢?https://github.com/typora ,这个app的的大纲功能其实也能满足我在linux下的编辑需求,然而这玩意儿编辑大于1m的文件会报错,没有宏支持,中文编码支持也怪怪的。

@gli-spirent
Copy link
Contributor

gli-spirent commented Oct 21, 2019

闭源的?没看到代码

@harvey-git
Copy link
Author

harvey-git commented Oct 21, 2019

重新反馈一下,我在将4.17的 wxWdigets3.0升级到 [wxWdigets3.1,编辑txt文件界面卡顿的情况大大好转(并没有完全消失),然而我发现在编辑录制好的宏文件时,短短四十多行的宏文件直接导致整个编辑器的界面卡得死去活来的,我几乎完全没法在madedit里面手动修改这个录制好的宏文件,只要这个宏文件
清理空行.zip

处于打开编辑状态,我在其他标签的编辑的txt文件也会变得卡顿起来,以下是我的录制的宏文件内容:

####====Todo:Add some help string for this====
#Use ####! as the prefix of the hotkey, eg ####!Ctrl-Shift-1 Ctrl, Shift, Alt are keys
#Create MadEdit Object for active edit
medit = MadEdit()
medit.DeleteEmptyLines()
medit.DeleteEmptyLinesWithSpaces()
medit.TrimTrailingSpaces()
medit.ConvertEncoding("GB18030",MadConvertEncodingFlag.TC2SC)
medit.ReplaceTextAll("\r\n", "\n", True, False, False)
medit.ReplaceTextAll("\n\n", "\n", True, False, False)
medit.ReplaceTextAll("1.","⒈", False, False, False, False, -1)
medit.ReplaceTextAll("2.","⒉", False, False, False, False, -1)
medit.ReplaceTextAll("3.","⒊", False, False, False, False, -1)
medit.ReplaceTextAll("4.","⒋", False, False, False, False, -1)
medit.ReplaceTextAll("5.","⒌", False, False, False, False, -1)
medit.ReplaceTextAll("6.","⒍", False, False, False, False, -1)
medit.ReplaceTextAll("7.","⒎", False, False, False, False, -1)
medit.ReplaceTextAll("8.","⒏", False, False, False, False, -1)
medit.ReplaceTextAll("9.","⒐", False, False, False, False, -1)
medit.ReplaceTextAll("10.","⒑", False, False, False, False, -1)
medit.ReplaceTextAll("1","1", False, False, False, False, -1)
medit.ReplaceTextAll("2","2", False, False, False, False, -1)
medit.ReplaceTextAll("3","3", False, False, False, False, -1)
medit.ReplaceTextAll("4","4", False, False, False, False, -1)
medit.ReplaceTextAll("5","5", False, False, False, False, -1)
medit.ReplaceTextAll("6","6", False, False, False, False, -1)
medit.ReplaceTextAll("7","7", False, False, False, False, -1)
medit.ReplaceTextAll("8","8", False, False, False, False, -1)
medit.ReplaceTextAll("9","9", False, False, False, False, -1)
medit.ReplaceTextAll("0","0", False, False, False, False, -1)
medit.ReplaceTextAll("笫","第", False, False, False, False, -1)
medit.ReplaceTextAll("...","…", False, False, False, False, -1)
medit.ReplaceTextAll("..","…", False, False, False, False, -1)
medit.ReplaceTextAll("….","…", False, False, False, False, -1)
medit.ReplaceTextAll("•","·", False, False, False, False, -1)
medit.ReplaceTextAll("[..]","。", True, True, False, False, -1)
medit.ReplaceTextAll(",",",", False, False, False, False, -1)
medit.ReplaceTextAll("?","?", False, False, False, False, -1)
medit.ReplaceTextAll("!","!", False, False, False, False, -1)
medit.ReplaceTextAll(";",";", False, False, False, False, -1)
medit.ReplaceTextAll("(^[  ]{2,})"," ", False, False, False, False, -1)
#medit.ReplaceTextAll("(“[^“”]+)(\n)","$1", True, True, False, False, -1)
#medit.ReplaceTextAll("([^。”…!?】)\)\!\?\,\"\*])(\n)","$1", True, True, False, False, -1)
#medit.ReplaceTextAll("(# 【[^】【]+】)","\n$1\n\t", True, True, False, False, -1)

@LiMinggang
Copy link
Owner

额,这个问题确实比较难办,在下个版本恢复使用自编译版本吧

@gli-spirent
Copy link
Contributor

你用的ubuntu是什么版本,我用18.04似乎没有。

@harvey-git
Copy link
Author

你用的ubuntu是什么版本,我用18.04似乎没有。

为了最新的wxWidgets,我把ubuntu升级到19.04昨天前几天升级到19.10了!

@LiMinggang
Copy link
Owner

我发布的这个是在18.04上编译的

@ljhwycxbb
Copy link

你这找错方向了,这倒无所谓。你找的这个是静态生成大纲的,其实跟madedit搜索结果是一回事,这个东西主要难点在于动态更新

老大 先弄就静态的也行呀。看代码的时候好用呀

@LiMinggang
Copy link
Owner

这个不是MadEdit的强项啊,做一个很鸡肋的功能还不如你们用更高级的IDE去浏览代码。

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

4 participants