Summary: | Static word wrap sets courser to the beginning of the new line | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | john Terragon <terragonjohn> |
Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dilfridge, goued120, hinow, j__n, kadlecf, kdebugs, kzollman, m.zhitlukhin, magnus, neteler, rolf.offermanns, ryan.reich, sonmezsahut, thomasdn, vpvainio, Wolfgang_Mader, wujastyk |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
john Terragon
2008-08-06 19:15:32 UTC
The problem is in KateDocument::editWrapLine: // ... else { nextLine->insertText (0, l->string().mid(col, pos)); l->truncate(col); This part does not work out with the doEdit call below. m_buffer->changeLine(line); m_buffer->changeLine(line+1); // no, no new line added ! if (newLineAdded) (*newLineAdded) = false; history()->doEdit( new KateEditInfo(this, m_editSources.top(), KTextEditor::Range(line, col, line+1, 0), QStringList(), KTextEditor::Range(line, col, line+1, pos), QStringList()) ); } Anyone an idea how to fix it? I confirm this bug on Kubuntu 8.04. *** Bug 170884 has been marked as a duplicate of this bug. *** *** Bug 193543 has been marked as a duplicate of this bug. *** Using: Qt: 4.5.0 KDE: 4.2.2 (KDE 4.2.2) Kate: 3.2.2 (OS: Ubuntu Jaunty, 9.04) I get a problem much like this, but intermittently. Sometimes, when I type past the static word-wrap boundary (using static word wrap, of course) the cursor jumps to the _end_ of the first word on the next line. For example, if the text on line 2 already exists and I start typing on line 1: | (word wrap) The quick brown fox ju... Mary had a little lamb and then continue, I will get the following: | (word wrap) The quick brown fox juMarymped had a little lamb because the cursor jumped to the end of "Mary" when the line wrapped, rather than having itself wrapped to the same position. This may be exactly what the original report claimed, in which case I'm glad to provide another case and this illustration. *** Bug 197554 has been marked as a duplicate of this bug. *** *** Bug 197745 has been marked as a duplicate of this bug. *** *** Bug 218494 has been marked as a duplicate of this bug. *** Still present in KDE 4.3.4, and annoying as ever. :] *** Bug 220598 has been marked as a duplicate of this bug. *** *** Bug 211124 has been marked as a duplicate of this bug. *** Not sure about the original description, but I definitely agree with comment 5 (kwrite 4.3.4). This happens if I am editing the last word on a line, and my cursor is not at the end of the word. Usually, I am adding a previous word, and there is not a space (yet) between the word I am adding and the last word of the line (inadvertently making a word longer than it needs be) and when the "word" I am editing is pushed to the next line, the cursor is pushed to the end of the "word", instead of keeping its position in the "word", as expected. > I get a problem much like this, but intermittently. Sometimes, when I type > past the static word-wrap boundary (using static word wrap, of course) the > cursor jumps to the _end_ of the first word on the next line. For example, if > the text on line 2 already exists and I start typing on line 1: > > | (word wrap) > The quick brown fox ju... > Mary had a little lamb > > and then continue, I will get the following: > > | (word wrap) > The quick brown fox > juMarymped had a > little lamb > > because the cursor jumped to the end of "Mary" when the line wrapped, rather > than having itself wrapped to the same position. This may be exactly what the > original report claimed, in which case I'm glad to provide another case and > this illustration. (In reply to comment #12) > Not sure about the original description, but I definitely agree with comment 5 > (kwrite 4.3.4). > > This happens if I am editing the last word on a line, and my cursor is not at > the end of the word. Usually, I am adding a previous word, and there is not a > space (yet) between the word I am adding and the last word of the line > (inadvertently making a word longer than it needs be) and when the "word" I am > editing is pushed to the next line, the cursor is pushed to the end of the > "word", instead of keeping its position in the "word", as expected. This is exactly what happens to me. Interestingly, it appears no longer to occur in kde-4.4.1 (kile-2.0.84). Can others verify this? Just for info: this is certainly not fixed in KDE 4.4. Maybe in KDE 4.5, with new text cursors... (In reply to comment #14) > Just for info: this is certainly not fixed in KDE 4.4. Maybe in KDE 4.5, with > new text cursors... You are right; I did a simple test but misinterpreted it. After a bit more testing, I'd like to add the following clarification. This only happens if there is already text on the next line. e.g. If I have: abcdefghijklm nopqrstuvwxyz abcdefghijklm nopqrstuvwxyz abcdefghijklm qrstuvwxyz a and I try to prepend p before q in the last word on the first line, my cursor jumps after the z. But, if I have (note the blank second line): abcdefghijklm nopqrstuvwxyz abcdefghijklm nopqrstuvwxyz abcdefghijklm qrstuvwxyz and I try to prepend p before q in the last word on the first line, my cursor stays after the p, as expected. ergh, that word wrapped when i posted. my word wrap is set to 80, and the first line should have 6 sets of "words" I originally reported the following as a Kile bug, but it belongs here, rather.] ------------------------------------ Public bug reported: Binary package hint: kile Splash screen: Kile 2.1 beta 3 $ kile --version Qt: 4.5.2 KDE: 4.3.5 (KDE 4.3.5) Kile: 2.0.84 Installed version: 1:2.1.0~svn1079982-0ubuntu1~karmic1~ppa1 Running under an up-to-date Ubuntu 9.10, apt-cache policy kile kile: Installed: 1:2.1.0~svn1079982-0ubuntu1~karmic1~ppa1 Candidate: 1:2.1.0~svn1079982-0ubuntu1~karmic1~ppa1 Version table: *** 1:2.1.0~svn1079982-0ubuntu1~karmic1~ppa1 0 500 http://ppa.launchpad.net karmic/main Packages 100 /var/lib/dpkg/status 1:2.1.0~svn1014763beta2-1ubuntu1 0 500 http://archive.ubuntu.com karmic/universe Packages --- Bug report: I've got static word wrap on, at column 62. When my typing gets to the end of a line, the cursor often jumps to a position a few characters along in the next line. For example, with * marking the position of my cursor, when I type "i", the following is the before and after scenario. Obeyesekere (impact in Sri Lanka), Montgomery (medical pract*), Taylor, and Obeyesekere (impact in Sri Lanka), Montgomery (medical practi),* Taylor, and So the cursor has jumped two chars forward, and my typing is in a mess. I can't routinely repeat the error, and I'm not sure about all the features of it. It seems to vary according to the exact layout of the text. But the above example was repeatable. Dominik Wujastyk ** Affects: kile (Ubuntu) Importance: Undecided Status: New -- word wrap faulty: cursor jumps forward on new line https://bugs.launchpad.net/bugs/523883 You received this bug notification because you are a direct subscriber of the bug. ======================================================================= And from Andreas Wenning (Kile maintainer): Thanks for reporting this bug! This is most likely a bug in the katepart (from kdelibs) then, which both kate and kile uses for the editing window. Your bug seems to be a problem with the KDE program itself, and not with our KDE packages. While we appreciate your issue, it would be better if it was tracked at https://bugs.kde.org, so that the KDE developers can deal with this speedily and have direct communication with you as the reporter for more effective debugging. Thanks! ** Also affects: kde4libs (Ubuntu) Importance: Undecided Status: New ** Changed in: kile (Ubuntu) Status: Incomplete => Invalid ** Changed in: kde4libs (Ubuntu) Status: New => Invalid Just in case this helps. I am using and up to date Ubuntu 9.10 with Qt: 4.5.2 KDE: 4.3.5 (KDE 4.3.5) Kile: 2.0.85 I can reproduce the bug on kile and kate. Start with the following document. "We construct higher-dimensional versions of the famous domains and show that the Bergman projection operators for these domains regular" then bring the cursor to in front of the word "show" in the first line. the cursor should be touching the word "show". Then try to write the following "let see if we make a mistake" you will get: "We construct higher-dimensional versions of the famous domains and let see ifshow make a mistake that the Bergman projection operators for these domains regular" However, if the cursor does not touch the word "show" then you get "We construct higher-dimensional versions of the famous domains and let see if we make a mistake show that the Bergman projection operators for these domains regular" Also, if I redo every step both programs crash at the end. Thanks, finally fix static word wrap bug for KDE 4.5. This is simple due to the new TextBuffer supporting wrapLine and unwrapLine out of the box. There is still an issue remaining: If you have a bookmark in the already wrapped line and then undo the wrap, the bookmark moves up, which is wrong. But this is another bug report and iirc not a new issue. This fixes bug #168534. Commit: http://gitorious.org/kate/kate/commit/c2a6ffe748bca6923af61ee791a30c32e085d588 SVN commit 1121214 by cullmann: dhaumann: finally fix static word wrap bug This is simple due to the new TextBuffer supporting wrapLine and unwrapLine out of the box. There is still an issue remaining: If you have a bookmark in the already wrapped line and then undo the wrap, the bookmark moves up, which is wrong. This fixes bug #168534. BUG: 168534 M +2 -2 katedocument.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1121214 SVN commit 1121215 by cullmann: dhaumann: add unit test for word wrap with cursor check CCBUG: 168534 M +11 -0 CMakeLists.txt A katedocument_test.cpp [License: LGPL (v2+)] A katedocument_test.h [License: LGPL (v2+)] M +10 -0 movingcursor_test.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1121215 *** Bug 242685 has been marked as a duplicate of this bug. *** *** Bug 273730 has been marked as a duplicate of this bug. *** |