-
Notifications
You must be signed in to change notification settings - Fork 39
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
fix: Allow comments to targets sections of a line instead of the whole #280
base: develop
Are you sure you want to change the base?
Conversation
Hi @pauliyobo
IMO, regarding multiple comments within the same line,
|
… comment that points to it said comment will be edited
Hi @pauliyobo It's more precise now. I guess you haven't had time to fix this yet:
Many thanks |
Sorry for the silence. As you noticed, I managed to tackle the selection precision and overlapping. Handling the comment cycling with f8 is a bit trickier because we have to keep into account overlapping comments, as well as comments that target the whole line. I'll be tackling this next. |
This does seem a bit tricky since we allow overlapping comments. If we take a step back, it seems easy enough that we don't allow overlapping comments. |
We could prevent comments to overlap. I believe quotes already do this. |
Link to issue number:
fixes #205
Summary of the issue:
Up until now, bookworm allowed to add notes, though it was possible to do so only by targeting the whole line
Description of how this pull request fixes the issue:
This PR makes it so that whenever you add a new comment, the comment will target the selected text, if any. Otherwise it fals back to the default behaviour, which is to target the whole line.
Testing performed:
Manual testing
Known issues with pull request:
It's not really an issue with the PR itself, but since this PR makes changes to the database, backing it up is advised before testing the change, unless you know how to use alembic to downgrade a revision.
@cary-rowen would this solve your issue?
P.S.
Due to the change introduced it is now possible to overlap two comments in the same line, as well as having multiple comments in the same line but in different positions.
Whenever two or more comments overlap, this will be reported with the message "Has N comments" where N is the number of comments.
If this is confusing, perhaps we can just prevent notes from overlapping.