octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #45610] wrong commenting (ctrl+R) behavior in


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #45610] wrong commenting (ctrl+R) behavior in GUI editor under Windows
Date: Mon, 27 Jul 2015 07:51:39 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15

Follow-up Comment #13, bug #45610 (project octave):

OK, let's just pre-processor conditionally remove 1 from the length for WIN32.
 (I believe WIN32 is the correct flag to condition on because of this
code/comment

http://www.qtcentre.org/threads/2229-Carriage-Return-in-QString?p=161439#post161439

).  The reason I think doing so is fine is because of a comment I put in the
changeset:


      // QScintilla's text() creates a QString for which CR or CR+LF is/are
      // part of the string and hence included in Qt's QString length().
      // However, QScintilla's setSelection() indexing apparently ignores
      // the CR or CR+LF.  Hence, on Windows the length is too long by 1.


For example, say the line of text is "line 3".  Well, after % placement we
have:

LINUX: %line 3<CR>
WIN32: %line 3<CR><LF>

In the Linux case, the length is 8.  (QString includes <CR> which goes toward
the count.)  In the Windows case, the length is 9.  But then, because
QScintilla ignores the <CR> or <CR><LF>, the 8 in the Linux case puts the
cursor at the first character of the next line while the 9 in the Windows case
puts the cursor at the second character of the next line.

To me, that seems a little inconsistent on part of QScintilla.  As I see it,
QScintilla's "text(lineTo)" should not be placing a <CR> or <CR><LF> in the
QString.  I've sent an email to the QScintilla list to see what their thoughts
are on this, so hold off applying the new changeset.  But feel free to test
it, of course.

(file #34532)
    _______________________________________________________

Additional Item Attachment:

File name: octave-cntl+R_bug45610-djs2015jul27.patch Size:1 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?45610>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]