jlcrochet / vim-ruby Goto Github PK
View Code? Open in Web Editor NEWImproved syntax highlighting and indentation for Ruby
Improved syntax highlighting and indentation for Ruby
First of all, thank you for vim-ruby!
It seems that this plugins breaks Haml highlighting through vim-haml (distributed with Vim itself) under some circumstances.
I originally thought this was a bug in vim-haml and opened a PR for it, but in the end that turned out not to be the case, and instead disabling your plugin fixed the issue for me.
The issue itself has to do with curly brace ({}
) attributes in Haml, which contain Ruby. When using that syntax along with a nested hash, the result is that vim-ruby continues to syntax-highlight the rest of the file, never returning back to Haml.
Here's an example Haml snippet that breaks highlighting:
.example{ data: { foo: 'bar' } }
%p
The lines after the first should be highlighted as Haml, but instead
they get highlighted as Ruby when using vim-ruby.
This only happens when there's a nested hash in attributes as above
class ThisShould_NOT_BeHighlightedAsRuby
end
I'd still like to use your plugin, but since I work with a lot of Haml files I'm unable to. I understand this may not be a bug that affects you though, so if you decide not to look into it that's perfectly OK, but I thought I'd bring it to your attention at least.
I had problems with default ruby plugin, and your version seems to fix it all!
The reason i make this issue, is that other people may be able to find your repo with a search engine when they search for the error message.
I am guessing a lot of people are having these errors:
E363: pattern uses more memory than 'maxmempattern'
'redrawtime' exceeded, syntax highlighting disabled
These are gone now!
Thanks!
Hey again ๐ ,
I found a small bug in the new Haml highlighter.
In Haml you can use #{}
for interpolating Ruby into a line of text, e.g.:
%p Hey there, my name is #{@name}
The new Haml syntax highlighter knows about this, but fails to detect it when the interpolation is at the beginning of its own line, e.g.:
%p
Hey there, my name is
#{@name}.
Screenshot:
First, thank you very much for writing this!
I get the following code indentation:
redirect_to @foo,
notice: 'Something'
The Ruby Style guide here method argument alignment says that arguments should be aligned with the end of the method name, so I would expect this:
redirect_to @foo,
notice: 'Something'
It works this way when using parentheses:
redirect_to(@foo,
notice: 'Something')
but the style guide recommends not using parentheses for dsl method calls , so using parentheses is not an option in these cases.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.