diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-04-21 13:01:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-21 13:01:43 +0200 |
commit | 71bbe6eb01d1664340ea624aca36aa47c693981d (patch) | |
tree | 7fab2ac8f65a8d3190d4255d1ba22cbb52a8697f /scene/gui | |
parent | 7879968136828a6b98daab9ee4e8897eb8c26048 (diff) | |
parent | 6ea253aa776e03dc7174b289c6747cd8d0410245 (diff) |
Merge pull request #27979 from Paulb23/remember_script_state
Restore script editor state between sessions
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/text_edit.cpp | 11 | ||||
-rw-r--r-- | scene/gui/text_edit.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 39a0b0aaf2..d06f066295 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -5189,6 +5189,17 @@ bool TextEdit::is_folded(int p_line) const { return false; } +Vector<int> TextEdit::get_folded_lines() const { + Vector<int> folded_lines; + + for (int i = 0; i < text.size(); i++) { + if (is_folded(i)) { + folded_lines.push_back(i); + } + } + return folded_lines; +} + void TextEdit::fold_line(int p_line) { ERR_FAIL_INDEX(p_line, text.size()); diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 96b409c6d4..503bead785 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -490,6 +490,7 @@ public: bool can_fold(int p_line) const; bool is_folded(int p_line) const; + Vector<int> get_folded_lines() const; void fold_line(int p_line); void unfold_line(int p_line); void toggle_fold_line(int p_line); |