From 1029648e8eeb7c8900154a28556f9048201f0153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Walle?= Date: Tue, 20 Mar 2012 19:26:57 +0100 Subject: [PATCH] Insert missing logical operator. Fix breaking on empty filetype. --- plugin/double-tap.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin/double-tap.vim b/plugin/double-tap.vim index 6f7074e..44b2816 100644 --- a/plugin/double-tap.vim +++ b/plugin/double-tap.vim @@ -1,3 +1,4 @@ +" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Double-Tap makes annoying comments go away " Maintainer: Øystein Walle @@ -25,7 +26,7 @@ set cpo&vim " We need version 7 for mappings " as well as the user wanting nocompatible if exists("g:loaded_doubletap") - \ !has("comments") + \ || !has("comments") \ || v:version < 700 \ || &compatible let &cpo = s:save_cpo @@ -43,6 +44,10 @@ let s:commStart = {} " dict to hold the comment starters using " This function returns a regular if the current line " is not simply an empty comment. Otherwise it clears the line function! Doubletap_detect_empty_comment() + " Do nothing in particular if no filetype is set + if empty(&ft) + return "\" + endif " Captures the comment starter if necessary; only once per filetype if !has_key(s:commStart, &ft) let s:commStart[&ft] = substitute(&comments, s:pattern, '\2', '')