Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 423482

Summary: Cannot put an annotation on last line of buffer if the line is empty
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: EditorAssignee: Project Inbox <orion.editor-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=423459
Whiteboard:
Attachments:
Description Flags
screenshot of error popup from on empty last line none

Description Mark Macdonald CLA 2013-12-06 17:41:22 EST
1. Create a buffer that ends with an empty line, eg
> foo bar baz
> 
2. Try to create an annotation on the empty line. I tried this indirectly by using a validator service, but it should also be reproducible by constructing an annotation and passing it directly to editor.showAnnotations(...).

I attempt to create an annotation with this shape:

 { start: model.getCharCount(), end: model.getCharCount() }

This does not behave correctly. First, the annotation never appears in the rulers. When I hover the cursor over the last line or the editor canvas, the annotation's popup appears unexpectedly. Finally the annotation is never removed, so duplicate messages pile up in the popup when I repeat the save/validate cycle several times.

The start == end approach works fine when the empty line is not the last line in the buffer.

Once this bug is fixed, the workaround I added to fix bug 423459 can be removed.
Comment 1 Mark Macdonald CLA 2013-12-06 17:47:05 EST
FWIW, you need at least 2 lines to see the problem: everything works fine when the buffer is empty.
Comment 2 Mark Macdonald CLA 2013-12-06 17:47:47 EST
Created attachment 238133 [details]
screenshot of error popup from on empty last line
Comment 3 John Arthorne CLA 2015-05-05 16:20:19 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:


https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html