diff options
| author | Luiz Paulo de Vasconcellos | 2016-04-04 02:31:39 -0300 |
|---|---|---|
| committer | Rémi Verschelde | 2016-04-06 18:47:18 +0200 |
| commit | 44daccc86114bffdfc0ef6bfee287376113ac937 (patch) | |
| tree | b4ec5f7a8a10bb3601a92a33b3a1f111aed2b031 /tools/editor/plugins/script_editor_plugin.cpp | |
| parent | 4220ffbd8ef2d7b493cb39f1e3f574bfcfe9de7a (diff) | |
| download | godot-44daccc86114bffdfc0ef6bfee287376113ac937.tar.gz godot-44daccc86114bffdfc0ef6bfee287376113ac937.tar.zst godot-44daccc86114bffdfc0ef6bfee287376113ac937.zip | |
Change toggle comment behaviour. Fixes #4198
(cherry picked from commit 1b6f14d81047b563283fb66022701f03d5bd9ca1)
Diffstat (limited to 'tools/editor/plugins/script_editor_plugin.cpp')
| -rw-r--r-- | tools/editor/plugins/script_editor_plugin.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index f8aa83670..51718bd9d 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -1257,6 +1257,11 @@ void ScriptEditor::_menu_option(int p_option) { { int begin = tx->get_selection_from_line(); int end = tx->get_selection_to_line(); + + // End of selection ends on the first column of the last line, ignore it. + if(tx->get_selection_to_column() == 0) + end -= 1; + for (int i = begin; i <= end; i++) { String line_text = tx->get_line(i); |
