todo.md

 1- Style the current inline editor
 2- Find a way to understand whether we want to refactor or append, or both. (function calls)
 3- Add a system prompt that makes GPT an expert of language X
 4- Provide context around the cursor/selection. We should try to fill the context window as much as possible (try to fill half of it so that we can spit out another half)
 5- When you hit escape, the assistant should stop.
 6- When you hit undo and you undo a transaction from the assistant, we should stop generating.
 7- Keep the inline editor around until the assistant is done. Add a cancel button to stop, and and undo button to undo the whole thing. (Interactive<IconButton>)
 8
 9
10# 9:39 AM
11
12- Hit `ctrl-enter`
13
14- Puts me in assistant mode with the selected text highlighted in a special color. If text was selected, I'm in transformation mode.
15- If there's no selection, put me on the line below, aligned with the indent of the line.
16- Enter starts generation
17- Ctrl-enter inserts a newline
18- Once generations starts, enter "confirms it" by dismissing the inline editor.
19- Escape in the inline editor cancels/undoes/dismisses.
20- To generate text in reference to other text, we can *mark* text.
21
22
23- Hit ctrl-enter deploys an edit prompt
24    - Empty selection (cursor) => append text
25        - On end of line: Edit prompt on end of line.
26        - Middle of line: Edit prompt near cursor head on a different line
27    - Non-empty selection => refactor
28        - Edit prompt near cursor head on a different line
29        - What was selected when you hit ctrl-enter is colored.
30- Selection is cleared and cursor is moved to prompt input
31- When cursor is inside a prompt
32    - Escape cancels/undoes
33    - Enter confirms
34- Multicursor
35    - Run the same prompt for every selection in parallel
36    - Position the prompt editor at the newest cursor
37- Follow up ship: Marks
38    - Global across all buffers
39    - Select text, hit a binding
40    - That text gets added to the marks
41        - Simplest: Marks are a set, and you add to them with this binding.
42        - Could this be a stack? That might be too much.
43    - When you hit ctrl-enter to generate / transform text, we include the marked text in the context.
44
45- During inference, always send marked text.
46- During inference, send as much context as possible given the user's desired generation length.
47
48- This would assume a convenient binding for setting the generation length.
49
50
51~~~~~~~~~
52
53Dial up / dial down how much context we send
54Dial up / down your max generation length.
55
56
57------- (merge to main)
58
59- Text in the prompt should soft wrap
60
61----------- (maybe pause)
62
63- Excurse outside of the editor without dismissing it... kind of like a message in the assistant.