Skip to content

cpp lexer adjustments #111

Answered by orbitalquark
snoopy asked this question in Q&A
May 7, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

To match 'std::' but not highlight it, you could do something like this:

lex:tag(lexer.DEFAULT, 'std::') * lex:tag(lexer.TYPE .. '.stl', lex:word_match(lexer.TYPE .. '.stl'))

For the related question, maybe

lex:add_rule('custom_type', lex:tag(lexer.DEFAULT, '::') * lex:tag(lexer.TYPE .. '.custom', lexer.word * -S('(:')))

? I'm not sure I understand exactly what you're trying to do.

You can highlight angle braces using lexer.property['scintillua.angle.braces'] = '1' as you've found. You can disable auto-pairing by adding to your ~/.textadept/init.lua:

events.connect(events.LEXER_LOADED, function(lang)
  if lang == 'cpp' then textadept.editing.auto_pairs['<'] = nil end
end

(Basically, ov…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@snoopy
Comment options

Answer selected by snoopy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants