Project Description:
We need an Ace editor that will edit 2 files in the same time
files could be in any language supported by ACE, and the language of the files might not match.
Design: two ACE editors, side by side (left right),
All code has to be client code, JavaScript, no server code (e.g. no PHP)
UI would look like
[checkbox] Sync
1) void main(void) { | x | void main(int args, char** vargs) {
2) int a = 7; | x | int a = DAYS_IN_WEEK;
...
controls:
A) left side editor
B) middle controls, with one button x for each line, when pressed it will delete that line from both editors
C) right side editor
D) Sync checkbox, can't be selected, unless the files have exactly the same number of lines!
When Sync is unchecked, both editors will edit their files freely
When Sync is checked, the editors will function as:
1) the files scroll together to show the same lines of code
2) if 1+ lines are deleted from one editor, they will be deleted from the other editor too
3) if a line is partially edited, no changes will be made on the second editor
4) at all times, both editors must have the same number of lines of code!
5) if text is copied in clipboard, and pasted somewhere else, completed lines on the second editor will be copied too
example
1) void main(void) { | x | void main(int args, char** vargs) {
2) int a = 7; | x | int a = DAYS_IN_WEEK;
3) int b = 52; | x | int b = WEEKS_IN_YEAR;
we we copy
" (void) {
int a = 7;
int"
then "int a = DAYS_IN_WEEK;" will be copied too
Ideally everything should be in 1 file! We might accept IFRAME usage (editors could be iframed), if ACE editor does not accept two types editors with different languages on the same html (e.g. a c++ one and a java).