Add an LFUN for continuous spell checking

This fixes the first part of #8589.
This commit is contained in:
Vincent van Ravesteijn 2013-03-24 19:20:19 +01:00
parent a31df78133
commit cb93f034d4
3 changed files with 21 additions and 0 deletions

View File

@ -456,6 +456,7 @@ enum FuncCode
LFUN_VC_RENAME, // gb 20130205
LFUN_VC_COPY, // gb 20130205
// 355
LFUN_SPELLING_CONTINUOUSLY, // vfr, 20130324
LFUN_LASTACTION // end of the table
};

View File

@ -1045,6 +1045,16 @@ void LyXAction::init()
* \endvar
*/
{ LFUN_SPELLING_REMOVE, "spelling-remove", ReadOnly, Edit },
/*!
* \var lyx::FuncCode lyx::LFUN_SPELLING_CONTINUOUSLY
* \li Action: Toggle continuous spell checking.
* \li Syntax: spelling-continuously
* \li Origin: vfr, 24 March 2013
* \endvar
*/
{ LFUN_SPELLING_CONTINUOUSLY, "spelling-continuously", ReadOnly, Edit },
/*!
* \var lyx::FuncCode lyx::LFUN_THESAURUS_ENTRY
* \li Action: Look up thesaurus entries with respect to the word under the cursor.

View File

@ -1855,6 +1855,10 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
enable = documentBufferView() && documentBufferView()->cursor().inTexted();
break;
case LFUN_SPELLING_CONTINUOUSLY:
flag.setOnOff(lyxrc.spellcheck_continuously);
break;
default:
return false;
}
@ -3758,6 +3762,12 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
one.startscript(Systemcall::DontWait, command);
break;
}
case LFUN_SPELLING_CONTINUOUSLY:
lyxrc.spellcheck_continuously = !lyxrc.spellcheck_continuously;
dr.screenUpdate(Update::Force | Update::FitCursor);
break;
default:
// The LFUN must be for one of BufferView, Buffer or Cursor;
// let's try that: