Questions tagged [gtksourceview]

GtkSourceView is a portable C library that extends the standard GTK+ framework.

GtkSourceView is a portable C library that extends the standard GTK+ framework for multiline text editing with support for configurable syntax highlighting, unlimited undo/redo, UTF-8 compliant caseless searching, printing and other features typical of a source code editor.

GtkSourceView is licensed under the GNU LGPL 2.1 and is part of the GNOME Desktop Environment.

87 questions
2
votes
1 answer

gtk+/gtksourceview how to insert line-comment or block-comment

I am creating a text editor in C using gtk+-2.0 gtksourceview-2.0. I am having trouble finding any information about how to comment a line or a block. I am finding plenty of information about how to highlight these commented lines, but nothing…
nomadicME
  • 1,389
  • 5
  • 15
  • 35
2
votes
1 answer

gtk_source_undo_manager_begin_not_undoable_action / gtk_source_undo_manager_end_not_undoable_action not working

I'm trying to write my own text editor in C using gtk+-2.0 & gtksourceview-2.0. I've been using the gedit source when I get stuck, but they apparently don't use this functionality and I can't find an example of its use online. When I open a text…
nomadicME
  • 1,389
  • 5
  • 15
  • 35
1
vote
2 answers

Gedit syntax-highlighting with gtksourceview for backreferencing sub-patterns?

The following will highlight "timeout" on the second line but will not highlight it ever again. Does gtksourceview support some sort of backreference on the "sub-pattern" that will match all instances throughout the file ? gtksourceview website…
1
vote
1 answer

Gedit highlight (gtksourceview): how to highlight a block inside [curly] braces with a color

I need to highlight every whole block of code that is inside curly braces, so I created a rule: { }
shaman.sir
  • 3,198
  • 3
  • 28
  • 36
1
vote
1 answer

Syntax highlighting for lex in gedit

I know i just need a file like /usr/share/gtksourceview-2.0/language-specs/javascript.lang. Where can i find a language definition like this for lex ?
Jaseem
  • 2,236
  • 6
  • 28
  • 35
1
vote
0 answers

GtkSourceView - Gedit: regex matching discrepancy

I try to use this RegEx ^(\[\^)([^\]\s\p{C}]+)(\])\ (\P{C}*(?:\n(?!\n[\[\n])\P{C}*)*) in dar.lang (located at /usr/share/gtksourceview-3.0/language-specs) to capture footnotes with multiple paragraphs (that i.a. terminate with 2 empty lines, i.e. 3…
user1876484
  • 610
  • 6
  • 16
1
vote
0 answers

How to add custom color scheme for syntax highlighting in a Text Editor using gtk source view and XML

I had built a text editor using gtk . It is a very simple text editor. I want to add syntax highlighting using gtk source view (probably). I want to use a custom style sheet in XML file format which I made for this text editor. How can I add syntax…
arka
  • 418
  • 2
  • 9
1
vote
0 answers

Use double line feed as -element in GtkSourceView

I'm working on a language definition for GtkSourceView. I've got an element which starts with a "@LI:" and ends with a double line feed. The first line should get a different style, then the rest of the element another style. My problem right now…
Chrissss
  • 11
  • 3
1
vote
0 answers

gtksourceview / gedit syntax-highlighting : highlighting a 'shell' sub-section

I'm writing a .lang gtksourceview/gedit file for the nextflow language. In this language, there are some sections starting and ending with """ and containing some shell statements. ( My xml/lang file is here :…
Pierre
  • 34,472
  • 31
  • 113
  • 192
1
vote
1 answer

I want bigger pixbufs rendered onto GtkSourceGutter

It seems that the size of the source marks rendered with GtkSourceGutterRenderer are remotely tied up to the size of the text in the GtkSourceView. I want to have bigger pixbufs, without making the text font size bigger and to achieve that I…
Edenia
  • 2,312
  • 1
  • 16
  • 33
1
vote
2 answers

Second argument of gtk_source_mark_attributes_render_icon

What should be the second argument of the function gtk_source_mark_attributes_render_icon() It is clearly of type GtkWidget* and according to the reference page this is "widget of which style settings may be used" I find it for a bit…
Edenia
  • 2,312
  • 1
  • 16
  • 33
1
vote
0 answers

Redraw Whitespace characters on GtkSourceView Python

I am using GtkSource.view in Python to display whitespace characters. After setting View.set_draw_spaces(GtkSource.DrawSpacesFlags.ALL), it is displaying whitespace characters, But I want to redraw/customize some symbols like Non-Breaking space,…
1
vote
2 answers

GtkSourceGutter - How to render icon or text on a specific line

I have inserted custom gtk source gutter renderer pixbuf and I want to render icon on a specific line. The reference API states that the interface is very similar to that on GtkTreeView, but doesn't work with a tree model. So... how am I supposed to…
Imobilis
  • 1,475
  • 8
  • 29
1
vote
1 answer

GTK SourceView scroll to mark not working

I'm trying to fill a SourceView's buffer with text and then scroll to make a specific line visible, like this: lines = '....'.split('\n') line_number = 76 # For instance, assuming lines has at least this many lines buffer = view.get_buffer() for…
Tom
  • 7,269
  • 1
  • 42
  • 69
1
vote
1 answer

How to use custom language highlight syntax in Gtk SourceView?

I'm trying to create my own language definition, and use it for highlighting the syntax in my app. The issue I have is that, when trying to access the language definition from my app's data folder (/usr/share/myapp/), even using the c.lang file…
Aleksandar Stefanović
  • 1,583
  • 2
  • 20
  • 36