Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
evandrocoan committed Oct 1, 2016
2 parents 9d51fa7 + 2559283 commit 31fc814
Show file tree
Hide file tree
Showing 20 changed files with 106 additions and 42 deletions.
3 changes: 2 additions & 1 deletion .githooks/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ Git Hooks

This folder contains the git hooks used the by this project.
To install them, just copy the files "post-checkout", "post-commit"
and "prepare-commit-msg" to "$THIS_REPOSITORY_DIR/.git/hooks/".
and "prepare-commit-msg" to "$THIS_REPOSITORY_DIR/.git/hooks/",
or run the installer `install_githooks.sh`.


Open the file ".githooks/githooksConfig.txt" to configure the files to be
Expand Down
2 changes: 1 addition & 1 deletion .githooks/SUBLIME_STUDIO_VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1-10
1.0.1-16
19 changes: 15 additions & 4 deletions .githooks/__post-git-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,19 @@
GIT_DIR_="$(git rev-parse --git-dir)"
githooksConfig=$(cat $GIT_DIR_/../.githooks/githooksConfig.txt)

# $filePathToUpdate example: scripting/galileo.sma
filePathToUpdate=$GIT_DIR_/../$(echo $githooksConfig | cut -d',' -f 2)

# $targetBranch example: develop, use . to operate all branches
targetBranch=$(echo $githooksConfig | cut -d',' -f 3)

# $fileNameToUpdate example: galileo.sma
# Remove the '/app/blabla/' from the $filePathToUpdate argument name - https://regex101.com/r/rR0oM2/1
fileNameToUpdate=$(echo $filePathToUpdate | sed -r "s/((.+\/)+)//")

# $updateFlagFilePath example: isToUpdateTheGalileoFile.txt
updateFlagFilePath=$GIT_DIR_/$(echo $githooksConfig | cut -d',' -f 4)
sulfixName="FlagFile.txt"
updateFlagFilePath="$GIT_DIR_/$fileNameToUpdate$sulfixName"

currentBranch=$(git rev-parse --symbolic-full-name --abbrev-ref HEAD)
updateVersionProgram=$GIT_DIR_/../.githooks/updateVersion.sh
Expand All @@ -26,13 +37,13 @@ cleanUpdateFlagFile()
}


# Updates and changes the files if the flag file exits, if and only if we are on the 'master'
# Updates and changes the files if the flag file exits, if and only if we are on the '$targetBranch'
# branch.
# '-C HEAD' do not prompt for a commit message, use the HEAD as commit message.
# '--no-verify' do not call the pre-commit hook to avoid infinity loop.
if [ -f $updateFlagFilePath ]
then
if [[ $currentBranch == "master" ]]
if [[ $currentBranch == $targetBranch || $targetBranch == "." ]]
then
if sh $updateVersionProgram build
then
Expand All @@ -45,7 +56,7 @@ then
echo "Amending commits..."
git commit --amend -C HEAD --no-verify
else
echo "It is not time to amend, as we are not on the 'master' branch."
echo "It is not time to amend, as we are not on the '$targetBranch' branch."
fi
else
echo "It is not time to amend, as the file '$updateFlagFilePath' does not exist."
Expand Down
5 changes: 2 additions & 3 deletions .githooks/githooksConfig.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
.githooks/SUBLIME_STUDIO_VERSION.txt,README.MD,README.MD,isToUpdateTheStudioFile.txt,
.githooks/SUBLIME_STUDIO_VERSION.txt,README.MD,develop,

This is the 'updateVersion.sh' configuration file.
It is important do not include any spaces on the above configuration line or remove the last comma.

The above line define the files where:
1) The file path where the current version number will be stored. Example: githooks/GALILEO_VERSION.txt
2) The file path which will be updated using the current version file. Example: scripting/galileo.sma
3) The file name which will be updated using the current version file. Example: galileo.sma
4) The file name which will be used as flag to run the version update. Example: isToUpdateTheGalileoFile.txt
3) The target branch to operate/apply the versioning. Use . to work with any branch. Example: develop

