Merged trunk to build-system
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/build-system@4101 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
commit
081e9e768f
157
ChangeLog
157
ChangeLog
@ -167,6 +167,163 @@ Configurable Build Menu Changes
|
|||||||
* src/project.h, src/project.c:
|
* src/project.h, src/project.c:
|
||||||
Changed to load/store the new configuration info.
|
Changed to load/store the new configuration info.
|
||||||
|
|
||||||
|
2009-08-16 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||||
|
|
||||||
|
* src/document.c:
|
||||||
|
Add a translation hint to an ambiguous format string.
|
||||||
|
* src/Makefile.am:
|
||||||
|
Add missing include path to fix 'make distcheck'.
|
||||||
|
* src/win32.c:
|
||||||
|
Fix opening of local files in the browser on Windows.
|
||||||
|
* New release: Geany 0.18 "Kaine".
|
||||||
|
* configure.in, geany.nsi, geany_private.rc, win32-config.h, wscript,
|
||||||
|
src/geany.h, doc/geany.html, doc/geany.txt:
|
||||||
|
Post-release version bump.
|
||||||
|
|
||||||
|
|
||||||
|
2009-08-15 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||||
|
|
||||||
|
* src/editor.c:
|
||||||
|
Temporarily disable reshowing calltips when the autocompletion
|
||||||
|
list was closed implicitly by not choosing an item to fix
|
||||||
|
problems with wrongly displayed calltips.
|
||||||
|
* src/template.c:
|
||||||
|
Add missing 'coding' cookie to the Python filetype template.
|
||||||
|
* doc/images/pref_dialog_edit_completions.png,
|
||||||
|
doc/images/pref_dialog_toolbar.png:
|
||||||
|
Update images for Geany 0.18.
|
||||||
|
|
||||||
|
|
||||||
|
2009-08-13 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||||
|
|
||||||
|
* wscript:
|
||||||
|
Add command '--hackingdoc' to create the HTML form of the
|
||||||
|
HACKING file.
|
||||||
|
|
||||||
|
|
||||||
|
2009-08-12 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||||
|
|
||||||
|
* po/pt_PT.po, po/LINGUAS:
|
||||||
|
Added a first Portugese (Portugal) translation based on work done at
|
||||||
|
launchpad by e.g. André Glória and Alexandre Jesus.
|
||||||
|
* src/main.c: Fix a minor typo on --help call.
|
||||||
|
|
||||||
|
|
||||||
|
2009-08-11 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||||
|
|
||||||
|
* src/highlighting.c:
|
||||||
|
Call get_keyfile_wordchars() in highlighting_init_styles().
|
||||||
|
|
||||||
|
|
||||||
|
2009-08-09 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||||
|
|
||||||
|
* data/filetypes.ada:
|
||||||
|
Add missing file.
|
||||||
|
* src/keybindings.c:
|
||||||
|
Switching notebook tabs now works for the currently used notebook
|
||||||
|
widget instead of always using the documents notebook.
|
||||||
|
* src/document.c, src/document.h, src/documentprivate.h,
|
||||||
|
doc/plugins.dox:
|
||||||
|
Small corrections to some API docs.
|
||||||
|
|
||||||
|
|
||||||
|
2009-08-02 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||||
|
|
||||||
|
* src/build.c, src/win32.h, src/win32.c:
|
||||||
|
Expand system environment variables (%variableName%) on Windows when
|
||||||
|
running Build commands.
|
||||||
|
|
||||||
|
|
||||||
|
2009-07-30 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||||
|
|
||||||
|
* src/keybindings.c:
|
||||||
|
Rename 'Reflow lines/paragraph' to 'Reflow lines/block' because in
|
||||||
|
future using an indent block is more useful e.g. for ChangeLog
|
||||||
|
files.
|
||||||
|
* scintilla/LexMarkdown.cxx, scintilla/makefile.win32,
|
||||||
|
scintilla/include/SciLexer.h, scintilla/include/Scintilla.iface,
|
||||||
|
scintilla/KeyWords.cxx, scintilla/Makefile.am, src/highlighting.c,
|
||||||
|
src/about.c, src/filetypes.c, src/filetypes.h, THANKS,
|
||||||
|
tagmanager/parsers.h, tagmanager/makefile.win32,
|
||||||
|
tagmanager/markdown.c, tagmanager/Makefile.am, wscript:
|
||||||
|
Add Markdown filetype (patch by Jon Strait, thanks).
|
||||||
|
* src/pluginprivate.h, src/pluginutils.c, src/plugins.c:
|
||||||
|
Fix disconnecting plugin signal id when not using geany_object.
|
||||||
|
* src/filetypes.c:
|
||||||
|
Add filetype_make_title() instead of using:
|
||||||
|
ft->title = g_strdup_printf(_("%s source file"), ft->name);
|
||||||
|
It also supports "%s file" strings.
|
||||||
|
|
||||||
|
|
||||||
|
2009-07-29 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||||
|
|
||||||
|
* src/pluginprivate.h, src/utils.h, src/plugindata.h,
|
||||||
|
src/stash.c, src/pluginutils.c, src/plugins.c, src/pluginutils.h,
|
||||||
|
doc/pluginsymbols.c, doc/plugins.dox, plugins/geanyfunctions.h,
|
||||||
|
plugins/filebrowser.c:
|
||||||
|
Add plugin_signal_connect() for connecting plugin signals at
|
||||||
|
runtime and also for connecting to any GObject signal.
|
||||||
|
Add 'Plugin Utility Functions' on main page.
|
||||||
|
Add foreach_array() macro.
|
||||||
|
* src/keybindings.c, src/sciwrappers.c, src/sciwrappers.h,
|
||||||
|
src/document.c, src/editor.c:
|
||||||
|
Rename 3 sci functions to sci_set_target_start(),
|
||||||
|
sci_set_target_end(), sci_replace_target() to match the SCI_
|
||||||
|
message name.
|
||||||
|
|
||||||
|
|
||||||
|
2009-07-28 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||||
|
|
||||||
|
* wscript: Fix compiling error with waf.
|
||||||
|
|
||||||
|
|
||||||
|
2009-07-28 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||||
|
|
||||||
|
* src/pluginprivate.h, src/makefile.win32, src/plugindata.h,
|
||||||
|
src/pluginutils.c, src/plugins.c, src/pluginutils.h,
|
||||||
|
src/Makefile.am, wscript:
|
||||||
|
Move plugin_* utility functions to pluginutils.c.
|
||||||
|
Add pluginprivate.h.
|
||||||
|
* src/editor.c:
|
||||||
|
Fix reshowing calltip in the wrong document.
|
||||||
|
|
||||||
|
|
||||||
|
2009-07-25 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||||
|
|
||||||
|
* doc/geany.txt, doc/geany.html:
|
||||||
|
Add some general information about auto-completion capabilities
|
||||||
|
(patch by Lex Trotman, thanks).
|
||||||
|
|
||||||
|
|
||||||
|
2009-07-25 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||||
|
|
||||||
|
* po/LINGUAS, po/sl_SI.po, THANKS, src/about.c:
|
||||||
|
Added a first Slovenian translation. Thanks to Joze Klepec.
|
||||||
|
|
||||||
|
|
||||||
|
2009-07-24 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||||
|
|
||||||
|
* src/highlighting.c:
|
||||||
|
Use full styleset_foo[_init] function name as argument to
|
||||||
|
init_styleset_case() and styleset_case() macros so it's easier to
|
||||||
|
understand the code.
|
||||||
|
* src/keybindings.c, src/keybindings.h, src/sciwrappers.c,
|
||||||
|
src/sciwrappers.h, src/editor.c, src/editor.h, THANKS,
|
||||||
|
doc/geany.txt, doc/geany.html:
|
||||||
|
Add 'Reflow lines/paragraph' keybinding, defaults to Ctrl-J.
|
||||||
|
Heavily based on a patch by Eugene Arshinov (thanks).
|
||||||
|
Add sci_lines_split(), sci_lines_join(), sci_text_width(),
|
||||||
|
editor_strip_line_trailing_spaces().
|
||||||
|
|
||||||
|
|
||||||
|
2009-07-24 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||||
|
|
||||||
|
* src/editor.c:
|
||||||
|
Attempt to fix reshowing calltips after the autocompletion list
|
||||||
|
has been shown.
|
||||||
|
Reshow calltips also when the autocompletion list was closed
|
||||||
|
implicitly by not choosing an item.
|
||||||
|
|
||||||
2009-07-23 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
2009-07-23 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||||
|
|
||||||
* src/utils.c, src/utils.h, src/toolbar.c, src/plugindata.h,
|
* src/utils.c, src/utils.h, src/toolbar.c, src/plugindata.h,
|
||||||
|
4
HACKING
4
HACKING
@ -249,9 +249,9 @@ the following things:
|
|||||||
is created. Again you could copy and adapt a function like
|
is created. Again you could copy and adapt a function like
|
||||||
styleset_tcl().
|
styleset_tcl().
|
||||||
3. In highlighting_init_styles(), add
|
3. In highlighting_init_styles(), add
|
||||||
``init_styleset_case(GEANY_FILETYPES_FOO, foo);``.
|
``init_styleset_case(GEANY_FILETYPES_FOO, styleset_foo_init);``.
|
||||||
4. In highlighting_set_styles(), add
|
4. In highlighting_set_styles(), add
|
||||||
``styleset_case(GEANY_FILETYPES_FOO, foo);``.
|
``styleset_case(GEANY_FILETYPES_FOO, styleset_foo);``.
|
||||||
|
|
||||||
Error message parsing
|
Error message parsing
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
97
NEWS
97
NEWS
@ -1,3 +1,96 @@
|
|||||||
|
Geany 0.18 (August 16, 2009)
|
||||||
|
|
||||||
|
General:
|
||||||
|
* Fix scrolling horizontally after finding a search match with the
|
||||||
|
search bar or Find Next/Previous which is off-screen.
|
||||||
|
* Remove relative/untidy path elements from filenames when opening
|
||||||
|
documents (#2823998).
|
||||||
|
* Create initial template files with proper platform-specific line
|
||||||
|
ending characters.
|
||||||
|
* Improve inserting of comment templates like File header or licence
|
||||||
|
notices.
|
||||||
|
|
||||||
|
Interface:
|
||||||
|
* Add 'Show Paths' documents list popup item.
|
||||||
|
* Add filetypes.common to 'Configuration Files' menu.
|
||||||
|
* Implement a graphical toolbar editor.
|
||||||
|
* Add 'Build' toolbar button to the default layout.
|
||||||
|
* Add 'Replace' toolbar button (closes #2798225).
|
||||||
|
* Use a more Tango like icon for 'Save All' (by Jesse Mayes, thanks).
|
||||||
|
* Add a popup menu for the keybinding list in the preferences dialog
|
||||||
|
to easily expand and collapse all groups.
|
||||||
|
|
||||||
|
Keybindings:
|
||||||
|
* Implement Most-Recently-Used document switching when pressing
|
||||||
|
'Switch to last used document' keybinding (Ctrl-Tab).
|
||||||
|
* Add 'Mark All' keybinding (Ctrl-Shift-M).
|
||||||
|
* Add 'Reflow lines/block' keybinding, (Ctrl-J; thanks to
|
||||||
|
Eugene Arshinov).
|
||||||
|
* Make the Scintilla keybindings 'Delete to end of line' and
|
||||||
|
'Go to end of display line' configurable.
|
||||||
|
* Switching notebook tabs now works for the currently used notebook
|
||||||
|
widget instead of always using the documents notebook.
|
||||||
|
|
||||||
|
Editor:
|
||||||
|
* Fix a redraw when documents were first drawn uncolourised.
|
||||||
|
* Delay highlighting matching braces by 100ms to speed up scrolling
|
||||||
|
with the arrow keys.
|
||||||
|
* Support 'tab indents, space aligns' style when indenting (#2789109).
|
||||||
|
* Add 'Autocomplete all words in document' pref; also used when forcing
|
||||||
|
autocompletion and there's no symbol names to show.
|
||||||
|
* Add 'Drop rest of word on completion' pref.
|
||||||
|
* Update Scintilla to version 1.79.
|
||||||
|
* Improve displaying and reshowing of calltips.
|
||||||
|
|
||||||
|
Syntax highlighting:
|
||||||
|
* Reload color schemes via Tools menu (thanks to Eugene Arshinov).
|
||||||
|
* Implement named styles support for filetypes.* using a
|
||||||
|
filetypes.common [named_styles] section; used as
|
||||||
|
"style=named_style,bold". (See the manual for details).
|
||||||
|
* Allow style definitions with missing fields to use the
|
||||||
|
filetypes.common default style's fields.
|
||||||
|
* Make C-like filetype styles use named styles & default background
|
||||||
|
color. (Anyone who wants to likewise update any other filetype's
|
||||||
|
styles, please let us know ;-)).
|
||||||
|
* Allow indentation of wrapped lines (see style 'line_wrap_indent').
|
||||||
|
* Add new styles 'line_height' and 'marker_mark'.
|
||||||
|
|
||||||
|
Filetypes:
|
||||||
|
* Add Markdown filetype (thanks to Jon Strait).
|
||||||
|
* Highlight D WYSIWYG backtick `strings` and r"strings" (#1895745).
|
||||||
|
* Minor improvements for filetypes: Fortran, Haxe, HTML, Lua,
|
||||||
|
Matlab, Pascal, Python, Tcl
|
||||||
|
|
||||||
|
Tags:
|
||||||
|
* Read custom system global tags files from $prefix/share/geany/tags
|
||||||
|
(#2778923).
|
||||||
|
* Autocomplete scoped fields like struct members when typing '.' (and
|
||||||
|
also '->' or '::' in C/C++) if the language's tag parser supports it.
|
||||||
|
* Save field tags for C/C++ when generating a global tags file (you may
|
||||||
|
want to regenerate your tag files).
|
||||||
|
* Parse Python calltips.
|
||||||
|
* Show relative paths in Diff filename tags.
|
||||||
|
* Group reStructuredText symbol list items by scope level.
|
||||||
|
|
||||||
|
Plugin API:
|
||||||
|
* Add geanyplugin.h single include.
|
||||||
|
* Add plugin_signal_connect() for connecting plugin signals at
|
||||||
|
runtime and also for connecting to any GObject signal.
|
||||||
|
* Add documents_foreach(), filetypes[], documents[], utils_strdupa()
|
||||||
|
and various foreach_type() macros.
|
||||||
|
* Make GeanyDocument::file_type always be non-NULL.
|
||||||
|
|
||||||
|
Windows:
|
||||||
|
* Fix quoting the build command string on Windows (closes #2791769).
|
||||||
|
* Fix LaTeX view commands on Windows (part of #2807688).
|
||||||
|
* Expand system environment variables (%variableName%) on Windows when
|
||||||
|
running Build commands.
|
||||||
|
|
||||||
|
Internationalisation:
|
||||||
|
* Added translations: lb, sl, pt_PT
|
||||||
|
* Updated translations: ca, cs, de, en_GB, fi, fr, ja, pt_BR, ru, tr
|
||||||
|
|
||||||
|
|
||||||
Geany 0.17 (May 02, 2009)
|
Geany 0.17 (May 02, 2009)
|
||||||
|
|
||||||
Bug fixes:
|
Bug fixes:
|
||||||
@ -299,7 +392,7 @@ Geany 0.14 (April 19, 2008)
|
|||||||
* Add translucency settings to filetypes.common for semi-transparency.
|
* Add translucency settings to filetypes.common for semi-transparency.
|
||||||
* Add HTML parser to get h1, h2, h3 symbols as well as link anchors and
|
* Add HTML parser to get h1, h2, h3 symbols as well as link anchors and
|
||||||
JavaScript functions (fixes #1896068).
|
JavaScript functions (fixes #1896068).
|
||||||
* Update Javascript, TCL and Assembler parser.
|
* Update Javascript, Tcl and Assembler parser.
|
||||||
|
|
||||||
Interface:
|
Interface:
|
||||||
* When closing a tab when using left-to-right tabs, focus the next
|
* When closing a tab when using left-to-right tabs, focus the next
|
||||||
@ -613,7 +706,7 @@ Geany 0.11 (May 21, 2007)
|
|||||||
Tab.
|
Tab.
|
||||||
* Add MimeType associatiations for: C++ header, Pascal, Perl,
|
* Add MimeType associatiations for: C++ header, Pascal, Perl,
|
||||||
Python, httpd-PHP and XML files (thanks to Iñaki Rodriguez).
|
Python, httpd-PHP and XML files (thanks to Iñaki Rodriguez).
|
||||||
* Add brace indenting support for Perl and TCL.
|
* Add brace indenting support for Perl and Tcl.
|
||||||
* Make backspace unindent when using spaces for indentation.
|
* Make backspace unindent when using spaces for indentation.
|
||||||
* Wrap notebook pages when switching tabs.
|
* Wrap notebook pages when switching tabs.
|
||||||
* Speed up loading multiple C-like files slightly.
|
* Speed up loading multiple C-like files slightly.
|
||||||
|
4
THANKS
4
THANKS
@ -65,7 +65,8 @@ Chris Macksey <cmacksey(at)users(dot)sourceforge(dot)net> - ActionScript filetyp
|
|||||||
Simon Treny <simon(dot)treny(at)free(dot)fr> - Documents sidebar stock icons patch
|
Simon Treny <simon(dot)treny(at)free(dot)fr> - Documents sidebar stock icons patch
|
||||||
Elias Pschernig <elias(at)users(dot)sourceforge(dot)net> - Recent Projects menu patch
|
Elias Pschernig <elias(at)users(dot)sourceforge(dot)net> - Recent Projects menu patch
|
||||||
Jesse Mayes <plasmasheep(at)gmail(dot)com> - Tango'ish Save All icon
|
Jesse Mayes <plasmasheep(at)gmail(dot)com> - Tango'ish Save All icon
|
||||||
Eugene Arshinov <earshinov(at)gmail(dot)com> - Reload color schemes via menu patch
|
Eugene Arshinov <earshinov(at)gmail(dot)com> - Reload color schemes, split lines KB patches
|
||||||
|
Jon Strait <jstrait(at)moonloop(dot)net> - Markdown filetype patch
|
||||||
|
|
||||||
Translators:
|
Translators:
|
||||||
------------
|
------------
|
||||||
@ -107,6 +108,7 @@ Nikita E. Shalaev <nshalaev(at)eu(dot)spb(dot)ru> - ru_RU
|
|||||||
stat.c <Static-Const(at)yandex(dot)ru> - ru_RU
|
stat.c <Static-Const(at)yandex(dot)ru> - ru_RU
|
||||||
Andrew Drynov <adryno(at)gmail(dot)com> - ru_RU
|
Andrew Drynov <adryno(at)gmail(dot)com> - ru_RU
|
||||||
John Wehin <john(dot)wehin(at)gmail(dot)com> - ru_RU
|
John Wehin <john(dot)wehin(at)gmail(dot)com> - ru_RU
|
||||||
|
Jože Klepec <joze(dot)klepec(at)siol(dot)net> - sl_SI
|
||||||
Tony Mattsson <superxorn(at)gmail(dot)com> - sv
|
Tony Mattsson <superxorn(at)gmail(dot)com> - sv
|
||||||
Gürkan Gür <seqizz(at)gmail(dot)com - tr
|
Gürkan Gür <seqizz(at)gmail(dot)com - tr
|
||||||
Boris Dibrov <dibrov(dot)bor(at)gmail(dot)com> - uk
|
Boris Dibrov <dibrov(dot)bor(at)gmail(dot)com> - uk
|
||||||
|
@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
|
|||||||
dnl $Id$
|
dnl $Id$
|
||||||
|
|
||||||
AC_INIT(configure.in)
|
AC_INIT(configure.in)
|
||||||
AM_INIT_AUTOMAKE(geany, 0.18)
|
AM_INIT_AUTOMAKE(geany, 0.19)
|
||||||
|
|
||||||
AM_CONFIG_HEADER(config.h)
|
AM_CONFIG_HEADER(config.h)
|
||||||
|
|
||||||
|
53
data/filetypes.ada
Normal file
53
data/filetypes.ada
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
# For complete documentation of this file, please see Geany's main documentation
|
||||||
|
[styling]
|
||||||
|
# foreground;background;bold;italic
|
||||||
|
default=0x000000;0xffffff;false;false
|
||||||
|
word=0x00007f;0xffffff;true;false
|
||||||
|
identifier=0x000000;0xffffff;false;false
|
||||||
|
number=0x007f00;0xffffff;false;false
|
||||||
|
delimiter=0x301010;0xffffff;false;false
|
||||||
|
character=0xff901e;0xffffff;false;false
|
||||||
|
charactereol=0x000000;0xe0c0e0;false;false
|
||||||
|
string=0xff901e;0xffffff;false;false
|
||||||
|
stringeol=0x000000;0xe0c0e0;false;false
|
||||||
|
label=0xaaaaaa;0xffffff;false;true
|
||||||
|
commentline=0xd00000;0xffffff;false;false
|
||||||
|
illegal=0xff0000;0xffffff;false;true
|
||||||
|
|
||||||
|
[keywords]
|
||||||
|
# all items must be in one line
|
||||||
|
primary=abort abs abstract accept access aliased all and array at begin body case constant declare delay delta digits do else elsif end entry exception exit for function generic goto if in interface is limited loop mod new not null of or others out overriding package pragma private procedure protected raise range record rem renames requeue return reverse select separate subtype synchronized tagged task terminate then type until use when while with xor
|
||||||
|
|
||||||
|
|
||||||
|
[settings]
|
||||||
|
# default extension used when saving files
|
||||||
|
#extension=adb
|
||||||
|
|
||||||
|
# the following characters are these which a "word" can contains, see documentation
|
||||||
|
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
|
||||||
|
|
||||||
|
# if only single comment char is supported like # in this file, leave comment_close blank
|
||||||
|
comment_open=#
|
||||||
|
comment_close=
|
||||||
|
|
||||||
|
# set to false if a comment character/string should start at column 0 of a line, true uses any
|
||||||
|
# indentation of the line, e.g. setting to true causes the following on pressing CTRL+d
|
||||||
|
#command_example();
|
||||||
|
# setting to false would generate this
|
||||||
|
# command_example();
|
||||||
|
# This setting works only for single line comments
|
||||||
|
comment_use_indent=true
|
||||||
|
|
||||||
|
# context action command (please see Geany's main documentation for details)
|
||||||
|
context_action_cmd=
|
||||||
|
|
||||||
|
|
||||||
|
[build_settings]
|
||||||
|
# %f will be replaced by the complete filename
|
||||||
|
# %e will be replaced by the filename without extension
|
||||||
|
# (use only one of it at one time)
|
||||||
|
compiler=gcc -Wall -c "%f"
|
||||||
|
linker=gnatmake "%e"
|
||||||
|
run_cmd="./%e"
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
.TH "GEANY" "1" "May 02, 2009" "geany @VERSION@" ""
|
.TH "GEANY" "1" "August 16, 2009" "geany @VERSION@" ""
|
||||||
.SH "NAME"
|
.SH "NAME"
|
||||||
Geany \(em a small and lightweight IDE
|
Geany \(em a small and lightweight IDE
|
||||||
.SH "SYNOPSIS"
|
.SH "SYNOPSIS"
|
||||||
|
2009
doc/geany.html
2009
doc/geany.html
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
|||||||
.. |(version)| replace:: 0.18
|
.. |(version)| replace:: 0.19
|
||||||
|
|
||||||
=======
|
=======
|
||||||
Geany
|
Geany
|
||||||
@ -834,6 +834,38 @@ the word "echo", a browser window will open(assumed your browser is
|
|||||||
called firefox) and it will open the address: http://www.php.net/echo.
|
called firefox) and it will open the address: http://www.php.net/echo.
|
||||||
|
|
||||||
|
|
||||||
|
Autocompletion
|
||||||
|
^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Geany can offer a list of possible completions for symbols defined in the
|
||||||
|
tags and for all words in a document.
|
||||||
|
|
||||||
|
The autocompletion list for symbols is presented when the first few
|
||||||
|
characters of the symbol are typed (configurable, see `Editor Completions
|
||||||
|
tab in preferences dialog`_, default 4) or when the *Complete word*
|
||||||
|
keybinding is pressed (configurable, see `Configurable keybindings`_,
|
||||||
|
default Ctrl-Space).
|
||||||
|
|
||||||
|
When the defined keybinding is typed and the *Autocomplete all words in
|
||||||
|
document* preference (in `Editor Completions tab in preferences dialog`_)
|
||||||
|
is selected then the autocompletion list will show all matching words
|
||||||
|
in the document, if there are no matching symbols.
|
||||||
|
|
||||||
|
If you don't want to use autocompletion it can be dismissed until
|
||||||
|
the next symbol by typing Escape. The autocompletion list is updated
|
||||||
|
as more characters are typed so that it only shows completions that start
|
||||||
|
with the characters typed so far. If no symbols begin with the sequence,
|
||||||
|
the autocompletion window is closed.
|
||||||
|
|
||||||
|
The up and down arrows will move the selected item. The highlighted
|
||||||
|
item on the autocompletion list can be chosen from the list by Tab or
|
||||||
|
Enter/Return. You can also double-click to select an item. The sequence
|
||||||
|
will be completed to match the chosen item, and if the *Drop rest of
|
||||||
|
word on completion* preference is set (in `Editor Completions tab in
|
||||||
|
preferences dialog`_) then any characters after the cursor that match
|
||||||
|
a symbol or word are deleted.
|
||||||
|
|
||||||
|
|
||||||
User-definable snippets
|
User-definable snippets
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
@ -2855,6 +2887,9 @@ Send Selection to Terminal Sends the current sele
|
|||||||
line (if there is no selection) to the
|
line (if there is no selection) to the
|
||||||
embedded Terminal (VTE).
|
embedded Terminal (VTE).
|
||||||
|
|
||||||
|
Reflow lines/paragraph Reformat selected lines or current paragraph,
|
||||||
|
breaking lines at the long line marker.
|
||||||
|
|
||||||
|
|
||||||
**Settings**
|
**Settings**
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 26 KiB |
Binary file not shown.
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 19 KiB |
@ -37,14 +37,15 @@
|
|||||||
* @section Intro
|
* @section Intro
|
||||||
* This is the Geany API documentation. It is far from being complete and should be
|
* This is the Geany API documentation. It is far from being complete and should be
|
||||||
* considered as a work in progress.
|
* considered as a work in progress.
|
||||||
* We will try to %document as many functions and structs as possible.
|
* We will try to document as many functions and structs as possible.
|
||||||
*
|
*
|
||||||
* To get started, see the @link howto Plugin Howto @endlink.
|
* To get started, see the @link howto Plugin Howto @endlink.
|
||||||
*
|
*
|
||||||
* Other pages:
|
* Other pages:
|
||||||
* - @link plugindata.h Main Datatypes and Macros @endlink
|
|
||||||
* - @link pluginsymbols.c Plugin Symbols @endlink
|
* - @link pluginsymbols.c Plugin Symbols @endlink
|
||||||
|
* - @link plugindata.h Main Datatypes and Macros @endlink
|
||||||
* - @link signals Plugin Signals @endlink
|
* - @link signals Plugin Signals @endlink
|
||||||
|
* - @link pluginutils.c Plugin Utility Functions @endlink
|
||||||
* - @link guidelines Plugin Writing Guidelines @endlink
|
* - @link guidelines Plugin Writing Guidelines @endlink
|
||||||
*
|
*
|
||||||
* @note Some of these pages are also listed in Related Pages.
|
* @note Some of these pages are also listed in Related Pages.
|
||||||
@ -56,10 +57,13 @@
|
|||||||
*
|
*
|
||||||
* @section Usage
|
* @section Usage
|
||||||
*
|
*
|
||||||
* To use plugin signals in Geany, you simply create a PluginCallback array, list the signals
|
* To use plugin signals in Geany, you have two options:
|
||||||
|
*
|
||||||
|
* -# Create a PluginCallback array with the @ref plugin_callbacks symbol. List the signals
|
||||||
* you want to listen to and create the appropiate signal callbacks for each signal.
|
* you want to listen to and create the appropiate signal callbacks for each signal.
|
||||||
* The callback array is read @a after plugin_init() has been called.
|
* The callback array is read @a after plugin_init() has been called.
|
||||||
* @note The PluginCallback array has to be ended with a final NULL entry.
|
* -# Use plugin_signal_connect(), which can be called at any time and can also connect
|
||||||
|
* to non-Geany signals (such as GTK widget signals).
|
||||||
*
|
*
|
||||||
* The following code demonstrates how to use signals in Geany plugins. The code can be inserted
|
* The following code demonstrates how to use signals in Geany plugins. The code can be inserted
|
||||||
* in your plugin code at any desired position.
|
* in your plugin code at any desired position.
|
||||||
@ -76,6 +80,7 @@ PluginCallback plugin_callbacks[] =
|
|||||||
{ NULL, NULL, FALSE, NULL }
|
{ NULL, NULL, FALSE, NULL }
|
||||||
};
|
};
|
||||||
* @endcode
|
* @endcode
|
||||||
|
* @note The PluginCallback array has to be ended with a final @c NULL entry.
|
||||||
*
|
*
|
||||||
* @section Signals
|
* @section Signals
|
||||||
*
|
*
|
||||||
@ -84,7 +89,7 @@ PluginCallback plugin_callbacks[] =
|
|||||||
* void user_function(GObject *obj, GeanyDocument *doc, gpointer user_data);
|
* void user_function(GObject *obj, GeanyDocument *doc, gpointer user_data);
|
||||||
* @endsignalproto
|
* @endsignalproto
|
||||||
* @signaldesc
|
* @signaldesc
|
||||||
* Sent when a new %document is created.
|
* Sent when a new document is created.
|
||||||
*
|
*
|
||||||
* You need to include "document.h" for the declaration of GeanyDocument.
|
* You need to include "document.h" for the declaration of GeanyDocument.
|
||||||
*
|
*
|
||||||
@ -98,7 +103,7 @@ PluginCallback plugin_callbacks[] =
|
|||||||
* void user_function(GObject *obj, GeanyDocument *doc, gpointer user_data);
|
* void user_function(GObject *obj, GeanyDocument *doc, gpointer user_data);
|
||||||
* @endsignalproto
|
* @endsignalproto
|
||||||
* @signaldesc
|
* @signaldesc
|
||||||
* Sent when a new %document is opened.
|
* Sent when a new document is opened.
|
||||||
*
|
*
|
||||||
* You need to include "document.h" for the declaration of GeanyDocument.
|
* You need to include "document.h" for the declaration of GeanyDocument.
|
||||||
*
|
*
|
||||||
@ -112,7 +117,7 @@ PluginCallback plugin_callbacks[] =
|
|||||||
* void user_function(GObject *obj, GeanyDocument *doc, gpointer user_data);
|
* void user_function(GObject *obj, GeanyDocument *doc, gpointer user_data);
|
||||||
* @endsignalproto
|
* @endsignalproto
|
||||||
* @signaldesc
|
* @signaldesc
|
||||||
* Sent when a new %document is saved.
|
* Sent when a new document is saved.
|
||||||
*
|
*
|
||||||
* You need to include "document.h" for the declaration of GeanyDocument.
|
* You need to include "document.h" for the declaration of GeanyDocument.
|
||||||
*
|
*
|
||||||
@ -328,7 +333,7 @@ PluginCallback plugin_callbacks[] =
|
|||||||
* @section intro Introduction
|
* @section intro Introduction
|
||||||
*
|
*
|
||||||
* Since Geany 0.12 there is a plugin interface to extend Geany's functionality and
|
* Since Geany 0.12 there is a plugin interface to extend Geany's functionality and
|
||||||
* add new features. This %document gives a brief overview about how to add new
|
* add new features. This document gives a brief overview about how to add new
|
||||||
* plugins by writing a simple "Hello World" plugin in C.
|
* plugins by writing a simple "Hello World" plugin in C.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
@ -66,7 +66,8 @@ const GeanyFunctions *geany_functions;
|
|||||||
PluginFields *plugin_fields;
|
PluginFields *plugin_fields;
|
||||||
|
|
||||||
/** An array for connecting GeanyObject events, which should be terminated with
|
/** An array for connecting GeanyObject events, which should be terminated with
|
||||||
* @c {NULL, NULL, FALSE, NULL}. See @link signals Signal documentation @endlink. */
|
* @c {NULL, NULL, FALSE, NULL}. See @link signals Signal documentation @endlink.
|
||||||
|
* @see plugin_signal_connect(). */
|
||||||
PluginCallback plugin_callbacks[];
|
PluginCallback plugin_callbacks[];
|
||||||
|
|
||||||
/** Most plugins should use the PLUGIN_KEY_GROUP() macro to define it. However,
|
/** Most plugins should use the PLUGIN_KEY_GROUP() macro to define it. However,
|
||||||
|
@ -33,8 +33,8 @@ RequestExecutionLevel user ; set execution level for Windows Vista
|
|||||||
; helper defines ;
|
; helper defines ;
|
||||||
;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;
|
||||||
!define PRODUCT_NAME "Geany"
|
!define PRODUCT_NAME "Geany"
|
||||||
!define PRODUCT_VERSION "0.18"
|
!define PRODUCT_VERSION "0.19"
|
||||||
!define PRODUCT_VERSION_ID "0.18.0.0"
|
!define PRODUCT_VERSION_ID "0.19.0.0"
|
||||||
!define PRODUCT_PUBLISHER "The Geany developer team"
|
!define PRODUCT_PUBLISHER "The Geany developer team"
|
||||||
!define PRODUCT_WEB_SITE "http://www.geany.org/"
|
!define PRODUCT_WEB_SITE "http://www.geany.org/"
|
||||||
!define PRODUCT_DIR_REGKEY "Software\Geany"
|
!define PRODUCT_DIR_REGKEY "Software\Geany"
|
||||||
@ -54,7 +54,7 @@ VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}"
|
|||||||
VIAddVersionKey "LegalCopyright" "Copyright 2005-2009 by the Geany developer team"
|
VIAddVersionKey "LegalCopyright" "Copyright 2005-2009 by the Geany developer team"
|
||||||
VIAddVersionKey "FileDescription" "${PRODUCT_NAME} Installer"
|
VIAddVersionKey "FileDescription" "${PRODUCT_NAME} Installer"
|
||||||
|
|
||||||
BrandingText "$(^NAME) installer (NSIS 2.44)"
|
BrandingText "$(^NAME) installer (NSIS 2.45)"
|
||||||
InstallDir "$PROGRAMFILES\Geany"
|
InstallDir "$PROGRAMFILES\Geany"
|
||||||
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
||||||
SetCompressor /SOLID lzma
|
SetCompressor /SOLID lzma
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "../icons/geany.ico"
|
A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "../icons/geany.ico"
|
||||||
|
|
||||||
1 VERSIONINFO
|
1 VERSIONINFO
|
||||||
FILEVERSION 0,18,0,0
|
FILEVERSION 0,19,0,0
|
||||||
PRODUCTVERSION 0,18,0,0
|
PRODUCTVERSION 0,19,0,0
|
||||||
FILETYPE VFT_APP
|
FILETYPE VFT_APP
|
||||||
{
|
{
|
||||||
BLOCK "StringFileInfo"
|
BLOCK "StringFileInfo"
|
||||||
@ -14,14 +14,14 @@ FILETYPE VFT_APP
|
|||||||
BLOCK "040704E4"
|
BLOCK "040704E4"
|
||||||
{
|
{
|
||||||
VALUE "CompanyName", ""
|
VALUE "CompanyName", ""
|
||||||
VALUE "FileVersion", "0.18"
|
VALUE "FileVersion", "0.19"
|
||||||
VALUE "FileDescription", "Geany"
|
VALUE "FileDescription", "Geany"
|
||||||
VALUE "InternalName", "geany"
|
VALUE "InternalName", "geany"
|
||||||
VALUE "LegalCopyright", "Copyright 2005-2009 by the Geany developers"
|
VALUE "LegalCopyright", "Copyright 2005-2009 by the Geany developers"
|
||||||
VALUE "LegalTrademarks", ""
|
VALUE "LegalTrademarks", ""
|
||||||
VALUE "OriginalFilename", "geany"
|
VALUE "OriginalFilename", "geany"
|
||||||
VALUE "ProductName", "geany"
|
VALUE "ProductName", "geany"
|
||||||
VALUE "ProductVersion", "0.18"
|
VALUE "ProductVersion", "0.19"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include <gdk/gdkkeysyms.h>
|
#include <gdk/gdkkeysyms.h>
|
||||||
|
|
||||||
|
|
||||||
|
GeanyPlugin *geany_plugin;
|
||||||
GeanyData *geany_data;
|
GeanyData *geany_data;
|
||||||
GeanyFunctions *geany_functions;
|
GeanyFunctions *geany_functions;
|
||||||
|
|
||||||
@ -87,12 +88,10 @@ static struct
|
|||||||
} popup_items;
|
} popup_items;
|
||||||
|
|
||||||
|
|
||||||
static void document_activate_cb(GObject *obj, GeanyDocument *doc, gpointer data);
|
|
||||||
static void project_change_cb(GObject *obj, GKeyFile *config, gpointer data);
|
static void project_change_cb(GObject *obj, GKeyFile *config, gpointer data);
|
||||||
|
|
||||||
PluginCallback plugin_callbacks[] =
|
PluginCallback plugin_callbacks[] =
|
||||||
{
|
{
|
||||||
{ "document-activate", (GCallback) &document_activate_cb, TRUE, NULL },
|
|
||||||
{ "project-open", (GCallback) &project_change_cb, TRUE, NULL },
|
{ "project-open", (GCallback) &project_change_cb, TRUE, NULL },
|
||||||
{ "project-save", (GCallback) &project_change_cb, TRUE, NULL },
|
{ "project-save", (GCallback) &project_change_cb, TRUE, NULL },
|
||||||
{ NULL, NULL, FALSE, NULL }
|
{ NULL, NULL, FALSE, NULL }
|
||||||
@ -1020,6 +1019,9 @@ void plugin_init(GeanyData *data)
|
|||||||
0, 0, "focus_file_list", _("Focus File List"), NULL);
|
0, 0, "focus_file_list", _("Focus File List"), NULL);
|
||||||
keybindings_set_item(plugin_key_group, KB_FOCUS_PATH_ENTRY, kb_activate,
|
keybindings_set_item(plugin_key_group, KB_FOCUS_PATH_ENTRY, kb_activate,
|
||||||
0, 0, "focus_path_entry", _("Focus Path Entry"), NULL);
|
0, 0, "focus_path_entry", _("Focus Path Entry"), NULL);
|
||||||
|
|
||||||
|
plugin_signal_connect(geany_plugin, NULL, "document-activate", TRUE,
|
||||||
|
(GCallback) &document_activate_cb, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
geany_functions->p_plugin->add_toolbar_item
|
geany_functions->p_plugin->add_toolbar_item
|
||||||
#define plugin_module_make_resident \
|
#define plugin_module_make_resident \
|
||||||
geany_functions->p_plugin->module_make_resident
|
geany_functions->p_plugin->module_make_resident
|
||||||
|
#define plugin_signal_connect \
|
||||||
|
geany_functions->p_plugin->signal_connect
|
||||||
#define document_new_file \
|
#define document_new_file \
|
||||||
geany_functions->p_document->new_file
|
geany_functions->p_document->new_file
|
||||||
#define document_get_current \
|
#define document_get_current \
|
||||||
|
92
po/ChangeLog
92
po/ChangeLog
@ -1,4 +1,94 @@
|
|||||||
2009-07-24 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
2009-08-16 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||||
|
|
||||||
|
* de.po:
|
||||||
|
Several improvements of the German translation by
|
||||||
|
Dominic Hopf, thanks.
|
||||||
|
* *.po, geany.pot:
|
||||||
|
Regenerate message catalog template.
|
||||||
|
Remove a fuzzy mark from all translations.
|
||||||
|
|
||||||
|
|
||||||
|
2009-08-13 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||||
|
|
||||||
|
* fi.po: Update of Finnish translation. Thanks to Jari Rahkonen and
|
||||||
|
Harri Koskinen.
|
||||||
|
|
||||||
|
|
||||||
|
2009-08-13 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||||
|
|
||||||
|
* ca.po: Update of Catalan translation (Thanks to Toni Garcia-Navarro)
|
||||||
|
|
||||||
|
|
||||||
|
2009-08-12 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||||
|
|
||||||
|
* pt_PT.po, LINGUAS:
|
||||||
|
Added a first Portugese (Portugal) translation based on work done at
|
||||||
|
launchpad by e.g. André Glória and Alexandre Jesus.
|
||||||
|
|
||||||
|
|
||||||
|
2009-08-11 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||||
|
|
||||||
|
* fr.po: Update of French translation (Thanks Jean-Philippe Moal).
|
||||||
|
* sl.po: Update of Slovenian translation. Thanks to Joze Klepec.
|
||||||
|
|
||||||
|
|
||||||
|
2009-08-08 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||||
|
|
||||||
|
* de.po: Update of German translation.
|
||||||
|
|
||||||
|
|
||||||
|
2009-08-07 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||||
|
|
||||||
|
* tr.po: Update of Turkish translation. Thanks to Gürkan Gür.
|
||||||
|
|
||||||
|
|
||||||
|
2009-08-05 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||||
|
|
||||||
|
* ru.po: Update of Russian translation. Thanks to John Wehin.
|
||||||
|
* sl.po: Update of Slovenian translation. Thanks to Joze Klepec.
|
||||||
|
|
||||||
|
|
||||||
|
2009-08-05 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||||
|
|
||||||
|
* cs.po: Update of Czech translation. Thanks to Karel Kolman for
|
||||||
|
providing.
|
||||||
|
* ja.po: Update of Japanese translation. Thanks to Chikahiro Masami.
|
||||||
|
|
||||||
|
|
||||||
|
2009-08-04 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||||
|
|
||||||
|
* pt_BR.po: Update of Brasilian Portuguese translation
|
||||||
|
(Thanks to Adrovane Marques Kade).
|
||||||
|
|
||||||
|
|
||||||
|
2009-08-03 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||||
|
|
||||||
|
* en_GB.po: Update British English translation (Thanks to Jeff Bailes)
|
||||||
|
|
||||||
|
|
||||||
|
2009-08-02 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||||
|
|
||||||
|
* sl_SI.po: Update of Slovenian translation. Thanks to Joze Klepec.
|
||||||
|
* sl.po: Rename Slovenian translation file.
|
||||||
|
|
||||||
|
|
||||||
|
2009-08-01 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||||
|
|
||||||
|
* *.po: Update for upcoming string freeze of Geany 0.18
|
||||||
|
|
||||||
|
|
||||||
|
2009-07-27 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||||
|
|
||||||
|
* sl_SI.po: Update of Slovenian translation. Thanks to Joze Klepec.
|
||||||
|
|
||||||
|
|
||||||
|
2009-07-25 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||||
|
|
||||||
|
* sl_SI.po: Added a first Slovenian translation.
|
||||||
|
Thanks to Joze Klepec.
|
||||||
|
|
||||||
|
|
||||||
|
2009-07-24 Frank Lanitz
|
||||||
|
|
||||||
* de.po: Minor update of German translation.
|
* de.po: Minor update of German translation.
|
||||||
|
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
# set of available languages (in alphabetic order)
|
# set of available languages (in alphabetic order)
|
||||||
be bg ca cs de el en_GB es fi fr hu it ja ko lb nl pl pt_BR ro ru sv tr uk vi zh_CN zh_TW
|
be bg ca cs de el en_GB es fi fr hu it ja ko lb nl pl pt_BR pt_PT ro ru sl sv tr uk vi zh_CN zh_TW
|
||||||
|
2322
po/en_GB.po
2322
po/en_GB.po
File diff suppressed because it is too large
Load Diff
2167
po/geany.pot
2167
po/geany.pot
File diff suppressed because it is too large
Load Diff
3522
po/pt_BR.po
3522
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
5159
po/pt_PT.po
Normal file
5159
po/pt_PT.po
Normal file
File diff suppressed because it is too large
Load Diff
2220
po/zh_CN.po
2220
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
2176
po/zh_TW.po
2176
po/zh_TW.po
File diff suppressed because it is too large
Load Diff
@ -158,6 +158,7 @@ int Scintilla_LinkLexers() {
|
|||||||
LINK_LEXER(lmLatex);
|
LINK_LEXER(lmLatex);
|
||||||
LINK_LEXER(lmLua);
|
LINK_LEXER(lmLua);
|
||||||
LINK_LEXER(lmMake);
|
LINK_LEXER(lmMake);
|
||||||
|
LINK_LEXER(lmMarkdown);
|
||||||
LINK_LEXER(lmMatlab);
|
LINK_LEXER(lmMatlab);
|
||||||
LINK_LEXER(lmNsis);
|
LINK_LEXER(lmNsis);
|
||||||
LINK_LEXER(lmNull);
|
LINK_LEXER(lmNull);
|
||||||
|
433
scintilla/LexMarkdown.cxx
Normal file
433
scintilla/LexMarkdown.cxx
Normal file
@ -0,0 +1,433 @@
|
|||||||
|
/******************************************************************
|
||||||
|
* LexMarkdown.cxx
|
||||||
|
*
|
||||||
|
* A simple Markdown lexer for scintilla.
|
||||||
|
*
|
||||||
|
* Includes highlighting for some extra features from the
|
||||||
|
* Pandoc implementation; strikeout, using '#.' as a default
|
||||||
|
* ordered list item marker, and delimited code blocks.
|
||||||
|
*
|
||||||
|
* Limitations:
|
||||||
|
*
|
||||||
|
* Standard indented code blocks are not highlighted at all,
|
||||||
|
* as it would conflict with other indentation schemes. Use
|
||||||
|
* delimited code blocks for blanket highlighting of an
|
||||||
|
* entire code block. Embedded HTML is not highlighted either.
|
||||||
|
* Blanket HTML highlighting has issues, because some Markdown
|
||||||
|
* implementations allow Markdown markup inside of the HTML. Also,
|
||||||
|
* there is a following blank line issue that can't be ignored,
|
||||||
|
* explained in the next paragraph. Embedded HTML and code
|
||||||
|
* blocks would be better supported with language specific
|
||||||
|
* highlighting; something Scintilla isn't really architected
|
||||||
|
* to support yet.
|
||||||
|
*
|
||||||
|
* The highlighting aims to accurately reflect correct syntax,
|
||||||
|
* but a few restrictions are relaxed. Delimited code blocks are
|
||||||
|
* highlighted, even if the line following the code block is not blank.
|
||||||
|
* Requiring a blank line after a block, breaks the highlighting
|
||||||
|
* in certain cases, because of the way Scintilla ends up calling
|
||||||
|
* the lexer.
|
||||||
|
*
|
||||||
|
* Written by Jon Strait - jstrait@moonloop.net
|
||||||
|
*
|
||||||
|
* This source code is released for free distribution under the
|
||||||
|
* terms of the GNU General Public License.
|
||||||
|
*
|
||||||
|
*****************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
#include "Platform.h"
|
||||||
|
|
||||||
|
#include "PropSet.h"
|
||||||
|
#include "Accessor.h"
|
||||||
|
#include "StyleContext.h"
|
||||||
|
#include "KeyWords.h"
|
||||||
|
#include "Scintilla.h"
|
||||||
|
#include "SciLexer.h"
|
||||||
|
|
||||||
|
#ifdef SCI_NAMESPACE
|
||||||
|
using namespace Scintilla;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static inline bool IsNewline(const int ch) {
|
||||||
|
return (ch == '\n' || ch == '\r');
|
||||||
|
}
|
||||||
|
|
||||||
|
// True if can follow ch down to the end with possibly trailing whitespace
|
||||||
|
static bool FollowToLineEnd(const int ch, const int state, const int endPos, StyleContext &sc) {
|
||||||
|
int i = 0;
|
||||||
|
while (sc.GetRelative(++i) == ch)
|
||||||
|
;
|
||||||
|
// Skip over whitespace
|
||||||
|
while (IsASpaceOrTab(sc.GetRelative(i)) && sc.currentPos + i < endPos)
|
||||||
|
++i;
|
||||||
|
if (IsNewline(sc.GetRelative(i)) || sc.currentPos + i == endPos) {
|
||||||
|
sc.Forward(i);
|
||||||
|
sc.ChangeState(state);
|
||||||
|
sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the state on text section from current to length characters,
|
||||||
|
// then set the rest until the newline to default, except for any characters matching token
|
||||||
|
static void SetStateAndZoom(const int state, const int length, const int token, StyleContext &sc) {
|
||||||
|
int i = 0;
|
||||||
|
sc.SetState(state);
|
||||||
|
sc.Forward(length);
|
||||||
|
sc.SetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
sc.Forward();
|
||||||
|
while (sc.More() && !IsNewline(sc.ch)) {
|
||||||
|
bool started = false;
|
||||||
|
if (sc.ch == token && !started) {
|
||||||
|
sc.SetState(state);
|
||||||
|
started = true;
|
||||||
|
}
|
||||||
|
else if (sc.ch != token) {
|
||||||
|
sc.SetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
started = false;
|
||||||
|
}
|
||||||
|
sc.Forward();
|
||||||
|
}
|
||||||
|
sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Does the previous line have more than spaces and tabs?
|
||||||
|
static bool HasPrevLineContent(StyleContext &sc) {
|
||||||
|
int i = 0;
|
||||||
|
// Go back to the previous newline
|
||||||
|
while ((--i + sc.currentPos) && !IsNewline(sc.GetRelative(i)))
|
||||||
|
;
|
||||||
|
while (--i + sc.currentPos) {
|
||||||
|
if (IsNewline(sc.GetRelative(i)))
|
||||||
|
break;
|
||||||
|
if (!IsASpaceOrTab(sc.GetRelative(i)))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool IsValidHrule(const int endPos, StyleContext &sc) {
|
||||||
|
int c, i = 0, count = 1;
|
||||||
|
while (++i) {
|
||||||
|
c = sc.GetRelative(i);
|
||||||
|
if (c == sc.ch)
|
||||||
|
++count;
|
||||||
|
// hit a terminating character
|
||||||
|
else if (!IsASpaceOrTab(c) || sc.currentPos + i == endPos) {
|
||||||
|
// Are we a valid HRULE
|
||||||
|
if ((IsNewline(c) || sc.currentPos + i == endPos) &&
|
||||||
|
count >= 3 && !HasPrevLineContent(sc)) {
|
||||||
|
sc.SetState(SCE_MARKDOWN_HRULE);
|
||||||
|
sc.Forward(i);
|
||||||
|
sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sc.SetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Only consume if already valid. Doesn't work for delimiting multiple lines.
|
||||||
|
static void ConsumeEnd(const int state, const int origPos, const int endPos,
|
||||||
|
const char *token, StyleContext &sc) {
|
||||||
|
int targetPos;
|
||||||
|
while (sc.currentPos + 1 < endPos) {
|
||||||
|
sc.Forward();
|
||||||
|
if (sc.Match(token) && sc.chPrev != '\\' && sc.chPrev != ' ') {
|
||||||
|
targetPos = sc.currentPos + strlen(token);
|
||||||
|
sc.currentPos = origPos;
|
||||||
|
sc.SetState(state);
|
||||||
|
sc.Forward(targetPos - origPos);
|
||||||
|
sc.SetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ColorizeMarkdownDoc(unsigned int startPos, int length, int initStyle,
|
||||||
|
WordList *keywordlists[], Accessor &styler) {
|
||||||
|
|
||||||
|
int digitCount = 0;
|
||||||
|
int endPos = startPos + length;
|
||||||
|
int precharCount;
|
||||||
|
// Don't advance on a new loop iteration and retry at the same position.
|
||||||
|
// Useful in the corner case of having to start at the beginning file position
|
||||||
|
// in the default state.
|
||||||
|
bool freezeCursor = false;
|
||||||
|
|
||||||
|
StyleContext sc(startPos, length, initStyle, styler);
|
||||||
|
|
||||||
|
while (sc.More()) {
|
||||||
|
// Skip past escaped characters
|
||||||
|
if (sc.ch == '\\') {
|
||||||
|
sc.Forward();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// A blockquotes resets the line semantics
|
||||||
|
if (sc.state == SCE_MARKDOWN_BLOCKQUOTE)
|
||||||
|
sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
|
||||||
|
|
||||||
|
// Conditional state-based actions
|
||||||
|
if (sc.state == SCE_MARKDOWN_CODE2) {
|
||||||
|
if (sc.Match("``") && sc.GetRelative(-2) != ' ') {
|
||||||
|
sc.Forward(2);
|
||||||
|
sc.SetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (sc.state == SCE_MARKDOWN_CODE) {
|
||||||
|
if (sc.ch == '`' && sc.chPrev != ' ')
|
||||||
|
sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
}
|
||||||
|
/* De-activated because it gets in the way of other valid indentation
|
||||||
|
* schemes, for example multiple paragraphs inside a list item.
|
||||||
|
// Code block
|
||||||
|
else if (sc.state == SCE_MARKDOWN_CODEBK) {
|
||||||
|
bool d = true;
|
||||||
|
if (IsNewline(sc.ch)) {
|
||||||
|
if (sc.chNext != '\t') {
|
||||||
|
for (int c = 1; c < 5; ++c) {
|
||||||
|
if (sc.GetRelative(c) != ' ')
|
||||||
|
d = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (sc.atLineStart) {
|
||||||
|
if (sc.ch != '\t' ) {
|
||||||
|
for (int i = 0; i < 4; ++i) {
|
||||||
|
if (sc.GetRelative(i) != ' ')
|
||||||
|
d = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!d)
|
||||||
|
sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
// Strong
|
||||||
|
else if (sc.state == SCE_MARKDOWN_STRONG1) {
|
||||||
|
if (sc.Match("**") && sc.chPrev != ' ') {
|
||||||
|
sc.Forward(2);
|
||||||
|
sc.SetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (sc.state == SCE_MARKDOWN_STRONG2) {
|
||||||
|
if (sc.Match("__") && sc.chPrev != ' ') {
|
||||||
|
sc.Forward(2);
|
||||||
|
sc.SetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Emphasis
|
||||||
|
else if (sc.state == SCE_MARKDOWN_EM1) {
|
||||||
|
if (sc.ch == '*' && sc.chPrev != ' ')
|
||||||
|
sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
}
|
||||||
|
else if (sc.state == SCE_MARKDOWN_EM2) {
|
||||||
|
if (sc.ch == '_' && sc.chPrev != ' ')
|
||||||
|
sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
}
|
||||||
|
else if (sc.state == SCE_MARKDOWN_CODEBK) {
|
||||||
|
if (sc.atLineStart && sc.Match("~~~")) {
|
||||||
|
int i = 1;
|
||||||
|
while (!IsNewline(sc.GetRelative(i)) && sc.currentPos + i < endPos)
|
||||||
|
i++;
|
||||||
|
sc.Forward(i);
|
||||||
|
sc.SetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (sc.state == SCE_MARKDOWN_STRIKEOUT) {
|
||||||
|
if (sc.Match("~~") && sc.chPrev != ' ') {
|
||||||
|
sc.Forward(2);
|
||||||
|
sc.SetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (sc.state == SCE_MARKDOWN_LINE_BEGIN) {
|
||||||
|
// Header
|
||||||
|
if (sc.Match("######"))
|
||||||
|
SetStateAndZoom(SCE_MARKDOWN_HEADER6, 6, '#', sc);
|
||||||
|
else if (sc.Match("#####"))
|
||||||
|
SetStateAndZoom(SCE_MARKDOWN_HEADER5, 5, '#', sc);
|
||||||
|
else if (sc.Match("####"))
|
||||||
|
SetStateAndZoom(SCE_MARKDOWN_HEADER4, 4, '#', sc);
|
||||||
|
else if (sc.Match("###"))
|
||||||
|
SetStateAndZoom(SCE_MARKDOWN_HEADER3, 3, '#', sc);
|
||||||
|
else if (sc.Match("##"))
|
||||||
|
SetStateAndZoom(SCE_MARKDOWN_HEADER2, 2, '#', sc);
|
||||||
|
else if (sc.Match("#")) {
|
||||||
|
// Catch the special case of an unordered list
|
||||||
|
if (sc.chNext == '.' && IsASpaceOrTab(sc.GetRelative(2))) {
|
||||||
|
precharCount = 0;
|
||||||
|
sc.SetState(SCE_MARKDOWN_PRECHAR);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
SetStateAndZoom(SCE_MARKDOWN_HEADER1, 1, '#', sc);
|
||||||
|
}
|
||||||
|
// Code block
|
||||||
|
else if (sc.Match("~~~")) {
|
||||||
|
if (!HasPrevLineContent(sc))
|
||||||
|
sc.SetState(SCE_MARKDOWN_CODEBK);
|
||||||
|
else
|
||||||
|
sc.SetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
}
|
||||||
|
else if (sc.ch == '=') {
|
||||||
|
if (HasPrevLineContent(sc) && FollowToLineEnd('=', SCE_MARKDOWN_HEADER1, endPos, sc))
|
||||||
|
;
|
||||||
|
else
|
||||||
|
sc.SetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
}
|
||||||
|
else if (sc.ch == '-') {
|
||||||
|
if (HasPrevLineContent(sc) && FollowToLineEnd('-', SCE_MARKDOWN_HEADER2, endPos, sc))
|
||||||
|
;
|
||||||
|
else {
|
||||||
|
precharCount = 0;
|
||||||
|
sc.SetState(SCE_MARKDOWN_PRECHAR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (IsNewline(sc.ch))
|
||||||
|
sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
|
||||||
|
else {
|
||||||
|
precharCount = 0;
|
||||||
|
sc.SetState(SCE_MARKDOWN_PRECHAR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// The header lasts until the newline
|
||||||
|
else if (sc.state == SCE_MARKDOWN_HEADER1 || sc.state == SCE_MARKDOWN_HEADER2 ||
|
||||||
|
sc.state == SCE_MARKDOWN_HEADER3 || sc.state == SCE_MARKDOWN_HEADER4 ||
|
||||||
|
sc.state == SCE_MARKDOWN_HEADER5 || sc.state == SCE_MARKDOWN_HEADER6) {
|
||||||
|
if (IsNewline(sc.ch))
|
||||||
|
sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
// New state only within the initial whitespace
|
||||||
|
if (sc.state == SCE_MARKDOWN_PRECHAR) {
|
||||||
|
// Blockquote
|
||||||
|
if (sc.ch == '>' && precharCount < 5)
|
||||||
|
sc.SetState(SCE_MARKDOWN_BLOCKQUOTE);
|
||||||
|
/*
|
||||||
|
// Begin of code block
|
||||||
|
else if (!HasPrevLineContent(sc) && (sc.chPrev == '\t' || precharCount >= 4))
|
||||||
|
sc.SetState(SCE_MARKDOWN_CODEBK);
|
||||||
|
*/
|
||||||
|
// HRule - Total of three or more hyphens, asterisks, or underscores
|
||||||
|
// on a line by themselves
|
||||||
|
else if ((sc.ch == '-' || sc.ch == '*' || sc.ch == '_') && IsValidHrule(endPos, sc))
|
||||||
|
;
|
||||||
|
// Unordered list
|
||||||
|
else if ((sc.ch == '-' || sc.ch == '*' || sc.ch == '+') && IsASpaceOrTab(sc.chNext)) {
|
||||||
|
sc.SetState(SCE_MARKDOWN_ULIST_ITEM);
|
||||||
|
sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
}
|
||||||
|
// Ordered list
|
||||||
|
else if (IsADigit(sc.ch)) {
|
||||||
|
digitCount = 0;
|
||||||
|
while (IsADigit(sc.GetRelative(++digitCount)))
|
||||||
|
;
|
||||||
|
if (sc.GetRelative(digitCount) == '.' &&
|
||||||
|
IsASpaceOrTab(sc.GetRelative(digitCount + 1))) {
|
||||||
|
sc.SetState(SCE_MARKDOWN_OLIST_ITEM);
|
||||||
|
sc.Forward(digitCount + 1);
|
||||||
|
sc.SetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Alternate Ordered list
|
||||||
|
else if (sc.ch == '#' && sc.chNext == '.' && IsASpaceOrTab(sc.GetRelative(2))) {
|
||||||
|
sc.SetState(SCE_MARKDOWN_OLIST_ITEM);
|
||||||
|
sc.Forward(2);
|
||||||
|
sc.SetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
}
|
||||||
|
else if (sc.ch != ' ' || precharCount > 2)
|
||||||
|
sc.SetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
else
|
||||||
|
++precharCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
// New state anywhere in doc
|
||||||
|
if (sc.state == SCE_MARKDOWN_DEFAULT) {
|
||||||
|
int origPos = sc.currentPos;
|
||||||
|
if (sc.atLineStart && sc.ch == '#') {
|
||||||
|
sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
|
||||||
|
freezeCursor = true;
|
||||||
|
}
|
||||||
|
// Links and Images
|
||||||
|
if (sc.Match("![") || sc.ch == '[') {
|
||||||
|
int i = 0, j = 0, k = 0;
|
||||||
|
int len = endPos - sc.currentPos;
|
||||||
|
while (i < len && (sc.GetRelative(++i) != ']' || sc.GetRelative(i - 1) == '\\'))
|
||||||
|
;
|
||||||
|
if (sc.GetRelative(i) == ']') {
|
||||||
|
j = i;
|
||||||
|
if (sc.GetRelative(++i) == '(') {
|
||||||
|
while (i < len && (sc.GetRelative(++i) != ')' || sc.GetRelative(i - 1) == '\\'))
|
||||||
|
;
|
||||||
|
if (sc.GetRelative(i) == ')')
|
||||||
|
k = i;
|
||||||
|
}
|
||||||
|
else if (sc.GetRelative(i) == '[' || sc.GetRelative(++i) == '[') {
|
||||||
|
while (i < len && (sc.GetRelative(++i) != ']' || sc.GetRelative(i - 1) == '\\'))
|
||||||
|
;
|
||||||
|
if (sc.GetRelative(i) == ']')
|
||||||
|
k = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// At least a link text
|
||||||
|
if (j) {
|
||||||
|
sc.SetState(SCE_MARKDOWN_LINK);
|
||||||
|
sc.Forward(j);
|
||||||
|
// Also has a URL or reference portion
|
||||||
|
if (k)
|
||||||
|
sc.Forward(k - j);
|
||||||
|
sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Code - also a special case for alternate inside spacing
|
||||||
|
if (sc.Match("``") && sc.GetRelative(3) != ' ') {
|
||||||
|
sc.SetState(SCE_MARKDOWN_CODE2);
|
||||||
|
sc.Forward();
|
||||||
|
}
|
||||||
|
else if (sc.ch == '`' && sc.chNext != ' ') {
|
||||||
|
sc.SetState(SCE_MARKDOWN_CODE);
|
||||||
|
}
|
||||||
|
// Strong
|
||||||
|
else if (sc.Match("**") && sc.GetRelative(2) != ' ') {
|
||||||
|
sc.SetState(SCE_MARKDOWN_STRONG1);
|
||||||
|
sc.Forward();
|
||||||
|
}
|
||||||
|
else if (sc.Match("__") && sc.GetRelative(2) != ' ') {
|
||||||
|
sc.SetState(SCE_MARKDOWN_STRONG2);
|
||||||
|
sc.Forward();
|
||||||
|
}
|
||||||
|
// Emphasis
|
||||||
|
else if (sc.ch == '*' && sc.chNext != ' ')
|
||||||
|
sc.SetState(SCE_MARKDOWN_EM1);
|
||||||
|
else if (sc.ch == '_' && sc.chNext != ' ')
|
||||||
|
sc.SetState(SCE_MARKDOWN_EM2);
|
||||||
|
// Strikeout
|
||||||
|
else if (sc.Match("~~") && sc.GetRelative(2) != ' ') {
|
||||||
|
sc.SetState(SCE_MARKDOWN_STRIKEOUT);
|
||||||
|
sc.Forward();
|
||||||
|
}
|
||||||
|
// Beginning of line
|
||||||
|
else if (IsNewline(sc.ch))
|
||||||
|
sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
|
||||||
|
}
|
||||||
|
// Advance if not holding back the cursor for this iteration.
|
||||||
|
if (!freezeCursor)
|
||||||
|
sc.Forward();
|
||||||
|
freezeCursor = false;
|
||||||
|
}
|
||||||
|
sc.Complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
LexerModule lmMarkdown(SCLEX_MARKDOWN, ColorizeMarkdownDoc, "markdown");
|
||||||
|
|
@ -19,10 +19,10 @@ LexD.cxx \
|
|||||||
LexFortran.cxx \
|
LexFortran.cxx \
|
||||||
LexHaskell.cxx \
|
LexHaskell.cxx \
|
||||||
LexHTML.cxx \
|
LexHTML.cxx \
|
||||||
LexYAML.cxx \
|
|
||||||
LexLua.cxx \
|
LexLua.cxx \
|
||||||
LexNsis.cxx \
|
LexMarkdown.cxx \
|
||||||
LexMatlab.cxx \
|
LexMatlab.cxx \
|
||||||
|
LexNsis.cxx \
|
||||||
LexOthers.cxx \
|
LexOthers.cxx \
|
||||||
LexPascal.cxx \
|
LexPascal.cxx \
|
||||||
LexPerl.cxx \
|
LexPerl.cxx \
|
||||||
@ -31,7 +31,8 @@ LexR.cxx \
|
|||||||
LexRuby.cxx \
|
LexRuby.cxx \
|
||||||
LexSQL.cxx \
|
LexSQL.cxx \
|
||||||
LexTCL.cxx \
|
LexTCL.cxx \
|
||||||
LexVHDL.cxx
|
LexVHDL.cxx \
|
||||||
|
LexYAML.cxx
|
||||||
|
|
||||||
SRCS= \
|
SRCS= \
|
||||||
CallTip.cxx \
|
CallTip.cxx \
|
||||||
|
@ -110,6 +110,7 @@
|
|||||||
#define SCLEX_POWERPRO 95
|
#define SCLEX_POWERPRO 95
|
||||||
#define SCLEX_NIMROD 96
|
#define SCLEX_NIMROD 96
|
||||||
#define SCLEX_SML 97
|
#define SCLEX_SML 97
|
||||||
|
#define SCLEX_MARKDOWN 98
|
||||||
#define SCLEX_AUTOMATIC 1000
|
#define SCLEX_AUTOMATIC 1000
|
||||||
#define SCE_P_DEFAULT 0
|
#define SCE_P_DEFAULT 0
|
||||||
#define SCE_P_COMMENTLINE 1
|
#define SCE_P_COMMENTLINE 1
|
||||||
@ -1277,6 +1278,28 @@
|
|||||||
#define SCE_MYSQL_USER2 19
|
#define SCE_MYSQL_USER2 19
|
||||||
#define SCE_MYSQL_USER3 20
|
#define SCE_MYSQL_USER3 20
|
||||||
#define SCE_MYSQL_HIDDENCOMMAND 21
|
#define SCE_MYSQL_HIDDENCOMMAND 21
|
||||||
|
#define SCE_MARKDOWN_DEFAULT 0
|
||||||
|
#define SCE_MARKDOWN_LINE_BEGIN 1
|
||||||
|
#define SCE_MARKDOWN_STRONG1 2
|
||||||
|
#define SCE_MARKDOWN_STRONG2 3
|
||||||
|
#define SCE_MARKDOWN_EM1 4
|
||||||
|
#define SCE_MARKDOWN_EM2 5
|
||||||
|
#define SCE_MARKDOWN_HEADER1 6
|
||||||
|
#define SCE_MARKDOWN_HEADER2 7
|
||||||
|
#define SCE_MARKDOWN_HEADER3 8
|
||||||
|
#define SCE_MARKDOWN_HEADER4 9
|
||||||
|
#define SCE_MARKDOWN_HEADER5 10
|
||||||
|
#define SCE_MARKDOWN_HEADER6 11
|
||||||
|
#define SCE_MARKDOWN_PRECHAR 12
|
||||||
|
#define SCE_MARKDOWN_ULIST_ITEM 13
|
||||||
|
#define SCE_MARKDOWN_OLIST_ITEM 14
|
||||||
|
#define SCE_MARKDOWN_BLOCKQUOTE 15
|
||||||
|
#define SCE_MARKDOWN_STRIKEOUT 16
|
||||||
|
#define SCE_MARKDOWN_HRULE 17
|
||||||
|
#define SCE_MARKDOWN_LINK 18
|
||||||
|
#define SCE_MARKDOWN_CODE 19
|
||||||
|
#define SCE_MARKDOWN_CODE2 20
|
||||||
|
#define SCE_MARKDOWN_CODEBK 21
|
||||||
#define SCE_PO_DEFAULT 0
|
#define SCE_PO_DEFAULT 0
|
||||||
#define SCE_PO_COMMENT 1
|
#define SCE_PO_COMMENT 1
|
||||||
#define SCE_PO_MSGID 2
|
#define SCE_PO_MSGID 2
|
||||||
|
@ -2135,6 +2135,7 @@ val SCLEX_SORCUS=94
|
|||||||
val SCLEX_POWERPRO=95
|
val SCLEX_POWERPRO=95
|
||||||
val SCLEX_NIMROD=96
|
val SCLEX_NIMROD=96
|
||||||
val SCLEX_SML=97
|
val SCLEX_SML=97
|
||||||
|
val SCLEX_MARKDOWN=98
|
||||||
|
|
||||||
# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
|
# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
|
||||||
# value assigned in sequence from SCLEX_AUTOMATIC+1.
|
# value assigned in sequence from SCLEX_AUTOMATIC+1.
|
||||||
@ -3545,6 +3546,30 @@ val SCE_SML_COMMENT=12
|
|||||||
val SCE_SML_COMMENT1=13
|
val SCE_SML_COMMENT1=13
|
||||||
val SCE_SML_COMMENT2=14
|
val SCE_SML_COMMENT2=14
|
||||||
val SCE_SML_COMMENT3=15
|
val SCE_SML_COMMENT3=15
|
||||||
|
# Lexical state for SCLEX_MARKDOWN
|
||||||
|
lex Markdown=SCLEX_MARKDOWN SCE_MARKDOWN_
|
||||||
|
val SCE_MARKDOWN_DEFAULT=0
|
||||||
|
val SCE_MARKDOWN_LINE_BEGIN=1
|
||||||
|
val SCE_MARKDOWN_STRONG1=2
|
||||||
|
val SCE_MARKDOWN_STRONG2=3
|
||||||
|
val SCE_MARKDOWN_EM1=4
|
||||||
|
val SCE_MARKDOWN_EM2=5
|
||||||
|
val SCE_MARKDOWN_HEADER1=6
|
||||||
|
val SCE_MARKDOWN_HEADER2=7
|
||||||
|
val SCE_MARKDOWN_HEADER3=8
|
||||||
|
val SCE_MARKDOWN_HEADER4=9
|
||||||
|
val SCE_MARKDOWN_HEADER5=10
|
||||||
|
val SCE_MARKDOWN_HEADER6=11
|
||||||
|
val SCE_MARKDOWN_PRECHAR=12
|
||||||
|
val SCE_MARKDOWN_ULIST_ITEM=13
|
||||||
|
val SCE_MARKDOWN_OLIST_ITEM=14
|
||||||
|
val SCE_MARKDOWN_BLOCKQUOTE=15
|
||||||
|
val SCE_MARKDOWN_STRIKEOUT=16
|
||||||
|
val SCE_MARKDOWN_HRULE=17
|
||||||
|
val SCE_MARKDOWN_LINK=18
|
||||||
|
val SCE_MARKDOWN_CODE=19
|
||||||
|
val SCE_MARKDOWN_CODE2=20
|
||||||
|
val SCE_MARKDOWN_CODEBK=21
|
||||||
|
|
||||||
# Events
|
# Events
|
||||||
|
|
||||||
|
@ -61,7 +61,8 @@ MARSHALLER=scintilla-marshal.o
|
|||||||
#**LEXOBJS=\\\n\(\*.o \)
|
#**LEXOBJS=\\\n\(\*.o \)
|
||||||
LEXOBJS=\
|
LEXOBJS=\
|
||||||
LexAda.o LexBash.o LexAsm.o LexCSS.o LexCPP.o LexCrontab.o LexHTML.o LexOthers.o LexPascal.o \
|
LexAda.o LexBash.o LexAsm.o LexCSS.o LexCPP.o LexCrontab.o LexHTML.o LexOthers.o LexPascal.o \
|
||||||
LexPerl.o LexPython.o LexSQL.o LexCaml.o LexTCL.o LexRuby.o LexFortran.o LexVHDL.o LexMatlab.o \
|
LexPerl.o LexPython.o LexSQL.o LexCaml.o LexTCL.o LexRuby.o LexFortran.o LexVHDL.o \
|
||||||
|
LexMarkdown.o LexMatlab.o \
|
||||||
LexD.o LexLua.o LexHaskell.o LexBasic.o LexR.o LexYAML.o LexCmake.o LexNsis.o
|
LexD.o LexLua.o LexHaskell.o LexBasic.o LexR.o LexYAML.o LexCmake.o LexNsis.o
|
||||||
#--Autogenerated -- end of automatically generated section
|
#--Autogenerated -- end of automatically generated section
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env perl
|
#!/usr/bin/env perl
|
||||||
# Copyright: 2008, Nick Treleaven
|
# Copyright: 2008-2009, Nick Treleaven
|
||||||
# License: GNU GPL V2 or later
|
# License: GNU GPL V2 or later
|
||||||
# Warranty: NONE
|
# Warranty: NONE
|
||||||
|
|
||||||
@ -8,6 +8,18 @@
|
|||||||
# repeats until all matching blocks of text are found.
|
# repeats until all matching blocks of text are found.
|
||||||
# Results are printed in reverse, hence in chronological order (as ChangeLogs
|
# Results are printed in reverse, hence in chronological order (as ChangeLogs
|
||||||
# are usually written in reverse date order).
|
# are usually written in reverse date order).
|
||||||
|
#
|
||||||
|
# The resulting lines are then formatted to be easier to read and edit into a
|
||||||
|
# NEWS file.
|
||||||
|
|
||||||
|
# Example ChangeLog format:
|
||||||
|
#2009-04-03 Joe Author <joe@example.net>
|
||||||
|
#
|
||||||
|
# * src/file.c, src/file.h,
|
||||||
|
# src/another.c:
|
||||||
|
# Some change description,
|
||||||
|
# spanning several lines.
|
||||||
|
# * foo.c: Combined line.
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
@ -15,8 +27,12 @@ use warnings;
|
|||||||
my $scriptname = "changelist.pl";
|
my $scriptname = "changelist.pl";
|
||||||
my $argc = $#ARGV + 1;
|
my $argc = $#ARGV + 1;
|
||||||
|
|
||||||
($argc == 2)
|
($argc == 2) or die <<END;
|
||||||
or die "Usage:\n$scriptname matchstring changelogfile\n";
|
Usage:
|
||||||
|
$scriptname matchstring changelogfile >outfile
|
||||||
|
|
||||||
|
matchstring is not case sensitive.
|
||||||
|
END
|
||||||
|
|
||||||
my ($matchstr, $infile) = @ARGV;
|
my ($matchstr, $infile) = @ARGV;
|
||||||
|
|
||||||
@ -24,7 +40,10 @@ open(INPUT, $infile)
|
|||||||
or die "Couldn't open $infile for reading: $!\n";
|
or die "Couldn't open $infile for reading: $!\n";
|
||||||
|
|
||||||
my $entry; # the current matching block of text
|
my $entry; # the current matching block of text
|
||||||
my @entries;
|
my @entries; # changelog entries, one per date
|
||||||
|
|
||||||
|
# first parse each ChangeLog entry into an array
|
||||||
|
|
||||||
my $found = 0; # if we're in a matching block of text
|
my $found = 0; # if we're in a matching block of text
|
||||||
my $blank = 0; # whether the last line was empty
|
my $blank = 0; # whether the last line was empty
|
||||||
|
|
||||||
@ -34,8 +53,7 @@ while (<INPUT>) {
|
|||||||
if (! $found) {
|
if (! $found) {
|
||||||
($line =~ m/$matchstr/) and $found = 1;
|
($line =~ m/$matchstr/) and $found = 1;
|
||||||
} else {
|
} else {
|
||||||
if (length($line) <= 1) # current line is empty
|
if (length($line) <= 1) { # current line is empty
|
||||||
{
|
|
||||||
if ($blank > 0) { # previous line was also empty
|
if ($blank > 0) { # previous line was also empty
|
||||||
push(@entries, $entry); # append entry
|
push(@entries, $entry); # append entry
|
||||||
$entry = "";
|
$entry = "";
|
||||||
@ -47,10 +65,61 @@ while (<INPUT>) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$found and $entry .= $line;
|
if ($found) {
|
||||||
|
$entry .= $line;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
close(INPUT);
|
close(INPUT);
|
||||||
|
|
||||||
|
# reformat entries
|
||||||
foreach $entry (reverse @entries) {
|
foreach $entry (reverse @entries) {
|
||||||
print "$entry\n\n";
|
my @lines = split(/\n/, $entry);
|
||||||
|
my $fl = 0; # in file list lines
|
||||||
|
my $cm = 0; # in commit message lines
|
||||||
|
|
||||||
|
foreach my $line (@lines){
|
||||||
|
my $flset = $fl;
|
||||||
|
|
||||||
|
# strip trailing space
|
||||||
|
$line =~ s/\s+$//g;
|
||||||
|
|
||||||
|
if (!$cm){
|
||||||
|
# check if in filelist
|
||||||
|
($line =~ m/ \* /) and $fl = 1;
|
||||||
|
# join filelist together on one line
|
||||||
|
$fl and ($line =~ s/^ / /);
|
||||||
|
if ($fl and ($line =~ m/:/)){
|
||||||
|
$fl = 0;
|
||||||
|
# separate ' * foo.c: Some edit.' messages:
|
||||||
|
if (!($line =~ m/:$/)) {
|
||||||
|
($line =~ s/:/:\n*/);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$fl and ($line =~ m/,$/) or $fl = 0;
|
||||||
|
}
|
||||||
|
if (!$flset){
|
||||||
|
# Asterisk commit messages
|
||||||
|
if (!$cm and ($line =~ m/^ /)){
|
||||||
|
$cm = 1;
|
||||||
|
$line =~ s/^( )/$1* /;
|
||||||
|
} else {
|
||||||
|
$cm and ($line =~ s/^( )/$1 /); # indent continuing lines
|
||||||
|
}
|
||||||
|
$cm and ($line =~ m/\.$/) and $cm = 0;
|
||||||
|
}
|
||||||
|
#~ print $fl.','.$cm.','.$line."\n"; next; # debug
|
||||||
|
|
||||||
|
# change file list start char to easily distinguish between file list and commit messages
|
||||||
|
$line =~ s/^ \* /@ /g;
|
||||||
|
# strip <email> from date line
|
||||||
|
$line =~ s/^([0-9-]+.*?)\s+<.+>$/$1/g;
|
||||||
|
# remove indent
|
||||||
|
$line =~ s/^ //g;
|
||||||
|
|
||||||
|
if ($line ne ""){
|
||||||
|
print $line;
|
||||||
|
(!$fl) and print "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "\n";
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,9 @@ SRCS = \
|
|||||||
msgwindow.c msgwindow.h \
|
msgwindow.c msgwindow.h \
|
||||||
navqueue.c navqueue.h \
|
navqueue.c navqueue.h \
|
||||||
notebook.c notebook.h \
|
notebook.c notebook.h \
|
||||||
|
pluginprivate.h \
|
||||||
plugins.c plugins.h \
|
plugins.c plugins.h \
|
||||||
|
pluginutils.c pluginutils.h \
|
||||||
prefix.c prefix.h \
|
prefix.c prefix.h \
|
||||||
prefs.c prefs.h \
|
prefs.c prefs.h \
|
||||||
printing.c printing.h \
|
printing.c printing.h \
|
||||||
@ -75,7 +77,8 @@ geany_include_HEADERS = \
|
|||||||
build.h
|
build.h
|
||||||
|
|
||||||
|
|
||||||
INCLUDES = -I$(srcdir)/../scintilla/include -I$(srcdir)/../tagmanager/include @GTK_CFLAGS@ @GIO_CFLAGS@
|
INCLUDES = -I$(top_srcdir) -I$(srcdir)/../scintilla/include -I$(srcdir)/../tagmanager/include \
|
||||||
|
@GTK_CFLAGS@ @GIO_CFLAGS@
|
||||||
|
|
||||||
# tell automake we have a C++ file so it uses the C++ linker we need for Scintilla
|
# tell automake we have a C++ file so it uses the C++ linker we need for Scintilla
|
||||||
nodist_EXTRA_geany_SOURCES = dummy.cxx
|
nodist_EXTRA_geany_SOURCES = dummy.cxx
|
||||||
|
@ -64,6 +64,7 @@ const gchar *translators[][2] = {
|
|||||||
{ "pt_BR", "Alexandra Moreire <alexandream@gmail.com>\nAdrovane Marques Kade <adrovane@gmail.com>" },
|
{ "pt_BR", "Alexandra Moreire <alexandream@gmail.com>\nAdrovane Marques Kade <adrovane@gmail.com>" },
|
||||||
{ "ro", "Alex Eftimie <alex@rosedu.org>" },
|
{ "ro", "Alex Eftimie <alex@rosedu.org>" },
|
||||||
{ "ru_RU", "brahmann_ <brahmann@pisem.net>,\nNikita E. Shalaev <nshalaev@eu.spb.ru>" },
|
{ "ru_RU", "brahmann_ <brahmann@pisem.net>,\nNikita E. Shalaev <nshalaev@eu.spb.ru>" },
|
||||||
|
{ "sl_SI", "Jože Klepec <joze.klepec@siol.net>"},
|
||||||
{ "sv", "Tony Mattsson <superxorn@gmail.com>" },
|
{ "sv", "Tony Mattsson <superxorn@gmail.com>" },
|
||||||
{ "tr", "Gürkan Gür <seqizz@gmail.com>"},
|
{ "tr", "Gürkan Gür <seqizz@gmail.com>"},
|
||||||
{ "uk", "Boris Dibrov <dibrov.bor@gmail.com>" },
|
{ "uk", "Boris Dibrov <dibrov.bor@gmail.com>" },
|
||||||
@ -83,7 +84,7 @@ static const gchar *contributors =
|
|||||||
"Chris Macksey, Christoph Berg, Colomban Wendling, Conrad Steenberg, Daniel Richard G., Dave Moore, Dirk Weber, "
|
"Chris Macksey, Christoph Berg, Colomban Wendling, Conrad Steenberg, Daniel Richard G., Dave Moore, Dirk Weber, "
|
||||||
"Elias Pschernig, Eugene Arshinov, Felipe Pena, François Cami, "
|
"Elias Pschernig, Eugene Arshinov, Felipe Pena, François Cami, "
|
||||||
"Giuseppe Torelli, Guillaume de Rorthais, Guillaume Hoffmann, Herbert Voss, Jason Oster, Jean-François Wauthy, Jeff Pohlmeyer, "
|
"Giuseppe Torelli, Guillaume de Rorthais, Guillaume Hoffmann, Herbert Voss, Jason Oster, Jean-François Wauthy, Jeff Pohlmeyer, "
|
||||||
"Jesse Mayes, John Gabriele, Josef Whiter, Kevin Ellwood, Kristoffer A. Tjernås, Marko Peric, Matti Mårds, Moritz Barsnick, "
|
"Jesse Mayes, John Gabriele, Jon Strait, Josef Whiter, Kevin Ellwood, Kristoffer A. Tjernås, Marko Peric, Matti Mårds, Moritz Barsnick, "
|
||||||
"Peter Strand, Philipp Gildein, Pierre Joye, Rob van der Linde, Robert McGinley, Roland Baudin, S Jagannathan, Saleem Abdulrasool, "
|
"Peter Strand, Philipp Gildein, Pierre Joye, Rob van der Linde, Robert McGinley, Roland Baudin, S Jagannathan, Saleem Abdulrasool, "
|
||||||
"Sebastian Kraft, Shiv, Slava Semushin, Stefan Oltmanns, Tamim, Thomas Martitz, Tomás Vírseda, "
|
"Sebastian Kraft, Shiv, Slava Semushin, Stefan Oltmanns, Tamim, Thomas Martitz, Tomás Vírseda, "
|
||||||
"Tyler Mulligan, Walery Studennikov, Yura Siamashka";
|
"Tyler Mulligan, Walery Studennikov, Yura Siamashka";
|
||||||
|
@ -1046,12 +1046,18 @@ static gboolean build_create_shellscript(const gchar *fname, const gchar *cmd, g
|
|||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
gchar *str;
|
gchar *str;
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
gchar *expanded_cmd;
|
||||||
|
#endif
|
||||||
|
|
||||||
fp = g_fopen(fname, "w");
|
fp = g_fopen(fname, "w");
|
||||||
if (! fp)
|
if (! fp)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
str = g_strdup_printf("%s\n\n%s\ndel \"%%0\"\n\npause\n", cmd, (autoclose) ? "" : "pause");
|
/* Expand environment variables like %blah%. */
|
||||||
|
expanded_cmd = win32_expand_environment_variables(cmd);
|
||||||
|
str = g_strdup_printf("%s\n\n%s\ndel \"%%0\"\n\npause\n", expanded_cmd, (autoclose) ? "" : "pause");
|
||||||
|
g_free(expanded_cmd);
|
||||||
#else
|
#else
|
||||||
str = g_strdup_printf(
|
str = g_strdup_printf(
|
||||||
"#!/bin/sh\n\nrm $0\n\n%s\n\necho \"\n\n------------------\n(program exited with code: $?)\" \
|
"#!/bin/sh\n\nrm $0\n\n%s\n\necho \"\n\n------------------\n(program exited with code: $?)\" \
|
||||||
|
@ -254,9 +254,9 @@ GeanyDocument *document_get_from_page(guint page_num)
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find and retrieve the current %document.
|
* Find and retrieve the current document.
|
||||||
*
|
*
|
||||||
* @return A pointer to the current %document or @c NULL if there are no opened documents.
|
* @return A pointer to the current document or @c NULL if there are no opened documents.
|
||||||
**/
|
**/
|
||||||
GeanyDocument *document_get_current(void)
|
GeanyDocument *document_get_current(void)
|
||||||
{
|
{
|
||||||
@ -750,12 +750,12 @@ GeanyDocument *document_new_file(const gchar *utf8_filename, GeanyFiletype *ft,
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open a %document specified by @a locale_filename.
|
* Open a document specified by @a locale_filename.
|
||||||
* After all, the "document-open" signal is emitted for plugins.
|
* After all, the "document-open" signal is emitted for plugins.
|
||||||
*
|
*
|
||||||
* @param locale_filename The filename of the %document to load, in locale encoding.
|
* @param locale_filename The filename of the document to load, in locale encoding.
|
||||||
* @param readonly Whether to open the %document in read-only mode.
|
* @param readonly Whether to open the document in read-only mode.
|
||||||
* @param ft The %filetype for the %document or @c NULL to auto-detect the %filetype.
|
* @param ft The filetype for the document or @c NULL to auto-detect the filetype.
|
||||||
* @param forced_enc The file encoding to use or @c NULL to auto-detect the file encoding.
|
* @param forced_enc The file encoding to use or @c NULL to auto-detect the file encoding.
|
||||||
*
|
*
|
||||||
* @return The document opened or @c NULL.
|
* @return The document opened or @c NULL.
|
||||||
@ -1308,6 +1308,9 @@ GeanyDocument *document_open_file_full(GeanyDocument *doc, const gchar *filename
|
|||||||
if (reload)
|
if (reload)
|
||||||
ui_set_statusbar(TRUE, _("File %s reloaded."), display_filename);
|
ui_set_statusbar(TRUE, _("File %s reloaded."), display_filename);
|
||||||
else
|
else
|
||||||
|
/* For translators: this is the status window message for opening a file. %d is the number
|
||||||
|
* of the newly opened file, %s indicates whether the file is opened read-only
|
||||||
|
* (it is replaced with the string ", read-only"). */
|
||||||
msgwin_status_add(_("File %s opened(%d%s)."),
|
msgwin_status_add(_("File %s opened(%d%s)."),
|
||||||
display_filename, gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)),
|
display_filename, gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)),
|
||||||
(readonly) ? _(", read-only") : "");
|
(readonly) ? _(", read-only") : "");
|
||||||
@ -1365,8 +1368,8 @@ void document_open_file_list(const gchar *data, gssize length)
|
|||||||
* Internally, document_open_file() is called for every list item.
|
* Internally, document_open_file() is called for every list item.
|
||||||
*
|
*
|
||||||
* @param filenames A list of filenames to load, in locale encoding.
|
* @param filenames A list of filenames to load, in locale encoding.
|
||||||
* @param readonly Whether to open the %document in read-only mode.
|
* @param readonly Whether to open the document in read-only mode.
|
||||||
* @param ft The %filetype for the %document or @c NULL to auto-detect the %filetype.
|
* @param ft The filetype for the document or @c NULL to auto-detect the filetype.
|
||||||
* @param forced_enc The file encoding to use or @c NULL to auto-detect the file encoding.
|
* @param forced_enc The file encoding to use or @c NULL to auto-detect the file encoding.
|
||||||
**/
|
**/
|
||||||
void document_open_files(const GSList *filenames, gboolean readonly, GeanyFiletype *ft,
|
void document_open_files(const GSList *filenames, gboolean readonly, GeanyFiletype *ft,
|
||||||
@ -1387,7 +1390,7 @@ void document_open_files(const GSList *filenames, gboolean readonly, GeanyFilety
|
|||||||
* @param doc The document to reload.
|
* @param doc The document to reload.
|
||||||
* @param forced_enc The file encoding to use or @c NULL to auto-detect the file encoding.
|
* @param forced_enc The file encoding to use or @c NULL to auto-detect the file encoding.
|
||||||
*
|
*
|
||||||
* @return @c TRUE if the %document was actually reloaded or @c FALSE otherwise.
|
* @return @c TRUE if the document was actually reloaded or @c FALSE otherwise.
|
||||||
**/
|
**/
|
||||||
gboolean document_reload_file(GeanyDocument *doc, const gchar *forced_enc)
|
gboolean document_reload_file(GeanyDocument *doc, const gchar *forced_enc)
|
||||||
{
|
{
|
||||||
@ -1471,9 +1474,9 @@ static void replace_header_filename(GeanyDocument *doc)
|
|||||||
|
|
||||||
if (sci_find_text(doc->editor->sci, SCFIND_MATCHCASE, &ttf) != -1)
|
if (sci_find_text(doc->editor->sci, SCFIND_MATCHCASE, &ttf) != -1)
|
||||||
{
|
{
|
||||||
sci_target_start(doc->editor->sci, ttf.chrgText.cpMin);
|
sci_set_target_start(doc->editor->sci, ttf.chrgText.cpMin);
|
||||||
sci_target_end(doc->editor->sci, ttf.chrgText.cpMax);
|
sci_set_target_end(doc->editor->sci, ttf.chrgText.cpMax);
|
||||||
sci_target_replace(doc->editor->sci, filename, FALSE);
|
sci_replace_target(doc->editor->sci, filename, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free(filebase);
|
g_free(filebase);
|
||||||
@ -1689,7 +1692,7 @@ static gchar *write_data_to_disk(GeanyDocument *doc, const gchar *locale_filenam
|
|||||||
*
|
*
|
||||||
* If the file is not modified, this functions does nothing unless force is set to @c TRUE.
|
* If the file is not modified, this functions does nothing unless force is set to @c TRUE.
|
||||||
*
|
*
|
||||||
* @param doc The %document to save.
|
* @param doc The document to save.
|
||||||
* @param force Whether to save the file even if it is not modified (e.g. for Save As).
|
* @param force Whether to save the file even if it is not modified (e.g. for Save As).
|
||||||
*
|
*
|
||||||
* @return @c TRUE if the file was saved or @c FALSE if the file could not or should not be saved.
|
* @return @c TRUE if the file was saved or @c FALSE if the file could not or should not be saved.
|
||||||
@ -1984,7 +1987,7 @@ gint document_replace_text(GeanyDocument *doc, const gchar *find_text, const gch
|
|||||||
gint replace_len;
|
gint replace_len;
|
||||||
/* search next/prev will select matching text, which we use to set the replace target */
|
/* search next/prev will select matching text, which we use to set the replace target */
|
||||||
sci_target_from_selection(doc->editor->sci);
|
sci_target_from_selection(doc->editor->sci);
|
||||||
replace_len = sci_target_replace(doc->editor->sci, replace_text, flags & SCFIND_REGEXP);
|
replace_len = sci_replace_target(doc->editor->sci, replace_text, flags & SCFIND_REGEXP);
|
||||||
/* select the replacement - find text will skip past the selected text */
|
/* select the replacement - find text will skip past the selected text */
|
||||||
sci_set_selection_start(doc->editor->sci, search_pos);
|
sci_set_selection_start(doc->editor->sci, search_pos);
|
||||||
sci_set_selection_end(doc->editor->sci, search_pos + replace_len);
|
sci_set_selection_end(doc->editor->sci, search_pos + replace_len);
|
||||||
@ -2080,8 +2083,8 @@ document_replace_range(GeanyDocument *doc, const gchar *find_text, const gchar *
|
|||||||
{
|
{
|
||||||
gint movepastEOL = 0;
|
gint movepastEOL = 0;
|
||||||
|
|
||||||
sci_target_start(sci, search_pos);
|
sci_set_target_start(sci, search_pos);
|
||||||
sci_target_end(sci, search_pos + find_len);
|
sci_set_target_end(sci, search_pos + find_len);
|
||||||
|
|
||||||
if (find_len <= 0)
|
if (find_len <= 0)
|
||||||
{
|
{
|
||||||
@ -2090,7 +2093,7 @@ document_replace_range(GeanyDocument *doc, const gchar *find_text, const gchar *
|
|||||||
if (chNext == '\r' || chNext == '\n')
|
if (chNext == '\r' || chNext == '\n')
|
||||||
movepastEOL = 1;
|
movepastEOL = 1;
|
||||||
}
|
}
|
||||||
replace_len = sci_target_replace(sci, replace_text,
|
replace_len = sci_replace_target(sci, replace_text,
|
||||||
flags & SCFIND_REGEXP);
|
flags & SCFIND_REGEXP);
|
||||||
count++;
|
count++;
|
||||||
if (search_pos == end)
|
if (search_pos == end)
|
||||||
@ -2466,12 +2469,12 @@ void document_reload_config(GeanyDocument *doc)
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the encoding of a %document.
|
* Sets the encoding of a document.
|
||||||
* This function only set the encoding of the %document, it does not any conversions. The new
|
* This function only set the encoding of the %document, it does not any conversions. The new
|
||||||
* encoding is used when e.g. saving the file.
|
* encoding is used when e.g. saving the file.
|
||||||
*
|
*
|
||||||
* @param doc The %document to use.
|
* @param doc The document to use.
|
||||||
* @param new_encoding The encoding to be set for the %document.
|
* @param new_encoding The encoding to be set for the document.
|
||||||
**/
|
**/
|
||||||
void document_set_encoding(GeanyDocument *doc, const gchar *new_encoding)
|
void document_set_encoding(GeanyDocument *doc, const gchar *new_encoding)
|
||||||
{
|
{
|
||||||
|
@ -71,7 +71,7 @@ struct GeanyDocument
|
|||||||
/** General flag to represent this document is active and all properties are set correctly. */
|
/** General flag to represent this document is active and all properties are set correctly. */
|
||||||
gboolean is_valid;
|
gboolean is_valid;
|
||||||
gint index; /**< Index in the documents array. */
|
gint index; /**< Index in the documents array. */
|
||||||
/** Whether this %document support source code symbols(tags) to show in the sidebar. */
|
/** Whether this document supports source code symbols(tags) to show in the sidebar. */
|
||||||
gboolean has_tags;
|
gboolean has_tags;
|
||||||
/** The UTF-8 encoded file name.
|
/** The UTF-8 encoded file name.
|
||||||
* Be careful; glibc and GLib file functions expect the locale representation of the
|
* Be careful; glibc and GLib file functions expect the locale representation of the
|
||||||
@ -79,20 +79,20 @@ struct GeanyDocument
|
|||||||
* For conversion into locale encoding, you can use @ref utils_get_locale_from_utf8().
|
* For conversion into locale encoding, you can use @ref utils_get_locale_from_utf8().
|
||||||
* @see real_path. */
|
* @see real_path. */
|
||||||
gchar *file_name;
|
gchar *file_name;
|
||||||
/** The encoding of the %document, must be a valid string representation of an encoding, can
|
/** The encoding of the document, must be a valid string representation of an encoding, can
|
||||||
* be retrieved with @ref encodings_get_charset_from_index. */
|
* be retrieved with @ref encodings_get_charset_from_index. */
|
||||||
gchar *encoding;
|
gchar *encoding;
|
||||||
/** Internally used flag to indicate whether the file of this %document has a byte-order-mark. */
|
/** Internally used flag to indicate whether the file of this document has a byte-order-mark. */
|
||||||
gboolean has_bom;
|
gboolean has_bom;
|
||||||
struct GeanyEditor *editor; /**< The editor associated with the document. */
|
struct GeanyEditor *editor; /**< The editor associated with the document. */
|
||||||
/** The filetype for this %document, it's only a reference to one of the elements of the global
|
/** The filetype for this document, it's only a reference to one of the elements of the global
|
||||||
* filetypes array. */
|
* filetypes array. */
|
||||||
GeanyFiletype *file_type;
|
GeanyFiletype *file_type;
|
||||||
/** TMWorkObject object for this %document, or @c NULL. */
|
/** TMWorkObject object for this document, or @c NULL. */
|
||||||
TMWorkObject *tm_file;
|
TMWorkObject *tm_file;
|
||||||
/** Whether this %document is read-only. */
|
/** Whether this document is read-only. */
|
||||||
gboolean readonly;
|
gboolean readonly;
|
||||||
/** Whether this %document has been changed since it was last saved. */
|
/** Whether this document has been changed since it was last saved. */
|
||||||
gboolean changed;
|
gboolean changed;
|
||||||
/** The link-dereferenced, locale-encoded file name.
|
/** The link-dereferenced, locale-encoded file name.
|
||||||
* If non-NULL, this indicates the file once existed on disk (not just as an
|
* If non-NULL, this indicates the file once existed on disk (not just as an
|
||||||
@ -133,8 +133,8 @@ extern GPtrArray *documents_array;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* DOC_FILENAME returns the filename of the document passed or
|
* DOC_FILENAME returns the filename of the document passed or
|
||||||
* GEANY_STRING_UNTITLED (e.g. _("untitled")) if the %document's filename was not yet set.
|
* GEANY_STRING_UNTITLED (e.g. _("untitled")) if the document's filename was not yet set.
|
||||||
* This macro never returns NULL.
|
* This macro never returns @c NULL.
|
||||||
**/
|
**/
|
||||||
#define DOC_FILENAME(doc) \
|
#define DOC_FILENAME(doc) \
|
||||||
(G_LIKELY(doc->file_name != NULL) ? (doc->file_name) : GEANY_STRING_UNTITLED)
|
(G_LIKELY(doc->file_name != NULL) ? (doc->file_name) : GEANY_STRING_UNTITLED)
|
||||||
|
@ -59,11 +59,11 @@ typedef struct GeanyDocumentPrivate
|
|||||||
{
|
{
|
||||||
/* GtkLabel shown in the notebook header. */
|
/* GtkLabel shown in the notebook header. */
|
||||||
GtkWidget *tab_label;
|
GtkWidget *tab_label;
|
||||||
/* GtkTreeView object for this %document within the Symbols treeview of the sidebar. */
|
/* GtkTreeView object for this document within the Symbols treeview of the sidebar. */
|
||||||
GtkWidget *tag_tree;
|
GtkWidget *tag_tree;
|
||||||
/* GtkTreeStore object for this %document within the Symbols treeview of the sidebar. */
|
/* GtkTreeStore object for this document within the Symbols treeview of the sidebar. */
|
||||||
GtkTreeStore *tag_store;
|
GtkTreeStore *tag_store;
|
||||||
/* Iter for this %document within the Open Files treeview of the sidebar. */
|
/* Iter for this document within the Open Files treeview of the sidebar. */
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
/* Used by the Undo/Redo management code. */
|
/* Used by the Undo/Redo management code. */
|
||||||
GTrashStack *undo_actions;
|
GTrashStack *undo_actions;
|
||||||
|
117
src/editor.c
117
src/editor.c
@ -101,7 +101,6 @@ static void auto_table(GeanyEditor *editor, gint pos);
|
|||||||
static void close_block(GeanyEditor *editor, gint pos);
|
static void close_block(GeanyEditor *editor, gint pos);
|
||||||
static void editor_highlight_braces(GeanyEditor *editor, gint cur_pos);
|
static void editor_highlight_braces(GeanyEditor *editor, gint cur_pos);
|
||||||
static void editor_auto_latex(GeanyEditor *editor, gint pos);
|
static void editor_auto_latex(GeanyEditor *editor, gint pos);
|
||||||
static void editor_strip_line_trailing_spaces(GeanyEditor *editor, gint line);
|
|
||||||
|
|
||||||
|
|
||||||
void editor_snippets_free(void)
|
void editor_snippets_free(void)
|
||||||
@ -490,6 +489,63 @@ static gboolean match_last_chars(ScintillaObject *sci, gint pos, const gchar *st
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
gint message;
|
||||||
|
gint pos;
|
||||||
|
gchar *text;
|
||||||
|
} CalltipReshowInfo;
|
||||||
|
|
||||||
|
|
||||||
|
static gboolean reshow_calltip(gpointer data)
|
||||||
|
{
|
||||||
|
CalltipReshowInfo *cri = data;
|
||||||
|
GeanyDocument *doc;
|
||||||
|
|
||||||
|
g_return_val_if_fail(calltip.sci != NULL, FALSE);
|
||||||
|
|
||||||
|
SSM(calltip.sci, SCI_CALLTIPCANCEL, 0, 0);
|
||||||
|
doc = document_get_current();
|
||||||
|
|
||||||
|
if (doc && doc->editor->sci == calltip.sci)
|
||||||
|
{
|
||||||
|
/* we use the position where the calltip was previously started as SCI_GETCURRENTPOS
|
||||||
|
* may be completely wrong in case the user cancelled the auto completion with the mouse */
|
||||||
|
SSM(calltip.sci, SCI_CALLTIPSHOW, calltip.pos, (sptr_t) calltip.text);
|
||||||
|
|
||||||
|
/* now autocompletion has been cancelled by SCI_CALLTIPSHOW, so do it manually */
|
||||||
|
if (cri->message == SCN_AUTOCSELECTION)
|
||||||
|
{
|
||||||
|
gint pos = SSM(calltip.sci, SCI_GETCURRENTPOS, 0, 0);
|
||||||
|
|
||||||
|
sci_set_selection_start(calltip.sci, cri->pos);
|
||||||
|
sci_set_selection_end(calltip.sci, pos);
|
||||||
|
sci_replace_sel(calltip.sci, ""); /* clear root of word */
|
||||||
|
SSM(calltip.sci, SCI_INSERTTEXT, cri->pos, (sptr_t) cri->text);
|
||||||
|
sci_goto_pos(calltip.sci, cri->pos + strlen(cri->text), FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
g_free(cri->text);
|
||||||
|
g_free(cri);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void request_reshowing_calltip(SCNotification *nt)
|
||||||
|
{
|
||||||
|
if (calltip.set)
|
||||||
|
{
|
||||||
|
CalltipReshowInfo *cri = g_new0(CalltipReshowInfo, 1);
|
||||||
|
cri->message = nt->nmhdr.code;
|
||||||
|
cri->message = nt->lParam;
|
||||||
|
cri->text = g_strdup(nt->text);
|
||||||
|
/* delay the reshow of the calltip window to make sure it is actually displayed,
|
||||||
|
* without it might be not visible on SCN_AUTOCCANCEL */
|
||||||
|
g_idle_add(reshow_calltip, cri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void autocomplete_scope(GeanyEditor *editor)
|
static void autocomplete_scope(GeanyEditor *editor)
|
||||||
{
|
{
|
||||||
ScintillaObject *sci = editor->sci;
|
ScintillaObject *sci = editor->sci;
|
||||||
@ -601,7 +657,12 @@ static void on_char_added(GeanyEditor *editor, SCNotification *nt)
|
|||||||
case ':': /* C/C++ class:: syntax */
|
case ':': /* C/C++ class:: syntax */
|
||||||
/* tag autocompletion */
|
/* tag autocompletion */
|
||||||
default:
|
default:
|
||||||
|
#if 0
|
||||||
|
if (! editor_start_auto_complete(editor, pos, FALSE))
|
||||||
|
request_reshowing_calltip(nt);
|
||||||
|
#else
|
||||||
editor_start_auto_complete(editor, pos, FALSE);
|
editor_start_auto_complete(editor, pos, FALSE);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
check_line_breaking(editor, pos, nt->ch);
|
check_line_breaking(editor, pos, nt->ch);
|
||||||
}
|
}
|
||||||
@ -714,32 +775,6 @@ static void ensure_range_visible(ScintillaObject *sci, gint posStart, gint posEn
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static gboolean reshow_calltip(gpointer data)
|
|
||||||
{
|
|
||||||
SCNotification *nt = data;
|
|
||||||
|
|
||||||
g_return_val_if_fail(calltip.sci != NULL, FALSE);
|
|
||||||
|
|
||||||
SSM(calltip.sci, SCI_CALLTIPCANCEL, 0, 0);
|
|
||||||
/* we use the position where the calltip was previously started as SCI_GETCURRENTPOS
|
|
||||||
* may be completely wrong in case the user cancelled the auto completion with the mouse */
|
|
||||||
SSM(calltip.sci, SCI_CALLTIPSHOW, calltip.pos, (sptr_t) calltip.text);
|
|
||||||
|
|
||||||
/* now autocompletion has been cancelled by SCI_CALLTIPSHOW, so do it manually */
|
|
||||||
if (nt->nmhdr.code == SCN_AUTOCSELECTION)
|
|
||||||
{
|
|
||||||
gint pos = SSM(calltip.sci, SCI_GETCURRENTPOS, 0, 0);
|
|
||||||
|
|
||||||
sci_set_selection_start(calltip.sci, nt->lParam);
|
|
||||||
sci_set_selection_end(calltip.sci, pos);
|
|
||||||
sci_replace_sel(calltip.sci, ""); /* clear root of word */
|
|
||||||
SSM(calltip.sci, SCI_INSERTTEXT, nt->lParam, (sptr_t) nt->text);
|
|
||||||
sci_goto_pos(calltip.sci, nt->lParam + strlen(nt->text), FALSE);
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void auto_update_margin_width(GeanyEditor *editor)
|
static void auto_update_margin_width(GeanyEditor *editor)
|
||||||
{
|
{
|
||||||
gint next_linecount = 1;
|
gint next_linecount = 1;
|
||||||
@ -846,13 +881,7 @@ static gboolean on_editor_notify(G_GNUC_UNUSED GObject *object, GeanyEditor *edi
|
|||||||
{
|
{
|
||||||
/* now that autocomplete is finishing or was cancelled, reshow calltips
|
/* now that autocomplete is finishing or was cancelled, reshow calltips
|
||||||
* if they were showing */
|
* if they were showing */
|
||||||
if (calltip.set)
|
request_reshowing_calltip(nt);
|
||||||
{
|
|
||||||
/* delay the reshow of the calltip window to make sure it is actually displayed,
|
|
||||||
* without it might be not visible on SCN_AUTOCCANCEL */
|
|
||||||
/* TODO g_idle_add() seems to be not enough, only with a timeout it works stable */
|
|
||||||
g_timeout_add(50, reshow_calltip, nt);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef GEANY_DEBUG
|
#ifdef GEANY_DEBUG
|
||||||
@ -4229,9 +4258,9 @@ void editor_replace_tabs(GeanyEditor *editor)
|
|||||||
pos_in_line = sci_get_col_from_position(editor->sci,search_pos);
|
pos_in_line = sci_get_col_from_position(editor->sci,search_pos);
|
||||||
current_tab_true_length = tab_len - (pos_in_line % tab_len);
|
current_tab_true_length = tab_len - (pos_in_line % tab_len);
|
||||||
tab_str = g_strnfill(current_tab_true_length, ' ');
|
tab_str = g_strnfill(current_tab_true_length, ' ');
|
||||||
sci_target_start(editor->sci, search_pos);
|
sci_set_target_start(editor->sci, search_pos);
|
||||||
sci_target_end(editor->sci, search_pos + 1);
|
sci_set_target_end(editor->sci, search_pos + 1);
|
||||||
sci_target_replace(editor->sci, tab_str, FALSE);
|
sci_replace_target(editor->sci, tab_str, FALSE);
|
||||||
/* next search starts after replacement */
|
/* next search starts after replacement */
|
||||||
ttf.chrg.cpMin = search_pos + current_tab_true_length - 1;
|
ttf.chrg.cpMin = search_pos + current_tab_true_length - 1;
|
||||||
/* update end of range now text has changed */
|
/* update end of range now text has changed */
|
||||||
@ -4275,9 +4304,9 @@ void editor_replace_spaces(GeanyEditor *editor)
|
|||||||
if (search_pos == -1)
|
if (search_pos == -1)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
sci_target_start(editor->sci, search_pos);
|
sci_set_target_start(editor->sci, search_pos);
|
||||||
sci_target_end(editor->sci, search_pos + tab_len);
|
sci_set_target_end(editor->sci, search_pos + tab_len);
|
||||||
sci_target_replace(editor->sci, "\t", FALSE);
|
sci_replace_target(editor->sci, "\t", FALSE);
|
||||||
ttf.chrg.cpMin = search_pos;
|
ttf.chrg.cpMin = search_pos;
|
||||||
/* update end of range now text has changed */
|
/* update end of range now text has changed */
|
||||||
ttf.chrg.cpMax -= tab_len - 1;
|
ttf.chrg.cpMax -= tab_len - 1;
|
||||||
@ -4287,7 +4316,7 @@ void editor_replace_spaces(GeanyEditor *editor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void editor_strip_line_trailing_spaces(GeanyEditor *editor, gint line)
|
void editor_strip_line_trailing_spaces(GeanyEditor *editor, gint line)
|
||||||
{
|
{
|
||||||
gint line_start = sci_get_position_from_line(editor->sci, line);
|
gint line_start = sci_get_position_from_line(editor->sci, line);
|
||||||
gint line_end = sci_get_line_end_position(editor->sci, line);
|
gint line_end = sci_get_line_end_position(editor->sci, line);
|
||||||
@ -4301,9 +4330,9 @@ static void editor_strip_line_trailing_spaces(GeanyEditor *editor, gint line)
|
|||||||
}
|
}
|
||||||
if (i < (line_end-1))
|
if (i < (line_end-1))
|
||||||
{
|
{
|
||||||
sci_target_start(editor->sci, i + 1);
|
sci_set_target_start(editor->sci, i + 1);
|
||||||
sci_target_end(editor->sci, line_end);
|
sci_set_target_end(editor->sci, line_end);
|
||||||
sci_target_replace(editor->sci, "", FALSE);
|
sci_replace_target(editor->sci, "", FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ typedef struct GeanyEditorPrefs
|
|||||||
gboolean show_white_space;
|
gboolean show_white_space;
|
||||||
gboolean show_indent_guide;
|
gboolean show_indent_guide;
|
||||||
gboolean show_line_endings;
|
gboolean show_line_endings;
|
||||||
gint long_line_type;
|
gint long_line_type; /* 0 - line, 1 - background, 2 - none */
|
||||||
gint long_line_column;
|
gint long_line_column;
|
||||||
gchar *long_line_color;
|
gchar *long_line_color;
|
||||||
gboolean show_markers_margin; /* view menu */
|
gboolean show_markers_margin; /* view menu */
|
||||||
@ -251,6 +251,8 @@ void editor_replace_tabs(GeanyEditor *editor);
|
|||||||
|
|
||||||
void editor_replace_spaces(GeanyEditor *editor);
|
void editor_replace_spaces(GeanyEditor *editor);
|
||||||
|
|
||||||
|
void editor_strip_line_trailing_spaces(GeanyEditor *editor, gint line);
|
||||||
|
|
||||||
void editor_strip_trailing_spaces(GeanyEditor *editor);
|
void editor_strip_trailing_spaces(GeanyEditor *editor);
|
||||||
|
|
||||||
void editor_ensure_final_newline(GeanyEditor *editor);
|
void editor_ensure_final_newline(GeanyEditor *editor);
|
||||||
|
@ -80,6 +80,29 @@ GSList *filetypes_by_title = NULL;
|
|||||||
static void create_radio_menu_item(GtkWidget *menu, GeanyFiletype *ftype);
|
static void create_radio_menu_item(GtkWidget *menu, GeanyFiletype *ftype);
|
||||||
|
|
||||||
|
|
||||||
|
enum TitleType
|
||||||
|
{
|
||||||
|
TITLE_SOURCE_FILE,
|
||||||
|
TITLE_FILE
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Save adding many translation strings if the filetype name doesn't need translating */
|
||||||
|
static void filetype_make_title(GeanyFiletype *ft, enum TitleType type)
|
||||||
|
{
|
||||||
|
const gchar *fmt = NULL;
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
case TITLE_SOURCE_FILE: fmt = _("%s source file"); break;
|
||||||
|
case TITLE_FILE: fmt = _("%s file"); break;
|
||||||
|
}
|
||||||
|
g_assert(!ft->title);
|
||||||
|
g_assert(ft->name);
|
||||||
|
ft->title = g_strdup_printf(fmt, ft->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Note: remember to update HACKING if this function is renamed. */
|
/* Note: remember to update HACKING if this function is renamed. */
|
||||||
static void init_builtin_filetypes(void)
|
static void init_builtin_filetypes(void)
|
||||||
{
|
{
|
||||||
@ -100,7 +123,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_C];
|
ft = filetypes[GEANY_FILETYPES_C];
|
||||||
ft->lang = 0;
|
ft->lang = 0;
|
||||||
ft->name = g_strdup("C");
|
ft->name = g_strdup("C");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "C");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("c");
|
ft->extension = g_strdup("c");
|
||||||
ft->pattern = utils_strv_new("*.c", "*.h", NULL);
|
ft->pattern = utils_strv_new("*.c", "*.h", NULL);
|
||||||
ft->comment_open = g_strdup("/*");
|
ft->comment_open = g_strdup("/*");
|
||||||
@ -111,7 +134,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_CPP];
|
ft = filetypes[GEANY_FILETYPES_CPP];
|
||||||
ft->lang = 1;
|
ft->lang = 1;
|
||||||
ft->name = g_strdup("C++");
|
ft->name = g_strdup("C++");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "C++");
|
filetype_make_title(ft, TITLE_FILE);
|
||||||
ft->extension = g_strdup("cpp");
|
ft->extension = g_strdup("cpp");
|
||||||
ft->pattern = utils_strv_new("*.cpp", "*.cxx", "*.c++", "*.cc",
|
ft->pattern = utils_strv_new("*.cpp", "*.cxx", "*.c++", "*.cc",
|
||||||
"*.h", "*.hpp", "*.hxx", "*.h++", "*.hh", "*.C", NULL);
|
"*.h", "*.hpp", "*.hxx", "*.h++", "*.hh", "*.C", NULL);
|
||||||
@ -123,7 +146,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_CS];
|
ft = filetypes[GEANY_FILETYPES_CS];
|
||||||
ft->lang = 25;
|
ft->lang = 25;
|
||||||
ft->name = g_strdup("C#");
|
ft->name = g_strdup("C#");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "C#");
|
filetype_make_title(ft, TITLE_FILE);
|
||||||
ft->extension = g_strdup("cs");
|
ft->extension = g_strdup("cs");
|
||||||
ft->pattern = utils_strv_new("*.cs", NULL);
|
ft->pattern = utils_strv_new("*.cs", NULL);
|
||||||
ft->comment_open = g_strdup("//");
|
ft->comment_open = g_strdup("//");
|
||||||
@ -134,7 +157,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_VALA];
|
ft = filetypes[GEANY_FILETYPES_VALA];
|
||||||
ft->lang = 33;
|
ft->lang = 33;
|
||||||
ft->name = g_strdup("Vala");
|
ft->name = g_strdup("Vala");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "Vala");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("vala");
|
ft->extension = g_strdup("vala");
|
||||||
ft->pattern = utils_strv_new("*.vala", "*.vapi", NULL);
|
ft->pattern = utils_strv_new("*.vala", "*.vapi", NULL);
|
||||||
ft->comment_open = g_strdup("//");
|
ft->comment_open = g_strdup("//");
|
||||||
@ -145,7 +168,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_D];
|
ft = filetypes[GEANY_FILETYPES_D];
|
||||||
ft->lang = 17;
|
ft->lang = 17;
|
||||||
ft->name = g_strdup("D");
|
ft->name = g_strdup("D");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "D");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("d");
|
ft->extension = g_strdup("d");
|
||||||
ft->pattern = utils_strv_new("*.d", "*.di", NULL);
|
ft->pattern = utils_strv_new("*.d", "*.di", NULL);
|
||||||
ft->comment_open = g_strdup("//");
|
ft->comment_open = g_strdup("//");
|
||||||
@ -156,7 +179,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_JAVA];
|
ft = filetypes[GEANY_FILETYPES_JAVA];
|
||||||
ft->lang = 2;
|
ft->lang = 2;
|
||||||
ft->name = g_strdup("Java");
|
ft->name = g_strdup("Java");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "Java");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("java");
|
ft->extension = g_strdup("java");
|
||||||
ft->pattern = utils_strv_new("*.java", "*.jsp", NULL);
|
ft->pattern = utils_strv_new("*.java", "*.jsp", NULL);
|
||||||
ft->comment_open = g_strdup("/*");
|
ft->comment_open = g_strdup("/*");
|
||||||
@ -167,7 +190,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_PASCAL];
|
ft = filetypes[GEANY_FILETYPES_PASCAL];
|
||||||
ft->lang = 4;
|
ft->lang = 4;
|
||||||
ft->name = g_strdup("Pascal");
|
ft->name = g_strdup("Pascal");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "Pascal");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("pas");
|
ft->extension = g_strdup("pas");
|
||||||
ft->pattern = utils_strv_new("*.pas", "*.pp", "*.inc", "*.dpr",
|
ft->pattern = utils_strv_new("*.pas", "*.pp", "*.inc", "*.dpr",
|
||||||
"*.dpk", NULL);
|
"*.dpk", NULL);
|
||||||
@ -190,7 +213,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_BASIC];
|
ft = filetypes[GEANY_FILETYPES_BASIC];
|
||||||
ft->lang = 26;
|
ft->lang = 26;
|
||||||
ft->name = g_strdup("FreeBasic");
|
ft->name = g_strdup("FreeBasic");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "FreeBasic");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("bas");
|
ft->extension = g_strdup("bas");
|
||||||
ft->pattern = utils_strv_new("*.bas", "*.bi", NULL);
|
ft->pattern = utils_strv_new("*.bas", "*.bi", NULL);
|
||||||
ft->comment_open = g_strdup("'");
|
ft->comment_open = g_strdup("'");
|
||||||
@ -223,7 +246,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_GLSL];
|
ft = filetypes[GEANY_FILETYPES_GLSL];
|
||||||
ft->lang = 31;
|
ft->lang = 31;
|
||||||
ft->name = g_strdup("GLSL");
|
ft->name = g_strdup("GLSL");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "GLSL");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("glsl");
|
ft->extension = g_strdup("glsl");
|
||||||
ft->pattern = utils_strv_new("*.glsl", "*.frag", "*.vert", NULL);
|
ft->pattern = utils_strv_new("*.glsl", "*.frag", "*.vert", NULL);
|
||||||
ft->comment_open = g_strdup("/*");
|
ft->comment_open = g_strdup("/*");
|
||||||
@ -245,7 +268,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_PERL];
|
ft = filetypes[GEANY_FILETYPES_PERL];
|
||||||
ft->lang = 5;
|
ft->lang = 5;
|
||||||
ft->name = g_strdup("Perl");
|
ft->name = g_strdup("Perl");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "Perl");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("pl");
|
ft->extension = g_strdup("pl");
|
||||||
ft->pattern = utils_strv_new("*.pl", "*.perl", "*.pm", "*.agi",
|
ft->pattern = utils_strv_new("*.pl", "*.perl", "*.pm", "*.agi",
|
||||||
"*.pod", NULL);
|
"*.pod", NULL);
|
||||||
@ -257,7 +280,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_PHP];
|
ft = filetypes[GEANY_FILETYPES_PHP];
|
||||||
ft->lang = 6;
|
ft->lang = 6;
|
||||||
ft->name = g_strdup("PHP");
|
ft->name = g_strdup("PHP");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "PHP");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("php");
|
ft->extension = g_strdup("php");
|
||||||
ft->pattern = utils_strv_new("*.php", "*.php3", "*.php4", "*.php5",
|
ft->pattern = utils_strv_new("*.php", "*.php3", "*.php4", "*.php5",
|
||||||
"*.phtml", NULL);
|
"*.phtml", NULL);
|
||||||
@ -269,7 +292,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_JS];
|
ft = filetypes[GEANY_FILETYPES_JS];
|
||||||
ft->lang = 23;
|
ft->lang = 23;
|
||||||
ft->name = g_strdup("Javascript");
|
ft->name = g_strdup("Javascript");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "Javascript");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("js");
|
ft->extension = g_strdup("js");
|
||||||
ft->pattern = utils_strv_new("*.js", NULL);
|
ft->pattern = utils_strv_new("*.js", NULL);
|
||||||
ft->comment_open = g_strdup("//");
|
ft->comment_open = g_strdup("//");
|
||||||
@ -280,7 +303,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_PYTHON];
|
ft = filetypes[GEANY_FILETYPES_PYTHON];
|
||||||
ft->lang = 7;
|
ft->lang = 7;
|
||||||
ft->name = g_strdup("Python");
|
ft->name = g_strdup("Python");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "Python");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("py");
|
ft->extension = g_strdup("py");
|
||||||
ft->pattern = utils_strv_new("*.py", "*.pyw", NULL);
|
ft->pattern = utils_strv_new("*.py", "*.pyw", NULL);
|
||||||
ft->comment_open = g_strdup("#");
|
ft->comment_open = g_strdup("#");
|
||||||
@ -291,7 +314,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_RUBY];
|
ft = filetypes[GEANY_FILETYPES_RUBY];
|
||||||
ft->lang = 14;
|
ft->lang = 14;
|
||||||
ft->name = g_strdup("Ruby");
|
ft->name = g_strdup("Ruby");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "Ruby");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("rb");
|
ft->extension = g_strdup("rb");
|
||||||
ft->pattern = utils_strv_new("*.rb", "*.rhtml", "*.ruby", NULL);
|
ft->pattern = utils_strv_new("*.rb", "*.rhtml", "*.ruby", NULL);
|
||||||
ft->comment_open = g_strdup("#");
|
ft->comment_open = g_strdup("#");
|
||||||
@ -302,7 +325,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_TCL];
|
ft = filetypes[GEANY_FILETYPES_TCL];
|
||||||
ft->lang = 15;
|
ft->lang = 15;
|
||||||
ft->name = g_strdup("Tcl");
|
ft->name = g_strdup("Tcl");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "Tcl");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("tcl");
|
ft->extension = g_strdup("tcl");
|
||||||
ft->pattern = utils_strv_new("*.tcl", "*.tk", "*.wish", NULL);
|
ft->pattern = utils_strv_new("*.tcl", "*.tk", "*.wish", NULL);
|
||||||
ft->comment_open = g_strdup("#");
|
ft->comment_open = g_strdup("#");
|
||||||
@ -313,7 +336,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_LUA];
|
ft = filetypes[GEANY_FILETYPES_LUA];
|
||||||
ft->lang = 22;
|
ft->lang = 22;
|
||||||
ft->name = g_strdup("Lua");
|
ft->name = g_strdup("Lua");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "Lua");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("lua");
|
ft->extension = g_strdup("lua");
|
||||||
ft->pattern = utils_strv_new("*.lua", NULL);
|
ft->pattern = utils_strv_new("*.lua", NULL);
|
||||||
ft->comment_open = g_strdup("--");
|
ft->comment_open = g_strdup("--");
|
||||||
@ -324,7 +347,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_FERITE];
|
ft = filetypes[GEANY_FILETYPES_FERITE];
|
||||||
ft->lang = 19;
|
ft->lang = 19;
|
||||||
ft->name = g_strdup("Ferite");
|
ft->name = g_strdup("Ferite");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "Ferite");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("fe");
|
ft->extension = g_strdup("fe");
|
||||||
ft->pattern = utils_strv_new("*.fe", NULL);
|
ft->pattern = utils_strv_new("*.fe", NULL);
|
||||||
ft->comment_open = g_strdup("/*");
|
ft->comment_open = g_strdup("/*");
|
||||||
@ -335,13 +358,24 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_HASKELL];
|
ft = filetypes[GEANY_FILETYPES_HASKELL];
|
||||||
ft->lang = 24;
|
ft->lang = 24;
|
||||||
ft->name = g_strdup("Haskell");
|
ft->name = g_strdup("Haskell");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "Haskell");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("hs");
|
ft->extension = g_strdup("hs");
|
||||||
ft->pattern = utils_strv_new("*.hs", "*.lhs", NULL);
|
ft->pattern = utils_strv_new("*.hs", "*.lhs", NULL);
|
||||||
ft->comment_open = g_strdup("--");
|
ft->comment_open = g_strdup("--");
|
||||||
ft->comment_close = NULL;
|
ft->comment_close = NULL;
|
||||||
ft->group = GEANY_FILETYPE_GROUP_COMPILED;
|
ft->group = GEANY_FILETYPE_GROUP_COMPILED;
|
||||||
|
|
||||||
|
#define MARKDOWN
|
||||||
|
ft = filetypes[GEANY_FILETYPES_MARKDOWN];
|
||||||
|
ft->lang = 36;
|
||||||
|
ft->name = g_strdup("Markdown");
|
||||||
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
|
ft->extension = g_strdup("md");
|
||||||
|
ft->pattern = utils_strv_new("*.mdml", "*.mdwn", "*.markdown", "*.md", NULL);
|
||||||
|
ft->comment_open = NULL;
|
||||||
|
ft->comment_close = NULL;
|
||||||
|
ft->group = GEANY_FILETYPE_GROUP_MISC;
|
||||||
|
|
||||||
#define SH
|
#define SH
|
||||||
ft = filetypes[GEANY_FILETYPES_SH];
|
ft = filetypes[GEANY_FILETYPES_SH];
|
||||||
ft->lang = 16;
|
ft->lang = 16;
|
||||||
@ -382,7 +416,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_DOCBOOK];
|
ft = filetypes[GEANY_FILETYPES_DOCBOOK];
|
||||||
ft->lang = 12;
|
ft->lang = 12;
|
||||||
ft->name = g_strdup("Docbook");
|
ft->name = g_strdup("Docbook");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "Docbook");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("docbook");
|
ft->extension = g_strdup("docbook");
|
||||||
ft->pattern = utils_strv_new("*.docbook", NULL);
|
ft->pattern = utils_strv_new("*.docbook", NULL);
|
||||||
ft->comment_open = g_strdup("<!--");
|
ft->comment_open = g_strdup("<!--");
|
||||||
@ -393,7 +427,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_HTML];
|
ft = filetypes[GEANY_FILETYPES_HTML];
|
||||||
ft->lang = 29;
|
ft->lang = 29;
|
||||||
ft->name = g_strdup("HTML");
|
ft->name = g_strdup("HTML");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "HTML");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("html");
|
ft->extension = g_strdup("html");
|
||||||
ft->pattern = utils_strv_new(
|
ft->pattern = utils_strv_new(
|
||||||
"*.htm", "*.html", "*.shtml", "*.hta", "*.htd", "*.htt", "*.cfm", NULL);
|
"*.htm", "*.html", "*.shtml", "*.hta", "*.htd", "*.htt", "*.cfm", NULL);
|
||||||
@ -427,7 +461,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_LATEX];
|
ft = filetypes[GEANY_FILETYPES_LATEX];
|
||||||
ft->lang = 8;
|
ft->lang = 8;
|
||||||
ft->name = g_strdup("LaTeX");
|
ft->name = g_strdup("LaTeX");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "LaTeX");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("tex");
|
ft->extension = g_strdup("tex");
|
||||||
ft->pattern = utils_strv_new("*.tex", "*.sty", "*.idx", "*.ltx", NULL);
|
ft->pattern = utils_strv_new("*.tex", "*.sty", "*.idx", "*.ltx", NULL);
|
||||||
ft->comment_open = g_strdup("%");
|
ft->comment_open = g_strdup("%");
|
||||||
@ -438,7 +472,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_VHDL];
|
ft = filetypes[GEANY_FILETYPES_VHDL];
|
||||||
ft->lang = 21;
|
ft->lang = 21;
|
||||||
ft->name = g_strdup("VHDL");
|
ft->name = g_strdup("VHDL");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "VHDL");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("vhd");
|
ft->extension = g_strdup("vhd");
|
||||||
ft->pattern = utils_strv_new("*.vhd", "*.vhdl", NULL);
|
ft->pattern = utils_strv_new("*.vhd", "*.vhdl", NULL);
|
||||||
ft->comment_open = g_strdup("--");
|
ft->comment_open = g_strdup("--");
|
||||||
@ -449,7 +483,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_DIFF];
|
ft = filetypes[GEANY_FILETYPES_DIFF];
|
||||||
ft->lang = 20;
|
ft->lang = 20;
|
||||||
ft->name = g_strdup("Diff");
|
ft->name = g_strdup("Diff");
|
||||||
ft->title = g_strdup(_("Diff file"));
|
filetype_make_title(ft, TITLE_FILE);
|
||||||
ft->extension = g_strdup("diff");
|
ft->extension = g_strdup("diff");
|
||||||
ft->pattern = utils_strv_new("*.diff", "*.patch", "*.rej", NULL);
|
ft->pattern = utils_strv_new("*.diff", "*.patch", "*.rej", NULL);
|
||||||
ft->comment_open = g_strdup("#");
|
ft->comment_open = g_strdup("#");
|
||||||
@ -483,7 +517,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_HAXE];
|
ft = filetypes[GEANY_FILETYPES_HAXE];
|
||||||
ft->lang = 27;
|
ft->lang = 27;
|
||||||
ft->name = g_strdup("Haxe");
|
ft->name = g_strdup("Haxe");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "Haxe");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("hx");
|
ft->extension = g_strdup("hx");
|
||||||
ft->pattern = utils_strv_new("*.hx", NULL);
|
ft->pattern = utils_strv_new("*.hx", NULL);
|
||||||
ft->comment_open = g_strdup("//");
|
ft->comment_open = g_strdup("//");
|
||||||
@ -494,7 +528,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_AS];
|
ft = filetypes[GEANY_FILETYPES_AS];
|
||||||
ft->lang = 34;
|
ft->lang = 34;
|
||||||
ft->name = g_strdup("ActionScript");
|
ft->name = g_strdup("ActionScript");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "Actionscript");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("as");
|
ft->extension = g_strdup("as");
|
||||||
ft->pattern = utils_strv_new("*.as", NULL);
|
ft->pattern = utils_strv_new("*.as", NULL);
|
||||||
ft->comment_open = g_strdup("//");
|
ft->comment_open = g_strdup("//");
|
||||||
@ -516,7 +550,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_REST];
|
ft = filetypes[GEANY_FILETYPES_REST];
|
||||||
ft->lang = 28;
|
ft->lang = 28;
|
||||||
ft->name = g_strdup("reStructuredText");
|
ft->name = g_strdup("reStructuredText");
|
||||||
ft->title = g_strdup(_("reStructuredText file"));
|
filetype_make_title(ft, TITLE_FILE);
|
||||||
ft->extension = g_strdup("rst");
|
ft->extension = g_strdup("rst");
|
||||||
ft->pattern = utils_strv_new(
|
ft->pattern = utils_strv_new(
|
||||||
"*.rest", "*.reST", "*.rst", NULL);
|
"*.rest", "*.reST", "*.rst", NULL);
|
||||||
@ -528,7 +562,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_MATLAB];
|
ft = filetypes[GEANY_FILETYPES_MATLAB];
|
||||||
ft->lang = 32;
|
ft->lang = 32;
|
||||||
ft->name = g_strdup("Matlab");
|
ft->name = g_strdup("Matlab");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "Matlab");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("m");
|
ft->extension = g_strdup("m");
|
||||||
ft->pattern = utils_strv_new("*.m", NULL);
|
ft->pattern = utils_strv_new("*.m", NULL);
|
||||||
ft->comment_open = g_strdup("%");
|
ft->comment_open = g_strdup("%");
|
||||||
@ -539,7 +573,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_YAML];
|
ft = filetypes[GEANY_FILETYPES_YAML];
|
||||||
ft->lang = -2;
|
ft->lang = -2;
|
||||||
ft->name = g_strdup("YAML");
|
ft->name = g_strdup("YAML");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "YAML");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("yaml");
|
ft->extension = g_strdup("yaml");
|
||||||
ft->pattern = utils_strv_new("*.yaml", "*.yml", NULL);
|
ft->pattern = utils_strv_new("*.yaml", "*.yml", NULL);
|
||||||
ft->comment_open = g_strdup("#");
|
ft->comment_open = g_strdup("#");
|
||||||
@ -550,7 +584,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_CMAKE];
|
ft = filetypes[GEANY_FILETYPES_CMAKE];
|
||||||
ft->lang = -2;
|
ft->lang = -2;
|
||||||
ft->name = g_strdup("CMake");
|
ft->name = g_strdup("CMake");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "CMake");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("cmake");
|
ft->extension = g_strdup("cmake");
|
||||||
ft->pattern = utils_strv_new("CMakeLists.txt", "*.cmake", "*.ctest", NULL);
|
ft->pattern = utils_strv_new("CMakeLists.txt", "*.cmake", "*.ctest", NULL);
|
||||||
ft->comment_open = g_strdup("#");
|
ft->comment_open = g_strdup("#");
|
||||||
@ -561,7 +595,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_NSIS];
|
ft = filetypes[GEANY_FILETYPES_NSIS];
|
||||||
ft->lang = 35;
|
ft->lang = 35;
|
||||||
ft->name = g_strdup("NSIS");
|
ft->name = g_strdup("NSIS");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "NSIS");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("nsis");
|
ft->extension = g_strdup("nsis");
|
||||||
ft->pattern = utils_strv_new("*.nsi", "*.nsh", NULL);
|
ft->pattern = utils_strv_new("*.nsi", "*.nsh", NULL);
|
||||||
ft->comment_open = g_strdup(";");
|
ft->comment_open = g_strdup(";");
|
||||||
@ -572,7 +606,7 @@ static void init_builtin_filetypes(void)
|
|||||||
ft = filetypes[GEANY_FILETYPES_ADA];
|
ft = filetypes[GEANY_FILETYPES_ADA];
|
||||||
ft->lang = -2;
|
ft->lang = -2;
|
||||||
ft->name = g_strdup("Ada");
|
ft->name = g_strdup("Ada");
|
||||||
ft->title = g_strdup_printf(_("%s source file"), "Ada");
|
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||||
ft->extension = g_strdup("adb");
|
ft->extension = g_strdup("adb");
|
||||||
ft->pattern = utils_strv_new("*.adb", "*.ads", NULL);
|
ft->pattern = utils_strv_new("*.adb", "*.ads", NULL);
|
||||||
ft->comment_open = g_strdup("--");
|
ft->comment_open = g_strdup("--");
|
||||||
|
@ -77,7 +77,7 @@ typedef enum
|
|||||||
GEANY_FILETYPES_VHDL,
|
GEANY_FILETYPES_VHDL,
|
||||||
GEANY_FILETYPES_ADA,
|
GEANY_FILETYPES_ADA,
|
||||||
GEANY_FILETYPES_CMAKE,
|
GEANY_FILETYPES_CMAKE,
|
||||||
|
GEANY_FILETYPES_MARKDOWN,
|
||||||
/* ^ append items here */
|
/* ^ append items here */
|
||||||
GEANY_MAX_BUILT_IN_FILETYPES /* Don't use this, use filetypes_array->len instead */
|
GEANY_MAX_BUILT_IN_FILETYPES /* Don't use this, use filetypes_array->len instead */
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
* listed in the documentation should not be changed */
|
* listed in the documentation should not be changed */
|
||||||
#define GEANY_FILEDEFS_SUBDIR "filedefs"
|
#define GEANY_FILEDEFS_SUBDIR "filedefs"
|
||||||
#define GEANY_TEMPLATES_SUBDIR "templates"
|
#define GEANY_TEMPLATES_SUBDIR "templates"
|
||||||
#define GEANY_CODENAME "Kaine"
|
#define GEANY_CODENAME "Vellam"
|
||||||
#define GEANY_HOMEPAGE "http://www.geany.org/"
|
#define GEANY_HOMEPAGE "http://www.geany.org/"
|
||||||
#define GEANY_USE_WIN32_DIALOG 0
|
#define GEANY_USE_WIN32_DIALOG 0
|
||||||
#define GEANY_STRING_UNTITLED _("untitled")
|
#define GEANY_STRING_UNTITLED _("untitled")
|
||||||
|
@ -906,9 +906,6 @@ static void styleset_c_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
|
|||||||
get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_C, 1, "");
|
get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_C, 1, "");
|
||||||
get_keyfile_keywords(config, config_home, "docComment", GEANY_FILETYPES_C, 2, "TODO FIXME");
|
get_keyfile_keywords(config, config_home, "docComment", GEANY_FILETYPES_C, 2, "TODO FIXME");
|
||||||
style_sets[GEANY_FILETYPES_C].keywords[3] = NULL;
|
style_sets[GEANY_FILETYPES_C].keywords[3] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_C].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -948,9 +945,6 @@ static void styleset_cpp_init(gint ft_id, GKeyFile *config, GKeyFile *config_hom
|
|||||||
get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_CPP, 1, "");
|
get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_CPP, 1, "");
|
||||||
get_keyfile_keywords(config, config_home, "docComment", GEANY_FILETYPES_CPP, 2, "TODO FIXME");
|
get_keyfile_keywords(config, config_home, "docComment", GEANY_FILETYPES_CPP, 2, "TODO FIXME");
|
||||||
style_sets[GEANY_FILETYPES_CPP].keywords[3] = NULL;
|
style_sets[GEANY_FILETYPES_CPP].keywords[3] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_CPP].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1002,9 +996,6 @@ static void styleset_glsl_init(gint ft_id, GKeyFile *config, GKeyFile *config_ho
|
|||||||
get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_GLSL, 1, "");
|
get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_GLSL, 1, "");
|
||||||
get_keyfile_keywords(config, config_home, "docComment", GEANY_FILETYPES_GLSL, 2, "TODO FIXME");
|
get_keyfile_keywords(config, config_home, "docComment", GEANY_FILETYPES_GLSL, 2, "TODO FIXME");
|
||||||
style_sets[GEANY_FILETYPES_GLSL].keywords[3] = NULL;
|
style_sets[GEANY_FILETYPES_GLSL].keywords[3] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_GLSL].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1052,9 +1043,6 @@ static void styleset_cs_init(gint ft_id, GKeyFile *config, GKeyFile *config_home
|
|||||||
get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_CS, 1, "");
|
get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_CS, 1, "");
|
||||||
get_keyfile_keywords(config, config_home, "docComment", GEANY_FILETYPES_CS, 2, "");
|
get_keyfile_keywords(config, config_home, "docComment", GEANY_FILETYPES_CS, 2, "");
|
||||||
style_sets[GEANY_FILETYPES_CS].keywords[3] = NULL;
|
style_sets[GEANY_FILETYPES_CS].keywords[3] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_CS].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1112,9 +1100,6 @@ static void styleset_vala_init(gint ft_id, GKeyFile *config, GKeyFile *config_ho
|
|||||||
get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_VALA, 1, "");
|
get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_VALA, 1, "");
|
||||||
get_keyfile_keywords(config, config_home, "docComment", GEANY_FILETYPES_VALA, 2, "");
|
get_keyfile_keywords(config, config_home, "docComment", GEANY_FILETYPES_VALA, 2, "");
|
||||||
style_sets[GEANY_FILETYPES_VALA].keywords[3] = NULL;
|
style_sets[GEANY_FILETYPES_VALA].keywords[3] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_VALA].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1161,9 +1146,6 @@ static void styleset_pascal_init(gint ft_id, GKeyFile *config, GKeyFile *config_
|
|||||||
"asm begin byte case char class do else end for function if implementation integer \
|
"asm begin byte case char class do else end for function if implementation integer \
|
||||||
interface object procedure program real repeat string then to try unit until uses var word");
|
interface object procedure program real repeat string then to try unit until uses var word");
|
||||||
style_sets[GEANY_FILETYPES_PASCAL].keywords[1] = NULL;
|
style_sets[GEANY_FILETYPES_PASCAL].keywords[1] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_PASCAL].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1208,9 +1190,6 @@ static void styleset_makefile_init(gint ft_id, GKeyFile *config, GKeyFile *confi
|
|||||||
get_keyfile_hex(config, config_home, "ideol", 0x008000, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MAKE].styling[6]);
|
get_keyfile_hex(config, config_home, "ideol", 0x008000, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MAKE].styling[6]);
|
||||||
|
|
||||||
style_sets[GEANY_FILETYPES_MAKE].keywords = NULL;
|
style_sets[GEANY_FILETYPES_MAKE].keywords = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_MAKE].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1244,9 +1223,6 @@ static void styleset_diff_init(gint ft_id, GKeyFile *config, GKeyFile *config_ho
|
|||||||
get_keyfile_hex(config, config_home, "changed", 0x7f007f, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_DIFF].styling[7]);
|
get_keyfile_hex(config, config_home, "changed", 0x7f007f, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_DIFF].styling[7]);
|
||||||
|
|
||||||
style_sets[GEANY_FILETYPES_DIFF].keywords = NULL;
|
style_sets[GEANY_FILETYPES_DIFF].keywords = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_DIFF].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1280,9 +1256,6 @@ static void styleset_latex_init(gint ft_id, GKeyFile *config, GKeyFile *config_h
|
|||||||
style_sets[GEANY_FILETYPES_LATEX].keywords = g_new(gchar*, 2);
|
style_sets[GEANY_FILETYPES_LATEX].keywords = g_new(gchar*, 2);
|
||||||
get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_LATEX, 0, "section subsection begin item");
|
get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_LATEX, 0, "section subsection begin item");
|
||||||
style_sets[GEANY_FILETYPES_LATEX].keywords[1] = NULL;
|
style_sets[GEANY_FILETYPES_LATEX].keywords[1] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_LATEX].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1307,9 +1280,6 @@ static void styleset_php_init(gint ft_id, GKeyFile *config, GKeyFile *config_hom
|
|||||||
{
|
{
|
||||||
style_sets[GEANY_FILETYPES_PHP].styling = NULL;
|
style_sets[GEANY_FILETYPES_PHP].styling = NULL;
|
||||||
style_sets[GEANY_FILETYPES_PHP].keywords = NULL;
|
style_sets[GEANY_FILETYPES_PHP].keywords = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_PHP].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1330,9 +1300,6 @@ static void styleset_html_init(gint ft_id, GKeyFile *config, GKeyFile *config_ho
|
|||||||
{
|
{
|
||||||
style_sets[GEANY_FILETYPES_HTML].styling = NULL;
|
style_sets[GEANY_FILETYPES_HTML].styling = NULL;
|
||||||
style_sets[GEANY_FILETYPES_HTML].keywords = NULL;
|
style_sets[GEANY_FILETYPES_HTML].keywords = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_HTML].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1418,9 +1385,6 @@ static void styleset_markup_init(gint ft_id, GKeyFile *config, GKeyFile *config_
|
|||||||
get_keyfile_keywords(config, config_home, "php", GEANY_FILETYPES_XML, 4, "abstract and array as bool boolean break case catch cfunction __class__ class clone const continue declare default die __dir__ directory do double echo else elseif empty enddeclare endfor endforeach endif endswitch endwhile eval exception exit extends false __file__ final float for foreach __function__ function goto global if implements include include_once int integer interface isset __line__ list __method__ namespace __namespace__ new null object old_function or parent php_user_filter print private protected public real require require_once resource return __sleep static stdclass string switch this throw true try unset use var __wakeup while xor");
|
get_keyfile_keywords(config, config_home, "php", GEANY_FILETYPES_XML, 4, "abstract and array as bool boolean break case catch cfunction __class__ class clone const continue declare default die __dir__ directory do double echo else elseif empty enddeclare endfor endforeach endif endswitch endwhile eval exception exit extends false __file__ final float for foreach __function__ function goto global if implements include include_once int integer interface isset __line__ list __method__ namespace __namespace__ new null object old_function or parent php_user_filter print private protected public real require require_once resource return __sleep static stdclass string switch this throw true try unset use var __wakeup while xor");
|
||||||
get_keyfile_keywords(config, config_home, "sgml", GEANY_FILETYPES_XML, 5, "ELEMENT DOCTYPE ATTLIST ENTITY NOTATION");
|
get_keyfile_keywords(config, config_home, "sgml", GEANY_FILETYPES_XML, 5, "ELEMENT DOCTYPE ATTLIST ENTITY NOTATION");
|
||||||
style_sets[GEANY_FILETYPES_XML].keywords[6] = NULL;
|
style_sets[GEANY_FILETYPES_XML].keywords[6] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_XML].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1597,9 +1561,6 @@ static void styleset_java_init(gint ft_id, GKeyFile *config, GKeyFile *config_ho
|
|||||||
get_keyfile_keywords(config, config_home, "doccomment", GEANY_FILETYPES_JAVA, 2, "return param author throws");
|
get_keyfile_keywords(config, config_home, "doccomment", GEANY_FILETYPES_JAVA, 2, "return param author throws");
|
||||||
get_keyfile_keywords(config, config_home, "typedefs", GEANY_FILETYPES_JAVA, 3, "");
|
get_keyfile_keywords(config, config_home, "typedefs", GEANY_FILETYPES_JAVA, 3, "");
|
||||||
style_sets[GEANY_FILETYPES_JAVA].keywords[4] = NULL;
|
style_sets[GEANY_FILETYPES_JAVA].keywords[4] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_JAVA].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1688,9 +1649,6 @@ static void styleset_perl_init(gint ft_id, GKeyFile *config, GKeyFile *config_ho
|
|||||||
use utime values vec wait waitpid wantarray warn while write \
|
use utime values vec wait waitpid wantarray warn while write \
|
||||||
x xor y");
|
x xor y");
|
||||||
style_sets[GEANY_FILETYPES_PERL].keywords[1] = NULL;
|
style_sets[GEANY_FILETYPES_PERL].keywords[1] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_PERL].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1767,9 +1725,6 @@ static void styleset_python_init(gint ft_id, GKeyFile *config, GKeyFile *config_
|
|||||||
get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_PYTHON, 0, "and as assert break class continue def del elif else except exec finally for from global if import in is lambda not or pass print raise return try while with yield False None True");
|
get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_PYTHON, 0, "and as assert break class continue def del elif else except exec finally for from global if import in is lambda not or pass print raise return try while with yield False None True");
|
||||||
get_keyfile_keywords(config, config_home, "identifiers", GEANY_FILETYPES_PYTHON, 1, "");
|
get_keyfile_keywords(config, config_home, "identifiers", GEANY_FILETYPES_PYTHON, 1, "");
|
||||||
style_sets[GEANY_FILETYPES_PYTHON].keywords[2] = NULL;
|
style_sets[GEANY_FILETYPES_PYTHON].keywords[2] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_PYTHON].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1829,9 +1784,6 @@ static void styleset_cmake_init(gint ft_id, GKeyFile *config, GKeyFile *config_h
|
|||||||
get_keyfile_keywords(config, config_home, "parameters", GEANY_FILETYPES_CMAKE, 1, "");
|
get_keyfile_keywords(config, config_home, "parameters", GEANY_FILETYPES_CMAKE, 1, "");
|
||||||
get_keyfile_keywords(config, config_home, "userdefined", GEANY_FILETYPES_CMAKE, 2, "");
|
get_keyfile_keywords(config, config_home, "userdefined", GEANY_FILETYPES_CMAKE, 2, "");
|
||||||
style_sets[GEANY_FILETYPES_CMAKE].keywords[3] = NULL;
|
style_sets[GEANY_FILETYPES_CMAKE].keywords[3] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_CMAKE].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1886,9 +1838,6 @@ static void styleset_r_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
|
|||||||
get_keyfile_keywords(config, config_home, "package", GEANY_FILETYPES_R, 1, NULL);
|
get_keyfile_keywords(config, config_home, "package", GEANY_FILETYPES_R, 1, NULL);
|
||||||
get_keyfile_keywords(config, config_home, "package_other", GEANY_FILETYPES_R, 2, NULL);
|
get_keyfile_keywords(config, config_home, "package_other", GEANY_FILETYPES_R, 2, NULL);
|
||||||
style_sets[GEANY_FILETYPES_R].keywords[3] = NULL;
|
style_sets[GEANY_FILETYPES_R].keywords[3] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_R].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1960,9 +1909,6 @@ static void styleset_ruby_init(gint ft_id, GKeyFile *config, GKeyFile *config_ho
|
|||||||
style_sets[GEANY_FILETYPES_RUBY].keywords = g_new(gchar*, 2);
|
style_sets[GEANY_FILETYPES_RUBY].keywords = g_new(gchar*, 2);
|
||||||
get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_RUBY, 0, "load define_method attr_accessor attr_writer attr_reader include __FILE__ and def end in or self unless __LINE__ begin defined? ensure module redo super until BEGIN break do false next rescue then when END case else for nil require retry true while alias class elsif if not return undef yield");
|
get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_RUBY, 0, "load define_method attr_accessor attr_writer attr_reader include __FILE__ and def end in or self unless __LINE__ begin defined? ensure module redo super until BEGIN break do false next rescue then when END case else for nil require retry true while alias class elsif if not return undef yield");
|
||||||
style_sets[GEANY_FILETYPES_RUBY].keywords[1] = NULL;
|
style_sets[GEANY_FILETYPES_RUBY].keywords[1] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_RUBY].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2034,9 +1980,6 @@ static void styleset_sh_init(gint ft_id, GKeyFile *config, GKeyFile *config_home
|
|||||||
style_sets[GEANY_FILETYPES_SH].keywords = g_new(gchar*, 2);
|
style_sets[GEANY_FILETYPES_SH].keywords = g_new(gchar*, 2);
|
||||||
get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_SH, 0, "break case continue do done elif else esac eval exit export fi for goto if in integer return set shift then until while");
|
get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_SH, 0, "break case continue do done elif else esac eval exit export fi for goto if in integer return set shift then until while");
|
||||||
style_sets[GEANY_FILETYPES_SH].keywords[1] = NULL;
|
style_sets[GEANY_FILETYPES_SH].keywords[1] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_SH].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2169,9 +2112,6 @@ static void styleset_docbook_init(gint ft_id, GKeyFile *config, GKeyFile *config
|
|||||||
userlevel url vendor xreflabel status label endterm linkend space width");
|
userlevel url vendor xreflabel status label endterm linkend space width");
|
||||||
get_keyfile_keywords(config, config_home, "dtd", GEANY_FILETYPES_DOCBOOK, 1, "ELEMENT DOCTYPE ATTLIST ENTITY NOTATION");
|
get_keyfile_keywords(config, config_home, "dtd", GEANY_FILETYPES_DOCBOOK, 1, "ELEMENT DOCTYPE ATTLIST ENTITY NOTATION");
|
||||||
style_sets[GEANY_FILETYPES_DOCBOOK].keywords[2] = NULL;
|
style_sets[GEANY_FILETYPES_DOCBOOK].keywords[2] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_DOCBOOK].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2274,9 +2214,6 @@ static void styleset_css_init(gint ft_id, GKeyFile *config, GKeyFile *config_hom
|
|||||||
get_keyfile_keywords(config, config_home, "browser_pseudo_classes", GEANY_FILETYPES_CSS, 6, "");
|
get_keyfile_keywords(config, config_home, "browser_pseudo_classes", GEANY_FILETYPES_CSS, 6, "");
|
||||||
get_keyfile_keywords(config, config_home, "browser_pseudo_elements", GEANY_FILETYPES_CSS, 7, "");
|
get_keyfile_keywords(config, config_home, "browser_pseudo_elements", GEANY_FILETYPES_CSS, 7, "");
|
||||||
style_sets[GEANY_FILETYPES_CSS].keywords[8] = NULL;
|
style_sets[GEANY_FILETYPES_CSS].keywords[8] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_CSS].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2347,9 +2284,6 @@ static void styleset_nsis_init(gint ft_id, GKeyFile *config, GKeyFile *config_ho
|
|||||||
get_keyfile_keywords(config, config_home, "lables", GEANY_FILETYPES_NSIS, 2, "");
|
get_keyfile_keywords(config, config_home, "lables", GEANY_FILETYPES_NSIS, 2, "");
|
||||||
get_keyfile_keywords(config, config_home, "userdefined", GEANY_FILETYPES_NSIS, 3, "");
|
get_keyfile_keywords(config, config_home, "userdefined", GEANY_FILETYPES_NSIS, 3, "");
|
||||||
style_sets[GEANY_FILETYPES_NSIS].keywords[4] = NULL;
|
style_sets[GEANY_FILETYPES_NSIS].keywords[4] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_NSIS].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2404,9 +2338,6 @@ static void styleset_po_init(gint ft_id, GKeyFile *config, GKeyFile *config_home
|
|||||||
get_keyfile_hex(config, config_home, "fuzzy", 0xffa500, 0xffffff, TRUE, &style_sets[GEANY_FILETYPES_PO].styling[8]);
|
get_keyfile_hex(config, config_home, "fuzzy", 0xffa500, 0xffffff, TRUE, &style_sets[GEANY_FILETYPES_PO].styling[8]);
|
||||||
|
|
||||||
style_sets[GEANY_FILETYPES_PO].keywords = NULL;
|
style_sets[GEANY_FILETYPES_PO].keywords = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_PO].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2440,9 +2371,6 @@ static void styleset_conf_init(gint ft_id, GKeyFile *config, GKeyFile *config_ho
|
|||||||
get_keyfile_hex(config, config_home, "defval", 0x00007f, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_CONF].styling[5]);
|
get_keyfile_hex(config, config_home, "defval", 0x00007f, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_CONF].styling[5]);
|
||||||
|
|
||||||
style_sets[GEANY_FILETYPES_CONF].keywords = NULL;
|
style_sets[GEANY_FILETYPES_CONF].keywords = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_CONF].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2488,9 +2416,6 @@ static void styleset_asm_init(gint ft_id, GKeyFile *config, GKeyFile *config_hom
|
|||||||
get_keyfile_keywords(config, config_home, "registers", GEANY_FILETYPES_ASM, 1, "");
|
get_keyfile_keywords(config, config_home, "registers", GEANY_FILETYPES_ASM, 1, "");
|
||||||
get_keyfile_keywords(config, config_home, "directives", GEANY_FILETYPES_ASM, 2, "ORG LIST NOLIST PAGE EQUIVALENT WORD TEXT");
|
get_keyfile_keywords(config, config_home, "directives", GEANY_FILETYPES_ASM, 2, "ORG LIST NOLIST PAGE EQUIVALENT WORD TEXT");
|
||||||
style_sets[GEANY_FILETYPES_ASM].keywords[3] = NULL;
|
style_sets[GEANY_FILETYPES_ASM].keywords[3] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_ASM].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2549,9 +2474,6 @@ static void styleset_f77_init(gint ft_id, GKeyFile *config, GKeyFile *config_hom
|
|||||||
get_keyfile_keywords(config, config_home, "intrinsic_functions", GEANY_FILETYPES_F77, 1, "");
|
get_keyfile_keywords(config, config_home, "intrinsic_functions", GEANY_FILETYPES_F77, 1, "");
|
||||||
get_keyfile_keywords(config, config_home, "user_functions", GEANY_FILETYPES_F77, 2, "");
|
get_keyfile_keywords(config, config_home, "user_functions", GEANY_FILETYPES_F77, 2, "");
|
||||||
style_sets[GEANY_FILETYPES_F77].keywords[3] = NULL;
|
style_sets[GEANY_FILETYPES_F77].keywords[3] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_F77].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2608,9 +2530,6 @@ static void styleset_fortran_init(gint ft_id, GKeyFile *config, GKeyFile *config
|
|||||||
get_keyfile_keywords(config, config_home, "intrinsic_functions", GEANY_FILETYPES_FORTRAN, 1, "");
|
get_keyfile_keywords(config, config_home, "intrinsic_functions", GEANY_FILETYPES_FORTRAN, 1, "");
|
||||||
get_keyfile_keywords(config, config_home, "user_functions", GEANY_FILETYPES_FORTRAN, 2, "");
|
get_keyfile_keywords(config, config_home, "user_functions", GEANY_FILETYPES_FORTRAN, 2, "");
|
||||||
style_sets[GEANY_FILETYPES_FORTRAN].keywords[3] = NULL;
|
style_sets[GEANY_FILETYPES_FORTRAN].keywords[3] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_FORTRAN].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2692,9 +2611,6 @@ static void styleset_sql_init(gint ft_id, GKeyFile *config, GKeyFile *config_hom
|
|||||||
type under union unique unknown unnest update usage user using value values varchar varchar2 variable varying \
|
type under union unique unknown unnest update usage user using value values varchar varchar2 variable varying \
|
||||||
view when whenever where with without work write year zone");
|
view when whenever where with without work write year zone");
|
||||||
style_sets[GEANY_FILETYPES_SQL].keywords[1] = NULL;
|
style_sets[GEANY_FILETYPES_SQL].keywords[1] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_SQL].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2725,6 +2641,62 @@ static void styleset_sql(ScintillaObject *sci)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void styleset_markdown_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
|
||||||
|
{
|
||||||
|
new_style_array(GEANY_FILETYPES_MARKDOWN, 17);
|
||||||
|
|
||||||
|
get_keyfile_hex(config, config_home, "default", 0x000000, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MARKDOWN].styling[0]);
|
||||||
|
get_keyfile_hex(config, config_home, "strong", 0xff0000, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MARKDOWN].styling[1]);
|
||||||
|
get_keyfile_hex(config, config_home, "emphasis", 0xff0000, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MARKDOWN].styling[2]);
|
||||||
|
get_keyfile_hex(config, config_home, "header1", 0x0000bb, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MARKDOWN].styling[3]);
|
||||||
|
get_keyfile_hex(config, config_home, "header2", 0x0000bb, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MARKDOWN].styling[4]);
|
||||||
|
get_keyfile_hex(config, config_home, "header3", 0x0000bb, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MARKDOWN].styling[5]);
|
||||||
|
get_keyfile_hex(config, config_home, "header4", 0x0000bb, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MARKDOWN].styling[6]);
|
||||||
|
get_keyfile_hex(config, config_home, "header5", 0x0000bb, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MARKDOWN].styling[7]);
|
||||||
|
get_keyfile_hex(config, config_home, "header6", 0x0000bb, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MARKDOWN].styling[8]);
|
||||||
|
get_keyfile_hex(config, config_home, "ulist_item", 0x007f00, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MARKDOWN].styling[9]);
|
||||||
|
get_keyfile_hex(config, config_home, "olist_item", 0x007f00, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MARKDOWN].styling[10]);
|
||||||
|
get_keyfile_hex(config, config_home, "blockquote", 0xff0000, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MARKDOWN].styling[11]);
|
||||||
|
get_keyfile_hex(config, config_home, "strikeout", 0xaa00ff, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MARKDOWN].styling[12]);
|
||||||
|
get_keyfile_hex(config, config_home, "hrule", 0xff901e, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MARKDOWN].styling[13]);
|
||||||
|
get_keyfile_hex(config, config_home, "link", 0x0000ff, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MARKDOWN].styling[14]);
|
||||||
|
get_keyfile_hex(config, config_home, "code", 0x009f00, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MARKDOWN].styling[15]);
|
||||||
|
get_keyfile_hex(config, config_home, "codebk", 0x005f00, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_MARKDOWN].styling[16]);
|
||||||
|
|
||||||
|
style_sets[GEANY_FILETYPES_MARKDOWN].keywords = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void styleset_markdown(ScintillaObject *sci)
|
||||||
|
{
|
||||||
|
const filetype_id ft_id = GEANY_FILETYPES_MARKDOWN;
|
||||||
|
|
||||||
|
apply_filetype_properties(sci, SCLEX_MARKDOWN, ft_id);
|
||||||
|
|
||||||
|
set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_MARKDOWN, 0);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_DEFAULT, GEANY_FILETYPES_MARKDOWN, 0);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_LINE_BEGIN, GEANY_FILETYPES_MARKDOWN, 0);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_PRECHAR, GEANY_FILETYPES_MARKDOWN, 0);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_STRONG1, GEANY_FILETYPES_MARKDOWN, 1);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_STRONG2, GEANY_FILETYPES_MARKDOWN, 1);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_EM1, GEANY_FILETYPES_MARKDOWN, 2);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_EM2, GEANY_FILETYPES_MARKDOWN, 2);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_HEADER1, GEANY_FILETYPES_MARKDOWN, 3);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_HEADER2, GEANY_FILETYPES_MARKDOWN, 4);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_HEADER3, GEANY_FILETYPES_MARKDOWN, 5);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_HEADER4, GEANY_FILETYPES_MARKDOWN, 6);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_HEADER5, GEANY_FILETYPES_MARKDOWN, 7);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_HEADER6, GEANY_FILETYPES_MARKDOWN, 8);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_ULIST_ITEM, GEANY_FILETYPES_MARKDOWN, 9);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_OLIST_ITEM, GEANY_FILETYPES_MARKDOWN, 10);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_BLOCKQUOTE, GEANY_FILETYPES_MARKDOWN, 11);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_STRIKEOUT, GEANY_FILETYPES_MARKDOWN, 12);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_HRULE, GEANY_FILETYPES_MARKDOWN, 13);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_LINK, GEANY_FILETYPES_MARKDOWN, 14);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_CODE, GEANY_FILETYPES_MARKDOWN, 15);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_CODE2, GEANY_FILETYPES_MARKDOWN, 15);
|
||||||
|
set_sci_style(sci, SCE_MARKDOWN_CODEBK, GEANY_FILETYPES_MARKDOWN, 16);
|
||||||
|
}
|
||||||
|
|
||||||
static void styleset_haskell_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
|
static void styleset_haskell_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
|
||||||
{
|
{
|
||||||
new_style_array(GEANY_FILETYPES_HASKELL, 17);
|
new_style_array(GEANY_FILETYPES_HASKELL, 17);
|
||||||
@ -2751,8 +2723,6 @@ static void styleset_haskell_init(gint ft_id, GKeyFile *config, GKeyFile *config
|
|||||||
get_keyfile_keywords(config, config_home, "keywords", GEANY_FILETYPES_HASKELL, 0,
|
get_keyfile_keywords(config, config_home, "keywords", GEANY_FILETYPES_HASKELL, 0,
|
||||||
"as case class data deriving do else if import in infixl infixr instance let module of primitive qualified then type where");
|
"as case class data deriving do else if import in infixl infixr instance let module of primitive qualified then type where");
|
||||||
style_sets[GEANY_FILETYPES_HASKELL].keywords[1] = NULL;
|
style_sets[GEANY_FILETYPES_HASKELL].keywords[1] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home, &style_sets[GEANY_FILETYPES_HASKELL].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2812,9 +2782,6 @@ static void styleset_caml_init(gint ft_id, GKeyFile *config, GKeyFile *config_ho
|
|||||||
or private rec sig struct then to true try type val virtual when while with");
|
or private rec sig struct then to true try type val virtual when while with");
|
||||||
get_keyfile_keywords(config, config_home, "keywords_optional", GEANY_FILETYPES_CAML, 1, "option Some None ignore ref");
|
get_keyfile_keywords(config, config_home, "keywords_optional", GEANY_FILETYPES_CAML, 1, "option Some None ignore ref");
|
||||||
style_sets[GEANY_FILETYPES_CAML].keywords[2] = NULL;
|
style_sets[GEANY_FILETYPES_CAML].keywords[2] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_CAML].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2872,9 +2839,6 @@ static void styleset_tcl_init(gint ft_id, GKeyFile *config, GKeyFile *config_hom
|
|||||||
get_keyfile_keywords(config, config_home, "tkcommands", GEANY_FILETYPES_TCL, 3, "");
|
get_keyfile_keywords(config, config_home, "tkcommands", GEANY_FILETYPES_TCL, 3, "");
|
||||||
get_keyfile_keywords(config, config_home, "expand", GEANY_FILETYPES_TCL, 4, "");
|
get_keyfile_keywords(config, config_home, "expand", GEANY_FILETYPES_TCL, 4, "");
|
||||||
style_sets[GEANY_FILETYPES_TCL].keywords[5] = NULL;
|
style_sets[GEANY_FILETYPES_TCL].keywords[5] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_TCL].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2926,9 +2890,6 @@ static void styleset_matlab_init(gint ft_id, GKeyFile *config, GKeyFile *config_
|
|||||||
style_sets[GEANY_FILETYPES_MATLAB].keywords = g_new(gchar*, 2);
|
style_sets[GEANY_FILETYPES_MATLAB].keywords = g_new(gchar*, 2);
|
||||||
get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_MATLAB, 0, "break case catch continue else elseif end for function global if otherwise persistent return switch try while");
|
get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_MATLAB, 0, "break case catch continue else elseif end for function global if otherwise persistent return switch try while");
|
||||||
style_sets[GEANY_FILETYPES_MATLAB].keywords[1] = NULL;
|
style_sets[GEANY_FILETYPES_MATLAB].keywords[1] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_MATLAB].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2996,8 +2957,6 @@ static void styleset_d_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
|
|||||||
get_keyfile_keywords(config, config_home, "types", GEANY_FILETYPES_D, 3,
|
get_keyfile_keywords(config, config_home, "types", GEANY_FILETYPES_D, 3,
|
||||||
"");
|
"");
|
||||||
style_sets[GEANY_FILETYPES_D].keywords[4] = NULL;
|
style_sets[GEANY_FILETYPES_D].keywords[4] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home, &style_sets[GEANY_FILETYPES_D].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3048,9 +3007,6 @@ static void styleset_ferite_init(gint ft_id, GKeyFile *config, GKeyFile *config_
|
|||||||
get_keyfile_keywords(config, config_home, "types", GEANY_FILETYPES_FERITE, 1, "boolean string number array object void");
|
get_keyfile_keywords(config, config_home, "types", GEANY_FILETYPES_FERITE, 1, "boolean string number array object void");
|
||||||
get_keyfile_keywords(config, config_home, "docComment", GEANY_FILETYPES_FERITE, 2, "brief class declaration description end example extends function group implements modifies module namespace param protocol return return static type variable warning");
|
get_keyfile_keywords(config, config_home, "docComment", GEANY_FILETYPES_FERITE, 2, "brief class declaration description end example extends function group implements modifies module namespace param protocol return return static type variable warning");
|
||||||
style_sets[GEANY_FILETYPES_FERITE].keywords[3] = NULL;
|
style_sets[GEANY_FILETYPES_FERITE].keywords[3] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_FERITE].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3118,9 +3074,6 @@ static void styleset_vhdl_init(gint ft_id, GKeyFile *config, GKeyFile *config_ho
|
|||||||
std_ulogic_vector std_logic std_logic_vector X01 X01Z UX01 UX01Z unsigned signed");
|
std_ulogic_vector std_logic std_logic_vector X01 X01Z UX01 UX01Z unsigned signed");
|
||||||
get_keyfile_keywords(config, config_home, "userwords", GEANY_FILETYPES_VHDL, 6, "");
|
get_keyfile_keywords(config, config_home, "userwords", GEANY_FILETYPES_VHDL, 6, "");
|
||||||
style_sets[GEANY_FILETYPES_VHDL].keywords[7] = NULL;
|
style_sets[GEANY_FILETYPES_VHDL].keywords[7] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_VHDL].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3175,9 +3128,6 @@ static void styleset_yaml_init(gint ft_id, GKeyFile *config, GKeyFile *config_ho
|
|||||||
style_sets[GEANY_FILETYPES_YAML].keywords = g_new(gchar*, 2);
|
style_sets[GEANY_FILETYPES_YAML].keywords = g_new(gchar*, 2);
|
||||||
get_keyfile_keywords(config, config_home, "keywords", GEANY_FILETYPES_YAML, 0, "true false yes no");
|
get_keyfile_keywords(config, config_home, "keywords", GEANY_FILETYPES_YAML, 0, "true false yes no");
|
||||||
style_sets[GEANY_FILETYPES_YAML].keywords[1] = NULL;
|
style_sets[GEANY_FILETYPES_YAML].keywords[1] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_VHDL].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3224,8 +3174,6 @@ static void styleset_js_init(gint ft_id, GKeyFile *config, GKeyFile *config_home
|
|||||||
toUpperCase transient true try typeof undefined unescape unshift valueOf \
|
toUpperCase transient true try typeof undefined unescape unshift valueOf \
|
||||||
var void volatile while with");
|
var void volatile while with");
|
||||||
style_sets[GEANY_FILETYPES_JS].keywords[1] = NULL;
|
style_sets[GEANY_FILETYPES_JS].keywords[1] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home, &style_sets[GEANY_FILETYPES_JS].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3303,9 +3251,6 @@ static void styleset_lua_init(gint ft_id, GKeyFile *config, GKeyFile *config_hom
|
|||||||
get_keyfile_keywords(config, config_home, "user3", GEANY_FILETYPES_LUA, 6, "");
|
get_keyfile_keywords(config, config_home, "user3", GEANY_FILETYPES_LUA, 6, "");
|
||||||
get_keyfile_keywords(config, config_home, "user4", GEANY_FILETYPES_LUA, 7, "");
|
get_keyfile_keywords(config, config_home, "user4", GEANY_FILETYPES_LUA, 7, "");
|
||||||
style_sets[GEANY_FILETYPES_LUA].keywords[8] = NULL;
|
style_sets[GEANY_FILETYPES_LUA].keywords[8] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_LUA].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3390,9 +3335,6 @@ static void styleset_basic_init(gint ft_id, GKeyFile *config, GKeyFile *config_h
|
|||||||
get_keyfile_keywords(config, config_home, "user1", GEANY_FILETYPES_BASIC, 2, "");
|
get_keyfile_keywords(config, config_home, "user1", GEANY_FILETYPES_BASIC, 2, "");
|
||||||
get_keyfile_keywords(config, config_home, "user2", GEANY_FILETYPES_BASIC, 3, "");
|
get_keyfile_keywords(config, config_home, "user2", GEANY_FILETYPES_BASIC, 3, "");
|
||||||
style_sets[GEANY_FILETYPES_BASIC].keywords[4] = NULL;
|
style_sets[GEANY_FILETYPES_BASIC].keywords[4] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_BASIC].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3441,8 +3383,6 @@ static void styleset_actionscript_init(gint ft_id, GKeyFile *config, GKeyFile *c
|
|||||||
get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_AS, 1, "");
|
get_keyfile_keywords(config, config_home, "secondary", GEANY_FILETYPES_AS, 1, "");
|
||||||
get_keyfile_keywords(config, config_home, "classes", GEANY_FILETYPES_AS, 2, "");
|
get_keyfile_keywords(config, config_home, "classes", GEANY_FILETYPES_AS, 2, "");
|
||||||
style_sets[GEANY_FILETYPES_AS].keywords[3] = NULL;
|
style_sets[GEANY_FILETYPES_AS].keywords[3] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home, &style_sets[GEANY_FILETYPES_AS].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3484,8 +3424,6 @@ static void styleset_haxe_init(gint ft_id, GKeyFile *config, GKeyFile *config_ho
|
|||||||
UInt ValueType Void Xml XmlType");
|
UInt ValueType Void Xml XmlType");
|
||||||
|
|
||||||
style_sets[GEANY_FILETYPES_HAXE].keywords[3] = NULL;
|
style_sets[GEANY_FILETYPES_HAXE].keywords[3] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home, &style_sets[GEANY_FILETYPES_HAXE].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3523,9 +3461,6 @@ static void styleset_ada_init(gint ft_id, GKeyFile *config, GKeyFile *config_hom
|
|||||||
style_sets[GEANY_FILETYPES_ADA].keywords = g_new(gchar*, 2);
|
style_sets[GEANY_FILETYPES_ADA].keywords = g_new(gchar*, 2);
|
||||||
get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_ADA, 0, "abort abs abstract accept access aliased all and array at begin body case constant declare delay delta digits do else elsif end entry exception exit for function generic goto if in interface is limited loop mod new not null of or others out overriding package pragma private procedure protected raise range record rem renames requeue return reverse select separate subtype synchronized tagged task terminate then type until use when while with xor");
|
get_keyfile_keywords(config, config_home, "primary", GEANY_FILETYPES_ADA, 0, "abort abs abstract accept access aliased all and array at begin body case constant declare delay delta digits do else elsif end entry exception exit for function generic goto if in interface is limited loop mod new not null of or others out overriding package pragma private procedure protected raise range record rem renames requeue return reverse select separate subtype synchronized tagged task terminate then type until use when while with xor");
|
||||||
style_sets[GEANY_FILETYPES_ADA].keywords[1] = NULL;
|
style_sets[GEANY_FILETYPES_ADA].keywords[1] = NULL;
|
||||||
|
|
||||||
get_keyfile_wordchars(config, config_home,
|
|
||||||
&style_sets[GEANY_FILETYPES_ADA].wordchars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3554,10 +3489,10 @@ static void styleset_ada(ScintillaObject *sci)
|
|||||||
|
|
||||||
|
|
||||||
/* lang_name is the name used for the styleset_foo_init function, e.g. foo. */
|
/* lang_name is the name used for the styleset_foo_init function, e.g. foo. */
|
||||||
#define init_styleset_case(ft_id, lang_name) \
|
#define init_styleset_case(ft_id, init_styleset_func) \
|
||||||
case (ft_id): \
|
case (ft_id): \
|
||||||
styleset_ ## lang_name ## _init(filetype_idx, config, configh); \
|
init_styleset_func(filetype_idx, config, configh); \
|
||||||
break;
|
break
|
||||||
|
|
||||||
/* Called by filetypes_load_config(). */
|
/* Called by filetypes_load_config(). */
|
||||||
void highlighting_init_styles(gint filetype_idx, GKeyFile *config, GKeyFile *configh)
|
void highlighting_init_styles(gint filetype_idx, GKeyFile *config, GKeyFile *configh)
|
||||||
@ -3571,58 +3506,62 @@ void highlighting_init_styles(gint filetype_idx, GKeyFile *config, GKeyFile *con
|
|||||||
|
|
||||||
switch (filetype_idx)
|
switch (filetype_idx)
|
||||||
{
|
{
|
||||||
init_styleset_case(GEANY_FILETYPES_NONE, common);
|
init_styleset_case(GEANY_FILETYPES_NONE, styleset_common_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_ADA, ada);
|
init_styleset_case(GEANY_FILETYPES_ADA, styleset_ada_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_ASM, asm);
|
init_styleset_case(GEANY_FILETYPES_ASM, styleset_asm_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_BASIC, basic);
|
init_styleset_case(GEANY_FILETYPES_BASIC, styleset_basic_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_C, c);
|
init_styleset_case(GEANY_FILETYPES_C, styleset_c_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_CAML, caml);
|
init_styleset_case(GEANY_FILETYPES_CAML, styleset_caml_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_CMAKE, cmake);
|
init_styleset_case(GEANY_FILETYPES_CMAKE, styleset_cmake_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_CONF, conf);
|
init_styleset_case(GEANY_FILETYPES_CONF, styleset_conf_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_CPP, cpp);
|
init_styleset_case(GEANY_FILETYPES_CPP, styleset_cpp_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_CS, cs);
|
init_styleset_case(GEANY_FILETYPES_CS, styleset_cs_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_CSS, css);
|
init_styleset_case(GEANY_FILETYPES_CSS, styleset_css_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_D, d);
|
init_styleset_case(GEANY_FILETYPES_D, styleset_d_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_DIFF, diff);
|
init_styleset_case(GEANY_FILETYPES_DIFF, styleset_diff_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_DOCBOOK, docbook);
|
init_styleset_case(GEANY_FILETYPES_DOCBOOK, styleset_docbook_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_FERITE, ferite);
|
init_styleset_case(GEANY_FILETYPES_FERITE, styleset_ferite_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_F77, f77);
|
init_styleset_case(GEANY_FILETYPES_F77, styleset_f77_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_FORTRAN, fortran);
|
init_styleset_case(GEANY_FILETYPES_FORTRAN, styleset_fortran_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_GLSL, glsl);
|
init_styleset_case(GEANY_FILETYPES_GLSL, styleset_glsl_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_HASKELL, haskell);
|
init_styleset_case(GEANY_FILETYPES_HASKELL, styleset_haskell_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_HAXE, haxe);
|
init_styleset_case(GEANY_FILETYPES_HAXE, styleset_haxe_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_AS, actionscript);
|
init_styleset_case(GEANY_FILETYPES_AS, styleset_actionscript_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_HTML, html);
|
init_styleset_case(GEANY_FILETYPES_HTML, styleset_html_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_JAVA, java);
|
init_styleset_case(GEANY_FILETYPES_JAVA, styleset_java_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_JS, js);
|
init_styleset_case(GEANY_FILETYPES_JS, styleset_js_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_LATEX, latex);
|
init_styleset_case(GEANY_FILETYPES_LATEX, styleset_latex_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_LUA, lua);
|
init_styleset_case(GEANY_FILETYPES_LUA, styleset_lua_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_MAKE, makefile);
|
init_styleset_case(GEANY_FILETYPES_MAKE, styleset_makefile_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_MATLAB, matlab);
|
init_styleset_case(GEANY_FILETYPES_MATLAB, styleset_matlab_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_NSIS, nsis);
|
init_styleset_case(GEANY_FILETYPES_MARKDOWN, styleset_markdown_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_PASCAL, pascal);
|
init_styleset_case(GEANY_FILETYPES_NSIS, styleset_nsis_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_PERL, perl);
|
init_styleset_case(GEANY_FILETYPES_PASCAL, styleset_pascal_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_PHP, php);
|
init_styleset_case(GEANY_FILETYPES_PERL, styleset_perl_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_PO, po);
|
init_styleset_case(GEANY_FILETYPES_PHP, styleset_php_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_PYTHON, python);
|
init_styleset_case(GEANY_FILETYPES_PO, styleset_po_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_R, r);
|
init_styleset_case(GEANY_FILETYPES_PYTHON, styleset_python_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_RUBY, ruby);
|
init_styleset_case(GEANY_FILETYPES_R, styleset_r_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_SH, sh);
|
init_styleset_case(GEANY_FILETYPES_RUBY, styleset_ruby_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_SQL, sql);
|
init_styleset_case(GEANY_FILETYPES_SH, styleset_sh_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_TCL, tcl);
|
init_styleset_case(GEANY_FILETYPES_SQL, styleset_sql_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_VALA, vala);
|
init_styleset_case(GEANY_FILETYPES_TCL, styleset_tcl_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_VHDL, vhdl);
|
init_styleset_case(GEANY_FILETYPES_VALA, styleset_vala_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_XML, markup);
|
init_styleset_case(GEANY_FILETYPES_VHDL, styleset_vhdl_init);
|
||||||
init_styleset_case(GEANY_FILETYPES_YAML, yaml);
|
init_styleset_case(GEANY_FILETYPES_XML, styleset_markup_init);
|
||||||
|
init_styleset_case(GEANY_FILETYPES_YAML, styleset_yaml_init);
|
||||||
}
|
}
|
||||||
|
/* should be done in filetypes.c really: */
|
||||||
|
if (filetype_idx != GEANY_FILETYPES_NONE)
|
||||||
|
get_keyfile_wordchars(config, configh, &style_sets[filetype_idx].wordchars);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* lang_name is the name used for the styleset_foo function, e.g. foo. */
|
/* lang_name is the name used for the styleset_foo function, e.g. foo. */
|
||||||
#define styleset_case(ft_id, lang_name) \
|
#define styleset_case(ft_id, styleset_func) \
|
||||||
case (ft_id): \
|
case (ft_id): \
|
||||||
styleset_ ## lang_name (sci); \
|
styleset_func (sci); \
|
||||||
break;
|
break
|
||||||
|
|
||||||
void highlighting_set_styles(ScintillaObject *sci, gint filetype_idx)
|
void highlighting_set_styles(ScintillaObject *sci, gint filetype_idx)
|
||||||
{
|
{
|
||||||
@ -3634,50 +3573,51 @@ void highlighting_set_styles(ScintillaObject *sci, gint filetype_idx)
|
|||||||
|
|
||||||
switch (filetype_idx)
|
switch (filetype_idx)
|
||||||
{
|
{
|
||||||
styleset_case(GEANY_FILETYPES_ADA, ada);
|
styleset_case(GEANY_FILETYPES_ADA, styleset_ada);
|
||||||
styleset_case(GEANY_FILETYPES_ASM, asm);
|
styleset_case(GEANY_FILETYPES_ASM, styleset_asm);
|
||||||
styleset_case(GEANY_FILETYPES_BASIC, basic);
|
styleset_case(GEANY_FILETYPES_BASIC, styleset_basic);
|
||||||
styleset_case(GEANY_FILETYPES_C, c);
|
styleset_case(GEANY_FILETYPES_C, styleset_c);
|
||||||
styleset_case(GEANY_FILETYPES_CAML, caml);
|
styleset_case(GEANY_FILETYPES_CAML, styleset_caml);
|
||||||
styleset_case(GEANY_FILETYPES_CMAKE, cmake);
|
styleset_case(GEANY_FILETYPES_CMAKE, styleset_cmake);
|
||||||
styleset_case(GEANY_FILETYPES_CONF, conf);
|
styleset_case(GEANY_FILETYPES_CONF, styleset_conf);
|
||||||
styleset_case(GEANY_FILETYPES_CPP, cpp);
|
styleset_case(GEANY_FILETYPES_CPP, styleset_cpp);
|
||||||
styleset_case(GEANY_FILETYPES_CS, cs);
|
styleset_case(GEANY_FILETYPES_CS, styleset_cs);
|
||||||
styleset_case(GEANY_FILETYPES_CSS, css);
|
styleset_case(GEANY_FILETYPES_CSS, styleset_css);
|
||||||
styleset_case(GEANY_FILETYPES_D, d);
|
styleset_case(GEANY_FILETYPES_D, styleset_d);
|
||||||
styleset_case(GEANY_FILETYPES_DIFF, diff);
|
styleset_case(GEANY_FILETYPES_DIFF, styleset_diff);
|
||||||
styleset_case(GEANY_FILETYPES_DOCBOOK, docbook);
|
styleset_case(GEANY_FILETYPES_DOCBOOK, styleset_docbook);
|
||||||
styleset_case(GEANY_FILETYPES_FERITE, ferite);
|
styleset_case(GEANY_FILETYPES_FERITE, styleset_ferite);
|
||||||
styleset_case(GEANY_FILETYPES_F77, f77);
|
styleset_case(GEANY_FILETYPES_F77, styleset_f77);
|
||||||
styleset_case(GEANY_FILETYPES_FORTRAN, fortran);
|
styleset_case(GEANY_FILETYPES_FORTRAN, styleset_fortran);
|
||||||
styleset_case(GEANY_FILETYPES_GLSL, glsl);
|
styleset_case(GEANY_FILETYPES_GLSL, styleset_glsl);
|
||||||
styleset_case(GEANY_FILETYPES_HASKELL, haskell);
|
styleset_case(GEANY_FILETYPES_HASKELL, styleset_haskell);
|
||||||
styleset_case(GEANY_FILETYPES_HAXE, haxe);
|
styleset_case(GEANY_FILETYPES_HAXE, styleset_haxe);
|
||||||
styleset_case(GEANY_FILETYPES_AS, actionscript);
|
styleset_case(GEANY_FILETYPES_AS, styleset_actionscript);
|
||||||
styleset_case(GEANY_FILETYPES_HTML, html);
|
styleset_case(GEANY_FILETYPES_HTML, styleset_html);
|
||||||
styleset_case(GEANY_FILETYPES_JAVA, java);
|
styleset_case(GEANY_FILETYPES_JAVA, styleset_java);
|
||||||
styleset_case(GEANY_FILETYPES_JS, js);
|
styleset_case(GEANY_FILETYPES_JS, styleset_js);
|
||||||
styleset_case(GEANY_FILETYPES_LATEX, latex);
|
styleset_case(GEANY_FILETYPES_LATEX, styleset_latex);
|
||||||
styleset_case(GEANY_FILETYPES_LUA, lua);
|
styleset_case(GEANY_FILETYPES_LUA, styleset_lua);
|
||||||
styleset_case(GEANY_FILETYPES_MAKE, makefile);
|
styleset_case(GEANY_FILETYPES_MAKE, styleset_makefile);
|
||||||
styleset_case(GEANY_FILETYPES_MATLAB, matlab);
|
styleset_case(GEANY_FILETYPES_MARKDOWN, styleset_markdown);
|
||||||
styleset_case(GEANY_FILETYPES_NSIS, nsis);
|
styleset_case(GEANY_FILETYPES_MATLAB, styleset_matlab);
|
||||||
styleset_case(GEANY_FILETYPES_PASCAL, pascal);
|
styleset_case(GEANY_FILETYPES_NSIS, styleset_nsis);
|
||||||
styleset_case(GEANY_FILETYPES_PERL, perl);
|
styleset_case(GEANY_FILETYPES_PASCAL, styleset_pascal);
|
||||||
styleset_case(GEANY_FILETYPES_PHP, php);
|
styleset_case(GEANY_FILETYPES_PERL, styleset_perl);
|
||||||
styleset_case(GEANY_FILETYPES_PO, po);
|
styleset_case(GEANY_FILETYPES_PHP, styleset_php);
|
||||||
styleset_case(GEANY_FILETYPES_PYTHON, python);
|
styleset_case(GEANY_FILETYPES_PO, styleset_po);
|
||||||
styleset_case(GEANY_FILETYPES_R, r);
|
styleset_case(GEANY_FILETYPES_PYTHON, styleset_python);
|
||||||
styleset_case(GEANY_FILETYPES_RUBY, ruby);
|
styleset_case(GEANY_FILETYPES_R, styleset_r);
|
||||||
styleset_case(GEANY_FILETYPES_SH, sh);
|
styleset_case(GEANY_FILETYPES_RUBY, styleset_ruby);
|
||||||
styleset_case(GEANY_FILETYPES_SQL, sql);
|
styleset_case(GEANY_FILETYPES_SH, styleset_sh);
|
||||||
styleset_case(GEANY_FILETYPES_TCL, tcl);
|
styleset_case(GEANY_FILETYPES_SQL, styleset_sql);
|
||||||
styleset_case(GEANY_FILETYPES_VALA, vala);
|
styleset_case(GEANY_FILETYPES_TCL, styleset_tcl);
|
||||||
styleset_case(GEANY_FILETYPES_VHDL, vhdl);
|
styleset_case(GEANY_FILETYPES_VALA, styleset_vala);
|
||||||
styleset_case(GEANY_FILETYPES_XML, xml);
|
styleset_case(GEANY_FILETYPES_VHDL, styleset_vhdl);
|
||||||
styleset_case(GEANY_FILETYPES_YAML, yaml);
|
styleset_case(GEANY_FILETYPES_XML, styleset_xml);
|
||||||
|
styleset_case(GEANY_FILETYPES_YAML, styleset_yaml);
|
||||||
default:
|
default:
|
||||||
styleset_case(GEANY_FILETYPES_NONE, none);
|
styleset_case(GEANY_FILETYPES_NONE, styleset_none);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,14 +114,14 @@ static void apply_kb_accel(GeanyKeyGroup *group, GeanyKeyBinding *kb, gpointer u
|
|||||||
* assign the keybinding to the menu_item (apply_kb_accel) otherwise it can't be overridden
|
* assign the keybinding to the menu_item (apply_kb_accel) otherwise it can't be overridden
|
||||||
* by user keybindings anymore */
|
* by user keybindings anymore */
|
||||||
/** Simple convenience function to fill a GeanyKeyBinding struct item.
|
/** Simple convenience function to fill a GeanyKeyBinding struct item.
|
||||||
* @param group
|
* @param group Group.
|
||||||
* @param key_id
|
* @param key_id Keybinding index for the group.
|
||||||
* @param callback
|
* @param callback Function to call when activated.
|
||||||
* @param key
|
* @param key (Lower case) default key, e.g. @c GDK_j, but usually 0 for unset.
|
||||||
* @param mod
|
* @param mod Default modifier, e.g. @c GDK_CONTROL_MASK, but usually 0 for unset.
|
||||||
* @param name
|
* @param name Not duplicated - use a static string.
|
||||||
* @param label
|
* @param label Currently not duplicated - use a static or heap-allocated (e.g. translated) string.
|
||||||
* @param menu_item */
|
* @param menu_item Optional widget to set an accelerator for, or @c NULL. */
|
||||||
void keybindings_set_item(GeanyKeyGroup *group, gsize key_id,
|
void keybindings_set_item(GeanyKeyGroup *group, gsize key_id,
|
||||||
GeanyKeyCallback callback, guint key, GdkModifierType mod,
|
GeanyKeyCallback callback, guint key, GdkModifierType mod,
|
||||||
gchar *name, gchar *label, GtkWidget *menu_item)
|
gchar *name, gchar *label, GtkWidget *menu_item)
|
||||||
@ -320,6 +320,8 @@ static void init_default_kb(void)
|
|||||||
GDK_3, GDK_CONTROL_MASK, "edit_sendtocmd3", _("Send to Custom Command 3"), NULL);
|
GDK_3, GDK_CONTROL_MASK, "edit_sendtocmd3", _("Send to Custom Command 3"), NULL);
|
||||||
keybindings_set_item(group, GEANY_KEYS_FORMAT_SENDTOVTE, cb_func_format_action,
|
keybindings_set_item(group, GEANY_KEYS_FORMAT_SENDTOVTE, cb_func_format_action,
|
||||||
0, 0, "edit_sendtovte", _("Send Selection to Terminal"), LW(send_selection_to_vte1));
|
0, 0, "edit_sendtovte", _("Send Selection to Terminal"), LW(send_selection_to_vte1));
|
||||||
|
keybindings_set_item(group, GEANY_KEYS_FORMAT_REFLOWPARAGRAPH, cb_func_format_action,
|
||||||
|
GDK_j, GDK_CONTROL_MASK, "format_reflowparagraph", _("Reflow lines/block"), NULL);
|
||||||
|
|
||||||
group = ADD_KB_GROUP(INSERT, _("Insert"));
|
group = ADD_KB_GROUP(INSERT, _("Insert"));
|
||||||
|
|
||||||
@ -1091,7 +1093,6 @@ static gboolean on_key_press_event(GtkWidget *widget, GdkEventKey *ev, gpointer
|
|||||||
|
|
||||||
keyval = ev->keyval;
|
keyval = ev->keyval;
|
||||||
state = ev->state & gtk_accelerator_get_default_mod_mask();
|
state = ev->state & gtk_accelerator_get_default_mod_mask();
|
||||||
|
|
||||||
/* hack to get around that CTRL+Shift+r results in GDK_R not GDK_r */
|
/* hack to get around that CTRL+Shift+r results in GDK_R not GDK_r */
|
||||||
if ((ev->state & GDK_SHIFT_MASK) || (ev->state & GDK_LOCK_MASK))
|
if ((ev->state & GDK_SHIFT_MASK) || (ev->state & GDK_LOCK_MASK))
|
||||||
if (keyval >= GDK_A && keyval <= GDK_Z)
|
if (keyval >= GDK_A && keyval <= GDK_Z)
|
||||||
@ -1108,7 +1109,6 @@ static gboolean on_key_press_event(GtkWidget *widget, GdkEventKey *ev, gpointer
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
if (check_menu_key(doc, keyval, state, ev->time))
|
if (check_menu_key(doc, keyval, state, ev->time))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
ignore_keybinding = FALSE;
|
ignore_keybinding = FALSE;
|
||||||
for (g = 0; g < keybinding_groups->len; g++)
|
for (g = 0; g < keybinding_groups->len; g++)
|
||||||
{
|
{
|
||||||
@ -1480,36 +1480,56 @@ static void cb_func_switch_action(guint key_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void switch_document(gint direction)
|
static void switch_notebook_page(gint direction)
|
||||||
{
|
{
|
||||||
gint page_count = gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook));
|
gint page_count, cur_page;
|
||||||
gint cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.notebook));
|
gboolean parent_is_notebook = FALSE;
|
||||||
|
GtkNotebook *notebook;
|
||||||
|
GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window));
|
||||||
|
|
||||||
|
/* check whether the current widget is a GtkNotebook or a child of a GtkNotebook */
|
||||||
|
do
|
||||||
|
{
|
||||||
|
parent_is_notebook = GTK_IS_NOTEBOOK(focusw);
|
||||||
|
}
|
||||||
|
while (! parent_is_notebook && (focusw = gtk_widget_get_parent(focusw)) != NULL);
|
||||||
|
|
||||||
|
/* if we found a GtkNotebook widget, use it. Otherwise fallback to the documents notebook */
|
||||||
|
if (parent_is_notebook)
|
||||||
|
notebook = GTK_NOTEBOOK(focusw);
|
||||||
|
else
|
||||||
|
notebook = GTK_NOTEBOOK(main_widgets.notebook);
|
||||||
|
|
||||||
|
/* now switch pages */
|
||||||
|
page_count = gtk_notebook_get_n_pages(notebook);
|
||||||
|
cur_page = gtk_notebook_get_current_page(notebook);
|
||||||
|
|
||||||
if (direction == GTK_DIR_LEFT)
|
if (direction == GTK_DIR_LEFT)
|
||||||
{
|
{
|
||||||
if (cur_page > 0)
|
if (cur_page > 0)
|
||||||
gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), cur_page - 1);
|
gtk_notebook_set_current_page(notebook, cur_page - 1);
|
||||||
else
|
else
|
||||||
gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), page_count - 1);
|
gtk_notebook_set_current_page(notebook, page_count - 1);
|
||||||
}
|
}
|
||||||
else if (direction == GTK_DIR_RIGHT)
|
else if (direction == GTK_DIR_RIGHT)
|
||||||
{
|
{
|
||||||
if (cur_page < page_count - 1)
|
if (cur_page < page_count - 1)
|
||||||
gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), cur_page + 1);
|
gtk_notebook_set_current_page(notebook, cur_page + 1);
|
||||||
else
|
else
|
||||||
gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), 0);
|
gtk_notebook_set_current_page(notebook, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void cb_func_switch_tableft(G_GNUC_UNUSED guint key_id)
|
static void cb_func_switch_tableft(G_GNUC_UNUSED guint key_id)
|
||||||
{
|
{
|
||||||
switch_document(GTK_DIR_LEFT);
|
switch_notebook_page(GTK_DIR_LEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void cb_func_switch_tabright(G_GNUC_UNUSED guint key_id)
|
static void cb_func_switch_tabright(G_GNUC_UNUSED guint key_id)
|
||||||
{
|
{
|
||||||
switch_document(GTK_DIR_RIGHT);
|
switch_notebook_page(GTK_DIR_RIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1905,6 +1925,145 @@ static void cb_func_editor_action(guint key_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void join_lines(GeanyEditor *editor)
|
||||||
|
{
|
||||||
|
gint start, end, i;
|
||||||
|
|
||||||
|
start = sci_get_line_from_position(editor->sci,
|
||||||
|
sci_get_selection_start(editor->sci));
|
||||||
|
end = sci_get_line_from_position(editor->sci,
|
||||||
|
sci_get_selection_end(editor->sci));
|
||||||
|
|
||||||
|
/* if there is only one line in selection, join it with the following one */
|
||||||
|
if (end == start)
|
||||||
|
end = start + 1;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* remove trailing spaces for every line except the last one
|
||||||
|
* so that these spaces won't appear within text after joining
|
||||||
|
*/
|
||||||
|
for (i = start; i < end; i++)
|
||||||
|
editor_strip_line_trailing_spaces(editor, i);
|
||||||
|
|
||||||
|
/* remove starting spaces from second and following lines due to the same reason */
|
||||||
|
for (i = start+1; i <= end; i++)
|
||||||
|
sci_set_line_indentation(editor->sci, i, 0);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* SCI_LINESJOIN automatically adds spaces between joined lines, including
|
||||||
|
* empty ones. We should drop empty lines if we want only one space to be
|
||||||
|
* inserted (see also example below). I don't think we should care of that.
|
||||||
|
*/
|
||||||
|
|
||||||
|
sci_set_target_start(editor->sci,
|
||||||
|
sci_get_position_from_line(editor->sci, start));
|
||||||
|
sci_set_target_end(editor->sci,
|
||||||
|
sci_get_position_from_line(editor->sci, end));
|
||||||
|
sci_lines_join(editor->sci);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Example: joining
|
||||||
|
*
|
||||||
|
* [TAB]if (something_wrong)
|
||||||
|
* [TAB]{
|
||||||
|
* [TAB][TAB]
|
||||||
|
* [TAB][TAB]exit(1);[SPACE][SPACE]
|
||||||
|
* [TAB]}[SPACE]
|
||||||
|
*
|
||||||
|
* gives
|
||||||
|
*
|
||||||
|
* [TAB]if (something_wrong) { exit(1); }[SPACE]
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void split_lines(GeanyEditor *editor)
|
||||||
|
{
|
||||||
|
gint start, indent, linescount, i;
|
||||||
|
|
||||||
|
/* do nothing if long line marker is disabled */
|
||||||
|
if (editor_prefs.long_line_type == 2)
|
||||||
|
return;
|
||||||
|
|
||||||
|
start = sci_get_line_from_position(editor->sci,
|
||||||
|
sci_get_selection_start(editor->sci));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If several lines are selected, first join them.
|
||||||
|
* This allows to reformat text paragraphs easily.
|
||||||
|
*/
|
||||||
|
if (sci_get_lines_selected(editor->sci) > 1)
|
||||||
|
join_lines(editor);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If this line is short enough, just return
|
||||||
|
*/
|
||||||
|
if (editor_prefs.long_line_column >
|
||||||
|
sci_get_line_end_position(editor->sci, start) -
|
||||||
|
sci_get_position_from_line(editor->sci, start))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We have to manipulate line indentation so that indentation
|
||||||
|
* of the resulting lines would be consistent. For example,
|
||||||
|
* the result of splitting "[TAB]very long content":
|
||||||
|
*
|
||||||
|
* +-------------+-------------+
|
||||||
|
* | proper | wrong |
|
||||||
|
* +-------------+-------------+
|
||||||
|
* | [TAB]very | [TAB]very |
|
||||||
|
* | [TAB]long | long |
|
||||||
|
* | [TAB]content| content |
|
||||||
|
* +-------------+-------------+
|
||||||
|
*/
|
||||||
|
indent = sci_get_line_indentation(editor->sci, start);
|
||||||
|
sci_set_line_indentation(editor->sci, start, 0);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Use sci_get_line_count() to determine how many new lines
|
||||||
|
* appeared during splitting. SCI_LINESSPLIT should better return
|
||||||
|
* this value itself...
|
||||||
|
*/
|
||||||
|
sci_target_from_selection(editor->sci);
|
||||||
|
linescount = sci_get_line_count(editor->sci);
|
||||||
|
sci_lines_split(editor->sci,
|
||||||
|
(editor_prefs.long_line_column - indent) *
|
||||||
|
sci_text_width(editor->sci, STYLE_DEFAULT, " "));
|
||||||
|
linescount = sci_get_line_count(editor->sci) - linescount;
|
||||||
|
|
||||||
|
/* Fix indentation. */
|
||||||
|
for (i = start; i <= start + linescount; i++)
|
||||||
|
sci_set_line_indentation(editor->sci, i, indent);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void reflow_paragraph(GeanyEditor *editor)
|
||||||
|
{
|
||||||
|
ScintillaObject *sci = editor->sci;
|
||||||
|
gboolean sel;
|
||||||
|
|
||||||
|
sci_start_undo_action(sci);
|
||||||
|
sel = sci_has_selection(sci);
|
||||||
|
if (!sel)
|
||||||
|
{
|
||||||
|
gint line, pos;
|
||||||
|
|
||||||
|
keybindings_send_command(GEANY_KEY_GROUP_SELECT, GEANY_KEYS_SELECT_PARAGRAPH);
|
||||||
|
/* deselect last line break */
|
||||||
|
pos = sci_get_selection_end(sci);
|
||||||
|
line = sci_get_line_from_position(sci, pos);
|
||||||
|
pos = sci_get_line_end_position(sci, line - 1);
|
||||||
|
sci_set_selection_end(sci, pos);
|
||||||
|
}
|
||||||
|
split_lines(editor);
|
||||||
|
if (!sel)
|
||||||
|
sci_set_anchor(sci, -1);
|
||||||
|
sci_end_undo_action(sci);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* common function for format keybindings, only valid when scintilla has focus. */
|
/* common function for format keybindings, only valid when scintilla has focus. */
|
||||||
static void cb_func_format_action(guint key_id)
|
static void cb_func_format_action(guint key_id)
|
||||||
{
|
{
|
||||||
@ -1959,6 +2118,9 @@ static void cb_func_format_action(guint key_id)
|
|||||||
case GEANY_KEYS_FORMAT_SENDTOVTE:
|
case GEANY_KEYS_FORMAT_SENDTOVTE:
|
||||||
on_send_selection_to_vte1_activate(NULL, NULL);
|
on_send_selection_to_vte1_activate(NULL, NULL);
|
||||||
break;
|
break;
|
||||||
|
case GEANY_KEYS_FORMAT_REFLOWPARAGRAPH:
|
||||||
|
reflow_paragraph(doc->editor);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,6 +174,7 @@ enum
|
|||||||
GEANY_KEYS_FORMAT_SENDTOCMD2,
|
GEANY_KEYS_FORMAT_SENDTOCMD2,
|
||||||
GEANY_KEYS_FORMAT_SENDTOCMD3,
|
GEANY_KEYS_FORMAT_SENDTOCMD3,
|
||||||
GEANY_KEYS_FORMAT_SENDTOVTE,
|
GEANY_KEYS_FORMAT_SENDTOVTE,
|
||||||
|
GEANY_KEYS_FORMAT_REFLOWPARAGRAPH,
|
||||||
GEANY_KEYS_FORMAT_COUNT
|
GEANY_KEYS_FORMAT_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ static GOptionEntry entries[] =
|
|||||||
{ "no-plugins", 'p', 0, G_OPTION_ARG_NONE, &no_plugins, N_("Don't load plugins"), NULL },
|
{ "no-plugins", 'p', 0, G_OPTION_ARG_NONE, &no_plugins, N_("Don't load plugins"), NULL },
|
||||||
#endif
|
#endif
|
||||||
{ "print-prefix", 0, 0, G_OPTION_ARG_NONE, &print_prefix, N_("Print Geany's installation prefix"), NULL },
|
{ "print-prefix", 0, 0, G_OPTION_ARG_NONE, &print_prefix, N_("Print Geany's installation prefix"), NULL },
|
||||||
{ "no-session", 's', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &cl_options.load_session, N_("don't load the previous session's files"), NULL },
|
{ "no-session", 's', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &cl_options.load_session, N_("Don't load the previous session's files"), NULL },
|
||||||
#ifdef HAVE_VTE
|
#ifdef HAVE_VTE
|
||||||
{ "no-terminal", 't', 0, G_OPTION_ARG_NONE, &no_vte, N_("Don't load terminal support"), NULL },
|
{ "no-terminal", 't', 0, G_OPTION_ARG_NONE, &no_vte, N_("Don't load terminal support"), NULL },
|
||||||
{ "vte-lib", 0, 0, G_OPTION_ARG_FILENAME, &lib_vte, N_("Filename of libvte.so"), NULL },
|
{ "vte-lib", 0, 0, G_OPTION_ARG_FILENAME, &lib_vte, N_("Filename of libvte.so"), NULL },
|
||||||
|
@ -62,7 +62,8 @@ endif
|
|||||||
OBJS = about.o build.o callbacks.o dialogs.o document.o editor.o encodings.o filetypes.o \
|
OBJS = about.o build.o callbacks.o dialogs.o document.o editor.o encodings.o filetypes.o \
|
||||||
geanyentryaction.o geanymenubuttonaction.o geanyobject.o geanywraplabel.o highlighting.o \
|
geanyentryaction.o geanymenubuttonaction.o geanyobject.o geanywraplabel.o highlighting.o \
|
||||||
interface.o keybindings.o keyfile.o \
|
interface.o keybindings.o keyfile.o \
|
||||||
log.o main.o msgwindow.o navqueue.o notebook.o plugins.o prefs.o printing.o project.o \
|
log.o main.o msgwindow.o navqueue.o notebook.o plugins.o pluginutils.o \
|
||||||
|
prefs.o printing.o project.o \
|
||||||
queue.o sciwrappers.o search.o socket.o stash.o \
|
queue.o sciwrappers.o search.o socket.o stash.o \
|
||||||
symbols.o templates.o toolbar.o tools.o treeviews.o \
|
symbols.o templates.o toolbar.o tools.o treeviews.o \
|
||||||
ui_utils.o utils.o win32.o
|
ui_utils.o utils.o win32.o
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
enum {
|
enum {
|
||||||
/** The Application Programming Interface (API) version, incremented
|
/** The Application Programming Interface (API) version, incremented
|
||||||
* whenever any plugin data types are modified or appended to. */
|
* whenever any plugin data types are modified or appended to. */
|
||||||
GEANY_API_VERSION = 149,
|
GEANY_API_VERSION = 150,
|
||||||
|
|
||||||
/** The Application Binary Interface (ABI) version, incremented whenever
|
/** The Application Binary Interface (ABI) version, incremented whenever
|
||||||
* existing fields in the plugin data types have to be changed or reordered. */
|
* existing fields in the plugin data types have to be changed or reordered. */
|
||||||
@ -90,7 +90,8 @@ typedef struct PluginInfo
|
|||||||
PluginInfo;
|
PluginInfo;
|
||||||
|
|
||||||
|
|
||||||
/** Basic information for the plugin and identification. */
|
/** Basic information for the plugin and identification.
|
||||||
|
* @see geany_plugin. */
|
||||||
typedef struct GeanyPlugin
|
typedef struct GeanyPlugin
|
||||||
{
|
{
|
||||||
PluginInfo *info; /**< Fields set in plugin_set_info(). */
|
PluginInfo *info; /**< Fields set in plugin_set_info(). */
|
||||||
@ -137,7 +138,7 @@ GeanyPlugin;
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/** callback array entry */
|
/** Callback array entry type used with the @ref plugin_callbacks symbol. */
|
||||||
typedef struct PluginCallback
|
typedef struct PluginCallback
|
||||||
{
|
{
|
||||||
/** The name of signal, must be an existing signal. For a list of available signals,
|
/** The name of signal, must be an existing signal. For a list of available signals,
|
||||||
@ -545,6 +546,9 @@ typedef struct PluginFuncs
|
|||||||
{
|
{
|
||||||
void (*add_toolbar_item)(GeanyPlugin *plugin, GtkToolItem *item);
|
void (*add_toolbar_item)(GeanyPlugin *plugin, GtkToolItem *item);
|
||||||
void (*module_make_resident) (GeanyPlugin *plugin);
|
void (*module_make_resident) (GeanyPlugin *plugin);
|
||||||
|
void (*signal_connect) (GeanyPlugin *plugin,
|
||||||
|
GObject *object, gchar *signal_name, gboolean after,
|
||||||
|
GCallback callback, gpointer user_data);
|
||||||
}
|
}
|
||||||
PluginFuncs;
|
PluginFuncs;
|
||||||
|
|
||||||
|
47
src/pluginprivate.h
Normal file
47
src/pluginprivate.h
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* pluginprivate.h - this file is part of Geany, a fast and lightweight IDE
|
||||||
|
*
|
||||||
|
* Copyright 2009 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||||
|
* Copyright 2009 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef PLUGINPRIVATE_H
|
||||||
|
#define PLUGINPRIVATE_H
|
||||||
|
|
||||||
|
#include "ui_utils.h"
|
||||||
|
|
||||||
|
typedef struct SignalConnection
|
||||||
|
{
|
||||||
|
GObject *object;
|
||||||
|
gulong handler_id;
|
||||||
|
}
|
||||||
|
SignalConnection;
|
||||||
|
|
||||||
|
typedef struct GeanyPluginPrivate
|
||||||
|
{
|
||||||
|
GeanyAutoSeparator toolbar_separator;
|
||||||
|
gboolean resident;
|
||||||
|
GArray *signal_ids; /* SignalConnection's to disconnect when unloading */
|
||||||
|
}
|
||||||
|
GeanyPluginPrivate;
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* PLUGINPRIVATE_H */
|
101
src/plugins.c
101
src/plugins.c
@ -23,8 +23,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Code to manage, load and unload plugins. */
|
/* Code to manage, load and unload plugins. */
|
||||||
/** @file plugins.c
|
|
||||||
* Plugin utility functions. */
|
|
||||||
|
|
||||||
#include "geany.h"
|
#include "geany.h"
|
||||||
|
|
||||||
@ -61,15 +59,8 @@
|
|||||||
#include "stash.h"
|
#include "stash.h"
|
||||||
#include "keyfile.h"
|
#include "keyfile.h"
|
||||||
#include "win32.h"
|
#include "win32.h"
|
||||||
|
#include "pluginutils.h"
|
||||||
|
#include "pluginprivate.h"
|
||||||
|
|
||||||
typedef struct GeanyPluginPrivate
|
|
||||||
{
|
|
||||||
GeanyAutoSeparator toolbar_separator;
|
|
||||||
gboolean resident;
|
|
||||||
}
|
|
||||||
GeanyPluginPrivate;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct Plugin
|
typedef struct Plugin
|
||||||
@ -79,10 +70,8 @@ typedef struct Plugin
|
|||||||
PluginInfo info; /* plugin name, description, etc */
|
PluginInfo info; /* plugin name, description, etc */
|
||||||
PluginFields fields;
|
PluginFields fields;
|
||||||
GeanyPlugin public; /* fields the plugin can read */
|
GeanyPlugin public; /* fields the plugin can read */
|
||||||
GeanyPluginPrivate priv; /* GeanyPlugin type private data */
|
GeanyPluginPrivate priv; /* GeanyPlugin type private data, same as (*public.priv) */
|
||||||
|
|
||||||
gulong *signal_ids; /* signal IDs to disconnect when unloading */
|
|
||||||
gsize signal_ids_len;
|
|
||||||
GeanyKeyGroup *key_group;
|
GeanyKeyGroup *key_group;
|
||||||
|
|
||||||
void (*init) (GeanyData *data); /* Called when the plugin is enabled */
|
void (*init) (GeanyData *data); /* Called when the plugin is enabled */
|
||||||
@ -106,13 +95,11 @@ static GtkWidget *menu_separator = NULL;
|
|||||||
|
|
||||||
static void pm_show_dialog(GtkMenuItem *menuitem, gpointer user_data);
|
static void pm_show_dialog(GtkMenuItem *menuitem, gpointer user_data);
|
||||||
|
|
||||||
void plugin_add_toolbar_item(GeanyPlugin *plugin, GtkToolItem *item);
|
|
||||||
void plugin_module_make_resident(GeanyPlugin *plugin);
|
|
||||||
|
|
||||||
|
|
||||||
static PluginFuncs plugin_funcs = {
|
static PluginFuncs plugin_funcs = {
|
||||||
&plugin_add_toolbar_item,
|
&plugin_add_toolbar_item,
|
||||||
&plugin_module_make_resident
|
&plugin_module_make_resident,
|
||||||
|
&plugin_signal_connect
|
||||||
};
|
};
|
||||||
|
|
||||||
static DocumentFuncs doc_funcs = {
|
static DocumentFuncs doc_funcs = {
|
||||||
@ -467,16 +454,12 @@ static void add_callbacks(Plugin *plugin, PluginCallback *callbacks)
|
|||||||
if (len == 0)
|
if (len == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
plugin->signal_ids_len = len;
|
|
||||||
plugin->signal_ids = g_new(gulong, len);
|
|
||||||
|
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
cb = &callbacks[i];
|
cb = &callbacks[i];
|
||||||
|
|
||||||
plugin->signal_ids[i] = (cb->after) ?
|
plugin_signal_connect(&plugin->public, NULL, cb->signal_name, cb->after,
|
||||||
g_signal_connect_after(geany_object, cb->signal_name, cb->callback, cb->user_data) :
|
cb->callback, cb->user_data);
|
||||||
g_signal_connect(geany_object, cb->signal_name, cb->callback, cb->user_data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -698,14 +681,16 @@ plugin_new(const gchar *fname, gboolean init_plugin, gboolean add_to_list)
|
|||||||
|
|
||||||
static void remove_callbacks(Plugin *plugin)
|
static void remove_callbacks(Plugin *plugin)
|
||||||
{
|
{
|
||||||
guint i;
|
GArray *signal_ids = plugin->priv.signal_ids;
|
||||||
|
SignalConnection *sc;
|
||||||
|
|
||||||
if (plugin->signal_ids == NULL)
|
if (signal_ids == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < plugin->signal_ids_len; i++)
|
foreach_array(SignalConnection, sc, signal_ids)
|
||||||
g_signal_handler_disconnect(geany_object, plugin->signal_ids[i]);
|
g_signal_handler_disconnect(sc->object, sc->handler_id);
|
||||||
g_free(plugin->signal_ids);
|
|
||||||
|
g_array_free(signal_ids, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1307,62 +1292,4 @@ static void pm_show_dialog(GtkMenuItem *menuitem, gpointer user_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Insert a toolbar item before the Quit button, or after the previous plugin toolbar item.
|
|
||||||
* A separator is added on the first call to this function, and will be shown when @a item is
|
|
||||||
* shown; hidden when @a item is hidden.
|
|
||||||
* @note You should still destroy @a item yourself, usually in @ref plugin_cleanup().
|
|
||||||
* @param plugin Must be @ref geany_plugin.
|
|
||||||
* @param item The item to add. */
|
|
||||||
void plugin_add_toolbar_item(GeanyPlugin *plugin, GtkToolItem *item)
|
|
||||||
{
|
|
||||||
GtkToolbar *toolbar = GTK_TOOLBAR(main_widgets.toolbar);
|
|
||||||
gint pos;
|
|
||||||
GeanyAutoSeparator *autosep;
|
|
||||||
|
|
||||||
g_return_if_fail(plugin);
|
|
||||||
autosep = &plugin->priv->toolbar_separator;
|
|
||||||
|
|
||||||
if (!autosep->widget)
|
|
||||||
{
|
|
||||||
GtkToolItem *sep;
|
|
||||||
|
|
||||||
pos = toolbar_get_insert_position();
|
|
||||||
|
|
||||||
sep = gtk_separator_tool_item_new();
|
|
||||||
gtk_toolbar_insert(toolbar, sep, pos);
|
|
||||||
autosep->widget = GTK_WIDGET(sep);
|
|
||||||
|
|
||||||
gtk_toolbar_insert(toolbar, item, pos + 1);
|
|
||||||
|
|
||||||
toolbar_item_ref(sep);
|
|
||||||
toolbar_item_ref(item);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pos = gtk_toolbar_get_item_index(toolbar, GTK_TOOL_ITEM(autosep->widget));
|
|
||||||
g_return_if_fail(pos >= 0);
|
|
||||||
gtk_toolbar_insert(toolbar, item, pos);
|
|
||||||
toolbar_item_ref(item);
|
|
||||||
}
|
|
||||||
/* hide the separator widget if there are no toolbar items showing for the plugin */
|
|
||||||
ui_auto_separator_add_ref(autosep, GTK_WIDGET(item));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** Ensures that a plugin's module (*.so) will never be unloaded.
|
|
||||||
* This is necessary if you register new GTypes in your plugin, e.g. when using own classes
|
|
||||||
* using the GObject system.
|
|
||||||
*
|
|
||||||
* @param plugin Must be @ref geany_plugin.
|
|
||||||
*
|
|
||||||
* @since 0.16
|
|
||||||
*/
|
|
||||||
void plugin_module_make_resident(GeanyPlugin *plugin)
|
|
||||||
{
|
|
||||||
g_return_if_fail(plugin);
|
|
||||||
|
|
||||||
plugin->priv->resident = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
127
src/pluginutils.c
Normal file
127
src/pluginutils.c
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
/*
|
||||||
|
* pluginutils.c - this file is part of Geany, a fast and lightweight IDE
|
||||||
|
*
|
||||||
|
* Copyright 2009 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||||
|
* Copyright 2009 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @file pluginutils.c
|
||||||
|
* Plugin utility functions.
|
||||||
|
* These functions all take the @ref geany_plugin symbol as their first argument. */
|
||||||
|
|
||||||
|
#include "geany.h"
|
||||||
|
#include "pluginutils.h"
|
||||||
|
#include "pluginprivate.h"
|
||||||
|
|
||||||
|
#include "ui_utils.h"
|
||||||
|
#include "toolbar.h"
|
||||||
|
|
||||||
|
|
||||||
|
/** Insert a toolbar item before the Quit button, or after the previous plugin toolbar item.
|
||||||
|
* A separator is added on the first call to this function, and will be shown when @a item is
|
||||||
|
* shown; hidden when @a item is hidden.
|
||||||
|
* @note You should still destroy @a item yourself, usually in @ref plugin_cleanup().
|
||||||
|
* @param plugin Must be @ref geany_plugin.
|
||||||
|
* @param item The item to add. */
|
||||||
|
void plugin_add_toolbar_item(GeanyPlugin *plugin, GtkToolItem *item)
|
||||||
|
{
|
||||||
|
GtkToolbar *toolbar = GTK_TOOLBAR(main_widgets.toolbar);
|
||||||
|
gint pos;
|
||||||
|
GeanyAutoSeparator *autosep;
|
||||||
|
|
||||||
|
g_return_if_fail(plugin);
|
||||||
|
autosep = &plugin->priv->toolbar_separator;
|
||||||
|
|
||||||
|
if (!autosep->widget)
|
||||||
|
{
|
||||||
|
GtkToolItem *sep;
|
||||||
|
|
||||||
|
pos = toolbar_get_insert_position();
|
||||||
|
|
||||||
|
sep = gtk_separator_tool_item_new();
|
||||||
|
gtk_toolbar_insert(toolbar, sep, pos);
|
||||||
|
autosep->widget = GTK_WIDGET(sep);
|
||||||
|
|
||||||
|
gtk_toolbar_insert(toolbar, item, pos + 1);
|
||||||
|
|
||||||
|
toolbar_item_ref(sep);
|
||||||
|
toolbar_item_ref(item);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pos = gtk_toolbar_get_item_index(toolbar, GTK_TOOL_ITEM(autosep->widget));
|
||||||
|
g_return_if_fail(pos >= 0);
|
||||||
|
gtk_toolbar_insert(toolbar, item, pos);
|
||||||
|
toolbar_item_ref(item);
|
||||||
|
}
|
||||||
|
/* hide the separator widget if there are no toolbar items showing for the plugin */
|
||||||
|
ui_auto_separator_add_ref(autosep, GTK_WIDGET(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Ensures that a plugin's module (*.so) will never be unloaded.
|
||||||
|
* This is necessary if you register new GTypes in your plugin, e.g. when using own classes
|
||||||
|
* using the GObject system.
|
||||||
|
*
|
||||||
|
* @param plugin Must be @ref geany_plugin.
|
||||||
|
*
|
||||||
|
* @since 0.16
|
||||||
|
*/
|
||||||
|
void plugin_module_make_resident(GeanyPlugin *plugin)
|
||||||
|
{
|
||||||
|
g_return_if_fail(plugin);
|
||||||
|
|
||||||
|
plugin->priv->resident = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Connect a signal which will be disconnected on unloading the plugin, to prevent a possible segfault.
|
||||||
|
* @param plugin Must be @ref geany_plugin.
|
||||||
|
* @param object Object to connect to, or @c NULL when using @link signals Geany signals @endlink.
|
||||||
|
* @param signal_name The name of the signal. For a list of available
|
||||||
|
* signals, please see the @link signals Signal documentation @endlink.
|
||||||
|
* @param after Set to @c TRUE to call your handler after the main signal handlers have been called
|
||||||
|
* (if supported by @a signal_name).
|
||||||
|
* @param callback The function to call when the signal is emitted.
|
||||||
|
* @param user_data The user data passed to the signal handler.
|
||||||
|
* @see plugin_callbacks. */
|
||||||
|
void plugin_signal_connect(GeanyPlugin *plugin,
|
||||||
|
GObject *object, gchar *signal_name, gboolean after,
|
||||||
|
GCallback callback, gpointer user_data)
|
||||||
|
{
|
||||||
|
gulong id;
|
||||||
|
SignalConnection sc;
|
||||||
|
|
||||||
|
if (!object)
|
||||||
|
object = geany_object;
|
||||||
|
|
||||||
|
id = after ?
|
||||||
|
g_signal_connect_after(object, signal_name, callback, user_data) :
|
||||||
|
g_signal_connect(object, signal_name, callback, user_data);
|
||||||
|
|
||||||
|
if (!plugin->priv->signal_ids)
|
||||||
|
plugin->priv->signal_ids = g_array_new(FALSE, FALSE, sizeof(SignalConnection));
|
||||||
|
|
||||||
|
sc.object = object;
|
||||||
|
sc.handler_id = id;
|
||||||
|
g_array_append_val(plugin->priv->signal_ids, sc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
39
src/pluginutils.h
Normal file
39
src/pluginutils.h
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* pluginutils.h - this file is part of Geany, a fast and lightweight IDE
|
||||||
|
*
|
||||||
|
* Copyright 2009 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||||
|
* Copyright 2009 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef PLUGINUTILS_H
|
||||||
|
#define PLUGINUTILS_H
|
||||||
|
|
||||||
|
#include "plugindata.h"
|
||||||
|
|
||||||
|
void plugin_add_toolbar_item(GeanyPlugin *plugin, GtkToolItem *item);
|
||||||
|
|
||||||
|
void plugin_module_make_resident(GeanyPlugin *plugin);
|
||||||
|
|
||||||
|
void plugin_signal_connect(GeanyPlugin *plugin,
|
||||||
|
GObject *object, gchar *signal_name, gboolean after,
|
||||||
|
GCallback callback, gpointer user_data);
|
||||||
|
|
||||||
|
#endif /* PLUGINUTILS_H */
|
@ -46,8 +46,9 @@ void sci_set_line_numbers(ScintillaObject * sci, gboolean set, gint extra_width)
|
|||||||
gchar tmp_str[15];
|
gchar tmp_str[15];
|
||||||
gint len = SSM(sci, SCI_GETLINECOUNT, 0, 0);
|
gint len = SSM(sci, SCI_GETLINECOUNT, 0, 0);
|
||||||
gint width;
|
gint width;
|
||||||
|
|
||||||
g_snprintf(tmp_str, 15, "_%d%d", len, extra_width);
|
g_snprintf(tmp_str, 15, "_%d%d", len, extra_width);
|
||||||
width = SSM(sci, SCI_TEXTWIDTH, STYLE_LINENUMBER, (sptr_t) tmp_str);
|
width = sci_text_width(sci, STYLE_LINENUMBER, tmp_str);
|
||||||
SSM (sci, SCI_SETMARGINWIDTHN, 0, width);
|
SSM (sci, SCI_SETMARGINWIDTHN, 0, width);
|
||||||
SSM (sci, SCI_SETMARGINSENSITIVEN, 0, FALSE); /* use default behaviour */
|
SSM (sci, SCI_SETMARGINSENSITIVEN, 0, FALSE); /* use default behaviour */
|
||||||
}
|
}
|
||||||
@ -709,8 +710,12 @@ void sci_set_search_anchor(ScintillaObject *sci)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* removes a selection if pos < 0 */
|
||||||
void sci_set_anchor(ScintillaObject *sci, gint pos)
|
void sci_set_anchor(ScintillaObject *sci, gint pos)
|
||||||
{
|
{
|
||||||
|
if (pos < 0)
|
||||||
|
pos = sci_get_current_position(sci);
|
||||||
|
|
||||||
SSM(sci, SCI_SETANCHOR, pos, 0);
|
SSM(sci, SCI_SETANCHOR, pos, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -863,19 +868,19 @@ void sci_target_from_selection(ScintillaObject *sci)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void sci_target_start(ScintillaObject *sci, gint start)
|
void sci_set_target_start(ScintillaObject *sci, gint start)
|
||||||
{
|
{
|
||||||
SSM(sci, SCI_SETTARGETSTART, start, 0);
|
SSM(sci, SCI_SETTARGETSTART, start, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void sci_target_end(ScintillaObject *sci, gint end)
|
void sci_set_target_end(ScintillaObject *sci, gint end)
|
||||||
{
|
{
|
||||||
SSM(sci, SCI_SETTARGETEND, end, 0);
|
SSM(sci, SCI_SETTARGETEND, end, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
gint sci_target_replace(ScintillaObject *sci, const gchar *text, gboolean regex)
|
gint sci_replace_target(ScintillaObject *sci, const gchar *text, gboolean regex)
|
||||||
{
|
{
|
||||||
return SSM(sci, (regex) ? SCI_REPLACETARGETRE : SCI_REPLACETARGET, (uptr_t) -1, (sptr_t) text);
|
return SSM(sci, (regex) ? SCI_REPLACETARGETRE : SCI_REPLACETARGET, (uptr_t) -1, (sptr_t) text);
|
||||||
}
|
}
|
||||||
@ -1084,4 +1089,17 @@ gint sci_get_position_after(ScintillaObject *sci, gint start)
|
|||||||
return SSM(sci, SCI_POSITIONAFTER, start, 0);
|
return SSM(sci, SCI_POSITIONAFTER, start, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sci_lines_split(ScintillaObject *sci, gint pixelWidth)
|
||||||
|
{
|
||||||
|
SSM(sci, SCI_LINESSPLIT, pixelWidth, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sci_lines_join(ScintillaObject *sci)
|
||||||
|
{
|
||||||
|
SSM(sci, SCI_LINESJOIN, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
gint sci_text_width(ScintillaObject *sci, gint styleNumber, const gchar *text)
|
||||||
|
{
|
||||||
|
return SSM(sci, SCI_TEXTWIDTH, styleNumber, (sptr_t) text);
|
||||||
|
}
|
||||||
|
@ -135,10 +135,12 @@ gchar* sci_get_contents_range (ScintillaObject * sci, gint start, gint end);
|
|||||||
void sci_selection_duplicate (ScintillaObject * sci);
|
void sci_selection_duplicate (ScintillaObject * sci);
|
||||||
void sci_line_duplicate (ScintillaObject * sci);
|
void sci_line_duplicate (ScintillaObject * sci);
|
||||||
void sci_insert_text (ScintillaObject * sci, gint pos, const gchar *text);
|
void sci_insert_text (ScintillaObject * sci, gint pos, const gchar *text);
|
||||||
|
|
||||||
void sci_target_from_selection (ScintillaObject * sci);
|
void sci_target_from_selection (ScintillaObject * sci);
|
||||||
void sci_target_start (ScintillaObject * sci, gint start);
|
void sci_set_target_start (ScintillaObject * sci, gint start);
|
||||||
void sci_target_end (ScintillaObject * sci, gint end);
|
void sci_set_target_end (ScintillaObject * sci, gint end);
|
||||||
gint sci_target_replace (ScintillaObject * sci, const gchar *text, gboolean regex);
|
gint sci_get_target_end (ScintillaObject * sci);
|
||||||
|
gint sci_replace_target (ScintillaObject * sci, const gchar *text, gboolean regex);
|
||||||
|
|
||||||
void sci_set_keywords (ScintillaObject * sci, gint k, gchar *text);
|
void sci_set_keywords (ScintillaObject * sci, gint k, gchar *text);
|
||||||
gint sci_get_lexer (ScintillaObject * sci);
|
gint sci_get_lexer (ScintillaObject * sci);
|
||||||
@ -173,7 +175,10 @@ void sci_set_scroll_stop_at_last_line (ScintillaObject* sci, gboolean set);
|
|||||||
|
|
||||||
void sci_cancel (ScintillaObject *sci);
|
void sci_cancel (ScintillaObject *sci);
|
||||||
|
|
||||||
gint sci_get_target_end (ScintillaObject *sci);
|
|
||||||
gint sci_get_position_after (ScintillaObject *sci, gint start);
|
gint sci_get_position_after (ScintillaObject *sci, gint start);
|
||||||
|
|
||||||
|
void sci_lines_split (ScintillaObject *sci, gint pixelWidth);
|
||||||
|
void sci_lines_join (ScintillaObject *sci);
|
||||||
|
gint sci_text_width (ScintillaObject *sci, int styleNumber, const char * text);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -62,10 +62,7 @@
|
|||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
#include "stash.h"
|
#include "stash.h"
|
||||||
#include "utils.h" /* only for utils_get_setting_*(). Stash should not depend on Geany. */
|
#include "utils.h" /* only for foreach_*, utils_get_setting_*(). Stash should not depend on Geany. */
|
||||||
|
|
||||||
#define foreach_array(type, item, array) \
|
|
||||||
foreach_c_array(item, ((type*)(gpointer)array->data), array->len)
|
|
||||||
|
|
||||||
|
|
||||||
struct GeanyPrefEntry
|
struct GeanyPrefEntry
|
||||||
|
@ -218,14 +218,16 @@ end\n\
|
|||||||
x = StdClass.new\n\
|
x = StdClass.new\n\
|
||||||
";
|
";
|
||||||
|
|
||||||
static const gchar templates_filetype_python[] = "#!/usr/bin/env python\n#\n\
|
static const gchar templates_filetype_python[] = "#!/usr/bin/env python\n\
|
||||||
|
# -*- coding: utf-8 -*-\n#\n\
|
||||||
{fileheader}\n\n\
|
{fileheader}\n\n\
|
||||||
\n\
|
\n\
|
||||||
def main():\n\
|
def main():\n\
|
||||||
\n\
|
\n\
|
||||||
return 0\n\
|
return 0\n\
|
||||||
\n\
|
\n\
|
||||||
if __name__ == '__main__': main()\n\
|
if __name__ == '__main__':\n\
|
||||||
|
main()\n\
|
||||||
";
|
";
|
||||||
|
|
||||||
static const gchar templates_filetype_latex[] = "\
|
static const gchar templates_filetype_latex[] = "\
|
||||||
|
@ -64,6 +64,13 @@
|
|||||||
#define foreach_c_array(item, array, len) \
|
#define foreach_c_array(item, array, len) \
|
||||||
for (item = array; item < &array[len]; item++)
|
for (item = array; item < &array[len]; item++)
|
||||||
|
|
||||||
|
/** Iterates all items in @a array.
|
||||||
|
* @param type Type of @a item.
|
||||||
|
* @param item pointer to item in @a array.
|
||||||
|
* @param array @c GArray to traverse. */
|
||||||
|
#define foreach_array(type, item, array) \
|
||||||
|
foreach_c_array(item, ((type*)(gpointer)array->data), array->len)
|
||||||
|
|
||||||
/** Iterates all the pointers in @a ptr_array.
|
/** Iterates all the pointers in @a ptr_array.
|
||||||
* @param item pointer in @a ptr_array.
|
* @param item pointer in @a ptr_array.
|
||||||
* @param idx @c guint index into @a ptr_array.
|
* @param idx @c guint index into @a ptr_array.
|
||||||
|
24
src/win32.c
24
src/win32.c
@ -644,8 +644,11 @@ gint win32_message_dialog_unsaved(const gchar *msg)
|
|||||||
void win32_open_browser(const gchar *uri)
|
void win32_open_browser(const gchar *uri)
|
||||||
{
|
{
|
||||||
if (strncmp(uri, "file://", 7) == 0)
|
if (strncmp(uri, "file://", 7) == 0)
|
||||||
|
{
|
||||||
uri += 7;
|
uri += 7;
|
||||||
|
while (*uri == '/')
|
||||||
|
uri++;
|
||||||
|
}
|
||||||
ShellExecute(NULL, "open", uri, NULL, NULL, SW_SHOWNORMAL);
|
ShellExecute(NULL, "open", uri, NULL, NULL, SW_SHOWNORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -937,11 +940,23 @@ static gboolean GetContentFromHandle(HANDLE hFile, gchar **content, GError **err
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
gchar *win32_expand_environment_variables(const gchar *str)
|
||||||
|
{
|
||||||
|
gchar expCmdline[32768]; /* 32768 is the limit for ExpandEnvironmentStrings() */
|
||||||
|
|
||||||
|
if (ExpandEnvironmentStrings((LPCTSTR) str, (LPTSTR) expCmdline, sizeof(expCmdline)) != 0)
|
||||||
|
return g_strdup(expCmdline);
|
||||||
|
else
|
||||||
|
return g_strdup(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static gboolean CreateChildProcess(geany_win32_spawn *gw_spawn, TCHAR *szCmdline, const TCHAR *dir, GError **error)
|
static gboolean CreateChildProcess(geany_win32_spawn *gw_spawn, TCHAR *szCmdline, const TCHAR *dir, GError **error)
|
||||||
{
|
{
|
||||||
PROCESS_INFORMATION piProcInfo;
|
PROCESS_INFORMATION piProcInfo;
|
||||||
STARTUPINFO siStartInfo;
|
STARTUPINFO siStartInfo;
|
||||||
BOOL bFuncRetn = FALSE;
|
BOOL bFuncRetn = FALSE;
|
||||||
|
gchar *expandedCmdline;
|
||||||
|
|
||||||
/* Set up members of the PROCESS_INFORMATION structure. */
|
/* Set up members of the PROCESS_INFORMATION structure. */
|
||||||
ZeroMemory(&piProcInfo, sizeof(PROCESS_INFORMATION) );
|
ZeroMemory(&piProcInfo, sizeof(PROCESS_INFORMATION) );
|
||||||
@ -955,9 +970,12 @@ static gboolean CreateChildProcess(geany_win32_spawn *gw_spawn, TCHAR *szCmdline
|
|||||||
siStartInfo.hStdInput = gw_spawn->hChildStdinRd;
|
siStartInfo.hStdInput = gw_spawn->hChildStdinRd;
|
||||||
siStartInfo.dwFlags |= STARTF_USESTDHANDLES;
|
siStartInfo.dwFlags |= STARTF_USESTDHANDLES;
|
||||||
|
|
||||||
|
/* Expand environment variables like %blah%. */
|
||||||
|
expandedCmdline = win32_expand_environment_variables(szCmdline);
|
||||||
|
|
||||||
/* Create the child process. */
|
/* Create the child process. */
|
||||||
bFuncRetn = CreateProcess(NULL,
|
bFuncRetn = CreateProcess(NULL,
|
||||||
szCmdline, /* command line */
|
expandedCmdline, /* command line */
|
||||||
NULL, /* process security attributes */
|
NULL, /* process security attributes */
|
||||||
NULL, /* primary thread security attributes */
|
NULL, /* primary thread security attributes */
|
||||||
TRUE, /* handles are inherited */
|
TRUE, /* handles are inherited */
|
||||||
@ -967,6 +985,8 @@ static gboolean CreateChildProcess(geany_win32_spawn *gw_spawn, TCHAR *szCmdline
|
|||||||
&siStartInfo, /* STARTUPINFO pointer */
|
&siStartInfo, /* STARTUPINFO pointer */
|
||||||
&piProcInfo); /* receives PROCESS_INFORMATION */
|
&piProcInfo); /* receives PROCESS_INFORMATION */
|
||||||
|
|
||||||
|
g_free(expandedCmdline);
|
||||||
|
|
||||||
if (bFuncRetn == 0)
|
if (bFuncRetn == 0)
|
||||||
{
|
{
|
||||||
gchar *msg = g_win32_error_message(GetLastError());
|
gchar *msg = g_win32_error_message(GetLastError());
|
||||||
|
@ -63,4 +63,6 @@ gchar *win32_get_shortcut_target(const gchar *file_name);
|
|||||||
|
|
||||||
gchar *win32_get_installation_dir(void);
|
gchar *win32_get_installation_dir(void);
|
||||||
|
|
||||||
|
gchar *win32_expand_environment_variables(const gchar *str);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -51,6 +51,7 @@ libtagmanager_a_SOURCES =\
|
|||||||
latex.c\
|
latex.c\
|
||||||
lregex.c\
|
lregex.c\
|
||||||
matlab.c\
|
matlab.c\
|
||||||
|
markdown.c\
|
||||||
pascal.c\
|
pascal.c\
|
||||||
perl.c\
|
perl.c\
|
||||||
rest.c\
|
rest.c\
|
||||||
|
@ -43,7 +43,7 @@ $(COMPLIB): args.o c.o fortran.o make.o conf.o pascal.o perl.o php.o diff.o vhdl
|
|||||||
actionscript.o nsis.o \
|
actionscript.o nsis.o \
|
||||||
haskell.o haxe.o html.o python.o lregex.o rest.o sh.o ctags.o entry.o get.o keyword.o nestlevel.o \
|
haskell.o haxe.o html.o python.o lregex.o rest.o sh.o ctags.o entry.o get.o keyword.o nestlevel.o \
|
||||||
options.o \
|
options.o \
|
||||||
parse.o basic.o read.o sort.o strlist.o latex.o matlab.o docbook.o tcl.o ruby.o asm.o sql.o css.o \
|
parse.o basic.o read.o sort.o strlist.o latex.o markdown.o matlab.o docbook.o tcl.o ruby.o asm.o sql.o css.o \
|
||||||
vstring.o regex.o tm_workspace.o tm_work_object.o tm_source_file.o tm_project.o tm_tag.o \
|
vstring.o regex.o tm_workspace.o tm_work_object.o tm_source_file.o tm_project.o tm_tag.o \
|
||||||
tm_symbol.o tm_file_entry.o tm_tagmanager.o
|
tm_symbol.o tm_file_entry.o tm_tagmanager.o
|
||||||
$(AR) rc $@ $^
|
$(AR) rc $@ $^
|
||||||
|
105
tagmanager/markdown.c
Normal file
105
tagmanager/markdown.c
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009, Jon Strait
|
||||||
|
*
|
||||||
|
* This source code is released for free distribution under the terms of the
|
||||||
|
* GNU General Public License.
|
||||||
|
*
|
||||||
|
* This module contains functions for generating tags for Markdown files.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* INCLUDE FILES
|
||||||
|
*/
|
||||||
|
#include "general.h" /* must always come first */
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "parse.h"
|
||||||
|
#include "read.h"
|
||||||
|
#include "vstring.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* DATA DEFINITIONS
|
||||||
|
*/
|
||||||
|
|
||||||
|
static kindOption MarkdownKinds[] = {
|
||||||
|
{ TRUE, 'v', "variable", "sections" }
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* FUNCTION DEFINITIONS
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* checks if str is all the same character */
|
||||||
|
static boolean issame(const char *str)
|
||||||
|
{
|
||||||
|
char first = *str;
|
||||||
|
|
||||||
|
while (*(++str))
|
||||||
|
{
|
||||||
|
if (*str && *str != first)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void makeMarkdownTag (const vString* const name, boolean name_before)
|
||||||
|
{
|
||||||
|
tagEntryInfo e;
|
||||||
|
initTagEntry (&e, vStringValue(name));
|
||||||
|
|
||||||
|
if (name_before)
|
||||||
|
e.lineNumber--; /* we want the line before the underline chars */
|
||||||
|
e.kindName = "variable";
|
||||||
|
e.kind = 'v';
|
||||||
|
|
||||||
|
makeTagEntry(&e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void findMarkdownTags (void)
|
||||||
|
{
|
||||||
|
vString *name = vStringNew();
|
||||||
|
const unsigned char *line;
|
||||||
|
|
||||||
|
while ((line = fileReadLine()) != NULL)
|
||||||
|
{
|
||||||
|
int name_len = vStringLength(name);
|
||||||
|
|
||||||
|
/* underlines must be the same length or more */
|
||||||
|
if (name_len > 0 && (line[0] == '=' || line[0] == '-') && issame((const char*) line))
|
||||||
|
{
|
||||||
|
makeMarkdownTag(name, TRUE);
|
||||||
|
}
|
||||||
|
else if (line[0] == '#') {
|
||||||
|
vStringClear(name);
|
||||||
|
vStringCatS(name, (const char *) line);
|
||||||
|
vStringTerminate(name);
|
||||||
|
makeMarkdownTag(name, FALSE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
vStringClear (name);
|
||||||
|
if (! isspace(*line))
|
||||||
|
vStringCatS(name, (const char*) line);
|
||||||
|
vStringTerminate(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vStringDelete (name);
|
||||||
|
}
|
||||||
|
|
||||||
|
extern parserDefinition* MarkdownParser (void)
|
||||||
|
{
|
||||||
|
static const char *const patterns [] = { "*.md", NULL };
|
||||||
|
static const char *const extensions [] = { "md", NULL };
|
||||||
|
parserDefinition* const def = parserNew ("Markdown");
|
||||||
|
|
||||||
|
def->kinds = MarkdownKinds;
|
||||||
|
def->kindCount = KIND_COUNT (MarkdownKinds);
|
||||||
|
def->patterns = patterns;
|
||||||
|
def->extensions = extensions;
|
||||||
|
def->parser = findMarkdownTags;
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
|
@ -50,8 +50,8 @@
|
|||||||
MatlabParser, \
|
MatlabParser, \
|
||||||
ValaParser, \
|
ValaParser, \
|
||||||
ActionScriptParser, \
|
ActionScriptParser, \
|
||||||
NsisParser
|
NsisParser, \
|
||||||
|
MarkdownParser
|
||||||
/*
|
/*
|
||||||
langType of each parser
|
langType of each parser
|
||||||
0 CParser
|
0 CParser
|
||||||
@ -90,6 +90,7 @@ langType of each parser
|
|||||||
33 ValaParser
|
33 ValaParser
|
||||||
34 ActionScriptParser
|
34 ActionScriptParser
|
||||||
35 NsisParser
|
35 NsisParser
|
||||||
|
36 MarkdownParser
|
||||||
*/
|
*/
|
||||||
#endif /* _PARSERS_H */
|
#endif /* _PARSERS_H */
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@
|
|||||||
/* #undef volatile */
|
/* #undef volatile */
|
||||||
|
|
||||||
/* Version number of package */
|
/* Version number of package */
|
||||||
#define VERSION "0.18"
|
#define VERSION "0.19"
|
||||||
|
|
||||||
#define REVISION "-1"
|
#define REVISION "-1"
|
||||||
|
|
||||||
|
64
wscript
64
wscript
@ -35,17 +35,26 @@ Missing features: --enable-binreloc, make targets: dist, pdf (in doc/)
|
|||||||
Known issues: Dependency handling is buggy, e.g. if src/document.h is
|
Known issues: Dependency handling is buggy, e.g. if src/document.h is
|
||||||
changed, depending source files are not rebuilt (maybe Waf bug).
|
changed, depending source files are not rebuilt (maybe Waf bug).
|
||||||
|
|
||||||
|
The code of this file itself loosely follows PEP 8 with some exceptions
|
||||||
|
(line width 100 characters and some other minor things).
|
||||||
|
|
||||||
Requires WAF 1.5.7 and Python 2.4 (or later).
|
Requires WAF 1.5.7 and Python 2.4 (or later).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import Build, Configure, Options, Utils
|
import Build
|
||||||
import sys, os, shutil, tempfile
|
import Configure
|
||||||
|
import Options
|
||||||
|
import Utils
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import tempfile
|
||||||
from distutils import version
|
from distutils import version
|
||||||
|
|
||||||
|
|
||||||
APPNAME = 'geany'
|
APPNAME = 'geany'
|
||||||
VERSION = '0.18'
|
VERSION = '0.19'
|
||||||
|
|
||||||
srcdir = '.'
|
srcdir = '.'
|
||||||
blddir = '_build_'
|
blddir = '_build_'
|
||||||
@ -58,7 +67,7 @@ tagmanager_sources = [
|
|||||||
'tagmanager/docbook.c', 'tagmanager/entry.c', 'tagmanager/fortran.c', 'tagmanager/get.c',
|
'tagmanager/docbook.c', 'tagmanager/entry.c', 'tagmanager/fortran.c', 'tagmanager/get.c',
|
||||||
'tagmanager/haskell.c', 'tagmanager/haxe.c', 'tagmanager/html.c', 'tagmanager/js.c',
|
'tagmanager/haskell.c', 'tagmanager/haxe.c', 'tagmanager/html.c', 'tagmanager/js.c',
|
||||||
'tagmanager/keyword.c', 'tagmanager/latex.c', 'tagmanager/lregex.c', 'tagmanager/lua.c',
|
'tagmanager/keyword.c', 'tagmanager/latex.c', 'tagmanager/lregex.c', 'tagmanager/lua.c',
|
||||||
'tagmanager/make.c', 'tagmanager/matlab.c', 'tagmanager/nsis.c',
|
'tagmanager/make.c', 'tagmanager/markdown.c', 'tagmanager/matlab.c', 'tagmanager/nsis.c',
|
||||||
'tagmanager/nestlevel.c', 'tagmanager/options.c',
|
'tagmanager/nestlevel.c', 'tagmanager/options.c',
|
||||||
'tagmanager/parse.c', 'tagmanager/pascal.c',
|
'tagmanager/parse.c', 'tagmanager/pascal.c',
|
||||||
'tagmanager/perl.c', 'tagmanager/php.c', 'tagmanager/python.c', 'tagmanager/read.c',
|
'tagmanager/perl.c', 'tagmanager/php.c', 'tagmanager/python.c', 'tagmanager/read.c',
|
||||||
@ -73,15 +82,18 @@ scintilla_sources = [
|
|||||||
'scintilla/CharClassify.cxx', 'scintilla/ContractionState.cxx', 'scintilla/Decoration.cxx',
|
'scintilla/CharClassify.cxx', 'scintilla/ContractionState.cxx', 'scintilla/Decoration.cxx',
|
||||||
'scintilla/DocumentAccessor.cxx', 'scintilla/Document.cxx', 'scintilla/Editor.cxx',
|
'scintilla/DocumentAccessor.cxx', 'scintilla/Document.cxx', 'scintilla/Editor.cxx',
|
||||||
'scintilla/ExternalLexer.cxx', 'scintilla/Indicator.cxx', 'scintilla/KeyMap.cxx',
|
'scintilla/ExternalLexer.cxx', 'scintilla/Indicator.cxx', 'scintilla/KeyMap.cxx',
|
||||||
'scintilla/KeyWords.cxx', 'scintilla/LexAda.cxx', 'scintilla/LexAsm.cxx', 'scintilla/LexBash.cxx',
|
'scintilla/KeyWords.cxx',
|
||||||
|
'scintilla/LexAda.cxx', 'scintilla/LexAsm.cxx', 'scintilla/LexBash.cxx',
|
||||||
'scintilla/LexBasic.cxx', 'scintilla/LexCaml.cxx', 'scintilla/LexCmake.cxx', 'scintilla/LexCPP.cxx',
|
'scintilla/LexBasic.cxx', 'scintilla/LexCaml.cxx', 'scintilla/LexCmake.cxx', 'scintilla/LexCPP.cxx',
|
||||||
'scintilla/LexCrontab.cxx', 'scintilla/LexCSS.cxx', 'scintilla/LexD.cxx',
|
'scintilla/LexCrontab.cxx', 'scintilla/LexCSS.cxx', 'scintilla/LexD.cxx',
|
||||||
'scintilla/LexFortran.cxx', 'scintilla/LexHaskell.cxx', 'scintilla/LexHTML.cxx',
|
'scintilla/LexFortran.cxx', 'scintilla/LexHaskell.cxx', 'scintilla/LexHTML.cxx',
|
||||||
'scintilla/LexLua.cxx', 'scintilla/LexNsis.cxx', 'scintilla/LexOthers.cxx',
|
'scintilla/LexLua.cxx', 'scintilla/LexMarkdown.cxx', 'scintilla/LexMatlab.cxx',
|
||||||
|
'scintilla/LexNsis.cxx', 'scintilla/LexOthers.cxx',
|
||||||
'scintilla/LexPascal.cxx', 'scintilla/LexPerl.cxx', 'scintilla/LexPython.cxx',
|
'scintilla/LexPascal.cxx', 'scintilla/LexPerl.cxx', 'scintilla/LexPython.cxx',
|
||||||
'scintilla/LexR.cxx', 'scintilla/LexMatlab.cxx', 'scintilla/LexYAML.cxx',
|
'scintilla/LexR.cxx',
|
||||||
'scintilla/LexRuby.cxx', 'scintilla/LexSQL.cxx', 'scintilla/LexTCL.cxx',
|
'scintilla/LexRuby.cxx', 'scintilla/LexSQL.cxx', 'scintilla/LexTCL.cxx',
|
||||||
'scintilla/LexVHDL.cxx', 'scintilla/LineMarker.cxx', 'scintilla/PerLine.cxx',
|
'scintilla/LexVHDL.cxx', 'scintilla/LexYAML.cxx',
|
||||||
|
'scintilla/LineMarker.cxx', 'scintilla/PerLine.cxx',
|
||||||
'scintilla/PlatGTK.cxx',
|
'scintilla/PlatGTK.cxx',
|
||||||
'scintilla/PositionCache.cxx', 'scintilla/PropSet.cxx', 'scintilla/RESearch.cxx',
|
'scintilla/PositionCache.cxx', 'scintilla/PropSet.cxx', 'scintilla/RESearch.cxx',
|
||||||
'scintilla/RunStyles.cxx', 'scintilla/ScintillaBase.cxx', 'scintilla/ScintillaGTK.cxx',
|
'scintilla/RunStyles.cxx', 'scintilla/ScintillaBase.cxx', 'scintilla/ScintillaGTK.cxx',
|
||||||
@ -95,7 +107,7 @@ geany_sources = [
|
|||||||
'src/geanymenubuttonaction.c', 'src/geanyobject.c', 'src/geanywraplabel.c',
|
'src/geanymenubuttonaction.c', 'src/geanyobject.c', 'src/geanywraplabel.c',
|
||||||
'src/highlighting.c', 'src/interface.c', 'src/keybindings.c',
|
'src/highlighting.c', 'src/interface.c', 'src/keybindings.c',
|
||||||
'src/keyfile.c', 'src/log.c', 'src/main.c', 'src/msgwindow.c', 'src/navqueue.c', 'src/notebook.c',
|
'src/keyfile.c', 'src/log.c', 'src/main.c', 'src/msgwindow.c', 'src/navqueue.c', 'src/notebook.c',
|
||||||
'src/plugins.c', 'src/prefix.c', 'src/prefs.c', 'src/printing.c', 'src/project.c',
|
'src/plugins.c', 'src/pluginutils.c', 'src/prefix.c', 'src/prefs.c', 'src/printing.c', 'src/project.c',
|
||||||
'src/queue.c', 'src/sciwrappers.c', 'src/search.c', 'src/socket.c', 'src/stash.c',
|
'src/queue.c', 'src/sciwrappers.c', 'src/search.c', 'src/socket.c', 'src/stash.c',
|
||||||
'src/symbols.c',
|
'src/symbols.c',
|
||||||
'src/templates.c', 'src/toolbar.c', 'src/tools.c', 'src/treeviews.c',
|
'src/templates.c', 'src/toolbar.c', 'src/tools.c', 'src/treeviews.c',
|
||||||
@ -261,7 +273,8 @@ def configure(conf):
|
|||||||
|
|
||||||
conf.env.append_value('CCFLAGS', '-DHAVE_CONFIG_H')
|
conf.env.append_value('CCFLAGS', '-DHAVE_CONFIG_H')
|
||||||
# Scintilla flags
|
# Scintilla flags
|
||||||
conf.env.append_value('CXXFLAGS', '-DNDEBUG -DGTK -DGTK2 -DSCI_LEXER -DG_THREADS_IMPL_NONE'.split())
|
conf.env.append_value('CXXFLAGS',
|
||||||
|
'-DNDEBUG -DGTK -DGTK2 -DSCI_LEXER -DG_THREADS_IMPL_NONE'.split())
|
||||||
|
|
||||||
|
|
||||||
def set_options(opt):
|
def set_options(opt):
|
||||||
@ -274,9 +287,11 @@ def set_options(opt):
|
|||||||
opt.add_option('--disable-plugins', action='store_true', default=False,
|
opt.add_option('--disable-plugins', action='store_true', default=False,
|
||||||
help='compile without plugin support [default: No]', dest='no_plugins')
|
help='compile without plugin support [default: No]', dest='no_plugins')
|
||||||
opt.add_option('--disable-socket', action='store_true', default=False,
|
opt.add_option('--disable-socket', action='store_true', default=False,
|
||||||
help='compile without support to detect a running instance [[default: No]', dest='no_socket')
|
help='compile without support to detect a running instance [[default: No]',
|
||||||
|
dest='no_socket')
|
||||||
opt.add_option('--disable-vte', action='store_true', default=target_is_win32(os.environ),
|
opt.add_option('--disable-vte', action='store_true', default=target_is_win32(os.environ),
|
||||||
help='compile without support for an embedded virtual terminal [[default: No]', dest='no_vte')
|
help='compile without support for an embedded virtual terminal [[default: No]',
|
||||||
|
dest='no_vte')
|
||||||
opt.add_option('--enable-gnu-regex', action='store_true', default=False,
|
opt.add_option('--enable-gnu-regex', action='store_true', default=False,
|
||||||
help='compile with included GNU regex library [default: No]', dest='gnu_regex')
|
help='compile with included GNU regex library [default: No]', dest='gnu_regex')
|
||||||
# Paths
|
# Paths
|
||||||
@ -289,6 +304,8 @@ def set_options(opt):
|
|||||||
# Actions
|
# Actions
|
||||||
opt.add_option('--htmldoc', action='store_true', default=False,
|
opt.add_option('--htmldoc', action='store_true', default=False,
|
||||||
help='generate HTML documentation', dest='htmldoc')
|
help='generate HTML documentation', dest='htmldoc')
|
||||||
|
opt.add_option('--hackingdoc', action='store_true', default=False,
|
||||||
|
help='generate HTML documentation from HACKING file', dest='hackingdoc')
|
||||||
opt.add_option('--apidoc', action='store_true', default=False,
|
opt.add_option('--apidoc', action='store_true', default=False,
|
||||||
help='generate API reference documentation', dest='apidoc')
|
help='generate API reference documentation', dest='apidoc')
|
||||||
opt.add_option('--update-po', action='store_true', default=False,
|
opt.add_option('--update-po', action='store_true', default=False,
|
||||||
@ -469,9 +486,9 @@ def build(bld):
|
|||||||
html_dir = '' if is_win32 else 'html/'
|
html_dir = '' if is_win32 else 'html/'
|
||||||
html_name = 'Manual.html' if is_win32 else 'index.html'
|
html_name = 'Manual.html' if is_win32 else 'index.html'
|
||||||
for f in 'AUTHORS ChangeLog COPYING README NEWS THANKS TODO'.split():
|
for f in 'AUTHORS ChangeLog COPYING README NEWS THANKS TODO'.split():
|
||||||
bld.install_as("%s/%s%s" % (base_dir, ucFirst(f, is_win32), ext), f)
|
bld.install_as("%s/%s%s" % (base_dir, uc_first(f, is_win32), ext), f)
|
||||||
bld.install_files('${DOCDIR}/%simages' % html_dir, 'doc/images/*.png')
|
bld.install_files('${DOCDIR}/%simages' % html_dir, 'doc/images/*.png')
|
||||||
bld.install_as('${DOCDIR}/%s' % ucFirst('manual.txt', is_win32), 'doc/geany.txt')
|
bld.install_as('${DOCDIR}/%s' % uc_first('manual.txt', is_win32), 'doc/geany.txt')
|
||||||
bld.install_as('${DOCDIR}/%s%s' % (html_dir, html_name), 'doc/geany.html')
|
bld.install_as('${DOCDIR}/%s%s' % (html_dir, html_name), 'doc/geany.html')
|
||||||
bld.install_as('${DOCDIR}/ScintillaLicense.txt', 'scintilla/License.txt')
|
bld.install_as('${DOCDIR}/ScintillaLicense.txt', 'scintilla/License.txt')
|
||||||
if is_win32:
|
if is_win32:
|
||||||
@ -495,7 +512,8 @@ def build(bld):
|
|||||||
def shutdown():
|
def shutdown():
|
||||||
is_win32 = False if not Build.bld else target_is_win32(Build.bld.env)
|
is_win32 = False if not Build.bld else target_is_win32(Build.bld.env)
|
||||||
# the following code was taken from midori's WAF script, thanks
|
# the following code was taken from midori's WAF script, thanks
|
||||||
if not is_win32 and not Options.options.destdir and (Options.commands['install'] or Options.commands['uninstall']):
|
if not is_win32 and not Options.options.destdir and (Options.commands['install'] or \
|
||||||
|
Options.commands['uninstall']):
|
||||||
dir = Build.bld.get_install_path('${DATADIR}/icons/hicolor')
|
dir = Build.bld.get_install_path('${DATADIR}/icons/hicolor')
|
||||||
icon_cache_updated = False
|
icon_cache_updated = False
|
||||||
try:
|
try:
|
||||||
@ -519,15 +537,23 @@ def shutdown():
|
|||||||
'doxygen could not be found. Please install the doxygen package.')
|
'doxygen could not be found. Please install the doxygen package.')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if Options.options.htmldoc:
|
if Options.options.htmldoc or Options.options.hackingdoc:
|
||||||
# first try rst2html.py as it is the upstream default, fall back to rst2html
|
# first try rst2html.py as it is the upstream default, fall back to rst2html
|
||||||
cmd = Configure.find_program_impl(Build.bld.env, 'rst2html.py')
|
cmd = Configure.find_program_impl(Build.bld.env, 'rst2html.py')
|
||||||
if not cmd:
|
if not cmd:
|
||||||
cmd = Configure.find_program_impl(Build.bld.env, 'rst2html')
|
cmd = Configure.find_program_impl(Build.bld.env, 'rst2html')
|
||||||
if cmd:
|
if cmd:
|
||||||
|
if Options.options.hackingdoc:
|
||||||
|
file_in = '../HACKING'
|
||||||
|
file_out = 'hacking.html'
|
||||||
|
msg = 'HACKING HTML'
|
||||||
|
else:
|
||||||
|
file_in = 'geany.txt'
|
||||||
|
file_out = 'geany.html'
|
||||||
|
msg = 'HTML'
|
||||||
os.chdir('doc')
|
os.chdir('doc')
|
||||||
ret = launch(cmd + ' -stg --stylesheet=geany.css geany.txt geany.html',
|
ret = launch(cmd + ' -stg --stylesheet=geany.css %s %s' % (file_in, file_out),
|
||||||
'Generating HTML documentation')
|
'Generating %s documentation' % msg)
|
||||||
else:
|
else:
|
||||||
Utils.pprint('RED',
|
Utils.pprint('RED',
|
||||||
'rst2html.py could not be found. Please install the Python docutils package.')
|
'rst2html.py could not be found. Please install the Python docutils package.')
|
||||||
@ -576,7 +602,7 @@ def print_message(conf, msg, result, color = 'GREEN'):
|
|||||||
conf.check_message_2(result, color)
|
conf.check_message_2(result, color)
|
||||||
|
|
||||||
|
|
||||||
def ucFirst(s, is_win32):
|
def uc_first(s, is_win32):
|
||||||
if is_win32:
|
if is_win32:
|
||||||
return s.title()
|
return s.title()
|
||||||
return s
|
return s
|
||||||
|
Loading…
x
Reference in New Issue
Block a user