Migrate block cursor to Layer and RectangleMarker API

Open
#137 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
tooling

Research direction

Start with src/block-cursor.ts and compare its copied selection implementation with codemirror/view 0.19.27 and the public Layer and RectangleMarker API in codemirror/view 6.16.0. Refactor the block cursor to use those public primitives; done means the implementation no longer depends on the copied selection logic and preserves block-cursor behavior.

Written by the indexing model from the issue text.

Description

https://github.com/replit/codemirror-vim/blob/master/src/block-cursor.ts copied the implementation of codemirror's selection, somewhere around this version https://github.com/codemirror/view/blob/0.19.27/src/draw-selection.ts. Most of the magic has since been moved to a public API https://github.com/codemirror/view/blob/6.16.0/src/draw-selection.ts#L4

I think using those primitives will simplify the implementation and make it more maintainable.

Dominant language
JavaScript
Stars
470
Forks
53
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from replit/codemirror-vim

All issues in replit/codemirror-vim

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.