From a96c7016b628668459b77fc6012cb73c0c384249 Mon Sep 17 00:00:00 2001 From: ingshtrom Date: Wed, 16 Jan 2013 14:58:29 -0500 Subject: [PATCH] updated metadata --- .gitignore | 8 ++-- README.md | 98 +++++++++++++++++++++---------------------- SublimeBlockCursor.py | 74 ++++++++++++++++---------------- package-metadata.json | 13 +++--- 4 files changed, 97 insertions(+), 96 deletions(-) diff --git a/.gitignore b/.gitignore index 47748ac..36afb98 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -*.pyc -*.cache -*.sublime-project -.DS_store +*.pyc +*.cache +*.sublime-project +.DS_store .c9revisions \ No newline at end of file diff --git a/README.md b/README.md index c07db9e..7bd83b2 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,49 @@ -# SublimeBlockCursor # - -![Screenshot](http://f.cl.ly/items/42131K2X1h0j0P2m1O2B/Screen%20Shot%202011-12-02%20at%202.36.54%20AM.png) - -It can become very difficult to keep track of your cursor location. This is solved by having a "block" cursor, which is very easy to spot no matter where it is on screen. Unfortunately, Sublime Text 2 does not (yet) support this feature natively. This Plugin mimics this functionality by highlighting the area behind the cursor whenever it moves (similar to how you might highlight syntax errors, or color a comment). - -## Installation ## - -### With Package Control ### - -If you have the [Package Control][package_control] installed, you can install SublimeBlockCursor from inside Sublime Text itself. Open the Command Palette and select "Package Control: Install Package", then search for SublimeBlockCursor and you’re done! - -### Without Package Control ### - -Go to your Sublime Text 2 Packages directory: - - Windows: %USERPROFILE%\AppData\Roaming\Sublime Text 2\Packages\ - Mac: ~/Library/Application Support/Sublime Text 2/Packages/ - -and clone the repository there - - git clone git://github.com/netpro2k/SublimeBlockCursor - git clone git://github.com/ingshtrom/SublimeBlockCursor - - -## Configuration ## - -These are the settings that I prefer. You can change the style of the block cursor by adding a section to your theme file like so: - -```xml - - name - Block Cursor - scope - block_cursor - settings - - foreground - #000000 - background - #FF1111 - - -``` - ---------- - -[sublime]: http://www.sublimetext.com/2 -[package_control]: http://wbond.net/sublime_packages/package_control +# SublimeBlockCursor # + +![Screenshot](http://f.cl.ly/items/42131K2X1h0j0P2m1O2B/Screen%20Shot%202011-12-02%20at%202.36.54%20AM.png) + +It can become very difficult to keep track of your cursor location. This is solved by having a "block" cursor, which is very easy to spot no matter where it is on screen. Unfortunately, Sublime Text 2 does not (yet) support this feature natively. This Plugin mimics this functionality by highlighting the area behind the cursor whenever it moves (similar to how you might highlight syntax errors, or color a comment). + +## Installation ## + +### With Package Control ### + +If you have the [Package Control][package_control] installed, you can install SublimeBlockCursor from inside Sublime Text itself. Open the Command Palette and select "Package Control: Install Package", then search for SublimeBlockCursor and you’re done! + +### Without Package Control ### + +Go to your Sublime Text 2 Packages directory: + + Windows: %USERPROFILE%\AppData\Roaming\Sublime Text 2\Packages\ + Mac: ~/Library/Application Support/Sublime Text 2/Packages/ + +and clone the repository there + + git clone git://github.com/netpro2k/SublimeBlockCursor + git clone git://github.com/ingshtrom/SublimeBlockCursor + + +## Configuration ## + +These are the settings that I prefer. You can change the style of the block cursor by adding a section to your theme file like so: + +```xml + + name + Block Cursor + scope + block_cursor + settings + + foreground + #000000 + background + #FF1111 + + +``` + +--------- + +[sublime]: http://www.sublimetext.com/2 +[package_control]: http://wbond.net/sublime_packages/package_control diff --git a/SublimeBlockCursor.py b/SublimeBlockCursor.py index 046af7a..240263d 100644 --- a/SublimeBlockCursor.py +++ b/SublimeBlockCursor.py @@ -1,38 +1,38 @@ -import sublime -import sublime_plugin - - -class SublimeBlockCursor(sublime_plugin.EventListener): - def view_is_widget(self, view): - settings = view.settings() - return bool(settings.get('is_widget')) - - def show_block_cursor(self, view): - validRegions = [] - for s in view.sel(): - if s.a != s.b: - continue - validRegions.append(sublime.Region(s.a, s.a + 1)) - if validRegions.__len__: - view.add_regions('SublimeBlockCursorListener', validRegions, 'block_cursor') - else: - view.erase_regions('SublimeBlockCursorListener') - - def on_selection_modified(self, view): - if view.settings().get('is_widget') or not("Vintage" in view.settings().get('ignored_packages') or view.settings().get('command_mode')): - view.erase_regions('SublimeBlockCursorListener') - return - self.show_block_cursor(view) - - def on_deactivated(self, view): - view.erase_regions('SublimeBlockCursorListener') - view.settings().clear_on_change('command_mode') - self.current_view = None - - def on_activated(self, view): - self.on_selection_modified(view) - view.settings().add_on_change('command_mode', self.on_command_mode_change) - self.current_view = view - - def on_command_mode_change(self): +import sublime +import sublime_plugin + + +class SublimeBlockCursor(sublime_plugin.EventListener): + def view_is_widget(self, view): + settings = view.settings() + return bool(settings.get('is_widget')) + + def show_block_cursor(self, view): + validRegions = [] + for s in view.sel(): + if s.a != s.b: + continue + validRegions.append(sublime.Region(s.a, s.a + 1)) + if validRegions.__len__: + view.add_regions('SublimeBlockCursorListener', validRegions, 'block_cursor') + else: + view.erase_regions('SublimeBlockCursorListener') + + def on_selection_modified(self, view): + if view.settings().get('is_widget') or not("Vintage" in view.settings().get('ignored_packages') or view.settings().get('command_mode')): + view.erase_regions('SublimeBlockCursorListener') + return + self.show_block_cursor(view) + + def on_deactivated(self, view): + view.erase_regions('SublimeBlockCursorListener') + view.settings().clear_on_change('command_mode') + self.current_view = None + + def on_activated(self, view): + self.on_selection_modified(view) + view.settings().add_on_change('command_mode', self.on_command_mode_change) + self.current_view = view + + def on_command_mode_change(self): self.on_selection_modified(self.current_view) \ No newline at end of file diff --git a/package-metadata.json b/package-metadata.json index a6f70e1..bf8a9f5 100644 --- a/package-metadata.json +++ b/package-metadata.json @@ -1,7 +1,8 @@ -{ - "url": "https://github.com/ingshtrom/SublimeBlockCursor", - "version": "1.0.1", - "description": "Sublime Text 2 plugin to mimic a block cursor in all modes.", - "author": "ingshtrom", - "homepage": "http://ingshtrom.tumblr.com" +{ + "name": "SublimeBlockCursorEverywhere", + "url": "https://github.com/ingshtrom/SublimeBlockCursor", + "version": "1.0.1", + "description": "Sublime Text 2 plugin to mimic a block cursor in all modes. Forked from netpro2k/SublimeBlockCursor.", + "author": "ingshtrom && netpro2k", + "homepage": "http://ingshtrom.tumblr.com" } \ No newline at end of file