PR-3876939.diff   [plain text]


Index: src/normal.c
===================================================================
--- src/normal.c	(revision 57762)
+++ src/normal.c	(working copy)
@@ -6566,18 +6566,23 @@
 	 * Imitate strange Vi behaviour: When using "]]" with an operator
 	 * we also stop at '}'.
 	 */
-	if (!findpar(&cap->oap->inclusive, cap->arg, cap->count1, flag,
-	      (cap->oap->op_type != OP_NOP
-				      && cap->arg == FORWARD && flag == '{')))
-	    clearopbeep(cap->oap);
-	else
-	{
-	    if (cap->oap->op_type == OP_NOP)
-		beginline(BL_WHITE | BL_FIX);
+	if (curbuf->b_p_lisp) {
+	    findpar(cap->oap, cap->arg, cap->count1, 
+	      '(', FALSE);
+	} else {
+	    if (!findpar(&cap->oap->inclusive, cap->arg, cap->count1, flag,
+		  (cap->oap->op_type != OP_NOP
+					  && cap->arg == FORWARD && flag == '{')))
+		clearopbeep(cap->oap);
+	    else
+	    {
+		if (cap->oap->op_type == OP_NOP)
+		    beginline(BL_WHITE | BL_FIX);
 #ifdef FEAT_FOLDING
-	    if ((fdo_flags & FDO_BLOCK) && KeyTyped && cap->oap->op_type == OP_NOP)
-		foldOpenCursor();
+		if ((fdo_flags & FDO_BLOCK) && KeyTyped && cap->oap->op_type == OP_NOP)
+		    foldOpenCursor();
 #endif
+	    }
 	}
     }
 
@@ -6747,6 +6752,11 @@
 nv_brace(cap)
     cmdarg_T	*cap;
 {
+    if (curbuf->b_p_lisp) {
+	cap->nchar = '(';
+	nv_csearch(cap);
+	return;
+    }
     cap->oap->motion_type = MCHAR;
     cap->oap->use_reg_one = TRUE;
     /* The motion used to be inclusive for "(", but that is not what Vi does. */
Index: src/search.c
===================================================================
--- src/search.c	(revision 57762)
+++ src/search.c	(working copy)
@@ -2787,6 +2787,10 @@
     char_u	*s;
 
     s = ml_get(lnum);
+    if (para == '(')
+	return *s == '(';
+    if (para == ')')
+	return *s == ')';
     if (*s == para || *s == '\f' || (both && *s == '}'))
 	return TRUE;
     if (*s == '.' && (inmacro(p_sections, s + 1) ||