Treat visual cursor on end-of-line as one behind

Like matchit.  Fixes #36.
This commit is contained in:
Andy K. Massimino
2018-08-17 10:52:24 -04:00
parent ebdac3081d
commit b777c11ef9
2 changed files with 25 additions and 0 deletions

View File

@@ -304,6 +304,10 @@ function! s:get_delim(opts) " {{{1
if l:cursorpos > 1 && l:insertmode
let l:cursorpos -= 1
endif
if l:cursorpos > strlen(getline('.'))
\ && stridx("vV\<c-v>", mode()) > -1
let l:cursorpos -= 1
endif
let s:invert_skip = 0

View File

@@ -0,0 +1,21 @@
return unless original_filename
if model && model.read_attribute(mounted_as).present?
model.read_attribute(mounted_as)
else
"#{SecureRandom.hex(5)}.#{file.extension}"
end
end
def store_dir
"u/#{model.user_id}/#{model.id}"
end
def extension_whitelist
%w[jpg jpeg png]
end
version :thumb do
process resize_to_fit: [150, 150]
end
end