[code] [textadept] Disable modification flag of a buffer

From: Procházka Lukáš Ing. <LPr.att.pontex.cz>
Date: Wed, 12 Sep 2018 10:51:00 +0200


I'm using a buffer which has similar function as '[Message Buffer]' - it is read-only (and should have click-on-line functionality in the future).

---- (snip)
   buf = buffer.new()
   buf._type = '[CodExp]' -- Inspired by '[Message Buffer]'

I modify the buffer content by:
---- (snip)
   buf.read_only = false
   buf:set_text(text or "")
   buf.read_only = true
The problem is that anytime I modify the buffer content, its '.modify' (read-only value) changes to 'true' and so when quitting TA, TA is asking for a file name to save the buf content (or discard changes).
How to:
- set (force) buffer state to "not modified"?
- tell TA to ignore this buffer when asking for saving changes?
	(suggestion: could be e.g. when 'buffer.ignore_changes' is 'true' or when buf has '._type' of mask '^%[.+%]$').
Best regards,
Ing. Lukáš Procházka | mailto:LPr.att.pontex.cz
Pontex s. r. o.      | mailto:pontex@pontex.cz | http://www.pontex.cz | IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4
Mob.: +420 702 033 396
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Wed 12 Sep 2018 - 04:51:00 EDT

This archive was generated by hypermail 2.2.0 : Wed 12 Sep 2018 - 06:41:29 EDT