mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-12-17 02:44:17 +00:00
Last commit before tagging and releasing
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: once
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Header Include-Guard
|
||||
# --
|
||||
#ifndef ${1:`#!/usr/bin/env ruby -wKU -riconv
|
||||
name = ENV["TM_FILENAME"] || "untitled"
|
||||
name = Iconv.iconv("ASCII//TRANSLIT", "UTF-8", name).first
|
||||
name = name.gsub(/[^a-z0-9]+/i, "_")
|
||||
uuid = (rand * 2821109907455).round.to_s(36)
|
||||
print "#{name}_#{uuid}".tr("[a-z]", "[A-Z]")
|
||||
`}
|
||||
#define $1
|
||||
|
||||
${TM_SELECTED_TEXT/\Z\n//}${0:}
|
||||
|
||||
#endif /* end of include guard: $1 */
|
||||
Reference in New Issue
Block a user