about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-09-22 07:15:30 +0000
committerbors <bors@rust-lang.org>2014-09-22 07:15:30 +0000
commiteeda1b87ff9dd2902f6d58c83d384775b90e3734 (patch)
treea8470e0d859aa920097faebda8f9174b5f07b463 /src/rustllvm/PassWrapper.cpp
parentcbb07e81be99271f9e240a27dcf540686d8c0bfc (diff)
parent39116d01914854882f62b1306e8b96fb0b4f9842 (diff)
downloadrust-eeda1b87ff9dd2902f6d58c83d384775b90e3734.tar.gz
rust-eeda1b87ff9dd2902f6d58c83d384775b90e3734.zip
auto merge of #17212 : mahkoh/rust/vim, r=kballard
There are currently two huge problems with the indent file:

1. Long list-like things cannot be indented. See #14446 for one example. Another one is long enums with over 100 lines, including comments. The indentation process stops after 100 lines and the rest is in column 0.
2. In certain files, opening a new line at mod level is extremely slow. See [this](https://github.com/mahkoh/posix.rs/blob/master/src/unistd/mod.rs) for an example. Opening a line at the very end and holing \<cr> down will freeze vim temporarily.

The reason for 1. is that cindent doesn't properly indent things that end with a `,` and the indent file tries to work around this by using the indentation of the previous line. It does this by recursively calling a function on the previous lines until it reaches the start of the block. Naturally O(n^2) function calls don't scale very well. Instead of recalculating the indentation of the previous line, we will now simply use the given indentation of the previous line and let the user deal with the rest. This is sufficient unless the user manually mis-indents a line.

The reason for 2. seems to be function calls of the form
```
searchpair('{\|(', '', '}\|)', 'nbW', 's:is_string_comment(line("."), col("."))')
```
I've no idea what this even does or why it is there since I cannot reproduce the mistake cindent is supposed to make without this fix. Therefore I've simply removed that part.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions