Re: [gedit-list] tabulation plugin



Hello

On 3/29/07, Nando Vieira <fnando vieira gmail com> wrote:
On 3/29/07, Kristoffer Lundén <kristoffer lunden gmail com> wrote:

In fact, I'm not detecting how tabulation should work. I'm just
forcing the tabulation without questions. :)


That's not what I meant - what I meant was that if there is some
traces left by your plugin that could be found by mine, they could be
taken into account. I do think the generic approach below is better
though, at least for any non-official plugins.

  php/python = 4 spaces
  ruby = 2 spaces
  html/js/css = 1 tab

I didn't know that I can set the plugin's precedence. How can I do that?


What I meant was that, if you use Auto Tab and find it useful, but at
the same time has a plugin such as yours, or modelines, or whatever,
it's obvious that Auto Tab should be the fallback only, and don't mess
with these.

That's what I meant by precedence, and that's mainly the job of Auto
Tab to try and be polite and step out of the way. :)

I think that creating a more generic way to skip Auto Tab is way to go.


Yup, me too. Gonna do that, so other plugins can talk to mine, if they
wish. Will make for easy patches, too.

I found Auto Tab interesting, but it didn't correctly detect my
tabulation -- all was 4 spaces tab and Auto Tab assumed that was 2 --
so I disabled it.  :)


I would very much appreciate it if you would share a few files that
fails to detect properly, either by sending them to me, or attaching
to a bug report at the homepage[1].

The algorithm has a slight bias towards 2 spaces, as it's hard to tell
the difference in a 4/8 spaces file if you have places with 2 or 6
spaces, even if the majority is 4/8. There's a constant in the code
that tries to fix this, and it's probably too low - as it is now, it
works on all my test files, which are quite a lot of them, but I was
pretty certain it would still need to be tweaked.

If you wish, you could try it yourself instead, it's a clearly marked
1.1 at the bottom, setting that to 1.2 or so probably will be enough.
If you go that way instead of sharing files, I'd appreciate hearing
any results you get. :)

1. http://code.google.com/p/gedit-autotab

Thanks for the feedback, either way!


-- Kristoffer



--
Nando Vieira
bloggin' @ http://simplesideias.com.br
money  @ http://spesa.com.br



--
Kristoffer Lundén
✉ kristoffer lunden gmail com
✉ kristoffer lunden gamemaker nu
http://www.gamemaker.nu/
☎ 0704 48 98 77


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]