GithubHelp home page GithubHelp logo

Comments (5)

lloydtao avatar lloydtao commented on June 15, 2024

Squashed it. Word wrap needs to be toggled before launching, but toggling it after start makes it crash.

Will re-word issue.

from render-with-notepad.

khalladay avatar khalladay commented on June 15, 2024

ah, word wrap was on by default on my system. Try that! :P

What might be happening is that toggling word wrap is somehow changing the address of the on screen before (maybe destroying / reallocating? or something else a little more clever), and if you try to write process memory to the old text buffer pointer after toggling word wrap, you try to write to a now-invalid address.

I'm happy to accept a pull request that has the code enabling word wrap before writing text!

from render-with-notepad.

lloydtao avatar lloydtao commented on June 15, 2024

Sounds like you have a better idea than I over the crash.

As for setting the word wrap, it's a setting in the registry, and seems very safe to edit.

image

I'll work on the PR shortly.

from render-with-notepad.

khalladay avatar khalladay commented on June 15, 2024

Happy to take a look at a PR, although I do wonder if this could be done without touching the registry. From stackoverflow, it looks like win32 edit controls don't support toggling word wrap (notepad just destroys the existing edit control and creates a new one).

If it's possible to query the status of word wrap in the existing edit control, we can probably just send the right message to the Notepad menu bar to toggle word wrap if we need to, before acquiring the address of the text buffer (since if we do things in the opposite order, we'll get the crash you reported).

Two things need to be sorted out for that:

  • Querying whether the existing edit control has word wrap enabled
  • Sending the right message (or messages) to the menu bar to make it toggle on word wrap

from render-with-notepad.

lloydtao avatar lloydtao commented on June 15, 2024

I unfortunately wouldn't know where to start with that. Out of my expertise! 😛

I do back up the fact that there's no control for it (https://stackoverflow.com/questions/83045/command-switch-to-toggle-notepads-word-wrap), and I support the fact that this is much healthier than editing the registry.

from render-with-notepad.

Related Issues (4)

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.