Skip to content

Commit

Permalink
Fix minor indent bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
jalvesaq committed Nov 2, 2014
1 parent 44f4efb commit 4b3abb8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions indent/r.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" Vim indent file
" Language: R
" Author: Jakson Alves de Aquino <[email protected]>
" Last Change: Fri Oct 17, 2014 10:02AM
" Last Change: Sun Nov 02, 2014 10:55AM


" Only load this indent file when no other was loaded.
Expand Down Expand Up @@ -288,9 +288,13 @@ function GetRIndent()
return indent(lnum) + &sw
endif

let s:curtabstop = repeat(' ', &tabstop)
if pb > 0 && line =~ '{$'
return s:Get_last_paren_idx(line, '(', ')', pb) + &sw
endif

let bb = s:Get_paren_balance(line, '[', ']')

let s:curtabstop = repeat(' ', &tabstop)
if g:r_indent_align_args == 1

if pb == 0 && bb == 0 && (line =~ '.*[,&|\-\*+<>]$' || cline =~ '^\s*[,&|\-\*+<>]')
Expand Down
6 changes: 3 additions & 3 deletions r-plugin/indent_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -525,13 +525,13 @@ test <- this('the function works',
x <- 0
})

############################################################################
## indent/r.vim starts to make mistakes here

test <- this('the function works', {
x <- 0
})

############################################################################
## indent/r.vim starts to make mistakes here

data.frame <- function(..., row.names = NULL, check.rows = FALSE, check.names = TRUE,
stringsAsFactors = default.stringsAsFactors())
{
Expand Down

0 comments on commit 4b3abb8

Please sign in to comment.