Commit Graph

33 Commits

Author SHA1 Message Date
Mike Blumenkrantz 6d40a78b25 elm.code.widget: rename events to avoid conflicts
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8264
2019-03-08 12:18:01 -08:00
Mike Blumenkrantz ca9daf94c6 elm_code_widget: make this efl_ui namespaced
this currently has no counterpart in interface widgets but would be
useful there. removing the use of an elm_scroller type makes it independent
of legacy widgets, and it's still a beta api so at least future development
can be resumed at some point without much issue

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8158
2019-03-07 14:14:55 -08:00
Derek Foreman ec910c5bb9 elm_code: Don't update selection if it didn't change
Summary:
Mouse motion can cause multiple worthless selection updates with no
change to row or column.  Discard updates that don't really update.

ref T6209
Depends on D7692

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T6209

Differential Revision: https://phab.enlightenment.org/D7693
2019-01-18 12:35:26 -05:00
Carsten Haitzler b05472eb9d elm code - warn - explicit truncation via custom truncate func 2018-11-09 12:18:59 +00:00
Alastair Poole 0f21b1f7aa elm_code: fix crash on backspace and selection delete.
FIx backspace issue and also issue involving the cursor
position and deleting/cutting/backspace of selected text.
Now that we properly move the cursor around when making a
selection, it's important that we place the cursor in a
valid position in the widget following the removal of text.

Previously the cursor always remained in a "safe" position
however now it's crucial to update this position when
necessary.

@fix T7259
Differential Revision: https://phab.enlightenment.org/D6835
2018-08-17 21:44:17 +02:00
Alastair Poole ad379ce04f elm_code_widget: fix keyboard and scrolling with active selection.
Summary:
This adds some attributes to the selectiont type in elm_code.
Including the type (whether it is mouse or keyboard) and also whether
a selection is in progress. Thus we can reliably select around the
file and also move/scroll when there is an active selection.

Test Plan:
Drag and select text with mouse. Also the same with keyboard (hold shift and select).
Leave selection active and scroll around the file. The selection should remain and
full movement is possible while retaining the active selection. This could really
be refactored for a next major release.

Reviewers: #committers, ajwillia.ms, cedric

Reviewed By: ajwillia.ms

Subscribers: zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6676
2018-07-27 17:08:44 +01:00
Andy Williams cc2b7a10a8 elm_code: Remove a render test and complex workarounds required
Fixes issues with Windows and general unused method warnings
2018-03-28 17:30:17 +01:00
Andy Williams 3b60da0e37 elm_code: Fix line selection with leading tabs 2018-03-28 16:47:55 +01:00
Vincent Torri 32b2102774 Elm_code test: fix compilation
Reviewers: cedric, raster

Differential Revision: https://phab.enlightenment.org/D5831
2018-03-04 21:41:34 +09:00
Lauro Moura 0dbeb91bb9 elementary: fix compilation of elm_code test on windows
Summary:
Added some guards to avoid redefinition of functions.

Partially fixes T5866, as there is still the question whether we should
test internal functions or not, as stated by jpeg in the comments.

Reviewers: vtorri, felipealmeida, jpeg, cedric

Reviewed By: cedric

Subscribers: jenkins, cedric

Maniphest Tasks: T5866

Differential Revision: https://phab.enlightenment.org/D5521

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-11-23 15:30:32 -08:00
Andy Williams 665679bc42 elm_code: add missing selection signals 2017-07-15 21:29:48 +01:00
Jean-Philippe Andre 65644d074e elm_code: Fix a compilation warning
warning: expression result unused; should this cast be to 'void'?
[-Wunused-value]
2017-06-29 16:02:36 +09:00
Andy Williams 53065309b8 elm_code: Fix select-all column calculations 2017-06-17 17:59:40 +01:00
Sanjeev BA ed201d7f30 Add support for select all with ctrl-a
Summary: Signed-off-by: Sanjeev BA <iamsanjeev@gmail.com>

