Purposed addition: Elastic tabstops (revised)

690 views
Skip to first unread message

Yarin

unread,
Feb 15, 2012, 3:24:42 PM2/15/12
to vim...@vim.org
I've revised my previous "clustervtabs" modification.
Many (all?) of the previously raised points have been addressed.
The new diff be found at http://naqua.net/p/vim
I am aware that even _if_ accepted that this wouldn't be added until a later version.
Maintainers, please give your input. It would be _really_ nice to have elastic tabstops (officially) in VIM.
Thanks,
Yarin

Matt Sacks

unread,
Feb 16, 2012, 1:28:21 PM2/16/12
to vim...@googlegroups.com, vim...@vim.org
+1 on getting this as an option in a future Vim release - it would be very, very handy.

Ben Fritz

unread,
Feb 18, 2012, 1:59:38 PM2/18/12
to vim_dev


On Feb 15, 2:24 pm, Yarin <ya...@warpmail.net> wrote:
> I've revised my previous "clustervtabs" modification.
> Many (all?) of the previously raised points have been addressed.
> The new diff be found athttp://naqua.net/p/vim
> I am aware that even _if_ accepted that this wouldn't be added until a later version.
> Maintainers, please give your input. It would be _really_ nice to have elastic tabstops (officially) in VIM.
> Thanks,
> Yarin

I had to make some updates to get it to apply cleanly to 7.3.444 and
compile (will attach to my next post, I don't have an email for this
thread yet).

Some feedback (I'll attach screenshots with the patch):
1. The text affected by the tabs doesn't adjust as I type. This is
very confusing.
2. The text affected still doesn't move after I exit insert
mode. :redraw doesn't update it. Only :redraw! or resizing the Vim
window gets it to adjust (and then it looks like it works mostly as
intended).
3. A quick test shows it still seems to work with listchars=tab:\|-
and 'list' set, which is good. If I use elastic tabs this setting or
something similar will almost definitely be on.
4. Maybe I'm misunderstanding what elastic tabs are supposed to do,
but it seems like tab blocks which are much longer than the normal tab
stop don't align with the other blocks properly or cause other lines
to not align properly.
5. Sometimes as I'm typing or in Visual mode, the screen jumps way
outside the visible text so that I cannot see what I am typing. I
thought it made my text invisible until I saw the scroll bar location.
6. Maybe this is the same issue as above, but quite often the cursor
is in a very wrong place as I type. Outside the buffer text, even.

Benjamin Fritz

unread,
Feb 18, 2012, 2:14:03 PM2/18/12
to vim_dev
On Sat, Feb 18, 2012 at 12:59 PM, Ben Fritz <fritzo...@gmail.com> wrote:
>
> I had to make some updates to get it to apply cleanly to 7.3.444 and
> compile (will attach to my next post, I don't have an email for this
> thread yet).
>
> Some feedback (I'll attach screenshots with the patch):
> 1. The text affected by the tabs doesn't adjust as I type. This is
> very confusing.
> 2. The text affected still doesn't move after I exit insert
> mode. :redraw doesn't update it. Only :redraw! or resizing the Vim
> window gets it to adjust (and then it looks like it works mostly as
> intended).
> 3. A quick test shows it still seems to work with listchars=tab:\|-
> and 'list' set, which is good. If I use elastic tabs this setting or
> something similar will almost definitely be on.
> 4. Maybe I'm misunderstanding what elastic tabs are supposed to do,
> but it seems like tab blocks which are much longer than the normal tab
> stop don't align with the other blocks properly or cause other lines
> to not align properly.
> 5. Sometimes as I'm typing or in Visual mode, the screen jumps way
> outside the visible text so that I cannot see what I am typing. I
> thought it made my text invisible until I saw the scroll bar location.
> 6. Maybe this is the same issue as above, but quite often the cursor
> is in a very wrong place as I type. Outside the buffer text, even.
>

(1) and (2) are shown by no_update_after_insert.png and
update_after_redraw.png. I note after preparing the screenshots that
update_after_redraw.png also shows a bad cursor position in normal
mode (virtualedit is not on) and bad alignment (item 4).

(3) is shown by all the screenshots

(4) is shown by setting 'tabstop' to 2 and taking the
bad_alignment_tabstop_eq_2.png screenshot.

I did not capture a screenshot for (5).

(6) is shown by bad_cursor1.png and bad_cursor2.png, which were both
captured on the same insertion (I never left insert mode between the
screenshots).

All screenshots were taken from gvim -N -u NONE -i NONE on Windows XP.
I only set the following:

:set tw=0
:set elastictabstops
:set listchars=tab:\|-
:set list

And for one screenshot:
:set ts=2

vim73_elastictabstops.diff
bad_alignment_tabstop_eq_2.png
bad_cursor1.png
bad_cursor2.png
no_update_after_insert.png
update_after_redraw.png
Reply all
Reply to author
Forward
0 new messages