Git Product home page Git Product logo

reflow-list's Introduction

reflowlist

reflowList is an extension for reflowing (wrapping) text that might have lists, whether numeric lists, bulleted lists, or definition lists. It correctly handles comments in most languages. It is designed primarily for reflowing comments in code.

Features

reflowList provides a single command, reflowlist.reflowParagraph, which does the reformatting.

reflowParagraph reformats the paragraph around the cursor, where "paragraph" is defined as lines that have a common prefix and the same indentation.

reflowlist understands bulleted lists (marked by '-' or 'o'), numbered or lettered lists ("1.", "a.", "1)", "a)"), and definition lists. If the list element extends more than one line, the subsequent lines are indented properly.

This is best shown by example:

reflow animation

Extension Settings

If you need to support other programming languages or other definitions, you can adjust the regular expressions that reflowList uses to find comments. The regular expressions or wrap columns can be changed on a per-language or per-workspace basis following the usual vscode conventions.

You can adjust the regular expressions that reflowlist uses to find comments and lists and definition lists. You can also adjust the wrapColumn (the column at which text is wrapped). (This is how the above examples were formatted.)

Known Issues

  • reflowList may incorrectly think that a line that begins with a word followed by a colon is the first line of a definition list. This is a hazard of supporting definition lists; it was not obvious how to make it support definition lists without occasionally seeing them in the wrong place. You may have to fix up such paragraphs manually.

  • reflowList does not support paragraphs where the first line is indented or out-dented; it assumes that any lines with different indentation belong to a different paragraph. This is normally what you want when editing code or markdown.

  • reflowList converts tabs into spaces. Sorry if you actually wanted hard tabs. Hopefully you have a code reformatted (like gofmt) that can convert back.

  • reflowList does not attempt to reflow /* comment */ lines where there is text on the opening line of the comment, e.g.,

    /* Some text
     * that needs reflowing */
    

    It will treat the first line as a separate paragraph from subsequent lines. You may have to fix such comments manually.

    However, it will correctly reflow multi-line /* comment */ where there is no text on the opening line, e.g.,

    /*
     * Some text
     * that needs reflowing
     */
    

Release Notes

0.5

Initial release.

reflow-list's People

Contributors

garyholt avatar moshiulrabbi avatar rufflewind avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

reflow-list's Issues

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.