Skip to content

Don't show warning for "past end of" #1351

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

Closed
1 of 2 tasks
Tracked by #1616
pokey opened this issue Mar 23, 2023 · 3 comments
Closed
1 of 2 tasks
Tracked by #1616

Don't show warning for "past end of" #1351

pokey opened this issue Mar 23, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@pokey
Copy link
Member

pokey commented Mar 23, 2023

This behaviour could actually be useful in rare cases.

  • Remove warning
  • Add note to old videos that use "past end of" to use "tail"
@pokey pokey added the bug Something isn't working label Mar 23, 2023
@AndreasArvidsson
Copy link
Member

@pokey I was just about to implement this one, but I can't do the second task so it's probably better if you take ownership? Or do you want me to go ahead and do the first task and then hand it over to you?

This is where in the code the warning is defined

export function checkForOldInference(
partialTargets: PartialTargetDescriptor[],
) {
const hasOldInference = partialTargets.some((target) => {
return (
target.type === "range" &&
target.active.mark == null &&
target.active.modifiers?.some((m) => m.type === "position") &&
!target.active.modifiers?.some((m) => m.type === "inferPreviousMark")
);
});
if (hasOldInference) {
const { globalState, messages } = ide();
const hideInferenceWarning = globalState.get("hideInferenceWarning");
if (!hideInferenceWarning) {
showWarning(
messages,
"deprecatedPositionInference",
'The "past start of" / "past end of" form has changed behavior. For the old behavior, update cursorless-talon (https://www.cursorless.org/docs/user/updating/), and then you can now say "past start of its" / "past end of its". For example, "take air past end of its line". You may also consider using "head" / "tail" instead; see https://www.cursorless.org/docs/#head-and-tail',
"Don't show again",
).then((pressed) => {
if (pressed) {
globalState.set("hideInferenceWarning", true);
}
});
}
}
}

@pokey
Copy link
Member Author

pokey commented Jul 9, 2023

I don't feel strongly either way. I think either is fine

@AndreasArvidsson AndreasArvidsson self-assigned this Jul 9, 2023
github-merge-queue bot pushed a commit that referenced this issue Jul 13, 2023
- Fixes #1630
- Partially #1351

## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [ ] I have not broken the cheatsheet

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Pokey Rule <[email protected]>
@AndreasArvidsson
Copy link
Member

@pokey The warning is now removed and I have assigned it to us you can update your videos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants