- Updated folding actions and engine for more consistent behavior. - Added helper function `is_fold_hidden()` to check fold visibility state. - Improved gutter renderer to handle collapsible code blocks more reliably. - Refined tag handling for invisible folds to prevent desync issues. - Removed code fold Fix related entry in `TODO.md`.
25 lines
541 B
Python
25 lines
541 B
Python
# Python imports
|
|
|
|
# Lib imports
|
|
|
|
# Application imports
|
|
|
|
|
|
|
|
def collapse_range(view, fold):
|
|
buffer = view.get_buffer()
|
|
start = buffer.get_iter_at_line(fold["start_line"] + 1)
|
|
end = buffer.get_iter_at_line(fold["end_line"] + 1)
|
|
|
|
buffer.apply_tag_by_name("invisible", start, end)
|
|
|
|
|
|
def expand_range(view, fold):
|
|
buffer = view.get_buffer()
|
|
start = buffer.get_iter_at_line(fold["start_line"] + 1)
|
|
end = buffer.get_iter_at_line(fold["end_line"] + 1)
|
|
|
|
buffer.remove_tag_by_name("invisible", start, end)
|
|
|
|
|