Commit Graph

144 Commits

Author SHA1 Message Date
Andy Williams d24ded8b5a editor: grab keys that should not feed down to elm_code 2016-12-17 13:16:18 +00:00
Andy Williams a112dcad9e autosuggest: properly guard the clang variables 2016-12-17 12:31:36 +00:00
YeongJong Lee 8d82796fa1 autocomplete: fix screen flicker when use autocomplete
Summary: Remove file save function when initialize clang.

Test Plan: Check that the screen is not blinking when use autocomplete.

Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Differential Revision: https://phab.enlightenment.org/D4486
2016-12-16 22:06:49 +00:00
YeongJong Lee 9d128bdb40 autocomplete: Refresh candidate list when typing.
Summary:
if you start typing when candidate list is shown,
the list refresh immediately.

Test Plan:
1. Run edi.
2. Open project.
3. Open candidate list using <ctrl> + <space>.
4. Continue typing.
5. Check the candidate list is correct.

Reviewers: bu5hm4n, ajwillia.ms

Differential Revision: https://phab.enlightenment.org/D4478
2016-12-13 07:42:36 +00:00
Andy Williams 3f76c4d290 elm_code: update parameter order 2016-12-12 08:30:59 +00:00
Andy Williams efd56cf918 fix typo in patch 2016-12-12 00:24:51 +00:00
YeongJong Lee ebc07e85e0 autocomplete: Add code autocomplete using clang
Summary:
Pressing shortcut(<ctrl> + <space>) while editing the code show
the list of suggestions.

This support variable, function, struct member.. etc.
It is simple version, so it show just function name without parameter, return type.

Test Plan:
1. Run edi.
2. Open project.
3. Press shortcut(<ctrl> + <space>) while editing the code.
4. Check that the list of suggestions are correct.

Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: bu5hm4n

Differential Revision: https://phab.enlightenment.org/D4476
2016-12-12 00:23:22 +00:00
Jean-Philippe Andre 886b6356bd editor: Fix crash when resizing without any code open 2016-11-30 15:34:34 +09:00
Andy Williams 49f7506521 highlight: cancel the file parsing on line events
Either we have removed a line and could crash or we have
added a line and everything will be off by one!

This will get fixed moments later by the line change event
2016-11-28 01:46:07 +00:00
Andy Williams 1578481d46 ui: only use help lookup if control pressed 2016-09-11 19:17:21 +01:00
Andy Williams f71e4899c2 ui: Fix various toolbar items since tab chnges
oops :( lookup data in the right context
2016-09-10 23:41:14 +01:00
Andy Williams e9b18c4560 syntax: Fix bad racey thread conditions 2016-09-09 16:21:11 +01:00
Andy Williams 2262d7bf1c elm_code: Removed and migrated to using the elementary merged version 2016-06-10 10:03:40 +01:00
Andy Williams dcd56607a9 editor: re-enable undo
Oops, we blocked elm_code from doing it's job
2016-05-17 23:24:14 +01:00
Andy Williams 1971583e5e [help] Stub out a right-click-help UI
Not looking anything up yet but we're getting started
2016-04-07 17:44:12 +01:00
Andy Williams bca7ef40b8 tidy old stubs 2016-04-07 17:43:05 +01:00
Andy Williams b3a9bd0f2c Update to latest eo syntax
Thanks for the script Tom :)
2016-03-10 00:06:50 +00:00
Andy Williams acd7b54473 [editor] begin re-adding the undo feature.
This is provided completely by elm_code so can be reused in other editors.
For now this is just text/newline insertion...
Still have to add undo for deletion and selection
2016-02-21 18:11:33 +00:00
Andy Williams 557fb79396 [editor] Support space insertion instead of tabs
Elm_Code support and option in Edi to use spaces when the
Tab key is pressed - make this default too.
2016-02-09 00:32:16 +00:00
Andy Williams 2f0347b108 [editor] Make whitespace trimming an option
Add a global setting to turn off the behaviour
2015-08-29 14:46:18 +01:00
Andy Williams 155ec77ac8 [editor] fix stability of the highlighting thread
Grab locks at the correct times, seems to help a lot...
2015-08-28 00:12:59 +01:00
Andy Williams 1c7e2b3873 editor: improve goto line dialog
Focus the input when we show and allow enter press to submit.
Also refactor it out of the edi_main mess.
2015-07-16 22:36:15 +01:00
Andy Williams 3f86407481 elm_code: consistently use 0 based text index
This means it's more familiar as regular string work when
using the elm_code_line APIs. It's also more distinct from
the elm_code_widget layout which is still 1 based columns.
To support unicode we must convert correctly.
Now FIXED!
2015-06-03 21:29:31 +01:00
Andy Williams e3ed8806c3 elm_code: add legacy API.
Refactor eo API in line with elm_obj_* elsewhere
2015-06-02 08:22:36 +01:00
Andy Williams 7bf0fc7c3c highlighting: Fix threading to avoid overlap crash
It's not threadsafe code within the editor so block
a thread if another is already running.
Also ditch pthread for Ecore_Thread :)
2015-05-30 22:56:41 +01:00
Andy Williams f4c48d4ca9 elm_code: support setting custom fonts
For EDI create the config that would allow this to be altered.
Actual setting widget to follow...
2015-05-30 10:31:46 +01:00
Andy Williams bf17d7c8af config: save project config in the project dir
globally storing info about projects loaded, file associations
and the general user preference.

GUI and usage settings stored in <project>/.edi folder
2015-05-16 09:59:08 +01:00
Andy Williams a0d6627f54 elm_code: add a TODO/FIXME standard parser
Corret some callback code and re-parse each time the file is saved.
Use this to clean up save/parse code in EDI too
2015-04-20 01:21:03 +01:00
Andy Williams 179b0e713f clang: Fix crash if error is not related to a file 2015-04-12 23:39:38 +01:00
Andy Williams 17d8b30e00 syntax: Only display errors for current file
Clang can report from various sources,
only add those that are from the current file
2015-04-12 23:06:28 +01:00
Andy Williams bc6ec2dd6f syntax: reset status and hints when we reset token
re-use elm_code methods when we do this in edi
2015-04-12 23:04:46 +01:00
Andy Williams d03675ba71 clang: fix paths used in syntax lookup
Pass in the edi build config to get efl params.
Also find the correct system include for clang dynamically
2015-04-12 22:25:41 +01:00
Andy Williams c0654b6c4e clang: remove debugging 2015-04-12 16:47:53 +01:00
Andy Williams 6fc3da889b Fix crash where clang encounters too many errors 2015-04-12 15:39:47 +01:00
Andy Williams efec7c1f37 editor: add tabstop configuration
Allow setting of the tabstop. App wide for now.
2015-03-29 20:40:24 +01:00
Andy Williams f1571f296e settings: Allow configuration of line width marker 2015-03-28 00:45:20 +00:00
Andy Williams 2a1320d1f1 clang: tidy clang disposal and remove notes 2015-03-28 00:18:20 +00:00
Andy Williams ace8350ac2 highlighting: clear errors that no longer apply
Also refresh more regularly now it's faster
2015-03-27 23:55:17 +00:00
Andy Williams 4f8ece09cf clang: save errors and display if clicked
Using a gutter click in elm_code to print to console for now
2015-03-27 23:54:28 +00:00
Andy Williams 8eb3978c1e elm_code widget: fire user change events
This does not yet have a "change" attached so does not
support undo/redo yet
2015-03-21 20:04:12 +00:00
Andy Williams c29c9c5133 editor: display the line endings for the file 2015-03-21 13:56:27 +00:00
Andy Williams 0509eb1841 settings: configure the display of whitespace
Refresh this when config changes
2015-03-14 13:10:38 +00:00
Andy Williams 8730b4dfb3 config: Update editor when font size changes 2015-03-08 22:28:21 +01:00
Andy Williams b97da3b70a Merge branch 'master' into devs/ajwillia-ms/elm_code 2015-03-08 22:27:38 +01:00
Andy Williams e62ddd5bc1 config: add settings screen
Add a new autosave flag, upgrade config so it's set.
Listen to a config_changed event to update UI where required.
2015-03-08 22:14:25 +01:00
Andy Williams 0c2819bd4f editor: update to latest elm_code and show whitespace 2015-02-28 16:28:22 +00:00
Andy Williams c98ba7d1e8 syntax: Actually use the elm_code parser api.
Improve the API to allow passing of user data to the calls.
Yes, I forgot about this, it works well so remove the STYLE_SET callback
2015-02-24 00:32:40 +00:00
Andy Williams 71fa2d13c8 elm_code: display a line-width marker if requested 2015-02-23 21:52:49 +00:00
Andy Williams c18fccb646 syntax: Add line highlighting for clang errors
This never worked on the old elm_entry code!
Highlight where clang knows a problem exists.
Not yet inserting a caret, but there's more to be done...
2015-02-21 18:54:52 +00:00
Andy Williams 7212dc24bb syntax: Remove unneeded timers and threads.
Now that it's all much faster and more reliable we don't need to resync etc
2015-02-21 18:48:33 +00:00
Andy Williams bbe671626e elm_code: Support multi-line tokens
Adding a new token to each line it covers.
Each token references the end line so newline behaviour can be set
2015-02-21 18:24:17 +00:00
Andy Williams dd9f96d2c0 syntax: Update clang to output elm_code tokens
Addition of a refresh line command to say we're done.
We no longer need an active window for highlighting
as it's so much faster!
2015-02-21 17:30:17 +00:00
Andy Williams 187d9e609a elm_code: get / set the cursor position
When the cursor is updated make sure we have scrolled
so it's visible. Also adjust focus next points too.
2015-02-19 21:16:18 +00:00
Andy Williams 30460899a6 elm_code: Actually use it as our main editor window!
Need to hook in the clang highlighting and undo stack to the elm_code_widget
2015-02-19 00:22:07 +00:00
Andy Williams d79ee5a19a Fix some warnings when compiled without clang.
Also fix format of inner preprocessor ifs.
Patch from Vincent Torri.
2015-02-15 17:53:00 +00:00
Andy Williams aae8ea89bb editor: Let's reduce calls to saving files or resetting highlights.
Keep an eye on what has to be saved.
Only re-run clang parsing if we've actually saved recently
2015-02-14 23:55:05 +00:00
Andy Williams 8032f0fcd6 editor: delay autosave to 5 secs but save on unfocus too 2015-02-11 22:39:25 +00:00
Andy Williams 3a3bf2b6db editor: Control the auto-save function locally so we can re-sync with clang.
This should mean that highlighting, whilst still slow and flickery, does not corrupt.
2015-02-08 23:22:16 +00:00
Andy Williams 7c8d84d110 Fix a few warnings and possible build issues 2015-02-08 00:55:51 +00:00
Andy Williams c233fcad81 Split code editor type from text, don't try to highlight text.
Update our internal registry to know the difference between text and code.
Add some tests that verify we're getting the right type of editor.
2015-02-06 14:16:26 +00:00
Kelly Wilson ddfaa2798e Comment fix
Fix a small mixup with a comment for horizontal scrolling
2015-02-02 13:30:56 -07:00
Kelly Wilson 7bb6bca74c Merge branch 'open_file_new_win'
Fix a segfault when opening a file in a new window and pressing a key immediately.
2015-02-01 16:30:29 -07:00
Kelly Wilson 22cfc584d6 Edi_editor.c: Fix segfault
Fix a segfault when opening a file in a new window and then pressing a key without any other interaction. Simply check if item is null and return without action if it is.
2015-02-01 09:09:25 -07:00
Kelly Wilson a64ea17e68 Fix horizontal scroll highlighting
This small change just bypasses highlighting if there is a y scroll. Vertical scrolling still updates the highlighting.
2015-01-31 12:24:25 -07:00
Andy Williams 01cb36f510 More updates to correct API/export declarations for Windows.
Various changes brought in. Patch from Vincent Torri - thanks
2015-01-10 17:43:12 +00:00
Andy Williams 2249bcfc71 Adding replace support to our search bar.
Run a search first if one has not been, from then replace the current term and search again.
Submitted by Kelly Wilson
2015-01-18 17:36:12 +00:00
Andy Williams 5f55947048 Make incremental highlighting refresh a line at a time to reduce flicker on redraw 2014-12-08 21:03:06 +00:00
Andy Williams d973bbd5c4 Improvement to incremental highlighting - its not fast but it will not get slower.
Next the refresh window needs to reduce and any edits should adjust the tokens we have loaded
2014-12-06 15:23:32 -06:00
Andy Williams a36b687a47 Update the highlight code to refresh only what's on screen.
This is a temporary solution - saving CPUs mostly until elm_code is ready
2014-12-04 18:12:56 -06:00
Andy Williams 1fb649b732 Add a config system for remembering settings etc
.
Add a recent projects list to our welcome page which remembers what we open
2014-12-01 16:54:17 -06:00
Andy Williams 141a3a2107 Fix a crash bby removing some dead code.
Parsing will move to elm_code in the long term anyway
2014-12-01 13:11:29 -06:00
Andy Williams 5ec3492e36 Fix crash when highlighting multiple files in the background 2014-11-30 12:01:53 -06:00
Andy Williams 6fd2aed6f1 Update syntax highlighting to run in the background.
Hook the highlight runner into ctrl-s so you can get it to re-parse appropriately (this will be slicker with elm_code)
2014-11-30 16:25:11 +00:00
Andy Williams 20655d2bf9 Fix bug with undo not operating on current tab - fixes issue T1853.
Seems like a weird bug in the smart callbacks as they would pass the wrong event data in!
2014-11-29 20:13:18 +00:00
Andy Williams 3350a896ed change the colour of strings - does not seem to apply to all strangely, will dig further into CLANG tokens later 2014-11-13 21:35:58 +00:00
Andy Williams 863a4a47a2 Update the syntax highlighting to work after text set - thanks a lot to herdsman for the initial patch 2014-10-23 21:14:46 +01:00
Andy Williams f7336e9276 fix syntax mistake after changing markup type 2014-10-22 22:43:32 +01:00
Boris Faure 8fadf10987 fix some compiler warnings 2014-10-22 21:16:17 +02:00
Andy Williams 76675f6298 Use the recommended formatting for colour, avoid font weight right now as it doesn't stack properly 2014-10-21 14:26:46 +01:00
Andy Williams 5402a5921f Using the +/- format application to remove bold etc where used.
This requires a patch from herdsman to evas to work effectively
2014-10-20 23:20:14 +01:00
Andy Williams 174210cb02 Trying some slight optimisations for highlighting 2014-10-16 20:47:57 +01:00
Andy Williams ae9990f06c Tweaking syntax a little to have 1) less vivid comments and 2) the same colour for macro introducing punctuation characters as the macro they introduce 2014-10-12 13:34:41 +01:00
Andy Williams 84b25a2090 Implement the colouring of code based on the clang parser.
Has some issues with performance and failing on large files which need to be looked into.
2014-10-10 13:43:54 +01:00
Andy Williams f11369a361 Merge the clang syntax highlight parsing work from edi PROTO.
That's the parsing complete but I need to hook it into style the elm_entry widget...
2014-10-09 00:06:55 +01:00
Andy Williams 9ac976aa17 Add mime or requested type to text editor status bar.
Some refactoring to start splitting out file management from UI
2014-09-13 16:48:16 +01:00
Andy Williams c9d52cda28 Fix new window sizing following the layout changes 2030-07-13 03:06:54 +01:00
Andy Williams a25b043761 Move search UI into a panel at the top of the editor.
Correct search to work across multiple tabs within one Edi instance. Fix various issues around searc.
2030-07-12 21:12:05 +01:00
Andy Williams 64862ac5f1 Adding a status bar to editors, currently displaying line & col info 2030-07-10 00:03:26 +01:00
Andy Williams 961f65d910 Update line numbers to be the same length as content to better match the rows.
Still has an issue with very long files, but that's being investigated
2014-06-15 22:54:08 +01:00
Andy Williams 04a8a274a0 Correct the lining up of numbers, still a little off for scale=2, not sure why 2014-06-07 23:29:03 +01:00
Andy Williams d90d0e3c94 Adding line numbers to the text editor.
Not the prettiest approach right now, but we've got a scrolling list of lines that stays aligned with the text scroll
2014-06-07 21:50:14 +01:00
Andy Williams 43871e9a0c kill warning about ignored return 2014-05-18 23:00:10 +01:00
Andy Williams a3a4f5fce6 Added basic undo support - thanks to ecrire (Tasn) for the undo_redo_do function 2014-05-15 23:25:25 +01:00
Andy Williams d2117bac25 Begin factoring out the text editor from the mainview code 2014-05-15 22:40:19 +01:00