jcfaria / Vim-R-plugin

Plugin to work with R (forked for development only)
http://www.vim.org/scripts/script.php?script_id=2628
121 stars 34 forks source link

Incorrect indenting when '=' exists in string literal #158

Closed pgforbes closed 9 years ago

pgforbes commented 9 years ago

Thank you for your excellent work with Vim-R. I noticed an indenting bug recently when I was composing SQL queries. When a string is split over multiple lines, the indenter treats operators inside the string as if they were functional. Here's a minimal working example: notice that f() is indented too far in the current behavior.

Current behavior:

paste("A
      =", 2)
      f()

Correct behavior:

paste("A
      =", 2)
f()

Thank you again for your work!

jalvesaq commented 9 years ago

I am sorry, but this is a duplicate of https://github.com/jcfaria/Vim-R-plugin/issues/77. The problem is the multiline string, not the = inside it. Example:

paste("A
      B", 2)
      f()

A workaround is to use the special character \n instead of a real newline:

paste("A\n=", 2)
jalvesaq commented 9 years ago

I deleted from the Vim-R-plugin the files that are already distributed as official Vim runtime files. Now, there is a new repository with these files: https://github.com/jalvesaq/R-Vim-runtime

Since the official runtime files are no longer in this repository, I'm closing this bug. This bug is already described in the Known bugs section of the README.md, and new bugs should be reported in the new repository.