After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 132821 - SourceMarkers should be line based
SourceMarkers should be line based
Status: RESOLVED OBSOLETE
Product: gtksourceview
Classification: Platform
Component: General
0.7.x
Other All
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2004-01-29 03:51 UTC by Ben Maurer
Modified: 2014-02-15 12:53 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10



Description Ben Maurer 2004-01-29 03:51:28 UTC
Right now, SourceMarkers are implemented with TextMarks as a backend.
However this does not fit the model that most people use the `SourceMark'
for. Since the mark displays an icon on the line which it is places, it is
natural to limit 1 marker per type per line.

Also, the functions should be reworked to accomodate this. For example,
right now in MD we have:

		public void NextBookmark ()
		{
			TextIter loc = GetIterAtMark (InsertMark);
			int ln = loc.Line;
			
			IntPtr nextMarker = gtk_source_buffer_get_next_marker (Handle, ref loc);
			IntPtr firstMarker = nextMarker;
			bool first = true;
			while (true) {
				// Thats a wrap!
				if (nextMarker == IntPtr.Zero)
					nextMarker = gtk_source_buffer_get_first_marker (Handle);
				
				IntPtr nm = gtk_source_marker_get_marker_type (nextMarker);
				string name = GLibSharp.Marshaller.PtrToStringGFree (nm);
				if (name == "SourceEditorBookmark") {
					gtk_source_buffer_get_iter_at_marker (Handle, ref loc, nextMarker);
					
					if (! first || loc.Line != ln)
						break;
				}
				
				nextMarker = gtk_source_marker_next (nextMarker);
				
				first = false;
			}
			
			PlaceCursor (loc);
		}

Which will place the bookmark on the next line (yes, that is a wierd combo
of bindings + function invokes, this is because of refcounting issues +
gtype issues)

Really this function should be built in, so that you can just `go to the
next marker of this type'
Comment 1 Paolo Maggi 2007-08-28 09:41:39 UTC
Sorry for the very very late reply.

It is not clear to me what you mean with line based.

Limiting to  1 marker per type per line sounds wrong to me. Suppose the case where  you have a bookmark + a breakpoint at the same line or multiple syntax errors at the same line.

I agree we need a method to go to the next/prev marker of the same type.

I think you can implement the above method in a saner way by checking if there are markers in the current line with gtk_source_buffer_get_markers_in_region.
Comment 2 Yevgen Muntyan 2008-06-20 02:09:26 UTC
We got new fancy API for marks now.