Commit Graph

57 Commits

Author SHA1 Message Date
kit
f7c182371e Remove build_array and build_dictionary from tests 2025-05-26 13:02:01 -04:00
5df01a8c5a Merge pull request #96925 from SaNeOr/fix-#96908
Fix spaces converted to tabs in triple quote strings
2025-05-26 11:24:30 -05:00
0d267e7b1e Core: Add dedicated BitField template 2025-04-11 11:53:26 -05:00
40b7931279 [CodeEdit] Fix folding for comments mixed with code region tags.
Co-authored-by: Kit Bishop <kitbdev@gmail.com>
2025-04-07 20:50:54 +02:00
75881f8322 Use initializer list in Arrays 2025-03-26 18:38:15 +01:00
324512e11c Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
5775d29ad8 Fix SCRIPT ERROR/ERROR/WARNING on test output
Also "fixing" some GDScript completion tests which
where named wrongly.
2025-03-06 13:44:48 +01:00
f134769506 Fix various typos
* Add TODO notes for typos that should be fixed for 5.0

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2025-01-08 14:47:42 +02:00
ed69fd66da fix: Editor, save script file: Triple quote string: spaces are converted into tabs 2024-09-16 10:01:09 +08:00
504e0656bb Add TextEdit option to prevent copying without a selection 2024-09-14 09:39:36 +08:00
db5003519a Merge pull request #89554 from smnast/backspace-unfold
Fix backspace always unfolding previous line
2024-08-19 16:04:34 +02:00
kit
a7da814c6b CodeEdit Fix move lines up/down viewport and selection issues 2024-06-25 15:31:20 -04:00
2860b99077 Fix backspace always unfolding previous line 2024-05-27 13:30:19 -07:00
kit
948f09632e Unhide carets in add selection for occurrence 2024-05-27 15:30:18 -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
48ea019322 Fix a special case for button masks
In certain situations it is possible that in a `Viewport` the same
mouse button is pressed twice in series without releasing it in
between.
In this case, focus stealing should happen to ensure, that the
mouse button is not sent unintentionally to the previously focused
Control node.
2024-03-28 20:22:49 +01:00
8c36282feb Fix region section not ignoring #region and #endregion when in a string
When using the script editor, if the keywords #region and #endregion where
in a string and ate the start of the line, the editor would not ignore them
and count them as the actual keywords, which when folded, would only fold
until the first #endregion in a string, for example.

By checking if these keywords were in a string, this commit now ensures the
editor ignores strings and fold the section correctly.

Fixes #89115.
2024-03-11 00:04:39 +00:00
d5847fa54e Fix updating delimiter cache of CodeEdit when typing on the first line 2023-12-18 14:07:46 +01:00
881fe67d94 Code Editor: Fix regression with using doc comments for code regions 2023-10-13 09:38:03 +03:00
25cbb682f5 Fix code completion override of home and end keys 2023-10-06 14:48:45 -04:00
b11309ddb6 Merge pull request #81633 from matorin57/code-completion-popup
Avoid resetting the code completion popup excessively
2023-10-03 17:20:49 +02:00
d2e651f403 Add Duplicate Lines shortcut to CodeTextEditor
This keyboard shortcut has been made with inspiration from the VS Code keyboard shortcut editor.action.copyLinesDownAction. It duplicates all selected lines and inserts them below no matter where the caret is within the line.
2023-09-25 23:41:31 +02:00
303d0994e9 Avoid resetting the code completion popup excessively 2023-09-20 15:49:25 -05:00
67dce301aa Add code region folding to CodeEdit 2023-09-11 18:36:40 +02:00
19632eaf50 Change precedence in rules to make location after proper casing. 2023-09-05 16:16:21 +02:00
6fb391bc23 Fix various typos with codespell
And ignore some false positives introduced by recent versions of codespell.
2023-06-16 08:45:35 +02:00
006e899bb3 sort code completions with rules
Fixups

Add levenshtein distance for comparisons, remove kind sort order, try to improve as many different use cases as possible

Trying again to improve code completion

Sort code autocompletion options by similarity based on input

To make it really brief, uses a combination `String.similiary`, the category system introduced in a previous PR, and some filtering to yield more predictable results, instead of scattering every completion option at seemingly random.

It also gives much higher priority to strings that contain the base in full, closer to the beginning or are perfect matches.

