Tommaso Cucinotta wrote:
Last, why is the status of LFUN_REGEXP_MODE handled in BufferView.cpp while the dispatch is in Text3.cpp. Moreover, I would expect it to be next to LFUN_MATH_MODE as they seem to be related.
Probably should be moved to Text3.cpp.
For example, see attachment (behaviour is apparently ok).

   T.
Index: src/BufferView.cpp
===================================================================
--- src/BufferView.cpp	(revisione 33304)
+++ src/BufferView.cpp	(copia locale)
@@ -1024,11 +1024,6 @@
 		flag.setEnabled(true);
 		break;
 
-	case LFUN_REGEXP_MODE:
-		flag.setEnabled(buffer().isInternal() && !cur.inRegexped()
-				&& cur.inset().lyxCode() != ERT_CODE);
-		break;
-
 	case LFUN_LABEL_COPY_AS_REF: {
 		// if there is an inset at cursor, see whether it
 		// handles the lfun
Index: src/Text3.cpp
===================================================================
--- src/Text3.cpp	(revisione 33303)
+++ src/Text3.cpp	(copia locale)
@@ -2390,6 +2390,7 @@
 	case LFUN_MATH_MACRO:
 	case LFUN_MATH_SUBSCRIPT:
 	case LFUN_MATH_SUPERSCRIPT:
+	case LFUN_REGEXP_MODE:
 		code = MATH_HULL_CODE;
 		break;
 
@@ -2696,6 +2697,9 @@
 		if (cur.inset().getLayout().isPassThru())
 			enable = false;
 		break;
+	case LFUN_REGEXP_MODE:
+		enable &= cur.buffer()->isInternal() && !cur.inRegexped()
+			&& cur.inset().lyxCode() != ERT_CODE;
 	default:
 		break;
 	}

Reply via email to