Skip to content

Commit

Permalink
fix : do not set options when self.buf is nil (#53)
Browse files Browse the repository at this point in the history
neovim/neovim#14090 (comment)

Now the master did breaking changes to several functions fail with `nil`
value. This patch makes it execute only when self.buf is not `nil`.
  • Loading branch information
delphinus authored Jan 4, 2022
1 parent 0911ab9 commit eabb65f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/FTerm/terminal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ function Term:open_term()
end

-- This prevents the filetype being changed to term instead of fterm when closing the floating window
A.nvim_buf_set_option(self.buf, 'filetype', self.config.ft)
if self.buf then
A.nvim_buf_set_option(self.buf, 'filetype', self.config.ft)
end

cmd('startinsert')

Expand Down

0 comments on commit eabb65f

Please sign in to comment.