From 4dbe858b168919298b386b60ac6e4393cf7bc5f0 Mon Sep 17 00:00:00 2001 From: eidheim Date: Sat, 29 Aug 2015 13:39:00 +0200 Subject: [PATCH] Can now use locale settings to set spellcheck language. --- README.md | 2 +- src/files.h | 2 +- src/source.cc | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 20fcc3a..8fb39cb 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ towards libclang with speed in mind. * C++ warnings and errors on the fly * Fast C++ autocomletion (even external libraries) * Tooltips showing type information and doxygen documentation -* Accurate refactoring across files +* Refactoring across files * Highlighting of similar types * Spell checking depending on file context * Basic editor functionallity diff --git a/src/files.h b/src/files.h index 516cf05..3db5275 100644 --- a/src/files.h +++ b/src/files.h @@ -17,7 +17,7 @@ const std::string configjson = #endif #endif "//Use \"\" for default font, and for instance \"Monospace 12\" to also set size.\n" -" \"spellcheck_language\": \"en_US\", \n" +" \"spellcheck_language\": \"en_US\", //Use \"\" to set language from your locale settings\n" " \"clang_types\": {\n" " \"8\": \"def:function\",\n" " \"21\": \"def:function\",\n" diff --git a/src/source.cc b/src/source.cc index 278ed57..a9885d7 100644 --- a/src/source.cc +++ b/src/source.cc @@ -156,7 +156,8 @@ Source::View::View(const boost::filesystem::path &file_path): file_path(file_pat if(spellcheck_config==NULL) { spellcheck_config=new_aspell_config(); - aspell_config_replace(spellcheck_config, "lang", Singleton::Config::source()->spellcheck_language.c_str()); + if(Singleton::Config::source()->spellcheck_language.size()>0) + aspell_config_replace(spellcheck_config, "lang", Singleton::Config::source()->spellcheck_language.c_str()); } spellcheck_possible_err=new_aspell_speller(spellcheck_config);