COBOL Lexer

All questions regarding lexer highlighting schemes are discussed here...
Paolo_R
Posts: 24
Joined: 23.01.2021 01:11

COBOL Lexer

Post by Paolo_R »

Is it possible to display vertical lines according to settings requested e.g. at columns 8, 12, 16, ... 72. This would help greatly in formatting COBOL code.
Shovel
Posts: 141
Joined: 31.12.2019 10:16

Post by Shovel »

I'm not familiar with COBOL...
But if this is what you want, you can set option "margin_string" to "8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72" for COBOL lexer.
uvviewsoft
Posts: 392
Joined: 01.12.2020 13:46

Post by uvviewsoft »

yes, "margin_string".
we have 2 lexers: Cobol and Acu_Cobol, I don't recall what is the difference.
Paolo_R
Posts: 24
Joined: 23.01.2021 01:11

Post by Paolo_R »

Shovel wrote:I'm not familiar with COBOL...
But if this is what you want, you can set option "margin_string" to "8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72" for COBOL lexer.
OK, thanks. How do I edit the COBOL lexer? According to the WIki I have to install SynWrite. Is that correct?
Paolo_R
Posts: 24
Joined: 23.01.2021 01:11

Post by Paolo_R »

uvviewsoft wrote:yes, "margin_string".
we have 2 lexers: Cobol and Acu_Cobol, I don't recall what is the difference.
Acu-Cobol is a particular dialect of Cobol i.e. with non-standard extensions.
Shovel
Posts: 141
Joined: 31.12.2019 10:16

Post by Shovel »

Paolo_R wrote:OK, thanks. How do I edit the COBOL lexer? According to the WIki I have to install SynWrite. Is that correct?
No SynWrite.
In CudaText main menu open "Plugins > Options Editor...", here when you check "For Lexer", changed options will only apply to the Lexer specified below.
Last edited by Shovel on 24.01.2021 07:20, edited 2 times in total.
Paolo_R
Posts: 24
Joined: 23.01.2021 01:11

Post by Paolo_R »

OK, I've found margin_string but there seems no way to make a change, or in this case, to add a list of margins. I can't add changed margins to that option.
Shovel
Posts: 141
Joined: 31.12.2019 10:16

Post by Shovel »

On this screenshot I have it for ini lexer.
Paolo_R
Posts: 24
Joined: 23.01.2021 01:11

Post by Paolo_R »

Well I have made changes exactly as your screen shot showed but the margin lines do not show up when I open a .CBL file.
Shovel
Posts: 141
Joined: 31.12.2019 10:16

Post by Shovel »

When you have file open with COBOL lexer active, open menu "Options > Settings - Lexer Specific", and check that there is a line present:

Code: Select all

"margin_string": "8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72",
If it is there, but it is still doesn't work - maybe try restarting the editor.
Post Reply