Highlighting tags does not work properly

Reported by Izidor Matušov on 2011-04-08
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Getting Things GNOME!
Medium
Unassigned

Bug Description

GTG in trunk highlights tags in a tasks not as they should be. I would expect that every time I use @myTag, it would be with the yellow background.

As you can see, just only last tag is highlighted and tags which are followed by ")" are not counted.

Related branches

Izidor Matušov (izidor) wrote :
Izidor Matušov (izidor) wrote :

Tags followed by ")" are recognized as @myTags) -- so the half of mystery is solved..

Lionel Dricot (ploum) wrote :

This bug has been present since the beginning and is due to the way the parsing of tasks is impremented.

Changed in gtg:
status: New → Confirmed
milestone: 0.3 → 0.4
tags: added: editor
Izidor Matušov (izidor) on 2011-08-12
tags: added: taskeditor
Song Yangyu (flyfy1) wrote :

@ploum> Sorry I don't understand... how to reproduce the bug?

I'm testing with 0.3-development, this bug seems to be non-exist

Song Yangyu (flyfy1) wrote :

Oh after seeing the png file I sort of got it.. (https://launchpadlibrarian.net/68685826/2011-04-08_001.png)

But question: I think the tag should be used once only right? Is there a use case user want to refer to the tag many times?

Izidor Matušov (izidor) wrote :

I wouldn't introduce a restriction to tags. In my point of view the taskeditor and its freedom is the best feature on GTG. You can write whatever you want and if you use special formatting, you are able to assign tags, subtasks, etc.

A tag is an information as any other and you can replace every word to highlight it. Example:

<task>
Go to @work earlier

I need to complete my task before my @boss comes to @work.
</task>

It is quite an extreme use case but it doesn't interfere with others.

Song Yangyu (flyfy1) wrote :

Oh I see your point. I just tried out the mode (creating tag on the fly) you suggest and it's good.

But regarding with the tags, I think there're are the 2 problems:
1. the problem raised in this bug -- @home and @home) are different tags
2. cannot support multi-word tags, cuz the tag is separated by the space. (for example, one cannot use "normal life" as a tag name)

I think we need to restrict on the tag name a bit: by limiting the tag_name to be some non-special chars? (example of special characters: [()\//{}\[\]], so these character cannot be used as tag name)
But this cannot solve the second problem

Song Yangyu (flyfy1) wrote :

@Izidor: I looked at the code, in the file "taskview.py", line 44, you've defined a list of separators, and the comments says:

  #those separators are only separators if followed by a space. Else, they
  #are part of the word

I think currently the problem is that.. when I test the program, this is not true -- say we define ')' as separator also, then ideally according to the this comments, the tag name like "abc)def" should be seen as tag, but it's not.
Do I need to fix this?

BTW, for the problem raised in this post, it can be easily fixed by adding a ')' as separator.

Izidor Matušov (izidor) wrote :

Adding ')' into separators would be a sufficient workaround. We need to rework our texteditor's parser. At the moment it is in the same code with GTK code and is hard to update. This bug is not critical and must be addressed in a proper way during taskeditor rework which will be soon.

Izidor Matušov (izidor) wrote :

I've merged your workaround for ')' in rev 1145. The status of the bug doesn't change only the last tag is highlighted. (That was the reason of reporting this bug in the first place)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers