Commit graph

110 commits

Author SHA1 Message Date
kobewi
5906d6de8e Fix line folding with multiple carets 2023-02-21 21:28:26 +01:00
Paulb23
a197d6ef4e Support editing JSON in ScriptEditor 2023-01-28 16:06:13 +00:00
kobewi
59ea36b87c Remove set_drag_forwarding_compat() 2023-01-14 15:16:51 +01:00
Juan Linietsky
e6a4debede Change set_drag_forwarding() to use callables.
* This solution is much cleaner than the one in 3.x thanks to the use of callables.
* Works without issues in any language (no need to worry about camel or snake case).
* Editor code uses a compatibility function (too much work to redo).

Fixes #59899
2023-01-10 14:09:24 +01:00
Rémi Verschelde
d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
VolTer
94416e41c5 Fix various fringe issues with multi-carets and selections 2022-12-07 20:54:48 +01:00
trollodel
c90d0bd84f Use forward-declarations in big editor classes 2022-11-29 09:59:43 +01:00
Rémi Verschelde
5947f22be9
Merge pull request #67578 from KoBeWi/GEDITOR
Unify usage of GLOBAL/EDITOR_GET
2022-10-31 13:15:58 +01:00
Eric M
d499071e5b Set the shortcut context for the edit/search/goto menus to the ScriptEditor so that shortcuts continue to work when FindReplaceBar is focused. 2022-10-25 19:52:42 +10:00
kobewi
e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
Rémi Verschelde
f5903215d0 Merge pull request #61902 from Paulb23/multi-caret
Add Multi-caret support to TextEdit
2022-10-06 08:56:34 +02:00
Paulb23
0cbe176ce6 Add multi caret support to Editor 2022-10-05 17:19:26 +01:00
Rémi Verschelde
121e1df55b Merge pull request #66300 from KoBeWi/📝🧭
Split script navigation state and edit state
2022-10-05 08:30:49 +02:00
Rindbee
72a7d874b4 Fix the flickering of the line gutter icon when saving 2022-10-03 19:19:28 +08:00
VolTer
ded10214bf Rename Indent Left/Right to Indent/Dedent 2022-09-29 14:42:46 +02:00
kobewi
14435ebcee Split script navigation state and edit state 2022-09-25 23:06:39 +02:00
Micky
e31bb5ffeb Rename CanvasItem.update() to queue_redraw()
Affects a lot of classes. Very thoroughly checked signal connections and deferred calls to this method, add_do_method/add_undo_method calls, and so on.

Also renames the internal `_update_callback()` to `_redraw_callback()` for consistency.

Just a few comments have also been changed to say "redraw".

In CPUParticles2D, there was a private variable with the same name. It has been renamed to `do_redraw`.
2022-08-29 14:59:47 +02:00
kobewi
8be27dc59e Replace Array return types with TypedArray 2022-08-22 22:42:36 +02:00
Yuri Sizov
9f55bd971e Extract EditorResourceConversionPlugin into its own source files and clean up editor includes 2022-07-31 21:14:15 +03:00
Juan Linietsky
d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
FireForge
97dfbea6ad Rename Control PRESET_WIDE to PRESET_FULL_RECT 2022-07-18 20:08:11 -05:00
reduz
746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
Hugo Locurcio
180e5d3028
Remove RES and REF typedefs in favor of spelled out Ref<>
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00
kobewi
42078dec9f Allow negative indexes in ItemList and PopupMenu 2022-03-12 01:14:03 +01:00
Rémi Verschelde
fc076ece3d
Revert "Add missing SNAME macro optimization to all theme methods call"
This reverts commit a988fad9a0.

