Commit graph

92 commits

Author SHA1 Message Date
Aiden Storey b4c1634b52 Implement trim_final_newlines functionality 2024-05-02 22:57:34 -04:00
kit 773a473807 Overhaul multiple caret editing in TextEdit.
Use a multicaret edit to delay merging overlapping carets until the end.
2024-04-26 14:26:10 -04:00
kobewi 3a1246c198 Store line change in script navigation history 2024-04-25 23:22:47 +02:00
Haoyu Qiu bafbdc6cb2 Improve search/replace bar behavior
- When multiple lines are selected:
  - Find: Keep previous search instead of putting those lines in the
    find input.
  - Replace: Focus find input instead of replace input.
- Add placeholder and tooltip for LineEdits and icon buttons.
- Disable related buttons when the operation makes no sense.
2024-04-10 10:10:17 +08:00
VolTer de8b6f7a3c Add editor settings for autocompletion with NodePath and StringName 2024-03-19 17:23:54 +02:00
Zi Ye 9281c441f6 Improved text editor status bar and zooming UX. 2024-02-21 17:33:16 -06:00
Brian MacIntosh 0d7db935aa Search terms are now highlighted when the bar opens with a selection.
This is achieved by triggering a search when the bar opens. This is slightly inefficient but cleanly updates everything that's dependent on the search and reduces code duplication.
2023-10-30 10:21:25 -07:00
kobewi c09a43abd7 Fix FindReplaceBar focus problems 2023-10-16 11:12:49 +02:00
Danil Alexeev de7cbe8789
Highlight doc comments in a different color 2023-10-08 19:26:10 +03:00
quinnyo 68c24f9993 Add code_complete_enabled code editor setting 2023-06-21 02:51:05 +10:00
Paulb23 0b3fba45c6 Move convert_indent into CodeEdit 2023-05-07 13:08:37 +01:00
aXu-AP bdfb10fb98 Rework code editor multiline operations
Fix bugs if 2 selections were on same line.
Fix bugs when selection ended at new line.
Make carets stay in place after operation and on undo.

Affects: delete lines, move lines, toggle comments, bookmarks and breakpoints.
2023-02-12 20:53:49 +02: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
Alfred Reinold Baudisch 02f7e03a66 Cancels the code complete timer when the caret moves to another line
Fixes and closes #68961
2022-12-06 12:45:25 +01:00
Rindbee ff0de4e220 Fix some bugs about search in code editor
1. Fix #61713;
2. Fix the bug when there are consecutive matches, forward searching will skip the adjacent item;
3. Fix the bug that enable the selection-only option will affect the operations in search mode.
2022-10-11 18:15:32 +08: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
kobewi 14435ebcee Split script navigation state and edit state 2022-09-25 23:06:39 +02:00
Yuri Roubinsky 7b94603baa Adding shader preprocessor support
Co-authored-by: TheOrangeDay <6472143+TheOrangeDay@users.noreply.github.com>
2022-07-22 22:51:57 +02:00
Rémi Verschelde c273ddc3ee Style: Partially apply clang-tidy's cppcoreguidelines-pro-type-member-init
Didn't commit all the changes where it wants to initialize a struct
with `{}`. Should be reviewed in a separate PR.

Option `IgnoreArrays` enabled for now to be conservative, can be
disabled to see if it proposes more useful changes.

Also fixed manually a handful of other missing initializations / moved
some from constructors.
2022-05-02 16:28:25 +02:00
Oğuzhan Eroğlu 77a78cb4ad Indicate code editor search match number 2022-04-27 15:21:28 +03:00
Rémi Verschelde f8ab79e68a Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been
assigned something valid by comparing to nullptr.
2022-04-04 19:49:50 +02:00
reduz 360dea5348 Add GDExtension support to Script
* Ability to create script languages from GDExtension
* Some additions to gdnative_extension.h to make this happen
* Moved the GDExtension binder to core

This now allows creating scripting languages from GDExtension, with the same ease as if it was a module. It replaces the old PluginScript from Godot 3.x.
Warning: GodotCPP will need to be updated to support this (it may be a bit of work as ScriptInstance needs to be created over there again).
2022-03-27 16:13:00 +02:00
Aaron Franke 918b09cabc
Initialize bools in the headers in editor 2022-03-12 13:34:06 -06:00
jmb462 dcd2a92af3 Port existing _notification code to use switch statements (part 1/3) 2022-02-16 11:38:24 +01:00
Rémi Verschelde 11572c6e30
Editor: Cleanup some includes dependencies
Removes some unnecessary includes from `editor_node.h`, and instead add
those where they're used.

Removes unnecessary `editor_node.h` includes in various editor classes.

Renames `dynamicfont` to `dynamic_font` in a couple files.

