Wednesday, January 1, 2020

Re: unchangeable lines

On 29.12.19 17:43, Efraim Yawitz wrote:
> I wonder if this could be easily hacked into the code of vim by creating a
> new syntax group called Unchangeable or something and adding code to make
> it uneditable.

Or more easily in the folding code? That already treats an arbitrary
number of lines as a single unit when a fold is closed. To make a fold
immutable, its fold status would admittedly need to be checked by all
edit operations - when the fold is open - a condition when it is hardly
distinguishable from any other text.

If done there, the immutable text would inherently still be able to be
moved, like any other closed fold, without needing to toggle the
immutability tag on the fold, I figure.

The various existing foldmethods would seem well suited to delimiting
protected text. But how to add the protecting metadata in anything other
than an easily circumvented way is difficult to imagine.

Erik

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200102064551.GB3705%40ratatosk.

No comments: