Commit graph

662 commits

Author SHA1 Message Date
Rémi Verschelde 6dfea347b0
Merge pull request #38655 from ice-blaze/minimap-shifted-selection-by-one-line#38532
Fix minimap selection offset
2020-05-12 18:02:21 +02:00
etienne.frank 72ab355945 Fix minimap selection offset
The minimap selection was shifted of 1 line too late.
2020-05-11 10:02:16 +02:00
Rémi Verschelde e956e80c1f Style: clang-format: Disable AllowShortIfStatementsOnASingleLine
Part of #33027, also discussed in #29848.

Enforcing the use of brackets even on single line statements would be
preferred, but `clang-format` doesn't have this functionality yet.
2020-05-10 13:12:16 +02:00
Rémi Verschelde d7b85fbaa1
Merge pull request #31086 from volzhs/underline
Use underline position and thickness value in font file
2020-05-07 21:18:41 +02:00
Rémi Verschelde b62218bbac
Merge pull request #38385 from ThakeeNathees/method-bind-text_edit-set_line
method bind TextEdit::set_line() added
2020-05-07 13:43:34 +02:00
Rémi Verschelde 4d50f747d5
Merge pull request #37293 from Janglee123/ctrl-click-improvements
Improved go-to definition (Ctrl + Click)
2020-05-05 16:49:15 +02:00
janglee be7a353c70 Improved go-to definition (Ctrl + Click)
Co-Authored-By: Bojidar Marinov <bojidar.marinov.bg@gmail.com>
2020-05-05 10:46:12 +05:30
Thakee Nathees b9acf1cedf method bind TextEdit::set_line() added 2020-05-01 18:37:12 +05:30
Rémi Verschelde f6e29addd4
Merge pull request #37846 from CaptainProton42/text-edit-undo-stack-size
Add "undo_max_stack_size" property to TextEdit
2020-04-29 15:56:08 +02:00
volzhs 9f1de2cfdd Use underline position and thickness value in font file 2020-04-29 21:56:15 +09:00
John Wigg 4a82390aaf Limit undo stack size
The stack size of the undo history of a TextEdit was not limited leading
to potential memory leaks when doing lots of operations on a TextEdit.

This commit adds the option gui/common/text_edit_undo_stack_max_size
to the project settings. The first element of the undo stack is popped
if the stack's size exceeds this value ensuring limited memory usage.

The default stack size setting is 1024.

Fixes #37838.
2020-04-29 11:31:01 +02:00
Tomasz Chabora 9dfb231e00 Remove unneccessary increment in TextEdit 2020-04-29 00:16:48 +02:00
Rémi Verschelde fdf58a5858 Rename InputFilter back to Input
It changed name as part of the DisplayServer and input refactoring
in #37317, with the rationale that input no longer goes through the
main loop, so the previous Input singleton now only does filtering.

But the gains in consistency are quite limited in the renaming, and
it breaks compatibility for all scripts and tutorials that access
the Input singleton via the scripting language. A temporary option
was suggested to keep the scripting singleton named `Input` even if
its type is `InputFilter`, but that adds inconsistency and breaks C#.

Fixes godotengine/godot-proposals#639.
Fixes #37319.
Fixes #37690.
2020-04-28 15:19:49 +02:00
HellonLegs f412237f38 solved control + alt issue 2020-04-10 19:49:51 +02:00
lupoDharkael 95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
Juan Linietsky a6f3bc7c69 Renaming of servers for coherency.
VisualServer -> RenderingServer
PhysicsServer -> PhysicsServer3D
Physics2DServer -> PhysicsServer2D
NavigationServer -> NavigationServer3D
Navigation2DServer -> NavigationServer2D

