You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to bump my content widget down one line, so it's still anchored to the same line in the file.
I've hooked into IModel.onDidChangeContent. That provides me IModelContentChangedEvent2 which has the original span, and the new text that has replaced what was there before. But that alone isn't enough for me to calculate the net change in number of lines caused by this event (hence, the number of lines that my existing content widgets must scroll by).
The text was updated successfully, but these errors were encountered:
Doh. Actually, I think it does provide enough information. I can look at range.endLineNumber - range.startLineNumber to count how many lines the original span encompassed, and I can use getPositionAtOffset to count how many lines the replacement text encompassed, and that's enough.
You always find the solution within 30 seconds of posting the question.
Scenario:
I've hooked into
IModel.onDidChangeContent
. That provides meIModelContentChangedEvent2
which has the original span, and the new text that has replaced what was there before. But that alone isn't enough for me to calculate the net change in number of lines caused by this event (hence, the number of lines that my existing content widgets must scroll by).The text was updated successfully, but these errors were encountered: