lib/soywiki.vim in soywiki-0.9.7 vs lib/soywiki.vim in soywiki-0.9.8
- old
+ new
@@ -20,10 +20,14 @@
let s:find_pages_linking_in_command = 'soywiki-pages-linking-in '
let s:expand_command = 'soywiki-expand '
let s:ls_command = 'soywiki-ls-t '
let s:search_for_link = ""
+if !exists("g:soywiki_filetype")
+ let g:soywiki_filetype = 'txt'
+endif
+
func! s:trimString(string)
let string = substitute(a:string, '\s\+$', '', '')
return substitute(string, '^\s\+', '', '')
endfunc
@@ -291,11 +295,12 @@
echo system("git mv " . original_file . " " . newfile)
else
echo system("mv " . original_file . " " . newfile)
endif
call system("git commit -am 'rename wiki page'")
- exec "!" . s:rename_links_command . original_file . " " . newfile
+ let &buftype = "nofile"
+ exec "!" . s:rename_links_command . s:wiki_root() . " " . original_file . " " . newfile
call system("git commit -am 'rename wiki links'")
exec "e " . newfile
else
call s:display_invalid_wiki_word_error(page_title)
endif
@@ -688,10 +693,10 @@
" this checks if the buffer is a SoyWiki file (from firstline)
" and then turns on syntax coloring and mappings as necessary
func! s:prep_buffer()
if (s:is_wiki_page() && !exists("b:mappings_loaded"))
" let user decide on the textwidth
- set filetype=txt
+ let &filetype=g:soywiki_filetype
nnoremap <buffer> <cr> :call <SID>follow_link_under_cursor(0)<cr>
nnoremap <buffer> <c-l> :call <SID>follow_link_under_cursor(2)<cr>
nnoremap <buffer> <c-h> :call <SID>follow_link_under_cursor(1)<cr>
noremap <buffer> <leader>f :call <SID>fuzzy_follow_link(0)<CR>
noremap <buffer> <c-j> :call <SID>find_next_wiki_link(0)<CR>