Code Monkey home page Code Monkey logo

sublime_deleteblanklines's People

Contributors

danyalaytekin avatar nicholasbuse 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sublime_deleteblanklines's Issues

Feature Request - Add in a Command Palette or Tools Menu Option

Hey - So I love this plugin, but I can never remember the Commands off the top of my head, and it's really interruptive to go google them or open up the readme file via Sublime.

It would be great if there was Command Palette or Tool Menu (preferably both) entry for these

I'd be willing to work on the feature if you'd like.

Cannot remove the lines containing only whitespaces

I changed something, and works well. You can take it in your code, if you like.

    def strip( self, edit, currentSelection, surplus ):
        # Convert the input range to a string, this represents the original selection.
        tokens = {'windows'  : '\r\n',
                  'mac'      : '\r',
                  'unix'     : '\n',
                 }
        line_endings = self.view.settings().get('default_line_ending')
        rtnl = tokens.get(line_endings, '\n')
        original = self.view.substr( currentSelection )
        lines = filter(None, map(lambda s: s.rstrip(), original.split(rtnl))) # strip the trailing spaces
        #lines = filter(lambda s: s.strip(), original.split(rtnl)) # do not strip the trailing spaces
        if surplus: rtnl *= 2
        output = rtnl.join(lines)
        self.view.replace( edit, currentSelection, output )
        return sublime.Region( currentSelection.begin(), currentSelection.begin() + len(output) )

does nothing on osx 10.8.5 & sublime text 3

No approximate combination of the defined keys works.
fn-ctrl-option-delete
ctrl-option-delete
cmd-option-delete

Any other suggestions?

It also doesn't show up under the preferences->package settings.

Can't delete surplus blank lines

The following shotcut does not work on windows:
Ctrl+Alt+Shift+Backspace --> Delete Surplus Blank Lines

Hint: Deleting blank linkes works.

Deleting surplus lines now adds spaces between each line of code

Using Win 10, and shortcut ctrl+alt+shift+backspace now adds carriage returns to each and every line.

I've uninstalled the plugin to ensure that the shortcuts were not mapped to anything else and also checked my keybindings but nothing there to suggest there's anything wrong.

Thanks.

Apply on save?

Any chance to implement a setting that deletes the surplus blank lines on file save?

Is OS really matter ?

To get the actual line endings of a view you must use view.line_endings()

But doesn't the buffer of ST2 always has a line ending of \n whatever the specified line endings ?
Line endings is only used when writing the physical file.

I'm pretty sure you can remove all OS check and only keep the \n processing, but I didn't test.

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.