Skip to content

Commit

Permalink
Bracket Colors, initial code review
Browse files Browse the repository at this point in the history
* various small updates recommended from Geany community
  • Loading branch information
asifamin13 authored Feb 5, 2023
1 parent b75167c commit 0ac738a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 134 deletions.
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Available plugins are:
* ``addons`` -- the Addons plugin
* ``autoclose`` -- the Autoclose plugin
* ``automark`` -- the Automark plugin
* ``bracketcolors`` -- the BracketColors plugin
* ``codenav`` -- the CodeNav plugin
* ``commander`` -- the Commander plugin
* ``debugger`` -- the Debugger plugin
Expand Down
4 changes: 2 additions & 2 deletions bracketcolors/README
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Color brackets, parenthesis, and braces
===================
=======================================

.. contents::

About
-----

This plugin enables bracket coloring features. Brackets are colored based on
nesting level
nesting level, often referred as "rainbow brackets".

Features
--------
Expand Down
35 changes: 1 addition & 34 deletions bracketcolors/src/BracketMap.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BracketMap.cc
*
* Copyright 2013 Asif Amin <[email protected]>
* Copyright 2023 Asif Amin <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -67,7 +67,6 @@
}



// -----------------------------------------------------------------------------
void BracketMap::ComputeOrder()
/*
Expand Down Expand Up @@ -109,35 +108,3 @@
GetOrder(bracket) = orderStack.size() - 1;
}
}



// -----------------------------------------------------------------------------
void BracketMap::Show()
/*
----------------------------------------------------------------------------- */
{ g_debug("%s: Showing bracket map ...", __FUNCTION__);

for (const auto it : mBracketMap) {

const Index &startIndex = it.first;
const Bracket &bracket = it.second;

Length length = std::get<0>(bracket);
Order order = std::get<1>(bracket);

Index end = -1;
if (length > 0) {
end = startIndex + length;
}

g_debug(
"%s: Bracket at %d, Length: %d, End: %d, Order: %d",
__FUNCTION__, startIndex, length, end, order
);
}

g_debug("%s: ... Finished showing bracket map", __FUNCTION__);
}

15 changes: 1 addition & 14 deletions bracketcolors/src/BracketMap.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* BracketMap.h
*
* Copyright 2013 Asif Amin <[email protected]>
* Copyright 2023 Asif Amin <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -40,8 +40,6 @@
BracketMap();
~BracketMap();

void Show();

void Update(Index index, Length length);
void ComputeOrder();

Expand All @@ -62,15 +60,4 @@
}
};












#endif
Loading

0 comments on commit 0ac738a

Please sign in to comment.