Giter VIP home page Giter VIP logo

wrapasyoutype's People

Contributors

btrekkie avatar

Stargazers

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

Watchers

 avatar

wrapasyoutype's Issues

Wrong line end characters

Altering text which is written back to a View does not require special line ending handling.

The result of adding \r\n to a view is displayed here:

grafik

A python plugin can safely use \n to add a line break on all OSs without respect of ST's line endings setting. This setting is used by ST to decide which line ending to write to the file while saving.

Hence the _line_break() method can be simplified:

return '\r\n'

Lines are joined on removing line breaks

In Markdown I set up the plugin to wrap the entire document. When a line break is removed, however, the previous two lines are joined (see below). If this is undone, first the unintentionally removed line break appears and afterwards the intentionally removed line break.

wrapasyoutype

Stopped working with JSDoc comments

For unclear reasons, this suddenly stopped working with JSDoc comments (i.e. wrapping doesn't happen):

		{
			"line_start": " * ",
			"selector": "comment.block - punctuation.definition.comment"
		},

With regular block comments (started with /*, not /**), it continues to work.

I tried to play around and figured out that removing .definition helps. But I have no idea why and what the effect of .definition is supposed to be (reading the manual didn't help), hence whether the removal will break the workings of the plugin in any other place.

Manually added line breaks are removed

If a line break is inserted by manually pressing the enter key a user most likely wants that break. Hence removing it automatically may not be desirable.

animation

Feature request: automatically start new comment line after pressing Enter

When starting a new line within a comment block, it would be awesome if this plugin had a flag to automatically begin the new line with the line_start character and the current indentation. This would make it much nicer to break up larger blocks of text into paragraphs.

E.g. if the cursor was here (with the pipe representing the text cursor):

# This is a test.|

And Enter is pressed twice, it should become:

# This is a test.
# 
# |

Or, if the cursor is in the middle of a line:

# This is also a test. |Please do not be alarmed.

and Enter is pressed twice, it should result in:

# This is also a test.
#
# |Please do not be alarmed.

Comments merge when moving lines

While this behavior makes sense, it's a bit unexpected. Moving a comment via Swap Lines (default key binding: ctrl+shift+up/down on Linux) into or adjacent to another comment automatically merges the two lines.

Non-breaking spaces are neither honored nor preserved

At the moment, WrapAsYouType does not handle non-breaking spaces (unicode codepoint 0xA0) very well.

First it will gladly cut a line at their position, even though by the very definition of non-breaking spaces it should refrain from doing so and cut at the previous word boundary instead.

Second, in the process of cutting a line at this incorrect position, it will replace the non-breaking space with a line feed, which means that if the things before and after the non-breaking spaces are subsequently reflowed together through more additions and deletions, the non-breaking space will effectively have been replaced with a regular space.

To be honest, I'm not sure if this is a problem in the WrapAsYouType plugin or the core Sublime engine, as I've seen other text reflow Sublime plugins handle non-breaking spaces in similarly incorrect ways.

Optional forward/backwards-looking word wrapping

I really like the ability to use hard wrapping only in comment sections. However, most of the time I use formatted text for documentations and not flowing text. Therefore, I would really like to see an option to enable only forward-looking word wrapping in comments. Is this possible?

Javascript settings didn't work for me (what worked for me is below)

Hi btrekkie!

I love this package, it's super helpful!! I did notice that the Javascript settings that were recommended in the README didn't seem to work for me (I'm using Sublime Text 3). This is what worked for me:

"wrap_as_you_type_sections": [
        {
            "line_start": "*", // I removed the spaces around the asterisk
            "selector": "comment.block - punctuation.definition.comment"
        },
        {
            "combining_selector":
                "source - (comment | constant | entity | invalid | keyword | punctuation | storage | string | variable)",
            "line_start": "\/\/", // I escaped the forward slashes
            "selector": "comment.line"
        }
    ],
}

It might be helpful to other users to call out this fix, if you confirm it?

In any case, many thanks for making this excellent package! Game changing!
-natlefiyr

Commenting out single lines removes linebreaks

When a line is commented out, it is joined with the previous like if it is a comment.

In the following I show a simple example, where I am consecutively commenting out code and then undo my changes. You can see that an additional step is performed, which joins the lines.

wrapasyoutype

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.