Commit Graph

411 Commits

Author SHA1 Message Date
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
f2baba6ddb Merge pull request #81927 from KoBeWi/uid﹕﹕∕∕c1ick
Make UIDs clickable in the script editor
2023-09-20 13:10:08 +02:00
3f43044a40 Make UIDs clickable in the script editor 2023-09-19 15:59:03 +02:00
6afadbaa9f Replace Ctrl in editor shortcuts with Cmd or Ctrl depending on platform 2023-09-19 10:29:07 +02:00
8ecc0c4f47 Fix accessing editor theme items throughout the UI
This also exposes `EditorInterface::get_editor_theme`.
2023-09-15 14:51:01 +02:00
67dce301aa Add code region folding to CodeEdit 2023-09-11 18:36:40 +02:00
6de34fde27 Add EditorStringNames singleton 2023-09-03 19:58:18 +02:00
cfd7dfd985 Fix a crash when built-in script is not saved and have syntax error
When built-in script is not saved, it has empty path, and origin
code assumes error with empty path is a depended_error but that's
not always the case.
Also add protection before access list index 0.
2023-08-30 17:45:58 +08:00
3f272f4910 Assume root when dropping node to unassigned script 2023-08-01 17:36:51 +02:00
25f3f660c5 Merge pull request #79610 from aaronfranke/toggle-comment-slash
Add Ctrl+/ as a shortcut to toggle comment in addition to Ctrl+K
2023-07-31 21:01:17 +02:00
74d20fe17e Merge pull request #75216 from rune-scape/rune-dependancy-errors
Script editor (GDScript): Show depended script errors
2023-07-24 19:32:20 +02:00
2bd904e3db Merge pull request #73196 from Vilcrow/fix-lookup-symbol
Fix jumping to function definition using `Ctrl+LMB` or the "Lookup Symbol" button
2023-07-24 19:32:12 +02:00
83b01708b2 Script editor: Show depended script errors 2023-07-24 15:49:39 +02:00
df3a1c18f1 Add Ctrl+/ as a shortcut to toggle comment in addition to Ctrl+K 2023-07-18 07:00:59 -05:00
56e2fad319 Fixed the jumping to function definition using 'Ctrl+LMB' and the 'Lookup Symbol' button. 2023-07-12 21:30:35 +03:00
a51116c6c7 Make onready variables created from dropping nodes include custom types 2023-07-12 07:58:26 -05:00
613c060e0b Add a line break to error messages in the script editor
Fixes #71002
2023-06-19 15:57:27 +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
d59cdb8327 Fix regression with right click on main selection 2023-05-08 21:56:16 +02:00
eb6d6ab29f Merge pull request #76658 from Paulb23/convert-indent-code-edit
Move convert_indent into CodeEdit
2023-05-08 12:20:37 +02:00
5c06c030f2 Fix right click in selection of additional caret 2023-05-08 00:02:56 +02:00
0b3fba45c6 Move convert_indent into CodeEdit 2023-05-07 13:08:37 +01:00
8f7b09916d Merge pull request #76026 from YuriSizov/editor-running-up-that-gui
Extract editor run toolbar into its own component
2023-04-26 12:15:29 +02:00
ff310f0969 Add shortcut for quick-toggling word wrap 2023-04-19 23:46:22 +02:00
8a74d8438f Extract editor run toolbar into its own component
- Simplify and update its logic.
- Simplify EditorScript.
- Improve EditorNode and other relevant includes.
- Fix scene-based path in the movie writer when
reloading a scene.
2023-04-19 17:12:28 +02:00
06c7940a5a Enable RichTextLabel context menu if selection is enabled 2023-03-06 13:18:36 +03:00
5906d6de8e Fix line folding with multiple carets 2023-02-21 21:28:26 +01:00
b3c64675cc [macOS] Replace all Alt/Option+Letter/Number default shortcuts to avoid conflicts with special character input. 2023-02-20 22:02:47 +02:00
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
78ea4b2f0c Fix code editor's ColorPicker issue
ColorPicker now supports color constants.
Modify code comments.
2023-02-11 00:14:14 +01:00
b004f8180e GDScript: Allow constant expressions in annotations 2023-01-25 18:43:56 +03:00
80b9d9537c Fix script editor drag and drop 2023-01-22 17:07:55 +01:00
59ea36b87c Remove set_drag_forwarding_compat() 2023-01-14 15:16:51 +01:00
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
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
94416e41c5 Fix various fringe issues with multi-carets and selections 2022-12-07 20:54:48 +01:00
c90d0bd84f Use forward-declarations in big editor classes 2022-11-29 09:59:43 +01:00
e791f4fce2 Double precision of String.split_floats 2022-11-20 12:29:50 +01:00
5947f22be9 Merge pull request #67578 from KoBeWi/GEDITOR
Unify usage of GLOBAL/EDITOR_GET
2022-10-31 13:15:58 +01:00
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
8ebc8813d5 Merge pull request #67314 from anvilfolk/quote-fix
Fix single-quotes incorrectly escaped when dragging into script editor
2022-10-21 18:12:09 +02:00
e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
97bada99ee Fix single-quotes incorrectly escaped when dragging into script editor 2022-10-17 16:05:53 -04:00
af0ee8b0a0 Reorganize script editor menu 2022-10-14 18:41:01 +02:00
0103af1ddd Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
f5903215d0 Merge pull request #61902 from Paulb23/multi-caret
Add Multi-caret support to TextEdit
2022-10-06 08:56:34 +02:00
0cbe176ce6 Add multi caret support to Editor 2022-10-05 17:19:26 +01:00
121e1df55b Merge pull request #66300 from KoBeWi/📝🧭
Split script navigation state and edit state
2022-10-05 08:30:49 +02:00
72a7d874b4 Fix the flickering of the line gutter icon when saving 2022-10-03 19:19:28 +08:00
4c73e8ba1a Merge pull request #66632 from RedMser/script-override-gutter-docs-fix
Fix wrong docs opening in script override gutter
2022-09-30 09:58:30 +02:00