Commit graph

327 commits

Author SHA1 Message Date
Rémi Verschelde
3c63b09a70
Merge pull request #81486 from jsjtxietian/Ignoring-empty-lines--when-uncommenting
Ignore empty lines when uncommenting code
2023-09-26 08:20:05 +02:00
PucklaMotzer09
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
jsjtxietian
12299e0f53 Ignore empty lines when commenting/uncommenting code 2023-09-20 18:55:48 +08:00
Yuri Sizov
3c63dce3cd Merge pull request #80573 from KoBeWi/2k_lines_of_changes_created_at_2AM
Add EditorStringNames singleton
2023-09-06 14:49:02 +02:00
kobewi
6de34fde27 Add EditorStringNames singleton 2023-09-03 19:58:18 +02:00
Yuri Rubinsky
35802374ac Add coloring for completion of vector components 2023-08-30 21:13:25 +03:00
Yuri Sizov
04e550acb6 Merge pull request #79358 from timothyqiu/indentation
Make indentation indicators translatable
2023-07-31 21:01:13 +02:00
Yuri Sizov
d13369eee1 Merge pull request #68140 from quinnyo/auto-complete-option
Add editor setting to toggle automatic code completion
2023-07-12 17:15:51 +02:00
Yuri Sizov
1e1d2a89bf Merge pull request #44557 from iwek7/improved_comment_toggle
Improve `CodeEdit`'s toggle comments behavior
2023-07-12 17:14:52 +02:00
Yuri Sizov
ecc9134086 Merge pull request #79079 from stmSi/ESC-key-not-closing-FindReplaceBar
Fix ESC (ui_cancel) not closing FindReplaceBar
2023-07-12 15:09:46 +02:00
Haoyu Qiu
a552103531 Make indentation indicators translatable 2023-07-12 09:19:24 +08:00
stmSi
7eb517c27f Fix: ESC (ui_cancel) not closing FindReplaceBar 2023-07-06 03:35:01 +06:30
Haoyu Qiu
ac454ce2a7 Translate "No match" message in FindReplaceBar 2023-07-02 16:49:22 +08:00
quinnyo
68c24f9993 Add code_complete_enabled code editor setting 2023-06-21 02:51:05 +10:00
bruvzg
75e6ec8874
[TextEdit] Expose all auto-wrap modes. 2023-06-13 10:28:27 +03:00
Rémi Verschelde
577ab3c565
Merge pull request #75746 from ajreckof/order_autocomplete
Sort code autocompletion with rules
2023-06-08 18:14:31 +02:00
kobewi
09d5884b0d Enable bookmarks gutter 2023-06-02 22:40:29 +02:00
iwek
b0df2e1552 Update comment toggle behavior in CodeEdit 2023-06-01 19:11:57 +02:00
Rémi Verschelde
6dcd490d03
Merge pull request #66763 from MewPurPur/remove-bookmark-hiding
Remove editor setting for hiding bookmarks
2023-05-29 10:28:37 +02:00
ajreckof
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
Arman Elgudzhyan
8ab2cf3d2d Use defined key mapping for closing popups and dialogs
As opposed to hardcoding the escape key. Also removed such hardcoding in a few other places as well as a hardcoded enter key in one of the affected input fields.
2023-05-20 17:39:59 -07:00
Paulb23
0b3fba45c6 Move convert_indent into CodeEdit 2023-05-07 13:08:37 +01:00
Clay John
610877e326
Merge pull request #72288 from MewPurPur/use-string-repeat
Use `String.repeat()` to optimize several String methods
2023-05-05 09:56:48 -07:00
VolTer
6b84e258d2 Use String.repeat() in more places 2023-05-01 02:27:46 +02:00
Rindbee
23d6225c1e Fix line_spacing in code editor will not take effect immediately on change
Previously, in CodeTextEditor, `line_spacing` was forgotten to update
when the editor setting property changed.
2023-04-24 17:11:38 +08:00
VolTer
f587a21899 Code style improvements to text_edit and related 2023-04-08 19:33:56 +02:00
Yuri Sizov
aeb4489e63
Merge pull request #75070 from jmb462/74802
Fix commenting collapsed function issue
2023-04-03 15:38:18 +02:00
Ron B. Yeh
1e9fd10f68 Fix off-by-one issue where Go to Line dialog shows the incorrect line
number (one less than the actual current line).
2023-03-30 23:39:44 -07:00
Jean-Michel Bernard
68ad3338ef Fix commenting collapsed function issue 2023-03-25 18:43:16 +01:00
aXu-AP
d188068caa Fix toggle comment not moving caret
Fix regression if caret is at the beginning of the line and comment is toggled.
2023-02-16 16:17:24 +02: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
b342dcdf04
Remove some unused signals
Part of #37604.
2023-01-31 18:54:04 +01:00
Paulb23
8cb05a5e53 Fixed removing secondary carets when editing with search open 2023-01-28 16:08:10 +00:00
bruvzg
5361ec9f43
Implement BiDi override mode for GDScript source. 2023-01-18 19:22:20 +02:00
Paulb23
b9f24f1586 Remove secondary carets when using FindReplaceBar 2023-01-14 15:58:56 +00: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
Rémi Verschelde
4bca815d41
Merge pull request #69132 from RumblingTurtle/multiline-move-fix
Script editor: Rewrite multiline move logic
2022-12-05 11:32:29 +01:00
Eduard Zalyaev
c3eec67f06 Script editor: Rewrite multiline move logic. Preserving all carets and their selections intact on alt+up/down shortcut
Fixes  #68731.
2022-12-05 10:43:27 +03:00
Rémi Verschelde
d4c4a44607
Merge pull request #68759 from MewPurPur/bookmark-fix
Fix text selection persisting on bookmark traversal
2022-11-28 08:06:05 +01:00
Aaron Franke
f6714858bf
Rename TextureButton set_*_texture methods to set_texture_* 2022-11-19 17:33:40 -06:00
VolTer
135c8cbf98 Fix text selection persisting on bookmark traversal 2022-11-17 02:50:04 +01:00
Christian Cuevas
5347c2b10e Fix "Search" match inconsistencies
- Offset by searched length not line text
- Continue searching line for whole word matches on mismatch: Breaking at this point makes it so that upon any whole word mismatch all potential matches after this point inline are skipped, to avoid this unwanted behavior we continue searching the line positioned after the mismatch.
2022-11-16 14:02:16 -08:00
Hugo Locurcio
11842eb738
Disable code font ligatures by default in the editor 2022-11-12 22:38:04 +01:00
VolTer
e0e236edfc Remove editor setting for hiding bookmarks 2022-11-02 01:14:02 +01:00
kobewi
e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02: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
bruvzg
0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03: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