Giter Club home page Giter Club logo

Comments (5)

dustdfg avatar dustdfg commented on May 26, 2024

I believe it is a work for plugin (If you are about hard wrap which persist in the file). @taconi does prettier taconi/plugin-channel#37 solves this?

If you need softwrap you can use softwrap and wordwrap options

from micro.

taconi avatar taconi commented on May 26, 2024

The prettier plugin uses the prettier tool and I know that it formats markdown files, maybe this plugin with some config help to solve this.
The other plugin with the same name also uses prettier if the other one helps.

You can also use the manager plugin to create your own formatters:

-- ~/.config/micro/init.lua
MANAGER_FORMATTERS_ENABLED = true

formatters = {
  -- yarn global add markdownlint-cli
  { cmd = 'markdownlint --dot --fix %f', onSave = true, filetypes = { 'markdown' } },
}

from micro.

slashdevslashurandom avatar slashdevslashurandom commented on May 26, 2024

Seems kinda annoying that the solution is to install a plugin that depends on a tool written in node.js. I tried to write a plug-in that would do that, but could not figure how to access util.StringWidth from Lua code (which would be necessary to figure out how long a string is, because Lua's string functions don't care about UTF-8).

from micro.

dmaluka avatar dmaluka commented on May 26, 2024

I tried to write a plug-in that would do that, but could not figure how to access util.StringWidth from Lua code (which would be necessary to figure out how long a string is, because Lua's string functions don't care about UTF-8).

We can add exporting util.StringWidth to Lua, if needed. It should be trivial to implement.

Or perhaps you can get by with using the buffer cursor's GetVisualX() method, which uses util.StringWidth underneath?

from micro.

slashdevslashurandom avatar slashdevslashurandom commented on May 26, 2024

That sounds like it would be a reasonable addition in general, as, for example, anyone who would want to write a plug-in that prints or outputs a table would also want to know the width of strings of text.

from micro.

Related Issues (20)

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.