D4947: [KTextEditor] Expose additional internal View's functionality to the public API

Thomas Friedrichsmeier noreply at phabricator.kde.org
Mon Mar 6 16:54:28 UTC 2017


tfry added a comment.


  Hi thanks for adding me in CC. My use case was saving and restoring a certain scroll position. Thus, what I am missing, immediately, is a way to retrieve the current scroll position. The proposed startLine() goes some length, here, but does not provide columns (in case of horizontal scrolling), as far as I can see. On the side of the setter functions, I wonder why there is scroll(To)Column(s), but apparently no equivalent for scrolling to a different line at the current horizontal position.
  
  Thus, I would suggest
  a) replacing
  
    int startLine() const Q_DECL_OVERRIDE;
  
  with
  
    KTextEditor::Cursor currentScrollPosition() const Q_DECL_OVERRIDE;
  
  for more flexibility.
  b) same probably for endLine(), although I'm not quite clear on the use case for this one.
  c) //either// add scrollToLine(), or remove scrollToColumn() (which could be written as
  
    scrollToPosition(KTextEditor::Cursor(x, currentScrollPosition.line())
  
  , where needed).

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D4947

To: jsalatas, #ktexteditor, #frameworks, mwolff, tfry
Cc: dhaumann, anthonyfieroni, mwolff, kwrite-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170306/927b6659/attachment.html>


More information about the Kde-frameworks-devel mailing list