Using the mouse cursor to draw a rendered line in scene view in edit mode

I’ve been on this problem for weeks now and can’t seem to get it working so I think it’s time to ask if it’s even possible. I want to use the mouse to draw a line in scene view in edit mode, just like what’s done in the following video and example project:

That example works fantastically in game mode. But I want to make it work in edit mode so that I can draw a line and then instantiate objects at intervals along that line. Currently I’ve got it set up so that after pressing a custom button in the inspector it allows me to hold the alt key and the left mouse button to draw the line. Unity recognizes that I’m holding both the alt key and the mouse button, but it doesn’t draw the line. I’m assuming this is because it doesn’t refresh the scene except OnSceneGUI which only seems to update with new mouse clicks/releases and keyboard presses/releases, but even after finishing moving the mouse there are no vector points saved in the line renderer. I’ve tried using HandleUtility.Repaint in OnSceneGUI to no avail, and I’ve also tried instantiating and destroying an object repeatedly to try to force OnSceneGUI to refresh as I move the mouse and that doesn’t seem to work either.

Does anyone know if what I’m trying to do is even possible or have any suggestions for alternative methods I could attempt to get it working?

you can do a sceneview Repaint in the if(alt && mousedrag){…} block, should be enough