Note: Both files must be using the same version number when the 'updateVersion.sh' program ran.

Expand Down
10 changes: 10 additions & 0 deletions .githooks/install_githooks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

githooksPath="../.git/hooks/"

printf "Installing the githooks...\n"
cp -v post-checkout $githooksPath
cp -v post-commit $githooksPath
cp -v prepare-commit-msg $githooksPath

printf "The githooks are successfully installed!\n"
18 changes: 11 additions & 7 deletions .githooks/post-checkout
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,19 @@ echo "Running the post-checkout hook..."
GIT_DIR_="$(git rev-parse --git-dir)"
updateVersionScript=$GIT_DIR_/../.githooks/__post-git-hook.sh

currentBranch=$(git rev-parse --symbolic-full-name --abbrev-ref HEAD)
commitsBehindDevelop=$(git rev-list --count $currentBranch..master)
# $targetBranch example: develop, use . to operate all branches
targetBranch=$GIT_DIR_/../$(echo $githooksConfig | cut -d',' -f 3)


# Alert the user when his checkout branch is behind the master branch.
if [ $commitsBehindDevelop -gt 0 ]
if [[ $targetBranch != "." ]]
then
echo "ATTENTION: Your branch '$currentBranch' is $commitsBehindDevelop commits behind master"
# exit 1
currentBranch=$(git rev-parse --symbolic-full-name --abbrev-ref HEAD)
commitsBehindDevelop=$(git rev-list --count $currentBranch..$targetBranch)

# Alert the user when his checkout branch is behind the $targetBranch branch.
if [ $commitsBehindDevelop -gt 0 ]
then
echo "ATTENTION: Your branch '$currentBranch' is $commitsBehindDevelop commits behind $targetBranch"
fi
fi

# Run the version update script.
Expand Down
16 changes: 11 additions & 5 deletions .githooks/prepare-commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,17 @@ versionFilePath=$GIT_DIR_/../$(echo $githooksConfig | cut -d',' -f 1)
# $filePathToUpdate example: scripting/galileo.sma
filePathToUpdate=$GIT_DIR_/../$(echo $githooksConfig | cut -d',' -f 2)

# $targetBranch example: develop, use . to operate all branches
targetBranch=$GIT_DIR_/../$(echo $githooksConfig | cut -d',' -f 3)


# $fileNameToUpdate example: galileo.sma
fileNameToUpdate=$(echo $githooksConfig | cut -d',' -f 3)
# Remove the '/app/blabla/' from the $filePathToUpdate argument name - https://regex101.com/r/rR0oM2/1
fileNameToUpdate=$(echo $filePathToUpdate | sed -r "s/((.+\/)+)//")

# $updateFlagFilePath example: isToUpdateTheGalileoFile.txt
updateFlagFilePath=$GIT_DIR_/$(echo $githooksConfig | cut -d',' -f 4)
sulfixName="FlagFile.txt"
updateFlagFilePath="$GIT_DIR_/$fileNameToUpdate$sulfixName"

currentGitFiles=$(git diff --name-only --cached)
currentBranch=$(git rev-parse --symbolic-full-name --abbrev-ref HEAD)
Expand Down Expand Up @@ -75,13 +81,13 @@ then

# This creates the flag file '$updateFlagFilePath' to indicate that 'post-checkout' and
# 'post-commit' hooks must to update the version number. It only updates whether the current
# branch the master and the file being changed is "$fileNameToUpdate".
if [[ $currentBranch == "develop" ]]
# branch is $targetBranch and the file being changed is "$fileNameToUpdate".
if [[ $currentBranch == $targetBranch ]]
then
echo "true" > $updateFlagFilePath
echo "Successfully created the flag file '$updateFlagFilePath'"
else
echo "The '$fileNameToUpdate' file is not being updated, because we are not on the 'master' branch."
echo "The '$fileNameToUpdate' file is not being updated, because we are not on the '$targetBranch' branch."
fi
else
echo "The '$fileNameToUpdate' file is not being committed right now."
Expand Down
9 changes: 7 additions & 2 deletions .githooks/updateVersion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@
#
#
# Change log:
#
#
# v2.0.0
# Added installer script `install_githooks.sh`.
# Removed reduntant configurations from `githooksConfig.txt`.
# Added a new setting to choose which branch is the target branch for auto versioning.
#
# v1.1.2
# Added error message when the 'sed' operation fails.
#
#
# v1.1.1
# Placed this file within the repository sub-folder "./.githooks".
#
Expand Down
2 changes: 1 addition & 1 deletion Amxx Pawn
9 changes: 9 additions & 0 deletions Default Syntax/default_syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ def on_new(self, view):



