Highlight modified text



  • Hi,

    Suppose I open a file and want to make some changes. I want my changes to be highlighted or marked in some way, so I can distinguish them from the original text.
    Do I have such an option?

    Thanks,
    Raz



  • welcome to the notepad++ community, @Raz

    yes, the Compare plugin does exactly that, by marking new texts or code as green on the right side, and showing all deleted parts in red on the left, as seen at the screenshot below.

    Imgur

    to refresh the differences while editing, press ctrl+alt+c.

    if you are on notepad++ 7.6.3 or above, you can install this plugin by using the built in notepad++ menu: plugins > plugins admin.
    if you are on notepad++ 7.5.9 or below, you can install it either manually, or by using the old plugin manager.



  • Find LocationNavigate plugin



  • I love LocationNavigate … when it works. It always seems to crash N++ for me. If the bug could be squashed, I’d be using it.



  • @AZJIO-AZJIO

    How is LocationNavigate relevant here?

    @Michael-Vincent

    I use LocationNavigate (never crashes for me!) only for its “change marker” feature. I can’t live without that. I think LocationNavigate is only 32-bits and the author no longer cares to support it. How come you didn’t mention this one in the other thread where you talked about porting plugins to 64-bits (maybe because it crashes for you)? Anyway, since you have some plugin skills (apparently), couldn’t you run LocationNavigate code as-is under control of the Visual Studio debugger–maybe get some insight into the crash? Then you could fix it, port it all to 64-bits, and add one more plugin to your list of things you don’t want to take ownership of. :)



  • I’ve tried, see:

    https://github.com/notepad-plus-plus/notepad-plus-plus/issues/240
    https://github.com/vinsworldcom/nppLocationNavigate/pull/1

    Still crashed N++ on exit. No use in trying to port to 64-bit when 32 doesn’t work for me and others.



  • How is LocationNavigate relevant here?

    Direct relationship. The author asked to control the change. Plugin marks modified lines.



  • @AZJIO-AZJIO

    You know what, you’re entirely right! I latched onto @Meta-Chuh 's compare explanation because it was very visual (and of course because Meta’s stuff is always so great). But all the OP really wanted was exactly what LocationNavigate’s change-marker feature provides.

    How about a replacement for just that feature? Esp. since LN seems to have gone unmaintained for a while now. Maybe a Pythonscript could do it. What do you think @Ekopalypse or @Eko-palypse ? At one time I looked into doing it with a PS and it seemed reasonable until you think about Undo and Redo, then it all fell apart. But maybe some other big-thinkers have ideas.



  • @Alan-Kilborn

    and of course because Meta’s stuff is always so great

    lol, epsecialy my typos 😉



  • @Ekopalypse / @Eko-palypse

    Suggestion: If one of your IDs is truly defunct, ask @guy038 as an admin on this site to remove it, or maybe better, combine your old posts with your current id (dunno if that’s possible)?

    Okay, so do you know the LocationNavigate change-markers? Basically, it puts an orange circle in the margin for any line that has changed since the file has been opened into a N++ tab, and then when the file is saved all of these orange circles get changed to green. So at a point, your file may look like the following. Easy, right? :)

    Imgur



  • @Alan-Kilborn

    you are a mind reader - that’s what I was starting about to ask :-)
    OK, sounds reasonable - let me think about it.

    @guy038, yes, if there is a way to delete the old Eko-palypse account you have my approval to remove it.



  • So lifetime of such markers end when closing npp?
    I mean, if I do changes on a document and close npp without saving it is not expected
    to see the markers of those changes once npp restarts, right?



  • What about deleting lines? How is this covered?



  • @Ekopalypse said:

    if there is a way to delete the old Eko-palypse account you have my approval to remove it

    Hmm…second thoughts. There are probably some nuggets you composed under that ID. Probably should just keep it. I’ll try to remember which one is current.

    lifetime of such markers end when closing npp?

    Yes, for me it is fine. For those people that love to quit N++ and have red tab icons, it is probably not ideal, but forget them, they have bigger issues. :)

    deleting lines

    They are gone, can’t see them…no indication they were ever there in this scheme.



  • @Alan-Kilborn

    , they have bigger issues

    I see, to know that there was a change but you see only NULLs isn’t funny LOL



  • @Ekopalypse

    Probably the best way to get a feel for this is to install LocationNavigate and turn on the Mark Changed Line option. If you’re so inclined. 32-bit only AFAIK.

    Once exposed, it quickly becomes a feature you can’t live without, IMO.



  • @Alan-Kilborn

    thx - to portable - I’ll give it a try and thx for the hint about 32bit.



  • @AZJIO-AZJIO and all

    Direct relationship. The author asked to control the change. Plugin marks modified lines.

    i disagree. the op requested the changes to be highlighted. (diff)
    meaning every single word, section, or character that have been added and or deleted shall be highlighted.

    original quote:

    I want my changes to be highlighted

    as far as i can see while testing, location navigate can not do that.
    only complete lines are marked, but not the changed words or sections, in green for added and red for deleted, and deleted text is not shown at all.

    can you confirm, or are there settings to achieve a diff view as requested ?

    example of deleted and added text diff view in compare:
    Imgur



  • @Meta-Chuh

    Wow, you are correct again. I wish people’s opinions would stop changing my mind! :)

    There’s really 2 schools of thought here, one is a diff from a basis, one is marking lines that are changed on a ternary scheme (no mark=no change, colored-mark: changed since last save, different colored mark: changed since start of session but now saved). Both schemes have value, but at different times.

    When I want a diff, I’ll call one up. I want line-has-been-changed marking constantly.



  • As far as I have understood, there are two main functions that LN has.

    1. marking lines with changes and
    2. jump to historical cursor positions (which is what I always wanted to have but never really started to implement)

    That basically means a script needs to provide two lists per buffer
    which do get loaded on bufferactivated event.
    Filesaved event changes the color of the markers.
    Fileclosed event deletes the two lists of that buffer.
    And an additional margin, which is used by the markers, needs to be introduced.

    Configuration options for cursor positions are

    1. position offset (basically when new position is valid to be recorded)
    2. limit of how many historical positions are stored

    configuration options for marking is what kind of marking to be used

    I guess, that’s it - more or less, right?


Log in to reply