[foldcode addon] Fix off-by-one error when determining brace type in braceRangeFinder

Closes #1185
Fix bug in widget-redrawing-prevention hack

See 67a54297b7aa92072c2434554a0211070b514411

Closes #1184