aboutsummaryrefslogtreecommitdiffhomepage
path: root/highlight.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-08-04 18:02:13 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-08-04 18:02:13 -0700
commit4906609dd9ee2c6fa6be1402f077d238925f6a46 (patch)
tree70dbbb7fa53f458c3ef3e6a76d1fd2bae272031f /highlight.cpp
parent682353f9cc1d2e1eb305cbb343ffec9523d846ba (diff)
Fix for assertion failure in syntax highlighting
Diffstat (limited to 'highlight.cpp')
-rw-r--r--highlight.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/highlight.cpp b/highlight.cpp
index d8b7e7ea..e0c99778 100644
--- a/highlight.cpp
+++ b/highlight.cpp
@@ -356,7 +356,7 @@ rgb_color_t highlight_get_color( int highlight, bool is_background )
/**
Highlight operators (such as $, ~, %, as well as escaped characters.
*/
-static void highlight_param( const wcstring &buffstr, std::vector<int> &colors, size_t pos, wcstring_list_t *error )
+static void highlight_param( const wcstring &buffstr, std::vector<int> &colors, wcstring_list_t *error )
{
const wchar_t * const buff = buffstr.c_str();
enum {e_unquoted, e_single_quoted, e_double_quoted} mode = e_unquoted;
@@ -970,8 +970,7 @@ static void tokenize( const wchar_t * const buff, std::vector<int> &color, const
std::vector<int>::const_iterator where = color.begin() + tok_pos;
std::vector<int> subcolors(where, where + param_str.size());
subcolors.push_back(-1);
- assert(pos >= tok_pos);
- highlight_param(param_str, subcolors, pos-tok_pos, error);
+ highlight_param(param_str, subcolors, error);
/* Copy the subcolors back into our colors array */
std::copy(subcolors.begin(), subcolors.begin() + param_str.size(), color.begin() + tok_pos);