From 8a0b2bb30813ea5be9f519ef8b42c3ea52c40629 Mon Sep 17 00:00:00 2001 From: cxl Date: Wed, 23 Jan 2019 21:26:05 +0000 Subject: [PATCH] ide: Comment spell checking now ignores non-letters git-svn-id: svn://ultimatepp.org/upp/trunk@12707 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CodeEditor/CHighlight.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/uppsrc/CodeEditor/CHighlight.cpp b/uppsrc/CodeEditor/CHighlight.cpp index 741a55256..8c538f44e 100644 --- a/uppsrc/CodeEditor/CHighlight.cpp +++ b/uppsrc/CodeEditor/CHighlight.cpp @@ -97,12 +97,14 @@ const wchar *CSyntax::DoComment(HighlightOutput& hls, const wchar *p, const wcha for(const wchar *s = p; s < e && IsLetter(*s); s++) w.Cat(ToUpper(*s)); int n = w.GetCount(); - if(!n) + word flags = 0; + if(n) { + if(comments_lang && !SpellWord(w, comments_lang)) + flags = LineEdit::SPELLERROR; + } + else for(const wchar *s = p; s < e && !IsLetter(*s); s++) n++; - word flags = 0; - if(n && comments_lang && !SpellWord(w, comments_lang)) - flags = LineEdit::SPELLERROR; hls.SetFlags(n, flags); static WString todo = "TODO"; static WString fixme = "FIXME";