Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
luozhiya committed May 17, 2024
1 parent 0749c0a commit a63587d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
runtime
nightly
nightly
doc/tags
9 changes: 9 additions & 0 deletions after/ftplugin/FittenCodeChat.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
if exists("b:did_ftplugin")
finish
endif

let b:did_ftplugin = 1

echo "Hello, FittenCodeChat!"

runtime! ftplugin/markdown.vim
14 changes: 4 additions & 10 deletions lua/fittencode/engines/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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', '<C-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('<ESC>', 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)
Expand Down

0 comments on commit a63587d

Please sign in to comment.