[ nedit-Bugs-1717911 ] cursor not erased completely
SourceForge.net
noreply at sourceforge.net
Sun May 27 19:37:45 CEST 2007
Bugs item #1717911, was opened at 2007-05-12 23:17
Message generated for change (Comment added) made by yooden
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=1717911&group_id=11005
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Thorsten Haude (yooden)
Summary: cursor not erased completely
Initial Comment:
NEdit release of Aug 20, 2004
Built on: Linux, 386, Intel C++
Built at: May 12 2007, 15:22:08
With Motif: 2.2.3 [@(#)Motif Version 2.2.4]
Running Motif: 2.2 [unknown]
Server: Colin Harrison 60900023
Visual: 24-bit TrueColor (ID 0x22, Default)
Locale: en_US.iso885915
-------------------------------------------------
to repeat:
1) Run nedit;
2) In the opened window, keep typing some letters until they (exactly) reach the right boundary of the window.
3) Select some text from left to right, and make sure the last letter in this line is also included in the selection.
4) type the backspace and you'll find the cursor is not erased completely from its previous position.
This will be more clear if the cursor is set to heavy and the cursor blinking rate is set to zero.
Thank you.
----------------------------------------------------------------------
>Comment By: Thorsten Haude (yooden)
Date: 2007-05-27 19:37
Message:
Logged In: YES
user_id=119143
Originator: NO
The patch seems to work, but I didn't test for regression. Please have a
look.
File Added: cursor-erase.2007-05-27.2.diff
----------------------------------------------------------------------
Comment By: Thorsten Haude (yooden)
Date: 2007-05-27 19:24
Message:
Logged In: YES
user_id=119143
Originator: NO
patching file textDisp.c
Hunk #1 FAILED at 1622.
Hunk #2 FAILED at 3001.
2 out of 2 hunks FAILED -- saving rejects to file textDisp.c.rej
Any way you could provide a patch file?
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2007-05-25 04:40
Message:
Logged In: NO
"width = left - x + cursorWidth;" is not necessary.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2007-05-24 00:57
Message:
Logged In: NO
last fix was wrong. The MORE correct one should be:
======================================================================
*** textDisp.c 2007-05-16 16:49:37.000000000 -0500
--- textDisp.c.new 2007-05-23 17:56:09.000000000 -0500
***************
*** 1622,1632 ****
endDispPos = pos + nRestyled;
else {
endDispPos = textD->continuousWrap ? wrapModEnd :
BufEndOfLine(buf, pos + nInserted) + 1;
if (origCursorPos >= startDispPos &&
! (origCursorPos <= endDispPos || endDispPos ==
buf->length))
blankCursorProtrusions(textD);
}
/* If more than one line is inserted/deleted, a line break may
have
been inserted or removed in between, and the line numbers
may
have changed. If only one line is altered, line numbers
cannot
--- 1622,1632 ----
endDispPos = pos + nRestyled;
else {
endDispPos = textD->continuousWrap ? wrapModEnd :
BufEndOfLine(buf, pos + nInserted) + 1;
if (origCursorPos >= startDispPos &&
! (origCursorPos <= endDispPos || endDispPos >=
buf->length))
blankCursorProtrusions(textD);
}
/* If more than one line is inserted/deleted, a line break may
have
been inserted or removed in between, and the line numbers
may
have changed. If only one line is altered, line numbers
cannot
***************
*** 3001,3014 ****
int cursorWidth, left = textD->left, right = left + textD->width;
cursorWidth = (fontWidth/3) * 2;
if (cursorX >= left-1 && cursorX <= left + cursorWidth/2 - 1) {
x = cursorX - cursorWidth/2;
! width = left - x;
} else if (cursorX >= right - cursorWidth/2 && cursorX <= right) {
x = right;
! width = cursorX + cursorWidth/2 + 2 - right;
} else
return;
XClearArea(XtDisplay(textD->w), XtWindow(textD->w), x, cursorY,
width, fontHeight, False);
--- 3001,3014 ----
int cursorWidth, left = textD->left, right = left + textD->width;
cursorWidth = (fontWidth/3) * 2;
if (cursorX >= left-1 && cursorX <= left + cursorWidth/2 - 1) {
x = cursorX - cursorWidth/2;
! width = left - x + cursorWidth;
} else if (cursorX >= right - cursorWidth/2 && cursorX <= right) {
x = right;
! width = cursorX + cursorWidth/2 + cursorWidth - right;
} else
return;
XClearArea(XtDisplay(textD->w), XtWindow(textD->w), x, cursorY,
width, fontHeight, False);
======================================================================
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2007-05-23 23:15
Message:
Logged In: NO
A fix: can any developer double check it and see if it can be improved?
======================================================================
*** textDisp.c 2007-05-16 16:49:37.000000000 -0500
--- textDisp.c.new 2007-05-23 16:09:11.000000000 -0500
***************
*** 1620,1630 ****
if (linesInserted == linesDeleted) {
if (nInserted == 0 && nDeleted == 0)
endDispPos = pos + nRestyled;
else {
endDispPos = textD->continuousWrap ? wrapModEnd :
! BufEndOfLine(buf, pos + nInserted) + 1;
if (origCursorPos >= startDispPos &&
(origCursorPos <= endDispPos || endDispPos ==
buf->length))
blankCursorProtrusions(textD);
}
/* If more than one line is inserted/deleted, a line break may
have
--- 1620,1630 ----
if (linesInserted == linesDeleted) {
if (nInserted == 0 && nDeleted == 0)
endDispPos = pos + nRestyled;
else {
endDispPos = textD->continuousWrap ? wrapModEnd :
! BufEndOfLine(buf, pos + nInserted +
textD->fontStruct->min_bounds.width);
if (origCursorPos >= startDispPos &&
(origCursorPos <= endDispPos || endDispPos ==
buf->length))
blankCursorProtrusions(textD);
}
/* If more than one line is inserted/deleted, a line break may
have
***************
*** 3001,3014 ****
int cursorWidth, left = textD->left, right = left + textD->width;
cursorWidth = (fontWidth/3) * 2;
if (cursorX >= left-1 && cursorX <= left + cursorWidth/2 - 1) {
x = cursorX - cursorWidth/2;
! width = left - x;
} else if (cursorX >= right - cursorWidth/2 && cursorX <= right) {
x = right;
! width = cursorX + cursorWidth/2 + 2 - right;
} else
return;
XClearArea(XtDisplay(textD->w), XtWindow(textD->w), x, cursorY,
width, fontHeight, False);
--- 3001,3014 ----
int cursorWidth, left = textD->left, right = left + textD->width;
cursorWidth = (fontWidth/3) * 2;
if (cursorX >= left-1 && cursorX <= left + cursorWidth/2 - 1) {
x = cursorX - cursorWidth/2;
! width = left - x + fontWidth;
} else if (cursorX >= right - cursorWidth/2 && cursorX <= right) {
x = right;
! width = cursorX + cursorWidth/2 + fontWidth - right;
} else
return;
XClearArea(XtDisplay(textD->w), XtWindow(textD->w), x, cursorY,
width, fontHeight, False);
======================================================================
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2007-05-21 16:30
Message:
Logged In: NO
!!??
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2007-05-17 16:12
Message:
Logged In: NO
to repeat, have to set line wrap to none.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2007-05-17 16:12
Message:
Logged In: NO
to repeat, have to set line wrap to none.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=1717911&group_id=11005
More information about the Develop
mailing list