[prev in list] [next in list] [prev in thread] [next in thread]
List: ktexteditor-devel
Subject: Re: Access to the currently displayed document range
From: Michel Ludwig <michel.ludwig () kdemail ! net>
Date: 2008-03-28 11:57:58
Message-ID: 200803281257.59621.michel.ludwig () kdemail ! net
[Download RAW message or body]
Hi,
On Wed 26 Mar 2008, Michel Ludwig wrote:
> I've attached a new version.
Actually, while I was trying to implement the interface, I realised that it
probably wouldn't be very useful to return a single range in
the 'displayRange()' method. The reason is that the part of the document that
is displayed doesn't have to be a contiguous range of the document. In the
following example,
'xx '
xxxxxx
'x '
if we consider ' to delimit the viewport, then 'displayRange()' would return
the range from (0,0) to (2,1), which is somehow not very intuitive as the
second line is actually clipped.
Hence, I would propose the following changes:
- Turn 'displayRange()' into
virtual QList<KTextEditor::Range> displayLineRanges() const;
(and not add this list to the signal as its computation might be quite
involved)
- Add the following two functions:
int displayLines() const;
KTextEditor::Range displayLineRange(int line) const;
'displayLines()' would return the number of lines currently displayed
and 'displayLineRange(int line)' would return the range of the document which
is shown in the corresponding line.
What do you think of that?
Michel
_______________________________________________
KTextEditor-Devel mailing list
KTextEditor-Devel@kde.org
https://mail.kde.org/mailman/listinfo/ktexteditor-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic