Skip to content
This repository
Browse code

Bug fix: Make <Tab> work on empty lines (reported by Ulrik Sverdrup)

  • Loading branch information...
commit c4f231e6d920d17901a32d43a4b64415a5af5f44 1 parent d863547
Peter Odding authored May 22, 2011
12  autoload/xolox/notes.vim
... ...
@@ -1,6 +1,6 @@
1 1
 " Vim auto-load script
2 2
 " Author: Peter Odding <peter@peterodding.com>
3  
-" Last Change: May 2, 2011
  3
+" Last Change: May 22, 2011
4 4
 " URL: http://peterodding.com/code/vim/notes/
5 5
 
6 6
 " Note: This file is encoded in UTF-8 including a byte order mark so
@@ -406,9 +406,13 @@ endfunction
406 406
 
407 407
 function! xolox#notes#indent_list(command, line1, line2) " {{{3
408 408
   " Change indent of list items from {line1} to {line2} using {command}.
409  
-  execute a:line1 . ',' . a:line2 . 'normal' a:command
410  
-  if getline('.') =~ '•$'
411  
-    call setline('.', getline('.') . ' ')
  409
+  if a:line1 == a:line2 && getline(a:line1) == ''
  410
+    call setline(a:line1, repeat(' ', &tabstop))
  411
+  else
  412
+    execute a:line1 . ',' . a:line2 . 'normal' a:command
  413
+    if getline('.') =~ '•$'
  414
+      call setline('.', getline('.') . ' ')
  415
+    endif
412 416
   endif
413 417
   normal $
414 418
 endfunction
2  plugin/notes.vim
@@ -3,7 +3,7 @@
3 3
 " Last Change: May 22, 2011
4 4
 " URL: http://peterodding.com/code/vim/notes/
5 5
 " License: MIT
6  
-" Version: 0.8.3
  6
+" Version: 0.8.4
7 7
 
8 8
 " Support for automatic update using the GLVS plug-in.
9 9
 " GetLatestVimScripts: 3375 1 :AutoInstall: notes.zip

0 notes on commit c4f231e

Please sign in to comment.
Something went wrong with that request. Please try again.