diff --git a/src/ctags.cpp b/src/ctags.cpp index ba5367c..85eee71 100644 --- a/src/ctags.cpp +++ b/src/ctags.cpp @@ -99,7 +99,7 @@ Ctags::Location Ctags::get_location(const std::string &line_, bool add_markup, b location.symbol = line.substr(0, symbol_end); if(9 < location.symbol.size() && location.symbol[8] == ' ' && starts_with(location.symbol, "operator")) { auto &chr = location.symbol[9]; - if(!((chr >= 'A' && chr <= 'Z') || (chr >= 'a' && chr <= 'z') || (chr >= '0' && chr <= '9') || chr == '_' || static_cast(chr) >= 128)) + if(!((chr >= 'A' && chr <= 'Z') || (chr >= 'a' && chr <= 'z') || (chr >= '0' && chr <= '9') || chr == '_' || chr == '$' || static_cast(chr) >= 128)) location.symbol.erase(8, 1); } @@ -215,7 +215,7 @@ std::vector Ctags::get_type_parts(const std::string &type) { size_t text_start = std::string::npos; for(size_t c = 0; c < type.size(); ++c) { auto &chr = type[c]; - if((chr >= 'A' && chr <= 'Z') || (chr >= 'a' && chr <= 'z') || (chr >= '0' && chr <= '9') || chr == '_' || static_cast(chr) >= 128 || chr == '~') { + if((chr >= 'A' && chr <= 'Z') || (chr >= 'a' && chr <= 'z') || (chr >= '0' && chr <= '9') || chr == '_' || chr == '$' || static_cast(chr) >= 128 || chr == '~') { if(text_start == std::string::npos) text_start = c; } diff --git a/src/source_base.cpp b/src/source_base.cpp index 7ef914c..bf5b917 100644 --- a/src/source_base.cpp +++ b/src/source_base.cpp @@ -860,7 +860,8 @@ Gtk::TextIter Source::BaseView::get_tabs_end_iter() { } bool Source::BaseView::is_token_char(gunichar chr) { - return (chr >= 'A' && chr <= 'Z') || (chr >= 'a' && chr <= 'z') || (chr >= '0' && chr <= '9') || chr == '_' || chr == '$' || chr >= 128; + return (chr >= 'A' && chr <= 'Z') || (chr >= 'a' && chr <= 'z') || (chr >= '0' && chr <= '9') || chr == '_' || chr == '$' || chr >= 128 || + (language_id == "css" && chr == '-'); } std::pair Source::BaseView::get_token_iters(Gtk::TextIter iter) { diff --git a/src/source_base.hpp b/src/source_base.hpp index 6fb0961..ba6ee2c 100644 --- a/src/source_base.hpp +++ b/src/source_base.hpp @@ -171,7 +171,7 @@ namespace Source { Gtk::TextIter get_tabs_end_iter(); public: - virtual bool is_token_char(gunichar chr); + bool is_token_char(gunichar chr); protected: std::pair get_token_iters(Gtk::TextIter iter); diff --git a/src/source_generic.cpp b/src/source_generic.cpp index 246cbc7..97b836f 100644 --- a/src/source_generic.cpp +++ b/src/source_generic.cpp @@ -52,10 +52,6 @@ Source::GenericView::~GenericView() { autocomplete.thread.join(); } -bool Source::GenericView::is_token_char(gunichar chr) { - return Source::BaseView::is_token_char(chr) || (language_id == "css" && chr == '-'); -} - void Source::GenericView::parse_language_file(bool &has_context_class, const boost::property_tree::ptree &pt) { bool case_insensitive = false; for(auto &node : pt) { diff --git a/src/source_generic.hpp b/src/source_generic.hpp index 698e3d2..3e462fa 100644 --- a/src/source_generic.hpp +++ b/src/source_generic.hpp @@ -11,8 +11,6 @@ namespace Source { GenericView(const boost::filesystem::path &file_path, const Glib::RefPtr &language); ~GenericView(); - bool is_token_char(gunichar chr) override; - private: void parse_language_file(bool &has_context_class, const boost::property_tree::ptree &pt);