Summary: | Folding Markers reappear when you save document | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | MikeH <mikeh> |
Component: | kwrite | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | franke.daniel |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
MikeH
2003-02-07 13:16:31 UTC
you must set your view defaults in the config to "show folding markers if available" = off *** Bug 57957 has been marked as a duplicate of this bug. *** Subject: kdelibs/kate/part CVS commit by dang: When saving, don't make the Code Folding Markers re-appear if the user explicitly turned them off for this view. Of course if you don't want them _at all_ as opposed to just for this time, then you'll have to switch them off in the "View Defaults" config page. Without this patch, the behaviour of Kate when saving is senseless (I don't see how the user could connect saving with the code folding markers re-appearing when they _deliberately_ turned them off). This bug has now been reported twice and closed the same number of times without a proper fix... ah, well at least it's fixed now :) CCMAIL: 54241@bugs.kde.org M +9 -2 kateview.cpp 1.255 M +1 -0 kateview.h 1.122 --- kdelibs/kate/part/kateview.cpp #1.254:1.255 @@ -81,4 +81,5 @@ KateView::KateView( KateDocument *doc, Q , m_active( false ) , m_hasWrap( false ) + , m_userWantsFoldingMarkersOff( false ) { KateFactory::registerView( this ); @@ -662,5 +663,6 @@ void KateView::slotDropEventPass( QDropE void KateView::updateFoldingMarkersAction() { - setFoldingMarkersOn( m_doc->highlight() && m_doc->highlight()->allowsFolding() && m_doc->m_foldingBar); + setFoldingMarkersOn( m_doc->highlight() && m_doc->highlight()->allowsFolding() && m_doc->m_foldingBar && + !m_userWantsFoldingMarkersOff ); m_toggleFoldingMarkers->setChecked( foldingMarkersOn() ); m_toggleFoldingMarkers->setEnabled( m_doc->highlight() && m_doc->highlight()->allowsFolding() ); @@ -899,4 +901,9 @@ void KateView::toggleFoldingMarkers() { m_viewInternal->leftBorder->toggleFoldingMarkers(); + + // if the user has turned off View/Show Folding Markers, + // then s/he _really_ doesn't want them to reappear when s/he saves + // (but probably just for this time else s/he'd change the View Defaults) + m_userWantsFoldingMarkersOff = !foldingMarkersOn(); } --- kdelibs/kate/part/kateview.h #1.121:1.122 @@ -351,4 +351,5 @@ class KateView : public Kate::View, bool m_active; bool m_hasWrap; + bool m_userWantsFoldingMarkersOff; private slots: Subject: Re: Folding Markers reappear when you save document
On Monday 05 May 2003 10:40, Clarence Dang wrote:
> + , m_userWantsFoldingMarkersOff( false )
Maybe we should instantiate a bitmask of user settings, to avoid all those
properties? Wouldn't that be more efficient?
-anders
> Maybe we should instantiate a bitmask of user settings,
> to avoid all those properties? Wouldn't that be more efficient?
Well, m_userWantsFoldingMarkersOff does not neccessarily == !foldingMarkersOn()
- it's only set if the user has _clicked_ on "Show Folding Markers". If you
try to invert the logic and change it to m_userWantsFoldingMarkersOn, then it
probably won't work (have a think about it...). So it's a strange variable
and I'm not sure if it could be considered a "property" (after all you can't
always click on "Show Folding Markers" because sometimes it's greyed out).
As for efficiency, maybe in terms of memory but in terms of performance an
access to a bit in a bitfield is far slower than accessing an aligned
int/bool, if that matters.
Subject: Re: Folding Markers reappear when you save document
On Tuesday 06 May 2003 03:58, Clarence Dang wrote:
> As for efficiency, maybe in terms of memory but in terms of performance an
> access to a bit in a bitfield is far slower than accessing an aligned
> int/bool, if that matters.
It's not a mission critical issue, so speed is not a topic.
My point is more that since KateDocument/View are big and complex classes, so
if anytime we discover an inconvenience we add a variable and 5 lines of
code, the future looks bleak - as long as a common solution within the
application is possible, which i think is the case here (a similar problem
with the highlight mode was solved in a similar way).
-anders
Subject: Re: Folding Markers reappear when you save document On Tue, 6 May 2003 04:53 pm, Anders Lund wrote: > On Tuesday 06 May 2003 03:58, Clarence Dang wrote: > > As for efficiency, maybe in terms of memory but in terms of performance > > an access to a bit in a bitfield is far slower than accessing an aligned > > int/bool, if that matters. > > It's not a mission critical issue, so speed is not a topic. > Fine, but you asked "Wouldn't that be more efficient?" after all... > My point is more that since KateDocument/View are big and complex classes, > so if anytime we discover an inconvenience we add a variable and 5 lines of > code, the future looks bleak - as long as a common solution within the > application is possible, which i think is the case here (a similar problem > with the highlight mode was solved in a similar way). > Ok, good idea then. Clarence Subject: Re: Folding Markers reappear when you save document On Tue, 6 May 2003 04:53 pm, Anders Lund wrote: > On Tuesday 06 May 2003 03:58, Clarence Dang wrote: > > As for efficiency, maybe in terms of memory but in terms of performance > > an access to a bit in a bitfield is far slower than accessing an aligned > > int/bool, if that matters. > > It's not a mission critical issue, so speed is not a topic. > Fine, but you asked "Wouldn't that be more efficient?" after all... > My point is more that since KateDocument/View are big and complex classes, > so if anytime we discover an inconvenience we add a variable and 5 lines of > code, the future looks bleak - as long as a common solution within the > application is possible, which i think is the case here (a similar problem > with the highlight mode was solved in a similar way). > Ok, good idea then. Clarence |