GithubHelp home page GithubHelp logo

sublimegremlins's Introduction

Sublime Gremlins

A Sublime Text plugin to help identify invisible and ambiguous Unicode whitespace characters (zero width spaces, no-break spaces, and similar.) I call these characters gremlins, and Sublime Gremlins highlights them in the following ways:

Screenshot of Sublime Gremlins

  1. The line containing the character is marked in the gutter.
  2. A colored border marks the character within the line.
  3. When the cursor reaches the character, the status bar displays its Unicode code position and name.

This plugin also adds commands to identify and select (for removal/replacement) any gremlins in the current document.

Installation

Sublime Gremlins is available on Package Control:

  1. Open Sublime Text's command palette
  2. Select the "Package Control: Install Package" command
  3. Search & select the "Gremlins" package

If you prefer, install via git:

git clone https://github.com/redoPop/SublimeGremlins.git \
  "~/Library/Application Support/Sublime Text 3/Packages/Gremlins"

Command palette

Sublime Gremlins adds the following to your command palette:

  • Gremlins: Find All selects (with multiple cursors) all gremlins in the current view.
  • Gremlins: Find Next selects the next gremlin from the current cursor position.
  • Gremlins: Highlight All highlights all gremlins in the current view (happens automatically by default).
  • Gremlins: Name Current Character Displays the Unicode code point and name of the character at the current cursor position, whether or not it's a gremlin.

Find menu

Sublime Gremlins adds a couple of items to the bottom of Sublime's Find menu:

  • Find Next Gremlin selects the next gremlin from the current cursor position.
  • Find All Gremlins selects (with multiple cursors) all gremlins in the current view.

Key bindings

Sublime Gremlins doesn't add any key bindings by default, but it does provide some example key bindings so you can add your own if you want.

Select Preferences ▸ Package Settings ▸ Gremlins ▸ Key Bindings from the menu. This will open a two-pane view with Gremlins' example key bindings on the left and your personal key bindings file on the right. Copy over any key bindings you want to use.

sublimegremlins's People

Contributors

louim avatar redopop avatar x100ex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sublimegremlins's Issues

output in the console: AttributeError: 'NoneType' object has no attribute 'run_command'

Closing the modified tab without saving causes:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 611, in on_activated_async
    callback.on_activated_async(v)
  File "/Users/aap/Library/Application Support/Sublime Text 3/Packages/SublimeGremlins/Gremlins.py", line 173, in on_activated_async
    self.name_current_gremlin(view)
  File "/Users/aap/Library/Application Support/Sublime Text 3/Packages/SublimeGremlins/Gremlins.py", line 168, in name_current_gremlin
    view.window().run_command('gremlins_name_current', {
AttributeError: 'NoneType' object has no attribute 'run_command'

Implement a "Remove All" command please?

Hi,

That is a great plugin! And such a cool name 👏 !

Could I suggest one more function/palette command please?
It could be verty useful to have a "Remove All" command to quickly remove all the nasty gremlins 👹 , instead of removing them one by one.

Thanks in advance 👋 !

The plugin doesn't highlight non-printable characters

Description of the Issue

Sublime Gremlins doesn't highlight Next Line (Codepoint U+0085, NEL), Arabic Letter Mark (Codepoint U+061C, ALM), Ogham Space Mark (Codepoint U+1680, OSPM) and Mongolian Vowel Separator (Codepoint U+180E, MVS) when inserted on a text file.

My observation was based from this table of non-printing characters where I confirmed that only NEL, ALM, OSPM and MVS wasn't detected by Sublime Gremlins plugin.

Debug Information

Windows 10 22H2 (Build 19045.2965)
Sublime Text 4 Build 4143
Plugins: Package Control v3.4.1, Sublime Gremlins v1.1.2

The plugin forces the Undo action to undo 1 character at a time

Hi.
I discovered that the on_modified_async() method causes that the Undo function works incorrectly.

def on_modified_async(self, view):

Specifically, if a command is run from that method (with run_command('...')).

Could you check that in your environment?
Test case:

  • enter '123'
  • press Ctrl+Z
  • as a result, only the '3' is removed (the default Sublime behaviour is to remove the whole string '123')

Thanks.

Broken gutter icon.

Hi,

I'm using material UI theme and syntax-higlighting, and gutter icon shows as broken, see:

image

Is there anything I can do about it?

Can't open settings - ST4

Hi @redoPop 👋

I love this little plugin and have been using it for years
I recently switched over to ST4 (4098) and set everything up again from scratch.

Not sure what's wrong, but when I try to go to Package Settings > Gremlins > Settings (or keybinds) it just throws an error.

image

In console:
image

I checked and there is no file there. But, even cloning the repo from Github and manually placing the Gremlins.sublime-settings file in my user prefs directory (~/Library/Application Support/Sublime Text/Packages/User) it still doesn't find it.

I'm not sure if ST4 changed the API for plugins to load settings, but thought I would ask...

Breaks the highlight when find/replace

When you press "Find" not often, the highlight of the matching string is practically not visible.

When you press "Find" very often, you can see that at first the highlight is yellow, and then instantly the backlight changes to an almost invisible one, merging with the background.

GIF

43016823-8d46339c-8c6d-11e8-87df-1a11ccf3f889

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.