class CopyScopeToClipboardCommand(sublime_plugin.TextCommand):
def run(self, edit):
syntax_name = self.view.scope_name(self.view.sel()[0].begin())
print(syntax_name)
self.view.set_status("Scope",syntax_name)
sublime.set_clipboard(syntax_name)



class GetScopeAlwaysTextCommand( sublime_plugin.TextCommand ):

def run( self, edit ):
Expand Down
28 changes: 24 additions & 4 deletions Matlab/syntax_test_matlab.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,39 @@
x = [ 1.76 ]
% <- source.matlab meta.variable.other.valid.matlab
% ^ source.matlab keyword.operator.symbols.matlab
% ^ source.matlab punctuation.definition.brackets.begin.matlab
% ^ source.matlab punctuation.section.brackets.begin.matlab
% ^ source.matlab meta.brackets.matlab constant.numeric.matlab
% ^ source.matlab punctuation.definition.brackets.end.matlab
% ^ source.matlab punctuation.section.brackets.end.matlab


xAprox = fMetodoDeNewton( xi )
% <- source.matlab meta.variable.other.valid.matlab
% ^ source.matlab keyword.operator.symbols.matlab
% ^ source.matlab meta.variable.other.valid.matlab
% ^ source.matlab punctuation.definition.parens.begin.matlab
% ^ source.matlab punctuation.section.parens.begin.matlab
% ^ source.matlab meta.parens.matlab meta.variable.other.valid.matlab
% ^ source.matlab punctuation.definition.parens.end.matlab
% ^ source.matlab punctuation.section.parens.end.matlab



%---------------------------------------------
% Block comment test

% Success case
%{
x = 5
% ^ source.matlab comment.block.percentage.matlab
%}

% Failure case
%{ fail
x = 5
% ^ source.matlab keyword.operator.symbols.matlab
%}

%{
%} fail
x = 5
% ^ source.matlab comment.block.percentage.matlab
%}

2 changes: 1 addition & 1 deletion Notepad++ Theme
4 changes: 2 additions & 2 deletions Octave/Octave.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ contexts:
- match: ''
push: Packages/Matlab/Matlab.sublime-syntax
with_prototype:
- match: '[#%]{.*\n'
- match: '[#%]{\s*\n'
scope: comment.line.octave
push:
- meta_scope: comment.line.octave
- match: '[#%]}.*\n'
- match: '[#%]}\s*\n'
scope: comment.line.octave
pop: true
- match: '#.*\n'
Expand Down
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ These are my sublime settings/packages used to program on:
4. Pawn


Its current version is: v1.0.1-10
Its current version is: v1.0.1-16



Expand Down
2 changes: 1 addition & 1 deletion SideBarEnhancements
11 changes: 6 additions & 5 deletions SublimeStudioDevelopment.bbcode
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@

