Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

editor line focus issue #1342

Closed
mingji opened this issue Apr 1, 2013 · 2 comments
Closed

editor line focus issue #1342

mingji opened this issue Apr 1, 2013 · 2 comments

Comments

@mingji
Copy link

mingji commented Apr 1, 2013

hello, ace experts!
I would like place some text in each line which is not div tag, and focus them by mouse click.
by default, ace editor only focus mouse cursor inside of the text of line.
I want focus on outside of line where I add element.
2

I 'v inserted my code in lib/ace/layer/text.js like as following.(only pay attention for mingji's comment)

// row is either first row of foldline or not in fold
this.$renderLine = function(stringBuilder, row, onlyContents, foldLine) {
    var lineNumber = row;
    if (!foldLine && foldLine != false)
        foldLine = this.session.getFoldLine(row);

    if (foldLine)
        var tokens = this.$getFoldLineTokens(row, foldLine);
    else
        var tokens = this.session.getTokens(row);


    if (!onlyContents) {
        stringBuilder.push(
            "<div class='ace_line' style='height:", this.config.lineHeight, "px'>"
        );
    }

    if (tokens.length) {
        var splits = this.session.getRowSplitData(row);
        if (splits && splits.length)
            this.$renderWrappedLine(stringBuilder, tokens, splits, onlyContents);
        else
            this.$renderSimpleLine(stringBuilder, tokens);
    }

    if (this.showInvisibles) {
        if (foldLine)
            row = foldLine.end.row

        stringBuilder.push(
            "<span class='ace_invisible'>",
            row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR,
            "</span>"
        );
    }

    //<<2013.03.30 mingji add this code for comment input
    stringBuilder.push(
        "<table id='notegrid",lineNumber,"' border='0' class='ace_notecomment' cellpadding='0' cellspacing='0' style='height:", this.config.lineHeight-4, "px;'> \
        <tr id='R",lineNumber,"'> \
        <td class='ace_notecomment_cn' >//note_cn</td> \
        <td class='ace_notecomment_en' >//note_en</td> \
        </tr> \
        </table>"
    );
    //>>

    if (!onlyContents)
        stringBuilder.push("</div>");

};

so such that image mockup displayed in my editor area.
but I cant focus mouse cursor on table td element on line.
please help me.

@mingji mingji closed this as completed Apr 3, 2013
@mingji mingji reopened this Apr 4, 2013
@nightwing
Copy link
Member

@mingji, last time i looked into this issue it was closed and had no content, unfortunately i haven't seen your updated version, since github doesn't send email notifications when issue is edited.
Is this issue still relevant? did you find a solution?

@github-actions
Copy link

github-actions bot commented May 9, 2022

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants