lean.nvim icon indicating copy to clipboard operation
lean.nvim copied to clipboard

Set the infoview cursor to the goal when updating

Open Julian opened this issue 2 years ago • 3 comments

Right now if the infoview contents are too long, we show the top lines.

It seems more natural perhaps to show the goal instead, which is almost the bottom modulo us showing diagnostics below the goal state.

Comments welcome if someone prefers the current behavior.

Julian avatar Mar 08 '22 20:03 Julian

I certainly prefer the current behavior. Scrolling to the bottom of the diagnostics is rarely what I want.

It seems more natural perhaps to show the goal instead, which is almost the bottom modulo us showing diagnostics below the goal state.

This is a reasonable compromise. The full goal should still be shown though if it fits on the screen. (That is, don't show the last line of the goal as the first line in the infoview.)

gebner avatar Mar 09 '22 17:03 gebner

Scrolling to the bottom of the diagnostics is rarely what I want.

The goal is what I was really suggesting as in the body yeah. Essentially vim.fn.search('^⊢ ', 'c'); vim.cmd('normal z-') -- i.e. "find first goal, then run z-". Do you still prefer the current behavior to that?

Julian avatar Mar 11 '22 13:03 Julian

Oh sorry, that wasn't really clear to me in the first post. Scrolling to the ⊢ is fine.

gebner avatar Mar 11 '22 13:03 gebner