No GEDIT_CURRENT_CHAR_NUMBER or GEDIT_CURRENT_COLUMN_NUMBER?

Hi,
I have found this old piece of code that mentions gedit environment variables :

Among them:
*GEDIT_CURRENT_CHAR_NUMBER
*GEDIT_CURRENT_CHARACTER_NUMBER
*GEDIT_CURRENT_COLUMN_NUMBER

But they seem not available in the version of gedit that i am using (41.0)

Getting the current word is not enough when they are several occurrences of it in a line.

Have they been existing in the past ? Is it a way to get thin information in external tools ? Is it possible to add it in the future ?

It seems that it belongs tho the external-tools plugin. ^1

Thanks.

The external tools plugin has some documentation here:

@swilmet Thanks for the links.

I knew those pages and they confirm that there is neither character nor column available variable.

echo ${!GEDIT_*} gives the list below:

  • GEDIT_CURRENT_DOCUMENT_DIR
  • GEDIT_CURRENT_DOCUMENT_LANGUAGE
  • GEDIT_CURRENT_DOCUMENT_NAME
  • GEDIT_CURRENT_DOCUMENT_PATH
  • GEDIT_CURRENT_DOCUMENT_SCHEME
  • GEDIT_CURRENT_DOCUMENT_TYPE
  • GEDIT_CURRENT_DOCUMENT_URI
  • GEDIT_CURRENT_LINE
  • GEDIT_CURRENT_LINE_NUMBER
  • GEDIT_CURRENT_WORD
  • GEDIT_CWD
  • GEDIT_DOCUMENTS_PATH
  • GEDIT_DOCUMENTS_URI
  • GEDIT_FILE_BROWSER_ROOT

Let us suppose I have a line in a file with several occurrences of the same word and I am selecting one of them… With the available GEDIT_* variables, I can know the current line, the current word, the selection… But I can’t neither know which occurrence I am selecting nor where the selection starts.

With a GEDIT_CURRENT_CHARACTER or a GEDIT_CURRENT_COLUMN[^1] I can know where the selection starts and make some stuff and change the selection.

I have not found on gitlab.gnome.org where I could ask for adding those variables. Rather, I’ve been politely invited to go there to talk. Where can I ask adding those variables ? Could one of my readers ask it ?

Thanks.

[^1]: Maybe both variables are necessary, maybe with other names, e.g: GEDIT_CURRENT_BYTE, for printf difficulties to manage UTF8 multibyte characters. See: bash - Why is printf "shrinking" umlaut? - Unix & Linux Stack Exchange

The External Tools plugin cannot do everything.

But there is always the possibility to write a new gedit plugin for some specific tasks.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.