diff options
author | 2020-08-03 18:59:42 -0400 | |
---|---|---|
committer | 2020-08-03 18:59:42 -0400 | |
commit | b1605586b4635d60d5ccf4283a7268db5d1b99fe (patch) | |
tree | e4c496bce23a44f1b879b8320ff41e98ba8a2fb7 /test | |
parent | bfb36db59c432f18c9516d7307dc18ff987aa8e0 (diff) | |
download | textadept-b1605586b4635d60d5ccf4283a7268db5d1b99fe.tar.gz textadept-b1605586b4635d60d5ccf4283a7268db5d1b99fe.zip |
Updated to latest Scintilla hg to get `lexer.fold_consecutive_lines()`.
Diffstat (limited to 'test')
-rw-r--r-- | test/test.lua | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/test.lua b/test/test.lua index 68125dd7..2519414f 100644 --- a/test/test.lua +++ b/test/test.lua @@ -3271,6 +3271,38 @@ function test_lexer_fold_properties() assert_equal(view.property['fold'], '0') end +function test_lexer_fold_line_groups() + local fold_line_groups = lexer.fold_line_groups + buffer.new() + buffer:add_text[[ + package foo; + + import bar; + import baz; + import quux; + // comment + // comment + // comment + + public class Foo {} + ]] + buffer:set_lexer('java') + lexer.fold_line_groups = false + buffer:colorize(1, -1) + assert(buffer.fold_level[3] & lexer.FOLD_HEADER == 0, 'import is a fold point') + assert(buffer.fold_level[6] & lexer.FOLD_HEADER == 0, 'line comment is a fold point') + lexer.fold_line_groups = true + buffer:colorize(1, -1) + assert(buffer.fold_level[3] & lexer.FOLD_HEADER > 0, 'import is not a fold point') + assert(buffer.fold_level[6] & lexer.FOLD_HEADER > 0, 'line comment is not a fold point') + view:toggle_fold(3) + for i = 4, 5 do assert(not view.line_visible[i], 'line %i is visible', i) end + view:toggle_fold(6) + for i = 7, 8 do assert(not view.line_visible[i], 'line %i is visible', i) end + buffer:close(true) + lexer.fold_line_groups = fold_line_groups -- restore +end + -- TODO: test init.lua's buffer settings function test_ctags() |