diff --git a/.gitignore b/.gitignore index 079e8e4..040429b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ runtime -nightly \ No newline at end of file +nightly +doc/tags diff --git a/after/ftplugin/FittenCodeChat.vim b/after/ftplugin/FittenCodeChat.vim new file mode 100644 index 0000000..18b11c1 --- /dev/null +++ b/after/ftplugin/FittenCodeChat.vim @@ -0,0 +1,9 @@ +if exists("b:did_ftplugin") + finish +endif + +let b:did_ftplugin = 1 + +echo "Hello, FittenCodeChat!" + +runtime! ftplugin/markdown.vim diff --git a/lua/fittencode/engines/actions.lua b/lua/fittencode/engines/actions.lua index d5e9551..b76ad97 100644 --- a/lua/fittencode/engines/actions.lua +++ b/lua/fittencode/engines/actions.lua @@ -235,17 +235,11 @@ function ActionsEngine.start_action(action, opts) local window = api.nvim_get_current_win() local buffer = api.nvim_win_get_buf(window) - local sln, eln = api.nvim_buf_get_mark(buffer, '<')[1], api.nvim_buf_get_mark(buffer, '>')[1] - Log.debug('sln: {}, eln: {}', sln, eln) - - local vmode = { 'v', 'V', '' } - Log.debug('mode: {}', api.nvim_get_mode().mode) - if vim.tbl_contains(vmode, api.nvim_get_mode().mode) then - sln = fn.getpos("'<")[2] - eln = fn.getpos("'>")[2] - Log.debug('v mode sln: {}, eln: {}', sln, eln) - end + api.nvim_feedkeys(api.nvim_replace_termcodes('', true, true, true), 'nx', false) + local marks = { '<', '>' } + local sln, eln = api.nvim_buf_get_mark(0, marks[1])[1], api.nvim_buf_get_mark(0, marks[2])[1] + Log.debug('Action range: {}-{}', sln, eln) chat:show() fn.win_gotoid(window)