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

Syntax highlighting may be disabled by "'redrawtime' exceeded" when re=1 #3583

Open
sugymt opened this issue Sep 10, 2023 · 4 comments
Open

Comments

@sugymt
Copy link

sugymt commented Sep 10, 2023

What did you do? (required: The issue will be closed when not provided)

  1. Setup env.
    sudo docker run --rm -it ubuntu:22.04 /bin/bash
    
    cd
    
    apt update
    apt install -y vim curl git
    
    curl -LO https://go.dev/dl/go1.21.1.linux-amd64.tar.gz
    tar xzf go1.21.1.linux-amd64.tar.gz
    mv go go1.21.1
    export PATH="$HOME/go1.21.1/bin:$PATH"
    
    git clone https://github.com/fatih/vim-go.git ~/.vim/pack/plugins/start/vim-go
    vim +GoInstallBinaries +q
    
    echo "set re=1" > ~/.vimrc
    echo "let g:go_highlight_function_calls = 1" >> ~/.vimrc
    
    echo "// aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" > main.go
  2. Open the file. vim main.go
  3. Insert '[' between the first 'a' and the second 'a'. :%s/ a/ a[/

What did you expect to happen?

vim and vim-go continues to work normally.

What happened instead?

"'redrawtime' exceeded, syntax highlighting disabled" is displayed and syntax highlighting is disabled.

This problem could be avoided by either of the following methods:

  • Change set re=1 to set re=0 or set re=2 in .vimrc
  • Install vim-go v1.25

Probably caused by #3397

MacOS users may run into this problem because vim defaults to re=1 .

Configuration (MUST fill this out):

vim-go version:

v1.28

vimrc you used to reproduce:

vimrc
set re=1
let g:go_highlight_function_calls = 1

Vim version (first three lines from :version):

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 18 2023 04:12:26)
Included patches: 1-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919, 213
Modified by [email protected]

Go version (go version):

go version go1.21.1 linux/amd64

Go environment

go env Output:
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/root/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/root/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/root/go1.21.1'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/root/go1.21.1/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.1'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='0'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2582224566=/tmp/go-build -gno-record-gcc-switches'

gopls version

gopls version Output:
golang.org/x/tools/gopls v0.13.2
    golang.org/x/tools/[email protected] h1:Pyvx6MKvatbX3zzZmdGiFRfQZl0ohPlt2sFxO/5j6Ro=
@sugymt
Copy link
Author

sugymt commented Sep 10, 2023

I don't know if this issue can be avoided by changing the implementation, but I hope that if re=0 or re=2 is recommended, it will be documented.

@bhcleek
Copy link
Collaborator

bhcleek commented Sep 16, 2023

Yes, this has come up a few times. A FAQ entry seems appropriate.

@bhcleek bhcleek added this to the vim-go v1.29 milestone Sep 16, 2023
@nidhi-singh02
Copy link

Do we wish to add this to the documentation ? I could help.

@bhcleek
Copy link
Collaborator

bhcleek commented Oct 2, 2023

@nidhi-singh02 yes, I'd like to add this to the FAQ section in https://github.com/fatih/vim-go/blob/master/doc/vim-go.txt. I would welcome a PR if you want to submit it.

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

No branches or pull requests

3 participants