Code Monkey home page Code Monkey logo

Comments (5)

suntong avatar suntong commented on June 15, 2024

Hi @sabarnett,

I was trying to fix this as well when fixing #16, but it turns out that what I found:

 private void button1_Click(object sender, EventArgs e)
    {
      textBox1.Focus();
      textBox1.Select(0, 0);
    }

Cannot be applied to EasyScintilla SimpleEditor.

Do you know how to fix this problem?
Ok if not, as Notepad++ suffers the same problem as well.

from jsoncsharpclassgenerator.

sabarnett avatar sabarnett commented on June 15, 2024

Not sure what the problem is. I just pulled the latest code and ran it. I always end up with the caret positioned on the first character. What're you seeing that's different or what are you expecting to see?

If it's the line/column number that is odd, that'll be because you need to call UpdateCursorPosition() after you reload the content of the editor. This is what I am seeing after the beautify:

afterbeautify

from jsoncsharpclassgenerator.

sabarnett avatar sabarnett commented on June 15, 2024

Might also be useful to know:

`

        // Moves the caret to the start of the document
        edtJson.CurrentPosition = 0;

        // Ensures that the aret is visible on screen
        edtJson.ScrollCaret();

        // Gets the position in the file of the first line
        var startOfFirstLine = edtJson.Lines[0].Position;

        // Gets the position in the file of the tenth line
        var startOfTenthLine = edtJson.Lines[9].Position;

        // So to go to the 6th line, you would
        edtJson.CurrentPosition = edtJson.Lines[5].Position;
        edtJson.ScrollCaret();

        // This is what updates the row/column indicator
        UpdateCursorPosition();

`

from jsoncsharpclassgenerator.

suntong avatar suntong commented on June 15, 2024

Oh, I'll try again next Monday to see how exactly to duplicate it (or whether possible at all), and let you know...

from jsoncsharpclassgenerator.

suntong avatar suntong commented on June 15, 2024

It appear to be a one-time thing that can't be duplicated. Sorry to take your time @sabarnett.
Thanks for the follow up -- it is indeed "useful to know", :-).

from jsoncsharpclassgenerator.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.