Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

查找时提示winlayout未定义 #311

Open
pidansolo opened this issue Jun 23, 2021 · 5 comments
Open

查找时提示winlayout未定义 #311

pidansolo opened this issue Jun 23, 2021 · 5 comments

Comments

@pidansolo
Copy link

image

@pidansolo
Copy link
Author

使用的vim版本太老,没有winlayout。更新使用8.2版本后解决。
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 13 2020 16:04:38)

@dyng
Copy link
Owner

dyng commented Sep 3, 2021

@pidansolo 这是个问题。按照设计sync模式需要支持Vim 7.4。

@dyng dyng reopened this Sep 3, 2021
@ukos-git
Copy link

  • First install of plugin on VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Oct 13 2020 15:49:09)
  • command entered: :CtrlSF test
  • Same Error
  • After Hitting [Enter], search results open as expected in left split
Searching...
Error detected while processing function ctrlsf#Search[15]..<SNR>72_ExecSearch[18]..<SNR>72_DoSearchAsync[4]..<SNR>72_Open[1].
.ctrlsf#win#OpenMainWindow[14]..ctrlsf#win#BackupAllWinSize:
line    4:
E117: Unknown function: winlayout
E116: Invalid arguments for function s:BuildResizeCmd(winlayout(), 0, 0), '|'))
E116: Invalid arguments for function join(s:BuildResizeCmd(winlayout(), 0, 0), '|'))
E116: Invalid arguments for function add
Press ENTER or type command to continue

image

@a-zvg
Copy link

a-zvg commented Dec 3, 2021

Try to install ctrlsf v2.1.2. It's worked for me.

@Nealium
Copy link

Nealium commented Sep 29, 2022

I've ran into this error when I was using Vim 8.1, winlayout is a newer function
Here's a couple of potential solutions:

  1. Just update your Vim Version
  2. Use an older version of CtrlSF
  3. Edit Code in autoload/ctrlsf/win.vim

autoload/ctrlsf/win.vim

  • Find func! ctrlsf#win#BackupAllWinSize()
  • Replace with:
func! ctrlsf#win#BackupAllWinSize()
    if !(exists('g:ctrlsf_win_compatibility'))
      " New Way
      if !exists("t:ctrlsf_winrestcmd")
          let t:ctrlsf_winrestcmd = []
      endif
      call add(t:ctrlsf_winrestcmd, join(s:BuildResizeCmd(winlayout(), 0, 0), '|'))
    else
      " Old Way
      let nr = 1
      while winbufnr(nr) != -1
          if getwinvar(nr, '&winfixwidth') || getwinvar(nr, '&winfixheight')
              if type(getwinvar(nr, 'ctrlsf_winwidth_bak')) != 3
                  call setwinvar(nr, 'ctrlsf_winwidth_bak', [])
              endif
              call add(getwinvar(nr, 'ctrlsf_winwidth_bak'), winwidth(nr))

              if type(getwinvar(nr, 'ctrlsf_winheight_bak')) != 3
                  call setwinvar(nr, 'ctrlsf_winheight_bak', [])
              endif
              call add(getwinvar(nr, 'ctrlsf_winheight_bak'), winheight(nr))
          endif
          let nr += 1
      endwh
    endif
endf
  • add let g:ctrlsf_win_compatibility = 1 into your vimrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants