Skip to content

Commit

Permalink
Merge pull request #597 from fox0430/fix#596
Browse files Browse the repository at this point in the history
Fix #596
  • Loading branch information
fox0430 authored Apr 20, 2020
2 parents be06982 + 0ec7b78 commit 84f7fa5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/moepkg/editorstatus.nim
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ proc updateHighlight*(status: var EditorStatus, windowNode: var WindowNode) =
allOccurrence = bufferInView.searchAllOccurrence(fullWidthSpace)
color = EditorColorPair.highlightFullWidthSpace
for pos in allOccurrence:
let colorSegment = ColorSegment(firstRow: pos.line, firstColumn: pos.column, lastRow: pos.line, lastColumn: pos.column, color: color)
let colorSegment = ColorSegment(firstRow: range[0] + pos.line, firstColumn: pos.column, lastRow: range[0] + pos.line, lastColumn: pos.column, color: color)
windowNode.highlight = windowNode.highlight.overwrite(colorSegment)

# highlight search results
Expand All @@ -646,7 +646,7 @@ proc updateHighlight*(status: var EditorStatus, windowNode: var WindowNode) =
allOccurrence = searchAllOccurrence(bufferInView, keyword)
color = if status.isSearchHighlight: EditorColorPair.searchResult else: EditorColorPair.replaceText
for pos in allOccurrence:
let colorSegment = ColorSegment(firstRow: pos.line, firstColumn: pos.column, lastRow: pos.line, lastColumn: pos.column + keyword.high, color: color)
let colorSegment = ColorSegment(firstRow: range[0] + pos.line, firstColumn: pos.column, lastRow: range[0] + pos.line, lastColumn: pos.column + keyword.high, color: color)
windowNode.highlight = windowNode.highlight.overwrite(colorSegment)

proc changeTheme*(status: var EditorStatus) = setCursesColor(ColorThemeTable[status.settings.editorColorTheme])
Expand Down

0 comments on commit 84f7fa5

Please sign in to comment.