Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a LineOffset trait #1259

Merged
merged 3 commits into from
Apr 3, 2020
Merged

Add a LineOffset trait #1259

merged 3 commits into from
Apr 3, 2020

Conversation

TDecking
Copy link
Collaborator

@TDecking TDecking commented Mar 25, 2020

Summary

This PR adds a LineOffset trait, allowing the use of offset_of_line, line_of_offset, offset_to_line_col and line_col_to_offset without needing a View.

In addition, the functions in movement.rs now use this trait instead.

Related Issues

Related to #1198

Review Checklist

  • I have responded to reviews and made changes where appropriate.
  • I have tested the code with cargo test --all / ./rust/run_all_checks.
  • I have updated comments / documentation related to the changes I made.
  • I have rebased my PR branch onto xi-editor/master.

Copy link
Member

@Cogitri Cogitri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really just a nit, LGTM to me, thank you!

@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//! Representation and calculation of movement within a view.
//! Representation and calculation of movement within a lo.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitty, but IMHO it'd make sense to just say lineoffset here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@Cogitri Cogitri requested a review from cmyr March 28, 2020 08:40
Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@cmyr cmyr merged commit 9afd0ac into xi-editor:master Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants