From 8ccb79057ee477c36d155f2c507c859934f858dd Mon Sep 17 00:00:00 2001 From: temporal Date: Thu, 31 Jul 2008 01:43:34 +0000 Subject: [PATCH] Apply Leandro Lucarella 's patches for VIM highlighting and not setting execute bit on protoc outputs. --- CONTRIBUTORS.txt | 1 + editors/proto.vim | 10 +++++++++- src/google/protobuf/compiler/command_line_interface.cc | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 0772fd671..74403530b 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -38,3 +38,4 @@ Non-Google patch contributors: Kevin Ko Johan Euphrosine Ulrich Kunitz + Leandro Lucarella diff --git a/editors/proto.vim b/editors/proto.vim index ea010480e..19c0d4c52 100644 --- a/editors/proto.vim +++ b/editors/proto.vim @@ -23,6 +23,9 @@ " augroup filetype " au! BufRead,BufNewFile *.proto setfiletype proto " augroup end +" +" Or just create a new file called ~/.vim/ftdetect/proto.vim with the +" previous lines on it. if version < 600 syntax clear @@ -32,6 +35,9 @@ endif syn case match +syn keyword pbTodo contained TODO FIXME XXX +syn cluster pbCommentGrp contains=pbTodo + syn keyword pbSyntax syntax import option syn keyword pbStructure package message group syn keyword pbRepeat optional required repeated @@ -50,7 +56,7 @@ syn match pbInt /\<0[xX]\x+\>/ syn match pbFloat /\<-\?\d*\(\.\d*\)\?/ " TODO: .proto also supports C-style block comments; " see /usr/share/vim/vim70/syntax/c.vim for how it's done. -syn match pbComment /\/\/.*$/ +syn region pbComment start="//" skip="\\$" end="$" keepend contains=@pbCommentGrp syn region pbString start=/"/ skip=/\\"/ end=/"/ syn region pbString start=/'/ skip=/\\'/ end=/'/ @@ -62,6 +68,8 @@ if version >= 508 || !exists("did_proto_syn_inits") command -nargs=+ HiLink hi def link endif + HiLink pbTodo Todo + HiLink pbSyntax Include HiLink pbStructure Structure HiLink pbRepeat Repeat diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc index 6c2c9e8f6..8f559f55f 100644 --- a/src/google/protobuf/compiler/command_line_interface.cc +++ b/src/google/protobuf/compiler/command_line_interface.cc @@ -203,7 +203,7 @@ io::ZeroCopyOutputStream* CommandLineInterface::DiskOutputDirectory::Open( do { file_descriptor = open((root_ + filename).c_str(), - O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0777); + O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666); } while (file_descriptor < 0 && errno == EINTR); if (file_descriptor < 0) {