#442 Smart Backspace is Inconsistent

release
closed-fixed
Program (402)
9
2007-01-04
2004-11-15
Thorsten Haude
No

If you press <Enter> at the end of a line indented by n *
$em_tab_dist, you can backup by pressing n *
backspace. If the line is indented by any other value,
you have to backspace each surplus space.

Discussion

  • Thorsten Haude
    Thorsten Haude
    2006-09-17

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

    • priority: 4 --> 9
     
  • Thorsten Haude
    Thorsten Haude
    2006-10-02

    Logged In: YES
    user_id=119143

    Hm, almost too simple. Now I'm suspicious that I missed
    something important.

     
  • Tony Balinski
    Tony Balinski
    2006-11-21

    Logged In: YES
    user_id=618141
    Originator: NO

    In newlineAndIndentAP:

    Old code was:

    if (tw->text.emulateTabs)
    tw->text.emTabsBeforeCursor = \ column / tw->text.emulateTabs;

    your patch 2006-10-05.1 has:

    if (tw->text.emulateTabs) {
    tw->text.emTabsBeforeCursor = \ column / tw->text.emulateTabs + 1;
    }
    which is not a rounding-up. This causes a bug. Use em-tabs and non-smart auto-indent; create a with a leading em-tab spaced distance, followed by a non-space. Now hit return: the cursor is at the column of the em-tab distance. Now press backspace until you have removed the line just created. You will need three presses instead of two: the first press deletes the indent, the second does nothing (leaving the cursor at the left margin), the third deletes the linebreak. You get this backspace non-movement whenever you delete an indent of some multiple of the em-tab distance in this way.

    A proper round-up does work, eg:

    if (tw->text.emulateTabs > 0) {
    column += tw->text.emulateTabs - 1;
    tw->text.emTabsBeforeCursor = \ column / tw->text.emulateTabs;
    }

     
  • Thorsten Haude
    Thorsten Haude
    2006-11-21

    Logged In: YES
    user_id=119143
    Originator: YES

    So I was right all along: I missed something important!

     
  • Thorsten Haude
    Thorsten Haude
    2007-01-03

    • status: open --> open-fixed
     
  • Thorsten Haude
    Thorsten Haude
    2007-01-04

    • status: open-fixed --> closed-fixed