#78 Don't unmark line as diff just b/c user typing

closed-rejected
None
5
2003-04-26
2003-03-23
No

Right now, when I start typing in a changed row
(yellow), it immediately turns white until I stop
typing & Rescan runs again. I think it should stay
yellow until Rescan runs again. Here is what it takes
to do that:

In MergeEditView.cpp
in method void CMergeEditView::OnEditOperation(int
nAction, LPCTSTR pszText)

Change the code that sets the line flag to this:

// clear left only, right only, or deleted flags
// editing in 'blank' areas should be considered
CPoint ptCursorPos = GetCursorPos \(\);
int clearflags = LF\_WINMERGE\_FLAGS & ~LF\_DIFF;
m\_pTextBuffer->SetLineFlag\(ptCursorPos.y, clearflags,

FALSE, FALSE, FALSE);

This is to *not* remove a diff flag if set for the line.

Discussion

  • Kimmo Varis

    Kimmo Varis - 2003-03-25

    Logged In: YES
    user_id=631874

    Works great!

    Please apply this one before next beta.

     
  • Anonymous - 2003-03-25

    Logged In: YES
    user_id=60964

    Maybe we shouldn't change the line flags at all here.

    We not only don't know which side they're typing on (so we
    don't know whether we should remove left only or right only
    flags), but we we don't know if they're making the line
    different, or making it the same.

     
  • Kimmo Varis

    Kimmo Varis - 2003-03-26

    Logged In: YES
    user_id=631874

    Valid points.

    When user is typing lines can't be same, unless whitespace
    is ignored and user adds them.

    After more thought Its maybe better to have line painted
    with "normal" colors when typing. It's more usable. If you
    have white background and black text as normal colors thats
    much more readable than dark red as diff backround and black
    text...

     
  • Anonymous - 2003-03-26

    Logged In: YES
    user_id=60964

    I was actually proposing leaving the line color just as it
    is (no flag alterations). What you're proposing is leaving
    the *code* just as it is (clear flags), I think, because
    what we have now is the line turns white as soon as you
    start typing.

    I thought it was weird that it turned white. But, you're
    right, that is more legible, and maybe that is the most
    important criteria (that user can see what s/he is doing! :))

    I'm willing to abandon this and leave code as is (as anyway
    I just can't think what is best).

    What happened was that after I applied this, but before I
    checked it in, I discovered that left-only areas turned to
    diff, even if I was typing in the left-only part (so that I
    wasn't making it into a diff), and then I realized that it
    is probably too difficult to get the color correct on-the-fly.

     
  • Kimmo Varis

    Kimmo Varis - 2003-04-08

    Logged In: YES
    user_id=631874

    I'v seen couple of times that after I edit line its not
    changed back to diff colors. I have no clue about what's
    going on then. Maybe rescan() was not called after delay.
    I can't reproduce easily :(

    Another possibility is that flags for line are not
    cleared/set correctly.

     
  • Anonymous - 2003-04-26
    • assigned_to: nobody --> puddle
    • status: open --> closed-rejected
     
  • Anonymous - 2003-04-26

    Logged In: YES
    user_id=60964

    I'm closing this; as mentioned in comments, I found out
    later that this doesn't always give the right color, and, it
    isn't obvious what to do. Also, as Kimmo mentioned, what we
    have now is pretty good for legibility, so I'm abandoning this.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks