Skip to content

Commit

Permalink
Don't set tabstop in shell buffers (#224)
Browse files Browse the repository at this point in the history
:FZF opens a terminal in the same window as the current buffer, and
setbufvar(tabstop) affects the cursor position in the current buffer
as well as the cursor position in the terminal buffer.

To avoid that, don't set tabstop in terminal windows running shells.
  • Loading branch information
chrisbra authored and cxw42 committed Nov 26, 2023
1 parent 0d54ea8 commit 7eec467
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugin/editorconfig.vim
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,8 @@ function! s:ApplyConfig(bufnr, config) abort
endif
endif

if s:IsRuleActive('tab_width', a:config)
" Set tabstop. Skip this for terminal buffers, e.g., :FZF (#224).
if s:IsRuleActive('tab_width', a:config) && bufname(l:bufnr) !~# '^!\w*sh$'
let l:tabstop = str2nr(a:config["tab_width"])
call setbufvar(a:bufnr, '&tabstop', l:tabstop)
else
Expand Down

0 comments on commit 7eec467

Please sign in to comment.