diff --git a/src/Buffer.cpp b/src/Buffer.cpp index c6a819afce..8849c7b3d0 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -2212,18 +2212,6 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr) break; } - case LFUN_BUFFER_LANGUAGE: { - Language const * oldL = params().language; - Language const * newL = languages.getLanguage(argument); - if (!newL || oldL == newL) - break; - if (oldL->rightToLeft() == newL->rightToLeft() && !isMultiLingual()) { - changeLanguage(oldL, newL); - dr.forceBufferUpdate(); - } - break; - } - default: dispatched = false; break; diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 9ec1e7d4b3..1c5d61f1ec 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -1884,6 +1884,19 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr) break; } + case LFUN_BUFFER_LANGUAGE: { + Language const * oldL = buffer_.params().language; + Language const * newL = languages.getLanguage(argument); + if (!newL || oldL == newL) + break; + if (oldL->rightToLeft() == newL->rightToLeft() && !buffer_.isMultiLingual()) { + cur.recordUndoFullDocument(); + buffer_.changeLanguage(oldL, newL); + dr.forceBufferUpdate(); + } + break; + } + default: // OK, so try the Buffer itself... buffer_.dispatch(cmd, dr); diff --git a/status.20x b/status.20x index d4df24596b..e28259c211 100644 --- a/status.20x +++ b/status.20x @@ -49,6 +49,9 @@ What's new - Group correctly Koma Book environments inside environment combo-box listing. +- Add undo for change of text language when document language is changed. + When a document is not multi-lingual the text contents is changed to the + new language. This should be recorded for Undo (bug 7740). * ADVANCED FIND AND REPLACE