Bug report: CTRL-arrow movement in non-C/C++ file - backtrace

jbb jbb at ihug.co.nz
Sat May 6 00:48:14 BST 2000


On Sat, 06 May 2000, you wrote:
> 
> All,
> 
> Here's the backtrace for the problem... As a reminder, the bug is that when
> using CTRL and the arrow keys to move left and right through text in a file that
> hasn't got a recognized extension, you get a core.  The file I use to cause this
> is attached.  If I rename the file from .vsm to .c, the arrows work fine.

Excellent report. Now I understand - it only happens if you have wordwrap on.
Here's a temporary patch that fixes this.

--- kdevelop.old/kdevelop/kwrite/kwdoc.cpp	Wed Feb 23 10:19:20 2000
+++ kdevelop/kdevelop/kwrite/kwdoc.cpp	Sat May  6 11:43:39 2000
@@ -168,7 +168,8 @@
 }
 
 char TextLine::getChar( int pos ) const {
-  if (pos < len) return text[pos];
+  if (pos >= 0 && pos < len )
+    return text[pos];
   return ' ';
 }

Thanks
 
> 
> 
> #0  0x81a9cb5 in TextLine::getChar (this=0x8367a98, pos=-1) at kwdoc.cpp:171
> #1  0x81b1856 in KWriteView::cursorRightWord (this=0x828fae8, c=@0xbffff2c0)
>     at kwview.cpp:468
> #2  0x81b2d8c in KWriteView::keyPressEvent (this=0x828fae8, e=0xbffff38c)
>     at kwview.cpp:1144
> #3  0x4012cec3 in QWidget::event () from /usr/lib/qt-1.45/lib/libqt.so.1
> #4  0x81b1581 in KWriteView::event (this=0x828fae8, e=0xbffff38c)
>     at kwview.cpp:388
> #5  0x400f6b4b in QApplication::notify () from /usr/lib/qt-1.45/lib/libqt.so.1
> #6  0x4019a890 in QETWidget::translateKeyEvent ()
>    from /usr/lib/qt-1.45/lib/libqt.so.1
> #7  0x4019823c in QApplication::x11ProcessEvent ()
>    from /usr/lib/qt-1.45/lib/libqt.so.1
> #8  0x40197d4d in QApplication::processNextEvent ()
>    from /usr/lib/qt-1.45/lib/libqt.so.1
> #9  0x40198a8c in QApplication::enter_loop ()
>    from /usr/lib/qt-1.45/lib/libqt.so.1
> #10 0x40197cc5 in QApplication::exec () from /usr/lib/qt-1.45/lib/libqt.so.1
> #11 0x80793c0 in main (argc=1, argv=0xbffff804) at main.cpp:61
> 

----------------------------------------
Content-Type: application/octet-stream; name="firstchop.vsm"
Content-Transfer-Encoding: base64
Content-Description: 
----------------------------------------

-- 
Regards,

jbb
http://homepages.ihug.co.nz/~jbb
ICQ: 60412209




More information about the KDevelop mailing list