Also renamed corresponding files.
2020-03-27 15:21:27 -03:00
bruvzg 15a9f94346 Add macOS DisplayServer implementation.
Change global menu to use Callable, add support for check items and submenus.
2020-03-26 16:24:05 +01:00
Mateo Kuruk Miccino f387b9b4f4 Multiple changes to DisplayServerX11
- Travis: Change x11 to linuxbsd
- SCons: Change x11 plataform to linuxbsd
- Plugins: Remove ; to avoid fallthrough warning
- DisplayServerX11: Implement set_icon
- DisplayServerX11: Fix X11 bug when a window was erased from windows
  map, all the changes from that erased windows are sending to the main
  window
- DisplayServerX11: Reorder create_window commands
- DisplayServerX11: Change every Size2 to Size2i and Rect2 to Rect2i
  where it belongs

+ More X11 fixes which have been integrated directly back into reduz's
original commits while rebasing the branch.
2020-03-26 15:49:54 +01:00
Juan Linietsky 441f1a5fe9 Popups are now windows also (broken!) 2020-03-26 15:49:42 +01:00
Juan Linietsky 8e6960a69e Refactored input, goes all via windows now.
Also renamed Input to InputFilter because all it does is filter events.
2020-03-26 15:49:39 +01:00
Juan Linietsky 9e08742de8 Added a Window node, and made it the scene root.
Still a lot of work to do.
2020-03-26 15:49:38 +01:00
Juan Linietsky f8a79a97c7 Effective DisplayServer separation, rename X11 -> LinuxBSD 2020-03-26 15:49:34 +01:00
Juan Linietsky 4396e98834 Refactored Input, create DisplayServer and DisplayServerX11 2020-03-26 15:49:32 +01:00
Rémi Verschelde ca4e4506db Fix potential divisions by 0 reported by MSVC
The `TextEdit` one was indeed a potential bug.
The `PCKPacker` one seems to be a false positive, it's already in a
`for` loop that depends on `files.size()`.
2020-03-21 11:54:08 +01:00
Rémi Verschelde 951ecc4f79
Merge pull request #36518 from Janglee123/no-underlined-keywords
Removed underlining of not clickable symbols
2020-03-12 22:24:43 +01:00
janglee 50a570c9c1 Removed underlining for not clickable symbols 2020-03-11 08:57:21 +00:00
Rémi Verschelde e80da4a920
Merge pull request #36715 from dreamsComeTrue/fix-text-edit-comment-quotes
Allow single quotes [',"] in comments in TextEdit
2020-03-11 07:32:24 +01:00
Dominik 'dreamsComeTrue' Jasiński ab6456d1bc Allow single quotes in comments
Fixes: #36638
2020-03-11 06:27:28 +01:00
Rémi Verschelde e2b66cacf7
Merge pull request #18020 from bruvzg/input_fix_non_latin_and_add_hw_scancodes
Fix non-latin layout scancodes on Linux, adds access to physical scancodes.
2020-03-01 23:00:42 +01:00
Rémi Verschelde 01afc442c7 Signals: Port connect calls to use callable_mp
Remove now unnecessary bindings of signal callbacks in the public API.
There might be some false positives that need rebinding if they were
meant to be public.

No regular expressions were harmed in the making of this commit.
(Nah, just kidding.)
2020-02-28 14:24:09 +01:00
Rémi Verschelde 2d904d2f80
Merge pull request #36232 from Calinou/add-soft-line-length-guideline
Add a soft line length guideline to the script editor
2020-02-27 21:10:42 +01:00
Juan Linietsky 33b5c57199 Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.
- Renames PackedIntArray to PackedInt32Array.
- Renames PackedFloatArray to PackedFloat32Array.
- Adds PackedInt64Array and PackedFloat64Array.
- Renames Variant::REAL to Variant::FLOAT for consistency.

Packed arrays are for storing large amount of data and creating stuff like
meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of
memory. That said, many users requested the ability to have 64 bits packed
arrays for their games, so this is just an optional added type.

For Variant, the float datatype is always 64 bits, and exposed as `float`.

We still have `real_t` which is the datatype that can change from 32 to 64
bits depending on a compile flag (not entirely working right now, but that's
the idea). It affects math related datatypes and code only.

Neither Variant nor PackedArray make use of real_t, which is only intended
for math precision, so the term is removed from there to keep only float.
2020-02-25 12:55:53 +01:00
bruvzg 1af06d3d46
Rename scancode to keycode.
Add `physical_keycode` (keyboard layout independent keycodes) to InputEventKey and InputMap.
Fix non-latin keyboard layout keycodes on Linux/X11 (fallback to physical keycodes).
2020-02-25 12:30:33 +02:00
Rémi Verschelde 194fd2d5a5
Merge pull request #36089 from dreamsComeTrue/fix-autocomplete-quotes
Fix: auto brace complete for quoted strings
2020-02-23 22:13:27 +01:00
Rémi Verschelde 2cf6ac6c50 Replace FALLTHROUGH macro by C++17 [[fallthrough]]
This attribute is now part of the standard we target so we no longer
need compiler-specific hacks.

Also enables -Wimplicit-fallthrough for Clang now that we can properly
support it. It's already on by default for GCC's -Wextra.

Fixes new warnings raised by Clang's -Wimplicit-fallthrough.
2020-02-23 00:52:50 +01:00
Dominik 'dreamsComeTrue' Jasiński 6a404a88e4 Fix: auto brace complete for quoted strings
Fixes #36002
2020-02-21 23:01:13 +01:00
Juan Linietsky 69c95f4b4c Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +01:00
Juan Linietsky 3205a92ad8 PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are
sugar for `Vector<Type>`.
2020-02-18 10:10:36 +01:00
Hugo Locurcio 3e4b508c3b
Add a soft line length guideline to the script editor
The default value is 80. The hard line length guideline's
default column has been moved to 100 to account for the new
soft line length guideline.

It can be disabled by setting its value to the same column as the
hard line length guideline.

This closes https://github.com/godotengine/godot-proposals/issues/347.
2020-02-15 03:02:40 +01: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 9d8e095946 Merge pull request #34288 from bojidar-bg/33425-always-suggest-subsequence
Always display subsequence autocompletion matches
2020-02-10 11:25:35 +01:00
Marcel Admiraal f0db13502a Remove duplicate WARN_PRINT macro. 2020-02-05 11:13:24 +01:00
Krystof Klestil c475f11018 expose scroll_vertical and scroll_horizontal in TextEdit + documentation 2020-01-07 15:16:07 +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
Paulb23 0049f43fc8 Fixed selection indent taking an additional line 2019-12-23 13:16:57 +00:00
Mikolaj Kaczmarek eced81e359 Fix- using cut in first line of a script file does not remove the line 2019-12-14 19:11:19 +01:00
Bojidar Marinov 0c4d35fd1a
Always display subsequence autocompletion matches
Fixes #33425
2019-12-12 01:25:44 +02:00
Rafał Mikrut ed1c4bc77d Removed unused variables, add some constants numbers 2019-12-10 05:13:02 +01:00
Rémi Verschelde bfd5e09879 Range: Fix cases where max was set to or below min value
It will now raise an error whenever this happens so that we can fix
these situations. `max == min` is not allowed as it could lead to
divisions by zero in ratios, and `max < min` doesn't make much sense.

Fixes #33907.
2019-11-26 10:25:41 +01:00
PouleyKetchoupp 8830e53fe1 Fixed index out of size error in TextEdit when opening scripts 2019-11-24 10:48:04 +01:00
Paulb23 25cba699f0 Fixed not being able to scroll ending wrapped line 2019-11-09 16:45:44 +00:00
Paulb23 362d38ea67 Update connection info on script validation rather then saved copy 2019-11-02 14:41:59 +00:00
Rémi Verschelde 5160d4f5ba
Merge pull request #33233 from hilfazer/dollar-quoted-autocomplete
$ autocompletion keeps quotation
2019-11-01 16:52:13 +01:00
hilfazer c394ef7410 $ autocompletion keeps quotation 2019-11-01 14:52:13 +01:00
PouleyKetchoupp d29c8ab81b Improved TextEdit search usability & documentation 2019-10-31 12:35:23 +01:00
Rémi Verschelde 0cae264d79
Merge pull request #33119 from creikey/fix-quote-malfunction
Remove duplicate quote in displayed quote type
2019-10-28 08:08:38 +01:00
Cameron Reikes 67ab03e245 Remove duplicate quote in displayed quote type
- fixes #32688
 - fixes #32593
2019-10-27 15:21:25 -07:00
Rémi Verschelde 2751cea0d4
Merge pull request #33066 from Tabas32/fix_indentation
Fixed indenting issue with comment at end of line
2019-10-27 13:42:53 +01:00
Paulb23 2e2a049d3c Improve performance of connection info in the script editor 2019-10-27 11:07:19 +00:00
Paulb23 df0c8386a9 Fix text minimap crash when last line is folded 2019-10-26 13:37:25 +01:00
Marian 3322d19cb3 Just initialization, needed by compiler 2019-10-25 16:14:24 +02:00
Marian 616f02e905 Fixed indenting issue with comment at end of line 2019-10-25 15:01:43 +02:00
Zatherz 72d2248276 Don't terminate search if begin_key doesn't fit
Previously this code would continue onto the next iteration of the loop if the line was smaller in size than begin_key, meaning that a situation where begin_key.length() > end_key.length() would cause weird behavior with newlines. Now both the checks for begin_key and end_key are in their own condition and do not skip the entire iteration if they can't be found.
2019-10-24 21:59:02 +02:00
volzhs 63e6b1ecce Fix rendering tooltip 2019-10-24 22:48:20 +09:00
Rémi Verschelde 78848bbfea
Merge pull request #32796 from Paulb23/set_text_caret
Changed `set_text` to place caret at start of the text.
2019-10-22 22:44:12 +02:00
Rémi Verschelde 9f28803927
Merge pull request #32940 from nekomatata/text-edit-clear-colors
TextEdit syntax highlighting fixes
2019-10-22 20:40:20 +02:00
Rémi Verschelde 97a4fe79fb
Merge pull request #32902 from nekomatata/auto-indent-bracket-fix
Auto-indent after opening bracket and parenthesis in the script editor
2019-10-22 14:30:16 +02:00
PouleyKetchoupp 4247c21cb0 TextEdit syntax highlighting fixes
- Fixed visual update when using add_keyword_color(), add_color_region(), clear_colors() in scripts
- More accurate description for clear_colors() in TextEdit documentation
2019-10-20 17:40:09 +02:00
Paulb23 ee94081b4a Fixed -1 minimap index when smooth scrolling is enabled 2019-10-20 13:27:53 +01:00
PouleyKetchoupp 74d7cbf920 Auto-indent after opening bracket and parenthesis in the script editor
This change makes auto-indent work the same way as for curly brackets, so '[', '(', '{' all act the same.

Fixes #32897
2019-10-18 11:02:05 +02:00
qarmin 616ab4fac2 Small fixes to redundand code, copy paste bugs 2019-10-14 11:40:55 +02:00
Paulb23 d579d2bf1d Fix undo / redo scrollbar calulations 2019-10-13 15:34:28 +01:00
Paulb23 aea0761b25 Place caret at 0,0 when setting text not at the end 2019-10-13 15:29:20 +01:00
Paulb23 e5b18cea63 Fixed inserting text at caret not updating scrollbar size 2019-10-07 19:17:32 +01:00
Paulb23 6025a76c78 Fixed drawing the caret at eol when at eol is not visible 2019-10-07 17:24:58 +01:00
lupoDharkael cb22a875aa TextEdit: Fix timer inside tree warning 2019-09-27 13:57:20 +02:00
Rémi Verschelde dec10dd776
Merge pull request #32051 from qarmin/some_error_explanation
Added some obvious errors explanations
2019-09-25 11:51:54 +02:00
qarmin 17732fe698 Added some obvious errors explanations 2019-09-25 10:28:50 +02:00
Rémi Verschelde fc47569be9
Merge pull request #32232 from Paulb23/issue_32070_goto_doc_when_selecting
Fixed going to doc reference while selecting text
2019-09-23 15:00:41 +02:00
Rémi Verschelde 0928e82027
Merge pull request #29895 from ptrojahn/menukey
Support menu key in TextEdit and LineEdit controls
2019-09-22 21:21:13 +02:00
Paul Trojahn ba24bc1e04 Support menu key in TextEdit and LineEdit controls
Related to #15542
2019-09-22 12:06:24 +02:00
Paulb23 ef3455f236 Fixed going to doc reference while selecting text 2019-09-21 13:45:20 +01:00
Rémi Verschelde 48db920f4a
Merge pull request #32190 from KoBeWi/undo_redo_stuff
Fix autocompletion undo
2019-09-20 17:22:11 +02:00
Rémi Verschelde fdc2463a1b
Merge pull request #32150 from luzpaz/typos
Fix misc. source comment typos
2019-09-20 17:09:05 +02:00
luz.paz 91ecd7b6a6 Fix misc. source comment typos
Found using `codespell -q 3 -S ./thirdparty,*.po -L ang,ba,cas,dof,doubleclick,fave,hist,leapyear,lod,nd,numer,ois,paket,seeked,sinc,switchs,te,uint -D ~/Projects/codespell/codespell_lib/data/dictionary.txt `
2019-09-19 14:36:52 -04:00
Rémi Verschelde fae14153f7
Merge pull request #31188 from codecustard/LineEdit_disable_shortcuts
Add Ability to Enable/Disable Shortcuts and Selection for LineEdit/TextEdit
2019-09-19 19:56:59 +02:00
Tomasz Chabora d630472b98 Fix autocompletion undo 2019-09-18 16:26:33 +02:00
Emmanuel Barroga b678d68224 Add Ability to Enable/Disable Shortcuts for LineEdit/TextEdit
This PR adds the ability to enable/disable shortcut keys and selection for LineEdit/TextEdit. It also updates the context menu when you disable/enable the shortcut keys or selection.
2019-09-07 06:06:36 -07:00
PouleyKetchoupp 5fdea32622 TextEdit & LineEdit caret blink timers run only when focused (fixes #31936) 2019-09-04 13:06:15 +02:00
amakarenko 544c39d1e7 Fix editor infinit loop in search_prev
Fixes godotengine#31328
2019-09-02 15:15:55 +03:00
Michael Alexsander Silva Dias 5f28a2f978 Fix multiline texts not updating its contents correctly in the inspector 2019-09-02 01:17:11 -03:00
Paulb23 b1aaeb07ea Fix minimap drag when height is less then control size 2019-08-31 15:43:19 +01:00
Rémi Verschelde 9fc359411f
Merge pull request #31803 from KoBeWi/minicursor
Don't change cursor when minimap is disabled
2019-08-30 20:08:21 +02:00
Tomasz Chabora b0805a1b53 Don't change cursor when minimap is disabled 2019-08-30 19:13:53 +02:00
Tomasz Chabora b55b3d71a8 Perform symbol lookup on button release 2019-08-30 16:19:25 +02:00
Michael Alexsander Silva Dias 9c36d893e3 Fix Multiline texts not updating correcly inside arrays 2019-08-26 13:47:33 -03:00
Rémi Verschelde 0985d5fa99
Merge pull request #31496 from nekomatata/fix-text-edit-insert-selection
Update TextEdit selection when inserting line
2019-08-25 22:33:23 +02:00
Rémi Verschelde 41b5c62952
Merge pull request #31654 from Paulb23/minimap_fixes
Viewport highlight, colour cache and minimap scrolling fixes.
2019-08-25 22:32:05 +02:00
Paulb23 32d5427f55 Refactor TextEdit control height calculations 2019-08-25 14:49:13 +01:00
PouleyKetchoupp bc839ed3f3 Update TextEdit selection & cursor when inserting line
Fixes #31458
2019-08-25 15:43:45 +02:00