Re: Request for a "Rewrap paragraph" function

From: phayz <>
Date: Tue, 27 Apr 2010 17:51:22 -0700 (PDT)

On Apr 28, 8:03 am, "" <>
> On Apr 27, 1:36 pm, Robert <> wrote:
> > I actually tried to quickly get this working before replying to
> > Russell and failed...
> > First I tried to get a init.lua and copied the one from the docs - it
> > didn't work because textadept has to be required before menu.
> Yes. I hit that problem as well. The example init.lua needs to be
> changed.
> > Then I
> > took the part from the original init.lua and then wrap.lua crashed
> > because I didn't had a buffer.edge_column...
> > I followed Brian's instructions and now it works - and do I wish I had
> > tried this before getting keyword lists for lexers together...
> > When testing it briefly now, it sometimes deleted all text - so I'll
> > be looking forward to the next version :-)
> > Example:
> > Empty buffer, typing one line longer than 80 chars, ctrl-h, perfect
> > rewrap, another line, ctrl-h, everythings gone.
> Hm. I thought I had gotten rid of those bugs. I'll try fixing that
> tonight.
> > I would propose to include a user's init.lua as a file in the docs
> > directory. So you could actually click on a link to it, save it in
> > .textadept and be ready.
> That would be a good idea.
> > Further I think the user snippets.lua and key_commands.lua
> > functionality could maybe be included in the user init.lua. (I know
> > I've been pro snippets.lua when this was discussed before :-)
> > I added an example for an init.lua. Certainly the wording or the
> > examples could be improved, maybe the comments for the first modules
> > could be shortened as most people would be interested in changing the
> > menu or key_commands.
> > Having a file and instructions like this would be one place less to
> > change things, as Russell mentioned, this can be confusing. Of course,
> > you can change things everywhere in Textadept, but in general I think
> > it would be nice to have as much as possible in one file.
> > What do you think?
> > Robert


Thanks for your step-by-step instructions. To be honest it was exactly
what I needed. Unfortunately I still haven't got the wrap function
working but I suspect I may have some corruption in having copy-and-
pasted the code from the wiki. So far I have tried only under Windows
so I will try the instructions under Linux before making any further

I realised after reading your reply that my main problem was the lack
of an "init.lua" file in the "modules/common" folder. I expect it was
this that caused my problems trying to get this working, since
variables referenced were not available to Textadept.


I really like your ideas of minimising the number of files required
when customising Texadept. The fewer the number of files, the easier
it might be for a new user to complete their customisations.

Another approach is the approach taken by gedit. In that case you have
a folder into which you copy your desired plugins. They must be
enabled from within gedit's preferences dialog. Adding a plugin is
easy, because it's a simple matter of copying files into the folder,
rather than Textadept's approach of requiring code being pasted into
files, with the order of the pasted lines sometimes being significant.
Each approach has advantages and disadvantages, so neither is the
definitive way to go. In other words, from a user's perspective I
would prefer whichever approach is easiest for me, but I understand
that things are much more complex from a developer's perspective.


Russell Dickenson

You received this message because you are subscribed to the Google Groups "textadept" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at
Received on Tue 27 Apr 2010 - 20:51:22 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:41:20 EST