Re: New property session.readonly

scintillaDotOrg <[email protected]> Thu, 29 Jan 2026 21:37:05 -0800 (PST)
Newsgroups gmane.editors.scite.general
Message-ID <[email protected]>
------=_Part_12974_1872667389.1769751425553
Content-Type: multipart/alternative; 
	boundary="----=_Part_12975_1273846140.1769751425553"

------=_Part_12975_1273846140.1769751425553
Content-Type: text/plain; charset="UTF-8"

Roberto Rossi wrote:

I added the "session.readonly"(1 or 0) property which saves the state of 
files opened in sessions.


OK, committed with simplification and variable name changes.
https://sourceforge.net/p/scintilla/scite/ci/8c0901932236dbb838908f11f44a40656e2dd82c/

In this code

const std::string bmString = buff.isReadOnly ? "1" : "0";
if (bmString.length()) {
propKey = IndexPropKey("buffer", i, "readonly");
fprintf(sessionFile, "%s=%s\n", propKey.c_str(), bmString.c_str());
}

bmString is always a single character string ("1" or "0") so there is no 
need to test its length. Any failure will throw an exception and no current 
C++ standard library implementation will throw due to the small string 
optimization.

Neil

-- 
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/scite-interest/8b7f0460-94af-4349-bb91-219dc3e3fa30n%40googlegroups.com.

------=_Part_12975_1273846140.1769751425553
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div><div dir=3D"auto">Roberto Rossi wrote:<br /></div><blockquote style=3D=
"margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204, 204); padd=
ing-left: 1ex;">I added the "session.readonly"(1 or 0) property which saves=
 the state of files opened in sessions.<br /></blockquote><div><br /></div>=
<div>OK, committed with simplification and variable name changes.</div><div=
>https://sourceforge.net/p/scintilla/scite/ci/8c0901932236dbb838908f11f44a4=
0656e2dd82c/</div><div><br /></div><div>In this code</div><div><br /></div>=
<div>const std::string bmString =3D buff.isReadOnly ? "1" : "0";<br />if (b=
mString.length()) {<br /><span style=3D"white-space: pre;">	</span>propKey =
=3D IndexPropKey("buffer", i, "readonly");<br /><span style=3D"white-space:=
 pre;">	</span>fprintf(sessionFile, "%s=3D%s\n", propKey.c_str(), bmString.=
c_str());<br />}<br /></div><div><br /></div><div>bmString is always a sing=
le character string ("1" or "0") so there is no need to test its length. An=
y failure will throw an exception and no current C++ standard library imple=
mentation will throw due to the small string optimization.</div><div><br />=
</div><div>Neil</div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;scite-interest&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">scit=
[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
scite-interest/8b7f0460-94af-4349-bb91-219dc3e3fa30n%40googlegroups.com?utm=
_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/scit=
e-interest/8b7f0460-94af-4349-bb91-219dc3e3fa30n%40googlegroups.com</a>.<br=
 />

------=_Part_12975_1273846140.1769751425553--

------=_Part_12974_1872667389.1769751425553--