diff --git a/.githooks/README.MD b/.githooks/README.MD index 63e6073d..f2a65cc9 100644 --- a/.githooks/README.MD +++ b/.githooks/README.MD @@ -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 diff --git a/.githooks/SUBLIME_STUDIO_VERSION.txt b/.githooks/SUBLIME_STUDIO_VERSION.txt index e0ac6087..65c840fa 100644 --- a/.githooks/SUBLIME_STUDIO_VERSION.txt +++ b/.githooks/SUBLIME_STUDIO_VERSION.txt @@ -1 +1 @@ -1.0.1-10 +1.0.1-16 diff --git a/.githooks/__post-git-hook.sh b/.githooks/__post-git-hook.sh index b60f8dbe..32a1953e 100644 --- a/.githooks/__post-git-hook.sh +++ b/.githooks/__post-git-hook.sh @@ -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 @@ -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 @@ -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." diff --git a/.githooks/githooksConfig.txt b/.githooks/githooksConfig.txt index 554face5..4f6a1449 100644 --- a/.githooks/githooksConfig.txt +++ b/.githooks/githooksConfig.txt @@ -1,4 +1,4 @@ -.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. @@ -6,8 +6,7 @@ It is important do not include any spaces on the above configuration line or rem 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. diff --git a/.githooks/install_githooks.sh b/.githooks/install_githooks.sh new file mode 100644 index 00000000..58a8f9fc --- /dev/null +++ b/.githooks/install_githooks.sh @@ -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" diff --git a/.githooks/post-checkout b/.githooks/post-checkout index f2a9f5e8..f10edf44 100644 --- a/.githooks/post-checkout +++ b/.githooks/post-checkout @@ -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. diff --git a/.githooks/prepare-commit-msg b/.githooks/prepare-commit-msg index f362a3c4..0194f789 100644 --- a/.githooks/prepare-commit-msg +++ b/.githooks/prepare-commit-msg @@ -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) @@ -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." diff --git a/.githooks/updateVersion.sh b/.githooks/updateVersion.sh index e25ce22d..29ba4291 100644 --- a/.githooks/updateVersion.sh +++ b/.githooks/updateVersion.sh @@ -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". # diff --git a/Amxx Pawn b/Amxx Pawn index 0cc7d9b5..728c2098 160000 --- a/Amxx Pawn +++ b/Amxx Pawn @@ -1 +1 @@ -Subproject commit 0cc7d9b56ac9fdf1961ca4a4798fdc25fd602ef9 +Subproject commit 728c2098389cb559179648868497ff2ad501c40f diff --git a/Default Syntax/default_syntax.py b/Default Syntax/default_syntax.py index faff2af9..917f1acf 100644 --- a/Default Syntax/default_syntax.py +++ b/Default Syntax/default_syntax.py @@ -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 ): diff --git a/Matlab/syntax_test_matlab.m b/Matlab/syntax_test_matlab.m index 9224a636..9ba30f93 100644 --- a/Matlab/syntax_test_matlab.m +++ b/Matlab/syntax_test_matlab.m @@ -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 +%} diff --git a/Notepad++ Theme b/Notepad++ Theme index dd505d7b..934252c1 160000 --- a/Notepad++ Theme +++ b/Notepad++ Theme @@ -1 +1 @@ -Subproject commit dd505d7b5995633e9e1c88b74364ad7935967f1a +Subproject commit 934252c1f270ac4e2a40310b55a8ea45515d5b3a diff --git a/Octave/Octave.sublime-syntax b/Octave/Octave.sublime-syntax index 9475551a..04c05004 100644 --- a/Octave/Octave.sublime-syntax +++ b/Octave/Octave.sublime-syntax @@ -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' diff --git a/README.MD b/README.MD index 00a1f5cd..5ac5e361 100644 --- a/README.MD +++ b/README.MD @@ -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 diff --git a/SideBarEnhancements b/SideBarEnhancements index 3c7957f2..6721d23b 160000 --- a/SideBarEnhancements +++ b/SideBarEnhancements @@ -1 +1 @@ -Subproject commit 3c7957f2446b442931c3731358a79750687059d2 +Subproject commit 6721d23b2f59fe886e5af545b8251956fdaccfd9 diff --git a/SublimeStudioDevelopment.bbcode b/SublimeStudioDevelopment.bbcode index 925dbfeb..4a41c83e 100644 --- a/SublimeStudioDevelopment.bbcode +++ b/SublimeStudioDevelopment.bbcode @@ -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]. @@ -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 diff --git a/User/C++.sublime-settings b/User/C++.sublime-settings index c63e0475..ec81a707 100644 --- a/User/C++.sublime-settings +++ b/User/C++.sublime-settings @@ -4,7 +4,6 @@ "h", "cfg", "txt", - "sma", "cpp" ] } diff --git a/User/Default (Windows).sublime-keymap b/User/Default (Windows).sublime-keymap index b52e76e1..dcac1bf8 100644 --- a/User/Default (Windows).sublime-keymap +++ b/User/Default (Windows).sublime-keymap @@ -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" }, diff --git a/User/Preferences.sublime-settings b/User/Preferences.sublime-settings index 7154bf37..81c61205 100644 --- a/User/Preferences.sublime-settings +++ b/User/Preferences.sublime-settings @@ -1,7 +1,6 @@ { "added_words": [ - "Rufini" ], "always_show_minimap_viewport": true, "animation_enabled": false, diff --git a/amxmodx b/amxmodx index 654eb43a..f41e518f 160000 --- a/amxmodx +++ b/amxmodx @@ -1 +1 @@ -Subproject commit 654eb43aafbc44e544d5f0f0ca8f77b586c3cd76 +Subproject commit f41e518f857d24c73ba93b29cb2fda87d75e4395