[gtksourceview/wip/chergert/snippets] tweak styles a bit for snippets



commit a350c28cad2d24c1d827700e17b509b40e17604b
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jan 28 17:41:53 2020 -0800

    tweak styles a bit for snippets

 data/snippets/licenses.snippets         | 30 +++++++++++++++---------------
 gtksourceview/gtksourcesnippetcontext.c |  7 +++----
 2 files changed, 18 insertions(+), 19 deletions(-)
---
diff --git a/data/snippets/licenses.snippets b/data/snippets/licenses.snippets
index 57c8bb78..83456c6c 100644
--- a/data/snippets/licenses.snippets
+++ b/data/snippets/licenses.snippets
@@ -25,7 +25,7 @@
   <snippet _name="GPLv3 or later" trigger="gpl3" _description="File header with GPLv3+ license">
     <text languages="python;python3;"><![CDATA[# ${1:$TM_FILENAME}
 #
-# Copyright $CURRENT_YEAR ${2:$FULLNAME} <${3:$EMAIL}>
+# Copyright $CURRENT_YEAR ${2:$NAME} <${3:$EMAIL}>
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -45,7 +45,7 @@ $0]]></text>
     <text languages="c;chdr;cpp;cpphdr;css;js;java;"><![CDATA[/*
  * ${1:$TM_FILENAME}
  *
- * Copyright $CURRENT_YEAR ${2:$FULLNAME} <${3:$EMAIL}>
+ * Copyright $CURRENT_YEAR ${2:$NAME} <${3:$EMAIL}>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -65,7 +65,7 @@ $0]]></text>
 $0]]></text>
     <text languages="c-sharp;rust;"><![CDATA[// ${1:$TM_FILENAME}
 //
-// Copyright $CURRENT_YEAR ${2:$USER_NAME} <${3:$USER_EMAIL}>
+// Copyright $CURRENT_YEAR ${2:$NAME} <${3:$EMAIL}>
 //
 // This program is free software: you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -86,7 +86,7 @@ $0]]></text>
   <snippet _name="LGPLv3 or later" trigger="lgpl3" _description="File header with LGPLv3 or later license">
     <text languages="python;python3;"><![CDATA[# ${1:$TM_FILENAME}
 #
-# Copyright $CURRENT_YEAR ${2:$FULLNAME} <${3:$EMAIL}>
+# Copyright $CURRENT_YEAR ${2:$NAME} <${3:$EMAIL}>
 #
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Lesser General Public License as published by
@@ -106,7 +106,7 @@ $0]]></text>
     <text languages="c;chdr;cpp;cpphdr;css;js;java;"><![CDATA[/*
  * ${1:$TM_FILENAME}
  *
- * Copyright $CURRENT_YEAR ${2:$FULLNAME} <${3:$EMAIL}>
+ * Copyright $CURRENT_YEAR ${2:$NAME} <${3:$EMAIL}>
  *
  * This file is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published by
@@ -126,7 +126,7 @@ $0]]></text>
 $0]]></text>
     <text languages="c-sharp;rust;"><![CDATA[// ${1:$TM_FILENAME}
 //
-// Copyright $CURRENT_YEAR ${2:$USER_NAME} <${3:$USER_EMAIL}>
+// Copyright $CURRENT_YEAR ${2:$NAME} <${3:$EMAIL}>
 //
 // This file is free software; you can redistribute it and/or modify it
 // under the terms of the GNU Lesser General Public License as published by
@@ -147,7 +147,7 @@ $0]]></text>
   <snippet _name="LGPLv2.1 or later" trigger="lgpl2" _description="File header with LGPL 2.1 or later 
license">
     <text languages="python;python3;"><![CDATA[# ${1:$TM_FILENAME}
 #
-# Copyright $CURRENT_YEAR ${2:$FULLNAME} <${3:$EMAIL}>
+# Copyright $CURRENT_YEAR ${2:$NAME} <${3:$EMAIL}>
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -167,7 +167,7 @@ $0]]></text>
     <text languages="c;chdr;cpp;cpphdr;css;js;java;"><![CDATA[/*
  * ${1:$TM_FILENAME}
  *
- * Copyright $CURRENT_YEAR ${2:$FULLNAME} <${3:$EMAIL}>
+ * Copyright $CURRENT_YEAR ${2:$NAME} <${3:$EMAIL}>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -187,7 +187,7 @@ $0]]></text>
 $0]]></text>
     <text languages="c-sharp;rust;"><![CDATA[// ${1:$TM_FILENAME}
 //
-// Copyright $CURRENT_YEAR ${2:$USER_NAME} <${3:$USER_EMAIL}>
+// Copyright $CURRENT_YEAR ${2:$NAME} <${3:$EMAIL}>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -208,7 +208,7 @@ $0]]></text>
   <snippet _name="Apache 2.0" trigger="apache2" _description="File header with Apache 2.0 license">
     <text languages="python;python3;"><![CDATA[# ${1:$TM_FILENAME}
 #
-# Copyright $CURRENT_YEAR ${2:$FULLNAME} <${3:$EMAIL}>
+# Copyright $CURRENT_YEAR ${2:$NAME} <${3:$EMAIL}>
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -227,7 +227,7 @@ $0]]></text>
     <text languages="c;chdr;cpp;cpphdr;css;js;java;"><![CDATA[/*
  * ${1:$TM_FILENAME}
  *
- * Copyright $CURRENT_YEAR ${2:$FULLNAME} <${3:$EMAIL}>
+ * Copyright $CURRENT_YEAR ${2:$NAME} <${3:$EMAIL}>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -246,7 +246,7 @@ $0]]></text>
 $0]]></text>
     <text languages="c-sharp;rust;"><![CDATA[// ${1:$TM_FILENAME}
 //
-// Copyright $CURRENT_YEAR ${2:$USER_NAME} <${3:$USER_EMAIL}>
+// Copyright $CURRENT_YEAR ${2:$NAME} <${3:$EMAIL}>
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -266,7 +266,7 @@ $0]]></text>
   <snippet _name="MIT" trigger="mit" _description="File header with MIT license">
     <text languages="python;python3;"><![CDATA[# ${1:$TM_FILENAME}
 #
-# Copyright $CURRENT_YEAR ${2:$FULLNAME} <${3:$EMAIL}>
+# Copyright $CURRENT_YEAR ${2:$NAME} <${3:$EMAIL}>
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to
@@ -291,7 +291,7 @@ $0]]></text>
     <text languages="c;chdr;cpp;cpphdr;css;js;java;"><![CDATA[/*
  * ${1:$TM_FILENAME}
  *
- * Copyright $CURRENT_YEAR ${2:$FULLNAME} <${3:$EMAIL}>
+ * Copyright $CURRENT_YEAR ${2:$NAME} <${3:$EMAIL}>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -316,7 +316,7 @@ $0]]></text>
 $0]]></text>
     <text languages="c-sharp;rust;"><![CDATA[// ${1:$TM_FILENAME}
 //
-// Copyright $CURRENT_YEAR ${2:$USER_NAME} <${3:$USER_EMAIL}>
+// Copyright $CURRENT_YEAR ${2:$NAME} <${3:$EMAIL}>
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to
diff --git a/gtksourceview/gtksourcesnippetcontext.c b/gtksourceview/gtksourcesnippetcontext.c
index 2828b21c..aa9e532e 100644
--- a/gtksourceview/gtksourcesnippetcontext.c
+++ b/gtksourceview/gtksourcesnippetcontext.c
@@ -901,10 +901,9 @@ gtk_source_snippet_context_init (GtkSourceSnippetContext *self)
        self->constants = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
 
 #define SET_CONSTANT(k, v) g_hash_table_insert (self->constants, g_strdup (k), g_strdup (v))
-       SET_CONSTANT ("username", g_get_user_name ());
-       SET_CONSTANT ("fullname", g_get_real_name ());
-       SET_CONSTANT ("author", g_get_real_name ());
-       SET_CONSTANT ("email", "");
+       SET_CONSTANT ("NAME_SHORT", g_get_user_name ());
+       SET_CONSTANT ("NAME", g_get_real_name ());
+       SET_CONSTANT ("EMAIL", "");
 #undef SET_CONSTANT
 
        dt = g_date_time_new_now_local ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]