about summary refs log tree commit diff
path: root/src/etc/vim/indent/rust.vim
AgeCommit message (Collapse)AuthorLines
2015-01-29Pull configs out into individual repositoriesSteve Klabnik-196/+0
As we grow, these don't belong in-tree. http://internals.rust-lang.org/t/moving-editor-highlighting-into-their-own-repos/1395 * https://github.com/rust-lang/rust.vim * https://github.com/rust-lang/rust-mode * https://github.com/rust-lang/gedit-config * https://github.com/rust-lang/kate-config * https://github.com/rust-lang/nano-config * https://github.com/rust-lang/zsh-config
2014-09-18fix for vim < 7.4.355Julian Orth-0/+37
2014-09-13update vim indent fileJulian Orth-38/+3
2014-05-08vim: Fix an indentation issue with cindentKevin Ballard-11/+16
cindent handles the following case incorrectly: impl X { b: int, // c: int, } if you try and insert a new line after the `c` declaration. To fix this, fix the get_line_trimmed() function to work properly, and then extend GetRustIndent to keep searching backwards until it finds a non-blank line after trimming. This lets it handle the trailing comma case properly, as if the comment were never there. Fixes #14041.
2014-05-04vim: Fix indentation at global scope after non-semantic ([{/)]}Kevin Ballard-3/+19
If an unbalanced [ exists in a string or comment, this should not be considered when calculating the indent at the top level. Similarly, when testing for ({/}) to see if we're at the top level to begin with, strings and comments should be skipped.
2014-04-24Fix Vim indent regressions from #13600.Chris Morgan-1/+1
The change in #13600 was incorrect, containing a bad regular expression; inside an indent function, errors are silently ignored (and the ``~=`` operation will return 0), so it just always failed, causing the cases that were supposed to be caught to not be caught and making things like the ``match`` example shown above or struct field definitions regress. I have fixed the regular expression to what it should have been. This is still imperfect, of course, not handling cases like where the first argument to a function is a function call (``foo(bar(),``), but it'll do for now.
2014-04-18Add another case where cindent is correctBrandon Waskiewicz-0/+11
When calling a function, or anything with nested parens, default to cindent's indent. The least error-prone way I could think of identifying this is to look for a line that ends with a ',', as well as a non-zero number of any character except parens before the comma, and then an open paren. This will overlap with the previous rule accounting for function definitions, but that should be fine because it is also using cindent.
2013-10-30Fix Vim indent for wrapped function arguments.Chris Morgan-2/+17
2013-07-11Fix Vim indentation for inline closures.Chris Morgan-1/+1
2013-07-11Fix comment indenting properly for Vim files.Chris Morgan-4/+14
Indentation now works correctly on subsequent lines of a multi-line comment, whether there are leaders (` * `) or not. (Formerly it was incorrectly doing a two-space indent if there was no leader.) By default, this no longer puts a ` * ` leader on `/*!` comments, as that appears to be the current convention in the Rust source code, but that can easily be re-enabled if desired: let g:rust_bang_comment_leader = 1
2013-07-10Do indentation properly in Vim.Chris Morgan-3/+129
The cases that this improves are clearly documented inside the committed file, so this commit message is comparatively brief.
2013-05-08Improved vim indent file for rustJames Miller-1/+4
2012-08-23vim - fix indent rules, hilight format strings, some keywordsBen Blum-3/+1
2012-02-19vim: fix indenting enums and macrosErick Tryzelaar-1/+2
Now vim indenting goes from: fn main() { enum t { a: int, b: int } #error("hello world"); } to: fn main() { enum t { a: int, b: int } #error("hello world"); }
2011-05-17Move vim syntax file, add indent file.Erick Tryzelaar-0/+9