As discussed in #57725 and clarified in #57788, `SNAME` is not meant to be used
everywhere but only in critical code paths. For theme methods specifically, it
was by design that only getters use `SNAME` and not setters.
2022-02-08 10:17:25 +01:00
jmb462
a988fad9a0 Add missing SNAME macro optimization to all theme methods call 2022-02-06 23:06:11 +01:00
Paulb23
f43f68f605 Convert TextEdit callbacks to Callable 2022-01-19 17:26:22 +00:00
Rémi Verschelde
fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Nathan Franke
49403cbfa0
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
jmb462
81efebb3a1
Fix bad popups offset in editor with single window off
Co-authored-by: Gil Arasa Verge <gilarasaverge@gmail.com>
Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
2021-12-06 14:29:48 +01:00
Yuri Roubinsky
eabf8f5edf Added reset_size method to Control and Window classes 2021-11-22 16:55:21 +03:00
Aaron Franke
3c0fdcc8ac
Use "enum class" for input enums 2021-11-12 15:37:54 -06:00
kobewi
134e4d168b Improve save handling for built-in scripts 2021-11-07 23:51:12 +01:00
kobewi
e393c2a734 Add is_built_in() method to Resource 2021-11-04 12:45:58 +01:00
Paulb23
3010bca41b Move add_syntax_highlighter bind to ScriptEditorBase 2021-10-11 18:13:31 +01:00
Yuri Roubinsky
1dda47c280 Added status bar and toggle scripts panel button to EditorHelp/VScripts 2021-09-15 11:35:03 +03:00
Haoyu Qiu
16c2d4ef22 Improve Undo/Redo menu items
* Make Undo/Redo menu items disabled when clicking it does nothing.
    * Context menu of `TextEdit`
    * Context menu of `LineEdit`
    * Editor's Scene menu
    * Script editor's Edit menu and context menu (for Script and Text)
* Make editor undo/redo log messages translatable.
* Mark `UndoRedo`'s `has_{un,re}do()` methods as `const`.
* Expose `TextEdit`'s `has_{un,re}do()` to scripts since `{un,re}do()` are already available.
2021-08-17 21:11:10 +08:00
Paulb23
bcfc591f86 Reorganise text editor settings 2021-08-16 17:18:49 +01:00
Paulb23
ae4dcb8918 Cleanup and bind remaing methods in TextEdit 2021-08-12 11:43:35 +01:00
Paulb23
b700011314 Protect internal CodeEdit --> TextEdit API 2021-08-12 09:29:58 +01:00
Paulb23
9ec3e7f3d7 Cleanup TextEdit selection methods 2021-08-12 09:29:56 +01:00
Paulb23
d5dcaee4c5 Cleanup and rename caret operations 2021-08-12 09:29:13 +01:00
reduz
6631f66c2a Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname.
* Subsequent usages use the cached version.
* Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time.
* Replaced all theme usages by this new macro.
* Replace all signal emission usages by this new macro.
* Replace all call_deferred usages by this new macro.

This is part of ongoing work to optimize GUI and the editor.
2021-07-18 21:20:02 -03:00
Rémi Verschelde
d41f4aca77
Script editor: Rename 'Clone Down' to 'Duplicate Selection'
Fixes #36670.
2021-06-29 12:14:24 +02:00
Paulb23
1a0cfc219b Move indent management to CodeEdit 2021-06-20 20:00:54 +01:00
Lightning_A
e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
Rémi Verschelde
341cb8da31
Merge pull request #49238 from Paulb23/code_edit_code_folding
Move code folding into CodeEdit and hide line hiding API
2021-06-16 20:11:39 +02:00
Rémi Verschelde
58c1235111
Merge pull request #49265 from KoBeWi/keepfreplace_2_keepers_of_replace
Move FindReplaceBar out of CodeTextEditor
2021-06-09 21:07:27 +02:00
kobewi
da6aebeb4c Move FindReplaceBar out of CodeTextEditor 2021-06-08 23:23:07 +02:00
Paulb23
d4c165d8c7 Fix TextEditor redo shortcut typo 2021-06-08 17:41:35 +01:00