Commit graph

391 commits

Author SHA1 Message Date
Rémi Verschelde 06667b2fcf
Merge pull request #21219 from AlexHolly/fix-textedit-shows-nothing
TextEdit update cache.size on ENTER_TREE
2018-09-12 17:41:12 +02:00
Rémi Verschelde 277b24dfb7 Make core/ includes absolute, remove subfolders from include path
This allows more consistency in the manner we include core headers,
where previously there would be a mix of absolute, relative and
include path-dependent includes.
2018-09-12 09:52:22 +02:00
Rémi Verschelde e883edfac9
Merge pull request #21872 from Paulb23/fix_backwards_search
Fix backwards search in TextEdit selecting non-whole words, issue 15677
2018-09-10 18:52:35 +02:00
Rémi Verschelde 87e0563116
Merge pull request #21491 from AlexHolly/fix-textedit-uncomment-spamm
Uncommenting a selection was not updating the selection.
2018-09-10 18:48:41 +02:00
Paulb23 e474b4a444 Fix backwards search in TextEdit selecting non-whole words, issue 15677 2018-09-08 14:54:41 +01:00
Paulb23 f051f5110e Fixed scientific notaion not highlighting correctly, issue 21435 2018-09-08 13:42:11 +01:00
Alexander Holland 5cb66b2776 Uncommenting a selection was not updating the selection.
Also adds uncomment lines(ctrl+u) where # is not in first place
2018-09-08 14:21:15 +02:00
Alexander Holland f2da51620d TextEdit replaced cache.size with get_size() 2018-08-25 16:21:47 +02:00
Rémi Verschelde 6ce4078c5f
Merge pull request #20586 from AlexHolly/text-edit-auto-completion
text_edit auto_completion
2018-08-24 20:48:01 +02:00
Rémi Verschelde 52466d57e9 Make some debug prints verbose-only, remove others 2018-08-24 14:59:01 +02:00
Alexander Holland 6d684aae8a text_edit auto_completion
replaced "similarity filter" with "sequential checks" this give more control over the desired filtering.
2018-08-14 22:45:10 +02:00
Rémi Verschelde a3d0b89892
Merge pull request #20876 from ttencate/cursor_blink
Reset caret blink when Ctrl+moving the cursor
2018-08-14 15:42:19 +02:00
James 109028f52b Editor autocomplete: prefer same case candidates 2018-08-13 20:45:33 +02:00
Rémi Verschelde 9ce33978db
Merge pull request #20666 from Calinou/script-editor-underline-hidpi
Scale underlines in the script editor with the editor scale
2018-08-13 12:21:23 +02:00
Juan Linietsky 0fc1c4eda8
Merge pull request #20149 from Overblob/shader_float_typing
Shader language - Add optional float typings
2018-08-10 18:21:28 -03:00
Thomas ten Cate 44d761e55c Reset caret blink when Ctrl+moving the cursor
There was a hardcoded exception to never reset caret blinking if Ctrl
(`command`) was pressed. This broke on Ctrl+arrows,
Ctrl+Home/End/PgUp/PgDn, Ctrl+C, Ctrl+V, Ctrl+Backspace and Ctrl+Delete.

Resetting blink only for those Ctrl operations that actually touch the
cursor somehow would clutter the code a lot, so I removed the check
entirely. That means we now also reset blinking on unrelated operations
like Ctrl+O, but that seems pretty harmless. I actually like the
additional bit of feedback even in that case (most of these will
immediately defocus the editor anyway, so you never see it).

