"dd" command clears the current line instead of removing it

Bug #790795 reported by Jarosław Foksa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ViGedit
Fix Committed
Low
Stephen Moore

Bug Description

"dd" command clears the current line instead of removing it if following conditions are met:
- cursor is placed at the beginning of the line
- the line begins with whitespace (either space or tab)

This bug seems to be related to currently intalled version of Python. I can reproduce it on system with Python 2.7.1 installed. I'm unable to reproduce it on system with exactly the same version of Gedit (2.30.3) and ViGedit but with older version of Python installed (2.6).

Revision history for this message
Jarosław Foksa (jfoksa-deactivatedaccount) wrote :
Revision history for this message
Jarosław Foksa (jfoksa-deactivatedaccount) wrote :

I managed to solve this issue by slightly modyfing delete_WholeLines() function from text.py:

Before
--------------------------------------------------------
def delete_WholeLines(act):
    number = act.vibase.numLines
    act.lines.select_Lines(act, number)
    cut_Selection(act)
    cursor = act.pos.getIter(act)
    line = cursor.get_line()
    if line > 0:
        delete_PrevChar(act, withBackSpace=True)
        act.pos.move_Forward(act)
    else:
        delete_Char(act, withBackSpace=True

After
--------------------------------------------------------
def delete_WholeLines(act):
    number = act.vibase.numLines
    act.lines.select_Lines(act, number)
    cut_Selection(act)
    cursor = act.pos.getIter(act)
    line = cursor.get_line()
    if line > 0:
        act.lines.select_ToLineEnd(act)
        cut_Selection(act)
        delete_PrevChar(act, withBackSpace=True)
        act.pos.move_Forward(act)
    else:
        delete_Char(act, withBackSpace=True

description: updated
Revision history for this message
Stephen Moore (delfick) wrote :

Hello.

Thankyou for pointing that out and finding a solution :)

I've added your fix, http://bazaar.launchpad.net/~delfick/vigedit/vigedit-additions/revision/94

Please tell me if you find any other problems.

Thanks
Stephen.

Changed in vigedit:
status: New → Fix Committed
assignee: nobody → delfick (delfick)
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.