Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • K KTextEditor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
  • Bugzilla
    • Bugzilla
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • FrameworksFrameworks
  • KTextEditor
  • Merge requests
  • !57

Add KTextEditor::LineRange

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Dominik Haumann requested to merge work/kte-line-range into master Jan 02, 2021
  • Overview 8
  • Commits 11
  • Pipelines 0
  • Changes 17

The idea is to have a range class similar to KTextEditor::Range but without column support. A LineRange simply is defined by a tuple of a start line and an end line. The API matches 1:1 the one of KTextEditor::Range but without column support.

Many locations in KTextEditor require only a start line and an end line, like tagging dirty lines for a repaint. The intention of this class is to have a better semantic of LineRanges throughout our code.

Since the class KTextEditor::LineRange is defined by two ints, it has in total 8 bytes in memory and therefore can safely be passed by value without performance issues.

For easy conversion, KTextEditor::Range::toLineRange() can be used to convert a Range to a LineRange. The same holds for a MovingRange.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: work/kte-line-range