Fixes #18100
2018-08-10 11:23:13 +02:00
Hugo Locurcio 501fc98c63
Scale underlines in the script editor with the editor scale 2018-08-02 09:38:56 +02:00
Rémi Verschelde 7056dc6011
Merge pull request #20498 from Calinou/caret-width-hidpi
Make the caret thicker in TextEdit and scale it with the editor scale
2018-07-27 09:01:58 +02:00
Hugo Locurcio f8a2cb3e15
Multiply TextEdit line spacing by the editor scale
This makes sure the default line spacing in the script editor
is consistent with the editor scale in use.
2018-07-26 23:50:16 +02:00
Hugo Locurcio 8d05f89bc1
Make the caret thicker in TextEdit and scale it with the editor scale
The caret in LineEdit is still 1 pixel thick, but it will become
2 pixels thick at editor scales higher than or equal to 150%.
2018-07-26 23:43:43 +02:00
Hein-Pieter van Braam 0e29f7974b Reduce unnecessary COW on Vector by make writing explicit
This commit makes operator[] on Vector const and adds a write proxy to it.  From
now on writes to Vectors need to happen through the .write proxy. So for
instance:

Vector<int> vec;
vec.push_back(10);
std::cout << vec[0] << std::endl;
vec.write[0] = 20;

Failing to use the .write proxy will cause a compilation error.

In addition COWable datatypes can now embed a CowData pointer to their data.
This means that String, CharString, and VMap no longer use or derive from
Vector.

_ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug
builds. This is a lot faster for Vector in the editor and while running tests.
The reason why this difference used to exist is because force-inlined methods
used to give a bad debugging experience. After extensive testing with modern
compilers this is no longer the case.
2018-07-26 00:54:16 +02:00
Wilson E. Alvarez a22e746bc3 Removed unnecessary assignments 2018-07-24 09:51:03 +02:00
George Marques 03746da73f
Add editor highlight for type-safe lines
The line number is hightlighted to indicate that the line contains only
type-safe code.
2018-07-20 21:55:18 -03:00
Overblob e6ad5e23b4 * Small hex/float/integer parsing refactoring
* Potential bug fix on hex (cannot be used atm)
* Added optional typing for floats, eg:
"1f" -> "1.0"
"1.f" -> "1.0"
"1.99f" -> "1.99"
"1." -> "1.0"
2018-07-15 14:58:23 +02:00
Max Hilbrunner 16f1a77319
Merge pull request #19735 from Paulb23/text_offset_issue_15688
Fixed text drawing too high in TextEdit, issue 15688
2018-07-05 04:04:39 +02:00
Max Hilbrunner e3c8ac43c6
Merge pull request #19187 from Zirak/editor-autocomplete-quote
Editor autocomplete won't insert unnecessary quotes
2018-07-05 02:33:33 +02:00
Max Hilbrunner edc63a2f60
Merge pull request #18028 from gabrii/18026
Fix #18026. Expose TextEdit::set_draw_breakpoint_gutter.
2018-07-05 02:30:18 +02:00
Max Hilbrunner fbff1804d2
Merge pull request #17438 from Deluvi/get-word-pos-quote-fix
get_word_at_pos considers simple and double quotes
2018-07-03 18:28:47 +02:00
Paulb23 8a168637fe Fixed text drawing too high in TextEdit, issue 15688 2018-06-24 10:38:53 +01:00
robojumper 4ba6755324 Re-enable scrolling via selecting code beyond edges in text_edit.cpp 2018-06-14 21:29:39 +02:00
Saracen c5bdb5b1d8 IME context detection. 2018-06-11 17:22:11 +01:00
Max Hilbrunner e949230837
Merge pull request #18298 from gabrii/TextEditScaledSelection
TextEdit scaled selection
2018-06-09 19:35:48 +02:00
Gabriel Gavilan b7b63fe034 Improve breakpoints and breakpoint gutter API in TextEdit
Added breakpoint_gutter, is_breakpoint_gutter_enabled, set_breakpoint_gutter_enabled, get_breakpoints, remove_breakpoints.
Fixed breakpoint_toggled signal not fierd when text is edited.
Fixes #18026.
2018-05-30 14:39:44 +02:00
Zirak c329780ea7 Editor autocomplete won't insert unnecessary quotes
When autocompleting a string (e.g. emit_signal or connect), e.g.

    emit_signal('visibility_c')
                            ^

where "^" is the cursor, hitting <tab> would insert an unnecessary
quote, breaking the string:

    emit_signal('visibility_changed'')

This commit adds a small lookahead, so the end result will be as the
user probably expected:

    emit_signal('visibility_changed')
2018-05-26 21:13:42 +00:00
Ibrahn Sahir 2abec59db9 fix for TextEdit::set_text firing signals it shouldn't.
Removing some _changed signals in set_ functions.
Includes revert of commit 384625aa31
2018-05-19 19:38:13 +01:00
Rémi Verschelde d6c15bd96a
Merge pull request #19017 from toger5/fix_no_a_input_script_editor_osx
fixed capital A osx
2018-05-18 20:04:31 +02:00
toger5 6476b708d9 fixed capital A osx 2018-05-18 19:46:40 +02:00
Rémi Verschelde 69cafb6044
Merge pull request #18910 from PJB3005/18-05-15-fix-textedit-param
Fix missing registration for new param of TextEdit::cursor_set_line.
2018-05-16 02:38:21 +02:00
Pieter-Jan Briers 0f303c9f43 Fix missing registration for new param of TextEdit::cursor_set_line.
This caused Mono glue gen to fail and other bugs to appear
(such as in Visual Script)
2018-05-15 21:53:42 +02:00
ianb96 ce434bca82 fix get_char_width for non-latin characters 2018-05-15 15:32:09 -04:00
Ian e1fff4bc09 TextEdit word wrap 2018-05-14 16:17:48 -04:00
Rémi Verschelde dd2aba021c
Merge pull request #18853 from YeldhamDev/gui_cppcheck_fixes
Fixed some warnings found with Cppcheck
2018-05-14 07:39:54 +02:00
Michael Alexsander Silva Dias 7f72d6476b Fixed some warnings found with Cppcheck. 2018-05-14 02:14:56 -03:00
toger5 d927e972d1 fixed a input not registered in osx script editor 2018-05-11 04:30:05 +02:00
Gabriel Gavilan b0069bb118 Apply viewport scale to selection update methods. Changed to propper fix sugested by reduz 2018-05-09 20:37:50 +02:00
Charly Mourglia b09e0454bb Consider TextEdit paste operation complex.
Not considering a paste operation as a complex one ends up
adding an unneeded extra step when pasting over a selection.

This fixes issue #18325
2018-05-09 14:07:06 +02:00
Deluvi 215150cfbf get_word_at_pos considers simple and double quotes
When using the get_word_at_pos function in TextEdit, the function would
return a full string only if this string is surrounded by double quotes
and not by simple quotes.

With this fix, get_word_at_pos will return the full string, whether be a
string surrounded by simple or double quotes.

Fixes #17437
2018-05-09 08:33:57 +02:00
Ruslan Mustakov 5cd12f6649 Perfect FreeType-based outlines for DynamicFonts
- Implement outlines based on FreeType Stroker API. This allows
  artifact-free results, similar to what you will see in Web or any text
  editing tools. Outline is a part of DynamicFont rather than Label,
  because outlines have to be baked into the font's atlas. Font has a
  default outline_color and a Label can specify font_outline_modulator
  that will be multiplied with the Font's color to get the final result.

- draw_char now has to be called twice to fully render a text - first
  with p_outline == true for each character and then with
  p_outline == false for each character.

- Number of draw-calls is reduced from 5 to 2 per outlined character.

- Overall cleanup of DynamicFont code, extracted duplicated code pieces
  into separate methods.

- The change is backward-compatible - Labels still have outline
  properties that work exactly as they worked before.

Closes #16279.
2018-05-08 13:45:24 +07:00
Juan Linietsky dff3a2f378
Merge pull request #18003 from sherjilozair/patch_macosx_shortcuts
Add additional macos shortcuts for going to start/end of line
2018-05-07 15:59:22 -03:00
Max Hilbrunner f9733b5cee
Merge pull request #18397 from KidRigger/working_te
Support of CMD+Backspace and CMD+Delete on MacOS.
2018-05-04 11:19:09 +02:00