Test Plan: Test with edi.

Reviewers: ajwillia.ms, jpeg, cedric

Reviewed By: ajwillia.ms

Differential Revision: https://phab.enlightenment.org/D4971
2017-06-17 17:42:18 +01:00
Andy Williams 28311d4327 elm_code: Fix possible crash when deleting a selection
If there was a multiline selection that ended at the end of a line this could crash
@fix
2017-06-09 23:40:40 -07:00
YeongJong Lee 0b67bfc031 elm_code: fix wrong selection delete
Summary:
If multi selection have 0 column and delete the selection, 0 + 1 column also
deleted
This fix that bug.

Also, remove needless code.

Test Plan:
1. select multi line with 0 column.
2. delete the selection

Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4922
2017-05-30 08:50:18 +01:00
Andy Williams eb04ab591c elm_code: Fix insertion of multiline content in widget
A small refactoring to reduce code duplication as well :)
2017-05-16 22:13:43 +01:00
Andy Williams 3b9e69e888 elm_code: Expose API for inserting text at cursor
widget operations use NULL terminated strings, backend does not.
Refactor some selection code so all selection deletions trigger
undo events (except where they should not).
2017-05-03 08:17:06 +01:00
Andy Williams e99bfd7e7d elm_code: Fix selection,start signal
@fix
2017-04-28 21:18:35 +01:00
Andy Williams d2406c3700 elm_code: Fix empty selection checks 2017-02-02 18:47:59 +00:00
YeongJong Lee 251469e2fe elm_code: add copy/paste/cut undo
Summary: The patch for supporting copy,paste and cut undo

Test Plan:
1. elementary_test - Code Editor
2. Check that undo work correctly when copy,paste and cut

Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4636
2017-02-01 09:23:08 +00:00
YeongJong Lee 928091bedb elm_code: fix that selected code can't undo
Summary: Change some undo logic and remove unused function

Test Plan:
1. elementary_test - Code Editor
2. Select lines.
3. Remove selected lines.
4. undo removed lines(<Ctrl> + <z>)

Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4631
2017-01-31 19:40:20 +00:00
Andy Williams d86143212a elm_code: Fix selection when moving around with cursor keys
Also fix the handling of newlines in our selections
@fix
2017-01-15 22:41:48 +00:00
Andy Williams 6d4f1501bf elm_code: Selections of word break on quotes too 2017-01-10 12:53:21 +00:00
Andy Williams 0014d0b99e elm_code: Fix another public API using the wrong order 2016-12-27 22:17:01 +00:00
Andy Williams 34c28918d5 elm_code: Don't assume control characters make a change
@fix
2016-12-17 13:12:46 +00:00
Andy Williams e0299f3510 elm_code: Fix parameter ordering for consistency 2016-12-12 08:29:51 +00:00
Andy Williams f290f9ca4c Elm: Fix crashes with copy/paste of large code
Various fixes to the memory management of multiline strings
2016-09-01 21:41:57 +01:00
Vitor Sousa 8356b16a49 Efl Object: remove legacy callback calls from event_callback_call
Efl.Object.event_callback_call no longer calls legacy smart callbacks;
calling only event callbacks registered with the given event description
pointer.

Create the method Efl.Object.event_callback_legacy_call to inherit the old
behavior from Efl.Object.event_callback_call, calling both Efl.Object events
and legacy smart callbacks.

Update all other files accordingly in order to still supply legacy
callbacks while they are necessary.
2016-08-26 15:45:07 -03:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Chris Michael d0826aacb7 elementary: Remove set but unused variable
This variable looks like it may be used in the future, but for now
just causes additional compiler warnings so comment it out for now.

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-07 13:37:53 -04:00
Cedric BAIL d384012307 elementary: merging in elm_code widget.
Theme is not there as it should be manually merged into the elementary
default theme.
2016-06-02 17:19:08 -07:00