Permalink
Browse files

Fix abbreviation replacement function

Replace instruction if and only if it is at the beginning of the line.
  • Loading branch information...
1 parent ad1632b commit d3a4acc5b49fe8bda90383c6633dcf61f81ac93c @rendon rendon committed Nov 20, 2015
Showing with 1 addition and 1 deletion.
  1. +1 −1 ftplugin/Dockerfile.vim
@@ -1,6 +1,6 @@
function! DockerfileReplaceInstruction(original, replacement)
let syn = synIDtrans(synID(line("."), col(".") - 1, 0))
- if syn != hlID("Comment") && syn != hlID("Constant")
+ if syn != hlID("Comment") && syn != hlID("Constant") && strlen(getline(".")) == 0
let word = a:replacement
else
let word = a:original

0 comments on commit d3a4acc

Please sign in to comment.