Comments (7)
I finally have a replication path that I can use to start tracking down the root cause.
from vim-go.
I'm only able to duplicate a problem with the folding when other.go
is opened after main.go
. The other settings are applied correctly. I suspect that what's going on here is a Vim bug of some sort, not a vim-go bug. Some quick testing seems to support that idea.
The folding is as expected when other.go
is opened after main.go
when setting foldmethod
is done unconditionally (e.g. not as part of an auto command). And interestingly, executing :setlocal foldmethod=syntax
folds correctly even when setting foldmethod
via the autocommand didn't cause the intended effect.
As far as I can tell, this isn't really a vim-go bug, especially given how the order file opening impacts the results.
from vim-go.
@bhcleek Thank you for investigating the issue, however I beg to differ this issue is of stock Vim and not of vim-go plugin. I've experimented with removing vim-go
and using only the rudimentary Go support coming with plain Vim (compiler, ftplugin, indentation & syntax highlight) and the issue didn't manifest. I've altered tabstop
and foldmethod
FileType plugin autocommand settings and they were correctly applied.
from vim-go.
I hear you, @dunric. What's throwing me is that the I see tabstop
applied correctly in all scenarios. I've also seen foldmethod
get applied correctly with vim-go when I edit other.go
very quickly after opening main.go
. Something is amiss, but it's hard to track down, and I'm not yet sure what's going on.
from vim-go.
Interestingly, it appears that editing other.go
again fixes the folding 🤔 I'm really not sure what to make of this. Vim-go doesn't do anything specific with regard to setting the foldmethod.
from vim-go.
Given that expandtab seems to be being applied correctly in all cases and that vim-go does not do anything specific with foldmethod, I'm still inclined to believe that this is some kind of Vim bug. Clearly, if it is a Vim bug, it's triggered by conditions that vim-go creates. I'll continue to see if I can narrow it down, but currently I'm stumped.
from vim-go.
Disabling diagnostics highlighting (i.e. g:go_diagnostics_level
) results in the expected behavior. Diagnostic highlighting does a few things with autocmds and also sets text properties. I'm not yet sure exactly what's triggering the errant behavior in Vim, but I suspect it's something to do with setting an autocmd or text properties while Vim is also processing for folding that causes the folds to not be applied when the foldmethod
is syntax
.
from vim-go.
Related Issues (20)
- Merged #3617 breaks UltiSnips placeholder mechanism HOT 3
- Cannot install or make it work with NeoVim gives error E492: Not an editor command :GoDef HOT 2
- Auto imports not working HOT 1
- Support quoting arguments to :GoImpl HOT 3
- Development: `make lint` always fails using GNU grep 3.8 or later HOT 5
- Vim randomly stops when go_highlight_function_calls is on HOT 4
- Execution: GoFmt changes the Chinese at the end to <e4> HOT 2
- Startup time ~4 s on nvim, macos, even with empty init.lua HOT 1
- c-x c-o error HOT 8
- Running :GoDef or any other commands that require gopls fails without error HOT 9
- vim has defined a set of key positions that span the ages
- Thank you for sharing
- Call: GoReferrers error
- GoFillStruct with proto pb.go HOT 1
- Import string is not highlighted if some comment follows
- Why is vim-go removing semicolons? HOT 2
- vim-go: failed to sync breakpoints
- How to setup gopath manually inside `.vimrc` HOT 2
- godef crashes when looking up a tag HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-go.