Loading ...
Sorry, an error occurred while loading the content.

Conceal feature vs editing and wrapping

Expand Messages
  • cheater cheater
    Hi List, I have been recently using the conceal feature a lot. It s very fun. However it s still missing in some places for what I want (and looking at the
    Message 1 of 1 , Aug 27, 2012
      Hi List,
      I have been recently using the conceal feature a lot. It's very fun. However it's still missing in some places for what I want (and looking at the list, other people, too), so I thought I'd chime in.

      I think the following conversation is the current status of the issue:

      On Sunday, August 21, 2011 5:53:27 PM UTC+2, Bram Moolenaar wrote:
      > Marcin Szamotulski wrote:
      > > With the conceal feature enabled it happens that a long line that fills
      > > several screen lines (without conceal) is break at exactly the same places
      > > when conceal is not enabled. For example look at the following line with the
      > > following settings: set ft=tex, set cole=2
      > > \(\bigcap_{i\in I}\;A\otimes I_i\ni\sum_{l=1}^n a_l\otimes b_l & \;\Leftrightarrow\;\forall_{i\in I}\ \sum_{l=1}^n a_l\otimes b_l\in A\otimes I_i\notag\)
      > >
      > > It would be nice if vim could fill whole the lines, i.e. break them in
      > > more accurate places when conceal is enabled.
      > This is intentional. Without this cursor movements would be messed up,
      > as the screen line depends on how text is concealed, which requires
      > syntax parsing, which is slow.
      > There still is the bug that cursor positioning with the mouse doesn't
      > work properly. To fix that requires something similar as what is
      > required for this feature. Perhaps someone can make that work, it's not
      > going to be easy.

      (this is from the thread "idea for wrapping lines and conceal feature")

      So: we have the conceal feature, we haven't touched how movements work.

      For what I want, I would like conceal to work in the ways I describe below. I am not sure what the full implications of this are, so I thought I'd use this place as a voicing board.

      (1) wrapping happens after concealment. Reason is that this picture looks sort of stupid: http://i.imgur.com/6iyCu.png

      For me, Vim is all about ease of use and readability.
      (2) movement and editing happens after concealment. This is a tough one.

      For a simple example, I have a syntax for overstriking. This means that A^HA gets displayed just as a bold "A" char.

      If I then have this file:
      1. ABC
      2. A^HABC

      and my cursor is on line 1, char 3, then pressing j should move me to C on line 2.

      If my cursor is on line 2, over the "A" (remember, line 2 gets displayed as "ABC"), then pressing X will delete the A^HA and leave me with "BC" as line 2.

      If my cursor is on line 1, char 1 ("A"), and I press ^V to go into visual block mode, then lj, then I would like the visual region to select AB on line 1 and A^HAB on line 2. This means that normal visual block selections are not rectangular anymore (although they aren't now, either, really, if you select on lines of varying lengths)

      I am not sure whether (2) would break any useful behaviour? If so, maybe it's a good idea to have a separate set of commands that happen "after concealment"? E.g. <visual-block-mode-after-concealment>, <j-after-concealment>, <k-after-concealment>, etc.

      Thanks for your opinions.

      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    Your message has been successfully submitted and would be delivered to recipients shortly.