0

I am using Notepad++ to program in Julia. I am using a custom userdefined template in order to highlight certain syntax as well as fold certain code blocks. In particular, I am using the "Folding in code 2 style (separators needed):" box, which is found within the User Defined Language dialog.

I have defined the following open statements: begin function type for while if.

I have defined the following middle statements: else

I have defined the following close statements: end

My problem: I have a variable named T_end. Normally, using code2 style prevents false positives arising from instances of the word within other words (such as a variable named endx). However, the underscore does not seem to be treated the same way, which makes any variable containing "_end" trigger a the end of the folding block, which is undesired behavior.

Likewise, I have instances where I use a Julia feature whereby the index "end" automatically refers to the last element of an array. For example:

julia> Sample = Array(1:7)
julia> Sample[end]
 7
julia> Sample[5:end]
3-element Array{Int64,1}:
 5
 6
 7

This usage of the word 'end' also triggers Notepad++ to believe it has reached the end of the code block. I want to remove these spurious close statements in order to make my program easier to read in Notepad++. Ideally, I'd be able to define exceptions to the close statement list so that the word "end" signifies the end of a code block EXCEPT when preceded by "_", "[" or ":"

0 Answers0