dpayne / CodeGPT.nvim

CodeGPT is a plugin for neovim that provides commands to interact with ChatGPT.
GNU General Public License v3.0
764 stars 50 forks source link

Fixed code extraction in code popup #37

Closed blockchainian closed 1 year ago

blockchainian commented 1 year ago

hey @dpayne!

minor fix. somehow, trimming doesn't work for indented code blocks.

please let me know if this makes sense.

dpayne commented 1 year ago

I think this should fix it while still keeping the indentation fix https://github.com/dpayne/CodeGPT.nvim/commit/3e1ef218268c38492d074a984a0ca191ceacc730 Do you minding testing what is in the latest master?

blockchainian commented 1 year ago

@dpayne thanks for the fix. it worked like a blast!

blockchainian commented 1 year ago

so just to understand how indentation works. does the generated code have the same indentation as the prompt? yeah?

image

edit: answered my own question. this is pretty neat!