You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.4 KiB

#ifndef JUCI_SOURCE_SPELLCHECK_H_
#define JUCI_SOURCE_SPELLCHECK_H_
#include <gtksourceviewmm.h>
#include <aspell.h>
#include "selectiondialog.h"
namespace Source {
Git integration through libgit2 (#244) * Git integration, fixes #63 * Fixed a crash when deleting directories, added libgit2 to MSYS2 CI, adjusted colors slightly * Git integration now supports debian stable * Fixed compilation error on MSYS2 * Added git_test * git_test fix * Git integration: now updates correct paths on source save. Also added slight delay to source diff git monitor change signal * git_test fixed * Now monitors .git directory instead. The .git/index file does not always update on for instance: git commit -m ... * Directories cleanup * Fixed git status update on rename refactoring, and some additional cleanup * Added menu items: Go to Next Diff, and Show Diff * Fixed Go to Next Diff and Show Diff keybindings * Minor fixes to git integration * Added: implement method * Minor fixes to Implement Method * Minor fixes to source_diff * source_diff: optimisations added, as well as some minor improvements * Fixed a crash when trying to show diff in a buffer not related to a diff repository * Git integration: MSYS2 support * source_diff: source should now refresh correctly when .git directory has changed * directories.cc: stop updating parent path colors when path including .git directory/file is found * Spellcheck underline no longer shows for for instance '\n' * Made directory view's git status update async * Use boost::filesystem::path in git.* * Optimisation: now stores a cache of git status, which can be slow, that is used when possible * Source view will now grab focus when a selection dialog is shown * Source menu should now be correctly updated * Implement Method: improved * git.cc: minor fix
10 years ago
class SpellCheckView : virtual public Gsv::View {
public:
SpellCheckView();
~SpellCheckView();
virtual void configure();
virtual void hide_tooltips() {}
virtual void hide_dialogs();
void spellcheck();
void remove_spellcheck_errors();
void goto_next_spellcheck_error();
protected:
bool is_code_iter(const Gtk::TextIter &iter);
bool spellcheck_all=false;
guint last_keyval=0;
private:
std::unique_ptr<SelectionDialog> spellcheck_suggestions_dialog;
static AspellConfig* spellcheck_config;
AspellCanHaveError *spellcheck_possible_err;
AspellSpeller *spellcheck_checker;
bool is_word_iter(const Gtk::TextIter& iter);
std::pair<Gtk::TextIter, Gtk::TextIter> spellcheck_get_word(Gtk::TextIter iter);
void spellcheck_word(const Gtk::TextIter& start, const Gtk::TextIter& end);
std::vector<std::string> spellcheck_get_suggestions(const Gtk::TextIter& start, const Gtk::TextIter& end);
sigc::connection delayed_spellcheck_suggestions_connection;
sigc::connection delayed_spellcheck_error_clear;
void spellcheck(const Gtk::TextIter& start, const Gtk::TextIter& end);
};
}
#endif //JUCI_SOURCE_SPELLCHECK_H_