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

Miscellaneous Vim improvements #12592

Closed

Commits on Feb 27, 2014

  1. Highlight the mod in extern mod x; as Error.

    Just like the bare keyword `crate` is highlighted as Error (a little
    dubious, actually, given macros), `mod` is invalid after `extern`: it's
    obsolete syntax.
    chris-morgan committed Feb 27, 2014
    Configuration menu
    Copy the full SHA
    63bae3a View commit details
    Browse the repository at this point in the history
  2. Downgrade do to a reserved keyword in Vim.

    This means it gets highlighted as Error by default.
    chris-morgan committed Feb 27, 2014
    Configuration menu
    Copy the full SHA
    256b094 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    66af850 View commit details
    Browse the repository at this point in the history
  4. Fix Vim section movements for standard Rust style.

    (Expressed another way: make `[[` et al. work with the curly brace at
    the end of a line as is standard Rust style, not just at the start is it
    is by default in Vim, from K&R style.)
    
    This came out of rust-lang#11492, where a simpler but less effective technique
    was initially proposed; some discussion of the techniques, ways and
    means can be found there.
    
    There are still a few caveats:
    
    - Operator-pending mode behaves differently to the standard behaviour:
      if inside curly braces, it should delete up to and including the
      closing of the outermost curly brace (that doesn't seem to me
      consistent with documented behaviour, but it's what it does). Actual
      behaviour (the more logical and consistent, in my opinion): up to the
      start of the next outermost curly brace.
    
    - With folding enabled (`set fdm=syntax`), `[[` and `]]` do not behave
      as they should: the default behaviour treats an entire closed fold as
      one line for these purposes while this code does not (I explicitly
      `set nofoldenable` in the function—the side-effects are worse with
      folds enabled), leading to unexpected behaviour, the worst of which is
      `[[` and/or `]]` not working in visual mode on a closed fold (visual
      mode keeps it at the extreme end of the region line of the folded
      region, so it's always going back to the opening line of that fold and
      immediately being shoved back to the end by visual mode).
    
    - `[[` and `]]` are operating inside comments, whereas the standard
      behaviour skips comments.
    
    - The viewport position is sometimes changed when it should not be
      necessary.
    chris-morgan committed Feb 27, 2014
    Configuration menu
    Copy the full SHA
    a94a559 View commit details
    Browse the repository at this point in the history
  5. 4 Configuration menu
    Copy the full SHA
    b1525de View commit details
    Browse the repository at this point in the history