]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.cpp
Fix part 1 of bug #7351
[lyx.git] / src / Paragraph.cpp
index 582a39f1abb1d48f5ef2fd51b608be71431aab2e..5b397bd8778fbeba1d3c8f759f9bf318b1794e44 100644 (file)
@@ -112,7 +112,7 @@ public:
                if (range_.first > pos) {
                        range_.first += offset;
                        range_.last += offset;
-               } else if (range_.last > pos) {
+               } else if (range_.last >= pos) {
                        range_.last += offset;
                }
        }
@@ -2375,8 +2375,8 @@ void Paragraph::latex(BufferParams const & bparams,
                                                            runparams);
                }
 
-               Change const & change = runparams.inDeletedInset ? runparams.changeOfDeletedInset
-                                                                : lookupChange(i);
+               Change const & change = runparams.inDeletedInset
+                       ? runparams.changeOfDeletedInset : lookupChange(i);
 
                if (bparams.outputChanges && runningChange != change) {
                        if (open_font) {
@@ -2850,6 +2850,14 @@ bool Paragraph::isWordSeparator(pos_type pos) const
        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));