Misc cleanup while jumping through that rabbit hole.
2022-02-15 14:54:15 +01: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
Marcel Admiraal 87a4ba492e Remove unimplemented methods 2021-10-21 18:44:25 +01:00
Gordon MacPherson 1881b3adc5
Improve GDScript Editor and Improve latency
Improvements:
- GDScript Highlighter is faster by 25% as keys are smaller (hashes instead of strings)
- Removes message queue from _apply_settings_change to allow resize to work correctly
- Some performance fixes are pending still

Note: this resolves the code editor behaving badly when resizing in debug builds
2021-09-21 13:56:47 +02:00
reduz 5cecdfa8af Entirely removes BIND_VMETHOD in favor of GDVIRTUAL
* `_gui_input`, `_input`, `_unhandled_input` and `_unhandled_key_input` are now regular C++ virutal functions.
* Everything else converted to GDVIRTUAL
* BIND_VMETHOD is gone, always use the new syntax from now on.

Creating `_gui_input` method and using the binder to register events will no longer work, simply override the virtual function now.
2021-08-23 08:10:13 -03:00
Paulb23 b6f5912174 Move CodeEdit theme overrides into EditorTheme 2021-08-13 17:47:53 +01:00
PouleyKetchoupp edc858ad82 Optimize theme change in code editor
Postpone applying the whole theme when a setting changes, to avoid
updating everything many times when the whole editor theme is changed.
2021-07-30 10:40:59 -07:00
Rémi Verschelde d41f4aca77
Script editor: Rename 'Clone Down' to 'Duplicate Selection'
Fixes #36670.
2021-06-29 12:14:24 +02:00
Eric M d0e78c86d7 Added support for scripts reporting multiple errors to ScriptTextEditor
Scripts can now report multiple errors to the scripting editors in the engine. UI elements were added to support multiple errors.
2021-06-19 22:20:30 +10:00
Gregory Basile 8ab13f8ace Documentation search fixes
Updates rich_text_label so that the built-in documentation can be searched
Previously, it would only find the first result and would not select other results
Renames "_entered" functions to "_submitted"
2021-06-16 09:43:34 -07:00
kobewi da6aebeb4c Move FindReplaceBar out of CodeTextEditor 2021-06-08 23:23:07 +02:00
Paulb23 00e10a842f Add custom background line colour to TextEdit and remove marked lines 2021-05-22 14:41:55 +01:00
Rémi Verschelde b5334d14f7
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
Paulb23 a0b409cb14 Add and convert editor to use CodeEdit 2020-09-10 20:35:27 +01:00
Paulb23 bc4cee4458 Extract Syntax highlighting from TextEdit and add EditorSyntaxHighlighter
- Extacted all syntax highlighting code from text edit
- Removed enable syntax highlighting from text edit
- Added line_edited_from signal to text_edit
- Renamed get/set_syntax_highlighting to get/set_syntax_highlighter
- Added EditorSyntaxHighligher
2020-07-11 17:09:58 +01:00
Marcel Admiraal 26fcf2b04c Add override keywords. 2020-07-10 13:56:54 +01:00
Hugo Locurcio 31b7f02a29
Remove ToolButton in favor of Button
ToolButton has no redeeming differences with Button;
it's just a Button with the Flat property enabled by default.
Removing it avoids some confusion when creating GUIs.

Existing ToolButtons will be converted to Buttons, but the Flat
property won't be enabled automatically.

This closes https://github.com/godotengine/godot-proposals/issues/1081.
2020-06-19 20:49:49 +02:00
Rémi Verschelde 0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
Juan Linietsky 3f335ce3d4 Texture refactor
-Texture renamed to Texture2D
-TextureLayered as base now inherits 2Darray, cubemap and cubemap array
-Removed all references to flags in textures (they will go in the shader)
-Texture3D gone for now (will come back later done properly)
-Create base rasterizer for RenderDevice, RasterizerRD
2020-02-11 11:53:26 +01:00
Rémi Verschelde a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
Yuri Roubinsky 03928c5b36 Fix toggle scripts panel to allow using shortcut in other areas 2019-12-17 17:23:29 +03:00
Yuri Roubinsky bb7b614da1 Prevent showing toggle scripts panel switch in shader editor 2019-12-17 11:19:43 +03:00
Yuri Roubinsky dc0199989d Moves switch for show scripts panel from File menu to status bar 2019-12-15 16:56:28 +03:00
Haoyu Qiu 6eaec3d10d Fixes Delete Line doesn't delete first line in script
Also, match multi-line delete behavior in script with single line:

If there are four lines: A, B, C, D.

Before the change:

    Delete C: Cursor lands on D
    Delete B and C: Cursor lands on A

After the change:

    Delete C: Cursor lands on D
    Delete B and C: Cursor lands on D
2019-12-09 16:31:43 +08:00
Tomasz Chabora 72c40c788f Tweak the behavior of search/replace bar 2019-08-13 17:18:13 +02:00