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

改进注释相关功能 #718

Closed
Crystal-RainSlide opened this issue Sep 13, 2023 · 6 comments
Closed

改进注释相关功能 #718

Crystal-RainSlide opened this issue Sep 13, 2023 · 6 comments
Labels
✅enhancement 🌐i18n Localization/Internationalization ui
Milestone

Comments

@Crystal-RainSlide
Copy link

Crystal-RainSlide commented Sep 13, 2023

  1. 支持切换块注释:

    目前块注释只能添加,不能切换/去除,会影响下面功能的实现。

  2. 改进 CSS 的注释:

    虽然 Less 等二次语言支持使用 // 来进行单行注释,但 CSS 本身只支持形如 /* */ 的注释。所以,使用 Ctrl + / 在 CSS 文件中切换单行注释时,最好也能加上块注释 /* */,而不是只能用 Ctrl + Q 添加块注释。在实现上面一点之前,可以考虑先和 HTML 一样,(为 CSS)禁用行注释,只允许块注释;

    P.S. 对于不支持行注释(例如 CSS)或不支持块注释(例如批处理)的情况,可以考虑在用户按下有关快捷键时显示一个提示。用检测到二进制文件进入只读模式的那个小提示框应该就够了。

  3. 注释内外空格:

    建议新增设置项,允许设置是否应当加空格,来保证注释符前后为空白字符(空格或换行符)。这样更接近许多其他代码编辑器的行为。

@zufuliu
Copy link
Owner

zufuliu commented Sep 13, 2023

建议新增设置项,允许设置要不要通过加空格的方式

Space is added after #711.

@zufuliu
Copy link
Owner

zufuliu commented Sep 13, 2023

可以考虑先和 HTML 一样,(为 CSS)禁用行注释,只允许块注释;

Ctrl + / for standard CSS is disabled by 90dfbf8.

zufuliu added a commit that referenced this issue Sep 23, 2023
@zufuliu
Copy link
Owner

zufuliu commented Sep 23, 2023

建议新增设置项,允许设置要不要通过加空格的方式,来保证注释符前后为空白字符

baf1cc1 added option "Insert space after comment marker on toggle line comment." on Auto Completion Settings dialog.
Auto Completion Settings

@zufuliu zufuliu added 🌐i18n Localization/Internationalization ui labels Sep 24, 2023
@zufuliu zufuliu added this to the v4.23.11 milestone Sep 24, 2023
@zufuliu
Copy link
Owner

zufuliu commented Sep 25, 2023

支持切换块注释

Toggle block comment is implemented by 3e79284.

image

zufuliu added a commit that referenced this issue Sep 27, 2023
@zufuliu
Copy link
Owner

zufuliu commented Sep 27, 2023

使用 Ctrl + / 在 CSS 文件中切换单行注释时,最好也能加上块注释 /* */,而不是只能用 Ctrl + Q 添加块注释

Implemented by 3494f2e. since this commit, Ctrl + / and Ctrl + Q are interchangeable for scheme with only line comment or block comment, however currently only enabled for CSS, HTML, PHP and XML (where both menus are enabled), this matches Visual Studio Code. uncomment following lines would matches Sublime Text:

https://github.com/zufuliu/notepad2/blob/3494f2e39a208276e7b84e78cb0ccb5dcb22fb7c/src/Notepad2.c#L2562-L2563

@zufuliu
Copy link
Owner

zufuliu commented Oct 13, 2023

EditUncommentBlock() can be simplified when boost regex (#725) is used, .e.g. /\*.+?\*/ (non-greedy, with dot match all character include newline) would find current C++ comment block.

@zufuliu zufuliu closed this as completed Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅enhancement 🌐i18n Localization/Internationalization ui
Projects
None yet
Development

No branches or pull requests

2 participants