Text randomly highlights during edit

From SuperMemopedia
Jump to navigation Jump to search

Problem

I've encountered a bug that appears randomly while editing text in an element. The text is edited in an HTML component. I have encountered this for certain when pressing ALT+Z to create a cloze deletion, but it only happens occasionally when doing this. I've also encountered it when working with the Format toolbar, possibly with the italics or subscript buttons but I'm not sure which ones. Again it is seemingly random.

There does appear to be one consistency: All of the recent occurrences have highlighted the same fragment of the same word, as you can see in the examples.

search highlight showing in SuperMemo

Example highlight triggered by cloze deletion: http://imgur.com/b5MJNAV

Example highlight triggered by use of the Format toolbar: http://imgur.com/WSDse6I

In none of the cases did I accidentally press the highlighter button on the Read toolbar.

Solution

The image shows a search highlight that persists after searching for the string "charact".

Workarounds:

  • ignore the highlight
  • search for another text (e.g. use F3 to search for "zzzz")
  • press Esc in the display mode (not all versions of SuperMemo)
  • remove the definition of the highlight class in the stylesheet used by the component

Response

I just checked both CTRL+F and CTRL+S and both had the text "theorem" in them, not "charact". I'm pretty certain the only place I searched for "charact" was in the image registry.

I've been ignoring the highlight, but it is very annoying and a distraction during the review process.

Removing the highlight class seems extreme. The class exists to highlight search terms to facilitate quick searching. This seems to be clearly a bug.

Quick fix

depending on the version you may have 1 or 2 search highlights. a quick fix would be to search for XXXXXX AND YYYYYY which would override both search strings.

Future solution

As you are not the first to ask, we should probably add an option to clear search highlights easily. However, with overcrowded shortcuts, menus, and screen buttons, it is hard to find a place where such an option should be placed without adding to the sense of option overload. If you have an idea, please write.

Suggestion

My first thought would be to add a "clear search" button in the search panel, easily accessible with ctrl+F

comment

this does not sound good. you need to remember about "clear search" before the search. If you forget, you are back to square one. Even worse, you will nearly always want to find your search terms first and clear the text only after the highlight is no longer needed. In other words, the option should work to clear the highlights when you think you no longer need them. This could be for current element highlights, or for highlight strings in general, or both (even though this leads to "featuritis")

Answer

Yes, for me the idea was that when you are done with the search and you want to reset the highlight you press ctrl+F and execute the Clear search. (Note that the idea to place it in the search box is just because of mnemoncs). A faster way would be a key shortcut, but then there would be one more to memorize. this idea would be a shortened version of the above mentionned "quick fix" of making an empty search, which I actually just tested and doesn't work, after searching for xxxxxxxx AND yyyyyyyyyy the previous text still remains highlighted. At the moment it looks like there is no fix at all...

Response

This workaround does work for me in SuperMemo 16. (I'm the one who created this page originally)

However, it's not as simple as running a search to clear the text. If text is highlighted:

  1. Press CTRL+S to start a new search, and search for some text that won't be present in an element. I searched for "sdfsdf" or similar.
  2. Run the search
  3. SuperMemo warns that there are no elements that can be found with that string
  4. SuperMemo then opens the Text Registry
  5. Press Esc to leave the Text Registry
  6. Press Esc again a few more times and the highlight is removed from the text

I'm writing this up to pass it along to others. The workaround works for me and I can live with it. If the choice in working on SuperMemo is between fixing bugs like this or fixing bugs that corrupt data then I vote that effort be prioritized to protect the data first. The software is supposed to be a tool for lifelong learning, so it must first and foremost protect all existing data, and second be open to expansion and data changes in future decades. Minor bugs like this are annoying but not significant in the grand scheme, in my opinion.

Don't get me wrong -- bugs like this *are* annoying, but if a workaround exists that is viable then that is acceptable. Thanks.

SuperMemo Tasklists

Future jobs are prioritized via tasklists, i.e. Value/Cost. Data safety goes to the top of the list by virtue of Value (despite high costs, e.g. in debugging/testing time), but a shortcut for clearing search highlights is in good standing due to low Cost (moreover, its Value comes up because you are not the only one to complain). It seems the biggest "cost" now is in finding the right way of implementing this. Someone needs to come up with a good idea/proposition.

Idea

Instead of a new option, Ctrl+F followed by Esc could clear search highlights (without confirmation?)