#494 capitalize/lowercase always modify buffer

Program (402)

shift.c:changeCase always calls BufReplace[Selected],
even if not a single character has been up/downcased.
So the buffer is marked as modified even if the text is
unchanged, which is a bug IMO.
The fix is simple, just check for changes while doing
toupper/tolower - you can extract the code from patch


  • TK Soh

    TK Soh - 2005-10-20

    Logged In: YES

    IMO, it's impractical for NEdit to always check if the
    change-case operation has been 'successful', as the selected
    text can span through the entire [huge] file. Though I'd
    agree it may seem confusing when tab is marked as modified
    while nothing appears to have changed.

    I believe it won't be such a hassle to press ^z.

  • Dimitar Zhekov

    Dimitar Zhekov - 2005-10-21

    Logged In: YES

    The code in 1076573 checks for changes while converting the
    characters. Now, I haven't checked (maybe I should have),
    but it probably emits no more than 5 assembler instructions
    per character, which shouldn't be of much significance by
    itself and compared to the rest of the capitalize/lowercase
    ^Z isn't a hassle, of course, it's just a bit confusing to
    have the modification marker raised - I unwillingly [don't
    know the exact english expression] try to identify/see the
    change, but these is none.

  • Thorsten Haude

    Thorsten Haude - 2006-09-17
    • assigned_to: nobody --> yooden
  • Thorsten Haude

    Thorsten Haude - 2006-09-17

    Logged In: YES

    I agree that this is a bug. Dimitar's fix is pretty
    straightforward and seems to work.

  • Thorsten Haude

    Thorsten Haude - 2006-09-30
    • priority: 5 --> 9
    • status: open --> open-accepted
  • Nobody/Anonymous

    Logged In: NO

    I think this patch is fine. It's not add any loops so it's
    only adding a constant to a linear function. In fact, it
    should be faster for no-ops, because then the text isn't

    (If one wanted to micro-optimize you could avoid checking if
    modified was already true but I think it will be plenty fast

  • Thorsten Haude

    Thorsten Haude - 2006-10-17
    • milestone: --> release
    • status: open-accepted --> closed-fixed

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

Sign up for the SourceForge newsletter:

No, thanks