Skip to content

Commit

Permalink
front: fix MacroEditorState.getPathKeys() when missing secondary code
Browse files Browse the repository at this point in the history
getPathKey() (right above) produces different keys when an OP is
missing a secondary code: it omits the "/code" suffix. Do the same
here so that positions don't get lost for these OPs.

Signed-off-by: Simon Ser <[email protected]>
  • Loading branch information
emersion committed Mar 4, 2025
1 parent fbbeb88 commit 0677285
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ export default class MacroEditorState {
static getPathKeys(item: SearchResultItemOperationalPoint): string[] {
const result = [];
result.push(`op_id:${item.obj_id}`);
result.push(`trigram:${item.trigram}/${item.ch}`);
result.push(`uic:${item.uic}/${item.ch}`);
result.push(`trigram:${item.trigram}${item.ch ? `/${item.ch}` : ''}`);
result.push(`uic:${item.uic}${item.ch ? `/${item.ch}` : ''}`);
item.track_sections.forEach((ts) => {
result.push(`track_offset:${ts.track}+${ts.position}`);
});
Expand Down

0 comments on commit 0677285

Please sign in to comment.