Indexing issue with the Ace editor

Hello,
I have tried convergence in my angular project with the ace editor.
I’m facing an indexing issue with the code.
Here are the steps to reproduce the issue.

Step 1: Open an example of ace editor on the convergence website and paste the below code.

using System;

public class Test
{
    public static string battle(int Y)
    {
        string result = "";

        //write your Logic here:


        return result;
    }
    public static void Main()
    {
        //INPUT [uncomment & modify if required]
        int Y = 0;
        Y = int.Parse(Console.ReadLine());

        //OUTPUT [uncomment & modify if required]
        Console.WriteLine(battle(Y));
    }
}

The editor looks like this-

Step 2 -
After pasting code insert “hello” text at line no. 11 -

Step 3 -
When we insert “hello” text, other participants who have joined the same session will see the below code on their code editor.

How to solve the above issue?
Thanks in advance

Just to make sure I understand. Are you inserting the text with the quotes or not? This could be a bug with the Ace Editor Extensions. We have seen instances where the Ace Editor tries to do something smart and adds or removes characters when pasting in.

hi @michael
Thanks for your reply.
I’m inserting text without quotes.
I’m inserting plain text i.e. hello.

What do I need to do to solve this error?

This looks like a bug in the ace editor extensions. We will likely have to release a new version. There is likely an issue with the adapter when there is a paste event. What version of the ACE editor are you using?

Ace Editor version - 1.4.5.

CDN - https://pagecdn.io/lib/ace/1.4.5/ace.js

Alright. I will check this out this weekend and let you know if there is a bug fix availble.

Hi @michael

Any update?

I have also faced this issue with the Monaco editor.
Sometimes it is inserting text at the wrong index.
Attaching a screenshot for more details.

The screen of participant 1 who inserted text -

The screen of participant 2 -

Text -

#include <stdio.h>
#include <string.h>
void battle(char Y[]){
    
    //write your Logic here:
    
    
    puts(Y);
}
int main(void) {
    //INPUT [uncomment & modify if required]
    char Y[100]=" ";
    gets(Y);
    
    //OUTPUT [uncomment & modify if required]
    battle(Y);
}

Hi,
I have simmilar issue, and now was solved by read advice you guys
jakarta selatan
thanks
best regards