Related topics:
[LIST=1]
[*][URL="https://www.sublimetext.com/"]Why Sublime Text?[/URL]
[*][URL="https://coderwall.com/p/k-bxtq/versioning-your-sublime-text-configuration"]Versioning your Sublime Text configuration[/URL]
[*][URL="http://stackoverflow.com/questions/16464410/what-how-to-version-control-for-text-editor-sublime-text-settings-on-github"]What & how to version control for text editor (Sublime Text) settings on Github[/URL]
[*][URL="https://opensourcehacker.com/2013/05/09/exporting-and-sharing-sublime-text-configuration/"]Exporting and sharing Sublime Text configuration[/URL]
[*][URL="https://www.sublimetext.com/"] Why Sublime Text?[/URL]
[*][URL="https://packagecontrol.io/docs/syncing"] Package Control - Syncing[/URL]
[*][URL="https://coderwall.com/p/k-bxtq/versioning-your-sublime-text-configuration"] Versioning your Sublime Text configuration[/URL]
[*][URL="https://opensourcehacker.com/2013/05/09/exporting-and-sharing-sublime-text-configuration/"] Exporting and sharing Sublime Text configuration[/URL]
[*][URL="http://stackoverflow.com/questions/16464410/what-how-to-version-control-for-text-editor-sublime-text-settings-on-github"] What & how to version control for text editor (Sublime Text) settings on Github[/URL]
[*][URL="https://forum.sublimetext.com/t/preserving-st3-configuration-in-source-control/23351"] https://forum.sublimetext.com/t/preserving-st3-configuration-in-source-control/23351[/URL]
[/LIST]

Eclipse, Netbeans, the JetBrains IDE's and VisualStudio are very good IDE for their major languages. Offer awesome tools and etc. The problem is, they are good only for the major, so if you want to/need to program on several ones, you will need to setup several different editor if they exist, i.e., there are specific ones for them as Java for Eclipse, C++ for Visual Studio and etc. There are packages to provide some support for other languages on these big IDEs, however they do not offer as much power as their native language ones. So, the proposal is to take on `Advanced Text Editor` which may be easily extended and use it for several/any languages you want to/need to program on. That is what is going to be tried within `Sublime Text`. I am developing `Sublime Text` Settings by versionning control using git. If you just started, you could install my settings at [URL="https://github.com/evandrocoan/SublimeTextStudio#installation"] https://github.com/evandrocoan/SublimeTextStudio#installation[/URL].
Expand All @@ -56,7 +58,6 @@ For now they need some fixes and improvements, see all they here on:
[*][URL="https://github.com/wbond/package_control/issues"] https://github.com/wbond/package_control/issues[/URL]
[*][URL="https://forum.sublimetext.com/"] https://forum.sublimetext.com/[/URL]
[/LIST]

I just started using `Sublime Text`, until now is almost two months gathering plugins/packages, settings things up. I came to `Sublime Text` due its speed and flexibility. At the beginning, I was just programming on C++, Java SE, then Eclipse, Netbeans, the JetBrains IDE's and VisualStudio were very good to go/use. However, I started programming on more, and more languages each day, then on a midlife crisis point, because I need something fast and powerful to all languages, not just C++/Java. The point is, setting up several IDE's for each language is a nightmare. But finding one `Editor`, and only one `Editor` and setting it up to work with every language I came across it is the best thing to do because, code is code. Does not matter if it is AmxxPawn, SourcePawn, C++, Java, Prolog, HTML, LaTeX, CSS, etc. You will always get used to some set of tools as:
[LIST=1]
[*]Multi-cursors
Expand Down
1 change: 0 additions & 1 deletion User/C++.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"h",
"cfg",
"txt",
"sma",
"cpp"
]
}
2 changes: 1 addition & 1 deletion User/Default (Windows).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@
{ "keys": ["f4"], "command": "next_result" },
{ "keys": ["shift+f4"], "command": "prev_result" },

{ "keys": ["f6"], "command": "toggle_setting", "args": {"setting": "spell_check"} },
{ "keys": ["f6"], "command": "copy_scope_to_clipboard" },
{ "keys": ["ctrl+f6"], "command": "next_misspelling" },
{ "keys": ["ctrl+shift+f6"], "command": "prev_misspelling" },

Expand Down
1 change: 0 additions & 1 deletion User/Preferences.sublime-settings
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"added_words":
[
"Rufini"
],
"always_show_minimap_viewport": true,
"animation_enabled": false,
Expand Down
2 changes: 1 addition & 1 deletion amxmodx

0 comments on commit 31fc814

Please sign in to comment.