Also moves CodeCompletionOptionCompare to code_edit.cpp

Co-Authored-By: Micky <66727710+Mickeon@users.noreply.github.com>
Co-Authored-By: Eric M <41730826+EricEzaM@users.noreply.github.com>
2023-05-23 05:12:34 +02:00
8e7afec479 Fix various errors when running the unit tests
Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2023-05-09 18:40:56 +02:00
0b3fba45c6 Move convert_indent into CodeEdit 2023-05-07 13:08:37 +01:00
fa7e6ddb83 Fix auto-indentation in typed arrays, comments, and after colon
Now the editor won't add indentation when pressing enter, is
declaring typed variables and there is a colon in the comment

example:
var a:=0#:[press enter]
no indentation
2023-04-20 18:48:21 -04:00
1b2ba353dc Remove m_object parameter from unit test Macros
This serves no longer any purpose and can be removed.
2023-02-09 00:20:25 +01:00
5b1df48c6c Convert en_GB spelling to en_US with codespell 2023-01-23 11:02:20 +01:00
b427d3585c Allow unindent without selection 2023-01-18 17:05:15 +01:00
1aac10d73d Fixed adding extra quote when completing strings 2023-01-14 15:28:22 +00:00
6a86dfad29 Fix typos with codespell
Also includes #71080.

Co-authored-by: Psychpsyo <60073468+Psychpsyo@users.noreply.github.com>
2023-01-09 08:39:07 +01:00
2b815df3c1 Use BitField<> in core type masks
* All core types masks are now correctly marked as bitfields.
* The enum hacks in MouseButtonMask and many other types are gone. This ensures that binders to other languages non C++ can actually implement type safe bitmasks.
* Most bitmask operations replaced by functions in BitField<>
* Key is still a problem because its enum and mask at the same time. While it kind of works in C++, this most likely can't be implemented safely in other languages and will have to be changed at some point. Mostly left as-is.
* Documentation and API dump updated to reflect bitfields in core types.
2023-01-08 22:17:40 +01:00
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
29f7bea241 Fix autocomplete with autobrace completion not adding closing pair 2022-12-19 14:20:52 +00:00
530b1f3f7a Fix autocomplete box placement 2022-12-17 12:33:29 +13:00
e5c183b01e Fix TextEdit::gutters_width (total gutter width) when adding & removing a gutter by calling TextEdit::_update_gutter_width in TextEdit::add_gutter & TextEdit::remove_gutter
Update TextEdit gutters subcase, gutter add and remove to ensure gutter total width is correct

Fix test_code_edit symbol lookup test case to include padding (+2)
2022-08-31 10:01:40 +09:00
8be27dc59e Replace Array return types with TypedArray 2022-08-22 22:42:36 +02:00
8823eae328 Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
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
925e54ad65 fix lines ending in comments causing auto indent 2022-04-28 20:07:10 -05:00
5e4e4967fe Use Input::push_input for tests plus extra mouse testing 2022-04-22 17:39:12 +01:00
f19cd44346 Unify TextServer built-in module and GDExtension code. 2022-03-17 08:15:29 +02:00
f170d6a171 With auto_brace_complete enabled, selected text now gets wrapped by braces 2022-01-30 17:33:13 +01:00
6f1089af86 Fix selection being deleted and indentation not being accounted for 2022-01-23 23:14:35 +00:00
1422c756ed Rename request_code_completion signal 2022-01-22 14:04:35 +01:00
84a69d7429 Improve the default project theme
The new default project theme uses StyleBoxFlat extensively for
a more modern design and better scalability to multiple resolutions.

SVG icons are now used in place of PNG icons. While this does not
allow for true vector-based icon drawing (icons are still rasterized
at load-time), this makes the design work easier for contributors
and opens the door to vector drawing in the future (e.g. with polygons
or SDFs).

Like for editor icons, the SVG header file is now built automatically
when a SVG file is changed. This removing the need for running
`make_header.py` manually (TODO).

The "Use Hidpi" project setting has been removed in favor of a
"Default Theme Scale" project setting, which allows creating the
default theme at a higher/lower scale than the default.
This can be used when designing GUIs with a high base resolution
to ensure crisp visuals.

Co-authored-by: Yuri Sizov <yuris@humnom.net>
2022-01-19 18:46:01 +03:00