[gnome-builder] libide/code: always return a language id
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide/code: always return a language id
- Date: Thu, 21 Jul 2022 09:05:02 +0000 (UTC)
commit 7b6011f787bd7c30af47dbee204720ee6ea61742
Author: Christian Hergert <chergert redhat com>
Date: Thu Jul 21 02:04:56 2022 -0700
libide/code: always return a language id
Just use "plain" to mean "nothing" for now.
src/libide/code/ide-buffer.c | 6 ++----
src/libide/sourceview/ide-source-view-addins.c | 2 +-
2 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/libide/code/ide-buffer.c b/src/libide/code/ide-buffer.c
index 899290472..d864943a8 100644
--- a/src/libide/code/ide-buffer.c
+++ b/src/libide/code/ide-buffer.c
@@ -1213,9 +1213,7 @@ _ide_buffer_attach (IdeBuffer *self,
g_return_if_fail (self->formatter == NULL);
g_return_if_fail (self->rename_provider == NULL);
- /* We use "--disabled--" just like sourceview does */
- if (!(language_id = ide_buffer_get_language_id (self)))
- language_id = "--disabled--";
+ language_id = ide_buffer_get_language_id (self);
/* Setup the semantic highlight engine */
self->highlight_engine = ide_highlight_engine_new (self);
@@ -1860,7 +1858,7 @@ ide_buffer_get_language_id (IdeBuffer *self)
if ((lang = gtk_source_buffer_get_language (GTK_SOURCE_BUFFER (self))))
return gtk_source_language_get_id (lang);
- return NULL;
+ return "plain";
}
void
diff --git a/src/libide/sourceview/ide-source-view-addins.c b/src/libide/sourceview/ide-source-view-addins.c
index 298a4b747..e5124cdc2 100644
--- a/src/libide/sourceview/ide-source-view-addins.c
+++ b/src/libide/sourceview/ide-source-view-addins.c
@@ -24,7 +24,7 @@
#include "ide-source-view-private.h"
-#define DISABLED_LANGUAGE_ID "--disabled--"
+#define DISABLED_LANGUAGE_ID "plain"
static void
ide_source_view_completion_provider_added_cb (IdeExtensionSetAdapter *adapter,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]