#73896: how to access configuration settings?

Daniel Franke daniel.franke at imbs.uni-luebeck.de
Sat Apr 24 07:34:13 UTC 2004


http://bugs.kde.org/show_bug.cgi?id=73896

Hi all,
it's a minor bug, but still I feel I want to fix it :)

In
	lib/cppparser/lexer.h:500: inline void Lexer::nextChar()

one would need access to the tabwidth-setting of the current editor to
ensure correct column count.

Are the configuration-settings accessable from cppparser?
If yes, which would be the right way to query them?

Thnx for hints.

Cheers
	Daniel

P.S. The name of a global object or classname/method would most likely be
sufficient :)


---

My changes so far ...


Index: lexer.h
===================================================================
RCS file: /home/kde/kdevelop/lib/cppparser/lexer.h,v
retrieving revision 1.17
diff -u -r1.17 lexer.h
--- lexer.h	9 Feb 2004 18:29:43 -0000	1.17
+++ lexer.h	24 Apr 2004 05:12:37 -0000
@@ -500,13 +500,17 @@

 inline void Lexer::nextChar()
 {
-    if(m_source[m_ptr++] == '\n') {
+    if(m_source[m_ptr] == '\n') {
         ++m_currentLine;
         m_currentColumn = 0;
         m_startLine = true;
+    } else if (m_source[m_ptr] == '\t') {
+	m_currentColumn += 8;		// @todo insert tabwidth here
     } else {
 	++m_currentColumn;
     }
+
+    ++m_ptr;
 }

 inline void Lexer::nextChar( int n )





More information about the KDevelop-devel mailing list