partial fix to coding style suggestions for vim settings

Lakshman acrlakshman at
Mon Mar 10 20:49:08 PDT 2014

On Mon, Mar 10, 2014 at 2:43 PM, Dirk Hohndel <dirk at> wrote:
> On Mon, 2014-03-10 at 14:02 -0500, Lakshman wrote:
> > > I'm still mulling over your other patch. I don't like it in the normal
> > > 'view' of Subsurface because it's redundant information (if there is a
> > > temperature, it's shown with a unit). But in edit and add mode I think
> > > it's a great improvement.
> >
> > You are right, when in normal view it is redundant. When I started I
> > kept in mind it for 'edit and add' mode, and ignored the normal mode.
> > I think to change it I need to go through the code to see, what
> > variable signals the edit and add mode and update accordingly. I will
> > be on it. Please guide me if I am going in a wrong direction.
> This is the easiest way to tell if you are in 'display' mode or in
> 'edit' or 'add' mode:
> if (DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING)
>         // I'm in edit or add mode

Thanks for the tip Dirk. I experimented with this option, later
realized that, when 'acceptChanges()' or 'rejectChanges()' functions
are called, Mode in DivePlannerPointsModel is changing to 'NOTHING',
and it remains in the same state even if the user starts editing the
file. I tried "isEditing()" function too, whose state doesnot change,
then I realized this may not be what I am looking for. However the
hint to me is that, whenever user starts editing or stops,
"displayMessage" and "hideMessage" are triggered, so I used them for
the time being and the attached patch is written on this basis and
works correctly, i.e. units are not shown when it is not required.

Regarding making the update clean, i.e. not depending on
"displayMessage" and "hideMessage" methods, I need to go through the
stages and modifications made to Mode in DivePlannerPointsModel, which
is being changed at multiple places. I will work in this direction
too, in case you feel cleaning is needed immediately. Can you please
let me know your opinion.

> Thanks for your continued enthusiasm.
> /D

Thank you,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Feature-to-show-units-with-labels.patch
Type: text/x-patch
Size: 5323 bytes
Desc: not available
URL: <>

More information about the subsurface mailing list