Jürgen Spitzmüller wrote:
> I propose the attached patch (this is the second option).

Another version. It looks sensible to me to make NOBREAKDASH isLetter(), as 
far as the use of this variable is concerned.

(the description of it is not very clear, especially the differentiation from 
isChar())

Can I commit this patch?

Jürgen
Index: src/insets/InsetSpecialChar.cpp
===================================================================
--- src/insets/InsetSpecialChar.cpp	(Revision 37929)
+++ src/insets/InsetSpecialChar.cpp	(Arbeitskopie)
@@ -342,7 +342,8 @@
 
 bool InsetSpecialChar::isLetter() const
 {
-	return kind_ == HYPHENATION || kind_ == LIGATURE_BREAK;
+	return kind_ == HYPHENATION || kind_ == LIGATURE_BREAK
+		|| kind_ == NOBREAKDASH;
 }
 
 
Index: src/Paragraph.cpp
===================================================================
--- src/Paragraph.cpp	(Revision 37929)
+++ src/Paragraph.cpp	(Arbeitskopie)
@@ -2850,6 +2850,14 @@
 	if (pos == size())
 		return true;
 	char_type const c = d->text_[pos];
+	// if we have a hard hyphen (no en- or emdash),
+	// we pass this to the spell checker
+	if (c == '-') {
+		int j = pos + 1;
+		if ((j == size() || d->text_[j] != '-')
+		    && (pos == 0 || d->text_[pos - 1] != '-'))
+			return false;
+	}
 	// We want to pass the ' and escape chars to the spellchecker
 	static docstring const quote = from_utf8(lyxrc.spellchecker_esc_chars + '\'');
 	return (!isLetterChar(c) && !isDigitASCII(c) && !contains(quote, c));

Reply via email to