codecompletion's problem
Roberto Raggi
raggi at cli.di.unipi.it
Wed Feb 20 19:08:03 UTC 2002
hi Walter,
i'm not sure.. but i think that attribute is different from color..
ciaor robe
On Wednesday 20 February 2002 18:31, W. Tasin wrote:
> Hi Roberto,
>
> if I understand it correctly you are using the color to decide wheter it
> should be activated or not...
> this isn't IMHO a good idea because you can change the color on
> highlighted sources.
>
> Ciao
>
> Walter
>
> Roberto Raggi wrote:
> >hi all,
> >if you press . or -> in a comment region or within a string, the code
> >completion is activated!! i wrote a simple patch
> >that solves the problem, but i don't know if it's a clean solution..
> >in fact i use the TextLine attributes from highlight engine..
> >
> >what do you think?? shall i apply my patch?
> >
> >ciao robe
> >
> >
> >
> >
> >------------------------------------------------------------------------
> >
> >? .cvsignore
> >? .directory
> >? cprjaddoptsdlg.cpp
> >? cprjaddoptsdlg.h
> >? rx.patch
> >? simple.patch
> >Index: cppcodecompletion.cpp
> >===================================================================
> >RCS file: /home/kde/kdevelop/kdevelop/Attic/cppcodecompletion.cpp,v
> >retrieving revision 1.1.2.9
> >diff -u -r1.1.2.9 cppcodecompletion.cpp
> >--- cppcodecompletion.cpp 2002/02/18 19:00:15 1.1.2.9
> >+++ cppcodecompletion.cpp 2002/02/20 13:47:12
> >@@ -156,7 +156,11 @@
> > col > 0 && m_edit->textLine( line )[ col-1 ] ==
> > '-') ) { kdDebug() << "---------------------------> complete (enabled by
> > robe :-)" << endl; m_edit->insertText( ke->text() );
> >- completeText();
> >+ TextLine* l = m_edit->doc()->textLine( line );
> >+ int attr = l->getAttr( col );
> >+ if( attr == 13 ){
> >+ completeText();
> >+ }
> > return TRUE;
> > }
> > }
> >Index: kdevregexp.cpp
> >===================================================================
> >RCS file: /home/kde/kdevelop/kdevelop/Attic/kdevregexp.cpp,v
> >retrieving revision 1.1.2.1
> >diff -u -r1.1.2.1 kdevregexp.cpp
> >--- kdevregexp.cpp 2002/02/18 19:00:15 1.1.2.1
> >+++ kdevregexp.cpp 2002/02/20 13:47:12
> >@@ -31,7 +31,7 @@
> > {}
> >
> > ~KDevRegExpData()
> >- { if( rx ) delete( rx ); }
> >+ { delete( rx ); rx=0;}
> > };
> >
> > KDevRegExp::KDevRegExp()
> >@@ -68,13 +68,12 @@
> > KDevRegExp::~KDevRegExp()
> > {
> > delete( d );
> >+ d=0;
> > }
> >
> > void KDevRegExp::init()
> > {
> >- if( d->rx ){
> >- delete( d->rx );
> >- }
> >+ delete( d->rx );
> > d->rx = new KRegExp( pattern(), caseSensitive() ? "" : "i" );
> > }
> >
> >@@ -126,7 +125,7 @@
> > {
> > const char* s = d->rx->group( grp );
> > if( s ){
> >- return QString::fromLatin1( s, ::strlen(s) );
> >+ return QString::fromLatin1( s );
> > }
> > return QString::null;
> > }
More information about the KDevelop-devel
mailing list