Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Teach Notepad++ to fold new multiline comment (R)

Tags:

r

notepad++

Can I teach Notepad++ that it should apply a fold whenever it sees a multi-line comment, where comments start with the hash mark and multi-line comments are hash marks on consecutive lines?

# This is a comment
# It continues on the next line
# and the next
# I want to fold this block

Edit
I submitted a fix to the R lexer to support multi-line comments. It includes the fix to source as well as a compiled SciLexer.dll for those who are eager to use this feature. Simply replace SciLexer.dll in the NPP folder with the one attached to the bug:
https://sourceforge.net/tracker/?func=detail&aid=3485870&group_id=95717&atid=612385

like image 654
SFun28 Avatar asked Jan 28 '12 14:01

SFun28


1 Answers

I've tested your multi-line comment with notepad++ 5.9.8 and it correctly fold as a single entity as long as there is a non-comment line between the comment groups and that the language selected has comments starting with '#' (eg: sh).

EDIT:

This seem to be language specific.

I've looked at the xml files that configure the behavior of notepad++ and it seem that this mechanic is hardcoded inside the program.

EDIT2:

The author of the question has just added comment folding support for the R languange!

like image 127
Gigi Avatar answered Nov 06 '22 22:11

Gigi