From 512b3cb2cf96dc3a988ac02ee87416f29159c2ac Mon Sep 17 00:00:00 2001 From: Bert Wesarg Date: Sun, 21 Sep 2008 12:59:57 +0200 Subject: [PATCH] disable fix-for-SF1869862-searchline.patch B.W. Patch: -fix-for-SF1869862-searchline.patch --- fix-for-SF1869862-searchline.patch | 158 ------------------------------------- series | 1 - 2 files changed, 159 deletions(-) delete mode 100644 fix-for-SF1869862-searchline.patch diff --git a/fix-for-SF1869862-searchline.patch b/fix-for-SF1869862-searchline.patch deleted file mode 100644 index d30892e..0000000 --- a/fix-for-SF1869862-searchline.patch +++ /dev/null @@ -1,158 +0,0 @@ -From: Thorsten Haude -Subject: fix for SF#1869862: "^" doesn't match all lines - -Reported-by: Bert Wesarg - -To reproduce: - -start nedit in a clean NEDIT_HOME - -create the following document and move the cursor back to the beginning: - -=====cut===== -1 -2 -3 - -5 -6 -7 -=====cut===== - -open the search dialog in 'regex' and 'keep' mode and search for "^" - -keep pressing "Find" to cycle through all lines - -you will see that line 5 is never matched - -Solution: - -It seems that on repeated searches, searchMatchesSelection() (search.c) -returns True for empty selections if the search term is not empty but -zero-width (as in the example, where ^ matches ""). - -So it would solve the problem at hand if we would let -searchMatchesSelection() return False for empty selections. Further, since -BufGetEmptySelectionPos() is only called by searchMatchesSelection(), we -can change *that* to do as promised: "[...] returns TRUE for empty -selections" (note not "non-existing selections"). - -(It doesn't help that the documentation about selection.zeroWidth is less -than clear: 'Width 0 selections aren't "real" selections, but they can be -useful when creating rectangular selections from the keyboard.' So since -selection.zeroWidth is a char, what does it hold? A boolean? (Would that -imply a True for selection.selected?) An "A" for "A-Ok, continue with your -work!!"?) - - ---- - - source/textBuf.c | 20 +++++++++++++------- - source/textBuf.h | 8 +++++--- - 2 files changed, 18 insertions(+), 10 deletions(-) - -diff --quilt old/source/textBuf.c new/source/textBuf.c ---- old/source/textBuf.c -+++ new/source/textBuf.c -@@ -80,11 +80,11 @@ static void setRectSelect(selection *sel - int rectStart, int rectEnd); - static void updateSelections(textBuffer *buf, int pos, int nDeleted, - int nInserted); - static void updateSelection(selection *sel, int pos, int nDeleted, - int nInserted); --static int getSelectionPos(selection *sel, int *start, int *end, -+static Boolean getSelectionPos(selection *sel, int *start, int *end, - int *isRect, int *rectStart, int *rectEnd); - static char *getSelectionText(textBuffer *buf, selection *sel); - static void removeSelected(textBuffer *buf, selection *sel); - static void replaceSelected(textBuffer *buf, selection *sel, const char *text); - static void addPadding(char *string, int startIndent, int toIndent, -@@ -694,23 +694,29 @@ void BufRectSelect(textBuffer *buf, int - - setRectSelect(&buf->primary, start, end, rectStart, rectEnd); - redisplaySelection(buf, &oldSelection, &buf->primary); - } - --int BufGetSelectionPos(textBuffer *buf, int *start, int *end, -+Boolean BufGetSelectionPos(textBuffer *buf, int *start, int *end, - int *isRect, int *rectStart, int *rectEnd) - { - return getSelectionPos(&buf->primary, start, end, isRect, rectStart, - rectEnd); - } - --/* Same as above, but also returns TRUE for empty selections */ --int BufGetEmptySelectionPos(textBuffer *buf, int *start, int *end, -+/* -+** Same as BufGetSelectionPos(), but this returns True for empty selections. -+** -+** At the moment, any caller knowing the textBuffer could do this itself, -+** but it would break encapsulation. -+*/ -+Boolean BufGetEmptySelectionPos(textBuffer *buf, int *start, int *end, - int *isRect, int *rectStart, int *rectEnd) - { -- return getSelectionPos(&buf->primary, start, end, isRect, rectStart, -- rectEnd) || buf->primary.zeroWidth; -+ (void) getSelectionPos(&buf->primary, start, end, isRect, rectStart, rectEnd); -+ -+ return (buf->primary.selected && buf->primary.zeroWidth); - } - - char *BufGetSelectionText(textBuffer *buf) - { - return getSelectionText(buf, &buf->primary); -@@ -1996,11 +2002,11 @@ static void setRectSelect(selection *sel - sel->end = end; - sel->rectStart = rectStart; - sel->rectEnd = rectEnd; - } - --static int getSelectionPos(selection *sel, int *start, int *end, -+static Boolean getSelectionPos(selection *sel, int *start, int *end, - int *isRect, int *rectStart, int *rectEnd) - { - /* Always fill in the parameters (zero-width can be requested too). */ - *isRect = sel->rectangular; - *start = sel->start; -diff --quilt old/source/textBuf.h new/source/textBuf.h ---- old/source/textBuf.h -+++ new/source/textBuf.h -@@ -26,18 +26,20 @@ - *******************************************************************************/ - - #ifndef NEDIT_TEXTBUF_H_INCLUDED - #define NEDIT_TEXTBUF_H_INCLUDED - -+#include -+ - /* Maximum length in characters of a tab or control character expansion - of a single buffer character */ - #define MAX_EXP_CHAR_LEN 20 - - typedef struct _RangesetTable RangesetTable; - - typedef struct { -- char selected; /* True if the selection is active */ -+ Boolean selected; /* True if the selection is active */ - char rectangular; /* True if the selection is rectangular */ - char zeroWidth; /* Width 0 selections aren't "real" selections, but - they can be useful when creating rectangular - selections from the keyboard. */ - int start; /* Pos. of start of selection, or if rectangular -@@ -114,13 +116,13 @@ void BufSetTabDistance(textBuffer *buf, - void BufCheckDisplay(textBuffer *buf, int start, int end); - void BufSelect(textBuffer *buf, int start, int end); - void BufUnselect(textBuffer *buf); - void BufRectSelect(textBuffer *buf, int start, int end, int rectStart, - int rectEnd); --int BufGetSelectionPos(textBuffer *buf, int *start, int *end, -+Boolean BufGetSelectionPos(textBuffer *buf, int *start, int *end, - int *isRect, int *rectStart, int *rectEnd); --int BufGetEmptySelectionPos(textBuffer *buf, int *start, int *end, -+Boolean BufGetEmptySelectionPos(textBuffer *buf, int *start, int *end, - int *isRect, int *rectStart, int *rectEnd); - char *BufGetSelectionText(textBuffer *buf); - void BufRemoveSelected(textBuffer *buf); - void BufReplaceSelected(textBuffer *buf, const char *text); - void BufSecondarySelect(textBuffer *buf, int start, int end); diff --git a/series b/series index 1bf8969..ebbd3a9 100644 --- a/series +++ b/series @@ -105,4 +105,3 @@ scrolltip-enable-opt.patch calltipsID.diff fix-calltip-not-found-tip.patch textDisp-cursor-position.patch -fix-for-SF1869862-searchline.patch -- 2.11.4.GIT